PageSourceSearch

https://app.farmdok.com/farm/js/app.aadf06db.js

js farmdok.com collected 2026-10-04 17:59:28 UTC 2,256,376 bytes, 2 lines download raw bytes

vendor: 7,330 bytes, line 1
1(function(){var e={54125:function(e,t,i){var a={"./af":2525,"./af.js":2525,"./ar":89102,"./ar-dz":63778,"./ar-dz.js":63778,"./ar-kw":10960,"./ar-kw.js":10960,"./ar-ly":81490,"./ar-ly.js":81490,"./ar-ma":85507,"./ar-ma.js":85507,"./ar-sa":24042,"./ar-sa.js":24042,"./ar-tn":91523,"./ar-tn.js":91523,"./ar.js":89102,"./az":38365,"./az.js":38365,"./be":44860,"./be.js":44860,"./bg":9904,"./bg.js":9904,"./bm":60952,"./bm.js":60952,"./bn":9807,"./bn.js":9807,"./bo":58437,"./bo.js":58437,"./br":84557,"./br.js":84557,"./bs":79332,"./bs.js":79332,"./ca":93667,"./ca.js":93667,"./cs":76860,"./cs.js":76860,"./cv":15427,"./cv.js":15427,"./cy":58863,"./cy.js":58863,"./da":13520,"./da.js":13520,"./de":12111,"./de-at":30464,"./de-at.js":30464,"./de-ch":50701,"./de-ch.js":50701,"./de.js":12111,"./dv":94438,"./dv.js":94438,"./el":33121,"./el.js":33121,"./en-SG":82406,"./en-SG.js":82406,"./en-au":49197,"./en-au.js":49197,"./en-ca":53885,"./en-ca.js":53885,"./en-gb":51914,"./en-gb.js":51914,"./en-ie":80938,"./en-ie.js":80938,"./en-il":25438,"./en-il.js":25438,"./en-nz":19722,"./en-nz.js":19722,"./eo":42783,"./eo.js":42783,"./es":56820,"./es-do":59651,"./es-do.js":59651,"./es-us":46018,"./es-us.js":46018,"./es.js":56820,"./et":18686,"./et.js":18686,"./eu":31323,"./eu.js":31323,"./fa":61885,"./fa.js":61885,"./fi":63741,"./fi.js":63741,"./fo":19961,"./fo.js":19961,"./fr":2800,"./fr-ca":88121,"./fr-ca.js":88121,"./fr-ch":27979,"./fr-ch.js":27979,"./fr.js":2800,"./fy":28930,"./fy.js":28930,"./ga":22591,"./ga.js":22591,"./gd":95513,"./gd.js":95513,"./gl":24485,"./gl.js":24485,"./gom-latn":3878,"./gom-latn.js":3878,"./gu":25435,"./gu.js":25435,"./he":62825,"./he.js":62825,"./hi":27282,"./hi.js":27282,"./hr":2438,"./hr.js":2438,"./hu":91310,"./hu.js":91310,"./hy-am":14794,"./hy-am.js":14794,"./id":8761,"./id.js":8761,"./is":56593,"./is.js":56593,"./it":72196,"./it-ch":38111,"./it-ch.js":38111,"./it.js":72196,"./ja":12645,"./ja.js":12645,"./jv":71869,"./jv.js":71869,"./ka":74093,"./ka.js":74093,"./kk":19794,"./kk.js":19794,"./km":92637,"./km.js":92637,"./kn":28684,"./kn.js":28684,"./ko":94565,"./ko.js":94565,"./ku":2773,"./ku.js":2773,"./ky":65606,"./ky.js":65606,"./lb":72027,"./lb.js":72027,"./lo":80366,"./lo.js":80366,"./lt":27311,"./lt.js":27311,"./lv":31851,"./lv.js":31851,"./me":52700,"./me.js":52700,"./mi":73575,"./mi.js":73575,"./mk":95509,"./mk.js":95509,"./ml":29866,"./ml.js":29866,"./mn":89072,"./mn.js":89072,"./mr":13798,"./mr.js":13798,"./ms":26848,"./ms-my":1212,"./ms-my.js":1212,"./ms.js":26848,"./mt":63181,"./mt.js":63181,"./my":63977,"./my.js":63977,"./nb":47248,"./nb.js":47248,"./ne":91859,"./ne.js":91859,"./nl":27058,"./nl-be":66901,"./nl-be.js":66901,"./nl.js":27058,"./nn":61748,"./nn.js":61748,"./pa-in":34266,"./pa-in.js":34266,"./pl":79581,"./pl.js":79581,"./pt":87410,"./pt-br":6114,"./pt-br.js":6114,"./pt.js":87410,"./ro":38295,"./ro.js":38295,"./ru":39862,"./ru.js":39862,"./sd":59548,"./sd.js":59548,"./se":93236,"./se.js":93236,"./si":40289,"./si.js":40289,"./sk":58339,"./sk.js":58339,"./sl":74170,"./sl.js":74170,"./sq":15316,"./sq.js":15316,"./sr":68791,"./sr-cyrl":47630,"./sr-cyrl.js":47630,"./sr.js":68791,"./ss":65773,"./ss.js":65773,"./sv":31159,"./sv.js":31159,"./sw":22329,"./sw.js":22329,"./ta":67054,"./ta.js":67054,"./te":71280,"./te.js":71280,"./tet":54120,"./tet.js":54120,"./tg":37678,"./tg.js":37678,"./th":54679,"./th.js":54679,"./tl-ph":63270,"./tl-ph.js":63270,"./tlh":45386,"./tlh.js":45386,"./tr":64669,"./tr.js":64669,"./tzl":91434,"./tzl.js":91434,"./tzm":57217,"./tzm-latn":47665,"./tzm-latn.js":47665,"./tzm.js":57217,"./ug-cn":24956,"./ug-cn.js":24956,"./uk":69596,"./uk.js":69596,"./ur":85133,"./ur.js":85133,"./uz":49456,"./uz-latn":78737,"./uz-latn.js":78737,"./uz.js":49456,"./vi":5577,"./vi.js":5577,"./x-pseudo":64564,"./x-pseudo.js":64564,"./yo":68854,"./yo.js":68854,"./zh-cn":95817,"./zh-cn.js":95817,"./zh-hk":66634,"./zh-hk.js":66634,"./zh-tw":49292,"./zh-tw.js":49292};function n(e){var t=r(e);return i(t)}function r(e){if(!i.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=r,e.exports=n,n.id=54125},46700:function(e,t,i){var a={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se"
1:10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function n(e){var t=r(e);return i(t)}function r(e){if(!i.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=r,e.exports=n,n.id=46700},99315:function(e,t,i){"use strict";var a={};i.r(a);var n={};i.r(n),i.d(n,{calcBasicSeedStrengthFromManualSeedrate:function(){return Km},calcHeatmapColors:function(){return qm},calcKDiffFromManualSeedrate:function(){return Zm},findMaterialBasedOnSelectedFields:function(){return af},findMaterialBasedOnVariety:function(){return tf},formatVarietyForDropdown:function(){return of},getCropName:function(){return Wm},getFirstSelectedField:function(){return ef},getMostFrequentWorkflowVarietyInFields:function(){return rf}});var r={};i.r(r),i.d(r,{Z:function(){return ES}});var s=i(57810),o=i(9669),l=i.n(o),d=i(71518),c=i(68793),u=i(15193),p=i(18365),h=i(48764),m=(i(95474),i(96245)),f=i(30381),g=i.n(f),y=i(25287),v=i.n(y),b=i(20144),w=i(66531),C=i(20629);function F(e){return!!e.errorCode||Array.isArray(e.errorUserMessage)}function A(e){const t={status:k(e),data:S(e)};if("success"!==t.status){const{errorCode:i,errorUserMessage:a}=E(e);t.errorCode=i.join(", "),t.errorUserMessage=a}return t}function k(e){if(e.find((e=>"error"===e.status)))return"error";if(e.find((e=>"partialSuccess"===e.status)))return"partialSuccess";if(e.every((e=>"success"===e.status)))return"success";const t=e.find((e=>"success"!==e.status&&"partialSuccess"!==e.status&&"error"!==e.status));throw new Error(`Unsupported response status: ${t?.status}`)}function S(e){const t=e.reduce(((e,t)=>t.data?[...e,...t.data]:e),[]);return t}function E(e){const t=e.reduce(((e,t)=>(F(t)&&t.errorCode&&e.push(t.errorCode),e)),[]),i=e.reduce(((e,t)=>(F(t)&&t.errorUserMessage&&e.push(...t.errorUserMessage),e)),[]);return{errorCode:t,errorUserMessage:i}}i(82801);function I(e){return["success","partialSuccess","error"].includes(e.status)&&"number"===typeof e.page&&"number"===typeof e.itemsPerPage&&"number"===typeof e.total}var _=i(72378),D=i.n(_);const M=(()=>{if("object"===typeof window.FD&&"string"===typeof window.FD.appWebclientUri&&window.FD.appWebclientUri.length>0)try{return new URL(window.FD.appWebclientUri).pathname}catch(e){}return"/farm/"})(),P=window.location.origin,T=P.replace("://","://m."),x=((()=>{if("object"===typeof window.FD&&"string"===typeof window.FD.appWebclientUri&&window.FD.appWebclientUri.length>0)try{return new URL(window.FD.appWebclientUri).origin}catch(e){}"".length>0||window.location.origin})(),"AIzaSyA8F_fPvskHkZaOykCyDNKbQAEJkljNKBY"),B="3ac83-2345c-e48b3-6432f-26032";var O;(function(e){e["PRIMARY"]="rgb(60, 201, 97)",e["SECONDARY"]="rgb(55, 151, 174)",e["DANGER"]="rgb(255, 97, 76)",e["DANGER_DARK"]="rgb(224, 73, 53)",e["WARNING"]="rgb(215, 147, 14)",e["WHITE"]="rgb(255, 255, 255)",e["LIGHTEST"]="rgb(247, 247, 247)",e["MEDIUM"]="rgb(222, 222, 222)",e["DARK"]="rgb(72, 67, 92)",e["BLACK"]="rgb(19, 53, 60)"})(O||(O={}));const $={ENTER:"Enter",ESCAPE:"Escape",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},R="id",N=Symbol("ENTRY_NEW"),z=Symbol("ENTRY_INSERTING"),L=Symbol("ENTRY_ERROR_INSERTING"),V=Symbol("ENTRY_SYNCED"),U=Symbol("ENTRY_DIRTY"),j=Symbol("ENTRY_UPDATING"),H=Symbol("ENTRY_ERROR_UPDATING"),G=Symbol("ENTRY_TO_REMOVE"),W=Symbol("ENTRY_REMOVING"),Z=Symbol("ENTRY_REMOVED"),K=Symbol("ENTRY_RECENTLY_RESTORED"),q=(Symbol("ROW_FOOTER"),Symbol("ERROR_FETCHING")),Y=Symbol("ERROR_INSERTING"),J=Symbol("ERROR_UPDATING"),X={POLYGON_DISABLED_STROKE_COLOR:"#828282",POLYGON_DISABLED_FILL_COLOR:"#828282",POLYGON_VISIBLE_STROKE_COLOR:"#000000",POLYGON_VISIBLE_FILL_COLOR:"#000000",POLYGON_ACTIVE_STROKE_COLOR:"#3CC961",POLYGON_ACTIVE_FILL_COLOR:"#3CC961",POLYGON_ACTIVE_HOVER_COLOR:"#81D897",POLYGON_DEFAULT_STROKE_COLOR:"#000",POLYGON_DEFAULT_FILL_COLOR:"#13353C",POLYGON_INVALID_COLOR:"#f54242",POLYLINE_ISOLATION_ZONE_COLOR:"#FF9B8D",POLYLINE_MULTIPLIER_GROUP_COLOR:"#3797AE",GOOGLE_MAPS_DEFAULT_CENTER:{center:{lat:47.561838,lng:14.633302},zoom:9},MEASURE_DISTANCE_LINE_COLOR:"#64BDD2"},Q={HA:"BE031F28-01B8-11E7-BE5A-08606E6810DA"},ee={AT:"3C52DB9A-6337-11E7-8CCD-08606E6810DA",DE:"71C1454A-6337-11E7-8CCD-08606E6810DA",SI:"CB156A8A-BFFD-11E8-A355-529269FB1459"};var te;(function(e){e["AT"]="3C52DB9A-6337-11E7-8CCD-08606E6810DA",e["DE"]="71C1454A-6337-11E7-8CCD-08606E6810DA",e["SI"]="CB156A8A-BFFD-11E8-A355-529269FB1459"})(te||(te={}));const ie={SEED_MAIN:"BDF13D42-01B8-11E7-BE5A-08606E6810DA",SEED_CATCH_CROP:"BDF13EFF-01B8-11E7-BE5A-08606E6810DA",FEMI:"BDF140A3-01B8-11E7-BE5A-08606E6810DA",FECO_SLURRY:"BDF1456E-01B8-11E7-BE5A-08606E6810DA",FECO_MANURE:"BDF14621-01B8-11E7-BE5A-08606E6810DA",FECO_LOW_LOSS:"BDF146D3-01B8-11E7-BE5A-08606E6810DA",FECO:"51650914-8DB8-11E9-A204-91D0637C46E8",PROTECT:"BDF14158-01B8-11E7-BE5A-08606E6810DA",HARVEST:"BDF13FE3-01B8-11E7-BE5A-08606E6810DA",NOTE:"07D2F427-01BE-11E7-BE5A-08606E6810DA"},ae={NO_LICENSE:"D612483A-34EA-4CEC-BDAC-8E5167CC8975",FARMDOK_FREE:"FF89699C-0B35-11E7-BE5A-08606E6810DA",PRECISION:"A768463C-B9FC-467F-A175-2FD6D672778D"}
1,ne="FD_NAVBAR_EXPANDED",re="cnhState",se="https://caseih.afsconnect.com/cnhisso",oe="fieldContour",le={activities:{stroke:{color:"#3DA45C",opacity:.6,width:8}},fields:{stroke:{color:"#81D897",opacity:1,style:"solid",width:5}},distance:{stroke:{color:"#FFFFFF",opacity:1,style:"dashed",width:4}},tracks:{stroke:{color:"#63BED2",opacity:1,width:2},start_circle:{outline:{color:"#FFFFFF",opacity:1,width:1},fill:{color:"#3BC961",opacity:1},radius:2},end_circle:{outline:{color:"#FFFFFF",opacity:1,width:1},fill:{color:"#EA6B54",opacity:1},radius:2}},timestamps:{circle:{outline:{color:"#FFFFFF",opacity:1,width:0},fill:{color:"#FFFFFF",opacity:1},radius:.7},text:{outline:"#FFFFFF",fill:"#3698AD"}}},de=(e,t)=>{if(null==t)return e;if("string"===t.type)return String(e);if("number"===t.type){if("number"===typeof e)return e;let i=Number(e);return Number.isNaN(i)?e:(null!=e&&""!==e||(i=null),null==i&&("number"===typeof t.default?i=t.default:t.nullable||(i=0)),i)}if("enum"===t.type&&Array.isArray(t.values)){let i;return t.values.some((t=>t===e?(i=e,!0):String(t)===e&&(i=t,!0))),null!=i?i:t.nullable?null:t.default}return e},ce=(e,t,i={})=>{const a=D()({},t,e);return Object.keys(a).forEach((e=>{Object.prototype.hasOwnProperty.call(t,e)||delete a[e],Object.prototype.hasOwnProperty.call(i,e)&&(a[e]=de(a[e],i[e]))})),a},ue=(e,t={})=>{const i={status:"error",errorCode:"generalError",errorUserMessage:[b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")],...t};let a;return null!=e&&"string"===typeof e.status?a=e:null!=e&&null!=e.data&&"string"===typeof e.data.status?a=e.data:null!=e&&null!=e.response&&null!=e.response.data&&"string"===typeof e.response.data.status&&(a=e.response.data),null==a?i:"success"===a.status||"downloadSuccess"===a.status?a:"partialSuccess"===a.status?{errors:{},errorUserMessage:[b["default"].i18n.translate("Es wurden mehrere Operationen durchgeführt. Bei mindestens einer ist ein Fehler aufgetreten.")],...a}:{...i,...a}};let pe=0;const he=(...e)=>{if(0===e.length)return console.error("mergeRestResponseData called without parameters"),null;const t=e.reduce(((e,t)=>{const i={version:null!=e.version?e.version:t.version,status:null!=e.status?e.status:t.status};return i.version!==t.version?(console.error("mergeRestResponseData called with version mismatch"),null):("success"===i.status&&"success"===t.status||(i.errorUserMessage=[b["default"].i18n.translate("Es wurden mehrere Operationen durchgeführt. Bei mindestens einer ist ein Fehler aufgetreten.")||""],i.status="partialSuccess"),i.data=[],null!=e.data&&(i.data=[...Array.isArray(e.data)?e.data:[e.data]]),null!=t.data&&(i.data=[...i.data,...Array.isArray(t.data)?t.data:[t.data]]),"success"===i.status||(i.errors={},"error"===e.status?(pe+=1,i.errors[`request-${pe}`]={errorCode:e.errorCode,errorAttributeUserMessages:e.errorAttributeUserMessages,errorUserMessage:e.errorUserMessage}):"partialSuccess"===e.status&&(i.errors={...e.errors}),"error"===t.status?(pe+=1,i.errors[`request-${pe}`]={errorCode:t.errorCode,errorAttributeUserMessages:t.errorAttributeUserMessages,errorUserMessage:t.errorUserMessage}):"partialSuccess"===t.status&&(i.errors={...i.errors,...t.errors})),i)}),{});return t},me=(e={},t=[])=>Object.keys(t).every((i=>!t[i].required||"undefined"!==typeof e[i]&&(null!==e[i]||!!t[i].nullable)));function fe(e,t,i=[]){return{async subscribe({commit:e,dispatch:t,state:i},{forceReset:a,forceRefresh:n}={forceReset:!1,forceRefresh:!1}){if(null!=i.loaded&&!a)return void(n&&await t("refresh"));const r=new Promise((t=>e("addObserver",t)));i.fetching||t("loadAll",{forceReset:a}),await r},async refresh({commit:e,dispatch:t,state:i}){if(null==i.loaded)return t("subscribe");const a=new Promise((t=>e("addObserver",t)));return i.fetching||t("loadAll"),a},async refreshByIds(e,a){const{rootGetters:n}=e;if(!n["features/currentCompaniesHaveFeaturesEnabled"](i))return ue({});let r;try{const i=await t(a,e);r=ue(i)}catch(s){r=ue(s)}return"success"===r.status&&e.commit("updateEntries",r),r},async loadAll(t,{forceReset:a=!1}={}){const{commit:n,dispatch:r,state:s,rootGetters:o}=t;if(!o["features/currentCompaniesHaveFeaturesEnabled"](i))return n("loadAll",{data:[]}),void n("finishFetching");a&&await r("reset");const d=l().CancelToken.source();n("startFetching",d);try{const i=await e(t,{cancelToken:d.token});"success"!==i.status?n("fetchingError",d):(I(i)&&i.resolved&&await r("loadResolved",i.resolved),n("loadAll",{data:i.data}),n("finishFetching",d))}catch(c){console.error(c),l().isCancel(c)||n("fetchingError",d)}
1finally{s.observers.forEach((e=>e())),n("clearObservers")}},loadResolved(){},reset({commit:e,state:t}){t.axiosSources.forEach((e=>e.cancel())),e("reset")}}}var ge=fe;const ye={data:e=>e.data,dataWithoutRemoved:e=>Object.values(e.data).reduce(((e,t)=>t.storeStatus===Z||t.storeStatus===W||t.storeStatus===G?e:{...e,[t.id]:t}),{}),errors:e=>e.errors,fetching:e=>e.fetching,loaded:e=>e.loaded,loading:e=>null==e.loaded&&(!!e.fetching||0===e.errors.length),findById(e){return t=>e.data[t]},getById(e,t){return e=>{const i=t.findById(e);if(i)return i;throw new a.Error(`Entry with id ${e} not found`)}}};var ve=ye;function be(){return{data:{},errors:[],fetching:!1,loaded:null,observers:[],axiosSources:[]}}const we={startFetching(e,t){b["default"].set(e,"fetching",!0),b["default"].set(e,"axiosSources",[...e.axiosSources,t])},addObserver(e,t){b["default"].set(e,"observers",[...e.observers,t])},clearObservers(e){b["default"].set(e,"observers",[])},addOne(e,t){b["default"].set(e.data,t.id,t)},loadAll(e,{data:t}){const i={};t.forEach((t=>{const a=e.data[t.id];a?.storeStatus&&[U,j].includes(a.storeStatus)?i[t.id]=a:i[t.id]={...t,storeStatus:V}})),b["default"].set(e,"data",i),b["default"].set(e,"loaded",new Date)},updateEntries(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>{const a=e.data[i.id]?.storeStatus;return a&&[U,j].includes(a)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,storeStatus:V}}}),e.data))},finishFetching(e,t){b["default"].set(e,"fetching",!1),b["default"].set(e,"axiosSources",e.axiosSources.filter((e=>e!==t)))},fetchingError(e,t){b["default"].set(e,"fetching",!1),b["default"].set(e,"axiosSources",e.axiosSources.filter((e=>e!==t))),b["default"].set(e,"errors",[...e.errors,{type:q}])},resetLoaded(e){b["default"].set(e,"loaded",null)},reset(e){const t=be();Object.entries(t).forEach((([t,i])=>{"observers"!==t&&b["default"].set(e,t,i)}))}};var Ce=we;function Fe(e,t,i=[]){return{namespaced:!0,state:be(),mutations:Ce,actions:ge(e,t,i),getters:ve}}function Ae(){return{version:"2.0",status:"success",data:[]}}async function ke(){throw new Error("not implemented yet!")}function Se(e,t){return{...e,data:[{id:t,...e.data}]}}async function Ee(e){if(0===e.length)return Ae();const{activitiesApi:t}=b["default"].prototype.$api,i=e.map((e=>t.activitiesGpsLog({activityId:e,dataTypes:"time"}).then((e=>e.data)).then((t=>Se(t,e))))),a=await Promise.all(i);return A(a)}const Ie=Fe(ke,Ee),_e={...Ie.actions};var De=_e;const Me={...Ie.getters};var Pe=Me;function Te(){return{...be()}}const xe={...Ie.mutations};var Be=xe;const Oe={namespaced:!0,state:Te(),mutations:Be,actions:De,getters:Pe};var $e=Oe;function Re(){return{version:"2.0",status:"success",data:[]}}async function Ne(){throw new Error("not implemented yet!")}function ze(e,t){return{...e,data:[{id:t,...e.data}]}}async function Le(e){if(0===e.length)return Re();const{activitiesApi:t}=b["default"].prototype.$api,i=e.map((e=>t.activitiesGpsTrack({activityId:e}).then((e=>e.data)).then((t=>ze(t,e))))),a=await Promise.all(i);return A(a)}const Ve=Fe(Ne,Le),Ue={...Ve.actions};var je=Ue;const He={...Ve.getters};var Ge=He;function We(){return{...be()}}const Ze={...Ve.mutations};var Ke=Ze;
1const qe={namespaced:!0,state:We(),mutations:Ke,actions:je,getters:Ge};var Ye=qe,Je=i(83465),Xe=i.n(Je),Qe=i(61478),et=i.n(Qe),tt=i(94956);class it{constructor(e){(0,tt.Z)(this,"activities",void 0),this.activities=e}get sumProcessedArea(){return this.activities.reduce(((e,t)=>e+(t.processedArea||0)),0)}get sumWorkingTime(){return this.activities.reduce(((e,t)=>e+(t.workingTime||0)),0)}get sumDrivingTime(){return this.activities.reduce(((e,t)=>e+(t.drivingTime||0)),0)}get sumSetupTime(){return this.activities.reduce(((e,t)=>e+(t.setupTime||0)),0)}get sumPauseTime(){return this.activities.reduce(((e,t)=>e+(t.pauseTime||0)),0)}}class at{constructor(e,t){(0,tt.Z)(this,"activities",void 0),(0,tt.Z)(this,"activityProductService",void 0),this.activities=e,this.activityProductService=t}findActivityByFieldId(e){return this.activities.find((t=>t.fieldId===e))}findActivitiesByFieldId(e){return this.activities.filter((t=>t.fieldId===e))}findActivityProduct(e){for(let t=0;t<this.activities.length;t+=1){const i=this.activities[t],a=i.products.find((t=>t.id===e));if(a)return a}}getActivityProduct(e){const t=this.findActivityProduct(e);if(!t)throw new Error(`ActivityProduct not found: ${e}`);return t}findActivityEquipment(e){for(let t=0;t<this.activities.length;t+=1){const i=this.activities[t],a=i.equipment.find((t=>t.id===e));if(a)return a}}getActivityEquipment(e){const t=this.findActivityEquipment(e);if(!t)throw new Error(`ActivityEquipment not found: ${e}`);return t}findActivityProductFamilyIds(e){const t=this.findActivityProduct(e);if(!t)return[];const i=[];return this.activities.forEach((e=>{e.products.forEach((e=>{this.activityProductService.isSibling(e,t)&&i.push(e.id)}))})),i}}const nt="https://develop.farmdok.com/rest".replace(/\/+$/,""),rt={csv:",",ssv:" ",tsv:"\t",pipes:"|"};class st{constructor(e,t=nt,i=l()){(0,tt.Z)(this,"basePath",void 0),(0,tt.Z)(this,"axios",void 0),(0,tt.Z)(this,"configuration",void 0),this.basePath=t,this.axios=i,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class ot extends Error{constructor(e,t){super(t),(0,tt.Z)(this,"field",void 0),(0,tt.Z)(this,"name","RequiredError"),this.field=e}}const lt="https://example.com",dt=function(e,t,i){if(null===i||void 0===i)throw new ot(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},ct=async function(e,t,i){if(i&&i.apiKey){const a="function"===typeof i.apiKey?await i.apiKey(t):await i.apiKey;e[t]=a}},ut=async function(e,t){if(t&&t.accessToken){const i="function"===typeof t.accessToken?await t.accessToken():await t.accessToken;e["Authorization"]="Bearer "+i}};function pt(e,t,i=""){"object"===typeof t?Array.isArray(t)?t.forEach((t=>pt(e,t,i))):Object.keys(t).forEach((a=>pt(e,t[a],`${i}${""!==i?".":""}${a}`))):e.has(i)?e.append(i,t):e.set(i,t)}const ht=function(e,...t){const i=new URLSearchParams(e.search);pt(i,t),e.search=i.toString()},mt=function(e,t,i){const a="string"!==typeof e,n=a&&i&&i.isJsonMime?i.isJsonMime(t.headers["Content-Type"]):a;return n?JSON.stringify(void 0!==e?e:{}):e||""},ft=function(e){return e.pathname+e.search+e.hash},gt=function(e,t,i,a){return(n=t,r=i)=>{const s={...e.options,url:(a?.basePath||r)+e.url};return n.request(s)}},yt={FieldId:"fieldId",ProductId:"productId",UnitId:"unitId",UserId:"userId",EquipmentId:"equipmentId",ActivityTypeId:"activityTypeId"},vt={IsolationZone:"IsolationZone",MultiplierGroup:"MultiplierGroup"},bt={Point:"Point",MultiPoint:"MultiPoint",LineString:"LineString",MultiLineString:"MultiLineString",PolyGon:"PolyGon",MultiPolygon:"MultiPolygon",GeometryCollection:"GeometryCollection"},wt={Solid:"solid",ForwardDiagonal:"forwardDiagonal",BackwardDiagonal:"backwardDiagonal",Horizontal:"horizontal",Vertical:"vertical",Grid:"grid",CheckerBoard:"checkerBoard"},Ct={Autodetect:"autodetect",CopyField:"copyField",ReplaceField:"replaceField",NoField:"noField"},Ft={CopyField:"copyField",ReplaceField:"replaceField",NoField:"noField",SameProcessOrder:"sameProcessOrder",WrongProcessOrder:"wrongProcessOrder",AccessDenied:"accessDenied",NoMatchFound:"noMatchFound"},At={Crop:"crop",Feco:"feco",Femi:"femi",Feoa:"feoa",Herb:"herb",Harvest:"harvest",Seed:"seed",Fesec:"fesec",Misc:"misc",Waad:"waad"},kt={Violation:"violation",NotChecked:"not_checked"},St={Empty:"",MutuallyDependent:"mutually_dependent"},Et={None:"None",WinterGrains1N:"WinterGrains1N",WinterGrains3N:"WinterGrains3N"},It={LiveStock:"LIVE_STOCK",Milling:"MILLING",Quality:"QUALITY",Premium:"PREMIUM"},_t={HumidArea:"HUMID_AREA",DryArea:"DRY_AREA"},Dt=function(e){return{activitiesGpsLog:async(t,i,a,n={})=>{dt("activitiesGpsLog","activityId",t),dt("activitiesGpsLog","dataTypes",i);const r="/activities/{activityId}/gpsLog".replace("{activityId}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["dataTypes"]=i),void 0!==a&&(c["pageKey"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},activitiesGpsTrack:async(t,i={})=>{dt("activitiesGpsTrack","activityId",t);const a="/activities/{activityId}/gpsTrack".replace("{activityId}",encodeURIComponent(String(t))),n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"GET",...r,...i},o={},l={};await ut(o,e),ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},{url:ft(n),options:s}},activityDelete:async(t,i,a,n={})=>{dt("activityDelete","objectIds",t);const r="/activities/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"DELETE",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},activityFavouriteProducts:async(t,i,a,n,r,s,o={})=>{dt("activityFavouriteProducts","companyIds",t),dt("activityFavouriteProducts","processOrderId",i),dt("activityFavouriteProducts","activityTypeId",a),dt("activityFavouriteProducts","cropIds",n);const l="/activities/favouriteProducts",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==r&&(h["version"]=r),void 0!==s&&(h["developerPayload"]=s),void 0!==t&&(h["companyIds"]=t),void 0!==i&&(h["processOrderId"]=i),void 0!==a&&(h["activityTypeId"]=a),void 0!==n&&(h["cropIds"]=n),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},activityLastUsedProductAmount:async(t,i,a,n,r,s={})=>{dt("activityLastUsedProductAmount","companyIds",t),dt("activityLastUsedProductAmount","productId",i),dt("activityLastUsedProductAmount","processOrderId",a);const o="/activities/lastUsedProductAmount",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==n&&(p["version"]=n),void 0!==r&&(p["developerPayload"]=r),void 0!==t&&(p["companyIds"]=t),void 0!==i&&(p["productId"]=i),void 0!==a&&(p["processOrderId"]=a),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},activityList:async(t,i,a,n,r,s,o,l,d={})=>{dt("activityList","processOrderId",t);const c="/activities",u=new URL(c,lt);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...d},m={},f={};await ut(m,e),void 0!==i&&(f["version"]=i),void 0!==a&&(f["deleted"]=a),void 0!==n&&(f["pageKey"]=n),void 0!==r&&(f["developerPayload"]=r),void 0!==s&&(f["properties"]=s),void 0!==t&&(f["processOrderId"]=t),void 0!==o&&(f["permissionMode"]=o),void 0!==l&&(f["fieldSharingCompanyId"]=l),ht(u,f);let g=p&&p.headers?p.headers:{};return h.headers={...m,...g,...d.headers},{url:ft(u),options:h}},activityMoveToProcessOrder:async(t,i={})=>{const a="/activities/moveToProcessOrder",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityObjects:async(t,i,a,n,r,s,o,l,d={})=>{dt("activityObjects","objectIds",t);const c="/activities/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),u=new URL(c,lt);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...d},m={},f={};await ut(m,e),void 0!==i&&(f["version"]=i),void 0!==a&&(f["deleted"]=a),void 0!==n&&(f["pageKey"]=n),void 0!==r&&(f["developerPayload"]=r),void 0!==s&&(f["properties"]=s),void 0!==o&&(f["permissionMode"]=o),void 0!==l&&(f["fieldSharingCompanyId"]=l),ht(u,f);let g=p&&p.headers?p.headers:{};return h.headers={...m,...g,...d.headers},{url:ft(u),options:h}},activityPatch:async(t,i={})=>{dt("activityPatch","activityPatchRequest",t);const a="/activities",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityPut:async(t,i={})=>{dt("activityPut","activityPutRequest",t);const a="/activities",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PUT",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityUndelete:async(t,i,a,n={})=>{dt("activityUndelete","objectIds",t);const r="/activities/undelete/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"POST",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}}}},Mt=function(e){const t=Dt(e);return{async activitiesGpsLog(i,a,n,r){const s=await t.activitiesGpsLog(i,a,n,r);return gt(s,l(),nt,e)},async activitiesGpsTrack(i,a){const n=await t.activitiesGpsTrack(i,a);return gt(n,l(),nt,e)},async activityDelete(i,a,n,r){const s=await t.activityDelete(i,a,n,r);return gt(s,l(),nt,e)},async activityFavouriteProducts(i,a,n,r,s,o,d){const c=await t.activityFavouriteProducts(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async activityLastUsedProductAmount(i,a,n,r,s,o){const d=await t.activityLastUsedProductAmount(i,a,n,r,s,o);return gt(d,l(),nt,e)},async activityList(i,a,n,r,s,o,d,c,u){const p=await t.activityList(i,a,n,r,s,o,d,c,u);return gt(p,l(),nt,e)},async activityMoveToProcessOrder(i,a){const n=await t.activityMoveToProcessOrder(i,a);return gt(n,l(),nt,e)},async activityObjects(i,a,n,r,s,o,d,c,u){const p=await t.activityObjects(i,a,n,r,s,o,d,c,u);return gt(p,l(),nt,e)},async activityPatch(i,a){const n=await t.activityPatch(i,a);return gt(n,l(),nt,e)},async activityPut(i,a){const n=await t.activityPut(i,a);return gt(n,l(),nt,e)},async activityUndelete(i,a,n,r){const s=await t.activityUndelete(i,a,n,r);return gt(s,l(),nt,e)}}};class Pt extends st{activitiesGpsLog(e,t){return Mt(this.configuration).activitiesGpsLog(e.activityId,e.dataTypes,e.pageKey,t).then((e=>e(this.axios,this.basePath)))}activitiesGpsTrack(e,t){return Mt(this.configuration).activitiesGpsTrack(e.activityId,t).then((e=>e(this.axios,this.basePath)))}activityDelete(e,t){return Mt(this.configuration).activityDelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}activityFavouriteProducts(e,t){return Mt(this.configuration).activityFavouriteProducts(e.companyIds,e.processOrderId,e.activityTypeId,e.cropIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}activityLastUsedProductAmount(e,t){return Mt(this.configuration).activityLastUsedProductAmount(e.companyIds,e.productId,e.processOrderId,e.ver
1sion,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}activityList(e,t){return Mt(this.configuration).activityList(e.processOrderId,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.permissionMode,e.fieldSharingCompanyId,t).then((e=>e(this.axios,this.basePath)))}activityMoveToProcessOrder(e={},t){return Mt(this.configuration).activityMoveToProcessOrder(e.activityMoveToProcessOrderRequest,t).then((e=>e(this.axios,this.basePath)))}activityObjects(e,t){return Mt(this.configuration).activityObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.permissionMode,e.fieldSharingCompanyId,t).then((e=>e(this.axios,this.basePath)))}activityPatch(e,t){return Mt(this.configuration).activityPatch(e.activityPatchRequest,t).then((e=>e(this.axios,this.basePath)))}activityPut(e,t){return Mt(this.configuration).activityPut(e.activityPutRequest,t).then((e=>e(this.axios,this.basePath)))}activityUndelete(e,t){return Mt(this.configuration).activityUndelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}}const Tt=function(e){return{activityImportDeleteObjects:async(t,i={})=>{const a="/activityImport/deleteObjects",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"DELETE",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityImportMapData:async(t,i,a,n,r,s={})=>{dt("activityImportMapData","source",t),dt("activityImportMapData","processOrderId",i);const o="/activityImport/mapData",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==a&&(p["version"]=a),void 0!==n&&(p["developerPayload"]=n),void 0!==t&&(p["source"]=t),void 0!==i&&(p["processOrderId"]=i),void 0!==r&&(p["objectIds"]=r),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},activityImportReset:async(t,i={})=>{const a="/activityImport/reset",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityImportResetMappings:async(t,i={})=>{const a="/activityImport/resetMappings",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityImportStatus:async(t,i,a,n={})=>{dt("activityImportStatus","source",t);const r="/activityImport/status",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),void 0!==t&&(c["source"]=t),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},activityImportStoreMappings:async(t,i={})=>{const a="/activityImport/storeMappings",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},activityImportUpload:async(t,i,a,n={})=>{const r="/activityImport/upload",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"POST",...o,...n},d={},c={},u=new(e&&e.formDataCtor||FormData);await ut(d,e),void 0!==t&&u.append("version",t),void 0!==i&&u.append("developerPayload",i),a&&a.forEach((e=>{u.append("files[]",e)})),d["Content-Type"]="multipart/form-data",ht(s,c);let p=o&&o.headers?o.headers:{};return l.headers={...d,...p,...n.headers},l.data=u,{url:ft(s),options:l}}}},xt=function(e){const t=Tt(e);return{async activityImportDeleteObjects(i,a){const n=await t.activityImportDeleteObjects(i,a);return gt(n,l(),nt,e)},async activityImportMapData(i,a,n,r,s,o){const d=await t.activityImportMapData(i,a,n,r,s,o);return gt(d,l(),nt,e)},async activityImportReset(i,a){const n=await t.activityImportReset(i,a);return gt(n,l(),nt,e)},async activityImportResetMappings(i,a){const n=await t.activityImportResetMappings(i,a);return gt(n,l(),nt,e)},async activityImportStatus(i,a,n,r){const s=await t.activityImportStatus(i,a,n,r);return gt(s,l(),nt,e)},async activityImportStoreMappings(i,a){const n=await t.activityImportStoreMappings(i,a);return gt(n,l(),nt,e)},async activityImportUpload(i,a,n,r){const s=await t.activityImportUpload(i,a,n,r);return gt(s,l(),nt,e)}}};class Bt extends st{activityImportDeleteObjects(e={},t){return xt(this.configuration).activityImportDeleteObjects(e.activityImportDeleteObjectsRequest,t).then((e=>e(this.axios,this.basePath)))}activityImportMapData(e,t){return xt(this.configuration).activityImportMapData(e.source,e.processOrderId,e.ver
1sion,e.developerPayload,e.objectIds,t).then((e=>e(this.axios,this.basePath)))}activityImportReset(e={},t){return xt(this.configuration).activityImportReset(e.activityImportResetRequest,t).then((e=>e(this.axios,this.basePath)))}activityImportResetMappings(e={},t){return xt(this.configuration).activityImportResetMappings(e.activityImportResetMappingsRequest,t).then((e=>e(this.axios,this.basePath)))}activityImportStatus(e,t){return xt(this.configuration).activityImportStatus(e.source,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}activityImportStoreMappings(e={},t){return xt(this.configuration).activityImportStoreMappings(e.activityImportStoreMappingsRequest,t).then((e=>e(this.axios,this.basePath)))}activityImportUpload(e={},t){return xt(this.configuration).activityImportUpload(e.version,e.developerPayload,e.files,t).then((e=>e(this.axios,this.basePath)))}}const Ot=function(e){return{applicationMapsTerrazoFieldTimestamp:async(t,i={})=>{const a="/applicationMaps/terrazo/fieldTimestamp",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},applicationMapsTerrazoMap:async(t,i={})=>{const a="/applicationMaps/terrazo/map",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}}}},$t=function(e){const t=Ot(e);return{async applicationMapsTerrazoFieldTimestamp(i,a){const n=await t.applicationMapsTerrazoFieldTimestamp(i,a);return gt(n,l(),nt,e)},async applicationMapsTerrazoMap(i,a){const n=await t.applicationMapsTerrazoMap(i,a);return gt(n,l(),nt,e)}}};class Rt extends st{applicationMapsTerrazoFieldTimestamp(e={},t){return $t(this.configuration).applicationMapsTerrazoFieldTimestamp(e.requestTerrazoFieldTimestamp,t).then((e=>e(this.axios,this.basePath)))}applicationMapsTerrazoMap(e={},t){return $t(this.configuration).applicationMapsTerrazoMap(e.requestTerrazoMap,t).then((e=>e(this.axios,this.basePath)))}}const Nt=function(e){return{bbchGroupList:async(t,i,a,n,r,s={})=>{const o="/bbchGroups",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==t&&(p["version"]=t),void 0!==i&&(p["deleted"]=i),void 0!==a&&(p["pageKey"]=a),void 0!==n&&(p["developerPayload"]=n),void 0!==r&&(p["properties"]=r),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},bbchGroupObjects:async(t,i,a,n,r,s,o={})=>{dt("bbchGroupObjects","objectIds",t);const l="/bbchGroups/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},bbchStageList:async(t,i,a,n,r,s={})=>{const o="/bbchStages",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==t&&(p["version"]=t),void 0!==i&&(p["deleted"]=i),void 0!==a&&(p["pageKey"]=a),void 0!==n&&(p["developerPayload"]=n),void 0!==r&&(p["properties"]=r),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},bbchStageObjects:async(t,i,a,n,r,s,o={})=>{dt("bbchStageObjects","objectIds",t);const l="/bbchStages/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},zt=function(e){const t=Nt(e);return{async bbchGroupList(i,a,n,r,s,o){const d=await t.bbchGroupList(i,a,n,r,s,o);return gt(d,l(),nt,e)},async bbchGroupObjects(i,a,n,r,s,o,d){const c=await t.bbchGroupObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async bbchStageList(i,a,n,r,s,o){const d=await t.bbchStageList(i,a,n,r,s,o);return gt(d,l(),nt,e)},async bbchStageObjects(i,a,n,r,s,o,d){const c=await t.bbchStageObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class Lt extends st{bbchGroupList(e={},t){return zt(this.configuration).bbchGroupList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}bbchGroupObjects(e,t){return zt(this.configuration).bbchGroupObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}bbchStageList(e={},t){return zt(this.configuration).bbchStageList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}bbchStageObjects(e,t){return zt(this.configuration).bbchStageObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const Vt=function(e){return{interfacesCnhConnectionStatus:async(t,i,a={})=>{const n="/external/cnh/connectionStatus",r=new URL(n,lt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},l={},d={};await ut(l,e),void 0!==t&&(d["version"]=t),void 0!==i&&(d["developerPayload"]=i),ht(r,d);let c=s&&s.headers?s.headers:{};return o.headers={...l,...c,...a.headers},{url:ft(r),options:o}},interfacesCnhDownloadTasks:async(t,i={})=>{const a="/external/cnh/downloadTasks",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},interfacesCnhLogin:async(t,i={})=>{const a="/external/cnh/login",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},interfacesCnhLogout:async(t={})=>{const i="/external/cnh/logout",a=new URL(i,lt);let n;e&&(n=e.baseOptions);const r={method:"POST",...n,...t},s={},o={};await ut(s,e),ht(a,o);let l=n&&n.headers?n.headers:{};return r.headers={...s,...l,...t.headers},{url:ft(a),options:r}},interfacesCnhOverview:async(t,i,a={})=>{const n="/external/cnh/overview",r=new URL(n,lt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},l={},d={};await ut(l,e),void 0!==t&&(d["version"]=t),void 0!==i&&(d["developerPayload"]=i),ht(r,d);let c=s&&s.headers?s.headers:{};return o.headers={...l,...c,...a.headers},{url:ft(r),options:o}},interfacesCnhTasks:async(t,i,a,n,r={})=>{dt("interfacesCnhTasks","companyId",t);const s="/external/cnh/tasks",o=new URL(s,lt);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...r},c={},u={};await ut(c,e),void 0!==i&&(u["version"]=i),void 0!==a&&(u["developerPayload"]=a),void 0!==n&&(u["pageKey"]=n),void 0!==t&&(u["companyId"]=t),ht(o,u);let p=l&&l.headers?l.headers:{};return d.headers={...c,...p,...r.headers},{url:ft(o),options:d}}}},Ut=function(e){const t=Vt(e);return{async interfacesCnhConnectionStatus(i,a,n){const r=await t.interfacesCnhConnectionStatus(i,a,n);
1return gt(r,l(),nt,e)},async interfacesCnhDownloadTasks(i,a){const n=await t.interfacesCnhDownloadTasks(i,a);return gt(n,l(),nt,e)},async interfacesCnhLogin(i,a){const n=await t.interfacesCnhLogin(i,a);return gt(n,l(),nt,e)},async interfacesCnhLogout(i){const a=await t.interfacesCnhLogout(i);return gt(a,l(),nt,e)},async interfacesCnhOverview(i,a,n){const r=await t.interfacesCnhOverview(i,a,n);return gt(r,l(),nt,e)},async interfacesCnhTasks(i,a,n,r,s){const o=await t.interfacesCnhTasks(i,a,n,r,s);return gt(o,l(),nt,e)}}};class jt extends st{interfacesCnhConnectionStatus(e={},t){return Ut(this.configuration).interfacesCnhConnectionStatus(e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}interfacesCnhDownloadTasks(e={},t){return Ut(this.configuration).interfacesCnhDownloadTasks(e.interfacesCnhDownloadTasksRequest,t).then((e=>e(this.axios,this.basePath)))}interfacesCnhLogin(e={},t){return Ut(this.configuration).interfacesCnhLogin(e.interfacesCnhLoginRequest,t).then((e=>e(this.axios,this.basePath)))}interfacesCnhLogout(e){return Ut(this.configuration).interfacesCnhLogout(e).then((e=>e(this.axios,this.basePath)))}interfacesCnhOverview(e={},t){return Ut(this.configuration).interfacesCnhOverview(e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}interfacesCnhTasks(e,t){return Ut(this.configuration).interfacesCnhTasks(e.companyId,e.version,e.developerPayload,e.pageKey,t).then((e=>e(this.axios,this.basePath)))}}const Ht=function(e){return{cultivationPlanAtList:async(t,i,a,n={})=>{dt("cultivationPlanAtList","fieldIds",t);const r="/cultivationPlan/At/{fieldIds}".replace("{fieldIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}}}},Gt=function(e){const t=Ht(e);return{async cultivationPlanAtList(i,a,n,r){const s=await t.cultivationPlanAtList(i,a,n,r);return gt(s,l(),nt,e)}}};class Wt extends st{cultivationPlanAtList(e,t){return Gt(this.configuration).cultivationPlanAtList(e.fieldIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}}const Zt=function(e){return{daturaDroneAssessmentDelete:async(t,i,a,n={})=>{dt("daturaDroneAssessmentDelete","objectIds",t);const r="/datura/droneAssessments/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"DELETE",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},daturaDroneAssessmentList:async(t,i,a,n,r,s,o={})=>{dt("daturaDroneAssessmentList","processOrderId",t);const l="/datura/droneAssessments",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),void 0!==t&&(h["processOrderId"]=t),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},daturaDroneAssessmentObjects:async(t,i,a,n,r,s,o={})=>{dt("daturaDroneAssessmentObjects","objectIds",t);const l="/datura/droneAssessments/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},daturaDroneAssessmentPatch:async(t,i={})=>{dt("daturaDroneAssessmentPatch","daturaDroneAssessmentPatchRequest",t);const a="/datura/droneAssessments",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},daturaImportJobList:async(t,i,a,n,r,s,o={})=>{dt("daturaImportJobList","processOrderId",t);const l="/datura/importJobs",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),void 0!==t&&(h["processOrderId"]=t),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},daturaImportJobObjects:async(t,i,a,n,r,s,o={})=>{dt("daturaImportJobObjects","objectIds",t);const l="/datura/importJobs/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},daturaImportJobPatch:async(t,i={})=>{dt("daturaImportJobPatch","daturaImportJobPatchRequest",t);const a="/datura/importJobs",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ct(o,"Api-Key",e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},daturaImportJobReset:async(t,i={})=>{dt("daturaImportJobReset","objectIds",t);const a="/datura/importJobs/reset/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ct(o,"Api-Key",e),ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},{url:ft(n),options:s}},daturaImportJobResultsPut:async(t,i={})=>{dt("daturaImportJobResultsPut","daturaImportJobResultsPutRequest",t);const a="/datura/importJobs/results",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PUT",...r,...i},o={},l={};await ct(o,"Api-Key",e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},daturaImportJobStart:async(t,i={})=>{const a="/datura/importJobs/start",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}}}},Kt=function(e){const t=Zt(e);return{async daturaDroneAssessmentDelete(i,a,n,r){const s=await t.daturaDroneAssessmentDelete(i,a,n,r);return gt(s,l(),nt,e)},async daturaDroneAssessmentList(i,a,n,r,s,o,d){const c=await t.daturaDroneAssessmentList(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async daturaDroneAssessmentObjects(i,a,n,r,s,o,d){const c=await t.daturaDroneAssessmentObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async daturaDroneAssessmentPatch(i,a){const n=await t.daturaDroneAssessmentPatch(i,a);return gt(n,l(),nt,e)},async daturaImportJobList(i,a,n,r,s,o,d){const c=await t.daturaImportJobList(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async daturaImportJobObjects(i,a,n,r,s,o,d){const c=await t.daturaImportJobObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async daturaImportJobPatch(i,a){const n=await t.daturaImportJobPatch(i,a);return gt(n,l(),nt,e)},async daturaImportJobReset(i,a){const n=await t.daturaImportJobReset(i,a);return gt(n,l(),nt,e)},async daturaImportJobResultsPut(i,a){const n=await t.daturaImportJobResultsPut(i,a);return gt(n,l(),nt,e)},async daturaImportJobStart(i,a){const n=await t.daturaImportJobStart(i,a);return gt(n,l(),nt,e)}}};class qt extends st{daturaDroneAssessmentDelete(e,t){return Kt(this.configuration).daturaDroneAssessmentDelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}daturaDroneAssessmentList(e,t){return Kt(this.configuration).daturaDroneAssessmentList(e.processOrderId,e.ver
1sion,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}daturaDroneAssessmentObjects(e,t){return Kt(this.configuration).daturaDroneAssessmentObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}daturaDroneAssessmentPatch(e,t){return Kt(this.configuration).daturaDroneAssessmentPatch(e.daturaDroneAssessmentPatchRequest,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobList(e,t){return Kt(this.configuration).daturaImportJobList(e.processOrderId,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobObjects(e,t){return Kt(this.configuration).daturaImportJobObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobPatch(e,t){return Kt(this.configuration).daturaImportJobPatch(e.daturaImportJobPatchRequest,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobReset(e,t){return Kt(this.configuration).daturaImportJobReset(e.objectIds,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobResultsPut(e,t){return Kt(this.configuration).daturaImportJobResultsPut(e.daturaImportJobResultsPutRequest,t).then((e=>e(this.axios,this.basePath)))}daturaImportJobStart(e={},t){return Kt(this.configuration).daturaImportJobStart(e.daturaImportJobStartRequest,t).then((e=>e(this.axios,this.basePath)))}}const Yt=function(e){return{equipmentDelete:async(t,i,a,n={})=>{dt("equipmentDelete","objectIds",t);const r="/equipment/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"DELETE",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},equipmentList:async(t,i,a,n,r,s,o={})=>{const l="/equipment",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==t&&(h["version"]=t),void 0!==i&&(h["deleted"]=i),void 0!==a&&(h["pageKey"]=a),void 0!==n&&(h["developerPayload"]=n),void 0!==r&&(h["properties"]=r),void 0!==s&&(h["companyId"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},equipmentObjects:async(t,i,a,n,r,s,o={})=>{dt("equipmentObjects","objectIds",t);const l="/equipment/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},equipmentPatch:async(t,i={})=>{dt("equipmentPatch","equipmentPatchRequest",t);const a="/equipment",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},equipmentPut:async(t,i={})=>{dt("equipmentPut","equipmentPutRequest",t);const a="/equipment",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PUT",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},equipmentUndelete:async(t,i,a,n={})=>{dt("equipmentUndelete","objectIds",t);const r="/equipment/undelete/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"POST",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}}}},Jt=function(e){const t=Yt(e);return{async equipmentDelete(i,a,n,r){const s=await t.equipmentDelete(i,a,n,r);return gt(s,l(),nt,e)},async equipmentList(i,a,n,r,s,o,d){const c=await t.equipmentList(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async equipmentObjects(i,a,n,r,s,o,d){const c=await t.equipmentObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async equipmentPatch(i,a){const n=await t.equipmentPatch(i,a);return gt(n,l(),nt,e)},async equipmentPut(i,a){const n=await t.equipmentPut(i,a);return gt(n,l(),nt,e)},async equipmentUndelete(i,a,n,r){const s=await t.equipmentUndelete(i,a,n,r);return gt(s,l(),nt,e)}}};class Xt extends st{equipmentDelete(e,t){return Jt(this.configuration).equipmentDelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}equipmentList(e={},t){return Jt(this.configuration).equipmentList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.companyId,t).then((e=>e(this.axios,this.basePath)))}equipmentObjects(e,t){return Jt(this.configuration).equipmentObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}equipmentPatch(e,t){return Jt(this.configuration).equipmentPatch(e.equipmentPatchRequest,t).then((e=>e(this.axios,this.basePath)))}equipmentPut(e,t){return Jt(this.configuration).equipmentPut(e.equipmentPutRequest,t).then((e=>e(this.axios,this.basePath)))}equipmentUndelete(e,t){return Jt(this.configuration).equipmentUndelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}}const Qt=function(e){return{fertilizationPlanFieldBasedList:async(t,i,a,n={})=>{dt("fertilizationPlanFieldBasedList","fieldIds",t);const r="/fertilizationPlan/fieldBased/{fieldIds}".replace("{fieldIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}}}},ei=function(e){const t=Qt(e);return{async fertilizationPlanFieldBasedList(i,a,n,r){const s=await t.fertilizationPlanFieldBasedList(i,a,n,r);return gt(s,l(),nt,e)}}};class ti extends st{fertilizationPlanFieldBasedList(e,t){return ei(this.configuration).fertilizationPlanFieldBasedList(e.fieldIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}}const ii=function(e){return{fieldContourDelete:async(t,i,a,n={})=>{dt("fieldContourDelete","objectIds",t);const r="/fieldContours/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"DELETE",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},fieldContourList:async(t,i,a,n,r,s,o,l,d={})=>{dt("fieldContourList","processOrderId",t);const c="/fieldContours",u=new URL(c,lt);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...d},m={},f={};await ut(m,e),void 0!==i&&(f["version"]=i),void 0!==a&&(f["deleted"]=a),void 0!==n&&(f["pageKey"]=n),void 0!==r&&(f["developerPayload"]=r),void 0!==s&&(f["properties"]=s),void 0!==t&&(f["processOrderId"]=t),void 0!==o&&(f["permissionMode"]=o),void 0!==l&&(f["fieldSharingCompanyId"]=l),ht(u,f);let g=p&&p.headers?p.headers:{};return h.headers={...m,...g,...d.headers},{url:ft(u),options:h}},fieldContourPatch:async(t,i={})=>{dt("fieldContourPatch","fieldContourPatchRequest",t);const a="/fieldContours",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},fieldContourPut:async(t,i={})=>{dt("fieldContourPut","fieldContourPutRequest",t);const a="/fieldContours",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PUT",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}}}},ai=function(e){const t=ii(e);return{async fieldContourDelete(i,a,n,r){const s=await t.fieldContourDelete(i,a,n,r);return gt(s,l(),nt,e)},async fieldContourList(i,a,n,r,s,o,d,c,u){const p=await t.fieldContourList(i,a,n,r,s,o,d,c,u);return gt(p,l(),nt,e)},async fieldContourPatch(i,a){const n=await t.fieldContourPatch(i,a);return gt(n,l(),nt,e)},async fieldContourPut(i,a){const n=await t.fieldContourPut(i,a);return gt(n,l(),nt,e)}}};
1class ni extends st{fieldContourDelete(e,t){return ai(this.configuration).fieldContourDelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}fieldContourList(e,t){return ai(this.configuration).fieldContourList(e.processOrderId,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.permissionMode,e.fieldSharingCompanyId,t).then((e=>e(this.axios,this.basePath)))}fieldContourPatch(e,t){return ai(this.configuration).fieldContourPatch(e.fieldContourPatchRequest,t).then((e=>e(this.axios,this.basePath)))}fieldContourPut(e,t){return ai(this.configuration).fieldContourPut(e.fieldContourPutRequest,t).then((e=>e(this.axios,this.basePath)))}}const ri=function(e){return{geoObject:async(t,i,a,n,r,s,o={})=>{dt("geoObject","objectIds",t);const l="/map/geo/objects/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},geoObjectDelete:async(t,i,a,n={})=>{dt("geoObjectDelete","objectIds",t);const r="/map/geo/objects/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"DELETE",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},geoObjectList:async(t,i,a,n,r,s,o,l={})=>{dt("geoObjectList","objectType",t),dt("geoObjectList","processOrderId",i);const d="/map/geo/objects",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==a&&(m["version"]=a),void 0!==n&&(m["deleted"]=n),void 0!==r&&(m["pageKey"]=r),void 0!==s&&(m["developerPayload"]=s),void 0!==o&&(m["properties"]=o),void 0!==t&&(m["objectType"]=t),void 0!==i&&(m["processOrderId"]=i),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}},geoObjectPatch:async(t,i={})=>{dt("geoObjectPatch","geoObjectPatchRequest",t);const a="/map/geo/objects",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PATCH",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},geoObjectPut:async(t,i={})=>{dt("geoObjectPut","geoObjectPutRequest",t);const a="/map/geo/objects",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"PUT",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},geoObjectUndelete:async(t,i,a,n={})=>{dt("geoObjectUndelete","objectIds",t);const r="/map/geo/objects/undelete/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"POST",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},mapLayerFieldUtilization:async(t,i,a,n={})=>{dt("mapLayerFieldUtilization","bbox",t);const r="/map/layer/fieldUtilization",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),void 0!==t&&(c["bbox"]=t),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},mapLayerLandCadastre:async(t,i,a,n={})=>{dt("mapLayerLandCadastre","bbox",t);const r="/map/layer/landCadastre",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),void 0!==t&&(c["bbox"]=t),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},mapLayerLandCadastreSearch:async(t,i,a,n={})=>{dt("mapLayerLandCadastreSearch","query",t);const r="/map/layer/landCadastre/search",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),void 0!==t&&(c["query"]=t),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},mapLayerWaterProtectionZone:async(t,i,a,n={})=>{dt("mapLayerWaterProtectionZone","bbox",t);const r="/map/layer/waterProtectionZone",s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"GET",...o,...n},d={},c={};await ut(d,e),void 0!==i&&(c["version"]=i),void 0!==a&&(c["developerPayload"]=a),void 0!==t&&(c["bbox"]=t),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}},mapLayerWaterProtectionZoneIntersects:async(t,i={})=>{const a="/map/layer/waterProtectionZone/intersects",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}}}},si=function(e){const t=ri(e);return{async geoObject(i,a,n,r,s,o,d){const c=await t.geoObject(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async geoObjectDelete(i,a,n,r){const s=await t.geoObjectDelete(i,a,n,r);return gt(s,l(),nt,e)},async geoObjectList(i,a,n,r,s,o,d,c){const u=await t.geoObjectList(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)},async geoObjectPatch(i,a){const n=await t.geoObjectPatch(i,a);return gt(n,l(),nt,e)},async geoObjectPut(i,a){const n=await t.geoObjectPut(i,a);return gt(n,l(),nt,e)},async geoObjectUndelete(i,a,n,r){const s=await t.geoObjectUndelete(i,a,n,r);return gt(s,l(),nt,e)},async mapLayerFieldUtilization(i,a,n,r){const s=await t.mapLayerFieldUtilization(i,a,n,r);return gt(s,l(),nt,e)},async mapLayerLandCadastre(i,a,n,r){const s=await t.mapLayerLandCadastre(i,a,n,r);return gt(s,l(),nt,e)},async mapLayerLandCadastreSearch(i,a,n,r){const s=await t.mapLayerLandCadastreSearch(i,a,n,r);return gt(s,l(),nt,e)},async mapLayerWaterProtectionZone(i,a,n,r){const s=await t.mapLayerWaterProtectionZone(i,a,n,r);return gt(s,l(),nt,e)},async mapLayerWaterProtectionZoneIntersects(i,a){const n=await t.mapLayerWaterProtectionZoneIntersects(i,a);return gt(n,l(),nt,e)}}};class oi extends st{geoObject(e,t){return si(this.configuration).geoObject(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}geoObjectDelete(e,t){return si(this.configuration).geoObjectDelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}geoObjectList(e,t){return si(this.configuration).geoObjectList(e.objectType,e.processOrderId,e.ver
1sion,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}geoObjectPatch(e,t){return si(this.configuration).geoObjectPatch(e.geoObjectPatchRequest,t).then((e=>e(this.axios,this.basePath)))}geoObjectPut(e,t){return si(this.configuration).geoObjectPut(e.geoObjectPutRequest,t).then((e=>e(this.axios,this.basePath)))}geoObjectUndelete(e,t){return si(this.configuration).geoObjectUndelete(e.objectIds,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}mapLayerFieldUtilization(e,t){return si(this.configuration).mapLayerFieldUtilization(e.bbox,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}mapLayerLandCadastre(e,t){return si(this.configuration).mapLayerLandCadastre(e.bbox,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}mapLayerLandCadastreSearch(e,t){return si(this.configuration).mapLayerLandCadastreSearch(e.query,e.version,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}mapLayerWaterProtectionZone(e,t){return si(this.configuration).mapLayerWaterProtectionZone(e.bbox,e.ver
1sion,e.developerPayload,t).then((e=>e(this.axios,this.basePath)))}mapLayerWaterProtectionZoneIntersects(e={},t){return si(this.configuration).mapLayerWaterProtectionZoneIntersects(e.mapLayerWaterProtectionZoneIntersectsRequest,t).then((e=>e(this.axios,this.basePath)))}}const li=function(e){return{pestList:async(t,i,a,n,r,s,o={})=>{dt("pestList","regionId",t);const l="/pests",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),void 0!==t&&(h["regionId"]=t),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},pestObjects:async(t,i,a,n,r,s,o={})=>{dt("pestObjects","objectIds",t);const l="/pests/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},di=function(e){const t=li(e);return{async pestList(i,a,n,r,s,o,d){const c=await t.pestList(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async pestObjects(i,a,n,r,s,o,d){const c=await t.pestObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class ci extends st{pestList(e,t){return di(this.configuration).pestList(e.regionId,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}pestObjects(e,t){return di(this.configuration).pestObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const ui=function(e){return{plantVarietyList:async(t,i,a,n,r,s,o,l={})=>{const d="/plantVarieties",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==t&&(m["version"]=t),void 0!==i&&(m["deleted"]=i),void 0!==a&&(m["pageKey"]=a),void 0!==n&&(m["developerPayload"]=n),void 0!==r&&(m["properties"]=r),void 0!==s&&(m["companyId"]=s),void 0!==o&&(m["regionId"]=o),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}},plantVarietyObjects:async(t,i,a,n,r,s,o={})=>{dt("plantVarietyObjects","objectIds",t);const l="/plantVarieties/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},pi=function(e){const t=ui(e);return{async plantVarietyList(i,a,n,r,s,o,d,c){const u=await t.plantVarietyList(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)},async plantVarietyObjects(i,a,n,r,s,o,d){const c=await t.plantVarietyObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class hi extends st{plantVarietyList(e={},t){return pi(this.configuration).plantVarietyList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.companyId,e.regionId,t).then((e=>e(this.axios,this.basePath)))}plantVarietyObjects(e,t){return pi(this.configuration).plantVarietyObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const mi=function(e){return{plantVarietyWorkflowSeedingList:async(t,i,a,n,r,s,o,l={})=>{dt("plantVarietyWorkflowSeedingList","regionId",t),dt("plantVarietyWorkflowSeedingList","seedingWorkflow",i);const d="/plantVarieties/workflowSeeding",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==a&&(m["version"]=a),void 0!==n&&(m["deleted"]=n),void 0!==r&&(m["pageKey"]=r),void 0!==s&&(m["developerPayload"]=s),void 0!==o&&(m["properties"]=o),void 0!==t&&(m["regionId"]=t),void 0!==i&&(m["seedingWorkflow"]=i),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}},plantVarietyWorkflowSeedingObjects:async(t,i,a,n,r,s,o={})=>{dt("plantVarietyWorkflowSeedingObjects","objectIds",t);const l="/plantVarieties/workflowSeeding/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},fi=function(e){const t=mi(e);return{async plantVarietyWorkflowSeedingList(i,a,n,r,s,o,d,c){const u=await t.plantVarietyWorkflowSeedingList(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)},async plantVarietyWorkflowSeedingObjects(i,a,n,r,s,o,d){const c=await t.plantVarietyWorkflowSeedingObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class gi extends st{plantVarietyWorkflowSeedingList(e,t){return fi(this.configuration).plantVarietyWorkflowSeedingList(e.regionId,e.seedingWorkflow,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}plantVarietyWorkflowSeedingObjects(e,t){return fi(this.configuration).plantVarietyWorkflowSeedingObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const yi=function(e){return{productCategoryList:async(t,i,a,n,r,s={})=>{const o="/productCategories",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==t&&(p["version"]=t),void 0!==i&&(p["deleted"]=i),void 0!==a&&(p["pageKey"]=a),void 0!==n&&(p["developerPayload"]=n),void 0!==r&&(p["properties"]=r),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},productCategoryObjects:async(t,i,a,n,r,s,o={})=>{dt("productCategoryObjects","objectIds",t);const l="/productCategories/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},vi=function(e){const t=yi(e);return{async productCategoryList(i,a,n,r,s,o){const d=await t.productCategoryList(i,a,n,r,s,o);return gt(d,l(),nt,e)},async productCategoryObjects(i,a,n,r,s,o,d){const c=await t.productCategoryObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class bi extends st{productCategoryList(e={},t){return vi(this.configuration).productCategoryList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}productCategoryObjects(e,t){return vi(this.configuration).productCategoryObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const wi=function(e){return{productPesticideIndicationList:async(t,i,a,n,r,s,o,l={})=>{const d="/products/pesticideIndications",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==t&&(m["version"]=t),void 0!==i&&(m["deleted"]=i),void 0!==a&&(m["pageKey"]=a),void 0!==n&&(m["developerPayload"]=n),void 0!==r&&(m["properties"]=r),void 0!==s&&(m["regionId"]=s),void 0!==o&&(m["pesticideId"]=o),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}}}},Ci=function(e){const t=wi(e);return{async productPesticideIndicationList(i,a,n,r,s,o,d,c){const u=await t.productPesticideIndicationList(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)}}};class Fi extends st{productPesticideIndicationList(e={},t){return Ci(this.configuration).productPesticideIndicationList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.regi
1onId,e.pesticideId,t).then((e=>e(this.axios,this.basePath)))}}const Ai=function(e){return{reportsPsmStatsXlsx:async(t,i,a,n,r,s,o={})=>{dt("reportsPsmStatsXlsx","companyId",t),dt("reportsPsmStatsXlsx","contractId",i),dt("reportsPsmStatsXlsx","organicFarming",a),dt("reportsPsmStatsXlsx","noHerbicideWineFruitHops",n),dt("reportsPsmStatsXlsx","noInsecticideWineFruitHops",r);const l="/reports/psm-stats/xlsx",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==s&&(h["version"]=s),void 0!==t&&(h["companyId"]=t),void 0!==i&&(h["contractId"]=i),void 0!==a&&(h["organicFarming"]=a),void 0!==n&&(h["noHerbicideWineFruitHops"]=n),void 0!==r&&(h["noInsecticideWineFruitHops"]=r),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},ki=function(e){const t=Ai(e);return{async reportsPsmStatsXlsx(i,a,n,r,s,o,d){const c=await t.reportsPsmStatsXlsx(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class Si extends st{reportsPsmStatsXlsx(e,t){return ki(this.configuration).reportsPsmStatsXlsx(e.companyId,e.contractId,e.organicFarming,e.noHerbicideWineFruitHops,e.noInsecticideWineFruitHops,e.version,t).then((e=>e(this.axios,this.basePath)))}}const Ei=function(e){return{productPesticideIndicationList:async(t,i,a,n,r,s,o,l={})=>{const d="/products/pesticideIndications",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==t&&(m["version"]=t),void 0!==i&&(m["deleted"]=i),void 0!==a&&(m["pageKey"]=a),void 0!==n&&(m["developerPayload"]=n),void 0!==r&&(m["properties"]=r),void 0!==s&&(m["regionId"]=s),void 0!==o&&(m["pesticideId"]=o),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}},ruleList:async(t,i,a,n,r,s={})=>{const o="/rulecheck/rules",l=new URL(o,lt);let d;e&&(d=e.baseOptions);const c={method:"GET",...d,...s},u={},p={};await ut(u,e),void 0!==t&&(p["version"]=t),void 0!==i&&(p["deleted"]=i),void 0!==a&&(p["pageKey"]=a),void 0!==n&&(p["developerPayload"]=n),void 0!==r&&(p["properties"]=r),ht(l,p);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...s.headers},{url:ft(l),options:c}},ruleObjects:async(t,i,a,n,r,s,o={})=>{dt("ruleObjects","objectIds",t);const l="/rulecheck/rules/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},rulecheckActivityRuleViolations:async(t,i,a,n,r,s,o={})=>{dt("rulecheckActivityRuleViolations","processOrderId",t);const l="/rulecheck/activityRuleViolations",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),void 0!==t&&(h["processOrderId"]=t),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},rulecheckDismiss:async(t,i={})=>{dt("rulecheckDismiss","activityRuleViolationId",t);const a="/rulecheck/activityRuleViolations/dismiss/{activityRuleViolationId}".replace("{activityRuleViolationId}",encodeURIComponent(String(t))),n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},{url:ft(n),options:s}},rulecheckRecheck:async(t,i={})=>{const a="/rulecheck/recheck",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}}}},Ii=function(e){const t=Ei(e);return{async productPesticideIndicationList(i,a,n,r,s,o,d,c){const u=await t.productPesticideIndicationList(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)},async ruleList(i,a,n,r,s,o){const d=await t.ruleList(i,a,n,r,s,o);return gt(d,l(),nt,e)}
1,async ruleObjects(i,a,n,r,s,o,d){const c=await t.ruleObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async rulecheckActivityRuleViolations(i,a,n,r,s,o,d){const c=await t.rulecheckActivityRuleViolations(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async rulecheckDismiss(i,a){const n=await t.rulecheckDismiss(i,a);return gt(n,l(),nt,e)},async rulecheckRecheck(i,a){const n=await t.rulecheckRecheck(i,a);return gt(n,l(),nt,e)}}};class _i extends st{productPesticideIndicationList(e={},t){return Ii(this.configuration).productPesticideIndicationList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.regionId,e.pesticideId,t).then((e=>e(this.axios,this.basePath)))}ruleList(e={},t){return Ii(this.configuration).ruleList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}ruleObjects(e,t){return Ii(this.configuration).ruleObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}rulecheckActivityRuleViolations(e,t){return Ii(this.configuration).rulecheckActivityRuleViolations(e.processOrderId,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}rulecheckDismiss(e,t){return Ii(this.configuration).rulecheckDismiss(e.activityRuleViolationId,t).then((e=>e(this.axios,this.basePath)))}rulecheckRecheck(e={},t){return Ii(this.configuration).rulecheckRecheck(e.rulecheckRecheckRequest,t).then((e=>e(this.axios,this.basePath)))}}const Di=function(e){return{sen4VegetationIndexGraph:async(t,i,a,n,r,s,o,l={})=>{dt("sen4VegetationIndexGraph","fieldId",t),dt("sen4VegetationIndexGraph","startDate",i),dt("sen4VegetationIndexGraph","endDate",a),dt("sen4VegetationIndexGraph","indexType",n);const d="/sen4/vegetationIndexGraph",c=new URL(d,lt);let u;e&&(u=e.baseOptions);const p={method:"GET",...u,...l},h={},m={};await ut(h,e),void 0!==r&&(m["version"]=r),void 0!==s&&(m["developerPayload"]=s),void 0!==t&&(m["fieldId"]=t),void 0!==i&&(m["startDate"]=i instanceof Date?i.toISOString().substr(0,10):i),void 0!==a&&(m["endDate"]=a instanceof Date?a.toISOString().substr(0,10):a),void 0!==n&&(m["indexType"]=n),void 0!==o&&(m["statistics"]=o),ht(c,m);let f=u&&u.headers?u.headers:{};return p.headers={...h,...f,...l.headers},{url:ft(c),options:p}}}},Mi=function(e){const t=Di(e);return{async sen4VegetationIndexGraph(i,a,n,r,s,o,d,c){const u=await t.sen4VegetationIndexGraph(i,a,n,r,s,o,d,c);return gt(u,l(),nt,e)}}};class Pi extends st{sen4VegetationIndexGraph(e,t){return Mi(this.configuration).sen4VegetationIndexGraph(e.fieldId,e.startDate,e.endDate,e.indexType,e.version,e.developerPayload,e.statistics,t).then((e=>e(this.axios,this.basePath)))}}const Ti=function(e){return{stockMovementsStockLevels:async(t,i,a,n,r={})=>{dt("stockMovementsStockLevels","companyId",t);const s="/stockMovements/stockLevels",o=new URL(s,lt);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...r},c={},u={};await ut(c,e),void 0!==i&&(u["version"]=i),void 0!==a&&(u["developerPayload"]=a),void 0!==t&&(u["companyId"]=t),void 0!==n&&(u["timestamp"]=n),ht(o,u);let p=l&&l.headers?l.headers:{};return d.headers={...c,...p,...r.headers},{url:ft(o),options:d}}}},xi=function(e){const t=Ti(e);return{async stockMovementsStockLevels(i,a,n,r,s){const o=await t.stockMovementsStockLevels(i,a,n,r,s);return gt(o,l(),nt,e)}}};class Bi extends st{stockMovementsStockLevels(e,t){return xi(this.configuration).stockMovementsStockLevels(e.companyId,e.version,e.developerPayload,e.timestamp,t).then((e=>e(this.axios,this.basePath)))}}const Oi=function(e){return{storagePlaceList:async(t,i,a,n,r,s,o={})=>{const l="/storagePlaces",d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==t&&(h["version"]=t),void 0!==i&&(h["deleted"]=i),void 0!==a&&(h["pageKey"]=a),void 0!==n&&(h["developerPayload"]=n),void 0!==r&&(h["properties"]=r),void 0!==s&&(h["companyId"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}},storagePlaceObjects:async(t,i,a,n,r,s,o={})=>{dt("storagePlaceObjects","objectIds",t);const l="/storagePlaces/{objectIds}".replace("{objectIds}",encodeURIComponent(String(t))),d=new URL(l,lt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},p={},h={};await ut(p,e),void 0!==i&&(h["version"]=i),void 0!==a&&(h["deleted"]=a),void 0!==n&&(h["pageKey"]=n),void 0!==r&&(h["developerPayload"]=r),void 0!==s&&(h["properties"]=s),ht(d,h);let m=c&&c.headers?c.headers:{};return u.headers={...p,...m,...o.headers},{url:ft(d),options:u}}}},$i=function(e){const t=Oi(e);return{async storagePlaceList(i,a,n,r,s,o,d){const c=await t.storagePlaceList(i,a,n,r,s,o,d);return gt(c,l(),nt,e)},async storagePlaceObjects(i,a,n,r,s,o,d){const c=await t.storagePlaceObjects(i,a,n,r,s,o,d);return gt(c,l(),nt,e)}}};class Ri extends st{storagePlaceList(e={},t){return $i(this.configuration).storagePlaceList(e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,e.companyId,t).then((e=>e(this.axios,this.basePath)))}storagePlaceObjects(e,t){return $i(this.configuration).storagePlaceObjects(e.objectIds,e.version,e.deleted,e.pageKey,e.developerPayload,e.properties,t).then((e=>e(this.axios,this.basePath)))}}const Ni=function(e){return{trackLiveCheck:async(t,i={})=>{const a="/track/liveCheck",n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"POST",...r,...i},o={},l={};await ut(o,e),o["Content-Type"]="application/json",ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},s.data=mt(t,s,e),{url:ft(n),options:s}},tracksGpsTrack:async(t,i={})=>{dt("tracksGpsTrack","trackId",t);const a="/tracks/{trackId}/gpsTrack".replace("{trackId}",encodeURIComponent(String(t))),n=new URL(a,lt);let r;e&&(r=e.baseOptions);const s={method:"GET",...r,...i},o={},l={};await ut(o,e),ht(n,l);let d=r&&r.headers?r.headers:{};return s.headers={...o,...d,...i.headers},{url:ft(n),options:s}}}},zi=function(e){const t=Ni(e);return{async trackLiveCheck(i,a){const n=await t.trackLiveCheck(i,a);return gt(n,l(),nt,e)},async tracksGpsTrack(i,a){const n=await t.tracksGpsTrack(i,a);return gt(n,l(),nt,e)}}};class Li extends st{trackLiveCheck(e={},t){return zi(this.configuration).trackLiveCheck(e.trackLiveCheckRequest,t).then((e=>e(this.axios,this.basePath)))}tracksGpsTrack(e,t){return zi(this.configuration).tracksGpsTrack(e.trackId,t).then((e=>e(this.axios,this.basePath)))}}const Vi=function(e){return{uploadFile:async(t,i,a,n={})=>{dt("uploadFile","uploadId",t),dt("uploadFile","contentLength",i),dt("uploadFile","contentRange",a);const r="/upload/file/{uploadId}".replace("{uploadId}",encodeURIComponent(String(t))),s=new URL(r,lt);let o;e&&(o=e.baseOptions);const l={method:"PUT",...o,...n},d={},c={};await ut(d,e),null!=i&&(d["Content-Length"]=String(i)),null!=a&&(d["Content-Range"]=String(a)),ht(s,c);let u=o&&o.headers?o.headers:{};return l.headers={...d,...u,...n.headers},{url:ft(s),options:l}}}},Ui=function(e){const t=Vi(e);return{async uploadFile(i,a,n,r){const s=await t.uploadFile(i,a,n,r);return gt(s,l(),nt,e)}}};
1class ji extends st{uploadFile(e,t){return Ui(this.configuration).uploadFile(e.uploadId,e.contentLength,e.contentRange,t).then((e=>e(this.axios,this.basePath)))}}const Hi=function(e){return{weatherAggregate:async(t,i,a,n,r,s,o,l,d,c,u,p={})=>{dt("weatherAggregate","latitude",t),dt("weatherAggregate","longitude",i),dt("weatherAggregate","startDate",a),dt("weatherAggregate","endDate",n),dt("weatherAggregate","variables",r);const h="/weather/aggregate",m=new URL(h,lt);let f;e&&(f=e.baseOptions);const g={method:"GET",...f,...p},y={},v={};await ut(y,e),void 0!==s&&(v["version"]=s),void 0!==o&&(v["developerPayload"]=o),void 0!==t&&(v["latitude"]=t),void 0!==i&&(v["longitude"]=i),void 0!==a&&(v["startDate"]=a instanceof Date?a.toISOString().substr(0,10):a),void 0!==n&&(v["endDate"]=n instanceof Date?n.toISOString().substr(0,10):n),r&&(v["variables"]=r.join(rt.csv)),void 0!==l&&(v["aggregate"]=l),void 0!==d&&(v["statistics"]=d),void 0!==c&&(v["tempBaseCrop"]=c),void 0!==u&&(v["dateAccumulate"]=u instanceof Date?u.toISOString().substr(0,10):u),ht(m,v);let b=f&&f.headers?f.headers:{};return g.headers={...y,...b,...p.headers},{url:ft(m),options:g}}}},Gi=function(e){const t=Hi(e);return{async weatherAggregate(i,a,n,r,s,o,d,c,u,p,h,m){const f=await t.weatherAggregate(i,a,n,r,s,o,d,c,u,p,h,m);return gt(f,l(),nt,e)}}};class Wi extends st{weatherAggregate(e,t){return Gi(this.configuration).weatherAggregate(e.latitude,e.longitude,e.startDate,e.endDate,e.variables,e.version,e.developerPayload,e.aggregate,e.statistics,e.tempBaseCrop,e.dateAccumulate,t).then((e=>e(this.axios,this.basePath)))}}function Zi(e,t){if(!e?.categoryId)return!1;const i=t[e.categoryId];return!!i&&i.type===At.Herb}var Ki=Zi;function qi(e,t){if(!e.sgdVersion)return!0;const i=t[0]?.sgdVersion,a=t.every((e=>e.sgdVersion===i));if(!a)throw new Error("processOrders must have same sgdVersion defined");return null===i||i===e.sgdVersion}function Yi(e,t,i){return!Ki(e,i)||!e?.pesticide?.gracePeriodUsageDate||e.pesticide.gracePeriodUsageDate>(t.length>0?Math.min(...t):0)}function Ji(e,t){if(na(e)){const i=t[0]?.regionId,a=t.every((e=>e.regionId===i));if(!a)return!1;const n=e.regionId===i;return n}return 1===e.companyClusterSync}function Xi(e,t,i,a){const n=[e,...t];if(0===n.length||0===i.length)return!0;const r=n.map((e=>e.id)),s=i.map((e=>e.id)),o=a.filter((e=>r.includes(e.productId)&&s.includes(e.companyId)));if(0===o.length)return!0;const l=o.some((e=>1===e.visible));return l}function Qi(e){const t=[];return e.forEach((e=>{sa(e)&&t.push(e),oa(t,e)||t.push(e)})),t}function ea(e,t){return sa(e)?[]:t.filter((t=>t.relatedMaterialId===e.relatedMaterialId))}function ta(e,t){return!!e.mainCropId&&t.includes(e.mainCropId)}function ia(e,t){return!t||e.categoryId!==t}function aa(e,t){const i=e.id.split("_")[0];return t.includes(i)}function na(e){return sa(e)&&!e.companyId}function ra(e,t){return e.id===t.id||e.relatedMaterialId===t.relatedMaterialId&&null!==e.relatedMaterialId&&null!==t.relatedMaterialId}function sa(e){return!e.relatedMaterialId}function oa(e,t){return e.some((e=>e.relatedMaterialId===t.relatedMaterialId))}function la(e){return"object"===typeof e&&null!=e&&"id"in e&&"name"in e}function da(e){return Math.round(e/1e3)}function ca(e){return 1e3*e}var ua,pa=i(86502),ha=i(19395);function ma(){return(0,pa.Z)().toUpperCase()}function fa(e,t){return(0,ha.Z)(e,ga(t.toUpperCase()))}function ga(e){const t=new Uint8Array(16),i=e.replace(/-/g,"");for(let a=0;a<16;a+=1)t[a]=parseInt(i.substring(2*a,2*a+2),16);return t}function ya(e){return"object"===typeof e&&null!=e&&"amount"in e&&"unitId"in e&&"isFixed"in e}function va(e,t){return Object.values(t).find((t=>t.name===e))}function ba(e,t){const i=e.numeratorUnitId;if(!i)return null;const a=t[i];return a||null}function wa(e,t){if(e&&e.groupId){const i=Object.values(t).filter((t=>t.groupId===e?.groupId&&null!==t.byUnitId&&!t.isPerLoad)),a=i.find((t=>t.name===`${e.name}/ha`));if(a)return a;const n=i[0];if(n)return n}return null}function Ca(e){return!(null!==e.byUnitId&&!e.isPerLoad)}function Fa(e){return null!==e.byUnitId&&!e.isPerLoad}(function(e){e["Total"]="total",e["PerHa"]="perHa"})(ua||(ua={}));class Aa{constructor(e,t,i){(0,tt.Z)(this,"units",void 0),(0,tt.Z)(this,"productService",void 0),(0,tt.Z)(this,"calculateAmou
1ntsAndUnits",void 0),this.units=e,this.productService=t,this.calculateAmountsAndUnits=i}updateActivityProductsFromChange(e,t,i){const[,a,,n,{activityProductId:r}]=t,s=a.split(".").slice(1).join(".");let o=Aa.findOrCreateActivityProduct(r,e);o=this.updateActivityProduct(o,s,n,i);const l=Aa.addOrReplaceActivityProduct(o,e);return l}static createActivityProduct(e){return{id:e??ma(),productId:"",amount:null,deleted:null,tstamp:da(Date.now())}}findUnitIdWithFallback(e){const{productId:t,unitId:i}=e;if(i)return i;if(!t)return;const a=this.productService.findProductById(t);return a?.unitId}getUnitIdWithFallback(e){const t=this.findUnitIdWithFallback(e);if(!t)throw new Error(`UnitId of activityProduct ${e.id} is not set`);return t}static findOrCreateActivityProduct(e,t){if(!e)return Aa.createActivityProduct();const i=t.find((t=>t.id===e));return i||Aa.createActivityProduct(e)}updateActivityProduct(e,t,i,a){switch(t){case"productStorageDropdownItem":if(!la(i))throw new Error(`Cannot update product and storage place with non DropdownItem value: ${i}`);return this.updateProductStorageAndOptionalUnit(e,i,a);case"pesticideIndicationDropdownItem":if(!la(i))throw new Error(`Cannot update pesticide indication with non DropdownItem value: ${i}`);return Aa.updatePestAndPesticideIndication(e,i);case"amountUnitRelative":case"amountUnitTotal":if(!ya(i))throw new Error(`Cannot update amount and unit with non AmountUnitPair value: ${i}`);return this.updateAmountAndUnit(e,t,i);default:throw new Error(`Unsupported key ${t}`)}}updateProductStorageAndOptionalUnit(e,t,i){if(!t.id)throw new Error("DropdownItem id is not set");const[a,n]=t.id.split("_"),{amount:r}=e,s=this.getUnitId(a);let o=this.setProductOrSibling(e,a,i);return o=Aa.setStoragePlaceId(o,n),o=Aa.setUnitId(o,s),o=Aa.setAmount(o,r),o}static updatePestAndPesticideIndication(e,t){if(!t.id)throw new Error("DropdownItem id is not set");const[i,a]=t.id.split("_");return{...e,pestId:i,pesticideIndicationId:a}}updateAmountAndUnit(e,t,i){const a=i.amount,n=this.getUnitIdWithFallback(e),r=this.findUnitIdOfAmountType(t,n);return{...e,amount:a,unitId:r}}updateUnit(e,t,i){if(!e.unitId||!e.amount)return{...e,unitId:t};const a=this.calculateAmountsAndUnits(e.amount,e.unitId,i,this.units),n=this.units[t];if(Ca(n))return{...e,unitId:t,amount:a.amountUnitTotal.amount};if(Fa(n))return{...e,unitId:t,amount:a.amountUnitRelative.amount};throw new Error(`Unsupported unit ${n}`)}getAmountsAndUnits(e,t){const{amount:i}=e,a=this.findUnitIdWithFallback(e);return this.calculateAmountsAndUnits(i,a,t,this.units)}static setStockLevelValues(e,t){return{...e,...t}}static addOrReplaceActivityProduct(e,t){const i=t.findIndex((t=>t.id===e.id));return-1===i?[...t,e]:[...t.slice(0,i),e,...t.slice(i+1)]}getUnitId(e){const t=this.productService.getProductById(e);if(!t.unitId)throw new Error(`UnitId not set for product ${e}`);return t.unitId}findUnitIdOfAmountType(e,t){const i=this.units[t];if(!i)throw new Error(`Unit ${t} not found`);switch(e){case"amountUnitRelative":return Fa(i)?t:wa(i,this.units)?.id;case"amountUnitTotal":return Ca(i)?t:ba(i,this.units)?.id;default:throw new Error(`Unsupported key ${e}`)}}setProductOrSibling(e,t,i){const a=this.productService.getProductOrSibling(t,i),n=Xe()(e);return n.productId=a.id,n}isSibling(e,t){if(e.unitId!=t.unitId)return!1;if(e.storagePlaceId!=t.storagePlaceId)return!1;const i=this.productService.findProductById(e.productId),a=this.productService.findProductById(t.productId),n=!i&&!a,r=!(!i||!a);return!!(n||r&&ra(i,a))}getCompanyId(e){const t=this.productService.findProductById(e.productId);return t?.companyId??null}getProduct(e){if(e.productId)return this.productService.getProductById(e.productId)}static setUnitId(e,t){const i=Xe()(e);return i.unitId=t,i}static setStoragePlaceId(e,t){const i=Xe()(e);return i.storagePlaceId=t,i}static setAmount(e,t){const i=Xe()(e);return i.amount=t,i}}function ka(e){return null!==e&&void 0!==e}class Sa{static toSyncableActivities(e){return e.map((e=>Sa.toSyncableActivity(e)))}static toSyncableActivity(e){const t=Sa.toSyncableActivityProducts(e.products),i=Sa.toSyncableActivityEquipments(e.equipment);return{...e,products:t,equipment:i}}static toSyncableActivityProducts(e){return e.map((e=>Sa.toSyncableActivityProduct(e))).filter(ka)}static toSyncableActivityProduct(e){return Sa.isSyncableActivityProduct(e)?null==e.amount&&null!=e.unitId?{...e,amount:0}:null!=e.amount&&null==e.unitId?{...e,amount:null,unitId:null}:e:null}static isSyncableActivityProduct(e){return""!==e.productId}static toSyncableActivityEquipments(e){return e.map((e=>Sa.toSyncableActivityEquipment(e))).filter(ka)}static toSyncableActivityEquipment(e){return Sa.isSyncableActivityEquipment(e)?e:null}static isSyncableActivityEquipment(e){return""!==e.equipmentId}}function Ea(e,t){return Math.round(e*10**t)/10**t}const Ia=(e,t,i,a)=>
1{if(!Fa(t)||!t.byUnitId)throw new Error("Unit is not relative");const n=va("ha",a);if(!n)throw new Error("Ha unit not found");if(t.byUnitId===n.id)return e*i;const r=a[t.byUnitId],s=Da(i,n,r);return s?e*s:null},_a=(e,t,i,a)=>{if(0===e)return 0;if(!Fa(t))throw new Error("Unit is not relative");const n=va("ha",a);if(!n)throw new Error("Ha unit not found");if(t.byUnitId===n.id)return e/i;const r=e/i,s=Da(r,n,t);return s||null};function Da(e,t,i){if(!xa(t,i))return null;const a=Pa(e,t);if(!a)return null;const n=Ta(a,i);return n||null}function Ma(e){return!e.siUnitId}function Pa(e,t){return Ma(t)?e:t.siFactor?e*t.siFactor:null}function Ta(e,t){return Ma(t)?e:t.siFactor?e/t.siFactor:null}function xa(e,t){return(e.siUnitId===t.siUnitId&&null!==e.siUnitId&&null!==t.siUnitId||e.id===t.siUnitId||e.siUnitId===t.id)&&Ba(e)===Ba(t)}function Ba(e){return e.isPerLoad?Oa.PER_LOAD:e.byUnitId?Oa.DIVISOR:Oa.TOTAL}var Oa;function $a(e,t,i,a){if(!t)return za;const n=a[t];if(!n)return za;if(Ca(n))return Ra(e,n,i,a);if(Fa(n))return Na(e,n,i,a);throw new Error(`Unit ${n.id} is neither relative nor total unit. This shouldn't happen.`)}function Ra(e,t,i,a){const n=wa(t,a),r="number"===typeof e&&"number"===typeof i&&n?_a(e,n,i,a):null,s="number"===typeof r?Ea(r,2):null;return{amountUnitRelative:{amount:s,unitId:n?.id??null,isFixed:!1},amountUnitTotal:{amount:e??null,unitId:t.id,isFixed:!0}}}function Na(e,t,i,a){const n=ba(t,a),r="number"===typeof e&&"number"===typeof i&&n?Ia(e,t,i,a):null,s="number"===typeof r?Ea(r,2):null;return{amountUnitRelative:{amount:e??null,unitId:t.id,isFixed:!0},amountUnitTotal:{amount:s,unitId:n?.id??null,isFixed:!1}}}(function(e){e[e["TOTAL"]=0]="TOTAL",e[e["DIVISOR"]=1]="DIVISOR",e[e["PER_LOAD"]=2]="PER_LOAD"})(Oa||(Oa={}));const za={amountUnitRelative:{amount:null,unitId:null,isFixed:!1},amountUnitTotal:{amount:null,unitId:null,isFixed:!1}};class La{constructor(e,t,i,a,n,r,s,o,l,d){(0,tt.Z)(this,"mineralFertilizers",void 0),(0,tt.Z)(this,"companyFertilizers",void 0),(0,tt.Z)(this,"secondaryFertilizers",void 0),(0,tt.Z)(this,"herbizides",void 0),(0,tt.Z)(this,"crops",void 0),(0,tt.Z)(this,"miscellaneous",void 0),(0,tt.Z)(this,"harvests",void 0),(0,tt.Z)(this,"seeds",void 0),(0,tt.Z)(this,"otherProductsAndFertilizers",void 0),(0,tt.Z)(this,"waads",void 0),this.mineralFertilizers=e,this.companyFertilizers=t,this.secondaryFertilizers=i,this.herbizides=a,this.crops=n,this.miscellaneous=r,this.harvests=s,this.seeds=o,this.otherProductsAndFertilizers=l,this.waads=d}get allProducts(){return[...Object.values(this.mineralFertilizers),...Object.values(this.companyFertilizers),...Object.values(this.secondaryFertilizers),...Object.values(this.herbizides),...Object.values(this.crops),...Object.values(this.miscellaneous),...Object.values(this.harvests),...Object.values(this.seeds),...Object.values(this.otherProductsAndFertilizers),...Object.values(this.waads)]}findProductById(e){return this.companyFertilizers[e]?this.companyFertilizers[e]:this.mineralFertilizers[e]?this.mineralFertilizers[e]:this.secondaryFertilizers[e]?this.secondaryFertilizers[e]:this.herbizides[e]?this.herbizides[e]:this.crops[e]?this.crops[e]:this.miscellaneous[e]?this.miscellaneous[e]:this.harvests[e]?this.harvests[e]:this.seeds[e]?this.seeds[e]:this.otherProductsAndFertilizers[e]?this.otherProductsAndFertilizers[e]:this.waads[e]?this.waads[e]:void 0}getProductById(e){const t=this.findProductById(e);if(!t)throw new Error(`Product with id ${e} not found`);return t}findProductOfCompany(e,t){const i=this.findProductById(e);if(!i||!i.companyId)return;if(i.companyId===t)return i;const a=ea(i,this.allProducts);return a.find((e=>e.companyId===t))}getProductOrSibling(e,t){const i=this.getProductById(e);if(null==i.companyId)return i;const a=this.findProductOfCompany(e,t);if(!a)throw new Error(`Product of company with id ${e} not found`);return a}}function Va(e,t,i){const a=t.reduce(((e,t)=>e+(t.processedArea??0)),0);return(e.processedArea??0)/a*i}var Ua=Va,ja=i(72307),Ha=i.n(ja);function Ga(e){if(e.length<=1)return!1;const{clusterId:t}=e[0],i=e.every((e=>e.clusterId===t));return!!i&&null!==t}class Wa{constructor(e){(0,tt.Z)(this,"equipment",void 0),this.equipment=e}findEquipmentById(e){return this.equipment[e]}getEquipmentById(e){const t=this.findEquipmentById(e);if(!t)throw new Error(`Equipment with id ${e} not found`);return t}findEquipmentOfCompany(e,t){const i=this.findEquipmentById(e);if(!i||!i.companyId)return;if(i.companyId===t)return i;const a=this.findSiblingsOfEquipment(i);return a.find((e=>e.companyId===t))}getEquipmentOrSibling(e,t){const i=this.getEquipmentById(e);if(!Wa.isCompanySpecificEquipment(i))return i;const a=this.findEquipmentOfCompany(e,t);if(!a)throw new Error(`Equipment of company with id ${e} not found`);return a}findEquipmentForActivityEquipment(e,t){const i=this.findEquipmentById(e);if(i)return Wa.isCompanySpecificEquipment(i)?this.findEquipmentOfCompany(e,t):i}static isCompanySpecificEquipment(e){return null!==e.companyId}getCompatibleEquipments(e,t){let i=Object.values(this.equipment).filter((t=>Wa.filterUsableEquipments(t,e)));
1return 1===t.length?i=i.filter((e=>e.companyId===t[0].id)):Ga(t)&&(i=i.filter(Wa.filterMulticompany)),i}getCompatibleEquipmentsToDropdownItems(e,t,i){const a=this.getCompatibleEquipments(e,t),n=Wa.filterSiblingDuplicates(a),r=n.map((e=>Wa.toDropdownItem(e))),s={name:b["default"].i18n.translate("Zuletzt verwendet")||"Zuletzt verwendet",id:"equipment-used",items:r.filter((e=>i.includes(e.id||""))),sort:!1},o={name:b["default"].i18n.translate("Maschinen & Geräte")||"Maschinen & Geräte",id:"equipment-others",items:r.filter((e=>!i.includes(e.id||""))),sort:!0};return[s,o]}findDropdownItem(e){const t=this.findEquipmentById(e);if(t)return Wa.toDropdownItem(t)}static toDropdownItem(e){return{id:e.id,name:e.name}}static isSibling(e,t){return!!Ha()(e,t)||!Wa.isEquipmentWithoutSiblings(e)&&!Wa.isEquipmentWithoutSiblings(t)&&e.relatedEquipmentId===t.relatedEquipmentId}findSiblingsOfEquipment(e){return null===e.companyId?[]:Object.values(this.equipment).filter((t=>Wa.isSibling(e,t)))}static filterUsableEquipments(e,t){return t.some((t=>t.usableEquipmentCategories.includes(e.equipmentCategoryId)))}static filterMulticompany(e){return e.companyClusterSync}static filterSiblingDuplicates(e){const t=[];return e.forEach((e=>{Wa.isEquipmentWithoutSiblings(e)&&t.push(e),Wa.containsSibling(t,e)||t.push(e)})),t}static isEquipmentWithoutSiblings(e){return null===e.relatedEquipmentId}static containsSibling(e,t){return e.some((e=>e.relatedEquipmentId===t.relatedEquipmentId))}}class Za{constructor(e){(0,tt.Z)(this,"equipmentService",void 0),this.equipmentService=e}updateActivityEquipmentsFromChange(e,t,i){const[,a,,n,{activityEquipmentId:r}]=t,s=a.split(".").slice(1).join(".");let o=Za.findOrCreateActivityEquipment(r,e);o=this.updateActivityEquipment(o,s,n,i);const l=Za.addOrReplaceActivityEquipment(o,e);return l}static createActivityEquipment(e,t){return{id:e??ma(),equipmentId:t??"",tstamp:da(Date.now())}}setEquipmentOrSibling(e,t,i){const a=this.equipmentService.getEquipmentOrSibling(t,i),n=Xe()(e);return n.equipmentId=a.id,n}isSibling(e,t){if(Ha()(e,t))return!0;const i=this.equipmentService.findEquipmentById(e.equipmentId),a=this.equipmentService.findEquipmentById(t.equipmentId),n=!i&&!a,r=!(!i||!a);return!!(n||r&&Wa.isSibling(i,a))}static findOrCreateActivityEquipment(e,t){if(!e)return Za.createActivityEquipment();const i=t.find((t=>t.id===e));return i||Za.createActivityEquipment(e)}updateActivityEquipment(e,t,i,a){switch(t){case"dropdownItem":{if(!i.id)return{...e,equipmentId:""};const t=this.setEquipmentOrSibling(e,i.id,a);return t}default:throw new Error(`Unsupported key ${t}`)}}static addOrReplaceActivityEquipment(e,t){const i=t.findIndex((t=>t.id===e.id));return-1===i?[...t,e]:[...t.slice(0,i),e,...t.slice(i+1)]}getCompanyId(e){const t=this.equipmentService.findEquipmentById(e.equipmentId);return t?.companyId??null}}class Ka{constructor(e,t,i,a,n){(0,tt.Z)(this,"activities",void 0),(0,tt.Z)(this,"fieldService",void 0),(0,tt.Z)(this,"activityEquipmentService",void 0),(0,tt.Z)(this,"activityProductService",void 0),(0,tt.Z)(this,"companyService",void 0),this.activities=e,this.fieldService=t,this.activityEquipmentService=i,this.activityProductService=a,this.companyService=n}static createActivity(e){return{id:e??ma(),deleted:null,tstamp:0,userId:null,processOrderId:"",trackId:null,activityTypeId:"",fieldId:null,userComment:null,timeStart:da(Date.now()),files:[],timeFinish:null,creationDate:null,processedArea:null,workingWidth:null,workingTime:null,drivingTime:null,setupTime:null,pauseTime:null,isCopy:!1,processingState:null,completed:!1,inspectionConducted:!1,products:[],equipment:[]}}getActivity(e){const t=this.activities[e];return t??null}getCropOfActivity(e){const t=this.activities[e];if(!t)throw new Error(`Activity with id ${e} not found`);const{fieldId:i}=t;return i?this.fieldService.getCropOfField(i):null}getCompanyOfActivity(e){const t=this.getActivity(e);if(!t)throw new Error(`Activity with id ${e} not found`);if(!t.processOrderId)throw Error("Activity must have a process order id");return this.companyService.getCompanyByProcessOrder(t.processOrderId)}findActivityEquipmentsOrSiblings(e,t){return e.equipment.filter((e=>this.activityEquipmentService.isSibling(e,t)))}findActivityProductsOrSiblings(e,t){return e.products.filter((e=>this.activityProductService.isSibling(e,t)))}static findActivityEquipmentsById(e,t){return e.equipment.filter((e=>t.includes(e.id)))}addActivityEquipment(e,t){if(!this.isCompatibleActivityEquipment(e,t))throw new Error(`Activity equipment ${t.id} is not compatible with activity`);e.equipment.push(t)}addActivityProduct(e,t){if(!this.isCompatibleActivityProduct(e,t))throw new Error(`Activity product ${t.id} is not compatible with activity`);e.products.push(t)}isCompatibleActivityEquipment(e,t){const i=this.activityEquipmentService.getCompanyId(t);if(!i)return!0;const a=this.companyService.getCompanyByProcessOrder(e.processOrderId).id;return null===a||a===i}isCompatibleActivityProduct(e,t){const i=this.activityProductService.getCompanyId(t);if(!i)return!0;const a=this.companyService.getCompanyByProcessOrder(e.processOrderId).id;return null===a||a===i}}class qa{constructor(e){(0,tt.Z)(this,"companies",void 0),this.companies=e}getCompanyByProcessOrder(e){const t=this.findCompanyByProcessOrder(e);if(!t)throw new Error(`Company with process order id ${e} not found`);return t}findCompanyByProcessOrder(e){return Object.values(this.companies).find((t=>t.processOrders.some((t=>
1t.id===e))))}}class Ya{constructor(e,t){(0,tt.Z)(this,"fields",void 0),(0,tt.Z)(this,"findProductById",void 0),this.fields=e,this.findProductById=t}getCropOfField(e){const t=this.fields[e];if(!t)return null;const{cropId:i}=t;if(!i)return null;const a=this.findProductById(i);return a}}function Ja(e,t,i){const a=new Wa(t.equipments.data),n=new Za(a),r=new La(t.products.mineralFertilizers.data,t.products.companyFertilizers.data,t.products.secondaryFertilizers.data,t.products.herbizides.data,t.products.crops.data,t.products.miscellaneous.data,t.products.harvests.data,t.products.seeds.data,t.products.otherProductsAndFertilizers.data,t.products.waads.data),s=new Aa(t.units.data,r,$a),o=new Ya(t.fields.data,i["products/findProductById"]),l=new qa(t.auth.companiesById),d=new Ka(t.activities.data,o,n,s,l),c=new at(e.activities,s);return{activityEquipmentService:n,activityProductService:s,companyService:l,activityService:d,findService:c}}function Xa({state:e,commit:t,rootState:i,rootGetters:a},n){const{activityProductService:r,companyService:s,activityService:o,findService:l}=Ja(e,i,a),d=Xe()(l.getActivityProduct(n.activityProductId)),c=Xe()(n.updateValues);e.activities.forEach((i=>{const a=Xe()(i),l=o.findActivityProductsOrSiblings(a,d);if(!i.processOrderId)throw Error("Activity must have a process order id");const u=s.getCompanyByProcessOrder(i.processOrderId).id;c.amount=Ua(i,e.activities,n.updateValues.amount),l.length>0?Qa(l,c,u,a.id,r,t):tn(a,c,u,o,r,t)}))}function Qa(e,t,i,a,n,r){e.forEach((e=>{en(e,t,i,a,n,r)}))}function en(e,t,i,a,n,r){const s=an(e,t,i,n);r("setActivityProduct",{activityId:a,activityProduct:s})}function tn(e,t,i,a,n,r){const s=Aa.createActivityProduct(),o=an(s,t,i,n);a.addActivityProduct(e,o),r("addActivityProduct",{activityId:e.id,activityProduct:e.products.slice(-1)[0]})}function an(e,t,i,a){let n=Xe()(e);return n=a.setProductOrSibling(e,t.productId,i),n=Aa.setUnitId(n,t.unitId),n=Aa.setStoragePlaceId(n,t.storagePlaceId),n.amount=t.amount,n}function nn({state:e,commit:t,rootState:i,rootGetters:a},n){const{activityService:r,findService:s}=Ja(e,i,a),o=Xe()(s.getActivityEquipment(n));e.activities.forEach((e=>{const i=r.findActivityEquipmentsOrSiblings(e,o);i.length>0&&rn(e.id,i,t)}))}function rn(e,t,i){t.forEach((t=>{i("removeActivityEquipment",{activityId:e,activityEquipmentId:t.id})}))}function sn({state:e,commit:t,rootState:i,rootGetters:a},n){const{activityService:r,findService:s}=Ja(e,i,a),o=Xe()(s.getActivityProduct(n));e.activities.forEach((e=>{const i=r.findActivityProductsOrSiblings(e,o);i.length>0&&on(e.id,i,t)}))}function on(e,t,i){t.forEach((t=>{i("removeActivityProduct",{activityId:e,activityProductId:t.id})}))}function ln({state:e,rootState:t,rootGetters:i,getters:a,commit:n},r){n("setProductAmountMode",r);const{activityProductService:s}=Ja(e,t,i),o=t.units.data,l=a.sumProcessedArea,d=a.mergedActivityProducts;d.forEach((e=>{const i=s.findUnitIdWithFallback(e);if(!i)return;const a=o[i];if(!a)return;const d=dn(a,r,o);if(!d)return;const c=s.updateUnit(e,d.id,l),u=c.unitId?o[c.unitId]:null;u&&n("updateAmountAndUnitOnActivityProductInAllActivities",{activityProductId:e.id,updateValues:{amount:c.amount,unit:u},rootState:t})}))}function dn(e,t,i){return t===ua.PerHa?Fa(e)?e:wa(e,i):Fa(e)?ba(e,i):e}function cn(e,t,i,a,n){const r=un(e,i),s=pn(t,r,a,n);return{...e,activityTypeId:s.id}}function un(e,t){if(""===e.processOrderId)return null;if(!e.processOrderId)throw Error("Activity must have a process order id");return t(e.processOrderId)}function pn(e,t,i,a){return t?i(e,t.id):a(e)}function hn({state:e,commit:t,rootGetters:i},a){e.activities.forEach((e=>{const n=cn(e,a,i["auth/getCompanyByProcessOrderId"],i["activityTypes/getActivityTypeOfCompanyBySyncName"],i["activityTypes/getBySyncName"]);t("setActivityTypeId",{activityId:e.id,activityTypeId:n.activityTypeId})}))}function mn({state:e,commit:t,rootState:i,rootGetters:a},n){const{activityEquipmentService:r,companyService:s,activityService:o,findService:l}=Ja(e,i,a),d=Xe()(l.getActivityEquipment(n.activityEquipmentId));e.activities.forEach((e=>{const i=Xe()(e),a=o.findActivityEquipmentsOrSiblings(i,d);if(!e.processOrderId)throw Error("Activity must have a process order id");const l=s.getCompanyByProcessOrder(e.processOrderId).id;a.length>0?fn(a,n.equipmentId,l,i.id,r,t):yn(i,n.equipmentId,l,o,r,t)}))}function fn(e,t,i,a,n,r){e.forEach((e=>{gn(e,t,i,a,n,r)}))}function gn(e,t,i,a,n,r){const s=n.setEquipmentOrSibling(e,t,i);r("setActivityEquipment",{activityId:a,activityEquipment:s})}function yn(e,t,i,a,n,r){let s=Za.createActivityEquipment();s=n.setEquipmentOrSibling(s,t,i),a.addActivityEquipment(e,s),r("addActivityEquipment",{activityEquipment:e.equipment.slice(-1)[0],activityId:e.id})}function vn({state:e,commit:t,rootState:i,rootGetters:a},n){const{activityService:r,findService:s}=Ja(e,i,a),o=Xe()(s.getActivityProduct(n.activityProductId));
1e.activities.forEach((e=>{const i=Xe()(e),a=r.findActivityProductsOrSiblings(i,o);a.length>0?bn(a,n.updateValues,i.id,t):Cn(i,n.updateValues,r,t)}))}function bn(e,t,i,a){e.forEach((e=>{wn(e,t,i,a)}))}function wn(e,t,i,a){const n=Fn(e,t);a("setActivityProduct",{activityId:i,activityProduct:n})}function Cn(e,t,i,a){let n=Aa.createActivityProduct();n=Fn(n,t),i.addActivityProduct(e,n),a("addActivityProduct",{activityId:e.id,activityProduct:e.products.slice(-1)[0]})}function Fn(e,{pestId:t,pesticideIndicationId:i}){const a=Xe()(e);return a.pestId=t,a.pesticideIndicationId=i,a}function An({state:e,commit:t,dispatch:i,getters:a,rootState:n,rootGetters:r},s){const{activityProductService:o,companyService:l,activityService:d,findService:c}=Ja(e,n,r),u=Xe()(c.getActivityProduct(s.activityProductId));e.activities.forEach((e=>{const i=Xe()(e),a=d.findActivityProductsOrSiblings(i,u);if(!e.processOrderId)throw Error("Activity must have a process order id");const n=l.getCompanyByProcessOrder(e.processOrderId).id;a.length>0?kn(a,s.updateValues,n,i.id,o,t):En(i,s.updateValues,n,d,o,t)})),i("setProductAmountModeForAllProducts",a.productAmountMode)}function kn(e,t,i,a,n,r){e.forEach((e=>{Sn(e,t,i,a,n,r)}))}function Sn(e,t,i,a,n,r){const s=In(e,t,i,n);r("setActivityProduct",{activityId:a,activityProduct:s})}function En(e,t,i,a,n,r){const s=Aa.createActivityProduct(),o=In(s,t,i,n);a.addActivityProduct(e,o),r("addActivityProduct",{activityId:e.id,activityProduct:e.products.slice(-1)[0]})}function In(e,{referenceProductId:t,storagePlaceId:i},a,n){let r=n.setProductOrSibling(e,t,a);const s=n.getProduct(r)?.unitId??null;return r=Aa.setUnitId(r,s),r=Aa.setStoragePlaceId(r,i),r}function _n(e,t,i){e.forEach((e=>{const{amount:a,unitId:n}=e;if(!a||!n)return;const r=t[n];i("updateAmountAndUnitOnActivityProductInAllActivities",{activityProductId:e.id,updateValues:{amount:a,unit:r}})}))}var Dn=_n;const Mn={setupEditActivityStore({rootState:e,commit:t},i){const a=[];i.forEach((t=>{const i=Xe()(e.activities.data[t]);a.push(i)})),t("setActivities",a),a.some((e=>e.products.length>0))||t("createActivityProduct"),a.some((e=>e.equipment.length>0))||t("createActivityEquipment"),t("setWorkflowKey","editActivity")},updateActivityType:hn,addFavouriteProducts({commit:e,dispatch:t,getters:i,state:a},n){e("removeAllActivityProductsWithoutProductId"),n.products.forEach((t=>{const i={...Aa.createActivityProduct(),...t};e("addActivityProductToAllActivities",i)})),a&&a.activities[0].products.forEach((e=>{t("updateProductOnActivityProductInAllActivities",{activityProductId:e.id,updateValues:{referenceProductId:e.productId,storagePlaceId:e.storagePlaceId}})}));const r=i.mergedActivityProducts?.[0];r&&e("setCurrentActivityProductId",r.id)},updateActivitiesBasedOnSelectedFields({rootState:e,state:t,commit:i,getters:a,rootGetters:n},r){const{sumWorkingTime:s,sumDrivingTime:o,sumSetupTime:l,sumPauseTime:d}=new it(t.activities),c=t.activities[0];if(0===r.length){const e=Xe()({...c,fieldId:null,processedArea:null});i("setActivity",e)}else{const{selectedFields:s}=a;let o=Xe()(t.activities);const l=et()(r,s);if(l.length>0){const t=e.fields.data;l.forEach((e=>{const i=t[e],a=n["auth/findCompanyByProcessOrderId"](i.processOrderId),r=n["activityTypes/findActivityTypeOfCompany"](c.activityTypeId,a.id),s=Xe()({...c,fieldId:e,processedArea:i.fieldSize,processOrderId:i.processOrderId,activityTypeId:r.id});o.push(s)})),o=o.filter((e=>e.fieldId))}const d=et()(s,r);d.length>0&&(o=o.filter((e=>e.fieldId&&!d.includes(e.fieldId)))),i("setActivities",o)}i("updateAllActivityIds"),i("updateAllActivityProductIds"),i("updateAllActivityEquipmentIds"),i("distributeWorkingTimeToActivities",s),i("distributeDrivingTimeToActivities",o),i("distributeSetupTimeToActivities",l),i("distributePauseTimeToActivities",d);const u=a.mergedActivityProducts;if(u.length<1)return;const p=e.units.data;Dn(u,p,i)},updateActivitiesBasedOnProcessedArea({rootState:e,state:t,commit:i,getters:a},{fieldId:n,processedArea:r}){const{sumWorkingTime:s,sumDrivingTime:o,sumSetupTime:l,sumPauseTime:d}=new it(t.activities),c=new La(e.products.mineralFertilizers.data,e.products.companyFertilizers.data,e.products.secondaryFertilizers.data,e.products.herbizides.data,e.products.crops.data,e.products.miscellaneous.data,e.products.harvests.data,e.products.seeds.data,e.products.otherProductsAndFertilizers.data,e.products.waads.data),u=new Aa(e.units.data,c,$a),p=new at(t.activities,u),h=p.findActivitiesByFieldId(n);
1if(!(h.length<1)&&(h.forEach((e=>{i("setProcessedArea",{activityId:e.id,processedArea:r})})),"createActivity"===t.workflowKey)){i("distributeWorkingTimeToActivities",s),i("distributeDrivingTimeToActivities",o),i("distributeSetupTimeToActivities",l),i("distributePauseTimeToActivities",d);const t=a.mergedActivityProducts;if(t.length<1)return;const n=e.units.data;Dn(t,n,i)}},updateProductOnActivityProductInAllActivities:An,updatePestOnActivityProductInAllActivities:vn,setProductAmountModeForAllProducts:ln,applyStockLevelOnActivityProductInAllActivities:Xa,updateEquipmentOnActivityEquipmentInAllActivities:mn,removeActivityProductInAllActivities:sn,removeActivityEquipmentInAllActivities:nn,save({state:e,dispatch:t}){if(!e.activities)throw new Error("No activity set");let i=Sa.toSyncableActivities(e.activities);const a=da(Date.now());i=i.map((e=>({...e,creationDate:a,tstamp:a,isCopy:!1,completed:!0}))),i.forEach((i=>{switch(e.workflowKey){case"createActivity":t("activities/insertAndSyncNewEntry",{entry:i},{root:!0});break;case"editActivity":t("activities/updateAndSyncEntry",{entry:i},{root:!0});break;default:throw new Error(`Unknown workflowKey ${e.workflowKey}`)}}))}};var Pn=Mn;class Tn{constructor(e){(0,tt.Z)(this,"activityEquipmentService",void 0),this.activityEquipmentService=e}mergedActivityEquipment(e){const t=[];return e.forEach((e=>{e.equipment.forEach((i=>{const a=t.findIndex((e=>this.isMergeableActivityEquipment(e,i)));if(a>-1){const n=Tn.toMergedActivityEquipment(i,e.id);t[a]=Tn.mergeActivityEquipment(t[a],n)}else t.push(Tn.toMergedActivityEquipment(i,e.id))}))})),t}isMergeableActivityEquipment(e,t){const i=Tn.toActivityEquipment({...e,ids:[e.ids[0]]});return this.activityEquipmentService.isSibling(i,t)}static mergeActivityEquipment(e,t){const i={...e,activityIds:[...e.activityIds,...t.activityIds],ids:[...e.ids,...t.ids]};return i}static toMergedActivityEquipment(e,t){const{id:i,...a}=e;return{...a,activityIds:[t],ids:[i]}}static toActivityEquipment(e){const{activityIds:t,ids:i,...a}=e;if(1!==i.length)throw new Error("Cannot convert merged equipment to activity equipment. Multiple ids found.");return{...a,id:i[0]}}}class xn{constructor(e,t,i){(0,tt.Z)(this,"activities",void 0),(0,tt.Z)(this,"units",void 0),(0,tt.Z)(this,"activityProductService",void 0),this.activities=e,this.units=t,this.activityProductService=i}get mergedActivityProducts(){const e=[];return this.activities.forEach((t=>{if(0===e.length){const i=t.products.map((e=>xn.toMergedActivityProduct(e,t.id)));e.push(...i)}else t.products.forEach((i=>{const a=e.findIndex((e=>this.activityProductService.isSibling(e,i)));if(a>-1){const n=xn.toMergedActivityProduct(i,t.id);e[a]=this.mergeActivityProducts(e[a],n)}else e.push(xn.toMergedActivityProduct(i,t.id))}))})),e}mergeActivityProducts(e,t){if(!this.activityProductService.isSibling(e,t))throw new Error("Cannot merge activity products that are not siblings");const i={...e,...this.mergeAmountAndUnit({amount:e.amount,unitId:e.unitId},{amount:t.amount,unitId:t.unitId}),activityIds:[...e.activityIds,...t.activityIds]};return e.pestId!==t.pestId&&(i.pestId="DIFFERENT"),e.pesticideIndicationId!==t.pesticideIndicationId&&(i.pesticideIndicationId="DIFFERENT"),i}static toMergedActivityProduct(e,t){return{...e,activityIds:[t]}}mergeAmountAndUnit(e,t){if(!e.unitId||!t.unitId)return{amount:null,unitId:null};if(e.unitId!==t.unitId)throw new Error("Cannot merge amounts with different units");const i=this.units[e.unitId];return Fa(i)?xn.mergeRelativeAmountUnit(e,t):xn.mergeTotalAmountUnit(e,t)}static mergeRelativeAmountUnit(e,t){return null===e.amount||void 0===e.amount||null===t.amount||void 0===t.amount?{amount:null,unitId:e.unitId}:e.amount!==t.amount?{amount:-1,unitId:e.unitId}:e}static mergeTotalAmountUnit(e,t){return null==e.amount&&null==t.amount?{amount:null,unitId:e.unitId}:{amount:(e.amount??0)+(t.amount??0),unitId:e.unitId}}static toActivityProduct(e){const{activityIds:t,...i}=e;return i}}const Bn={activityTimeStarts:e=>e.activities.map((e=>e?.timeStart)).filter(ka),currentActivityProduct:(e,t,i)=>{if(!e.currentActivityProductId)return null;if(!e.activities)return null;const a=new La(i.products.mineralFertilizers.data,i.products.companyFertilizers.data,i.products.secondaryFertilizers.data,i.products.herbizides.data,i.products.crops.data,i.products.miscellaneous.data,i.products.harvests.data,i.products.seeds.data,i.products.otherProductsAndFertilizers.data,i.products.waads.data),n=new Aa(i.units.data,a,$a),r=new xn(e.activities,i.units.data,n);return r.mergedActivityProducts.find((t=>t.id===e.currentActivityProductId))??null},selectedFields:e=>e.activities.filter((e=>e.fieldId)).map((e=>e.fieldId)),selectedCompanyIds:(e,t,i,a)=>e.activities.reduce(((e,t)=>{const i=a["auth/getCompanyByProcessOrderId"](t.processOrderId)?.id;return e.includes(i)||e.push(i),e}),[]),sumProcessedArea:e=>{const t=new it(e.activities);return t.sumProcessedArea},sumWorkingTime:e=>{const t=new it(e.activities);return t.sumWorkingTime},sumDrivingTime:e=>{const t=new it(e.activities);return t.sumDrivingTime},sumSetupTime:e=>{const t=new it(e.activities);return t.sumSetupTime},sumPauseTime:e=>{const t=new it(e.activities);return t.sumPauseTime},mergedActivityProducts:(e,t,i)=>{const a=new La(i.products.mineralFertilizers.data,i.products.companyFertilizers.data,i.products.secondaryFertilizers.data,i.products.herbizides.data,i.products.crops.data,i.products.miscellaneous.data,i.products.harvests.data,i.products.seeds.data,i.products.otherProductsAndFertilizers.data,i.products.waads.data),n=new Aa(i.units.data,a,$a),r=new xn(e.activities,i.units.data,n);return r.mergedActivityProducts},productAmountMode:(e,t,i)=>{if(null!=e.productAmountMode)return e.productAmountMode;const a=i.units.data,n=t.mergedActivityProducts,r=n.find((e=>
1e.unitId&&a[e.unitId]));return r?.unitId?Fa(a[r.unitId])?ua.PerHa:ua.Total:ua.PerHa},mergedActivityEquipment:(e,t,i)=>{const a=new Wa(i.equipments.data),n=new Za(a),r=new Tn(n);return r.mergedActivityEquipment(e.activities)}};var On=Bn;function $n(){const e={...Ka.createActivity(),timeStart:da(Date.now()),completed:!0,products:[Aa.createActivityProduct()],equipment:[Za.createActivityEquipment()]};return{polygons:{},currentActivityProductId:null,activities:[e],workflowKey:"createActivity",productAmountMode:null}}var Rn=$n;function Nn(e,t,i){return e&&0!==i?e*t/i:null}function zn(e,t){const{products:{mineralFertilizers:i,companyFertilizers:a,secondaryFertilizers:n,herbizides:r,crops:s,miscellaneous:o,harvests:l,seeds:d,otherProductsAndFertilizers:c,waads:u}}=t,p=new La(i.data,a.data,n.data,r.data,s.data,o.data,l.data,d.data,c.data,u.data),h=new Aa(t.units.data,p,$a),m=new at(e.activities,h);return{activityProductService:h,findService:m}}function Ln(e,t){const{activityProductService:i,findService:a}=zn(e,t.rootState),n=Xe()(a.findActivityProduct(t.activityProductId));n&&e.activities.forEach((e=>{const a=Vn(e,n,i);a.length>0?Un(a,t.updateValues):Hn(e,n,t.updateValues)}))}function Vn(e,t,i){return e.products.filter((e=>e.id===t.id||i.isSibling(e,t)))}function Un(e,t){e.forEach((e=>{jn(e,t)}))}function jn(e,t){Object.entries(t).forEach((([t,i])=>{"id"!==t&&b["default"].set(e,t,i)}))}function Hn(e,t,i){const a={...t,id:ma(),...i};return e.products.push(a),a}function Gn(e,t){Fa(t.updateValues.unit)?Ln(e,{activityProductId:t.activityProductId,updateValues:{amount:t.updateValues.amount,unitId:t.updateValues.unit.id},rootState:t.rootState}):Wn(e,t)}function Wn(e,t){const{findService:i,activityProductService:a}=zn(e,t.rootState),n=new it(e.activities),r=n.sumProcessedArea,s=Xe()(i.findActivityProduct(t.activityProductId));s&&e.activities.forEach((e=>{const i=Vn(e,s,a);if(i.length>0)Zn(i,{amount:t.updateValues.amount,unitId:t.updateValues.unit.id},e.processedArea,r);else{const i=Hn(e,s,t.updateValues);Zn([i],{amount:t.updateValues.amount,unitId:t.updateValues.unit.id},e.processedArea,r)}}))}function Zn(e,t,i,a){const n=Nn(t.amount,i??0,a);Un(e,{amount:n,unitId:t.unitId})}function Kn(e,t){const{activities:i}=e;if(1===i.length)return void b["default"].set(i[0],t.propertyKey,t.time);const{sumProcessedArea:a}=new it(i);i.forEach((e=>{const i=e.processedArea??0,n=Nn(t.time,i,a);b["default"].set(e,t.propertyKey,n)}))}function qn(e,t){const i=e.activities.find((e=>e.id===t));if(!i)throw new Error(`Activity with id ${t} not found`);return i}const Yn={distributeWorkingTimeToActivities(e,t){Kn(e,{time:t,propertyKey:"workingTime"})},distributeDrivingTimeToActivities(e,t){Kn(e,{time:t,propertyKey:"drivingTime"})},distributeSetupTimeToActivities(e,t){Kn(e,{time:t,propertyKey:"setupTime"})},distributePauseTimeToActivities(e,t){Kn(e,{time:t,propertyKey:"pauseTime"})},updateAllActivityIds(e){e.activities.forEach((e=>{e.id=ma()}))},updateAllActivityProductIds(e){e.activities.forEach((e=>{e.products.forEach((e=>{e.id=ma()}))}))},updateAllActivityEquipmentIds(e){e.activities.forEach((e=>{e.equipment.forEach((e=>{e.id=ma()}))}))},createActivityProduct(e){e.activities.forEach((e=>e.products.push(Aa.createActivityProduct())))},addActivityProductToAllActivities(e,t){e.activities.forEach((i=>{const a=Ua(i,e.activities,t.amount??0);i.products.push(Xe()({...t,id:ma(),amount:a}))}))},addActivityProduct(e,{activityId:t,activityProduct:i}){const a=qn(e,t);a.products.push(i)},setActivityProduct(e,{activityId:t,activityProduct:i}){const a=qn(e,t),n=a.products.findIndex((e=>e.id===i.id));if(-1===n)throw new Error("ActivityProduct not found in activity");b["default"].set(a.products,n,i)},updateAmountAndUnitOnActivityProductInAllActivities:Gn,removeActivityProduct(e,{activityId:t,activityProductId:i}){const a=qn(e,t);a.products=a.products.filter((e=>e.id!==i))},removeAllActivityProductsWithoutProductId(e){e.activities.forEach((e=>{e.products=e.products.filter((e=>e.productId))}))},setCurrentActivityProductId(e,t){e.currentActivityProductId=t},setProductAmountMode(e,t){e.productAmountMode=t},addActivityEquipment(e,{activityId:t,activityEquipment:i}){const a=qn(e,t);a.equipment.push(i)}
1,createActivityEquipment(e){e.activities.forEach((e=>e.equipment.push(Za.createActivityEquipment())))},setActivityEquipment(e,{activityId:t,activityEquipment:i}){const a=qn(e,t),n=a.equipment.findIndex((e=>e.id===i.id));if(-1===n)throw new Error("ActivityEquipment not found in activity");b["default"].set(a.equipment,n,i)},removeActivityEquipment(e,{activityId:t,activityEquipmentId:i}){const a=qn(e,t);a.equipment=a.equipment.filter((e=>e.id!==i))},addPolygon(e,t){e.polygons[t.field_key]=t},polygonSetState(e,{key:t,state:i}){e.polygons[t].state=i},setActivity(e,t){b["default"].set(e,"activities",[t])},setActivities(e,t){b["default"].set(e,"activities",t)},setActivityTypeId(e,{activityId:t,activityTypeId:i}){const a=qn(e,t);a.activityTypeId=i},setTimeStart(e,t){e.activities&&e.activities.forEach((e=>{e.timeStart=t}))},setUserComment(e,t){e.activities&&e.activities.forEach((e=>{e.userComment=t}))},setProcessedArea(e,{activityId:t,processedArea:i}){const a=e.activities?.find((e=>e.id===t));a&&(a.processedArea=i)},setBbchCode(e,t){e.activities&&e.activities.forEach((e=>{b["default"].set(e,"bbchCode",t)}))},setActivityNumericProperty(e,t){e.activities&&e.activities.forEach((e=>{b["default"].set(e,t.key,t.value)}))},setActivityBooleanProperty(e,t){e.activities&&e.activities.forEach((e=>{b["default"].set(e,t.key,t.value)}))},setWorkflowKey(e,t){e.workflowKey=t},reset(e){Object.assign(e,Rn())}};var Jn=Yn;const Xn={namespaced:!0,state:Rn(),mutations:Jn,actions:Pn,getters:On};var Qn=Xn;function er(){return{...be(),removing:!1,removableObservers:[]}}function tr(){return{data:{},errors:[],syncing:!1,syncableObservers:[]}}function ir(e,t,i){const a=[e,...t];if(0===a.length||0===i.length)return!0;const n=a.map((e=>e.companyId));return i.every((e=>n.includes(e.id)))}function ar(e,t){return t.filter((t=>nr(e,t))).filter((t=>t.id!==e.id))}function nr(e,t){return rr(e)===rr(t)}function rr(e){const{roughId:t,fineId:i,displayName:a}=e;return`${t}_${i}_${a}`}async function sr(e,t,i,a,n){const r=await or(e,t,i,a,n);if(F(r)||!r.pageKey)return r;const s=await sr(e,t,i,a,r.pageKey);return A([r,s])}async function or(e,t,i,a,n){const{data:r}=await e[t]({...i,pageKey:n},a);return r}function lr(){return{version:"2.0",status:"success",data:[]}}function dr(e){return e.data?.map((e=>({...e,products:cr(e.products),equipment:ur(e.equipment),id:ma()})))}function cr(e){return e.map((e=>({...e,id:ma(),tstamp:da(Date.now()),productId:e.productId||""})))}function ur(e){return e.map((e=>({...e,id:ma(),tstamp:da(Date.now()),equipmentId:e.equipmentId||""})))}async function pr(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"];if(0===i?.length)return lr();const{activityImportApi:a}=b["default"].prototype.$api,n=[];i.forEach((i=>{const r={...e.rootState.activities.importActivities.activityImportMapDataRequestParameters,processOrderId:i};n.push(sr(a,"activityImportMapData",r,t))}));const r=await Promise.all(n),s=A(r),o=dr(s);return{...s,data:o}}async function hr(e,t,i){throw new Error("API NOT AVAILABLE")}const mr=Fe(pr,hr),fr={...mr.actions,addImportActivityProduct({state:e,commit:t},i){const a=e.data[i];if(!a)return;const n=Aa.createActivityProduct(),r=[...a.products,n];t("updateEntryByKeyAndValue",{guid:a.id,key:"products",value:r})},addImportActivityEquipment({state:e,commit:t},i){const a=e.data[i];if(!a)return;const n=Za.createActivityEquipment(),r=[...a.equipment,n];t("updateEntryByKeyAndValue",{guid:a.id,key:"equipment",value:r})},removeImportActivityProduct({state:e,commit:t},{importActivityId:i,importActivityProductId:a}){const n=e.data[i];if(!n)return;const r=n.products.filter((e=>e.id!==a));t("updateEntryByKeyAndValue",{guid:n.id,key:"products",value:r})},removeImportActivityEquipment({state:e,commit:t},{importActivityId:i,importActivityEquipmentId:a}){const n=e.data[i];if(!n)return;const r=n.equipment.filter((e=>e.id!==a));t("updateEntryByKeyAndValue",{guid:n.id,key:"equipment",value:r})},updateActivityType({getters:e,rootGetters:t,commit:i},{importActivityId:a,importActivityTypeId:n}){const r=e.getById(a),s=t["activityTypes/getById"](n),o=cn(r,rr(s),t["auth/getCompanyByProcessOrderId"],t["activityTypes/getActivityTypeOfCompanyBySyncName"],t["activityTypes/getBySyncName"]);i("updateEntryByKeyAndValue",{guid:a,key:"activityTypeId",value:o.activityTypeId})}};var gr,yr,vr=fr;function br(){function e(e,t){if(!e)return;
1const{equipmentId:i,equipmentIdMatch:a,...n}=e;return!i&&a&&"NoMatch"===a.matchType?{...n,dropdownItem:{id:gr.NO_MATCH,name:e.equipmentIdMatch.originalValue??""}}:{...n,dropdownItem:{id:i,name:i?t[i].name:""}}}function t(){return{dropdownItem:"HOT_DISPLAY_BUTTON_RENDERER"}}return{convertToActivityImportEquipmentTableData:e,dummyEquipmentForAddEquipmentButton:t}}function wr(){function e(e,i,a,n,r,s){if(!e)return;const{amount:o,unitId:l,...d}=e,c=o??0,u=t(e,n),p=$a(c,u,i,a),h=void 0;return{...d,productStorageDropdownItem:r??void 0,pesticideIndicationDropdownItem:h,...p,isLoading:s}}function t(e,t){const{productId:i,unitId:a}=e;if(a)return a;if(!i)return;const n=t.findProductById(i);return n?.unitId}function i(){return{productId:"",productStorageDropdownItem:"HOT_DISPLAY_BUTTON_RENDERER",pesticideIndicationDropdownItem:void 0,amountUnitRelative:{amount:null,unitId:null,isFixed:!1},amountUnitTotal:{amount:null,unitId:null,isFixed:!1},isLoading:!1}}return{convertToActivityImportProductTableData:e,dummyProductForAddProductButton:i}}function Cr(e){if(!e)return!1;if(!e.activityTypeId)return!1;if(!e.fieldId)return!1;const t=e.products.every((e=>""!==e.productId)),i=e.equipment.every((e=>""!==e.equipmentId));return t&&i}function Fr(){const{convertToActivityImportProductTableData:e,dummyProductForAddProductButton:t}=wr(),{convertToActivityImportEquipmentTableData:i,dummyEquipmentForAddEquipmentButton:a}=br();function n(e){return{id:gr.NO_MATCH,name:e.fieldIdMatch.originalValue??""}}function r(e){return{id:gr.NO_MATCH,name:e.productIdMatch?.originalValue??""}}function s(e){return{id:gr.NO_MATCH,name:e.activityTypeIdMatch.originalValue??""}}function o(t,a,o,m,f,g,y,v,b,w,C,F,A,k){const S=[];return t.forEach((t=>{const{products:E,equipment:I,id:_,activityTypeId:D,fieldId:M,storeStatus:P,userId:T,...x}=t,B=c(_,a),O=w(D||"")??s(t),$=M?C(M)??void 0:n(t),R=u(m,t.fieldId),N=l(F,t.processOrderId,v),z=d(f,T),L=p(t,k),V=Math.max(E.length,I.length);if(0===V)S.push({...x,importStatus:L,id:_,activityTypeDropdownItem:O,fieldDropdownItem:$,...B,fieldSize:R,companyName:N,user:z,storeStatus:U});else for(let a=0;a<V;a+=1){const n=E[a],s=I[a];S.push({...x,id:_,importStatus:L,activityTypeDropdownItem:O,fieldDropdownItem:$,...B,product:n?e(n,t.processedArea,g,b,n.productId?A(n.productId,null):r(n),o):void 0,equipment:i(s,y),fieldSize:R,companyName:N,user:z,storeStatus:U})}S.push(h(_,O,$,R,x,B,N,z))})),S}function l(e,t,i){if(!t)return"";const{companyId:a}=e[t];return i[a].abbreviation??i[a].name}function d(e,t){const i=t?e[t]:void 0;if(i)return`${i.firstname} ${i.lastname}`}function c(e,t){const i=t[e]?.select??!0,a=t[e]?.expand??!0;return{select:i,expand:a}}function u(e,t){if(!t)return;const i=e[t];return i?.fieldSize}function p(e,t){return Cr(e)?t(e)?.length>0?{type:yr.DUPLICATE,tooltipLabel:"Eine ähnliche Maßnahme mit gleichen Datum, Tätigkeit, Feld und Produkten existiert bereits."}:{type:yr.OK,tooltipLabel:null}:{type:yr.INCOMPLETE,tooltipLabel:"Fehlerhaft/unvollständig"}}function h(e,i,n,r,s,o,l,d){return{...s,id:e,activityTypeDropdownItem:i,fieldDropdownItem:n,fieldSize:r,...o,product:t(),equipment:a(),companyName:l,user:d,storeStatus:U}}return{convertToActivitiesImportTableData:o}}(function(e){e["MATCH"]="MATCH",e["NO_MATCH"]="NO_MATCH"})(gr||(gr={})),function(e){e["OK"]="OK",e["DUPLICATE"]="DUPLICATE",e["INCOMPLETE"]="INCOMPLETE"}(yr||(yr={}));const{convertToActivitiesImportTableData:Ar}=Fr(),kr={...mr.getters,selectedImportActivityIds:e=>{const t=Object.keys(e.data);return t.filter((t=>e.tableDataMetadata[t]?.select??!0))},tableDataImportActivities:(e,t,i,a)=>{const n=a["auth/currentCompaniesRegionCodes"];if(n.length>1)throw new Error("Multiple region codes not supported");const r=Object.values(e.data),s=new La(i.products.mineralFertilizers.data,i.products.companyFertilizers.data,i.products.secondaryFertilizers.data,i.products.herbizides.data,i.products.crops.data,i.products.miscellaneous.data,i.products.harvests.data,i.products.seeds.data,i.products.otherProductsAndFertilizers.data,i.products.waads.data);return Ar(r,i.activities.importActivities.tableDataMetadata,a["products/loading"],i.fields.data,i.users.data,i.units.data,i.equipments.data,i.auth.companiesById,s,a["activityTypes/dropdownItem"],a["fields/dropdownItem"],a["auth/processOrdersById"],a["products/dropdownItem"],a["activities/findSimilarActivitiesForImportActivity"])},isImportActivityValid:(e,t)=>e=>{const i=t.findById(e);return Cr(i)}};var Sr=kr;function Er(){return{...be(),tableDataMetadata:{},hot:null,userColumnSettings:{},activityImportMapDataRequestParameters:{source:"CnhDownload",objectIds:void 0}}}const Ir={...mr.mutations,addOrUpdateTableDataMetadataByKeyAndValue(e,{importActivityId:t,key:i,value:a}){const n={...e.tableDataMetadata};n[t]={...n[t],[i]:a},e.tableDataMetadata=n},updateEntryByKeyAndValue(e,{guid:t,key:i,value:a}){if(null==e.data[t])return;const n={...e.data};n[t]={...e.data[t],[i]:a},e.data=n,e.errors=e.errors.filter((e=>e[R]!==t||e.key!==i))},removeImportActivity(e,t){b["default"]["delete"](e.data,t),b["default"]["delete"](e.tableDataMetadata,t)},updateActivityImportMapDataRequestParameters(e,{source:t,objectIds:i}){t&&(e.activityImportMapDataRequestParameters.source=t),e.activityImportMapDataRequestParameters.objectIds=i},resetTableData(e){e.data={}},resetTableDataMetadata(e){e.tableDataMetadata={}}};var _r=Ir;const Dr={namespaced:!0,state:Er(),mutations:_r,actions:vr,getters:Sr};var Mr=Dr;function Pr(e){return e.reduce(((e,t)=>{let i=null;t.result!==Ct.CopyField&&t.result!==Ct.ReplaceField||(i=t.result);const a={...t,mode:i};return{...e,[t.sourceActivityId]:a}}),{})}function Tr(e,t){if(e){const t=Object.values(e).map((e=>({sourceActivityId:e.sourceActivityId,mode:e.mode??Ct.Autodetect,destinationFieldId:e.destinationFieldId})));return t}const i=Ct.Autodetect;return t.map((e=>({sourceActivityId:e,mode:i})))}const xr={async toProcessOrder({state:e,commit:t},{activityIds:i,copy:a=!1}){const n=e.selectedProcessOrderId;if(!n)throw new Error("DestinationProcessOrderId is not defined");const r=Tr(e.moveActivityParametersWithResult,i),s={activityMoveToProcessOrderRequest:{destinationProcessOrderId:n,activities:r,copy:a}},{activitiesApi:o}=b["default"].prototype.$api;let l;try{const e=await o.activityMoveToProcessOrder(s);l=e.data,t("setMoveActivityParametersWithResult",{moveActivityParametersWithResult:e.data.data})}catch(d){d.response&&(l=d.response.data,"conflict"===l?.status&&t("increaseTrials"))}finally{if(l?.data){const e=Pr(l.data);t("setMoveActivityParametersWithResult",e)}}}};var Br=xr;const Or={moveActivityParametersWithoutMode:e=>e.moveActivityParametersWithResult?Object.values(e.moveActivityParametersWithResult).filter((e=>!e.mode)):null,moveActivityParametersWithConflict:e=>e.moveActivityParametersWithResult?Object.values(e.moveActivityParametersWithResult).filter((e=>e.result===Ft.NoMatchFound)):null,moveActivityParametersWithSuccess:e=>e.moveActivityParametersWithResult?Object.values(e.moveActivityParametersWithResult).filter((e=>e.result===Ft.CopyField||e.result===Ft.ReplaceField)):null};var $r=Or;function Rr(){return{selectedProcessOrderId:null,selectedCompanyId:null,moveActivityParametersWithResult:null,trials:0,counterCurrentMoveActivityConflict:0,keepOption:!1}}var Nr=Rr;const zr={increaseCounterCurrentMoveActivityConflict(e){e.counterCurrentMoveActivityConflict+=1},increaseTrials(e){e.trials+=1},setSelectedCompanyId(e,t){e.selectedCompanyId=t},setSelectedProcessOrderId(e,t){e.selectedProcessOrderId=t},setKeepOption(e,t){e.keepOption=t},setDestinationFieldIdOnMoveActivityParametersWithResult(e,{id:t,de
1stinationFieldId:i}){e.moveActivityParametersWithResult&&(e.moveActivityParametersWithResult[t].destinationFieldId=i)},setModeOnMoveActivityParametersWithResult(e,{id:t,mode:i}){e.moveActivityParametersWithResult&&(e.moveActivityParametersWithResult[t].mode=i)},setMoveActivityParametersWithResult(e,t){e.moveActivityParametersWithResult=t},reset(e){Object.assign(e,Nr())}};var Lr=zr;const Vr={namespaced:!0,state:Nr(),mutations:Lr,actions:Br,getters:$r};var Ur=Vr;const jr={FEATURE_CUSTOMERS:"FEATURE_CUSTOMERS",FEATURE_GROUNDWATER_PROTECTION:"FEATURE_GROUNDWATER_PROTECTION",FEATURE_SOIL_SAMPLES:"FEATURE_SOIL_SAMPLES",FEATURE_CROP_ROTATION:"FEATURE_CROP_ROTATION",FEATURE_NOTES:"FEATURE_NOTES",CAN_PURCHASE_LICENSE:"CAN_PURCHASE_LICENSE",FEATURE_FIELD_DETAIL_CROP_ROTATION:"FEATURE_FIELD_DETAIL_CROP_ROTATION",FEATURE_FIELDS:"FEATURE_FIELDS",FEATURE_FIELDS_ADVANCED:"FEATURE_FIELDS_ADVANCED",FEATURE_FIELDS_SHARED:"FEATURE_FIELDS_SHARED",FEATURE_TASK_PLAN:"FEATURE_TASK_PLAN",FEATURE_STOCK_MOVEMENT:"FEATURE_STOCK_MOVEMENT",FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC:"FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC",FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE:"FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE",FEATURE_APPLICATION_MAPS_SEEDING_SOY:"FEATURE_APPLICATION_MAPS_SEEDING_SOY",FEATURE_APPLICATION_MAPS_SPRAYING_FD_BASIC:"FEATURE_APPLICATION_MAPS_SPRAYING_FD_BASIC",FEATURE_VEGETATION_MONITORING:"FEATURE_VEGETATION_MONITORING",FEATURE_COST_ACCOUNTING:"FEATURE_COST_ACCOUNTING",FEATURE_CROPPING_PLAN:"FEATURE_CROPPING_PLAN",FEATURE_FERTILIZATION_PLAN:"FEATURE_FERTILIZATION_PLAN",FEATURE_DIGITAL_CONTRACTING:"FEATURE_DIGITAL_CONTRACTING",FEATURE_FERTILIZER_REGULATION:"FEATURE_FERTILIZER_REGULATION",FEATURE_NUTRIENT_COMPARISON:"FEATURE_NUTRIENT_COMPARISON",FEATURE_SUBSTANCE_FLOW:"FEATURE_SUBSTANCE_FLOW",FEATURE_CROP_RATIO:"FEATURE_CROP_RATIO",FEATURE_EXPORT_FIELD:"FEATURE_EXPORT_FIELD",FEATURE_NUTRIENT_BALANCE:"FEATURE_NUTRIENT_BALANCE",FEATURE_PROCESS_ORDER:"FEATURE_PROCESS_ORDER",FEATURE_WEATHER_INFO:"FEATURE_WEATHER_INFO",FEATURE_FIELDS_NDVI_MEAN:"FEATURE_FIELDS_NDVI_MEAN",FEATURE_MANAGED_CONTRACTS:"FEATURE_MANAGED_CONTRACTS",FEATURE_APPLICATION_MAPS_TERRAZO:"FEATURE_APPLICATION_MAPS_TERRAZO",FEATURE_ACTIVITIES:"FEATURE_ACTIVITIES",FEATURE_MOVE_ACTIVITIES:"FEATURE_MOVE_ACTIVITIES",FEATURE_ACTIVITIES_EXPORT:"FEATURE_ACTIVITIES_EXPORT",FEATURE_EQUIPMENT:"FEATURE_EQUIPMENT",FEATURE_PESTS:"FEATURE_PESTS",FEATURE_RULE_CHECK:"FEATURE_RULE_CHECK",FEATURE_ACTIVITIES_PESTICIDE_DETAILS:"FEATURE_ACTIVITIES_PESTICIDE_DETAILS",FEATURE_MAP:"FEATURE_MAP",FEATURE_MAP_LAND_CADASTRE:"FEATURE_MAP_LAND_CADASTRE",FEATURE_MAP_GEO_OBJECTS:"FEATURE_MAP_GEO_OBJECTS",FEATURE_FIELD_NAMES_UNIQUE:"FEATURE_FIELD_NAMES_UNIQUE",FEATURE_DATURA_CONTROL:"FEATURE_DATURA_CONTROL"};var Hr=jr;const Gr={visible:{type:Boolean,validator:e=>"boolean"===typeof e,default:!0},enabled:{type:Boolean,validator:e=>"boolean"===typeof e,default:!0},readonly:{type:Boolean,validator:e=>"boolean"===typeof e,default:!1}};var Wr=Gr;class Zr{constructor(e){(0,tt.Z)(this,"ruleCheckApi",void 0),this.ruleCheckApi=e}async getActivityRuleViolations(e){const t=await Promise.all(e.map((e=>this.getActivityRuleViolationsSingleProcessOrder(e))));return A(t)}async recheck(e){const t=await Promise.all(e.map((e=>this.recheckSingleProcessOrder(e))));return A(t)}async dismiss(e){const t=await Promise.all(e.map((e=>this.dismissSingleActivityRuleViolation(e))));A(t)}async getActivityRuleViolationsSingleProcessOrder(e){const t={processOrderId:e};return sr(this.ruleCheckApi,"rulecheckActivityRuleViolations",t)}async recheckSingleProcessOrder(e){const t={rulecheckRecheckRequest:{processOrderId:e}},{data:i}=await this.ruleCheckApi.rulecheckRecheck(t);return i}async dismissSingleActivityRuleViolation(e){const{data:t}=await this.ruleCheckApi.rulecheckDismiss({activityRuleViolationId:e});return t}}const Kr=[Hr.FEATURE_RULE_CHECK],qr={async subscribe({commit:e,rootGetters:t}){if(!t["features/currentCompaniesHaveFeaturesEnabled"](Kr))return;e("setFetching",!0);const i=t["auth/currentProcessOrderIds"],{ruleCheckApi:a}=this.$api,n=new Zr(a);try{const{data:t}=await n.getActivityRuleViolations(i);e("setData",t??[])}catch(r){console.error(r),e("setData",[])}e("setFetching",!1)},async recheck({commit:e,rootGetters:t}){if(!t["features/currentCompaniesHaveFeaturesEnabled"](Kr))return;e("setFetching",!0);const i=t["auth/currentProcessOrderIds"],{ruleCheckApi:a}=this.$api,n=new Zr(a);try{const{data:t}=await n.recheck(i);e("setData",t??[])}catch(r){console.error(r),e("setData",[])}e("setFetching",!1)},async dismiss({commit:e},t){const{ruleCheckApi:i}=this.$api,a=new Zr(i);try{await a.dismiss(t),e("removeData",t)}catch(n){console.error(n)}},reset({commit:e}){e("reset")}};var Yr=qr;const Jr={loading:e=>e.fetching};var Xr=Jr;function Qr(){return{data:[],fetching:!1}}const es={setData(e,t){b["default"].set(e,"data",t)},removeData(e,t){const i=e.data.filter((e=>!t.includes(e.id)));b["default"].set(e,"data",i)},setFetching(e,t){e.fetching=t},reset(e){const t=Qr();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))}};var ts=es;const is={namespaced:!0,state:Qr(),mutations:ts,actions:Yr,getters:Xr};var as=is;async function ns(e,t){const{ruleCheckApi:i}=b["default"].prototype.$api,a=sr(i,"ruleList",{},t);return a}
1async function rs(e,t,i){throw new Error("API NOT IMPLEMENTED")}const ss=Fe(ns,rs,[Hr.FEATURE_RULE_CHECK]);var os=ss;function ls(){return{...be()}}const ds={namespaced:!0,state:ls(),mutations:{...os.mutations},actions:{...os.actions},getters:{...os.getters}};var cs=ds;const us={dismissViolations({dispatch:e},t){const i=t.map((e=>e.activityRuleViolationId));e("activityRuleViolations/dismiss",i)}};var ps=us;class hs{constructor(e){(0,tt.Z)(this,"activityRuleViolations",void 0),(0,tt.Z)(this,"activityRuleViolationsMap",new Map),this.activityRuleViolations=e;for(const t of e){if(!t.activityId)continue;const e=this.activityRuleViolationsMap.get(t.activityId)??[];e.push(t),this.activityRuleViolationsMap.set(t.activityId,e)}}getActivityRuleViolations(e){return e?this.activityRuleViolationsMap.get(e)??[]:this.activityRuleViolations}}function ms(e,t,i){const a=t.map((e=>i[e]??""));return e.replace(/%[^ ]+/g,(()=>`<u>${a.shift()??""}</u>`))}class fs{constructor(e,t,i,a){(0,tt.Z)(this,"rules",void 0),(0,tt.Z)(this,"activityService",void 0),(0,tt.Z)(this,"activityRuleViolationService",void 0),(0,tt.Z)(this,"regionCode",void 0),this.rules=e,this.activityService=t,this.activityRuleViolationService=i,this.regionCode=a}getViolations(e,t=!1){let i=this.activityRuleViolationService.getActivityRuleViolations(e);return t||(i=i.filter(this.filterActivityRuleViolationOfDeletedActivities())),i.map((e=>this.createViolation(e)))}filterActivityRuleViolationOfDeletedActivities(){return e=>{const t=this.activityService.getActivity(e.activityId);return!!t&&null==t.deleted}}createViolation(e){switch(e.type){case kt.Violation:return this.createViolationTypeViolation(e);case kt.NotChecked:return this.createViolationTypeNotChecked(e);default:throw new Error(`Unknown violation type ${e.type}`)}}createViolationTypeViolation(e){const t=this.rules[e.ruleId];if(!t)throw new Error(`Rule with id ${e.ruleId} not found`);return{ruleId:t.id,shortMessage:t.shortMessage,longMessageHtml:fs.createLongMessageHtmlTypeViolation(e,t),activityId:e.activityId,activityRuleViolationId:e.id}}createViolationTypeNotChecked(e){const t=this.rules[e.ruleId];if(!t)throw new Error(`Rule with id ${e.ruleId} not found`);return{ruleId:t.id,shortMessage:`${t.name} konnte nicht geprüft werden`,links:this.createViolationNotCheckedLinks(e),activityId:e.activityId,activityRuleViolationId:e.id}}static createLongMessageHtmlTypeViolation(e,t){const{violationData:i}=e,{longMessage:a,parameterNames:n}=t;return ms(a,n,i)}createViolationNotCheckedLinks(e){return e.violationData.indicationData.map((t=>this.createIndicationLink(t,e.activityId)))}createIndicationLink(e,t){const i=this.createIndicationLinkLabel(e,t),a=this.createIndicationLinkHref(e);return{label:i,href:a}}createIndicationLinkLabel(e,t){const{externalId:i,pest:a}=e,n=this.activityService.getCropOfActivity(t);if(n)return`${n.name} - ${a} [${i}]`;const r=`${a} [${i}]`;return r}createIndicationLinkHref(e){const{externalId:t}=e;if("de"===this.regionCode){const[e]=t.split("/");return`https://psm-zulassung.bvl.bund.de/psm/jsp/BlattAnwendg.jsp?awg_id=${t}&kennr=${e}`}const[i,a]=t.split("/");return`https://psmregister.baes.gv.at/psmregister/faces/indication.jspx?refNr=${i}&indNr=${a}&locale=de`}}const gs={violations:(e,t,i,a)=>(t,n=!1)=>{const r=e.rules.data,s=e.activityRuleViolations.data,o=a["auth/currentCompaniesRegionCodes"];if(o.length>1)throw new Error("Multiple region codes not supported");const l=new Ya(i.fields.data,a["products/findProductById"]),d=new Wa(i.equipments.data),c=new Za(d),u=new qa(i.auth.companiesById),p=new La(i.products.mineralFertilizers.data,i.products.companyFertilizers.data,i.products.secondaryFertilizers.data,i.products.herbizides.data,i.products.crops.data,i.products.miscellaneous.data,i.products.harvests.data,i.products.seeds.data,i.products.otherProductsAndFertilizers.data,i.products.waads.data),h=new Aa(i.units.data,p,$a),m=new Ka(i.activities.data,l,c,h,u),f=new hs(s),g=new fs(r,m,f,o[0]).getViolations(t,n);return g??[]}};var ys=gs;function vs(){return{showRuleViolationModalForActivity:null}}const bs={showRuleViolationsModal(e,t){e.showRuleViolationModalForActivity=t},hideRuleViolationsModal(e){e.showRuleViolationModalForActivity=null}};var ws=bs;const Cs={namespaced:!0,state:vs(),mutations:ws,actions:ps,getters:ys,modules:{rules:cs,activityRuleViolations:as}};var Fs=Cs;function As(){return{version:"2.0",status:"success",data:[]}}async function ks(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"],a=e.rootGetters["auth/currentCompanyIds"],n="fieldSharing";if(0===i?.length||0===a.length)return As();const{activitiesApi:r}=b["default"].prototype.$api,s=[];a.forEach((e=>
1{i.forEach((i=>{const a={processOrderId:i,permissionMode:n,fieldSharingCompanyId:e,deleted:!1};s.push(sr(r,"activityList",a,t))}))}));const o=await Promise.all(s),l=A(o);return l}async function Ss(e,t,i){const a=t.rootGetters["auth/currentCompanyIds"],n="fieldSharing";if(0===a.length)return As();const{activitiesApi:r}=b["default"].prototype.$api,s=a.map((t=>{const a={objectIds:e.join(","),permissionMode:n,fieldSharingCompanyId:t,deleted:!1};return r.activityObjects(a,i)})),o=await Promise.all(s),l=o.map((e=>e.data)),d=A(l);return d}const Es=Fe(ks,Ss),Is={...Es.actions};var _s=Is;const Ds={...Es.getters};var Ms=Ds;function Ps(){return{...be()}}const Ts={...Es.mutations};var xs=Ts;const Bs={namespaced:!0,state:Ps(),mutations:xs,actions:_s,getters:Ms};var Os=Bs,$s=i(2658),Rs=i.n($s);function Ns(e){return{async removeAndSyncEntry({commit:e,dispatch:t},{entry:i}){e("removeEntry",{entry:i}),await t("syncAllRemovals")},async syncAllRemovals(t){const{state:i,commit:a,dispatch:n}=t;if(i.removing)return void await new Promise((e=>a("addRemovableObserver",e)));const r=Object.values(i.data).filter((e=>e.storeStatus===G));if(r.length<1)return void a("clearRemovableObservers");let s;a("syncAllRemovesStart",r),await new Promise((e=>{setTimeout(e,100)}));try{const i=await e(r,t);s=ue(i)}catch(o){s=ue(o)}"success"===s?.status?(a("syncAllRemovesFinish",s.data),await n("syncAllRemovals")):"partialSuccess"===s?.status?(n("addRemoveErrors",{entries:r,responseData:s}),a("syncAllRemovesFinish",s.data?.filter((e=>null==s?.errors?.[e.id]))),await n("syncAllRemovals")):(n("addRemoveErrors",{entries:r,responseData:s}),a("clearRemovableObservers"),a("syncAllRemovesFinish"))},addRemoveErrors({commit:e},{entries:t,responseData:i}){"partialSuccess"===i.status?Object.keys(i.errors||{}).forEach((t=>{const a=ue(i.errors[t]);e("addRemovalError",{guid:t,key:null,errorUserMessage:a.errorUserMessage[0]})})):t.forEach((t=>{e("addRemovalError",{guid:t.id,key:null,errorUserMessage:i.errorUserMessage[0]})}))}}}var zs=Ns;const Ls={syncAllRemovesStart(e,t){b["default"].set(e,"removing",!0),b["default"].set(e,"data",t.reduce(((e,t)=>null==e[t.id]?e:{...e,[t.id]:{...e[t.id],storeStatus:W}}),e.data));const i=t.map((({id:e})=>e));b["default"].set(e,"errors",e.errors.filter((e=>!i.includes(e.id))))},syncAllRemovesFinish(e,t){if(!e.removing)return;if(b["default"].set(e,"removing",!1),!Array.isArray(t))return;const i={...e.data};t.forEach((({id:e})=>{delete i[e]})),b["default"].set(e,"data",i)},addRemovableObserver(e,t){b["default"].set(e,"removableObservers",[...e.removableObservers,t])},clearRemovableObservers(e){e.removableObservers&&e.removableObservers.length>0&&e.removableObservers.forEach((e=>e())),b["default"].set(e,"removableObservers",[])},removeEntry(e,{entry:t}){if(null!=e.data[t.id])if(e.data[t.id].storeStatus===N){const i={...e.data};delete i[t.id],b["default"].set(e,"data",i)}else b["default"].set(e,"data",{...e.data,[t.id]:{...e.data[t.id],storeStatus:G}})},addRemovalError(e,{guid:t,key:i,errorUserMessage:a}){b["default"].set(e,"data",{...e.data,[t]:{...e.data[t],storeStatus:H}}),b["default"].set(e,"errors",[...e.errors,{type:J,guid:t,key:i,errorUserMessage:a}])}};var Vs=Ls;function Us(e){return{namespaced:!0,state:er(),mutations:Vs,actions:zs(e)}}function js(e){return{async insertNewEntry({commit:e},{entry:t}){e("insert",{entry:t})},async insertAndSyncNewEntry({dispatch:e},{entry:t}){await e("insertNewEntry",{entry:t}),await e("syncAll")},async updateAndSyncEntry({commit:e,dispatch:t},{entry:i}){e("updateEntry",{entry:i}),await t("syncAll")},async updateEntryByKeyAndValueAndSync({commit:e,dispatch:t},{key:i,guid:a,value:n}){e("updateEntryByKeyAndValue",{key:i,guid:a,value:n}),await t("syncAll")},async syncAll(t){const{state:i,commit:a,dispatch:n}=t;if(i.syncing)return void await new Promise((e=>{a("addSyncableObserver",e)}));a("syncAllStart"),await new Promise((e=>{setTimeout(e,100)}));const r=Object.values(i.data).filter((e=>e.storeStatus===U||e.storeStatus===N));if(r.length<1)return a("clearSyncableObservers"),void a("syncAllFinish");let s;a("syncAllAddEntries",r);try{const i=await e(r,t);s=ue(i)}catch(o){console.error(o),s=ue(o)}"success"===s.status?(a("syncAllFinish",s.data),await n("syncAll")):"partialSuccess"===s.status?(n("addSyncErrors",{requestData:r,responseData:s}),a("syncAllFinish",s.data?.filter((e=>
1null==s?.errors?.[e.id]))),await n("syncAll")):(n("addSyncErrors",{requestData:r,responseData:s}),a("clearSyncableObservers"),a("syncAllFinish"))},addSyncErrors({commit:e},{requestData:t,responseData:i}){"partialSuccess"===i.status?Object.keys(i.errors).forEach((t=>{const a=ue({status:"error",...i.errors[t]});a.errorUserMessage.forEach((i=>{e("addSyncError",{guid:t,key:null,errorUserMessage:i})})),"attributeValidationError"===a.errorCode?Object.keys(a.errorAttributeUserMessages).forEach((i=>{e("addSyncError",{guid:t,key:i,errorUserMessage:a.errorAttributeUserMessages[i][0]})})):"string"===typeof a.errorFieldName&&a.errorFieldName.length>0&&e("addSyncError",{guid:t,key:a.errorFieldName,errorUserMessage:b["default"].i18n.translate("Ungültiger Wert.")})})):t.forEach((t=>{e("addSyncError",{guid:t.id,key:null,errorUserMessage:i.errorUserMessage[0]})}))}}}var Hs=js;const Gs={syncAllStart(e){e.syncing=!0},syncAllAddEntries(e,t){e.data=t.reduce(((t,i)=>({...t,[i.id]:{...t[i.id],storeStatus:e.data[i.id].storeStatus===N?z:j}})),e.data);const i=t.map((({id:e})=>e));e.errors=e.errors.filter((e=>!i.includes(e.guid)))},syncAllFinish(e,t){e.syncing&&(e.syncing=!1,Array.isArray(t)&&(e.data=t.reduce(((t,i)=>{const a=e.data[i.id]?.storeStatus;return a&&![z,j].includes(a)?t:{...t,[i.id]:{...t[i.id],...i,storeStatus:V}}}),e.data)))},addSyncableObserver(e,t){e.syncableObservers=[...e.syncableObservers,t]},clearSyncableObservers(e){e.syncableObservers.forEach((e=>e())),e.syncableObservers=[]},addSyncError(e,t){let i=H,a=J;e.data[t.guid].storeStatus!==N&&e.data[t.guid].storeStatus!==z&&e.data[t.guid].storeStatus!==L||(i=L,a=Y),e.data[t.guid]={...e.data[t.guid],storeStatus:i},e.errors=[...e.errors,{...t,type:a}]},updateEntryByKeyAndValue(e,{guid:t,key:i,value:a}){if(null==e.data[t])return;const n={...e.data};n[t]={...e.data[t],[i]:a,storeStatus:U},e.data=n,e.errors=e.errors.filter((e=>e[R]!==t||e.key!==i))},updateEntry(e,{entry:t,silent:i=!1}){const a=t[R],n={...e.data};n[a]={...e.data[a],...t},i||(n[a].storeStatus=U),e.data=n},updateStoreStatusOfEntry(e,{guid:t,storeStatus:i}){null!=e.data[t]&&(e.data[t].storeStatus=i)},insert(e,{entry:t}){const i=t[R];e.data={...e.data,[i]:{...t,storeStatus:N}}}};var Ws=Gs;function Zs(e){return{namespaced:!0,state:tr(),mutations:Ws,actions:Hs(e)}}async function Ks(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"],a={version:"2.0",status:"success",data:[]};if(0===i?.length)return a;const{activitiesApi:n}=b["default"].prototype.$api,r=await Promise.all(i.map((e=>{const i={processOrderId:e,deleted:!1};return sr(n,"activityList",i,t)}))),s=A(r);return s}async function qs(e,t,i){const{activitiesApi:a}=b["default"].prototype.$api,{data:n}=await a.activityObjects({objectIds:e.join(",")},i);return n}async function Ys(e,t){const i=Sa.toSyncableActivities(e),{activitiesApi:a}=b["default"].prototype.$api,{data:n}=await a.activityPut({activityPutRequest:{data:i}});return n}async function Js(e){const{activitiesApi:t}=b["default"].prototype.$api,{data:i}=await t.activityPatch({activityPatchRequest:{data:[e]}});return i}function Xs(e){return{...e,data:e.data||[]}}async function Qs(e){const{activitiesApi:t}=b["default"].prototype.$api,i=e.map((e=>e.id)),a=Rs()(i,100),n=a.map((e=>t.activityDelete({objectIds:e.join(",")}).then((e=>e.data)).then((e=>Xs(e))))),r=await Promise.all(n);return A(r)}const eo=Fe(Ks,qs),to=Zs(Ys),io=Us(Qs);function ao({getters:e,rootGetters:t,dispatch:i},{activityId:a,activityTypeId:n}){const r=e.getById(a),s=t["activityTypes/getById"](n),o=cn(r,rr(s),t["auth/getCompanyByProcessOrderId"],t["activityTypes/getActivityTypeOfCompanyBySyncName"],t["activityTypes/getBySyncName"]);i("updateEntryByKeyAndValueAndSync",{guid:a,key:"activityTypeId",value:o.activityTypeId})}const no={...eo.actions,...to.actions,...io.actions,addActivityProduct({state:e,commit:t},i){const a=e.data[i];if(!a)return;const n=Aa.createActivityProduct(),r=[...a.products,n];t("updateEntryByKeyAndValue",{guid:a.id,key:"products",value:r})},addActivityEquipment({state:e,commit:t},i){const a=e.data[i];if(!a)return;const n=Za.createActivityEquipment(),r=[...a.equipment,n];t("updateEntryByKeyAndValue",{guid:a.id,key:"equipment",value:r})},removeOrDeleteActivityProductAndSync({state:e,commit:t,dispatch:i},{activityId:a,activityProductId:n}){const r=e.data[a];if(!r)return;const s=r.products.find((e=>e.id===n));s&&(Sa.isSyncableActivityProduct(s)?i("deleteActivityProductAndSync",{activityId:a,activityProductId:n}):(i("removeActivityProduct",{activityId:a,activityProductId:n}),t("updateStoreStatusOfEntry",{guid:r.id,value:V}
1)))},removeActivityProduct({state:e,commit:t},{activityId:i,activityProductId:a}){const n=e.data[i];if(!n)return;const r=n.products.filter((e=>e.id!==a));t("updateEntryByKeyAndValue",{guid:n.id,key:"products",value:r})},deleteActivityProduct({state:e,commit:t},{activityId:i,activityProductId:a}){const n=e.data[i];if(!n)return;const r=n.products.find((e=>e.id===a));r&&(r.deleted=da(Date.now()),t("updateEntryByKeyAndValue",{guid:n.id,key:"products",value:n.products}))},async deleteActivityProductAndSync({state:e,commit:t,dispatch:i},{activityId:a,activityProductId:n}){i("deleteActivityProduct",{activityId:a,activityProductId:n}),t("syncAllStart");const r=e.data[a];if(!r)throw new Error(`Activity not found: ${a}`);t("syncAllAddEntries",[r]);const s={processOrderId:r.processOrderId,id:r.id,products:Sa.toSyncableActivityProducts(r.products)};let o;try{switch(o=await Js(s),o.status){case"success":return void t("syncAllFinish",o.data);case"partialSuccess":case"error":return void(F(o)&&t("addSyncError",{guid:a,key:null,errorUserMessage:o.errorUserMessage?.[0]||b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")}));default:t("addSyncError",{guid:a,key:null,errorUserMessage:b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")})}}catch(l){console.error(l),t("addSyncError",{guid:a,key:null,errorUserMessage:[b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")]})}},removeOrDeleteActivityEquipmentAndSync({state:e,dispatch:t},{activityId:i,activityEquipmentId:a}){const n=e.data[i];if(!n)return;const r=n.equipment.find((e=>e.id===a));r&&(Sa.isSyncableActivityEquipment(r)?t("deleteActivityEquipmentAndSync",{activityId:i,activityEquipmentId:a}):t("removeActivityEquipment",{activityId:i,activityEquipmentId:a}))},removeActivityEquipment({state:e,commit:t},{activityId:i,activityEquipmentId:a}){const n=e.data[i];if(!n)return;const r=n.equipment.filter((e=>e.id!==a));t("updateEntryByKeyAndValue",{guid:n.id,key:"equipment",value:r})},deleteActivityEquipment({state:e,commit:t},{activityId:i,activityEquipmentId:a}){const n=e.data[i];if(!n)return;const r=n.equipment.find((e=>e.id===a));r&&(r.deleted=da(Date.now()),t("updateEntryByKeyAndValue",{guid:n.id,key:"equipment",value:n.equipment}))},async deleteActivityEquipmentAndSync({state:e,commit:t,dispatch:i,rootGetters:a},{activityId:n,activityEquipmentId:r}){i("deleteActivityEquipment",{activityId:n,activityEquipmentId:r}),t("syncAllStart");const s=e.data[n];if(!s)throw new Error(`Activity not found: ${n}`);t("syncAllAddEntries",[s]);const o=a["auth/currentProcessOrderIds"][0];if(!o)throw new Error(`ProcessOrderId '${o}' not found`);const l={id:s.id,processOrderId:o,equipment:s.equipment};let d;try{switch(d=await Js(l),d.status){case"success":return void t("syncAllFinish",d.data);case"partialSuccess":case"error":return void(F(d)&&t("addSyncError",{guid:n,key:null,errorUserMessage:d.errorUserMessage?.[0]||b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")}));default:t("addSyncError",{guid:n,key:null,errorUserMessage:b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")})}}catch(c){console.error(c),t("addSyncError",{guid:n,key:null,errorUserMessage:[b["default"].i18n.translate("Es ist ein unbekannter Fehler aufgetreten.")]})}},updateActivityTypeAndSync:ao,async duplicate({state:e,dispatch:t},i){const a=[];return i.forEach(((n,r)=>{const s=e.data[n];if(!s)return;const o=da(Date.now()),l=ma(),d=s.products.map((e=>({...e,id:ma()}))),c=s.equipment.map((e=>({...e,id:ma()}))),u={...s,id:l,creationDate:o,products:d,equipment:c};r===i.length-1?t("insertAndSyncNewEntry",{entry:u}):t("insertNewEntry",{entry:u}),a.push({originalId:n,duplicateId:l})})),a},async delete({dispatch:e,commit:t},i){i.forEach((e=>{t("removeEntry",{entry:e})})),e("syncAllRemovals")}};var ro=no;function so(e){return void 0!==e.links}function oo(e){const t="string"===typeof e?Number.parseInt(e,10):"number"===typeof e?e:null;return"number"!==typeof t||Number.isNaN(t)||t<0||t>99?null:Math.floor(t)}function lo(e){return String(e).padStart(2,"0")}function co(e){const t=oo(e);if(null===t)return;const i=lo(t);return{id:i,name:i}}function uo(e){return e?.id?oo(e.id):null}class po{constructor(e,t,i,a,n,r,s,o,l,d,c,u,p,h,m,f,g,y,v){(0,tt.Z)(this,"activities",void 0),(0,tt.Z)(this,"metadata",void 0),(0,tt.Z)(this,"units",void 0),(0,tt.Z)(this,"fields",void 0),(0,tt.Z)(this,"productCategories",void 0),(0,tt.Z)(this,"equipments",void 0),(0,tt.Z)(this,"users",void 0),(0,tt.Z)(this,"violationsService",void 0),(0,tt.Z)(this,"activityProductService",void 0),(0,tt.Z)(this,"companiesById",void 0),(0,tt.Z)(this,"processOrdersById",void 0),(0,tt.Z)(this,"productsLoading",void 0),(0,tt.Z)(this,"findProductById",void 0),(0,tt.Z)(this,"productStorageDropdownItem",void 0),(0,tt.Z)(this,"pesticideIndicationsDropdownItem",void 0),(0,tt.Z)(this,"activityTypeDropdownItem",void 0),(0,tt.Z)(this,"fieldDropdownItem",void 0),(0,tt.Z)(this,"calculateAmou
1ntsAndUnits",void 0),(0,tt.Z)(this,"isHerbicide",void 0),this.activities=e,this.metadata=t,this.units=i,this.fields=a,this.productCategories=n,this.equipments=r,this.users=s,this.violationsService=o,this.activityProductService=l,this.companiesById=d,this.processOrdersById=c,this.productsLoading=u,this.findProductById=p,this.productStorageDropdownItem=h,this.pesticideIndicationsDropdownItem=m,this.activityTypeDropdownItem=f,this.fieldDropdownItem=g,this.calculateAmountsAndUnits=y,this.isHerbicide=v}convertToActivitiesTableData(){const e=[];return this.activities.forEach((t=>{const{products:i,equipment:a,id:n,activityTypeId:r,fieldId:s,storeStatus:o,...l}=t,d=po.getNotDeletedActivityProducts(i),c=po.getNotDeletedActivityEquipment(a),u=this.getMetadataWithFallback(n),p=this.activityTypeDropdownItem(r)??void 0,h=s?this.fieldDropdownItem(s)??void 0:void 0,m=co(t.bbchCode),f=this.getFieldSize(t.fieldId),g=this.getRuleCheckStatus(n);if(!t.processOrderId)throw Error("Activity must have a process order id");const y=this.getCompanyName(t.processOrderId),v=this.getUserName(t.userId),b=Math.max(d.length,c.length);if(0===b)e.push({...l,id:n,activityTypeDropdownItem:p,fieldDropdownItem:h,...m?{bbchDropdownItem:m}:{},...u,fieldSize:f,ruleCheckStatus:g,companyName:y,user:v,storeStatus:o});else for(let w=0;w<b;w+=1){const i=d[w],a=c[w];e.push({...l,id:n,activityTypeDropdownItem:p,fieldDropdownItem:h,...m?{bbchDropdownItem:m}:{},...u,product:i?this.toTableDataActivityProduct(i,t.processedArea):void 0,equipment:a?this.toTableDataActivityEquipment(a):void 0,fieldSize:f,ruleCheckStatus:g,companyName:y,user:v,storeStatus:o})}e.push(po.rowForAddButtons(n,p,h,m,f,g,l,u,y,v))})),e}static getRuleCheckStatusType(e){return e&&0!==e.length?e.some((e=>!so(e)))?kt.Violation:kt.NotChecked:"OK"}getMetadataWithFallback(e){const t=this.metadata[e]?.select??!1,i=this.metadata[e]?.expand??!1;return{select:t,expand:i}}toTableDataActivityProduct(e,t){const i={...e,amount:e.amount??0},a=this.activityProductService.getAmountsAndUnits(i,t),{amount:n,unitId:r,...s}=e,o=this.productStorageDropdownItem(e.productId,e.storagePlaceId),l=this.getOptionalPesticideIndicationDropdownItem(e);return{...s,productStorageDropdownItem:o??void 0,pesticideIndicationDropdownItem:l,...a,isLoading:this.productsLoading}}toTableDataActivityEquipment(e){const{id:t,equipmentId:i,...a}=e;return{...a,id:t,dropdownItem:{id:i,name:this.equipments[i]?.name??""}}}static rowForAddButtons(e,t,i,a,n,r,s,o,l,d){return{...s,id:e,activityTypeDropdownItem:t,fieldDropdownItem:i,...a?{bbchDropdownItem:a}:{},fieldSize:n,ruleCheckStatus:r,...o,product:po.dummyProductForAddProductButton(),equipment:po.dummyEquipmentForAddEquipmentButton(),companyName:l,user:d,storeStatus:V}}static dummyProductForAddProductButton(){return{id:"",productId:"",tstamp:0,productStorageDropdownItem:"HOT_DISPLAY_BUTTON_RENDERER",pesticideIndicationDropdownItem:void 0,amountUnitRelative:{amount:null,unitId:null,isFixed:!1},amountUnitTotal:{amount:null,unitId:null,isFixed:!1},isLoading:!1}}static dummyEquipmentForAddEquipmentButton(){return{id:"",tstamp:0,dropdownItem:"HOT_DISPLAY_BUTTON_RENDERER"}}getOptionalPesticideIndicationDropdownItem(e){const t=this.findProductById(e.productId);if(t&&this.isHerbicide(t,this.productCategories)&&e.pestId&&e.pesticideIndicationId){const t=this.pesticideIndicationsDropdownItem(e.productId,e.pestId,e.pesticideIndicationId);return t}}getFieldSize(e){if(!e)return;const t=this.fields[e];return t?.fieldSize}getRuleCheckStatus(e){const t=this.violationsService?.getViolations(e);if(t){const e=po.getRuleCheckStatusType(t),i=po.getRuleCheckTooltipLabel(t);return{type:e,tooltipLabel:i}}return{type:"OK",tooltipLabel:null}}getCompanyName(e){const{companyId:t}=this.processOrdersById[e];return this.companiesById[t].abbreviation??this.companiesById[t].name}getUserName(e){const t=e?this.users[e]:void 0;if(t)return`${t.firstname} ${t.lastname}`}static getRuleCheckTooltipLabel(e){return e&&0!==e.length?1===e.length?e[0].shortMessage:"Es gibt mehrere Warnhinweise":null}static getNotDeletedActivityProducts(e){return e.filter((e=>!e.deleted))}static getNotDeletedActivityEquipment(e){return e.filter((e=>!e.deleted))}}function ho(e,t,i){const a=mo(t,e.fieldGroup.customerId),n=fo(i,e.cropId),r=go(e);return`${a}${r}${n}`}function mo(e,t){if(!t)return"";const i=e[t];return i?i.shortname?`${i.shortname} - `:`${i.name} - `:""}function fo(e,t){if(!t)return"";const i=e[t];return i?` (${i.name})`:""}function go(e){return e.fieldGroup.mfa?`${e.fieldGroup.mfa} - ${e.name}`:e.name}function yo(e,t,i,a,n,r,s,o){return Object.fromEntries(Object.entries(e).map((([e,l])=>{const d=vo(l,t,i,a,n,r,s,o);return[e,d]})))}function vo(e,t,i,a,n,r,s,o){const l=e.fieldId?r[e.fieldId]:null,d=l?ho(l,s,o):"";return{...e,fieldDisplayName:d,products:bo(e.products,t,i,a),equipment:wo(e.equipment,n),workingTime:e.workingTime?`${e.workingTime}`:null,pauseTime:e.pauseTime?`${e.pauseTime}`:null,drivingTime:e.drivingTime?`${e.drivingTime}`:null,setupTime:e.setupTime?`${e.setupTime}`:null}}function bo(e,t,i,a){return e&&0!==e.length?e.map((e=>{if(!e.productId)return{...e,productId:void 0,displayName:"",productStorageDropdownId:void 0};const n=t(e.productId);if(!n)return{...e,displayName:i?"loading...":"",productStorageDropdownId:void 0};if(e.storagePlaceId){const t=a[e.storagePlaceId];if(t)return{...e,displayName:`${n.name} (${t.name})`,productStorageDropdownId:`${n.id}_${t.id}`}}return{...e,displayName:n.name,productStorageDropdownId:n.id}})):[]}function wo(e,t){return e&&0!==e.length?e.map((e=>{const i=t[e.equipmentId];return i?{...e,displayName:i.name}:{...e,displayName:""}})):[]}function Co(e,t){return e.filter((e=>e.activityTypeId===t.activityTypeId&&e.fieldId===t.fieldId&&Fo(e,t)&&Ao(e,t)&&ko(e,t)))}function Fo(e,t){if(e.products.length!==t.products.length)return!1;const i=e.products.map((e=>e.productId)),a=t.products.map((e=>e.productId));return i.every((e=>a.includes(e)))}function Ao(e,t){if(e.equipment.length!==t.equipment.length)return!1;const i=e.equipment.map((e=>e.equipmentId)),a=t.equipment.map((e=>e.equipmentId));return i.every((e=>a.includes(e)))}function ko(e,t){return!e.timeStart||!t.timeStart||new Date(1e3*e.timeStart).toLocaleDateString()===new Date(1e3*t.timeStart).toLocaleDateString()}const So={...eo.getters,...to.getters,activityWithDisplayNames:(e,t,i,a)=>t=>{const n=e.data[t],r=a["products/findProductById"],s=a["products/loading"],o=i.storagePlaces.data,l=i.equipments.data,d=i.fields.data,c=a["customers/data"],u=i.products.crops.data;return vo(n,r,s,o,l,d,c,u)},activitiesWithDisplayNames:(e,t,i,a)=>{const n=a["products/findProductById"],r=a["products/loading"],s=i.storagePlaces.data,o=i.equipments.data,l=i.fields.data,d=a["customers/data"],c=i.products.crops.data;return yo(e.data,n,r,s,o,l,d,c)},activityProductDisplayName:(e,t,i,a)=>(e,t)=>{const n=a["products/findProductById"](e);if(!n)return null;if(t){const e=i.storagePlaces.data[t];return e?`${n.name} (${e.name})`:n.name}return n.name},selectedActivityIds:e=>Object.entries(e.tableDataMetadata).filter((([,e])=>e.select)).map((([e])=>e)),selectedActivities:(e,t)=>{const i=t.selectedActivityIds;return Object.values(e.data).filter((e=>i.includes(e.id)))},tableDataActivities:(e,t,i,a)=>{const n=da(Date.now()),r=Object.values(e.data).filter((e=>void 0===e.deleted||null===e.deleted||e.deleted>n)),s=a["auth/currentCompaniesRegionCodes"];
1if(s.length>1)throw new Error("Multiple region codes not supported");const o=new Ya(i.fields.data,a["products/findProductById"]),l=new Wa(i.equipments.data),d=new Za(l),c=new qa(i.auth.companiesById),u=new La(i.products.mineralFertilizers.data,i.products.companyFertilizers.data,i.products.secondaryFertilizers.data,i.products.herbizides.data,i.products.crops.data,i.products.miscellaneous.data,i.products.harvests.data,i.products.seeds.data,i.products.otherProductsAndFertilizers.data,i.products.waads.data),p=new Aa(i.units.data,u,$a),h=new Ka(e.data,o,d,p,c),m=new hs(e.ruleCheck.activityRuleViolations.data),f=new fs(e.ruleCheck.rules.data,h,m,s[0]),{companiesById:g}=i.auth;return new po(r,e.tableDataMetadata,i.units.data,i.fields.data,i.productCategories.data,i.equipments.data,i.users.data,f,p,g,a["auth/processOrdersById"],a["products/loading"],a["products/findProductById"],a["products/dropdownItem"],a["pesticideIndications/dropdownItem"],a["activityTypes/dropdownItem"],a["fields/dropdownItem"],$a,Ki).convertToActivitiesTableData()},pesticideIdsInUse:(e,t,i,a)=>{const n=Object.values(e.data),r=new Set;return n.forEach((e=>{e.products.forEach((e=>{const t=a["products/findProductById"](e.productId);t&&Ki(t,i.productCategories.data)&&r.add(t.id)}))})),Array.from(r).sort()},findSimilarActivitiesForImportActivity:e=>t=>{const i=Object.values(e.data);return Co(i,t)},findAllByFieldId:e=>t=>Object.values(e.data).filter((e=>e.fieldId===t)),findAllByFieldIds:e=>t=>Object.values(e.data).filter((e=>ka(e.fieldId))).filter((e=>t.includes(e.fieldId)))};var Eo=So;const Io={...eo.mutations,...to.mutations,...io.mutations,addOrUpdateTableDataMetadataByKeyAndValue(e,{activityId:t,key:i,value:a}){const n={...e.tableDataMetadata};n[t]={...n[t],[i]:a},e.tableDataMetadata=n},removeActivity(e,t){b["default"]["delete"](e.data,t),b["default"]["delete"](e.tableDataMetadata,t)},setHot(e,t){b["default"].set(e,"hot",t)},setUserColumnSettings(e,t){b["default"].set(e,"userColumnSettings",t)}};var _o=Io;function Do(){return{...be(),...tr(),...er(),tableDataMetadata:{},hot:null,userColumnSettings:{}}}const Mo={namespaced:!0,state:Do(),mutations:_o,actions:ro,getters:Eo,modules:{createEditActivity:Qn,moveActivity:Ur,ruleCheck:Fs,sharedActivities:Os,importActivities:Mr,gpsTrack:Ye,gpsLog:$e}};var Po=Mo;const To="/admin/rest";var xo=i(48731);function Bo(e){switch(typeof e){case"boolean":return e?"1":"0";case"number":return e.toString();case"object":if(Array.isArray(e))return e.toString();throw new Error(`Unsupported api option value: ${e}`);default:return e}}function Oo(e){const t=Object.entries(e).reduce(((e,[t,i])=>{switch(t){case"resolve":case"resolveInSeparateList":e.append(t,Ro(i));break;default:e.append(t,Bo(i))}return e}),new URLSearchParams);return t}function $o(e){return Array.from(e.entries()).map((([e,t])=>`${e}=${t}`)).join("&")}const Ro=e=>{if(null!=e){const t=new xo.TextEncoder,i=t.encode(JSON.stringify(e)),a=btoa(String.fromCharCode(...i));return a}return""};async function No(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=["AND",["companyId","IN",e],["rough.category","=","user_selectable"],["hidden","IS",null]];a.append("filter",Ro(n));const r=`${To}/activityTypes?${$o(a)}`;return l().get(r,t)}async function zo(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=["AND",["rough.category","=","user_selectable"],["hidden","IS",null]];a.append("filter",Ro(n)),a.append("permissionMode","fieldSharing"),a.append("fieldSharingCompanyId",e);const r=`${To}/activityTypes?${$o(a)}`;return l().get(r,t)}async function Lo(e,t={itemsPerPage:5e3}){const i=Oo(t);i.append("version","2.0");const a=`${To}/activityTypesRough?${i.toString()}`;return l().get(a,e)}async function Vo(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=["processOrderId","IN",e];a.append("filter",Ro(n));const r=`${To}/field?${$o(a)}`;return l().get(r,t)}async function Uo(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=["id","IN",e];a.append("filter",Ro(n));const r=`${To}/field?${$o(a)}`;return l().get(r,t)}async function jo(e,t,i,a){const n=new URLSearchParams;i&&n.append("permissionMode",i),a&&n.append("fieldSharingCompanyId",a);const r=`${To}/field/export?${n.toString()}`;return l().post(r,{version:"2.0",data:{type:e,fieldIds:t}})}async function Ho(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0"),e.forEach((e=>{a.append("processOrderIds[]",e)}));const n=`${To}/material/crop/active_for_process_order?${a.toString()}`;return l().get(n,t)}async function Go(e,t,i,a={itemsPerPage:5e3}){const n=Oo(a);n.append("version","2.0");const r=Wo(e,t);n.append("filter",Ro(r));const s=`${To}/material?${$o(n)}`;return l().get(s,i)}function Wo(e,t){const i=e.map((e=>e.id)),a=e.map((e=>e.regionId)),n=["AND",["systemOnly","=",!1],["category.type","=",t],["regi
1onId","IN",a],["OR",["companyId","IS",null],["companyId","IN",i]]];return n}async function Zo(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=["companyId","IN",e];a.append("filter",Ro(n));const r=`${To}/companyCustomer?${$o(a)}`;return l().get(r,t)}async function Ko(e,t){const i=e.rootState.auth.currentCompanies.map((e=>e.id)),{data:a}=await No(i,t);return a}async function qo(e,t,i){throw new Error("NOT IMPLEMENTED")}const Yo=Fe(Ko,qo),Jo={...Yo.actions};var Xo=Jo;function Qo(){return{used:[]}}const el={namespaced:!0,state:Qo(),mutations:{useItem(e,t){const i=[t,...e.used.filter((e=>e!==t))].slice(0,4);b["default"].set(e,"used",i)}},getters:{used:e=>e.used}};var tl=el;const il={...Yo.getters,...tl.getters,byRoughAndFineId:e=>(t,i=null)=>{const a=Object.values(e.data).find((e=>e.roughId===t&&e.fineId===i));return a??null},allActivityTypes:e=>Object.values(e.data),activityTypeByType:e=>t=>Object.values(e.data).find((e=>e.type===t)),compatibleActivityTypes:(e,t)=>i=>Ga(i)?t.allActivityTypes.filter((e=>{const a=ar(e,t.allActivityTypes);return ir(e,a,i)})):Object.values(e.data),compatibleActivityTypesWithoutSyncNameDuplicates:(e,t)=>e=>{const i=t.compatibleActivityTypes(e),a=new Map;return i.forEach((e=>{a.set(rr(e),e)})),Array.from(a.values())},dropdownItem:e=>t=>{const i=e.data[t];return i?{id:i.id,name:i.displayName}:null},dropdownItems:(e,t)=>e=>{const i=t.compatibleActivityTypesWithoutSyncNameDuplicates(e),a=t.used,n=i.map((e=>({id:e.id,name:e.displayName}))),r={name:b["default"].i18n.translate("Zuletzt verwendet")||"",id:"activityTypes-used",items:n.filter((e=>a.includes(e.id||""))),sort:!1},s={name:b["default"].i18n.translate("Tätigkeiten")||"",id:"activityTypes",items:n.filter((e=>!a.includes(e.id||""))),sort:!0};return[r,s]},findActivityTypeOfCompany:(e,t)=>(i,a)=>{const n=e.data[i];if(!n)return;if(n.companyId===a)return n;const r=ar(n,t.allActivityTypes);return r.find((e=>e.companyId===a))},findActivityTypeOfCompanyBySyncName:e=>(t,i)=>Object.values(e.data).find((e=>rr(e)===t&&e.companyId===i)),getActivityTypeOfCompanyBySyncName:(e,t)=>(e,i)=>{const a=t.findActivityTypeOfCompanyBySyncName(e,i);if(!a)throw new Error(`ActivityType with syncName ${e} not found`);return a},findBySyncName:e=>t=>Object.values(e.data).find((e=>rr(e)===t)),getBySyncName:(e,t)=>e=>{const i=t.findBySyncName(e);if(!i)throw new Error(`ActivityType with syncName ${e} not found`);return i},activityTypeDisplayName:e=>t=>{const i=e.data[t];return i&&i.displayName||""}};var al=il;function nl(){return{...be(),...Qo()}}const rl={...Yo.mutations,...tl.mutations};var sl=rl;const ol={namespaced:!0,state:nl(),mutations:sl,actions:Xo,getters:al};var ll=ol;async function dl(e,t){const{data:i}=await Lo(t);return i}async function cl(e,t,i){const{data:a}=await Lo(i);if("success"===a.status){const t=a.data,i=t.filter((t=>e.includes(t.id)));a.data=i}return a}const ul=Fe(dl,cl),pl={...ul.actions};var hl=pl;const ml={...ul.getters};var fl=ml;const gl={...ul.mutations};var yl=gl;function vl(){return{...be()}}const bl={namespaced:!0,state:vl(),mutations:yl,actions:hl,getters:fl};var wl=bl;async function Cl(e,t){const i=e.rootState.auth.currentCompanies?.[0]?.id,{data:a}=await zo(i,t);return a}async function Fl(e,t,i){throw new Error("NOT IMPLEMENTED")}const Al=Fe(Cl,Fl),kl={...Al.actions};var Sl=kl;const El={...Al.getters,...tl.getters,byRoughAndFineId:e=>(t,i=null)=>{let a=null;return Object.values(e.data).some((e=>e.roughId===t&&e.fineId===i&&(a=e,!0))),a}};var Il=El;const _l={...Al.mutations,...tl.mutations};var Dl=_l;function Ml(){return{...be(),...Qo()}}const Pl={namespaced:!0,state:Ml(),mutations:Dl,actions:Sl,getters:Il};var Tl=Pl,xl=i(94316),Bl=i.n(xl),Ol=i(83505),$l=i.n(Ol);Object.values($l()).forEach((e=>{e.languageTag.includes("de-")?Bl().registerLanguage({...e,delimiters:{thousands:".",decimal:","}}):Bl().registerLanguage(e)}));const Rl={thousandSeparated:!0,mantissa:2};Bl().setDefaults(Rl),b["default"].filter("numbro",((e,t)=>
1{if(Number.isNaN(e))return null;let i={...Rl};return"number"===typeof t&&(i.mantissa=t),"object"===typeof t&&(i={...Rl,...t}),Bl()(Number(e)).format(i)}));var Nl=Bl(),zl=i(78345);b["default"].use(zl.ZP);const Ll=new zl.ZP({mode:"history"});var Vl=Ll;function Ul(e,t,i=null){const a=encodeURIComponent(JSON.stringify(t)),n=`${e}=${a};domain=${window.location.hostname};path=/`;document.cookie=null!=i?`${n};max-age=${i}`:n}function jl(e){let t=null;document.cookie.split("; ").some((i=>{const a=i.split("=");return a[0]===e&&([,t]=a,!0)}));try{t=JSON.parse(decodeURIComponent(t))}catch{t=null}return t}const Hl="FARMDOK_AUTH_CHECK_EMAIL_VISITED",Gl="FARMDOK_AUTH_REGISTRATION_PROCESS_ACTIVE",Wl="FARMDOK_AUTH_CURRENT_COMPANIES_AND_PROCESS_ORDER_NAME";var Zl,Kl;(function(e){e["CAN_PURCHASE_LICENSE"]="CAN_PURCHASE_LICENSE",e["FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC"]="FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC",e["FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE"]="FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE",e["FEATURE_COST_ACCOUNTING"]="FEATURE_COST_ACCOUNTING",e["FEATURE_CROPPING_PLAN"]="FEATURE_CROPPING_PLAN",e["FEATURE_CROP_RATIO"]="FEATURE_CROP_RATIO",e["FEATURE_CROP_ROTATION"]="FEATURE_CROP_ROTATION",e["FEATURE_CUSTOMERS"]="FEATURE_CUSTOMERS",e["FEATURE_DIGITAL_CONTRACTING"]="FEATURE_DIGITAL_CONTRACTING",e["FEATURE_EXPORT_FIELD"]="FEATURE_EXPORT_FIELD",e["FEATURE_FERTILIZATION_PLAN"]="FEATURE_FERTILIZATION_PLAN",e["FEATURE_FERTILIZER_REGULATION"]="FEATURE_FERTILIZER_REGULATION",e["FEATURE_FIELD_DETAIL_CROP_ROTATION"]="FEATURE_FIELD_DETAIL_CROP_ROTATION",e["FEATURE_FIELDS"]="FEATURE_FIELDS",e["FEATURE_FIELDS_ADVANCED"]="FEATURE_FIELDS_ADVANCED",e["FEATURE_FIELDS_NDVI_MEAN"]="FEATURE_FIELDS_NDVI_MEAN",e["FEATURE_FIELDS_SHARED"]="FEATURE_FIELDS_SHARED",e["FEATURE_GROUNDWATER_PROTECTION"]="FEATURE_GROUNDWATER_PROTECTION",e["FEATURE_MANAGED_CONTRACTS"]="FEATURE_MANAGED_CONTRACTS",e["FEATURE_MOVE_ACTIVITIES"]="FEATURE_MOVE_ACTIVITIES",e["FEATURE_NOTES"]="FEATURE_NOTES",e["FEATURE_NUTRIENT_BALANCE"]="FEATURE_NUTRIENT_BALANCE",e["FEATURE_NUTRIENT_COMPARISON"]="FEATURE_NUTRIENT_COMPARISON",e["FEATURE_PROCESS_ORDER"]="FEATURE_PROCESS_ORDER",e["FEATURE_SOIL_SAMPLES"]="FEATURE_SOIL_SAMPLES",e["FEATURE_STOCK_MOVEMENT"]="FEATURE_STOCK_MOVEMENT",e["FEATURE_SUBSTANCE_FLOW"]="FEATURE_SUBSTANCE_FLOW",e["FEATURE_TASK_PLAN"]="FEATURE_TASK_PLAN",e["FEATURE_VEGETATION_MONITORING"]="FEATURE_VEGETATION_MONITORING",e["FEATURE_WEATHER_INFO"]="FEATURE_WEATHER_INFO"})(Zl||(Zl={})),function(e){e["FETCHING_INITIAL_ACCESS_TOKEN"]="fetchingInitialAccessToken",e["FETCHING_LOGIN"]="fetchingLogin",e["FETCHING_USER_INFO"]="fetchingUserInfo",e["FETCHING_REGISTER"]="fetchingRegister",e["FETCHING_COMPANIES"]="fetchingCompanies"}(Kl||(Kl={}));const ql={setCurrentCompanies({dispatch:e,commit:t,state:i},a){t("setCurrentCompaniesAndProcessOrderName",{companies:a,processOrderName:i.currentProcessOrderName}),e("persistCurrentCompanies"),e("resetData",null,{root:!0})},setCurrentProcessOrderName({dispatch:e,commit:t,getters:i},a){if(!i.availableProcessOrderNames.includes(a))throw new RangeError(`\n            setCurrentProcessOrderName: processOrderName "${a}"\n            out of range: [${i.availableProcessOrderNames.join(", ")}]\n          `);t("setCurrentProcessOrderName",a),e("persistCurrentCompanies"),e("resetData",null,{root:!0})},selectCompanyById({dispatch:e,commit:t,state:i},a){const n=i.companiesById[a];let r=null;Array.isArray(n.processOrders)&&n.processOrders.some((e=>(r=e,e.name===i.currentProcessOrderName))),t("setCurrentProcessOrder",{currentCompany:n,currentProcessOrder:r}),e("resetData",null,{root:!0})},async subscribe({commit:e,dispatch:t,state:i}){if(i.userInfoLoaded)return null;if(!i.loggedIn&&!i.fetchingInitialAccessToken&&null!=i.jwtAuth){e("startFetching",Kl.FETCHING_INITIAL_ACCESS_TOKEN);const a=await i.jwtAuth.initTokenChecking();if(e("endFetching",Kl.FETCHING_INITIAL_ACCESS_TOKEN),!a)return t("clearObservers"),null}return i.loggedIn&&!i.fetchingUserInfo&&t("updateUserInfo"),new Promise((t=>e("addObserver",t)))},async updateUserInfo({commit:e,dispatch:t,state:i}){e("startFetching",Kl.FETCHING_USER_INFO);try{await Promise.all([t("loadCurrentUser"),t("loadUserCompanies")])}catch(a){console.error("updateUserInfo failed",a),t("logout")}finally{e("endFetching",Kl.FETCHING_USER_INFO),t("clearObservers",{status:"success"})}if(!i.user.emailIsConfirmed){const e=localStorage.getItem(Hl);if(null==e||g()(e,"YYYY-MM-DD").format("YYYY-MM-DD")!==g()().format("YYYY-MM-DD"))return void Vl.pu
1sh({name:"register-check-email"}).catch((()=>{}))}0===i.userCompanies.length&&Vl.push({name:"no-company"}).catch((()=>{}))},async refreshUserCompanies({commit:e,dispatch:t,state:i}){if(!i.userInfoLoaded)return t("subscribe");if(i.fetchingUserInfo||i.fetchingCompanies)return new Promise((t=>e("addObserver",t)));e("startFetching",Kl.FETCHING_COMPANIES);try{await t("loadUserCompanies")}catch(a){console.error("refreshUserCompanies failed",a),t("logout")}finally{e("endFetching",Kl.FETCHING_COMPANIES),t("clearObservers",{status:"success"})}return null},async loadCurrentUser({commit:e,state:t,dispatch:i}){const{data:a}=await l().get("/admin/rest/user/current");if(t.user.id!==a.data.id)throw new Error("loadCurrentUser: id mismatch!");const n=a.data.language.code;i("selectLocale",n,{root:!0}),i("checkLocale",null,{root:!0}),b["default"].i18n.set(n),a.data.language.fallbackCode&&b["default"].i18n.fallback(a.data.language.fallbackCode),Nl.setLanguage(n),g().locale(n),e("setUser",a.data)},getCurrentCompanies(){return jl(Wl)},async loadUserCompanies({commit:e,dispatch:t,state:i,getters:a}){const n=["AND",["userId","=",i.user.id],["active","=",1]];let r={data:[]};try{const e=await l().get(`/admin/rest/companyUser?itemsPerPage=5000&filter=${Ro(n)}`);({data:r}=e)}catch(u){if(null==u||null==u.response||null==u.response.data||"noCompany"!==u.response.data.errorCode)throw console.error(u),u}const s=[];await Promise.all(r.data.map((async t=>{const i=["region"],a=await l().get(`/admin/rest/company/${t.companyId}?resolve=${Ro(i)}`);s.push({...t,company:a.data.data}),null!=a.data.data.features&&e("features/addFeaturesToCompany",{companyId:a.data.data.id,features:a.data.data.features},{root:!0})}))),e("setUserCompanies",s);const o=[];let d=g()().format("YYYY");const c=await t("getCurrentCompanies");if(null!=c&&Array.isArray(c.companies)&&(c.companies.forEach((e=>{null!=i.companiesById[e]&&o.push(i.companiesById[e])})),({processOrderName:d}=c)),0===o.length)if(null!=i.user.companyId&&null!=i.companiesById[i.user.companyId]){o.push(i.companiesById[i.user.companyId]);const{processOrderId:e}=i.companiesById[i.user.companyId];null!=e&&null!=a.processOrdersById[e]&&(d=a.processOrdersById[e].name)}else s.length>0&&o.push(s[0].company);e("setCurrentCompaniesAndProcessOrderName",{companies:o,processOrderName:d}),t("persistCurrentCompanies")},async login({commit:e,state:t,dispatch:i},{email:a,password:n}){localStorage.removeItem(Hl),localStorage.removeItem(Gl),i("resetData",null,{root:!0}),e("startFetching",Kl.FETCHING_LOGIN);const r=await(t.jwtAuth?.login(a,n));if(e("endFetching",Kl.FETCHING_LOGIN),"success"!==r?.status)return r;if(null!=r.data&&null!=r.data.access_token){const e=t.jwtAuth?.constructor.getDataFromToken(r.data.access_token);null!=e&&!0===e.super_admin&&Ul(Wl,null)}return i("subscribe")},async loginWithOneTimeToken({commit:e,state:t,dispatch:i},{oneTimeToken:a}){localStorage.removeItem(Gl),i("resetData",null,{root:!0}),e("startFetching",Kl.FETCHING_LOGIN);const n=await(t.jwtAuth?.loginOneTime(a));if(e("endFetching",Kl.FETCHING_LOGIN),"success"!==n?.status)return n;if(null!=n?.data&&null!=n.data.access_token){const e=t.jwtAuth?.constructor.getDataFromToken(n.data.access_token);null!=e&&!0===e.super_admin&&Ul(Wl,null)}return i("subscribe")},async logout({commit:e,dispatch:t,state:i}){localStorage.removeItem(Hl),localStorage.removeItem(Gl),e("startFetching",Kl.FETCHING_LOGIN),await(i.jwtAuth?.logout()),e("setLoggedOut"),t("resetData",null,{root:!0}),e("endFetching",Kl.FETCHING_LOGIN)},async register({commit:e,dispatch:t},{email:i,password:a,regionId:n,onboarding:r=null}){e("startFetching",Kl.FETCHING_REGISTER);try{const e=await l().post("/admin/rest/user/register",{version:"2.0",data:{email:i,password:a,regionId:n,onboarding:r}});if("success"!==e.data.status)return e}catch(o){return null==o||null==o.response?null:o.response.data}await new Promise((e=>setTimeout(e,1e3)));const s=await t("login",{email:i,password:a});return e("endFetching",Kl.FETCHING_REGISTER),localStorage.setItem(Gl,JSON.stringify(!0)),s},async updateAndSyncUser({state:e,commit:t},i){t("updateUser",i);let a=null;try{const t=await l().put(`/admin/rest/user/${e.user.id}`,{version:"2.0",data:i});a=t.data}catch(n){null!=n&&null!=n.response&&(a=n.response.data)}return a},async updateAndSyncCurrentCompany({commit:e},{id:t,data:i}
1){e("updateCurrentCompany",{id:t,data:i});let a=null;try{const e=await l().put(`/admin/rest/company/${t}`,{version:"2.0",data:i});a=e.data}catch(n){null!=n&&null!=n.response&&(a=n.response.data)}return a},clearObservers({state:e,commit:t},i){e.observers.forEach((e=>e(i))),t("clearObservers")},async createProcessOrder({state:e,getters:t},{direction:i,copyFields:a=!0,sourceProcessOrderName:n=null}){if(!["next","previous"].includes(i))return console.error("createProcessOrder called with invalid direction"),{status:"error"};let r=e.currentProcessOrderName;null!=n&&(r=n);const s=e.currentCompanies.map((e=>t.processOrderByCompanyIdAndNameAndType(e.id,r))),o=await Promise.all(s.map((async e=>{try{const{data:t}=await l().post(`/admin/rest/processOrder/create_${i}`,{version:"2.0",data:{id:e.id,copyFields:a}});return ue(t)}catch(t){return ue(t)}})));return he(...o)},persistCurrentCompanies({state:e,getters:t}){if(0!==e.currentCompanies.length&&null!=e.currentProcessOrderName){Ul(Wl,{companies:e.currentCompanies.map((e=>e.id)),processOrderName:e.currentProcessOrderName},2592e3);try{const i=e.currentCompanies.map((i=>({id:i.id,processOrderId:t.processOrderByCompanyIdAndNameAndType(i.id,e.currentProcessOrderName).id})));l().put("/admin/rest/company/",{version:"2.0",data:i})}catch(i){console.error("Unable to update company processOrderIds",i)}}else Ul(Wl,null)}};var Yl=ql,Jl=i(91296),Xl=i.n(Jl);function Ql(){return{...be(),removing:!1,removableObservers:[]}}function ed(e){return{namespaced:!0,state:Ql(),mutations:{syncAllRemovesStart(e,t){b["default"].set(e,"removing",!0),b["default"].set(e,"data",t.reduce(((e,t)=>null==e[t.id]?e:{...e,[t.id]:{...e[t.id],storeStatus:W}}),e.data));const i=t.map((({id:e})=>e));b["default"].set(e,"errors",e.errors.filter((e=>!i.includes(e.id))))},syncAllRemovesFinish(e,t){if(!e.removing)return;if(b["default"].set(e,"removing",!1),!Array.isArray(t))return;const i={...e.data};t.forEach((({id:e})=>{delete i[e]})),b["default"].set(e,"data",i)},addRemovableObserver(e,t){b["default"].set(e,"removableObservers",[...e.removableObservers,t])},clearRemovableObservers(e){e.removableObservers&&e.removableObservers.length>0&&e.removableObservers.forEach((e=>e())),b["default"].set(e,"removableObservers",[])},removeEntry(e,{entry:t}){if(null!=e.data[t.id])if(e.data[t.id].storeStatus===N){const i={...e.data};delete i[t.id],b["default"].set(e,"data",i)}else b["default"].set(e,"data",{...e.data,[t.id]:{...e.data[t.id],storeStatus:G}})},addRemovalError(e,{guid:t,key:i,errorUserMessage:a}){b["default"].set(e,"data",{...e.data,[t]:{...e.data[t],storeStatus:H}}),b["default"].set(e,"errors",[...e.errors,{type:J,guid:t,key:i,errorUserMessage:a}])}},actions:{async removeAndSyncEntry({commit:e,dispatch:t},{entry:i}){e("removeEntry",{entry:i}),await t("syncAllRemovals")},syncAllRemovals:Xl()((async({state:t,commit:i,dispatch:a})=>{if(t.removing)return void await new Promise((e=>i("addRemovableObserver",e)));const n=Object.values(t.data).filter((e=>e.storeStatus===G));if(n.length<1)return void i("clearRemovableObservers");let r;i("syncAllRemovesStart",n);try{const t=[];await Promise.all([...new Array(Math.ceil(n.length/50)).keys()].map((async i=>{const a=50*i,r=50*(i+1),s=["id","IN",n.slice(a,r).map((({id:e})=>e))],{data:o}=await l()["delete"](`${e}?version=2.0&filter=${Ro(s)}`);t.push(ue(o))}))),r=he(...t)}catch(s){r=ue(s)}"success"===r?.status?(i("syncAllRemovesFinish",r.data),await a("syncAllRemovals")):"partialSuccess"===r?.status?(a("addRemoveErrors",{entries:n,responseData:r}),i("syncAllRemovesFinish",r.data?.filter((e=>null==r?.errors?.[e.id]))),await a("syncAllRemovals")):(a("addRemoveErrors",{entries:n,responseData:r}),i("clearRemovableObservers"),i("syncAllRemovesFinish"))}),100),addRemoveErrors({commit:e},{entries:t,responseData:i}){"partialSuccess"===i.status?Object.keys(i.errors||{}).forEach((t=>{const a=ue(i.errors[t]);e("addRemovalError",{guid:t,key:null,errorUserMessage:a.errorUserMessage[0]})})):t.forEach((t=>{e("addRemovalError",{guid:t.id,key:null,errorUserMessage:i.errorUserMessage[0]})}))}}}}function td(){return{...be(),syncing:!1,syncableObservers:[],errors:[]}}function id(e,{model:t,modelDefinition:i={}}){return{namespaced:!0,state:td(),mutations:{syncAllStart(e){e.syncing=!0},syncAllAddEntries(e,t){e.data=t.reduce(((t,i)=>({...t,[i.id]:{...t[i.id],storeStatus:e.data[i.id].storeStatus===N?z:j}})),e.data);const i=t.map((({id:e})=>e));e.errors=e.errors.filter((e=>
1!i.includes(e.guid)))},syncAllFinish(e,t){e.syncing&&(e.syncing=!1,Array.isArray(t)&&(e.data=t.reduce(((t,i)=>{const a=e.data[i.id]?.storeStatus;return a&&![z,j].includes(a)?t:{...t,[i.id]:{...t[i.id],...i,storeStatus:V}}}),e.data)))},addSyncableObserver(e,t){e.syncableObservers=[...e.syncableObservers,t]},clearSyncableObservers(e){e.syncableObservers.forEach((e=>e())),e.syncableObservers=[]},addSyncError(e,t){let i=H,a=J;e.data[t.guid].storeStatus!==N&&e.data[t.guid].storeStatus!==z&&e.data[t.guid].storeStatus!==L||(i=L,a=Y),e.data[t.guid]={...e.data[t.guid],storeStatus:i},e.errors=[...e.errors,{...t,type:a}]},updateEntryByKeyAndValue(e,{guid:t,key:i,value:a}){if(null==e.data[t])return;const n={...e.data};n[t]={...e.data[t],[i]:a,storeStatus:U},e.data=n,e.errors=e.errors.filter((e=>e[R]!==t||e.key!==i))},updateEntry(e,{entry:t,silent:i=!1}){const a=t[R],n={...e.data};n[a]={...e.data[a],...t},i||(n[a].storeStatus=U),e.data=n},insert(e,{entry:t}){const i=t[R];e.data={...e.data,[i]:{...t,storeStatus:N}}}},actions:{async insertNewEntry({commit:e},{entry:i}){const a={...t,...i};e("insert",{entry:a})},async insertAndSyncNewEntry({dispatch:e},{entry:t}){await e("insertNewEntry",{entry:t}),await e("syncAll")},async updateAndSyncEntry({commit:e,dispatch:t},{entry:i}){e("updateEntry",{entry:i}),await t("syncAll")},async syncAll({state:a,commit:n,dispatch:r}){if(a.syncing)return void await new Promise((e=>{n("addSyncableObserver",e)}));n("syncAllStart"),await new Promise((e=>{setTimeout(e,100)}));const s=Object.values(a.data).filter((e=>e.storeStatus===U||e.storeStatus===N)).map((e=>({...ce(e,t,i),id:e.id}))).filter((e=>me(e,i)));if(s.length<1)return n("clearSyncableObservers"),void n("syncAllFinish");let o;n("syncAllAddEntries",s);try{const{data:t}=await l().put(e,{version:"2.0",data:s});o=ue(t)}catch(d){o=ue(d)}"success"===o.status?(n("syncAllFinish",o.data),await r("syncAll")):"partialSuccess"===o.status?(r("addSyncErrors",{requestData:s,responseData:o}),n("syncAllFinish",o.data?.filter((e=>null==o?.errors?.[e.id]))),await r("syncAll")):(r("addSyncErrors",{requestData:s,responseData:o}),n("clearSyncableObservers"),n("syncAllFinish"))},addSyncErrors({commit:e},{requestData:t,responseData:i}){"partialSuccess"===i.status?Object.keys(i.errors).forEach((t=>{const a=ue({status:"error",...i.errors[t]});a.errorUserMessage.forEach((i=>{e("addSyncError",{guid:t,key:null,errorUserMessage:i})})),"attributeValidationError"===a.errorCode?Object.keys(a.errorAttributeUserMessages).forEach((i=>{e("addSyncError",{guid:t,key:i,errorUserMessage:a.errorAttributeUserMessages[i][0]})})):"string"===typeof a.errorFieldName&&a.errorFieldName.length>0&&e("addSyncError",{guid:t,key:a.errorFieldName,errorUserMessage:b["default"].i18n.translate("Ungültiger Wert.")})})):t.forEach((t=>{e("addSyncError",{guid:t.id,key:null,errorUserMessage:i.errorUserMessage[0]})}))}}}}const ad=[{id:1,name:""},{id:2,name:"Ackerland"},{id:3,name:"Grünland"},{id:4,name:"Wein"},{id:5,name:"Wein Terassen"},{id:6,name:"Gemeinschaftsweide"},{id:7,name:"Almen"},{id:8,name:"Spezialkulturen"},{id:9,name:"Geschützter Anbau"},{id:10,name:"Sonstige Nutzflächen"},{id:11,name:"Forst"},{id:12,name:"Lager"},{id:13,name:"Gewächshaus"},{id:14,name:"Beizanlage"},{id:15,name:"Anlage zur Behandlung von Pflanzgut"}],nd=[{name:"k.A.",id:""},{name:"Variante 1 - GREENING",id:10},{name:"Variante 1 - GREENING + ÖPUL",id:15},{name:"Variante 1 - ÖPUL",id:1},{name:"Variante 2 - GREENING",id:11},{name:"Variante 2 - GREENING + ÖPUL",id:16},{name:"Variante 2 - ÖPUL",id:2},{name:"Variante 3 - GREENING",id:12},{name:"Variante 3 - GREENING + ÖPUL",id:17},{name:"Variante 3 - ÖPUL",id:3},{name:"Variante 4 - GREENING",id:13},{name:"Variante 4 - GREENING + ÖPUL",id:18},{name:"Variante 4 - ÖPUL",id:4},{name:"Variante 4 mit MZ - GREENING + ÖPUL",id:20},{name:"Variante 4 mit MZ - ÖPUL",id:7},{name:"Variante 5 - GREENING",id:14},{name:"Variante 5 - GREENING + ÖPUL",id:19},{name:"Variante 5 - ÖPUL",id:5},{name:"Variante 5 mit MZ - GREENING + ÖPUL",id:21},{name:"Variante 5 mit MZ - ÖPUL",id:8},{name:"Variante 6 - ÖPUL",id:6},{name:"Variante 6 mit MZ - ÖPUL",id:9},{name:"Variante 1",id:30},{name:"Variante 2",id:31},{name:"Variante 3",id:32},{name:"Variante 4",id:33},{name:"Variante 5",id:34},{name:"Variante 6",id:35},{name:"Variante 7",id:36}],rd=[{name:"AG",id:"AG"},{name:"APL",id:"APL"},{name:"APN",id:"APN"},{name:"BG",id:"BG"},{name:"BHG",id:"BHG"},{name:"BIO",id:"BIO"},{name:"BM0",id:"BM0"},{name:"BM1",id:"BM1"},{name:"BM2",id:"BM2"},{name:"BM3",id:"BM3"},{name:"DIV",id:"DIV"},{name:"ENP",id:"ENP"},{name:"EWA",id:"EWA"},{name:"FFV",id:"FFV"},{name:"FW",id:"FW"},{name:"GI",id:"GI"},{name:"k.A.",id:""},{name:"K20",id:"K20"},{name:"KNM",id:"KNM"},{name:"LRS",id:"LRS"},{name:"M",id:"M"},{name:"N2",id:"N2"},{name:"NUE",id:"NUE"},{name:"OG",id:"OG"},{name:"OP",id:"OP"},{name:"OPAG",id:"OPAG"},{name:"OPALP",id:"OPALP"},{name:"OPBIO",id:"OPBIO"},{name:"OPBM",id:"OPBM"},{name:"OPEEB",id:"OPEEB"},{name:"OPENP",id:"OPENP"},{name:"OPEOWH",id:"OPEOWH"},{name:"OPGWA",id:"OPGWA"},{name:"OPGWG",id:"OPGWG"},{name:"OPIMG",id:"OPIMG"},{name:"OPK20",id:"OPK20"},{name:"OPM",id:"OPM"},{name:"OPMULCH",id:"OPMULCH"},{name:"OPN2",id:"OPN2"},{name:"OPNUE",id:"OPNUE"},{name:"OPOG",id:"OPOG"},{name:"OPSLK",id:"OPSLK"},{name:"OPUBB",id:"OPUBB"},{name:"OPVFUWA",id:"OPVFUWA"},{name:"OPVHEWH",id:"OPVHEWH"},{name:"OPVINWH",id:"OPVINWH"},{name:"OPVSILA",id:"OPVSILA"},{name:"OPWF",id:"OPWF"},{name:"OPWRRL",id:"OPWRRL"},{name:"OPZOG",id:"OPZOG"},{name:"OPZWF",id:"OPZWF"},{name:"OVF",id:"OVF"},{name:"OVFPV",id:"OVFPV"},{name:"SG",id:"SG"},{name:"SLK",id:"SLK"},{name:"SONSTIGE",id:"SONSTIGE"},{name:"VF",id:"VF"},{name:"WF",id:"WF"},{name:"WPF",id:"WPF"},{name:"ZOG",id:"ZOG"}],sd=[{name:"WRRL GW GRAD",id:"gwGrad"},{name:"ÖPUL GWA",id:"gwOepul"},{name:"keines",id:"gwNone"},{name:"N-RISIKO",id:"nRisiko"},{name:"N-RISIKO + ÖPUL GWA",id:"nRisikoGw"}],od="fieldGroup.mfa",ld="fieldGroup.customerId",dd={processOrderId:null,name:null,fieldSize:null,[od]:null,[ld]:null,fieldNumber:null,comment:null,finished:!1,amaCode:null,catchcropVariant:null,created:Math.round((new Date).getTime()/1e3),cropId:null,varietyId:null,preCropId:null,kindofuse:null,additionalData:{cadastralCommunity:null,plots:null,owner:null,rightOfUse:null,overrideFertilizerClass:null},gwArea:"gwNone",lat:null,lon:null,status:null,inWaterProtectionZone:null},cd={name:{type:"text",required:!0,nullable:!1},fieldSize:{type:"number",nullable:!0},amaCode:{type:"enum",values:rd.map((e=>e.id)),nullable:!0},catchcropVariant:{type:"enum",values:nd.map((e=>e.id)),nullable:!0},kindofuse:{type:"enum",values:ad.map((e=>e.id)),default:1},gwArea:{type:"enum",values:sd.map((e=>e.id)),nullable:!0}},ud=["fieldGroup","fieldContour","processOrder"],pd=["crop","preCrop","variety"];async function hd(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"];
1if(0===i?.length){const e={version:"2.0",status:"success",data:[],page:0,itemsPerPage:0,total:0};return e}const{data:a}=await Vo(i,t,{resolve:ud,resolveInSeparateList:pd,itemsPerPage:5e3});return a}async function md(e,t,i){const{data:a}=await Uo(e,i,{resolve:ud,itemsPerPage:5e3});return a}const fd=Fe(hd,md),gd="/admin/rest/field",yd=id(gd,{model:dd,modelDefinition:cd}),vd=ed(gd);function bd(e){return!Array.isArray(e)||e.length<1?[]:e.map((({processOrders:e})=>e.map((e=>String(e.name))))).reduce(((e,t)=>e.filter((e=>t.includes(e))))).sort(new Intl.Collator(void 0,{numeric:!0}).compare)}function wd(e,t){if(0===e.length)return String(t);const i=bd(e);return 0===i.length?null:i.includes(t)?String(t):null!=t&&Number(t)<Number(i[0])?String(i[0]):String(i[i.length-1])}const Cd={initialFetching:e=>e.fetchingInitialAccessToken||e.fetchingUserInfo,processOrderByCompanyIdAndNameAndType:e=>(t,i,a="inwork")=>{let n=null;return null!=e.companiesById[t]&&Array.isArray(e.companiesById[t].processOrders)?(e.companiesById[t].processOrders.some((e=>Number(e.name)===Number(i)&&e.type===a&&(n=e,!0))),n):n},processOrderByCompanyIdAndNameAndTypeAsync:(e,t)=>async(e,i,a="inwork")=>{const n=t.processOrderByCompanyIdAndNameAndType(e,i,a);if(null!=n)return n;const r=[`companyId=${e}`,`name=${i}`,`type=${a}`];try{const e=await l().get(`/admin/rest/processOrder/by_company_name_type?${r.join("&")}`);if(null!=e.data&&"success"===e.data.status)return e.data.data}catch{return n}return n},findCompanyByProcessOrderId:e=>t=>e.currentCompanies.find((e=>e.processOrders.some((e=>e.id===t)))),getCompanyByProcessOrderId:(e,t)=>e=>{const i=t.findCompanyByProcessOrderId(e);if(!i)throw new Error(`Company not found for process order id ${e}`);return i},findCompanyById:e=>t=>e.companiesById[t],getCompanyById:(e,t)=>e=>{const i=t.findCompanyById(e);if(!i)throw new Error(`Company with id ${e} not found`);return i},accessToken:e=>()=>e.jwtAuth?.getAccessToken(),currentProcessOrders(e){return null==e.currentProcessOrderName?[]:e.currentCompanies.map((t=>t.processOrders.filter((t=>String(t.name)===String(e.currentProcessOrderName))))).reduce(((e,t)=>[...e,...t]),[])},currentProcessOrderIds(e,t){return t.currentProcessOrders.map((e=>e.id))},currentCompanyIds(e){return e.currentCompanies.map((e=>e.id))},currentCompaniesRegionIds:e=>{const t=new Set;return e.currentCompanies.forEach((e=>t.add(e.regionId))),[...t].filter((e=>null!=e))},currentCompaniesRegionCodes:e=>{const t=new Set;return e.currentCompanies.forEach((e=>t.add(e.region.code))),[...t].filter((e=>null!=e))},processOrdersById(e){return Object.values(e.companiesById).reduce(((e,t)=>({...e,...t.processOrders.reduce(((e,t)=>({...e,[t.id]:t})),{})})),{})},availableProcessOrderNames(e){return bd(e.currentCompanies)},currentCompaniesHaveFieldsInCropYear:(e,t)=>async i=>{const a=e.currentCompanies.map((e=>t.processOrderByCompanyIdAndNameAndType(e.id,i).id)),n=["processOrderId","IN",a],r=`${gd}/?itemsPerPage=1&filter=${Ro(n)}`;try{const{data:e}=await l().get(r);return e.data.length>0}catch(s){console.error(s)}return!1},currentCompaniesIsMulticompany(e){return Ga(e.currentCompanies)},userName(e){const t=[];return null!=e.user.firstname&&t.push(e.user.firstname),null!=e.user.lastname&&t.push(e.user.lastname),t.join(" ")},userCompaniesWithFeatureEnabled:e=>t=>e.userCompanies.filter((e=>e.company.features[t]))};var Fd=Cd;function Ad(){return{jwtAuth:null,loggedIn:!1,fetchingInitialAccessToken:!1,fetchingLogin:!1,fetchingUserInfo:!1,fetchingRegister:!1,fetchingCompanies:!1,observers:[],...kd()}}function kd(){return{userInfoLoaded:!1,userCompanies:[],companiesById:{},currentCompanies:[],currentProcessOrderName:null,user:{anonymousAccount:0,businessCustomer:0,companyId:"",confirmToken:null,created:0,deleted:null,email:"",emailIsConfirmed:!1,firstname:"",id:"",isPartner:0,languageId:"",lastname:"",newsletter:0,superAdmin:0,tstamp:0,vatInformation:null}}}const Sd={setJwtAuth(e,t){e.jwtAuth=t},startFetching(e,t){e[t]=!0},endFetching(e,t){e[t]=!1},addObserver(e,t){e.observers=[...e.observers,t]},clearObservers(e){e.observers=[]},setLoggedIn(e,{userId:t}){e.loggedIn=!0,e.user.id=t},setLoggedOut(e){e.loggedIn=!1,Object.assign(e,kd())},setUserCompanies(e,t){e.userCompanies=t,e.companiesById=t.reduce(((e,t)=>({...e,[t.company.id]:t.company})),{}),e.userInfoLoaded=!0},setUser(e,t){e.user=t},updateUser(e,t){Object.keys(t).forEach((i=>{"id"!==i&&"guid"!==i&&(e.user[i]=t[i])})),e.user.displayName=`${e.user.firstname} ${e.user.lastname}`},setCurrentCompaniesAndProcessOrderName(e,{companies:t,processOrderName:i}){e.currentCompanies=t,e.currentProcessOrderName=wd(t,i)},setCurrentProcessOrderName(e,t){e.currentProcessOrderName=wd(e.currentCompanies,t)},updateCurrentCompany(e,{id:t,data:i}
1){Object.keys(i).forEach((a=>{"id"!==a&&"guid"!==a&&(e.companiesById[t][a]=i[a])})),e.currentCompanies=e.currentCompanies.map((i=>i.id!==t?i:e.companiesById[t]))}};var Ed=Sd;const Id={namespaced:!0,state:Ad(),mutations:Ed,actions:Yl,getters:Fd};var _d=Id;const Dd=["address"];async function Md(e,t){const i=e.rootGetters["auth/currentCompanyIds"],{data:a}=await Zo(i,t,{resolve:Dd,itemsPerPage:5e3});return a}async function Pd(e,t,i){throw new Error("NOT IMPLEMENTED")}const Td=Fe(Md,Pd);function xd(){return{...be()}}const Bd={namespaced:!0,state:xd(),mutations:{...Td.mutations},actions:{...Td.actions},getters:{...Td.getters}};var Od=Bd,$d=i(36368),Rd={cs:$d.cs,de:$d.de,en:$d.en,hu:$d.hu,sk:$d.sk,sl:$d.slSI};async function Nd(e,t){const{daturaApi:i}=b["default"].prototype.$api,{data:a}=await i.daturaDroneAssessmentPatch({daturaDroneAssessmentPatchRequest:{data:[...e]}});return a}async function zd({rootGetters:e}){const{daturaApi:t}=b["default"].prototype.$api,i=e["auth/currentProcessOrderIds"][0],a=await t.daturaDroneAssessmentList({processOrderId:i});return Ld(a.data)}function Ld(e){return{...e,data:e.data}}async function Vd(){throw new Error("Unsupported operation!")}const Ud=Fe(zd,Vd),jd=Zs(Nd),Hd={...Ud.actions,...jd.actions};var Gd=Hd;const Wd={...Ud.getters,...jd.getters,list(e){return Object.values(e.data)},tableDataAssessments(e,t,i,a){return t.list.map((e=>{let t;if(e.fieldId){const a=i.fields.data[e.fieldId];a&&(t=i.customers.data[a.fieldGroup?.customerId??""])}return{...e,customerName:t?.name||"",customerEmail:t?.email||"",customerNumber:t?.customerNumber||"",farmNumber:t?.bdmId||"",occurrencesPerHa:e.additionalData.occurrencesPerHa,occurrencesTotal:e.additionalData.occurrencesTotal,assessmentName:e.additionalData.assessmentName,riskCategory:b["default"].i18n.translate(e.additionalData.riskCategory),select:!1,link:Zd(e),fieldDropdownItem:a["fields/dropdownItem"](e.fieldId)}}))}};function Zd(e){return e.files?.length?`${origin}${M}datura/drone/viewer/${e.files[0].id}`:""}var Kd=Wd;const qd={...Ud.mutations,...jd.mutations,setHot(e,t){b["default"].set(e,"hot",t)},setUserColumnSettings(e,t){b["default"].set(e,"userColumnSettings",t)}};var Yd=qd;function Jd(){return{...be(),...tr(),tableDataMetadata:{},hot:null,userColumnSettings:{}}}const Xd={namespaced:!0,state:Jd(),mutations:Yd,actions:Gd,getters:Kd};var Qd=Xd;async function ec({rootGetters:e}){const{daturaApi:t}=b["default"].prototype.$api,i=e["auth/currentProcessOrderIds"][0],a=await t.daturaImportJobList({processOrderId:i});return tc(a.data)}function tc(e){return{...e,data:e.data}}async function ic(){throw new Error("Unsupported operation!")}const ac=Fe(ec,ic),nc={...ac.actions};var rc=nc;const sc={...ac.getters,list(e){return Object.values(e.data).map((e=>({...e,importJobName:e.name,stateDisplayValue:b["default"].i18n.translate(e.state)}))).map((e=>{const{name:t,...i}=e;return i}))},tableDataHistory(e,t){return t.list.map((e=>({...e,select:!1})))}};var oc=sc;const lc={...ac.mutations,setHot(e,t){b["default"].set(e,"hot",t)},setUserColumnSettings(e,t){b["default"].set(e,"userColumnSettings",t)}};var dc=lc;function cc(){return{...be(),tableDataMetadata:{},hot:null,userColumnSettings:{}}}const uc={namespaced:!0,state:cc(),mutations:dc,actions:rc,getters:oc};var pc=uc;const hc={async import(e,t){const{daturaApi:i}=b["default"].prototype.$api;return i.daturaImportJobStart({daturaImportJobStartRequest:{data:t}}).then((e=>e.data.data))}};var mc=hc;const fc={};var gc=fc;const yc={setHot(e,t){b["default"].set(e,"hot",t)},setUserColumnSettings(e,t){b["default"].set(e,"userColumnSettings",t)}};var vc=yc;function bc(){return{tableDataMetadata:{},hot:null,userColumnSettings:{}}}const wc={namespaced:!0,state:bc(),mutations:vc,actions:mc,getters:gc,modules:{history:pc,assessments:Qd}};var Cc=wc;function Fc(){return{data:{},errors:[],fetching:!1,loaded:null,observers:[],axiosSources:[]}}const Ac=e=>null!=e?btoa(JSON.stringify(e)):"";function kc(e,{filter:t=[],resolve:i=[],resolveInSeparateList:a=[],additionalQueryParams:n=[]}={}){return{namespaced:!0,state:Fc(),mutations:{startFetching(e,t){b["default"].set(e,"fetching",!0),b["default"].set(e,"axiosSources",[...e.axiosSources,t])},addObserver(e,t){b["default"].set(e,"observers",[...e.observers,t])},clearObservers(e){b["default"].set(e,"observers",[])},addOne(e,t){b["default"].set(e.data,t.id,t)},loadAll(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>{const a=e.data[i.id]?.storeStatus;return a&&[U,j].includes(a)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,storeStatus:V}}}),{})),b["default"].set(e,"loaded",new Date)},updateEntries(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>{const a=e.data[i.id]?.storeStatus;return a&&[U,j].includes(a)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,storeStatus:V}}}),e.data))},finishFetching(e,t){b["default"].set(e,"fetching",!1),b["default"].set(e,"axiosSources",e.axiosSources.filter((e=>e!==t)))},fetchingError(e,t){b["default"].set(e,"fetching",!1),b["default"].set(e,"axiosSources",e.axiosSources.filter((e=>e!==t))),b["default"].set(e,"errors",[...e.errors,{type:q}])},resetLoaded(e){b["default"].set(e,"loaded",null)},reset(e){const t=Fc();Object.entries(t).forEach((([t,i])=>{"observers"!==t&&b["default"].set(e,t,i)}))}},actions:{async subscribe({commit:e,dispatch:t,state:i},{forceReset:a,forceRefresh:n}={forceReset:!1,forceRefresh:!1}){if(null!=i.loaded&&!a)return void(n&&await t("refresh"));const r=new Promise((t=>e("addObserver",t)));i.fetching||t("loadAll",{forceReset:a}),await r},async refresh({commit:e,dispatch:t,state:i}){if(null==i.loaded)return t("subscribe");const a=new Promise((t=>e("addObserver",t)));return i.fetching||t("loadAll"),a},async refreshByIds(t,a){const r=["id","IN",a];let s=i;"function"===typeof i&&(s=i(t));let o,d=[`${e}?version=2.0`,"itemsPerPage=11000",`filter=${Ac(r)}`,`resolve=${Ac(s)}`];Array.isArray(n)&&(d=[...d,...n]);try{const{data:e}=await l().get(d.join("&"));o=ue(e)}catch(c){o=ue(c)}return"success"===o.status&&t.commit("updateEntries",o),o},async loadAll(r,{forceReset:s=!1}={}){const{commit:o,dispatch:d,state:c}=r;s&&await d("reset");const u=l().CancelToken.source();o("startFetching",u);let p=t;if("function"===typeof t&&(p=await t(r)),!1===p)return c.observers.forEac
1h((e=>e())),o("finishFetching",u),void o("clearObservers");let h,m=i;"function"===typeof i&&(m=i(r)),h="function"===typeof n?await n(r):n;const f=[`${e}?version=2.0`,"itemsPerPage=11000",`filter=${Ac(p)}`,`resolve=${Ac(m)}`,...h];"function"===typeof a?f.push(`resolveInSeparateList=${Ac(a(r))}`):Array.isArray(a)&&a.length>0&&f.push(`resolveInSeparateList=${Ac(a)}`);try{const{data:e}=await l().get(f.join("&"),{cancelToken:u.token});"success"!==e.status?o("fetchingError",u):(null!=e.resolved&&await d("loadResolved",e),o("loadAll",{data:e.data}),o("finishFetching",u))}catch(g){console.error(g),l().isCancel(g)||o("fetchingError",u)}finally{c.observers.forEach((e=>e())),o("clearObservers")}},loadResolved(){},reset({commit:e,state:t}){t.axiosSources.forEach((e=>e.cancel())),e("reset")}},getters:{data:e=>e.data,dataWithoutRemoved:e=>Object.values(e.data).reduce(((e,t)=>t.storeStatus===Z||t.storeStatus===W||t.storeStatus===G?e:{...e,[t.id]:t}),{}),errors:e=>e.errors,fetching:e=>e.fetching,loaded:e=>e.loaded,loading:e=>null==e.loaded&&(!!e.fetching||0===e.errors.length)}}}const Sc=e=>null!=e?btoa(JSON.stringify(e)):"",Ec=kc("/admin/rest/contract"),Ic={id:null,status:null},_c=kc("/admin/rest/contractCompany"),Dc=id("/admin/rest/contractCompany",{model:Ic}),Mc=["contour"],Pc=kc("/admin/rest/contractField",{resolve:Mc}),Tc=ed("/admin/rest/contractField"),xc={id:null,contractCompanyId:null,fieldGroupMfa:null,fieldNumber:null,fieldName:null,fieldSize:0,fieldCropName:null,fieldPreCropName:null,fieldVarietyName:null,tstamp:null,deleted:null},Bc=id("/admin/rest/contractField",{model:xc}),Oc={id:null,contractId:null,fileName:null,contractCompanyId:null,created:null,tstamp:null,deleted:null},$c=kc("/admin/rest/contractFile"),Rc=id("/admin/rest/contractFile",{model:Oc}),Nc=ed("/admin/rest/contractFile"),zc={...Ec,mutations:{...Ec.mutations},actions:{...Ec.actions,reset(e){Ec.actions.reset(e),e.commit("reset")}}},Lc={..._c,state:{...be(),...tr()},mutations:{..._c.mutations,...Dc.mutations},actions:{..._c.actions,...Dc.actions,reset(e){_c.actions.reset(e),e.commit("reset")},async updateAndSyncEntry(e,{status:t,companyId:i}){const{state:a,commit:n,dispatch:r}=e,s=a.data[i];s.status=t,n("updateEntry",{entry:s}),await r("syncAll")}}},Vc={...Pc,mutations:{...Pc.mutations,...Bc.mutations,...Tc.mutations,setFieldNdvis(e,{data:t}){b["default"].set(e,"data",Object.keys(e.data).reduce(((i,a)=>t[a]?{...i,[a]:{...e.data[a],ndvi:t[a].vegetation.value}}:{...i,[a]:e.data[a]}),e.data))}},actions:{...Pc.actions,...Bc.actions,...Tc.actions,reset(e){Pc.actions.reset(e),e.commit("reset")},async loadByContractId({commit:e,dispatch:t,state:i},{contractId:a}){t("reset");const n=l().CancelToken.source();e("startFetching",n);const r=["AND",["contractCompany.contractId","=",a],["contractCompany.status","!=","canceled"]];try{const{data:t}=await l().get(`/admin/rest/contractField?filter==${Sc(r)}&resolve=${Sc(Mc)}&itemsPerPage=5000`,{cancelToken:n.token});Array.isArray(t.data)?(e("loadAll",{data:t.data}),e("finishFetching",n)):e("fetchingError",n)}catch(s){console.error(s),e("fetchingError",n)}finally{i.observers.forEach((e=>e())),e("clearObservers")}},async loadNdvi({state:e,commit:t}){const i=Math.floor(Date.now()/1e3),a=Object.keys(e.data).map((t=>{const a=e.data[t];return{clientId:a.id,polygon:a.contour?.coordinates[0],timestamp:i}})),n=a.filter((e=>e.polygon)),r=l().CancelToken.source();try{const{data:e}=await l().post("/admin/sen4/multiPolyMean",{indexType:"DNN_NDVI",products:n},{cancelToken:r.token});await t("setFieldNdvis",{data:e.products})}catch(s){console.error(s),t("fetchingError",r)}}}},Uc=(e,t)=>Object.values(e.companies.data).filter((e=>e.contractId===t)),jc=(e,t)=>{const i=Object.values(e.fields.data).filter((e=>e.contractCompanyId===t));return i},Hc=(e,t)=>{const i=Uc(e,t).map((e=>e.id)),a=Object.values(e.fields.data).filter((e=>i.includes(e.contractCompanyId)));return a},Gc=e=>e.reduce(((e,t)=>e+t.fieldSize),0),Wc=e=>{const t=e.map((e=>e.fieldCropName));return[...new Set(t.filter((e=>e)))]},Zc=e=>{const t=e.map((e=>e.fieldVarietyName));return[...new Set(t.filter((e=>e)))]},Kc={...$c,state:{...be(),...tr(),...Ql()},mutations:{...$c.mutations,...Rc.mutations,...Nc.mutations},actions:{...$c.actions,...Rc.actions,...Nc.actions,reset(e){_c.actions.reset(e),e.commit("reset")},async updateAndSyncEntry(e,{entry:t}){const{state:i,commit:a,dispatch:n}=e,r=t.companyId,s=i.data[t.id];s.contractCompanyId=r,await a("updateEntry",{entry:s}),await n("syncAll")}}},qc=(e,t)=>Object.values(e.files.data).filter((e=>e.contractId===t));var Yc={namespaced:!0,state:{},modules:{contracts:zc,companies:Lc,fields:Vc,files:Kc},actions:{reset({dispatch:e}){e("contracts/reset"),e("companies/reset"),e("fields/reset")}},getters:{contracts:e=>e.contracts.data,companies:e=>e.companies.data,companiesByContractId:e=>t=>Uc(e,t),contractCompanyData:e=>t=>{const i=Uc(e,t),a=i.map((t=>{const i=jc(e,t.id);return{guid:t.id,id:t.id,partnerNumber:t.foreignId,farmNumber:t.companyBdmId,farmName:t.companyName,lastUpdate:t.tstamp,status:t.status,contactEmail:t.email,fieldCount:i.length,fieldSize:Gc(i),crops:Wc(i),varieties:Zc(i)}}));return a},contractFieldData:e=>t=>{const i=Uc(e,t),a=Hc(e,t),n=a.map((e=>{const t=i.find((t=>t.id===e.contractCompanyId));return{guid:e.id,id:e.id,companyId:t.id,partnerNumber:t.foreignId,farmNumber:t.companyBdmId,farmName:t.companyName,fieldGroupNumber:e.fieldGroupMfa,fieldNumber:e.fieldNumber,fieldName:e.fieldName,fieldSize:e.fieldSize,crops:[e.fieldCropName],varieties:[e.fieldVarietyName],status:t.status,lastUpdate:e.tstamp,ndvi:e.ndvi}}));return n},contractFileData:e=>t=>{const i=Uc(e,t),a=qc(e,t),n=a.map((e=>{const t=i.find((t=>t.id===e.contractCompanyId)),a=`${P}/contractFile/${e.id}`;return{guid:e.id,id:e.id,companyId:t?.id,partnerNumber:t?.foreignId,farmNumber:t?.companyBdmId,farmName:t?.companyName,fileName:e.fileName,fileLink:a,contactEmail:t?.email,uploadDate:e.created}}));return n}}};const Jc=kc("/admin/digitalContracting/getContracts");function Xc(){return{contracting:null,creating:null}}var Qc={...Jc,namespaced:!0,state:{...Jc.state,...Xc()},mutations:{...Jc.mutations,reset(e){Jc.mutations.reset(e),Object.keys(Xc()).forEac
1h((t=>{b["default"].set(e,t,Xc()[t])}))},setContracting(e,t){b["default"].set(e,"contracting",t),b["default"].set(e,"errors",null)},setCreating(e,t){b["default"].set(e,"creating",t),b["default"].set(e,"errors",null)},accept(e,{contract:t,contractCompanyId:i}){const a={...e.data};a[t.id]={...t,contractCompanyId:i},b["default"].set(e,"data",a),b["default"].set(e,"errors",null),b["default"].set(e,"contracting",null)},errors(e,{errors:t}){const i=null==e.errors?[...t]:[...t,...e.errors];b["default"].set(e,"errors",i)}},actions:{...Jc.actions,reset(e){Jc.actions.reset(e),e.commit("reset")},async loadAll({commit:e,dispatch:t,state:i}){t("reset");const a=l().CancelToken.source();e("startFetching",a);try{const{data:t}=await l().get("/admin/digitalContracting/getContracts",{cancelToken:a.token});Array.isArray(t)?(e("loadAll",{data:t}),e("finishFetching",a)):e("fetchingError",a)}catch(n){console.error(n),e("fetchingError",a)}finally{i.observers.forEach((e=>e())),e("clearObservers")}},async accept({commit:e,state:t},{fieldIds:i,companyData:a,newsletter:n,contractAdditionalData:r=null}){if(null==t.contracting)return;const s=t.contracting;e("setCreating",s);try{const{data:t}=await l().post(`/admin/digitalContracting/contractCompany/${s.id}`,{fieldIds:i,...a,...a.user,companyBdmId:a.companyBdmId,postcode:a.postcode,contract_additional_data:[],newsletter:n,contractAdditionalData:r});e("setCreating",null),e("accept",{contract:s,contractCompanyId:t.contractCompanyId})}catch(o){e("setCreating",null),e("errors",{errors:[o.response.data]})}}},getters:{...Jc.getters,unsignedExpired(e,t,i){let a=[];return null!=i.auth.currentCompanies[0]&&Array.isArray(i.auth.currentCompanies[0].processOrders)&&(a=String(i.auth.currentCompanies[0].processOrders.map((e=>e.name)))),Object.values(e.data).filter((e=>null==e.contractCompanyId&&1e3*e.periodEnd<new Date&&a.includes(String(e.processOrderName)))).filter((e=>"AGRANA"===e.partner))},getByGuid:e=>t=>Object.values(e.data).find((e=>e.guid===t)),getByContractCompanyId:e=>t=>Object.values(e.data).find((e=>e.contractCompanyId===t))}};async function eu(e,t){const i=e.rootState.auth.currentCompanies.map((e=>e.id)),{equipmentsApi:a}=b["default"].prototype.$api,n=await Promise.all(i.map((e=>{const i={companyId:e};return sr(a,"equipmentList",i,t)}))),r=A(n);return r}async function tu(e,t,i){const{equipmentsApi:a}=b["default"].prototype.$api,{data:n}=await a.equipmentObjects({objectIds:e.join(",")},i);return n}const iu=Fe(eu,tu,[Hr.FEATURE_EQUIPMENT]);var au=iu;const nu={...au.getters,...tl.getters};var ru=nu;function su(){return{...be(),...Qo()}}const ou={namespaced:!0,state:su(),mutations:{...au.mutations,...tl.mutations},actions:{...au.actions},getters:{...ru}};var lu=ou;function du(){return be()}const cu={namespaced:!0,state:du(),mutations:{recentlyRestoredSetByGuids(e,t){t.forEach((t=>{b["default"].set(e.data,t,{...e.data[t],storeStatus:K})}))},recentlyRestoredUnsetByGuids(e,t){t.forEach((t=>{e.data[t].storeStatus===K&&b["default"].set(e.data,t,{...e.data[t],storeStatus:V})}))}},actions:{async recentlyRestoredSetByGuids({commit:e},t){e("recentlyRestoredSetByGuids",t),await new Promise((e=>{setTimeout(e,1e3)})),e("recentlyRestoredUnsetByGuids",t)}}};var uu=cu;const pu="/admin/rest/fieldGroup",hu=({state:e,rootState:t})=>{if(0===t.auth.currentCompanies.length)return!1;const i=["AND",["companyId","IN",t.auth.currentCompanies.map((e=>e.id))]];return e.addArchived||i.push(["archived","=",0]),i};function mu(){return{...be(),...tr(),...Ql(),...du(),addArchived:!1}}const fu="companyId",gu="mfa",yu="customerId",vu="name",bu="fieldSize",wu="archived",Cu="userComment",Fu={[fu]:null,[gu]:null,[yu]:null,[vu]:null,[bu]:null,[wu]:0,[Cu]:null},Au={[bu]:{type:"number",nullable:!0}},ku=kc(pu,{filter:hu}),Su=id(pu,{model:Fu,modelDefinition:Au}),Eu=ed(pu),Iu=(e,{rootState:t})=>null!=e[fu]||1!==t.auth.currentCompanies.length?e:{...Fu,...e,[fu]:t.auth.currentCompanies[0].id};var _u={namespaced:!0,state:mu(),mutations:{...ku.mutations,...Su.mutations,...Eu.mutations,...uu.mutations,setAddArchived(e,t){b["default"].set(e,"addArchived",t)}},actions:{...ku.actions,...Su.actions,...Eu.actions,...uu.actions,async 
1insertNewEntry(e,{entry:t}){const{commit:i}=e,a=Iu(t,e);i("insert",{entry:a})},async insertAndSyncNewEntry(e,{entry:t}){const{dispatch:i}=e,a=Iu(t,e);await i("insertNewEntry",{entry:a}),await i("syncAll")},async updateAndSyncEntry(e,{entry:t}){const{commit:i,dispatch:a}=e,n=Iu(t,e);i("updateEntry",{entry:n}),await a("syncAll")},addArchived({state:e,commit:t,dispatch:i}){e.addArchived||(i("reset"),t("setAddArchived",!0))}},getters:{...ku.getters}};const Du=0,Mu=10;function Pu(e){return Number.isNaN(e)?Du:Math.min(Mu,Math.max(Du,Math.round(e)))}function Tu(e,t){return Bl()(e).format({thousandSeparated:!0,mantissa:Pu(t)})}function xu(e,t=!1){const i=Number.parseInt(`${e}`,10),a=new Date(1e3*i),n=!Number.isNaN(a.getTime());return n?g()(a).format(t?"L HH:mm":"L"):""}var Bu=i(91530);function Ou(e){if(null===e||!Bu.Z.helper.isNumeric(e))return null;const t=Number(e);if(Number.isNaN(t)||0===t)return"";const i=new Date(1e3*t),a=24*(i.getUTCDate()-1),n=i.getUTCHours()+a,r=i.getUTCSeconds(),s=i.getUTCMinutes()+(r>30?1:0),o=`${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;return o}const $u="HOT_DISPLAY_BUTTON_RENDERER";function Ru(e,t){if(null!=e[t])return e[t];const i=t.split(".");return 1===i.length?e[i[0]]:null!=e[i[0]]?Ru(e[i.shift()],i.join(".")):void 0}function Nu(e,t,i){if(null==e)return;const a=t.split(".");1===a.length?b["default"].set(e,a[0],i):Nu(e[a.shift()],a.join("."),i)}function zu(e,t){if(null==e||null==t)return"";const i=Lu(t)??"",a="string"===typeof e||"number"===typeof e||"boolean"===typeof e||la(e);let n=a?e:Ru(e,i);if("function"===typeof t.data&&t.data(e)&&(n=t.data(e)),"farmdok.subtablePrimaryColumn"===t.type)return Array.isArray(e)?t.collapsedSubtable.getRendererValue({values:e}):n===$u?n:n?.name??"";if(null==n)return"";if("numeric"===t.type||"farmdok.numeric.optional"===t.type)return"number"!==typeof n?"":"number"===typeof t.decimalPlaces?Tu(n,t.decimalPlaces):Bl()(n).format();if("currency"===t.type)return"";if("date"===t.type||"farmdok.date.optional"===t.type||"datetime"===t.type){const e="datetime"===t.type;return xu(n,e)}if("duration"===t.type||"farmdok.duration"===t.type||"farmdok.duration.optional"===t.type)return Ou(n);if("dropdown"===t.type){const i=e[R];return t.getRendererValue({value:n,guid:i})}if("farmdok.dropdown"===t.type||"farmdok.dropdown.optional"===t.type)return n.name;if("farmdok.dropdownOrButton"===t.type)return t.dropdown.getRendererValue({value:n})??"";if("farmdok.amountUnit"===t.type){const{amount:e,unitId:i}=n;let a="";e&&(a="number"===typeof t.decimalPlaces?Tu(e,t.decimalPlaces):Bl()(e).format());const r=t.getUnitName(i);return`${a} ${r??""}`}if("time"===t.type)return"";if("table"===t.type)return"";if(["text","fieldName","farmName","farmdok.text.optional"].includes(t.type))return"string"!==typeof n?"":n;if("fieldStatus"===t.type){if("string"!==typeof n)return"";const e={completed:b["default"].i18n.translate("Abgeschlossen"),active:b["default"].i18n.translate("Aktiv"),planned:b["default"].i18n.translate("Geplant"),calculating:b["default"].i18n.translate("Berechnen ...")};return e[n]}if("fieldGroupArchived"===t.type)return n?b["default"].i18n.translate("Archiviert"):b["default"].i18n.translate("Aktiv");if("sharedFieldInfo"===t.type&&Array.isArray(n))return n.map((e=>e.name));if("subtable"===t.type)return n;if("partnerStatus"===t.type){if("string"!==typeof n)return"";const e={received:b["default"].i18n.translate("Erhalten"),contracted:b["default"].i18n.translate("Kontraktiert"),canceled:b["default"].i18n.translate("Storniert")};return e[n]}return""}function Lu(e){if(e.key)return e.key;if(void 0!==e.data&&null!==e.data){if("string"===typeof e.data)return e.data;throw new Error("Column data property is not a string")}throw new Error(`Column has no key or data property: ${JSON.stringify(e)}`)}const Vu=e=>null!=e?btoa(JSON.stringify(e)):"",Uu="/admin/rest/field",ju=({rootState:e})=>!!e.auth.currentProcessOrderName&&["processOrder.name","=",e.auth.currentProcessOrderName],Hu=["fieldGroup","fieldContour","processOrder"],Gu=["crop","preCrop","variety"],Wu=({rootState:e})=>{const t=["permissionMode=fieldSharing"],i=["fieldShare"];return t.push(`additional=${Vu(i)}`),e.auth.currentCompanies&&e.auth.currentCompanies[0]?(t.push(`fieldSharingCompanyId=${e.auth.currentCompanies[0].id}`),t):t},Zu=kc(Uu,{filter:ju,resolve:Hu,resolveInSeparateList:Gu,additionalQueryParams:Wu});function Ku(){return{...be()}}var qu={namespaced:!0,state:Ku(),mutations:{...Zu.mutations,loadAll(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>null!=e.data[i.id]&&[U,j].includes(e.data[i.id].storeStatus)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,[od]:Ru(i,od),[ld]:Ru(i,ld),storeStatus:V}}),{})),b["default"].set(e,"loaded",new Date)}},actions:{...Zu.actions,loadResolved({commit:e},{resolved:t}
1){null!=t&&(Array.isArray(t.crop)&&t.crop.forEach((t=>{e("products/crops/addOne",t,{root:!0})})),Array.isArray(t.preCrop)&&t.preCrop.forEach((t=>{e("products/crops/addOne",t,{root:!0})})),Array.isArray(t.variety)&&t.variety.forEach((t=>{e("varieties/addOne",t,{root:!0})})))}},getters:{...Zu.getters}};async function Yu(e){const{data:t}=await l().post("/admin/sen4/multiPolyMean",{indexType:"DNN_NDVI",products:e});return t.products}async function Ju(e){const{data:t}=await l().post("/admin/sen4/multiPolyMean",{indexType:"MBI",products:e});return t.products}const Xu={fieldId:null,geometry:null,id:null};async function Qu(e,t){const{state:i,rootState:a,rootGetters:n}=t;let r=null;if(null!=e.processOrderId)({processOrderId:r}=e);else if(null!=i.data[e.id]&&null!=i.data[e.id].processOrderId)({processOrderId:r}=i.data[e.id]);else if(1===n["auth/currentProcessOrders"].length)r=n["auth/currentProcessOrders"][0].id;else if(null!=Ru(e,"processOrder.companyId")){let t=null;Object.values(a.auth.companiesById).some((i=>i.id===Ru(e,"processOrder.companyId")&&(t=i.id,!0)));const i=n["auth/processOrderByCompanyIdAndNameAndType"](t,a.auth.currentProcessOrderName);r=i.id}return{...e,processOrderId:r,processOrder:n["auth/processOrdersById"][r]}}function ep(e,t){const{rootState:i,rootGetters:a}=t;if(null==e.cropId)return e;const n=i.products.crops.data[e.cropId];if(null==n||null==e.processOrderId)return{...e,cropId:null};if(1===i.auth.currentCompanies.length)return e;const r=a["auth/processOrdersById"][e.processOrderId].companyId;if(null==n.companyId||n.companyId===r)return e;if(null==n.relatedMaterialId)return{...e,cropId:null};let s=null;return Object.values(i.products.crops.data).some((e=>e.relatedMaterialId===n.relatedMaterialId&&e.companyId===r&&(s=e.id,!0))),{...e,cropId:s}}function tp(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&e.id===t.id&&e.tstamp===t.tstamp}function ip(e,t){return{cadastralCommunity:e["additionalData.cadastralCommunity"]??t.additionalData?.cadastralCommunity??"",plots:e["additionalData.plots"]??t.additionalData?.plots??"",owner:e["additionalData.owner"]??t.additionalData?.owner??"",rightOfUse:e["additionalData.rightOfUse"]??t.additionalData?.rightOfUse??"",overrideFertilizerClass:e["additionalData.overrideFertilizerClass"]??t.additionalData?.overrideFertilizerClass??""}}const ap={...fd.actions,...yd.actions,...vd.actions,...uu.actions,async insertNewEntry(e,{entry:t}){const{commit:i}=e;let a=await Qu({...dd,...t},e);a=ep(a,e),i("insert",{entry:a})},async insertAndSyncNewEntry(e,{entry:t}){const{dispatch:i}=e;let a=await Qu(t,e);a=ep(a,e),await i("insertNewEntry",{entry:a}),await i("syncAll"),null!=t.fieldContour&&(a.fieldContour.id=fa(oe,t.id),await i("syncFieldContourForEntry",{entry:a}))},async updateAndSyncEntry(e,{entry:t}){const{commit:i,dispatch:a,state:n}=e;let r=await Qu(t,e);r=ep(r,e);const s=!tp(n.data[t.id].fieldContour,t.fieldContour);r.additionalData=ip(t,n.data[t.id]),i("updateEntry",{entry:r}),await a("syncAll"),s&&null!=r.fieldContour&&await a("syncFieldContourForEntry",{entry:r})},async syncFieldContourForEntry({commit:e},{entry:t}){const i=t[R],a={...t.fieldContour,fieldId:i};let n;a.geometry=a.geoJson;try{const{fieldsApi:e}=this.$api,{data:t}=await e.fieldContourPut({fieldContourPutRequest:{data:[ce(a,Xu)]}});n=ue(t)}catch(r){n=ue(r)}"success"!==n.status?e("addSyncError",{guid:i,key:null,errorUserMessage:b["default"].i18n.translate("Die Feldkontur konnte nicht aktualisiert werden.")}):e("updateEntry",{entry:{id:t.id},silent:!0})},loadResolved({commit:e},{resolved:t}){null!=t&&(Array.isArray(t.crop)&&t.crop.forEach((t=>{e("products/crops/addOne",t,{root:!0})})),Array.isArray(t.preCrop)&&t.preCrop.forEach((t=>{e("products/crops/addOne",t,{root:!0})})),Array.isArray(t.variety)&&t.variety.forEach((t=>{e("varieties/addOne",t,{root:!0})})))},async setStatus({dispatch:e,rootGetters:t},{status:i,fieldIds:a}){if(!["completed","active","planned"].includes(i))throw new Error("fields/setStatus: desired status not possible");try{const{data:n}=await l().post("admin/rest/field/set_status",{version:"2.0",data:{status:i,fieldIds:a}});return await Promise.all([e("auth/refreshUserCompanies",null,{root:!0}),e("refresh")]),n.data=Object.keys(n.data).reduce(((e,i)=>{const a=t["auth/processOrdersById"][i].name;return{...e,[a]:{...e[a],...n.data[i]}}}),{}),n}catch(n){let e=[b["default"].i18n.translate("Der Erntejahr-Status konnte nicht geändert werden.")];return null!=n.response&&null!=n.response.data&&null!=n.response.data.errorUserMessage&&({errorUserMessage:e}=n.response.data),{version:"2.0",status:"error",errorCode:"generalError",errorUserMessage:e}}},async copyAllFieldsFromProcessOrder({rootState:e,rootGetters:t},{direction:i}){if(!["previous","next"].includes(i))return console.error("Method copyAllFieldsFromProcessOrder can only copy from 'next' or 'previous' processOrder"),{status:"error"};const a=e.auth.currentProcessOrderName,n=String("next"===i?Number(a)+1:Number(a)-1),r=[];return await Promise.all(e.auth.currentCompanies.map((async e=>{const i=t["auth/processOrderByCompanyIdAndNameAndType"](e.id,n),s=t["auth/processOrderByCompanyIdAndNameAndType"](e.id,a);try{const{data:e}=await l().post("admin/rest/field/copy_fields_from_process_order",{version:"2.0",data:{fromProcessOrderId:i.id,targetProcessOrderId:s.id}});r.push(ue(e))}catch(o){r.push(ue(o))}}))),he(...r)},async loadNdvi({state:e,commit:t},i){e.loadingNdvi=!0;const a=Math.floor(Date.now()/1e3),n=i.map((e=>({clientId:e.id,polygon:e.fieldContour.geoJson?.coordinates[0],timestamp:a}))),r=n.filter((e=>e.polygon)),s=10,o=Rs()(r,s);function l(e){try{t("setFieldNdvis",{data:e})}catch(i){console.error(i),t("fetchingError")}}for(const d of o){const e=await Yu(d);l(e)}e.loadingNdvi=!1},async loadMbi({state:e,commit:t},i){e.loadingMbi=!0;const a=Math.floor(Date.now()/1e3),n=i.map((e=>({clientId:e.id,polygon:e.fieldContour.geoJson?.coordinates[0],timestamp:a}))),r=n.filter((e=>e.polygon)),s=25,o=Rs()(r,s);function l(e){try{t("setFieldMbis",{data:e})}catch(i){console.error(i),t("fetchingError")}}for(const d of o){const e=await Ju(d);l(e)}e.loadingMbi=!1}};var np=ap;function rp(e,t){if(!e)return"";const i=t[e];return i?i.shortname?`${i.shortname} - `:`${i.name} - `:""}function sp(e){return e.fieldGroup.mfa?`${e.fieldGroup.mfa} - ${e.name}`:e.name}function op(e,t){if(!e)return"";const i=t[e];return i?` (${i.name})`:""}const lp={...fd.getters,kindOfUseTypes:e=>e.kindOfUseTypes,kindOfUseTypesById:e=>e.kindOfUseTypes.reduce(((e,t)=>({...e,[t.id]:t})),{}),catchCropVariants:e=>e.catchCropVariants,catchCropVariantsById:e=>e.catchCropVariants.reduce(((e,t)=>({...e,[t.id]:t})),{}),amaCodes:e=>e.amaCodes,amaCodesById:e=>e.amaCodes.reduce(((e,t)=>({...e,[t.id]:t})),{}),gwAreas:e=>e.gwAreas,gwAreasById:e=>e.gwAreas.reduce(((e,t)=>({...e,[t.id]:t})),{}),fieldDisplayName:(e,t,i)=>t=>{const a=e.data[t];if(!a)return null;const n=rp(a.fieldGroup?.customerId,i.customers.data),r=sp(a),s=op(a.cropId,i.products.crops.data);return`${n}${r}${s}`},dropdownItem:(e,t)=>
1i=>{const a=e.data[i];return a?{id:a.id,name:t.fieldDisplayName(a.id)??""}:null},dropdownItems:(e,t)=>i=>{const a=e.data;return[{name:b["default"].i18n.translate("Felder"),id:"fields",items:Object.values(a).filter((e=>e.processOrderId===i)).map((e=>({id:e.id,name:t.fieldDisplayName(e.id)??""}))),sort:!0}]},isUniqueFieldName:e=>t=>Object.values(e.data).map((e=>e.name)).includes(t)};var dp=lp;const cp={...fd.mutations,...yd.mutations,...vd.mutations,...uu.mutations,loadAll(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>null!=e.data[i.id]&&[U,j].includes(e.data[i.id].storeStatus)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,[od]:Ru(i,od),[ld]:Ru(i,ld),storeStatus:V}}),{})),b["default"].set(e,"loaded",new Date)},updateEntries(e,{data:t}){b["default"].set(e,"data",t.reduce(((t,i)=>null!=e.data[i.id]&&[U,j].includes(e.data[i.id].storeStatus)?{...t,[i.id]:e.data[i.id]}:{...t,[i.id]:{...i,[od]:Ru(i,od),[ld]:Ru(i,ld),storeStatus:V}}),e.data))},setFieldNdvis(e,{data:t}){b["default"].set(e,"data",Object.keys(e.data).reduce(((i,a)=>
1t[a]?{...i,[a]:{...e.data[a],ndvi:t[a].vegetation.value,ndviProps:{...t[a].properties}}}:{...i,[a]:e.data[a]}),e.data))},setFieldMbis(e,{data:t}){b["default"].set(e,"data",Object.keys(e.data).reduce(((i,a)=>t[a]?{...i,[a]:{...e.data[a],mbi:t[a].vegetation.value,mbiProps:{...t[a].properties}}}:{...i,[a]:e.data[a]}),e.data))}};var up=cp;function pp(){return{...be(),...tr(),...Ql(),...du(),kindOfUseTypes:ad,catchCropVariants:nd,amaCodes:rd,gwAreas:sd,loadingNdvi:!1,loadingMbi:!1}}const hp={namespaced:!0,state:pp(),mutations:up,actions:np,getters:dp};var mp=hp;async function fp(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"],{mapApi:a}=b["default"].prototype.$api,n=await Promise.all(i.map((e=>{const i={objectType:vt.IsolationZone,processOrderId:e};return sr(a,"geoObjectList",i,t)}))),r=await Promise.all(i.map((e=>{const i={objectType:vt.MultiplierGroup,processOrderId:e};return sr(a,"geoObjectList",i,t)}))),s=A([...n,...r]);return s}async function gp(e,t,i){const{mapApi:a}=b["default"].prototype.$api,{data:n}=await a.geoObject({objectIds:e.join(",")},i);return n}async function yp(e,t,i){const{mapApi:a}=b["default"].prototype.$api,{data:n}=await a.geoObjectPut({geoObjectPutRequest:{data:e}},i);return n}async function vp(e,t,i){const{mapApi:a}=b["default"].prototype.$api,n=await Promise.all(e.map((async e=>{const{data:t}=await a.geoObjectDelete({objectIds:e.id},i);return t})));return A(n)}const bp=Fe(fp,gp),wp=Zs(yp),Cp=Us(vp),Fp={...bp.actions,...wp.actions,...Cp.actions,toggleIsCreateActive({commit:e,state:t}){e("setIsCreateActive",!t.isCreateActive)},toggleIsEditActive({commit:e,state:t}){e("setIsEditActive",!t.isEditActive)},setIsCreateActive({commit:e},t){e("setIsCreateActive",t)},setIsEditActive({commit:e},t){e("setIsEditActive",t)},setCurrentObjectType({commit:e},t){e("setCurrentObjectType",t)},setHiddenSubLayers({commit:e},t){e("setHiddenSubLayers",t)}};var Ap=Fp;const kp={...bp.getters,...wp.getters,getIsolationZoneSubTypes:e=>{const t=Object.values(e.data).filter((e=>"IsolationZone"===e.objectType&&""!==e.objectSubType)).map((t=>{const i=e.hiddenIsolationZoneSubLayers.includes(t.objectSubType);return{name:t.objectSubType,hidden:i}}));return t}};var Sp=kp;const Ep={...bp.mutations,...wp.mutations,...Cp.mutations,removeMapObject(e,t){b["default"]["delete"](e.data,t)},setIsCreateActive(e,t){e.isCreateActive=t},setIsEditActive(e,t){e.isEditActive=t},setCurrentObjectType(e,t){e.currentObjectType=t},setHiddenSubLayers(e,t){e.hiddenIsolationZoneSubLayers=t.filter((e=>e.hidden)).map((e=>e.name))}};var Ip=Ep;function _p(){return{...be(),...tr(),...er(),isCreateActive:!1,isEditActive:!1,currentObjectType:vt.IsolationZone,hiddenIsolationZoneSubLayers:[]}}const Dp={namespaced:!0,state:_p(),mutations:Ip,actions:Ap,getters:Sp};var Mp=Dp;function Pp(){return{available:!1,visible:!1,expanded:!1,expandAvailable:!1,expandButtonLabel:null}}var Tp={namespaced:!0,state:Pp(),mutations:{setAvailability(e,t){b["default"].set(e,"available",t)},toggleVisibility(e){b["default"].set(e,"visible",!e.visible)},setExpandability(e,{expandAvailable:t,expandButtonLabel:i}){b["default"].set(e,"expandAvailable",t),b["default"].set(e,"expandButtonLabel",i)},toggleExpand(e){b["default"].set(e,"expanded",!e.expanded)},setState(e,{visible:t,expanded:i}){b["default"].set(e,"visible",t),b["default"].set(e,"expanded",i)},reset(e){Object.keys(Pp()).forEach((t=>{b["default"].set(e,t,Pp()[t])}))}}};const xp="/admin/rest/note",Bp=({rootState:e})=>!!e.auth.currentProcessOrderName&&["processOrder.name","=",e.auth.currentProcessOrderName],Op=({rootState:e})=>{const t=["permissionMode=fieldSharing"];return e.auth.currentCompanies&&e.auth.currentCompanies[0]?(t.push(`fieldSharingCompanyId=${e.auth.currentCompanies[0].id}`),t):t},$p=kc(xp,{filter:Bp,additionalQueryParams:Op});function Rp(){return{...$p.state}}var Np={...$p,state:Rp(),mutations:{...$p.mutations},actions:{...$p.actions},getters:{...$p.getters}};const zp="/admin/rest/note",Lp=({rootGetters:e})=>0!==e["auth/currentProcessOrders"].length&&["processOrderId","IN",e["auth/currentProcessOrderIds"]],Vp=kc(zp,{filter:Lp});function Up(){return{...Vp.state}}var jp={...Vp,state:Up(),mutations:{...Vp.mutations},actions:{...Vp.actions},getters:{...Vp.getters}};const Hp="subject",Gp="messageText",Wp="priority",Zp="read",Kp={[Hp]:null,[Gp]:null,[Wp]:null,[Zp]:null},qp="/admin/rest/message",Yp=({rootState:e})=>
1null!=e.auth.user&&null!=e.auth.user.id&&["AND",["receiverId","=",e.auth.user.id],["type","=","system"]],Jp=kc(qp,{filter:Yp,resolve:["template"]});function Xp(){return{...Jp.state,visible:!1}}var Qp={namespaced:!0,state:Xp(),mutations:{...Jp.mutations,toggleVisibility(e){b["default"].set(e,"visible",!e.visible)},hide(e){b["default"].set(e,"visible",!1)},markRead(e,t){const i=t[R];b["default"].set(e,"data",{...e.data,[i]:{...e.data[i],read:!0}})}},actions:{...Jp.actions,markRead({state:e,commit:t},i){t("markRead",i);const a=i[R];l().put(`${qp}/${a}`,{version:"2.0",data:ce(e.data[a],Kp)})}},getters:{...Jp.getters}};class eh{constructor(e){(0,tt.Z)(this,"productsApi",void 0),this.productsApi=e}async getProductPesticideIndications(e){const t=await Promise.all(e.map((e=>this.productsApi.productPesticideIndicationList({pesticideId:e})))),i=t.map((e=>e.data)),a=k(i);if("success"!==a){const e=E(i);throw new Error(e.errorUserMessage.join(", "))}const n=e.reduce(((e,t,a)=>{const{data:n}=i[a];return n&&(e[t]=n),e}),{});return n}}const th=[Hr.FEATURE_PESTS,Hr.FEATURE_ACTIVITIES_PESTICIDE_DETAILS],ih={async loadByIds({commit:e,rootGetters:t,state:i},a){if(!t["features/currentCompaniesHaveFeaturesEnabled"](th))return;const n=a.filter((e=>!i.data[e]));e("setFetching",!0);const{productsApi:r}=b["default"].prototype.$api,s=new eh(r);try{const t=await s.getProductPesticideIndications(n);n.forEach((i=>{e("setData",{pesticideId:i,pesticideIndications:t[i]})}))}catch(o){console.error(o),n.forEach((t=>{e("setData",{pesticideId:t,pesticideIndications:[]})}))}e("setFetching",!1)},reset({commit:e}){e("reset")}};var ah=ih;function nh(e,t){return t.every((t=>e.cropIds.includes(t)))}function rh(e,t){const i=t(e);return!!i&&na(i)}function sh(e,t){return 0===t.length||e.approvalStart<Math.min(...t)&&(!e.approvalEnd||e.approvalEnd>Math.max(...t))}function oh(e,t,i){const a=null!==t.maxAmount?Bl()(t.maxAmount).format({thousandSeparated:!0,mantissa:3}):null,n=a?`${a}`:"",r=i?`${i.name}`:"",s=n&&r?" ":"",o=t.isSplitting?", Splitting":"";return`${e.name} (${n}${s}${r}${o})`}const lh={compatiblePesticideIndications:(e,t,i,a)=>(t,i,n)=>{const r=i.filter((e=>rh(e,a["products/findProductById"])));return e.data[t]?.filter((e=>nh(e,r))).filter((e=>sh(e,n)))??[]},findById:e=>(t,i)=>{const a=e.data[t];if(a)return Object.values(e.data[t]).find((e=>e.id===i))},dropdownItem:(e,t,i)=>(e,a,n)=>{const r=i.pests.data[a],s=t.findById(e,n);if(!r||!s)return{id:"",name:""};const o=s.maxAmountUnitId?i.units.data[s.maxAmountUnitId]:void 0;return{id:`${r.id}_${s.id}`,name:oh(r,s,o)}},dropdownItems:(e,t,i)=>(e,a,n)=>{const r=[],s=t.compatiblePesticideIndications(e,a,n);return s.forEach((a=>{a.pestIds.forEach((n=>{const s=i.pests.data[n];s&&r.push(t.dropdownItem(e,n,a.id))}))})),[{items:r}]},findByProductAndPestId:e=>(t,i)=>{const a=e.data[t];return a?.find((e=>e.pestIds.includes(i)))},dropdownItemsForProductAndField:(e,t,i,a)=>(e,n,r)=>{const s=a["products/findProductById"](e);if(!s)return null;const o=i.productCategories.data;if(!Ki(s,o))return null;const{cropId:l}=i.fields.data[n];return l?t.dropdownItems(s.id,[l],r):null}};var dh=lh;function ch(){return{data:{},fetching:!1}}const uh={setData(e,{pesticideId:t,pesticideIndications:i}){b["default"].set(e.data,t,i)},setFetching(e,t){e.fetching=t},reset(e){const t=ch();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))}};var ph=uh;const hh={namespaced:!0,state:ch(),mutations:ph,actions:ah,getters:dh};var mh=hh;async function fh(e,t){const i=e.rootGetters["auth/currentCompaniesRegionIds"],{pestsApi:a}=b["default"].prototype.$api,n=await Promise.all(i.map((e=>{const i={regionId:e};return sr(a,"pestList",i,t)}))),r=A(n);return r}async function gh(e,t,i){throw new Error("API NOT IMPLEMENTED")}const yh=Fe(fh,gh,[Hr.FEATURE_PESTS]);var vh=yh;function bh(){return{...be()}}const wh={namespaced:!0,state:bh(),mutations:{...vh.mutations},actions:{...vh.actions},getters:{...vh.getters}};var Ch=wh;const Fh="BD3BBCFF-01B8-11E7-BE5A-08606E6810DA",Ah="BE0318CF-01B8-11E7-BE5A-08606E6810DA",kh="BE031CFC-01B8-11E7-BE5A-08606E6810DA",Sh="BE031BE4-01B8-11E7-BE5A-08606E6810DA",Eh="BE031FB3-01B8-11E7-BE5A-08606E6810DA",Ih=["B9548ED1-01B8-11E7-BE5A-08606E6810DA","73ED8E62-470D-11E9-A0F6-0898B227FA22","74E3F3BA-470D-11E9-AE99-0898B227BE5E","760D80A8-470D-11E9-914B-0898B2271D36","7BE5201C-470D-11E9-8645-0898B2274D69","7E473020-470D-11E9-99F6-0898B227A561","24F1C4B0-633C-11E7-8969-000000000000","D1B62396-6E86-11EA-BCDA-309C23B8C040","D1D40BC9-6E86-11EA-BCDA-309C23B8C040","8C75AC9E-470D-11E9-B171-0898B2275CAA","8E20B9F8-470D-11E9-9632-0898B22701B8","8E431426-470D-11E9-87E5-0898B227F2A0"],_h=["B9548E41-01B8
1-11E7-BE5A-08606E6810DA","24F1A50C-633C-11E7-B591-000000000000","74E3F3BA-470D-11E9-AE99-0898B227BE5E","8C70082A-470D-11E9-93C8-0898B2270CDA","D1A37D32-6E86-11EA-BCDA-309C23B8C040"],Dh={reset({commit:e,state:t}){Object.values(t.polygons).forEach((e=>{e.setMap(null)})),e("reset")},async setPaginationStep({commit:e,dispatch:t,state:i},a){if("function"===typeof i.paginationCallbackAsync){const e=await i.paginationCallbackAsync(i.paginationStep,a);if(!e)return}e("setPaginationStep",a),t("loadHeatmaps")},polygonSetState({commit:e},{key:t,state:i}){e("polygonSetState",{key:t,state:i})}};var Mh=Dh,Ph=i(20276),Th=i.n(Ph);const xh={paginationNextEnabled:()=>!1,selectedTaskDate:e=>e.selectedTaskDate?new Date(e.selectedTaskDate):null,fieldsWithHeatmap:e=>Object.keys(e.heatmaps.current).map((e=>e.split("_")[0])),currentHeatmaps:e=>e.heatmaps.current,heatmapsOfSelectedFields:(e,t)=>{const i=([t])=>void 0!==e.selectedFields.find((e=>t.startsWith(e)));return Object.entries(t.currentHeatmaps).filter(i).map((([,e])=>e))},indexTypes:()=>{const e=[{id:"DNN_NDVI",name:b["default"].i18n.translate("NDVI - Biomasse")},{id:"REIP",name:b["default"].i18n.translate("REIP - Stickstoffgehalt")},{id:"DNN_CIRE",name:b["default"].i18n.translate("CIre - Chlorophyll")},{id:"DNN_NDWI",name:b["default"].i18n.translate("NDWI - Wassergehalt")},{id:"DNN_LAI",name:b["default"].i18n.translate("LAI - Blattflächenindex")},{id:"MBI",name:b["default"].i18n.translate("MBI - Mehrjährige Biomasse")}];return[{items:e}]},zonesByHeatmaps(e){const t=e=>({...e,size:e.size/1e4}),i=e=>e.map(t).reduce(((e,t)=>({...e,size:e.size+t.size}))),a=e=>{const t=e.vegetation.custom_value_q??e.vegetation.value_q,i=e.properties.customColor??e.properties.fill,a=`${t}`;return{name:a,rate:t,size:e.area,color:i}},n=Object.values(e.heatmaps.current),r=e=>{const t=Number(e.name);return{name:e.name,rate:t,size:0,color:e.col}},s=n.flatMap((e=>e.color_codes)).filter((e=>e.area>0)).map(r),o=n.flatMap((e=>e.features)).map(a),l=[...o,...s],d=Object.values(Th()(l,"color")).map(i).sort(((e,t)=>e.name.includes("snow")?1:t.name.includes("snow")?-1:e.name.includes("cloud")?1:t.name.includes("cloud")||e.rate>t.rate?-1:1));return d}};var Bh=xh;const Oh="satellite",$h="upload",Rh={INACTIVE:"inactive",ACTIVE:"active"};function Nh(){return{paginationStep:1,zoneGenerationMode:Oh,paginationCallbackAsync:null,selectedFields:[],polygons:{},heatmaps:{fetching:!1,current:{}},fetchingTask:!1,task:null,selectedTaskDate:null,selectedCompany:{id:null,name:""},selectedIndexType:"DNN_NDVI",selectedHeatmapTimestamp:g()().startOf("day").unix(),multiPolyRequestIdentifier:null,stepsCompleted:!1,fetchingMaterial:!1,calculation:{material:{id:null,name:""},unit:null},checkingViolation:!1}}const zh={setPaginationStep(e,t){b["default"].set(e,"paginationStep",t)},setMultiPolyRequestIdentifier(e,t){b["default"].set(e,"multiPolyRequestIdentifier",t)},setPaginationCallbackAsync(e,t){b["default"].set(e,"paginationCallbackAsync",t)},setSelectedFields(e,t){b["default"].set(e,"selectedFields",t)},addPolygon(e,t){b["default"].set(e.polygons,t.field_key,t)},polygonSetState(e,{key:t,state:i}){const a={...e.polygons};a[t].state=i,b["default"].set(e,"polygons",a)},selectHeatmapDbId(e,t){b["default"].set(e,"selectedHeatmapDbId",t)},setCheckingViolation(e,t){b["default"].set(e,"checkingViolation",t)},fetchHeatmaps(e){b["default"].set(e.heatmaps,"fetching",!0),b["default"].set(e.heatmaps,"current",{})},setHeatmaps(e,t){Object.entries(t).forEach((([e,t])=>{t.features.forEach(((t,i)=>{t.heatmapKey=e,t.featureIndex=i}))})),b["default"].set(e.heatmaps,"fetching",!1),b["default"].set(e.heatmaps,"current",t)},setZoneGenerationMode(e,t){b["default"].set(e,"zoneGenerationMode",t)},setHeatmapTimestamp(e,t){b["default"].set(e,"selectedHeatmapTimestamp",t)},updateFeature(e,t){if(void 0===t.heatmapKey||void 0===t.featureIndex)throw new Error("Cannot update features with missing heatmap key or feature index in this workflow. Features are subordinates of heatmaps and therefore need to provide a heatmap key and a feature index for ease of reference.");b["default"].set(e.heatmaps.current[t.heatmapKey].features,t.featureIndex,t)},setStepsCompleted(e,t){b["default"].set(e,"stepsCompleted",t)},setTask(e,t){b["default"].set(e,"task",t)},setSelectedTaskDate(e,t){b["default"].set(e,"selectedTaskDate",t.toISOString())},setSelectedCompany(e,t){b["default"].set(e,"selectedCompany",t)},setFetchingTask(e,t){b["default"].set(e,"fetchingTask",t)},setFetchingMaterial(e,t){b["default"].set(e,"fetchingMaterial",t)}};var Lh=zh;const Vh={namespaced:!0,state:Nh(),mutations:Lh,actions:Mh,getters:Bh};var Uh=Vh;let jh=null;const Hh={...Uh.actions,async setMultipolyTimestamp({state:e,commit:t,getters:i},a){const n=e.polygons[a],r=`${a}:${i.coverageRatio}`,s=e.multiPolyTimestamps.loaded[r];let o={};if("MBI"===e.selectedIndexType)o={key:r,data:{availableData:[{coverageRatio:{cirrus:0,cloud:0,shadow:0,snow:0},dbId:"",timestamp:Math.floor(Date.now()/1e3)}]}};else if(s)o={key:r,data:s};else{const{coverageRatio:e}
1=i,a=g()().startOf("day").subtract(1,"year").unix(),s=g()().startOf("day").unix(),{data:d}=await l().post("/admin/sen4/multiPolyTimestamps",{polygon:n.pathsForAxios,timeStart:a,timeEnd:s,coverageRatio:e});o={key:r,data:d},t("addMultipolyTimestamp",o)}Object.keys(e.multiPolyTimestamps.current).map((e=>e.split(":")[0])).some((e=>e===a))&&(t("unsetCurrentMultipolyTimestamp",`${a}:0`),t("unsetCurrentMultipolyTimestamp",`${a}:2`)),t("setCurrentMultipolyTimestamp",o);const{timeArray:d}=i.availableTimestamps;for(let l=0;l<d.length;l+=1)if(e.selectedHeatmapTimestamp===d[l]){t("setHeatmapTimestampSelectedIndex",l);break}},async loadHeatmaps(e){await Gh(e)},async polygonSetState({commit:e,dispatch:t},{key:i,state:a}){e("polygonSetState",{key:i,state:a}),a===Rh.ACTIVE?await t("setMultipolyTimestamp",i):a===Rh.INACTIVE&&e("unsetCurrentMultipolyTimestamp",i)},setMaterial({rootState:e,commit:t},i){if(t("setMaterial",i),"manual"===i.id)return;const{n:a,p:n,k:r}=e.products.mineralFertilizers.data[i.id];t("setCalculationField",{key:"n",value:a}),t("setCalculationField",{key:"p",value:n}),t("setCalculationField",{key:"k",value:r})},setCalculationField({commit:e},t){e("setCalculationField",t),["n","p","k"].includes(t.key)&&e("setMaterial",{id:"manual",name:b["default"].i18n.translate("Eigener Dünger")})},setManualDosage({state:e,commit:t,getters:i},{key:a,index:n,value:r}){let s=null;s=null==e.calculation.manualDosage?i.zoneDosage.map((e=>({...e}))):e.calculation.manualDosage.map((e=>({...e})));let o=r;"dosage"!==a&&0!==e.calculation[a]&&(o=r/e.calculation[a]),s[n].dosage=o,s[n].n=e.calculation.n*o,s[n].p=e.calculation.p*o,s[n].k=e.calculation.k*o,t("setManualDosage",s)},async setTask({commit:e,rootState:t,dispatch:i,state:a},n){await i("auth/subscribe",void 0,{root:!0}),await Promise.all([i("fields/subscribe",void 0,{root:!0}),i("products/mineralFertilizers/subscribe",void 0,{root:!0})]),e("setTask",n),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&n.applicationMap.additionalData.zoneGenerationMode===$h&&e("setZoneGenerationMode",$h);const r=[];if(null!=n.applicationMap&&null!=n.applicationMap.additionalData&&Array.isArray(n.applicationMap.additionalData.fields)?n.applicationMap.additionalData.fields.forEach((({[R]:e})=>{null!=t.fields.data[e]&&r.push(e)})):Array.isArray(n.fields)&&n.fields.forEach((e=>{const{guid:i}=e.field;null!=t.fields.data[i]&&r.push(i)})),e("setSelectedFields",r),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.selectedIndexType&&e("setSelectedIndexType",n.applicationMap.additionalData.selectedIndexType),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.selectedHeatmapTimestamp&&e("setHeatmapTimestamp",n.applicationMap.additionalData.selectedHeatmapTimestamp),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.selectedQuantisationCode&&e("setSelectedQuantisationCode",n.applicationMap.additionalData.selectedQuantisationCode),null!=n.applicationMap&&null!=n.applicationMap.geoJson)if(null!=n.applicationMap.additionalData&&n.applicationMap.additionalData.zoneGenerationMode===$h)e("setUploadedZonesByFilename",n.applicationMap.geoJson);else{e("setHeatmaps",n.applicationMap.geoJson);const t=[...a.selectedFields,a.selectedIndexType,a.selectedQuantisationCode].join("_");e("setMultiPolyRequestIdentifier",t)}e("setPaginationStep",2),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&null!=n.applicationMap.additionalData.calculation.manualDosage&&e("setManualDosage",n.applicationMap.additionalData.calculation.manualDosage),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&"number"===typeof n.applicationMap.additionalData.calculation.n&&e("setCalculationField",{key:"n",value:n.applicationMap.additionalData.calculation.n}),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&"number"===typeof n.applicationMap.additionalData.calculation.p&&e("setCalculationField",{key:"p",value:n.applicationMap.additionalData.calculation.p}),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&"number"===typeof n.applicationMap.additionalData.calculation.k&&e("setCalculationField",{key:"k",value:n.applicationMap.additionalData.calculation.k}),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&"number"===typeof n.applicationMap.additionalData.calculation.averageDosage&&n.applicationMap.additionalData.calculation.averageDosage>0&&e("setCalculationField",{key:"averageDosage",value:n.applicationMap.additionalData.calculation.averageDosage}),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation&&null!=n.applicationMap.additionalData.calculation.material?e("setMaterial",n.applicationMap.additionalData.calculation.material):Array.isArray(n.workingMeans)&&n.workingMeans.length>0&&n.workingMeans.some((i=>null!=i&&null!=i.workingMean&&null!=i.workingMean.guid&&"string"===typeof i.workingMean.name&&null!=i.workingMean.category&&i.workingMean.category.guid===Fh&&"number"===typeof i.amount&&null!=i.unit&&i.unit.guid===Ah&&(e("setMaterial",{id:i.workingMean.guid,name:i.workingMean.name}),e("setCalculationField",{key:"averageDosage",value:i.amount}),e("setCalculationField",{key:"n",value:t.products.mineralFertilizers.data[i.workingMean.guid].n}),e("setCalculationField",{key:"p",value:t.products.mineralFertilizers.data[i.workingMean.guid].p}),e("setCalculationField",{key:"k",value:t.products.mineralFertilizers.data[i.workingMean.guid].k}),!0)))}},Gh=Xl()((async({state:e,commit:t,getters:i})=>{null!=jh&&jh.cancel();const{selectedFields:a,selectedHeatmapTimestamp:n,polygons:r,selectedIndexType:s,selectedQuantisationCode:o,heatmaps:d,multiPolyTimestamps:c}=e,u=a.filter((e=>!!r[e])).filter((e=>{const t=i.toClientId(e);return!d.current[t]})),p=g().unix(n),h=u.map((e=>{const t=r[e].pathsForAxios,a=`${e}:${i.coverageRatio}`,o=c.loaded[a]?.availableData?.find((e=>g().unix(e.timestamp).isSame(p,"day")))?.dbId??"",l=i.toClientId(e),d=e;return"MBI"===s?{dbId:null,timestamp:Math.floor(Date.now()/1e3),polygon:t,clientId:l,fieldKey:d}:s.includes("DNN_")?{timestamp:n,polygon:t,clientId:l,fieldKey:d}
1:{dbId:o,polygon:t,clientId:l,fieldKey:d}}));if(!h.length)return;jh=l().CancelToken.source();let m=null;e.heatmaps.fetching=!0;try{({data:m}=await l().post("/admin/sen4/multiPoly",{products:h,indexType:s,configSet:"SET_A1",quantisationCode:o},{cancelToken:jh.token}))}catch(y){return}finally{e.heatmaps.fetching=!1}jh=null;const f={...m.products};t("setHeatmaps",f)}),100,{leading:!1,trailing:!0});var Wh,Zh,Kh=Hh,qh=i(58948);(function(e){e["SEEDING"]="seeding",e["SEEDING_SOY"]="seedingSoy",e["FERTILIZATION"]="fertilization",e["FERTILIZATION_CEREALS"]="fertilizationCereals",e["SPRAYING"]="spraying"})(Wh||(Wh={})),function(e){e["SEEDING"]="seeding",e["SEEDING_SOY"]="seeding-soy",e["FERTILIZATION"]="fertilization",e["FERTILIZATION_CEREALS"]="fertilization-cereals",e["SPRAYING"]="spraying"}(Zh||(Zh={}));const Yh={...Uh.getters,timestampsByCoverageRatio:e=>t=>Object.entries(e.multiPolyTimestamps.current).filter((([e])=>e.endsWith(`${t}`))).map((([,e])=>e)),paginationNextEnabled:e=>!!e.selectedFields.length&&(!!Object.keys(e.multiPolyTimestamps.current).length&&((2!==e.paginationStep||e.zoneGenerationMode!==$h||0!==Object.values(e.uploadedZonesByFilename).length)&&((2!==e.paginationStep||!e.heatmaps.fetching)&&((3!==e.paginationStep||null!=e.calculation.averageDosage)&&!(4===e.paginationStep&&!e.stepsCompleted))))),paginationNextDisabledReason:(e,t)=>{if(t.paginationNextEnabled)return null;switch(e.paginationStep){case 1:return b["default"].i18n.translate("Bitte wähle ein Feld aus, bevor du fortfährst.");case 3:return b["default"].i18n.translate("Bitte wähle ein Produkt und eine Produktmenge aus, bevor du fortfährst.");default:return null}},selectedIndexType:e=>e.selectedIndexType,coverageRatio:(e,t)=>t.selectedIndexType.includes("DNN_")?0:2,selectedQuantisationCode:e=>e.selectedQuantisationCode,selectedHeatmapTimestamp:e=>e.selectedHeatmapTimestamp,availableTimestamps:(e,t)=>{const i=[],a={};return t.timestampsByCoverageRatio(t.coverageRatio).forEach((e=>{e.availableData.forEach((e=>{const t=e.timestamp,n=e.dbId,r=g().unix(e.timestamp).startOf("day").unix();let s=!1;i.forEach((e=>{const t=g().unix(e).startOf("day").unix();r===t&&(s=!0)})),s||(i.push(t),a[t]=n)}))})),{timeArray:i.sort(((e,t)=>e-t)),mapping:a}},uploadedZonesByFilename:e=>e.uploadedZonesByFilename,calculation:e=>e.calculation,zonesByUploadedZones(e){const t={};return Object.values(e.uploadedZonesByFilename).forEach((e=>{e.features.forEach((e=>{const i=e.properties.fill;null==t[i]&&(t[i]={size:0,color:i,name:Nl(e.properties.RATE||0).format(),rate:e.properties.RATE||0}),"number"===typeof e.properties.size&&(t[i].size+=e.properties.size/1e4)}))})),Object.values(t).filter((e=>e.size>0)).sort(((e,t)=>t.rate&&e.rate?t.rate-e.rate:-1))},zones(e,t){return e.zoneGenerationMode===Oh?t.zonesByHeatmaps:e.zoneGenerationMode===$h?t.zonesByUploadedZones:[]},zoneDosage(e,t){let i=0;e.calculation.averageDosage&&e.calculation.averageDosage>0&&({averageDosage:i}=e.calculation);const a=t.zones.filter((e=>e.size>0));if(0===a.length)return null;if(null!=e.calculation.manualDosage)return e.calculation.manualDosage;const n=[],r=[];n.push(a.map((e=>e.size))),r.push(a.reduce(((e,t)=>e+t.size),0)*i);for(let l=0;l<a.length-1;l+=1){const t=[];for(let e=0;e<l;e+=1)t.push(0);"quality"===e.calculation.strategy?(t.push(1-e.calculation.zoneDifference),t.push(-1)):"balancing"===e.calculation.strategy&&(t.push(-1),t.push(1-e.calculation.zoneDifference));for(let e=l+2;e<a.length;e+=1)t.push(0);n.push(t),r.push(0)}const s=(0,qh.DU)(n,r).map((([e])=>e));let o=0;return t.zones.map(((i,a)=>{let n=0;return i.size>0?n=s[a-o]:o+=1,{color:t.zones[a].color,name:t.zones[a].name,dosage:n,n:n*e.calculation.n,p:n*e.calculation.p,k:n*e.calculation.k}}))},zonesByHeatmaps(e,t){const i=e=>({...e,size:e.size/1e4}),a=e=>e.map(i).reduce(((e,t)=>({...e,size:e.size+t.size}))),n=t=>{const i=t.vegetation.custom_value_q??t.vegetation.value_q,a=t.properties.customColor??t.properties.fill,n=Nl(i).format({mantissa:"REIP"===e.selectedIndexType?0:2});return{name:n,rate:i,size:t.area,color:a}},r=e.selectedFields.map(t.toClientId),s=Object.entries(e.heatmaps.current).filter((([e])=>r.includes(e))).map((([,e])=>e)),o=e=>{const t=s.flatMap((e=>e.features)).find((t=>t.properties.fill===e.col));return{name:e.name,rate:t?.vegetation.value_q??0,size:0,color:e.col}},l=s.flatMap((e=>e.color_codes)).filter((e=>e.area>0)).map(o),d=s.flatMap((e=>e.features)).map(n),c=[...d,...l];return Object.values(Th()(c,"color")).map(a).sort(((e,t)=>e.name.includes("snow")?1:t.name.includes("snow")?-1:e.name.includes("cloud")?1:t.name.includes("cloud")||e.rate>t.rate?-1:1))},taskDataAsync:(e,t,i,a)=>async n=>
1{await n("activityTypes/subscribe");const{currentHeatmaps:r,zoneDosage:s,selectedTaskDate:o}=t,{zoneGenerationMode:l,uploadedZonesByFilename:d,selectedFields:c,selectedIndexType:u,selectedHeatmapTimestamp:p,selectedQuantisationCode:h,calculation:m,selectedCompany:f}=e,g=f.id?f.id:i.auth.currentCompanies[0].id,y=[];null!=m.material.id&&"manual"!==m.material.id&&"number"===typeof m.averageDosage&&m.averageDosage>0&&y.push({workingMeanId:m.material.id,amount:m.averageDosage,unitId:m.unit});let v=null;l===Oh&&(v=r),l===$h&&(v=d);const b=await a["auth/processOrderByCompanyIdAndNameAndTypeAsync"](i.auth.currentCompanies[0].id,i.auth.currentProcessOrderName),w=o||new Date,C=Math.floor(w.getTime()/1e3),F={version:"2.0",data:{companyId:g,processOrderId:b.id,activityId:a["activityTypes/byRoughAndFineId"](ie.FEMI).id,timeStart:C,state:"new",fields:c.map((e=>({fieldId:e,processedArea:a.fields[e].fieldSize}))),workingMeans:y,applicationMap:{additionalData:{fields:c.map((e=>{const t={id:e};return l===Oh&&(t.geoJsonId=Object.keys(r).find((t=>t.startsWith(e)))||null),t})),zoneGenerationMode:l,selectedIndexType:u,selectedHeatmapTimestamp:p,selectedQuantisationCode:h,calculation:m,zoneDosage:s},geoJson:v,companyId:g,workflowKey:Zh.FERTILIZATION}}};return F},toClientId(e){const{selectedHeatmapTimestamp:t,selectedIndexType:i,selectedQuantisationCode:a}=e;return e=>[e,t,i,a].join("_")}};var Jh=Yh;function Xh(){return{...Nh(),selectedQuantisationCode:"medium",uploadedZonesByFilename:{},multiPolyTimestamps:{loaded:{},current:{}},calculation:{averageDosage:null,material:{id:null,name:""},unit:Ah,n:0,p:0,k:0,zoneDifference:.05,strategy:"balancing",manualDosage:null}}}const Qh={...Uh.mutations,reset(e){const t=Xh();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},addMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.loaded};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"loaded",i)},setCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"current",i)},unsetCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};delete i[t],b["default"].set(e.multiPolyTimestamps,"current",i)},setHeatmapTimestampSelectedIndex(e,t){b["default"].set(e,"heatmapTimestampSelectedIndex",t)},setHeatmapTimestampManuallySelected(e,t){b["default"].set(e,"heatmapTimestampManuallySelected",t)},setSelectedIndexType(e,t){b["default"].set(e,"selectedIndexType",t)},setSelectedQuantisationCode(e,t){b["default"].set(e,"selectedQuantisationCode",t)},setUploadedZonesByFilename(e,t){b["default"].set(e,"uploadedZonesByFilename",t)},uploadedZoneFilesAddGeoJson(e,{filename:t,geoJson:i}){const a={...e.uploadedZonesByFilename,[t]:i};b["default"].set(e,"uploadedZonesByFilename",a)},uploadedZoneFilesRemoveGeoJson(e,t){const i=Object.keys(e.uploadedZonesByFilename).reduce(((i,a)=>a===t?i:{...i,[a]:e.uploadedZonesByFilename[a]}),{});b["default"].set(e,"uploadedZonesByFilename",i)},setMaterial(e,t){b["default"].set(e.calculation,"material",t)},setCalculationField(e,t){b["default"].set(e.calculation,t.key,t.value)},setManualDosage(e,t){b["default"].set(e.calculation,"manualDosage",t)}};var em=Qh;const tm={namespaced:!0,state:Xh(),mutations:em,actions:Kh,getters:Jh};var im=tm;function am(e){return nm(e)?Et.WinterGrains1N:rm(e)?Et.WinterGrains3N:Et.None}function nm(e){return!(!e||!("averageFertilizerRate"in e)||"number"!==typeof e.averageFertilizerRate)}function rm(e){return!!(e&&"averageFertilizerRate1N"in e&&"number"===typeof e.averageFertilizerRate1N&&"averageFertilizerRate2N"in e&&"number"===typeof e.averageFertilizerRate2N&&"expectedYield"in e&&"number"===typeof e.expectedYield&&"humidityAreaType"in e&&"targetGrainQuality"in e)}function sm(e,t){return e.map((e=>om(e,t)))}function om(e,t){const i=lm(e,t)||"#000000";return{color:i,name:e.index?.toString()||"Unknown",minNdvi:e.min,maxNdvi:e.max,avgNdvi:e.avg,size:e.area?e.area/1e4:0,rate:e.nRate??0}}function lm(e,t){const i=t.find((t=>t.properties.ZONE===e.index?.toString()));return i?.properties.fill}function dm(e,t,i){return{[i]:{area:-1,coverage_ratio:fm,color_codes:cm(e),color_config:mm,features:um(t),type:"FeatureCollection",vegetation:gm,satellite_products:{estimation_date:"2024-10-25T10:59:03.000Z"}}}}function cm(e){return e.map((e=>({area:e.size,col:e.color,name:e.name})))}function um(e){return e.map((e=>({area:-1,coverage_ratio:fm,geometry:e.geometry,properties:pm(e.properties),type:e.type,vegetation:hm(e.properties)})))}function pm(e){return{fill:e.fill||"#000000","fill-opacity":1,stroke:e.fill||"#000000","stroke-opacity":Number(e["stroke-opacity"]),"stroke-width":0,value:Number(e.NDVI)}}function hm(e){return{type:"NDVI",value:Number(e.NDVI),value_q:-1}}const mm={abs_color_scaling:-1,color_codes:[],max:-1,min:-1,quantisation_interval:-1,smoothing_kernel_size:-1},fm={all:1,cloud:0,shadow:0,snow:0},gm={type:"NDVI",value:0,value_max:0,value_min:0};var ym,vm,bm,wm;function Cm(e){switch(e){case vm.SATELLITE_IMAGE:return wm.TRUE_COLOR_IMAGE;case vm.VEGETATION:return wm.NDVI;case vm.ZONES:return wm.ZONE_MAP;default:throw new Error(`Cannot convert visualization mode to mapT
1ype: ${e}`)}}(function(e){e["EQUAL_ZONE_SIZE"]="EQUAL_ZONE_SIZE",e["EQUAL_INDEX_DISTANCE"]="EQUAL_INDEX_DISTANCE",e["JENKS_NATURAL_BREAKS"]="JENKS_NATURAL_BREAKS"})(ym||(ym={})),function(e){e["SATELLITE_IMAGE"]="SATELLITE_IMAGE",e["VEGETATION"]="VEGETATION",e["ZONES"]="ZONES"}(vm||(vm={})),function(e){e["MANUAL"]="manual",e["FIRST"]="first",e["SECOND"]="second",e["THIRD"]="third"}(bm||(bm={})),function(e){e["TRUE_COLOR_IMAGE"]="TCI",e["NDVI"]="NDVI",e["ZONE_MAP"]="ZONE_MAP"}(wm||(wm={}));const Fm={...Uh.actions,loadHeatmaps(){},async loadFieldTimestamps({commit:e},t){e("setFieldTimestampsLoading",!0);const i=g()().startOf("day").subtract(1,"year").unix(),a=g()().startOf("day").unix(),n={requestTerrazoFieldTimestamp:{fieldId:t,timeStart:i,timeEnd:a}},{applicationMapsApi:r}=b["default"].prototype.$api;try{const i=await r.applicationMapsTerrazoFieldTimestamp(n),a=i.data;if("success"!==a.status)throw new Error(`API response status is not success: ${a}`);e("setFieldTimestamps",{fieldId:t,timestamps:a.data}),e("setFieldTimestampsError",null)}catch(s){console.error(s),e("setFieldTimestampsError","Failed to load field timestamps"),e("setFieldTimestamps",{fieldId:t,timestamps:null})}finally{e("setFieldTimestampsLoading",!1)}},async loadFeaturesAndZones({commit:e},{fieldId:t,dbId:i,visualizationMode:a,numberOfZones:n,borderZoneCorrection:r,zoningMode:s,fertilizerAdviceParams:o}){e("setZonesLoading",!0);const l=Cm(a),d=am(o),c={requestTerrazoMap:{fieldId:t,dbId:i,mapType:l,numberOfZones:n,corrected:r,zoningMode:s,fertilizerAdviceType:d,fertilizerAdviceParamsWinterGrains1N:nm(o)?o:void 0,fertilizerAdviceParamsWinterGrains3N:rm(o)?o:void 0}},{applicationMapsApi:u}=b["default"].prototype.$api;try{const i=await u.applicationMapsTerrazoMap(c),a=i.data;if("success"!==a.status)throw new Error(`API response status is not success: ${a}`);if(a.data?.meta?.zones&&a.data.features){const i=sm(a.data.meta.zones,a.data.features);e("setZones",i);const n=dm(i,a.data.features,t);e("setHeatmaps",n)}}catch(p){console.error(p),e("setZonesError","Failed to load zones"),e("setZones",null),e("setHeatmaps",{})}finally{e("setZonesLoading",!1)}},setMaterial({rootState:e,commit:t}
1,i){if(t("setMaterial",i),!i||!i.id||"manual"===i.id)return;const{n:a,p:n,k:r}=e.products.mineralFertilizers.data[i.id];t("setCalculationField",{key:"n",value:a}),t("setCalculationField",{key:"p",value:n}),t("setCalculationField",{key:"k",value:r})},setCalculationField({commit:e},t){e("setCalculationField",t),["n","p","k"].includes(t.key)&&e("setMaterial",{id:"manual",name:b["default"].i18n.translate("Eigener Dünger")})},setManualDosage({state:e,commit:t,getters:i},{key:a,index:n,value:r}){let s=[];s=null==e.calculation.manualDosage?i.zoneDosage:e.calculation.manualDosage;let o=r;if("dosage"!==a){const t=e.calculation[a];0!==t&&(o=r/t)}s[n].dosage=o,s[n].n=e.calculation.n*o,s[n].p=e.calculation.p*o,s[n].k=e.calculation.k*o,"dosage"!==a&&(s[n][a]=r),t("setManualDosage",s),t("setApplicationField",{key:"applicationType",value:bm.MANUAL})},async setTask({commit:e,rootState:t,dispatch:i,state:a},n){if(await i("auth/subscribe",void 0,{root:!0}),await Promise.all([i("fields/subscribe",void 0,{root:!0}),i("products/mineralFertilizers/subscribe",void 0,{root:!0})]),e("setTask",n),!n.applicationMap||!n.applicationMap.additionalData)return;const r=[];if(Array.isArray(n.applicationMap.additionalData.fields)?n.applicationMap.additionalData.fields.forEach((({[R]:e})=>{null!=t.fields.data[e]&&r.push(e)})):Array.isArray(n.fields)&&n.fields.forEach((e=>{null!=t.fields.data[e.fieldId]&&r.push(e.fieldId)})),e("setSelectedFields",r),r.length>0&&e("setPaginationStep",2),e("setZoneMap",n.applicationMap.additionalData.zoneMap),null!=n.applicationMap.additionalData.calculation){const{calculation:t}=n.applicationMap.additionalData,i={n:t.n,p:t.p,k:t.k,manualDosage:t.manualDosage,material:t.material,unit:t.unit};e("setCalculation",{...a.calculation,...i})}n.applicationMap.additionalData.application&&e("setApplication",n.applicationMap.additionalData.application)}};var Am=Fm;function km(e,t){return e.find((e=>{if(!e.timestamp)return!1;const i=g().unix(t);return g().unix(e.timestamp).isSame(i,"day")}))}function Sm(e,t){if(e.length!==t.length)throw new Error("Scores and weights must have the same length");const i=e.reduce(((e,i,a)=>e+i*t[a]),0),a=t.reduce(((e,t)=>e+t),0);return i/a}const Em={...Uh.getters,paginationNextEnabled:e=>{if(1!==e.selectedFields.length)return!1;switch(e.paginationStep){case 1:return!0;case 2:return!e.fieldTimestamps.loading;case 3:return!!e.calculation.material.id;case 4:return e.stepsCompleted;default:return!1}},paginationNextDisabledReason:(e,t)=>{if(t.paginationNextEnabled)return null;switch(e.paginationStep){case 1:return b["default"].i18n.translate("Bitte wähle ein Feld aus, bevor du fortfährst.");default:return null}},calculation:e=>e.calculation,zoneDosage:e=>{if(e.application.applicationType===bm.MANUAL&&null!=e.calculation.manualDosage)return e.calculation.manualDosage;const t=e.zones.data?.filter((e=>e.size>0));return t?.map((t=>{const i=(t.rate||0)/(e.calculation.n||1);return{color:t.color,name:t.name,dosage:i,n:t.rate||0,p:i*e.calculation.p,k:i*e.calculation.k}}))},selectedField:e=>e.selectedFields[0]?e.selectedFields[0]:null,dbId:e=>null===e.zoneMap.date||null===e.fieldTimestamps.data?null:km(e.fieldTimestamps.data,e.zoneMap.date)?.dbId??null,weightedAverageDosage:(e,t)=>{const i=t.zoneDosage?.map((e=>e.dosage))??[],a=e.zones.data?.map((e=>e.size))??[];return Sm(i,a)},taskDataAsync:(e,t,i,a)=>async n=>{await n("activityTypes/subscribe",{},{root:!0});const{currentHeatmaps:r,zoneDosage:s,selectedTaskDate:o}=t,{zoneGenerationMode:l,selectedFields:d,calculation:c,selectedCompany:u,application:p,zoneMap:h}=e,m=u.id||i.auth.currentCompanies[0].id||"",f=[];null!=c.material.id&&"manual"!==c.material.id&&f.push({workingMeanId:c.material.id,amount:t.weightedAverageDosage,unitId:a["products/allProducts"].find((e=>e.id===c.material.id))?.unitId??""});const g=await a["auth/processOrderByCompanyIdAndNameAndTypeAsync"](i.auth.currentCompanies[0].id,i.auth.currentProcessOrderName),y=o||new Date,v=Math.floor(y.getTime()/1e3),b={version:"2.0",data:{companyId:m,processOrderId:g.id,activityId:a["activityTypes/byRoughAndFineId"](ie.FEMI).id,timeStart:v,state:"new",fields:d.map((e=>
1({fieldId:e,processedArea:a.fields[e].fieldSize}))),workingMeans:f,applicationMap:{additionalData:{fields:d.map((e=>({id:e,geoJsonId:Object.keys(r).find((t=>t.startsWith(e)))||null}))),zoneGenerationMode:l,calculation:{...c,averageDosage:t.weightedAverageDosage},zoneDosage:s,application:p,zoneMap:h},geoJson:r,companyId:m,workflowKey:Zh.FERTILIZATION_CEREALS},userComment:null}};return b}};var Im=Em;function _m(){return{...Nh(),fieldTimestamps:{loading:!1,error:null,data:null},zoneMap:{date:null,numberOfZones:5,zoningMode:ym.JENKS_NATURAL_BREAKS,borderZoneCorrection:!0,visualizationMode:vm.SATELLITE_IMAGE},calculation:{material:{id:null,name:""},k:0,n:0,p:0,manualDosage:null,unit:null},application:{applicationType:bm.MANUAL,applicationTypeFirst:{targetNRate:null},applicationTypeThird:{targetYield:null,humidityAreaType:null,targetGrainQuality:null,averageFertilizerRate1N:null,averageFertilizerRate2N:null},validationError:!1},zones:{loading:!1,error:null,data:null}}}var Dm=i(31468),Mm=i.n(Dm);const Pm={...Uh.mutations,reset(e){const t=_m();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},setSelectedFields(e,t){if(t.length<=1)return void(e.selectedFields=t);const i=t.filter((t=>!e.selectedFields.includes(t)));i.length>1?(console.warn("Cannot select more than one field at a time. Use the first unselected field."),e.selectedFields=i.slice(0,1)):e.selectedFields=i},setFieldTimestampsLoading(e,t){e.fieldTimestamps={...e.fieldTimestamps,loading:t}},setFieldTimestamps(e,{timestamps:t}){e.fieldTimestamps={...e.fieldTimestamps,data:t}},setFieldTimestampsError(e,t){e.fieldTimestamps={...e.fieldTimestamps,error:t}},setDate(e,t){e.zoneMap.date=t},setNumberOfZones(e,t){e.zoneMap.numberOfZones=t},setZoningMode(e,t){e.zoneMap.zoningMode=t},setBorderZoneCorrection(e,t){e.zoneMap.borderZoneCorrection=t},setVisualizationMode(e,t){e.zoneMap.visualizationMode=t},setZoneMap(e,t){e.zoneMap=t},setApplication(e,t){e.application=t},setApplicationField(e,{key:t,value:i}){if(t.split(".").length>1){const a={...e.application};Mm()(a,t,i),b["default"].set(e,"application",a)}else{const a={...e.application,[t]:i};b["default"].set(e,"application",a)}},setMaterial(e,t){e.calculation.material=t},setCalculation(e,t){e.calculation=t},setCalculationField(e,t){e.calculation={...e.calculation,[t.key]:t.value}},setManualDosage(e,t){e.calculation.manualDosage=t},setApplicationType(e,t){e.application.applicationType=t},setZonesLoading(e,t){e.zones={...e.zones,loading:t}},setZones(e,t){e.zones={...e.zones,data:t}},setZonesError(e,t){e.zones={...e.zones,error:t}}};var Tm=Pm;const xm={namespaced:!0,state:_m(),mutations:Tm,actions:Am,getters:Im};var Bm=xm;const Om={workflowName:"Maize",indexType:"RATE_SEED_MAIZE",configSet:"SET_A2",getUnitId:()=>kh,shouldConvertM2ToHa:!1,conversionFactor:1},$m={workflowName:"Soy",indexType:"RATE_SEED_MAIZE",configSet:"SET_A2",getUnitId:e=>"Drill"===e?Ah:Eh,shouldConvertM2ToHa:!0,conversionFactor:1e4,invertColorScale:!0};function Rm(e){let t="#"===e[0]?e.slice(1):e;6!==t.length&&(t=(()=>{const e=[];return Array.from(t).forEach((t=>{e.push(`${t}${t}`)})),e})().join(""));const i=t.match(/#?(.{2})(.{2})(.{2})/)?.slice(1),a=i?.map((e=>parseInt(e,16)))??[];return a.push(1),a}function Nm(e){return`#${e.map((e=>{const t=e.toString(16);return 1===t.length?`0${t}`:t})).join("")}`}function zm(e){const t=e[0]/255,i=e[1]/255,a=e[2]/255,n=Math.max(t,i,a),r=Math.min(t,i,a),s=n-r,o=n+r;let l;l=r===n?0:t===n?(60*(i-a)/s+360)%360:i===n?60*(a-t)/s+120:60*(t-i)/s+240;const d=.5*o;let c;c=0===d?0:1===d?1:d<=.5?s/o:s/(2-o);const u=Math.round(l),p=Math.round(100*c),h=Math.round(100*d),m=e[3]||1;return[u,p,h,m]}function Lm(e){const t=Rm(e);return zm(t)}function Vm(e){const t=Rm(e),i=.299*t[0]+.587*t[1]+.114*t[2];return i<150?"#ffffff":"#13353c"}function Um(e){return/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(e)}const jm=500;function Hm(e){return Math.round(e/jm)*jm}function Gm(e,t,i){return Math.min(Math.max(e,t),i)}function Wm(e,t){return e.cropId&&t[e.cropId]?.name||null}function Zm(e,t){const{manualMinSeedrate:i,manualMaxSeedrate:a}=t,n=e.map((e=>e.varietyValue||0)),r=Math.min(...n),s=Math.max(...n),o=((a||0)-(i||0))/(s-r);return Number(o.toFixed(2))}function Km(e,t){const{manualMinSeedrate:i,kDiff:a,areaWeightedVarietyMean:n}=t,r=Math.min(...e.map((e=>e.varietyValue||0))),s=(i||0)-a*(r-n),o=Hm(s);return o}function qm(e,t,i){const a=e,n=Object.values(e)[0].color_config,r=Ym(n,t,i);return Object.entries(e).forEach((([e,t])=>{a[e].color_codes=Xm(t.color_codes,r),a[e].features=Qm(t.features,r)})),a}function Ym(e,t,i){const a=e=>e.manualSeedRate??e.seedRateWithLossCompensation??e.seedRate??0,n=t.map((e=>a(e))),r=Math.min(...n),s=Math.max(...n),o={};return t.forEach((t=>{o[t.color]||(o[t.color]=Jm(e,r,s,a(t),i))})),o}function Jm(e,t,i,a,n){let r=(a-t)/(i-t);n&&(r=1-r),r=Math.max(0,Math.min(r,1-Number.EPSILON));const s=1/(e.color_codes.length-1),o=Math.trunc(r/s),l=o+1,d=(r-o*s)/s,c=e.color_codes[o],u=e.color_codes[l],p=[Math.trunc(c[0]+d*(u[0]-c[0])),Math.trunc(c[1]+d*(u[1]-c[1])),Math.trunc(c[2]+d*(u[2]-c[2]))],h=Nm(p);return h}function Xm(e,t){return e.map((e=>t[e.col]?{...e,col:t[e.col]}:e))}function Qm(e,t){return e.map((e=>{const i=e.properties.fill,a=t[i];return a?{...e,properties:{...e.properties,fill:a,stroke:a}}:e}))}function ef(e,t){if(0===e.length)return null;const i=t[e[0]];return i}async function tf(e,t,i){if(!e)return null;const{processOrder:{companyId:a}}=t,n=["AND",["category.type","=","seed"],["name","=",e.name],["unitId","=",i.getUnitId(e.seedingMethod)],["OR",["companyId","IS",null],["companyId","=",a]]];try{const e=Ro(n),{data:t}=await l().get(`/admin/rest/material/?version=2.0&filter=${e}`);return"success"===t.status&&t.data.length>0?t.data[0]:null}catch(r){return console.error(r),null}}async function af(e,t,i,a){const{cropId:n,processOrder:{companyId:r}}=e;if(!n)throw new Error("No cropId found on selected field");const s=await nf(n,r,t,i,a);return s}async function nf(e,t,i,a,n){const r=a[e];if(!r)return!1;const s=["AND",["category.type","=","seed"],["mainCropId","=",e],["unitId","=",n.getUnitId(i.seedingMethod)],["OR",["companyId","IS",null],["companyId","=",t]]];try{const e=Ro(s),{data:t}=await l().get(`/admin/rest/material/?version=2.0&filter=${e}&itemsPerPage=1000`);if("success"===t.status&&t.data.length>0){const e=t.data,i=e.find((e=>e.name.includes(r?.name)));return i||e[0]}throw new Error(`No material found: ${JSON.stringify(t)}`)}catch(o){return console.error(o),null}}function rf(e,t,i){const a=sf(e,t,i);if(0===Object.values(a).length)return null;const n=Object.values(a).sort(((e,t)=>t.count-e.count)),r=i.find((e=>e.name===n[0].name));return r}function sf(e,t,i){const a={},n=i.map((e=>e.name));return Object.values(e).forEach((e=>{if(!e.varietyId)return;let r=t[e.varietyId].name;if(!n.includes(r)){const t=i.find((t=>t.varietyId===e.varietyId));if(!t)return;r=t.name}a[r]?a[r].count+=1:a[r]={id:null,name:r,count:1}})),a}function of(e,t){if(!e.name||!e.fao)return e;const i=e.seedingMethod?`${e.name} (${e.fao}) ${t(e.seedingMethod)??e.seedingMethod}`:`${e.name} (${e.fao})`;return{id:e.id,name:i}}const{getMostFrequentWorkflowVarietyInFields:lf,getFirstSelectedField:df,calcHeatmapColors:cf,calcBasicSeedStrengthFromManualSeedrate:uf,calcKDiffFromManualSeedrate:pf,getCropName:hf}=n;async function mf(e,t){return tf(e,t,$m)}async function ff(e,t,i){return af(e,t,i,$m)}function gf(e,t){const i=yf(e),a=Hm(i),n=Gm(a,t.seedrateMin,t.seedrateMax);return n}function yf(e){const t=e.map((e=>e.varietyValue||0)),i=e.map((e=>e.size));return Sm(t,i)}function vf(){return{...Nh(),selectedHeatmapDbId:null,selectedQuantisationCode:"medium",varieties:{fetching:!1,current:[]},calculation:{averageDosage:null,material:{id:null,name:""}
1,unit:kh,variety:{id:null,name:"",count:0},kDiff:0,k:0,d:0,areaWeightedVarietyMean:0,basicSeedStrength:7e4,lossCompensation:0,seedrateMin:0,seedrateMax:0,manualMinSeedrate:null,manualMaxSeedrate:null,manualSeedRates:{},thousandGrainWeight:200}}}const bf="RATE_SEED_MAIZE",wf="SET_A2",Cf={...Uh.actions,async loadHeatmaps({state:e,commit:t,dispatch:i}){const a=[...e.selectedFields,e.selectedIndexType,e.selectedHeatmapDbId,e.selectedQuantisationCode,e.calculation.variety.id].join("_");if(e.multiPolyRequestIdentifier===a)return;if(t("setMultiPolyRequestIdentifier",a),t("fetchHeatmaps"),e.paginationStep<2||e.selectedFields.length<1)return e.multiPolyRequestIdentifier=null,void t("setHeatmaps",{});let n=e.selectedFields.filter((t=>null!=e.polygons[t]));if(n.length!==e.selectedFields.length)return void t("setHeatmaps",{});const r=e.selectedQuantisationCode;n=n.map((t=>{const i=null,a=e.polygons[t].pathsForAxios,n=`${t}_${i}_${bf}_${r}`,s=t,o=Math.floor(Date.now()/1e3);return{dbId:i,polygon:a,clientId:n,fieldKey:s,timestamp:o}}));let s=null;try{({data:s}=await l().post("/admin/sen4/multiPoly",{products:n,indexType:bf,configSet:wf,quantisationCode:r}))}catch(o){return}t("setHeatmaps",e.task?.applicationMap?.geoJson??s.products),i("setHeatmapColors")},async loadVarieties({commit:e,state:t},{forceRefresh:i=!1}){if(!this.state.varieties.fetching&&(0===t.varieties.current.length||i)){e("setVarietiesFetching",!0);try{const{regionId:t}=this.state.auth.currentCompanies[0],{plantVarietiesWorkflowSeedingApi:i}=b["default"].prototype.$api,a=await i.plantVarietyWorkflowSeedingList({regionId:t,seedingWorkflow:"Soy"});e("setVarieties",a.data.data)}catch(a){console.error(a)}e("setVarietiesFetching",!1)}},async setVariety({state:e,commit:t,dispatch:i},a){if("manual"===a.id)return void t("setCalculationField",{key:"variety",value:{id:a.id,name:a.name}});const{seedrateMin:n,seedrateMax:r,k:s,d:o,kDiff:l,name:d,id:c,seedingMethod:u,fao:p}=e.varieties.current.find((e=>e.id===a.id)),h=1e4,m="number"===typeof n?n*h:n,f="number"===typeof r?r*h:r,g="number"===typeof s?s*h:s,y="number"===typeof o?o*h:o,v={id:c,name:d,seedingMethod:u,fao:p},b={manualMaxSeedrate:null,manualMinSeedrate:null,manualSeedRates:{}};t("setCalculation",{...e.calculation,...b,variety:v,seedrateMin:m,seedrateMax:f,k:g,d:y,kDiff:l}),i("updateVarietyDependencies")},updateVarietyDependencies({dispatch:e}){e("setAreaWeightedVarietyMean"),e("loadHeatmaps")},setManualSeedRate({commit:e,state:t},{zoneName:i,manualSeedRate:a}){const{manualSeedRates:n}=t.calculation,r={[i]:a};e("setCalculationField",{key:"manualSeedRates",value:{...n,...r}})},setAreaWeightedVarietyMean({state:e,commit:t,getters:i}){if(!e.calculation.variety.id||e.heatmaps.fetching||0===Object.values(e.heatmaps.current).length)return;const a=gf(i.zones,e.calculation);t("setCalculationField",{key:"areaWeightedVarietyMean",value:a}),t("setCalculationField",{key:"basicSeedStrength",value:a})},setManualMinMaxSeedrate({commit:e,state:t,getters:i},a){e("setCalculationField",{key:"manualMinSeedrate",value:a.seedrateMin}),e("setCalculationField",{key:"manualMaxSeedrate",value:a.seedrateMax});const n=pf(i.zones,t.calculation);e("setCalculationField",{key:"kDiff",value:n});const r=uf(i.zones,t.calculation);e("setCalculationField",{key:"basicSeedStrength",value:r})},setHeatmapColors({commit:e,state:t,getters:i}){if(!t.heatmaps.current||t.heatmaps.fetching||!t.calculation.variety.id)return;const a=cf(t.heatmaps.current,i.zones,$m.invertColorScale);e("setHeatmaps",a)},setAverageDosage({commit:e},t){e("setCalculationField",{key:"averageDosage",value:t})},async findAndSetMaterial({commit:e,state:t,rootState:i}){const a=df(t.selectedFields,i.fields.data);if(!a)return;e("setFetchingMaterial",!0);let n=await mf(t.calculation.variety,a);n||(n=await ff(a,t.calculation.variety,i.products.crops.data)),n&&e("setCalculationField",{key:"material",value:{id:n.id,name:n.name}}),e("setFetchingMaterial",!1)},async setTask({commit:e,rootState:t,dispatch:i,state:a},n){await i("auth/subscribe",void 0,{root:!0}),await Promise.all([i("fields/subscribe",void 0,{root:!0}),i("products/mineralFertilizers/subscribe",void 0,{root:!0})]),e("setTask",n);const r=[];if(null!=n.applicationMap&&null!=n.applicationMap.additionalData&&Array.isArray(n.applicationMap.additionalData.fields)?n.applicationMap.additionalData.fields.forEach((({[R]:e})=>{null!=t.fields.data[e]&&r.push(e)})):Array.isArray(n.fields)&&n.fields.forEach((e=>{const{guid:i}
1=e.field;null!=t.fields.data[i]&&r.push(i)})),e("setSelectedFields",r),null!=n.applicationMap&&null!=n.applicationMap.geoJson){e("setHeatmaps",n.applicationMap.geoJson);const t=[...a.selectedFields,a.selectedIndexType,a.selectedHeatmapDbId,a.selectedQuantisationCode].join("_");e("setMultiPolyRequestIdentifier",t)}if(r.length>0&&e("setPaginationStep",2),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation){const{calculation:t}=n.applicationMap.additionalData;e("setCalculation",{...a.calculation,...t})}},resetManualSeedrates({commit:e,state:t,dispatch:i}){const{manualMaxSeedrate:a,manualMinSeedrate:n,manualSeedRates:r}=vf().calculation,{kDiff:s}=t.varieties.current.find((e=>e.id===t.calculation.variety.id));e("setCalculation",{...t.calculation,manualMaxSeedrate:a,manualMinSeedrate:n,manualSeedRates:r,kDiff:s}),i("setAreaWeightedVarietyMean")},async setDefaultVariety({state:e,rootState:t,dispatch:i}){const a=Object.values(t.fields.data).filter((t=>e.selectedFields.includes(t.id))),n=lf(a,t.varieties.data,e.varieties.current);n?i("setVariety",{id:n.id,name:n.name}):i("loadHeatmaps")}};var Ff=Cf;function Af(e,t){return t.variety.id&&"manual"!==t.variety.id?kf(e,t):null}function kf(e,t){const{k:i,d:a}=t,n=e.rate,r=n*i+a;return r}function Sf(e,t){return t.variety.id&&e?Ef(e,t):null}function Ef(e,t){const{kDiff:i,areaWeightedVarietyMean:a,basicSeedStrength:n,seedrateMin:r,seedrateMax:s,manualMinSeedrate:o,manualMaxSeedrate:l}=t;let d=i*(e-a)+n;d=Hm(d);const c=o??r,u=l??s;return Gm(d,c,u)}function If(e,t){return null===t.manualSeedRates[e]||void 0===t.manualSeedRates[e]?null:t.manualSeedRates[e]}function _f(e,t){if(null===e)return null;const{lossCompensation:i,seedrateMin:a,seedrateMax:n,manualMinSeedrate:r,manualMaxSeedrate:s}=t;let o=e*(1+i);return o=Hm(o),null!==r||null!==s?o:Gm(o,a,n)}const Df={...Uh.getters,paginationNextEnabled:e=>0!==e.selectedFields.length&&(e.paginationStep<=1||(!(2!==e.paginationStep||e.heatmaps.fetching||!e.calculation.variety.id)||!(3!==e.paginationStep||!e.stepsCompleted))),paginationNextDisabledReason:(e,t)=>{if(t.paginationNextEnabled)return null;switch(e.paginationStep){case 1:return b["default"].i18n.translate("Bitte wähle ein Feld aus, bevor du fortfährst.");case 2:return b["default"].i18n.translate("Bitte wähle eine Sorte aus, bevor du fortfährst.");default:return null}},varieties:e=>e.varieties,calculation:e=>e.calculation,features(e){let t=[];return Object.values(e.heatmaps.current).forEach((e=>{t=[...t,...e.features]})),t},zones:(e,t)=>t.zonesByHeatmaps.map((t=>{const i=Af(t,e.calculation),a=Sf(i,e.calculation),n=_f(a,e.calculation),r=If(t.name,e.calculation);return{...t,varietyValue:i,seedRate:a,seedRateWithLossCompensation:n,manualSeedRate:r}})),zoneDosage(e,t){const i=e.varieties.current.find((t=>t.id===e.calculation.variety.id)),a="Drill"===i?.seedingMethod;return t.zones.map((t=>{let i=t.manualSeedRate??t.seedRateWithLossCompensation;if(i)if(a){const t=i/1e4;i=Math.round(t*e.calculation.thousandGrainWeight/100)}else i=Math.round(i/1e4);return{color:t.color,name:t.name,dosage:i}}))},zonesMinSeedrate:(e,t)=>{const i=t.zones.map((e=>e.seedRate)).filter(ka);return Math.min(...i)},zonesMaxSeedrate:(e,t)=>{const i=t.zones.map((e=>e.seedRate)).filter(ka);return Math.max(...i)},taskDataAsync:(e,t,i,a)=>async n=>{await n("activityTypes/subscribe",{},{root:!0});const{currentHeatmaps:r,zoneDosage:s,selectedTaskDate:o}=t,{zoneGenerationMode:l,selectedFields:d,selectedHeatmapDbId:c,selectedHeatmapTimestamp:u,selectedQuantisationCode:p,calculation:h,task:m,selectedCompany:f,varieties:g}=e,y=f.id?f.id:i.auth.currentCompanies[0].id,v=g.current.find((e=>e.id===h.variety.id)),b="Drill"===v?.seedingMethod,w=[];if(null!=h.material.id&&"manual"!==h.material.id&&"number"===typeof h.averageDosage&&h.averageDosage>0){let e=h.averageDosage,t=h.unit;if(b){const i=h.averageDosage/1e4;e=Math.round(i*h.thousandGrainWeight/100),t=Ah}else e=Math.round(h.averageDosage/1e4),t=Eh;w.push({workingMeanId:h.material.id,amount:e,unitId:t})}const C=await a["auth/processOrderByCompanyIdAndNameAndTypeAsync"](i.auth.currentCompanies[0].id,i.auth.currentProcessOrderName),F=o||new Date,A=Math.floor(F.getTime()/1e3);function k(e){let t="";return m?.userComment&&(t=`${m.userComment} `),t=`${t}${e}`,t}const S=k(h.variety.name),E={version:"2.0",data:{companyId:y,processOrderId:C.id,activityId:a["activityTypes/byRoughAndFineId"](ie.SEED_MAIN).id,timeStart:A,state:"new",fields:d.map((e=>
1({fieldId:e,processedArea:a.fields[e].fieldSize}))),workingMeans:w,applicationMap:{additionalData:{fields:d.map((e=>{const t={id:e,geoJsonId:Object.keys(r).find((t=>t.startsWith(e)))||null};return t})),zoneGenerationMode:l,selectedIndexType:"RATE_SEED_MAIZE",selectedHeatmapDbId:c,selectedHeatmapTimestamp:u,selectedQuantisationCode:p,calculation:{...h,unit:b?Ah:Eh},zoneDosage:s},geoJson:r,companyId:y,workflowKey:Zh.SEEDING_SOY},userComment:S}};return E}};var Mf=Df;const Pf={...Uh.mutations,reset(e){const t=vf();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},fetchVarieties(e){b["default"].set(e.varieties,"fetching",!0)},setVarieties(e,t){b["default"].set(e.varieties,"fetching",!1),b["default"].set(e.varieties,"current",t)},setVarietiesFetching(e,t){b["default"].set(e.varieties,"fetching",t)},setCalculation(e,t){b["default"].set(e,"calculation",t)},setCalculationField(e,t){b["default"].set(e.calculation,t.key,t.value)},setQuantisationCode(e,t){b["default"].set(e,"selectedQuantisationCode",t)}};var Tf=Pf;const xf={namespaced:!0,state:vf(),mutations:Tf,actions:Ff,getters:Mf};var Bf=xf;const{getMostFrequentWorkflowVarietyInFields:Of,getFirstSelectedField:$f,calcHeatmapColors:Rf,calcBasicSeedStrengthFromManualSeedrate:Nf,calcKDiffFromManualSeedrate:zf,getCropName:Lf}=n;async function Vf(e,t){return tf(e,t,Om)}async function Uf(e,t,i){return af(e,t,i,Om)}function jf(e,t){const i=Hf(e),a=Hm(i),n=Gm(a,t.seedrateMin,t.seedrateMax);return n}function Hf(e){const t=e.map((e=>e.varietyValue||0)),i=e.map((e=>e.size));return Sm(t,i)}function Gf(){return{...Nh(),selectedHeatmapDbId:null,selectedQuantisationCode:"medium",varieties:{fetching:!1,current:[]},calculation:{averageDosage:null,material:{id:null,name:""},unit:kh,variety:{id:null,name:"",count:0},kDiff:0,k:0,d:0,areaWeightedVarietyMean:0,basicSeedStrength:7e4,lossCompensation:0,seedrateMin:0,seedrateMax:0,manualMinSeedrate:null,manualMaxSeedrate:null,manualSeedRates:{}}}}const Wf="RATE_SEED_MAIZE",Zf="SET_A2",Kf={...Uh.actions,async loadHeatmaps({state:e,commit:t,dispatch:i}){const a=[...e.selectedFields,e.selectedIndexType,e.selectedHeatmapDbId,e.selectedQuantisationCode,e.calculation.variety.id].join("_");if(e.multiPolyRequestIdentifier===a)return;if(t("setMultiPolyRequestIdentifier",a),t("fetchHeatmaps"),e.paginationStep<2||e.selectedFields.length<1)return e.multiPolyRequestIdentifier=null,void t("setHeatmaps",{});let n=e.selectedFields.filter((t=>null!=e.polygons[t]));if(n.length!==e.selectedFields.length)return void t("setHeatmaps",{});const r=e.selectedQuantisationCode;n=n.map((t=>{const i=null,a=e.polygons[t].pathsForAxios,n=`${t}_${i}_${Wf}_${r}`,s=t,o=Math.floor(Date.now()/1e3);return{dbId:i,polygon:a,clientId:n,fieldKey:s,timestamp:o}}));let s=null;try{({data:s}=await l().post("/admin/sen4/multiPoly",{products:n,indexType:Wf,configSet:Zf,quantisationCode:r}))}catch(o){return}t("setHeatmaps",e.task?.applicationMap?.geoJson??s.products),i("setHeatmapColors")},async loadVarieties({commit:e,state:t},{forceRefresh:i=!1}){if(!this.state.varieties.fetching&&(0===t.varieties.current.length||i)){e("setVarietiesFetching",!0);try{const{regionId:t}=this.state.auth.currentCompanies[0],{plantVarietiesWorkflowSeedingApi:i}=b["default"].prototype.$api,a=await i.plantVarietyWorkflowSeedingList({regionId:t,seedingWorkflow:"Maize"});e("setVarieties",a.data.data)}catch(a){console.error(a)}e("setVarietiesFetching",!1)}},async setVariety({state:e,commit:t,dispatch:i},a){if("manual"===a.id)return void t("setCalculationField",{key:"variety",value:{id:a.id,name:a.name}});const{seedrateMin:n,seedrateMax:r,k:s,d:o,kDiff:l,name:d,id:c,fao:u,seedingMethod:p}=e.varieties.current.find((e=>e.id===a.id)),h={id:c,name:d,fao:u,seedingMethod:p},m={manualMaxSeedrate:null,manualMinSeedrate:null,manualSeedRates:{}};t("setCalculation",{...e.calculation,...m,variety:h,seedrateMin:n,seedrateMax:r,k:s,d:o,kDiff:l}),i("updateVarietyDependencies")},updateVarietyDependencies({dispatch:e}){e("setAreaWeightedVarietyMean"),e("loadHeatmaps")},setManualSeedRate({commit:e,state:t},{zoneName:i,manualSeedRate:a}){const{manualSeedRates:n}
1=t.calculation,r={[i]:a};e("setCalculationField",{key:"manualSeedRates",value:{...n,...r}})},setAreaWeightedVarietyMean({state:e,commit:t,getters:i}){if(!e.calculation.variety.id||e.heatmaps.fetching||0===Object.values(e.heatmaps.current).length)return;const a=jf(i.zones,e.calculation);t("setCalculationField",{key:"areaWeightedVarietyMean",value:a}),t("setCalculationField",{key:"basicSeedStrength",value:a})},setManualMinMaxSeedrate({commit:e,state:t,getters:i},a){e("setCalculationField",{key:"manualMinSeedrate",value:a.seedrateMin}),e("setCalculationField",{key:"manualMaxSeedrate",value:a.seedrateMax});const n=zf(i.zones,t.calculation);e("setCalculationField",{key:"kDiff",value:n});const r=Nf(i.zones,t.calculation);e("setCalculationField",{key:"basicSeedStrength",value:r})},setHeatmapColors({commit:e,state:t,getters:i}){if(!t.heatmaps.current||t.heatmaps.fetching||!t.calculation.variety.id)return;const a=Rf(t.heatmaps.current,i.zones,Om.invertColorScale);e("setHeatmaps",a)},setAverageDosage({commit:e},t){e("setCalculationField",{key:"averageDosage",value:t})},async findAndSetMaterial({commit:e,state:t,rootState:i}){const a=$f(t.selectedFields,i.fields.data);if(!a)return;e("setFetchingMaterial",!0);let n=await Vf(t.calculation.variety,a);n||(n=await Uf(a,t.calculation.variety,i.products.crops.data)),n&&e("setCalculationField",{key:"material",value:{id:n.id,name:n.name}}),e("setFetchingMaterial",!1)},async setTask({commit:e,rootState:t,dispatch:i,state:a},n){await i("auth/subscribe",void 0,{root:!0}),await Promise.all([i("fields/subscribe",void 0,{root:!0}),i("products/mineralFertilizers/subscribe",void 0,{root:!0})]),e("setTask",n);const r=[];if(null!=n.applicationMap&&null!=n.applicationMap.additionalData&&Array.isArray(n.applicationMap.additionalData.fields)?n.applicationMap.additionalData.fields.forEach((({[R]:e})=>{null!=t.fields.data[e]&&r.push(e)})):Array.isArray(n.fields)&&n.fields.forEach((e=>{const{guid:i}=e.field;null!=t.fields.data[i]&&r.push(i)})),e("setSelectedFields",r),null!=n.applicationMap&&null!=n.applicationMap.geoJson){e("setHeatmaps",n.applicationMap.geoJson);const t=[...a.selectedFields,a.selectedIndexType,a.selectedHeatmapDbId,a.selectedQuantisationCode].join("_");e("setMultiPolyRequestIdentifier",t)}if(r.length>0&&e("setPaginationStep",2),null!=n.applicationMap&&null!=n.applicationMap.additionalData&&null!=n.applicationMap.additionalData.calculation){const{calculation:t}=n.applicationMap.additionalData;e("setCalculation",{...a.calculation,...t})}},resetManualSeedrates({commit:e,state:t,dispatch:i}){const{manualMaxSeedrate:a,manualMinSeedrate:n,manualSeedRates:r}=Gf().calculation,{kDiff:s}=t.varieties.current.find((e=>e.id===t.calculation.variety.id));e("setCalculation",{...t.calculation,manualMaxSeedrate:a,manualMinSeedrate:n,manualSeedRates:r,kDiff:s}),i("setAreaWeightedVarietyMean")},async setDefaultVariety({state:e,rootState:t,dispatch:i}){const a=Object.values(t.fields.data).filter((t=>e.selectedFields.includes(t.id))),n=Of(a,t.varieties.data,e.varieties.current);n?i("setVariety",{id:n.id,name:n.name}):i("loadHeatmaps")}};var qf=Kf;function Yf(e,t){return t.variety.id&&"manual"!==t.variety.id?Jf(e,t):null}function Jf(e,t){const{k:i,d:a}=t,n=e.rate,r=n*i+a;return r}function Xf(e,t){return t.variety.id&&e?Qf(e,t):null}function Qf(e,t){const{kDiff:i,areaWeightedVarietyMean:a,basicSeedStrength:n,seedrateMin:r,seedrateMax:s,manualMinSeedrate:o,manualMaxSeedrate:l}=t;let d=i*(e-a)+n;d=Hm(d);const c=o??r,u=l??s;return Gm(d,c,u)}function eg(e,t){return null===t.manualSeedRates[e]||void 0===t.manualSeedRates[e]?null:t.manualSeedRates[e]}function tg(e,t){if(null===e)return null;const{lossCompensation:i,seedrateMin:a,seedrateMax:n,manualMinSeedrate:r,manualMaxSeedrate:s}=t;let o=e*(1+i);return o=Hm(o),null!==r||null!==s?o:Gm(o,a,n)}const ig={...Uh.getters,paginationNextEnabled:e=>0!==e.selectedFields.length&&(e.paginationStep<=1||(!(2!==e.paginationStep||e.heatmaps.fetching||!e.calculation.variety.id)||!(3!==e.paginationStep||!e.stepsCompleted))),paginationNextDisabledReason:(e,t)=>{if(t.paginationNextEnabled)return null;switch(e.paginationStep){case 1:return b["default"].i18n.translate("Bitte wähle ein Feld aus, bevor du fortfährst.");case 2:return b["default"].i18n.translate("Bitte wähle eine Sorte aus, bevor du fortfährst.");default:return null}},varieties:e=>e.varieties,calculation:e=>e.calculation,features(e){let t=[];return Object.values(e.heatmaps.current).forEach((e=>{t=[...t,...e.features]})),t},zones:(e,t)=>t.zonesByHeatmaps.map((t=>{const i=Yf(t,e.calculation),a=Xf(i,e.calculation),n=tg(a,e.calculation),r=eg(t.
1name,e.calculation);return{...t,varietyValue:i,seedRate:a,seedRateWithLossCompensation:n,manualSeedRate:r}})),zoneDosage(e,t){return t.zones.map((e=>({color:e.color,name:e.name,dosage:e.manualSeedRate??e.seedRateWithLossCompensation})))},zonesMinSeedrate:(e,t)=>{const i=t.zones.map((e=>e.seedRate)).filter(ka);return Math.min(...i)},zonesMaxSeedrate:(e,t)=>{const i=t.zones.map((e=>e.seedRate)).filter(ka);return Math.max(...i)},taskDataAsync:(e,t,i,a)=>async n=>{await n("activityTypes/subscribe",{},{root:!0});const{currentHeatmaps:r,zoneDosage:s,selectedTaskDate:o}=t,{zoneGenerationMode:l,selectedFields:d,selectedHeatmapDbId:c,selectedHeatmapTimestamp:u,selectedQuantisationCode:p,calculation:h,task:m,selectedCompany:f}=e,g=f.id?f.id:i.auth.currentCompanies[0].id,y=[];null!=h.material.id&&"manual"!==h.material.id&&"number"===typeof h.averageDosage&&h.averageDosage>0&&y.push({workingMeanId:h.material.id,amount:h.averageDosage,unitId:h.unit});const v=await a["auth/processOrderByCompanyIdAndNameAndTypeAsync"](i.auth.currentCompanies[0].id,i.auth.currentProcessOrderName),b=o||new Date,w=Math.floor(b.getTime()/1e3);function C(e){let t="";return m?.userComment&&(t=`${m.userComment} `),t=`${t}${e}`,t}const F=C(h.variety.name),A={version:"2.0",data:{companyId:g,processOrderId:v.id,activityId:a["activityTypes/byRoughAndFineId"](ie.SEED_MAIN).id,timeStart:w,state:"new",fields:d.map((e=>({fieldId:e,processedArea:a.fields[e].fieldSize}))),workingMeans:y,applicationMap:{additionalData:{fields:d.map((e=>{const t={id:e,geoJsonId:Object.keys(r).find((t=>t.startsWith(e)))||null};return t})),zoneGenerationMode:l,selectedIndexType:"RATE_SEED_MAIZE",selectedHeatmapDbId:c,selectedHeatmapTimestamp:u,selectedQuantisationCode:p,calculation:h,zoneDosage:s},geoJson:r,companyId:g,workflowKey:Zh.SEEDING},userComment:F}};return A}};var ag=ig;const ng={...Uh.mutations,reset(e){const t=Gf();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},fetchVarieties(e){b["default"].set(e.varieties,"fetching",!0)},setVarieties(e,t){b["default"].set(e.varieties,"fetching",!1),b["default"].set(e.varieties,"current",t)},setVarietiesFetching(e,t){b["default"].set(e.varieties,"fetching",t)},setCalculation(e,t){b["default"].set(e,"calculation",t)},setCalculationField(e,t){b["default"].set(e.calculation,t.key,t.value)},setQuantisationCode(e,t){b["default"].set(e,"selectedQuantisationCode",t)}};var rg=ng;const sg={namespaced:!0,state:Gf(),mutations:rg,actions:qf,getters:ag};var og=sg;let lg=null;const dg=["37DD8F32-1251-4D56-9E19-A460DB72812C","5183EF01-B51D-4A72-A861-EB7CEC1CB55F"],cg={...Uh.actions,async setMultipolyTimestamp({state:e,commit:t,getters:i},a){const n=e.polygons[a],r=`${a}:${i.coverageRatio}`,s=e.multiPolyTimestamps.loaded[r];let o={};if("MBI"===e.selectedIndexType)o={key:r,data:{availableData:[{coverageRatio:{cirrus:0,cloud:0,shadow:0,snow:0},dbId:"",timestamp:Math.floor(Date.now()/1e3)}]}};else if(s)o={key:r,data:s};else{const{coverageRatio:e}=i,a=g()().startOf("day").subtract(1,"year").unix(),s=g()().startOf("day").unix(),{data:d}=await l().post("/admin/sen4/multiPolyTimestamps",{polygon:n.pathsForAxios,timeStart:a,timeEnd:s,coverageRatio:e});o={key:r,data:d},t("addMultipolyTimestamp",o)}Object.keys(e.multiPolyTimestamps.current).map((e=>e.split(":")[0])).some((e=>e===a))&&(t("unsetCurrentMultipolyTimestamp",`${a}:0`),t("unsetCurrentMultipolyTimestamp",`${a}:2`)),t("setCurrentMultipolyTimestamp",o);const{timeArray:d}=i.availableTimestamps;for(let l=0;l<d.length;l+=1)if(e.selectedHeatmapTimestamp===d[l]){t("setHeatmapTimestampSelectedIndex",l);break}},async loadHeatmaps(e){await ug(e)},async polygonSetState({commit:e,dispatch:t},{key:i,state:a}){e("polygonSetState",{key:i,state:a}),a===Rh.ACTIVE?await t("setMultipolyTimestamp",i):a===Rh.INACTIVE&&e("unsetCurrentMultipolyTimestamp",i)},updateOverwrite({commit:e},{summaryData:t}){e("setOverwrite",t)},resetOverwrite({commit:e}){e("setOverwrite",{reducedSprayMixPerZone:[],reducedVegetationPerZone:[]})},async liveCheck(e,t){const{tracksApi:i}=b["default"].prototype.$api;return e.commit("setCheckingViolation",!0),pg(e,i,t)},async setTask({commit:e,rootState:t,dispatch:i,state:a},n){await Promise.all([i("auth/subscribe",void 0,{root:!0}),i("fields/subscribe",void 0,{root:!0})]),e("setTask",n),n?.applicationMap?.additionalData?.zoneGenerationMode===$h&&e("setZoneGenerationMode",$h);const r=[];
1if(Array.isArray(n.applicationMap?.additionalData?.fields)?n.applicationMap.additionalData.fields.forEach((e=>{null!=t.fields.data[e.id]&&r.push(e.id)})):Array.isArray(n.fields)&&n.fields.forEach((e=>{const{guid:i}=e.field;null!=t.fields.data[i]&&r.push(i)})),e("setSelectedFields",r),null!=n.applicationMap?.additionalData?.selectedIndexType&&e("setSelectedIndexType",n.applicationMap.additionalData.selectedIndexType),null!=n.applicationMap?.additionalData?.selectedHeatmapTimestamp&&e("setHeatmapTimestamp",n.applicationMap.additionalData.selectedHeatmapTimestamp),null!=n.applicationMap?.additionalData?.selectedQuantisationCode&&e("setSelectedQuantisationCode",n.applicationMap.additionalData.selectedQuantisationCode),null!=n.workingMeans&&e("setWorkingMeans",n.workingMeans),null!=n.applicationMap?.geoJson)if(n?.applicationMap?.additionalData?.zoneGenerationMode===$h)e("setUploadedZonesByFilename",n.applicationMap.geoJson);else{e("setHeatmaps",n.applicationMap.geoJson);const t=[...a.selectedFields,a.selectedIndexType,a.selectedQuantisationCode].join("_");e("setMultiPolyRequestIdentifier",t)}if(e("setPaginationStep",2),n.applicationMap?.additionalData){const{calculation:t}=n.applicationMap.additionalData;e("setOverwrite",t.overwrite),e("setSprayMix",t.sprayMix),e("setReduction",t.reduction),e("setPlantProtections",t.products)}else Array.isArray(n.workingMeans)&&n.workingMeans.length>0&&n.workingMeans.some((t=>!(!t.workingMean?.guid||!t.workingMean?.name)&&(e("setPlantProtections",[{product:{id:t.workingMean.guid,name:t.workingMean.name},pest:{id:"",name:""},amount:t.amount,unit:t.unit.name}]),!0)))}},ug=Xl()((async({state:e,commit:t,getters:i})=>{null!=lg&&lg.cancel();const{selectedFields:a,selectedHeatmapTimestamp:n,polygons:r,selectedIndexType:s,selectedQuantisationCode:o,heatmaps:d,multiPolyTimestamps:c}=e,u=a.filter((e=>!!r[e])).filter((e=>{const t=i.toClientId(e);return!d.current[t]})),p=g().unix(n),h=u.map((e=>{const t=r[e].pathsForAxios,a=`${e}:${i.coverageRatio}`,o=c.loaded[a]?.availableData?.find((e=>g().unix(e.timestamp).isSame(p,"day")))?.dbId??"",l=i.toClientId(e),d=e;return"MBI"===s?{dbId:null,timestamp:Math.floor(Date.now()/1e3),polygon:t,clientId:l,fieldKey:d}:s.includes("DNN_")?{timestamp:n,polygon:t,clientId:l,fieldKey:d}:{dbId:o,polygon:t,clientId:l,fieldKey:d}}));if(!h.length)return;lg=l().CancelToken.source();let m=null;e.heatmaps.fetching=!0;try{({data:m}=await l().post("/admin/sen4/multiPoly",{products:h,indexType:s,configSet:"SET_A2",quantisationCode:o},{cancelToken:lg.token}))}catch(y){return}finally{e.heatmaps.fetching=!1}lg=null;const f={...m.products};t("setHeatmaps",f)}),100,{leading:!1,trailing:!0}),pg=Xl()((async({commit:e},t,i)=>t.trackLiveCheck({trackLiveCheckRequest:{data:{track:i,ignoreRuleIds:dg}}}).then((e=>e.data.data??[])).then((t=>(e("setViolations",t),t))).finally((()=>e("setCheckingViolation",!1)))),5e3,{leading:!0,trailing:!0,maxWait:5e3});var hg=cg;const mg={...Uh.getters,timestampsByCoverageRatio:e=>t=>Object.entries(e.multiPolyTimestamps.current).filter((([e])=>e.endsWith(`${t}`))).map((([,e])=>e)),paginationNextEnabled:(e,t)=>!!e.selectedFields.length&&(!!Object.keys(e.multiPolyTimestamps.current).length&&((2!==e.paginationStep||e.zoneGenerationMode!==$h||0!==Object.values(e.uploadedZonesByFilename).length)&&((2!==e.paginationStep||!e.heatmaps.fetching)&&(!(3===e.paginationStep&&!t.productListIsProperlyPopulated)&&!(4===e.paginationStep&&!e.stepsCompleted))))),paginationNextDisabledReason:(e,t)=>{if(t.paginationNextEnabled)return null;switch(e.paginationStep){case 1:return b["default"].i18n.translate("Bitte wähle ein Feld aus, bevor du fortfährst.");case 3:return b["default"].i18n.translate("Bitte wähle ein Produkt und eine Produktmenge aus, bevor du fortfährst.");default:return null}},selectedIndexType:e=>e.selectedIndexType,coverageRatio:(e,t)=>t.selectedIndexType.includes("DNN_")?0:2,selectedQuantisationCode:e=>e.selectedQuantisationCode,selectedHeatmapTimestamp:e=>e.selectedHeatmapTimestamp,availableTimestamps:(e,t)=>{const i=[],a={};
1return t.timestampsByCoverageRatio(t.coverageRatio).forEach((e=>{e.availableData.forEach((e=>{const t=e.timestamp,n=e.dbId,r=g().unix(e.timestamp).startOf("day").unix();let s=!1;i.forEach((e=>{const t=g().unix(e).startOf("day").unix();r===t&&(s=!0)})),s||(i.push(t),a[t]=n)}))})),{timeArray:i.sort(((e,t)=>e-t)),mapping:a}},uploadedZonesByFilename:e=>e.uploadedZonesByFilename,calculation:e=>e.calculation,zonesByUploadedZones(e){const t={};return Object.values(e.uploadedZonesByFilename).forEach((e=>{e.features.forEach((e=>{const i=e.properties.fill;null==t[i]&&(t[i]={size:0,color:i,name:Nl(e.properties.RATE||0).format(),rate:e.properties.RATE||0}),"number"===typeof e.properties.size&&(t[i].size+=e.properties.size/1e4)}))})),Object.values(t).filter((e=>e.size>0)).sort(((e,t)=>t.rate&&e.rate?t.rate-e.rate:-1))},zones(e,t){return e.zoneGenerationMode===Oh?t.zonesByHeatmaps:e.zoneGenerationMode===$h?t.zonesByUploadedZones:[]},zoneDosage(e,t){return t.zones.map(((e,i)=>({color:e.color,name:e.name,dosage:t.reducedSprayMixPerZone[i]})))},zonesByHeatmaps(e,t){const i=e=>({...e,size:e.size/1e4}),a=e=>e.map(i).reduce(((e,t)=>({...e,size:e.size+t.size}))),n=t=>{const i=t.vegetation.custom_value_q??t.vegetation.value_q,a=t.properties.customColor??t.properties.fill,n=Nl(i).format({mantissa:"REIP"===e.selectedIndexType?0:2});return{name:n,rate:i,size:t.area,color:a}},r=e.selectedFields.map(t.toClientId),s=Object.entries(e.heatmaps.current).filter((([e])=>r.includes(e))).map((([,e])=>e)),o=e=>{const t=s.flatMap((e=>e.features)).find((t=>t.properties.fill===e.col));return{name:e.name,rate:t?.vegetation.value_q??0,size:0,color:e.col}},l=s.flatMap((e=>e.color_codes)).filter((e=>e.area>0)).map(o),d=s.flatMap((e=>e.features)).map(n),c=[...d,...l];return Object.values(Th()(c,"color")).map(a).sort(((e,t)=>e.name.includes("snow")?1:t.name.includes("snow")?-1:e.name.includes("cloud")?1:t.name.includes("cloud")||e.rate>t.rate?-1:1))},toClientId(e){const{selectedHeatmapTimestamp:t,selectedIndexType:i,selectedQuantisationCode:a}=e;return e=>[e,t,i,a].join("_")},areas(e,t){return t.zones.map((({size:e})=>e))},vegetationValues(e,t){return t.zones.map((({rate:e})=>e)).filter(ka)},minVegetation(e,t){return Math.min(...t.vegetationValues)},maxVegetation(e,t){return Math.max(...t.vegetationValues)},vegetationPerZone(e,t){return t.zones.map((({rate:e,size:t})=>(e??1)*t))},reducedVegetationPerZone(e,t){if(t.isOverwritten)return e.calculation.overwrite.reducedVegetationPerZone;const{vegetationValues:i}=t,{reduction:a}=e.calculation;return fg(i).map((e=>e*a+(1-a)))},weightedVegetation(e,t){const{vegetationPerZone:i,areas:a}=t,n=i.reduce(((e,t)=>e+t),0),r=a.reduce(((e,t)=>e+t),0);return n/r},reducedWeightedVegetation(e,t){const{minVegetation:i,maxVegetation:a,weightedVegetation:n}=t,r=gg(n,i,a),{reduction:s}=e.calculation;return r*s+(1-s)},reducedSprayMixPerZone(e,t){if(t.isOverwritten)return e.calculation.overwrite.reducedSprayMixPerZone;const{reducedVegetationPerZone:i,reducedWeightedVegetation:a}=t;return i.map((t=>t*e.calculation.sprayMix/a))},isOverwritten(e){return!!e.calculation.overwrite.reducedVegetationPerZone.length},heatmapsOfSelectedFields:(e,t)=>{const i=([t])=>void 0!==e.selectedFields.find((e=>t.startsWith(e)));return Object.entries(t.currentHeatmaps).filter(i).filter((([t])=>t.includes(`${e.selectedHeatmapTimestamp}`))).filter((([t])=>t.includes(e.selectedIndexType))).filter((([t])=>t.includes(e.selectedQuantisationCode))).map((([,e])=>e))},taskDataAsync:(e,t,i,a)=>async n=>{await n("activityTypes/subscribe");const{currentHeatmaps:r,selectedTaskDate:s,zoneDosage:o}=t,{zoneGenerationMode:l,uploadedZonesByFilename:d,selectedFields:c,selectedIndexType:u,selectedHeatmapTimestamp:p,selectedQuantisationCode:h,calculation:m,selectedCompany:f,workingMeans:g}=e,y=f.id?f.id:i.auth.currentCompanies[0].id;let v=null;l===Oh&&(v=r),l===$h&&(v=d);const b=await a["auth/processOrderByCompanyIdAndNameAndTypeAsync"](i.auth.currentCompanies[0].id,i.auth.currentProcessOrderName),w=s||new Date,C=Math.floor(w.getTime()/1e3),F={version:"2.0",data:{companyId:y,processOrderId:b.id,activityId:a["activityTypes/byRoughAndFineId"](ie.PROTECT).id,timeStart:C,state:"new",fields:c.map((e=>
1({fieldId:e,processedArea:a.fields[e].fieldSize}))),workingMeans:g,applicationMap:{additionalData:{fields:c.map((e=>{const t={id:e};return l===Oh&&(t.geoJsonId=Object.keys(r).find((t=>t.startsWith(e)))||null),t})),zoneGenerationMode:l,selectedIndexType:u,selectedHeatmapTimestamp:p,selectedQuantisationCode:h,calculation:{...m,material:void 0},zoneDosage:o},geoJson:v,companyId:y,workflowKey:Zh.SPRAYING}}};return F},productListIsProperlyPopulated(e){const t=e.calculation.products.every((e=>!!e.product.id)),i=e.calculation.products.every((e=>!!e.amount));return t&&i}};function fg(e){const t=Math.min(...e),i=Math.max(...e);return e.map((e=>gg(e,t,i)))}function gg(e,t,i){return(e-t)/(i-t)}var yg=mg;function vg(){return{...Nh(),selectedQuantisationCode:"medium",selectedIndexType:"DNN_LAI",uploadedZonesByFilename:{},showRuleViolationModal:!1,violations:[],multiPolyTimestamps:{loaded:{},current:{}},calculation:{products:[{product:{id:"",name:""},pest:{id:"",name:""},amount:0,unit:""}],sprayMix:200,material:{id:null,name:""},overwrite:{reducedSprayMixPerZone:[],reducedVegetationPerZone:[]},unit:Sh,reduction:.1},workingMeans:[]}}const bg={...Uh.mutations,reset(e){const t=vg();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},addMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.loaded};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"loaded",i)},setCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"current",i)},unsetCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};delete i[t],b["default"].set(e.multiPolyTimestamps,"current",i)},setSelectedIndexType(e,t){b["default"].set(e,"selectedIndexType",t)},setSelectedQuantisationCode(e,t){b["default"].set(e,"selectedQuantisationCode",t)},setViolations(e,t){b["default"].set(e,"violations",t)},setCheckingViolation(e,t){b["default"].set(e,"checkingViolation",t)},setWorkingMeans(e,t){b["default"].set(e,"workingMeans",t)},setUploadedZonesByFilename(e,t){b["default"].set(e,"uploadedZonesByFilename",t)},uploadedZoneFilesAddGeoJson(e,{filename:t,geoJson:i}){const a={...e.uploadedZonesByFilename,[t]:i};b["default"].set(e,"uploadedZonesByFilename",a)},uploadedZoneFilesRemoveGeoJson(e,t){const i=Object.keys(e.uploadedZonesByFilename).reduce(((i,a)=>a===t?i:{...i,[a]:e.uploadedZonesByFilename[a]}),{});b["default"].set(e,"uploadedZonesByFilename",i)},setOverwrite(e,t){e.calculation.overwrite=t},setSprayMix(e,t){e.calculation.sprayMix=t},setReduction(e,t){e.calculation.reduction=t},setPlantProtections(e,t){e.calculation.products=t}};var wg=bg;const Cg={namespaced:!0,state:vg(),mutations:wg,actions:hg,getters:yg};var Fg=Cg;const Ag={namespaced:!0,modules:{fertilization:im,seeding:og,seedingSoy:Bf,fertilizationCereals:Bm,spraying:Fg},actions:{resetAll({dispatch:e}){e("fertilization/reset"),e("seeding/reset"),e("seedingSoy/reset"),e("fertilizationCereals/reset"),e("spraying/reset")}}};var kg=Ag;async function Sg(){throw new Error("not implemented yet!")}async function Eg(){throw new Error("not implemented yet!")}function Ig(e){return`${e.fieldId}-${e.indexType}-${e.statistics}-${e.startDate}-${e.endDate}`}const _g=Fe(Sg,Eg);function Dg(e){return e.data.value.every((e=>null===e))}const Mg={..._g.actions,async vegetationIndexGraph({state:e,commit:t},i){const a=Ig(i),n=e.data[a];if(n)return Promise.resolve().then((()=>n));const r=l().CancelToken.source();t("startFetching",r);const{sen4Api:s}=b["default"].prototype.$api;return s.sen4VegetationIndexGraph(i).then((e=>({id:a,...e.data}))).then((e=>{if(Dg(e))throw new Error("Vegetation data contains only nulls! Avoid setting in the state.");return t("addOne",e),e})).catch((e=>(console.error("Failed to load vegetation index data due to the following error",e),n))).finally((()=>t("finishFetching",r)))}};var Pg=Mg;const Tg={..._g.getters};var xg=Tg;function Bg(){return{...be()}}const Og={..._g.mutations};var $g=Og;const Rg={namespaced:!0,state:Bg(),mutations:$g,actions:Pg,getters:xg};var Ng=Rg;async function zg(){throw new Error("not implemented yet!")}async function Lg(){throw new Error("not implemented yet!")}function Vg(e){return`${e.aggregate}-${e.startDate}-${e.endDate}-${e.longitude}-${e.latitude}-${e.statistics}-${e.variables}-${e.tempBaseCrop}-${e.dateAccumulate}`}const Ug=Fe(zg,Lg),jg={...Ug.actions,async aggregate({state:e,commit:t},i){const a=Vg(i),n=e.data[a];if(n)return Promise.resolve().then((()=>n));const r=l().CancelToken.source();t("startFetching",r);const{weatherApi:s}=b["default"].prototype.$api;return s.weatherAggregate(i).then((e=>({id:a,...e.data}))).then((e=>(t("addOne",e),e))).catch((e=>(console.error("Failed to load weather data due to the following error",e),n))).finally((()=>t("finishFetching",r)))}};var Hg=jg;const Gg={...Ug.getters};var Wg=Gg;function Zg(){return{...be()}}const Kg={...Ug.mutations};var qg=Kg;const Yg={namespaced:!0,state:Zg(),mutations:qg,actions:Hg,getters:Wg};var Jg=Yg;const Xg={reset({commit:e,state:t}
1){Object.values(t.polygons).forEach((e=>{e.setMap(null)})),e("reset")},setPolygonState({state:e,commit:t,dispatch:i},a){Object.keys(a.values).forEach((async n=>{const r=a.key,s={...a};if(s.property=n,s.value=a.values[n],t("setPolygonProperty",s),"state"===n){if(t("setOverlayLoading"),"active"===a.values[n])if(await i("setPolygonVegetationData",r),await i("setMultipolyTimestamp",r),e.selectedHeatmapDbId)i("setCurrentHeatmaps",e.selectedHeatmapDbId);else{const t=e.multiPolyTimestamps.loaded[r].availableData.length-1;i("setCurrentHeatmaps",e.multiPolyTimestamps.loaded[r].availableData[t].dbId)}else"inactive"===a.values[n]&&(t("unsetCurrentMultipolyTimestamp",r),t("unsetCurrentVegetationData",r),t("unsetCurrentHeatmap",r));t("unsetOverlayLoading")}}))},setDnnPolygonState({commit:e},t){Object.keys(t.values).forEach((async i=>{const a={...t};a.property=i,a.value=t.values[i],e("setPolygonProperty",a)}))},async setCurrentHeatmaps({state:e,dispatch:t,commit:i},a){i("setSelectedHeatmapDbId",a);const n=Object.keys(e.polygons).filter((t=>"active"===e.polygons[t].state)),r={},s=[];if(n.forEach((t=>{const i=e.heatmaps.loaded[`${t}_${a}_${e.selectedIndexType}`];i?r[t]=i:s.push({dbId:e.selectedHeatmapDbId,polygon:e.polygons[t].pathsForAxios,clientId:`${t}_${a}_${e.selectedIndexType}`,fieldKey:t})})),s.length){const e=await t("loadHeatmaps",s);Object.keys(e.products).forEach((t=>{const i=t.split("_")[0];r[i]=e.products[t]})),i("addHeatmaps",e.products)}i("setCurrentHeatmaps",r)},async loadDnnHeatmaps({state:e,dispatch:t,commit:i}){const a=Object.keys(e.polygons).filter((t=>"active"===e.polygons[t].state)),n={},r=[];if(a.forEach((t=>{const i=e.heatmaps.loaded[`${t}_${e.selectedTimestamp}_${e.selectedIndexType}`];i?n[t]=i:r.push({polygon:e.polygons[t].pathsForAxios,clientId:`${t}_${e.selectedTimestamp}_${e.selectedIndexType}`,fieldKey:t,timestamp:e.selectedTimestamp})})),r.length){const e=await t("loadHeatmaps",r);Object.keys(e.products).forEach((t=>{const i=t.split("_")[0];n[i]=e.products[t]})),i("addHeatmaps",e.products)}i("setCurrentHeatmaps",n)},async loadHeatmaps({state:e,commit:t},i){t("setOverlayLoading");const{data:a}=await l().post("/admin/sen4/multiPoly",{products:i,indexType:e.selectedIndexType});return t("unsetOverlayLoading"),a},async setPolygonVegetationData({state:e,commit:t},i){const a=e.polygons[i],n=e.vegetationData[`${i}_${e.selectedIndexType}`];let r={};if(n)r={key:i,data:n};else{const{data:n}=await l().post("/admin/sen4/vegetationIndexGraph",{polygon:a.pathsForAxios,timeStart:Math.floor((new Date-63072e6)/1e3),timeEnd:Math.floor(new Date/1e3),indexType:e.selectedIndexType});r={key:i,data:n},t("addVegetationData",r)}return"active"===e.polygons[i].state&&t("setCurrentVegetationData",r),1},async setMultipolyTimestamp({state:e,commit:t},i){const a=e.polygons[i],n=e.multiPolyTimestamps[i];let r={};if(n)r={key:i,data:n};else{const{data:e}=await l().post("/admin/sen4/multiPolyTimestamps",{polygon:a.pathsForAxios,timeStart:Math.floor((new Date-63072e6)/1e3),timeEnd:Math.floor(new Date/1e3),coverageRatio:2}),n=Object.values(e.availableData.reduce(((e,t)=>{const i=g().unix(t.timestamp).format("DDMMYYYY");return null!=e[i]?e:{...e,[i]:t}}),{}));r={key:i,data:{availableData:n}},t("addMultipolyTimestamp",r)}return"active"===e.polygons[i].state&&t("setCurrentMultipolyTimestamp",r),1},setSelectedIndexType({state:e,commit:t,dispatch:i},a){const n=Object.keys(e.polygons).filter((t=>"active"===e.polygons[t].state));t("setSelectedIndexType",a),i("setCurrentHeatmaps",e.selectedHeatmapDbId),n.forEach((async e=>{t("setOverlayLoading"),await i("setPolygonVegetationData",e),t("unsetOverlayLoading")}))},setSelectedDnnIndexType({commit:e},t){e("setSelectedIndexType",t)},setSelectedTimestamp({commit:e},t){e("setSelectedTimestamp",t)},closeOverlay({state:e,commit:t,dispatch:i}){const a=Object.keys(e.polygons).filter((t=>"active"===e.polygons[t].state&&!e.polygons[t].external)),n=Object.keys(e.polygons).filter((t=>e.polygons[t].external));t("unsetCurrentHeatmaps"),t("unsetCurrentMultipolyTimestamps"),t("unsetAllCurrentVegetationData"),t("setSelectedFields",[]),a.forEach((e=>{i("setPolygonState",{key:e,values:{state:"inactive"}})}
1)),n.forEach((e=>{i("setPolygonState",{key:e,values:{state:"hidden"}})}))}};var Qg=Xg;const ey={selectedFields:e=>e.selectedFields,overlay:e=>e.overlay,overlayFolded:e=>e.overlay.folded,polygons:e=>e.polygons,currentHeatmaps:e=>e.heatmaps.current,multiPolyTimestamps:e=>Object.values(e.multiPolyTimestamps.current),vegetationData:e=>e.vegetationData.current,selectedHeatmapDbId:e=>e.selectedHeatmapDbId};var ty=ey;function iy(){return{selectedFields:[],polygons:{},heatmaps:{loaded:{},current:{}},vegetationData:{loaded:{},current:{}},multiPolyTimestamps:{loaded:{},current:{}},selectedIndexType:"DNN_NDVI",selectedTimestamp:g()().unix(),selectedHeatmapDbId:null,overlay:{folded:!1,loading:!1}}}const ay={reset(e){const t=iy();Object.entries(t).forEach((([t,i])=>{b["default"].set(e,t,i)}))},setSelectedFields(e,t){b["default"].set(e,"selectedFields",t)},addPolygon(e,t){b["default"].set(e.polygons,t.field_key,t)},setPolygonProperty(e,t){const i={...e.polygons};t.subProperty?i[t.key][t.property][t.subProperty]=t.value:i[t.key][t.property]=t.value,b["default"].set(e,"polygons",i)},addHeatmaps(e,t){b["default"].set(e.heatmaps,"loaded",{...e.heatmaps.loaded,...t})},setCurrentHeatmaps(e,t){b["default"].set(e.heatmaps,"current",t)},unsetCurrentHeatmap(e,t){const i={...e.heatmaps.current};delete i[t],b["default"].set(e.heatmaps,"current",i)},unsetCurrentHeatmaps(e){b["default"].set(e.heatmaps,"current",{})},addMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.loaded};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"loaded",i)},setCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};i[t.key]=t.data,b["default"].set(e.multiPolyTimestamps,"current",i)},unsetCurrentMultipolyTimestamp(e,t){const i={...e.multiPolyTimestamps.current};delete i[t],b["default"].set(e.multiPolyTimestamps,"current",i)},unsetCurrentMultipolyTimestamps(e){b["default"].set(e.multiPolyTimestamps,"current",{})},addVegetationData(e,t){const i={...e.vegetationData.loaded};i[t.key]=t.data,b["default"].set(e.vegetationData,"loaded",i)},setCurrentVegetationData(e,t){const i={...e.vegetationData.current};i[t.key]=t.data,b["default"].set(e.vegetationData,"current",i)},unsetCurrentVegetationData(e,t){const i={...e.vegetationData.current};delete i[t],b["default"].set(e.vegetationData,"current",i)},unsetAllCurrentVegetationData(e){b["default"].set(e.vegetationData,"current",{})},setSelectedIndexType(e,t){b["default"].set(e,"selectedIndexType",t)},setSelectedTimestamp(e,t){b["default"].set(e,"selectedTimestamp",t)},setSelectedHeatmapDbId(e,t){b["default"].set(e,"selectedHeatmapDbId",t)},toggleOverlayFold(e){b["default"].set(e.overlay,"folded",!e.overlay.folded)},setOverlayLoading(e){b["default"].set(e.overlay,"loading",!0)},unsetOverlayLoading(e){b["default"].set(e.overlay,"loading",!1)}};var ny=ay;const ry={namespaced:!0,state:iy(),mutations:ny,actions:Qg,getters:ty,modules:{sen4:Ng,weather:Jg}};var sy=ry;const oy={namespaced:!0,state:{},modules:{applicationMaps:kg,monitoring:sy}};var ly=oy;async function dy(e,t){const{productCategoriesApi:i}=b["default"].prototype.$api,a={},n=sr(i,"productCategoryList",a,t);return n}async function cy(e,t,i){const{productCategoriesApi:a}=b["default"].prototype.$api,{data:n}=await a.productCategoryObjects({objectIds:e.join(",")},i);return n}const uy=Fe(dy,cy),py={...uy.getters,isHerbicide:e=>t=>{const i=e.data[t];return i?.type===At.Herb}};var hy=py;function my(){return{...be()}}const fy={namespaced:!0,state:my(),mutations:{...uy.mutations},actions:{...uy.actions},getters:hy};var gy=fy;async function yy(e,t,i={itemsPerPage:5e3}){const a=Oo(i);a.append("version","2.0");const n=vy(e);a.append("filter",Ro(n));const r=`${To}/productVisibility?${$o(a)}`;return l().get(r,t)}function vy(e){const t=e.map((e=>e.id)),i=["companyId","IN",t];return i}async function by(e,t){const{currentCompanies:i}=e.rootState.auth,{data:a}=await yy(i,t);return a}async function wy(e,t,i){throw new Error("NOT IMPLEMENTED")}const Cy=Fe(by,wy);function Fy(){return{...be()}}const Ay={namespaced:!0,state:Fy(),mutations:{...Cy.mutations},actions:{...Cy.actions},getters:{...Cy.getters}};var ky,Sy=Ay;function Ey(e,t){return{fetchAll:async(i,a)=>{const{currentCompanies:n}=i.rootState.auth,{data:r}=await Go(n,e,a,{resolve:t,itemsPerPage:5e3});return r},fetchByIds:(e,t,i)=>
1{throw new Error("NOT IMPLEMENTED")}}}function Iy(e,t){const{fetchAll:i,fetchByIds:a}=Ey(e,t);return Fe(i,a)}function _y(){return{...be(),...Qo()}}function Dy(e,t){const i=Iy(e,t);return{namespaced:!0,state:_y(),mutations:{...i.mutations,...tl.mutations},actions:{...i.actions},getters:{...i.getters,...tl.getters}}}(function(e){e["shape"]="shape",e["isoXml"]="iso-xml"})(ky||(ky={}));var My,Py;(function(e){e["MINERAL_FERTILIZER"]="femi",e["COMPANY_FERTILIZER"]="feco",e["SECONDARY_FERTILIZER"]="fesec",e["HERBIZIDE"]="herb",e["CROP"]="crop",e["MISCELLANEOUS"]="misc",e["HARVEST"]="harvest",e["SEED"]="seed",e["OTHER_AUXILARY_PRODUCTS_AND_FERTILIZERS"]="feoa",e["WAAD"]="waad"})(My||(My={})),function(e){e["fieldSharing"]="fieldSharing"}(Py||(Py={}));var Ty=Py;const xy=Dy(My.COMPANY_FERTILIZER);var By=xy;async function Oy(e,t){const i=e.rootGetters["auth/currentProcessOrderIds"],{data:a}=await Ho(i,t);return a}async function $y(e,t,i){throw new Error("NOT IMPLEMENTED")}const Ry=Fe(Oy,$y),Ny={...Ry.actions};var zy=Ny;const Ly={...Ry.getters,...tl.getters};var Vy=Ly;const Uy={...Ry.mutations,...tl.mutations};var jy=Uy;function Hy(){return{...be(),...Qo()}}const Gy={namespaced:!0,state:Hy(),mutations:jy,actions:zy,getters:Vy};var Wy=Gy;const Zy=Dy(My.HARVEST);var Ky=Zy;const qy=Dy(My.HERBIZIDE,["pesticide"]);var Yy=qy;const Jy=Dy(My.MINERAL_FERTILIZER);var Xy=Jy;const Qy={...Xy.mutations,loadAll(e,{data:t}){e.data=t.reduce(((e,t)=>{const i={...t,storeStatus:V,n:0,p:0,k:0};Array.isArray(i.variants)&&i.variants.length>0&&null==i.variants[0].processOrderId&&null!=i.variants[0].ingredients&&Object.keys(i.variants[0].ingredients).forEach((e=>{i[e.toLowerCase()]=i.variants[0].ingredients[e].amount}));const a={...e,[t[R]]:i};return a}),{}),e.loaded=new Date}};var ev=Qy;const tv={namespaced:!0,state:_y(),mutations:ev,actions:{...Xy.actions},getters:{...Xy.getters}};var iv=tv;const av=Dy(My.MISCELLANEOUS);var nv=av;const rv=Dy(My.OTHER_AUXILARY_PRODUCTS_AND_FERTILIZERS);var sv=rv;const ov=Dy(My.SECONDARY_FERTILIZER);var lv=ov;const dv=Dy(My.SEED);var cv=dv;const uv=Dy(My.WAAD);var pv=uv;const hv={async subscribe({dispatch:e}){return Promise.all([e("companyFertilizers/subscribe"),e("crops/subscribe"),e("harvests/subscribe"),e("herbizides/subscribe"),e("mineralFertilizers/subscribe"),e("miscellaneous/subscribe"),e("otherProductsAndFertilizers/subscribe"),e("secondaryFertilizers/subscribe"),e("seeds/subscribe"),e("waads/subscribe")])},reset({dispatch:e}){e("companyFertilizers/reset"),e("crops/reset"),e("harvests/reset"),e("herbizides/reset"),e("mineralFertilizers/reset"),e("miscellaneous/reset"),e("otherProductsAndFertilizers/reset"),e("secondaryFertilizers/reset"),e("seeds/reset"),e("waads/reset")}};var mv=hv;function fv(e){return e.sort(((e,t)=>e.name>t.name?1:-1))}function gv(e){return e.sort(((e,t)=>e.name&&t.name?e.name>t.name?1:-1:0))}function yv(e,t){if(0===t.length)return[{items:e}];const i={},a=e=>{i[e.id]={name:e.name,id:e.id,items:[]}},n=e=>{i[e.categoryId].items.push(e)};e.forEach((e=>{if(!i[e.categoryId]){const i=t.find((t=>t.id===e.categoryId));i&&a(i)}n(e)}));const r=Object.values(i);return gv(r)}class vv{constructor(e,t){(0,tt.Z)(this,"product",void 0),(0,tt.Z)(this,"storagePlace",void 0),this.product=e,this.storagePlace=t}toData(){return{id:this.getId(),name:this.getName()}}getId(){const{product:e,storagePlace:t}=this,{id:i}=e;return t?`${i}_${t.id}`:i}getName(){const{product:e}=this,{name:t}=e,i=this.getPesticideNamePart(),a=this.getStorageNamePart();return`${t}${i}${a}`}getPesticideNamePart(){const{product:e}=this,{pesticide:t}=e;if(!t)return"";const{registerNr:i,registerAdd:a}=t;return null!=i&&null==a?` (${i})`:null!=i&&null!=a?` (${i}/${a})`:""}getStorageNamePart(){const{storagePlace:e}=this;if(!e)return"";const{name:t}=e;return t?` (${t})`:""}}class bv{static getDropdownItem(e,t){return new vv(e,t).toData()}}const wv={crops:e=>e.crops.data,mineralFertilizers:e=>e.mineralFertilizers.data,loading:(e,t)=>
1{const i=t["companyFertilizers/loading"]||t["crops/loading"]||t["harvests/loading"]||t["herbizides/loading"]||t["mineralFertilizers/loading"]||t["miscellaneous/loading"]||t["otherProductsAndFertilizers/loading"]||t["secondaryFertilizers/loading"]||t["seeds/loading"]||t["waads/loading"];return i},allProducts:e=>{const t=[...Object.values(e.companyFertilizers.data),...Object.values(e.crops.data),...Object.values(e.harvests.data),...Object.values(e.herbizides.data),...Object.values(e.mineralFertilizers.data),...Object.values(e.miscellaneous.data),...Object.values(e.otherProductsAndFertilizers.data),...Object.values(e.secondaryFertilizers.data),...Object.values(e.seeds.data),...Object.values(e.waads.data)];return t},findProductById:e=>t=>e.companyFertilizers.data[t]?e.companyFertilizers.data[t]:e.crops.data[t]?e.crops.data[t]:e.harvests.data[t]?e.harvests.data[t]:e.herbizides.data[t]?e.herbizides.data[t]:e.mineralFertilizers.data[t]?e.mineralFertilizers.data[t]:e.miscellaneous.data[t]?e.miscellaneous.data[t]:e.otherProductsAndFertilizers.data[t]?e.otherProductsAndFertilizers.data[t]:e.secondaryFertilizers.data[t]?e.secondaryFertilizers.data[t]:e.seeds.data[t]?e.seeds.data[t]:e.waads.data[t]?e.waads.data[t]:void 0,getProductById:(e,t)=>e=>{const i=t.findProductById(e);if(!i)throw new Error(`Product with id ${e} not found`);return i},findProductOfCompany:(e,t)=>(e,i)=>{const a=t.findProductById(e);if(!a||na(a))return;if(a.companyId===i)return a;const n=ea(a,t.allProducts),r=n.find((e=>e.companyId===i));return r},allProductsOfCategories:e=>t=>{const i=t.map((t=>{switch(t){case My.MINERAL_FERTILIZER:return Object.values(e.mineralFertilizers.data);case My.COMPANY_FERTILIZER:return Object.values(e.companyFertilizers.data);case My.SECONDARY_FERTILIZER:return Object.values(e.secondaryFertilizers.data);case My.HERBIZIDE:return Object.values(e.herbizides.data);case My.CROP:return Object.values(e.crops.data);case My.MISCELLANEOUS:return Object.values(e.miscellaneous.data);case My.HARVEST:return Object.values(e.harvests.data);case My.SEED:return Object.values(e.seeds.data);case My.OTHER_AUXILARY_PRODUCTS_AND_FERTILIZERS:return Object.values(e.otherProductsAndFertilizers.data);case My.WAAD:return Object.values(e.waads.data);default:throw new Error(`Unknown product category: ${t}`)}})),a=i.flat();return a},compatibleProducts:(e,t,i)=>(e,a,n,r,s,o)=>{let l=t.allProductsOfCategories(e.usableWorkingMeanCategories).filter((e=>qi(e,n))).filter((e=>!o||Yi(e,o,i.productCategories.data)));if(Ga(a)&&(l=l.filter((e=>Ji(e,a)))),!Ga(a)&&s.length>0){const e=t.storageProducts(l,s);e&&(l=[...l,...e])}const d=t.compatibleHerbizideProducts(l);return l=l.filter((e=>!d.find((t=>t.id===e.id)))),l=[...l,...d],l=l.filter((e=>{const t=ea(e,l);return Xi(e,t,a,r)})),fv(l)},compatibleProductsOfCategories:(e,t)=>(e,i,a,n,r,s)=>{const o=t.compatibleProducts(e,i,a,n,s),l=t.allProductsOfCategories(r).map((e=>e.id));return o.filter((e=>aa(e,l)))},favoriteProducts:(e,t)=>(e,i,a,n,r,s)=>{const o=e.type,l=o===My.SEED||o===My.HARVEST;if(!r||0===r.length||!l)return null;const d=t.compatibleProductsOfCategories(e,i,a,n,[o],s),c=r.map((e=>e.cropId)).filter(ka),u=d.filter((e=>ta(e,c)));return fv(u)},primaryProducts:(e,t)=>(e,i,a,n,r)=>{const s=e.type;if(!s)return null;const o=t.compatibleProductsOfCategories(e,i,a,n,[s],r);return fv(o)},primaryProductsToDropdownItems:(e,t)=>(e,i,a,n,r,s)=>{let o=t.primaryProducts(e,i,a,n,s);o=Qi(o);const l=e.type,d=r.find((e=>e.type===l));return l&&o&&o.length>0&&d?{name:d.name,id:d.id,items:o}:null},compatibleProductsToDropdownItems:(e,t)=>(e,i,a,n,r,s,o,l)=>{const d=[],c=t.compatibleProducts(e,i,a,n,o,l),u=Qi(c),p=t.favoriteProducts(e,i,a,n,s,o);if(p&&p.length>0){const e=Qi(p);d.push({name:b["default"].i18n.translate("Favoriten"),id:"favorites",items:e})}const h=t.primaryProductsToDropdownItems(e,i,a,n,r,o);h&&d.push(h);const m=u.filter((e=>ia(e,h?.id)));if(m.length>0){const e=yv(m,r);d.push(...e)}return d},dropdownItem:(e,t,i)=>(e,a)=>{const n=t.findProductById(e);if(!n)return null;const r=a?i.storagePlaces.data[a]:void 0,s=bv.getDropdownItem(n,r);return s},storageProducts:()=>(e,t)=>{if(!t||0===t.length||0===e.length)return[];const i=[];return t.forEach((t=>
1{!t.deleted&&t.products&&t.products.forEach((a=>{if(a.type===St.MutuallyDependent)return;const n=e.find((e=>e.id===a.productId));if(!n)return;const r={...n,id:`${a.productId}_${t.id}`,name:`${n?.name} (${t.name})`};i.push(r)}))})),i},compatibleHerbizideProducts:()=>e=>{if(0===e.length)return[];const t=[];return e.forEach((e=>{if(!e.pesticide)return;const{name:i}=new vv(e).toData(),a={...e,id:e.id,name:i};t.push(a)})),t},isCompanySpecificProduct:()=>e=>null!==e.companyId,getProductOrSibling:(e,t)=>(e,i)=>{const a=t.findProductById(e);if(!a)throw new Error(`Product with id ${e} not found`);if(!t.isCompanySpecificProduct(a))return a;const n=t.findProductOfCompany(e,i);if(!n)throw new Error(`Product of company with id ${e} not found`);return n},getActivityProductWithProductOrSibling:(e,t)=>(e,i,a)=>{const n=t.getProductOrSibling(i,a),r=Xe()(e);return r.productId=n.id,r},isHerbicide:(e,t)=>e=>{const i=t.findProductById(e),a=i?.pesticide?.functionId??"";return _h.includes(a)},isInsecticide:(e,t)=>e=>{const i=t.findProductById(e),a=i?.pesticide?.functionId??"";return Ih.includes(a)}};var Cv=wv;const Fv={namespaced:!0,state:{},actions:mv,getters:Cv,modules:{companyFertilizers:By,crops:Wy,harvests:Ky,herbizides:Yy,mineralFertilizers:iv,miscellaneous:nv,otherProductsAndFertilizers:sv,secondaryFertilizers:lv,seeds:cv,waads:pv}};var Av=Fv;const kv=kc("/admin/rest/region");var Sv={...kv};const Ev={companyFeatureVisible:e=>(t,i)=>null!=e.availableFeaturesByCompanyId[t]&&null!=e.availableFeaturesByCompanyId[t][i]&&!0===e.availableFeaturesByCompanyId[t][i].visible,companyFeatureEnabled:e=>(t,i)=>null!=e.availableFeaturesByCompanyId[t]&&null!=e.availableFeaturesByCompanyId[t][i]&&!0===e.availableFeaturesByCompanyId[t][i].enabled,companyFeatureReadonly:e=>(t,i)=>null!=e.availableFeaturesByCompanyId[t]&&null!=e.availableFeaturesByCompanyId[t][i]&&!0===e.availableFeaturesByCompanyId[t][i].readonly,currentCompaniesHaveFeatureVisible:(e,t,i)=>e=>i.auth.currentCompanies.length>0&&i.auth.currentCompanies.some((i=>t.companyFeatureVisible(i.id,e))),currentCompaniesHaveFeatureEnabled:(e,t,i)=>e=>i.auth.currentCompanies.length>0&&i.auth.currentCompanies.every((i=>t.companyFeatureEnabled(i.id,e))),currentCompaniesHaveFeaturesEnabled:(e,t,i)=>e=>i.auth.currentCompanies.length>0&&e.every((e=>t.currentCompaniesHaveFeatureEnabled(e))),currentCompaniesHaveFeatureReadonly:(e,t,i)=>e=>i.auth.currentCompanies.length>0&&i.auth.currentCompanies.some((i=>t.companyFeatureReadonly(i.id,e)))};var Iv=Ev;const _v={addFeaturesToCompany(e,{companyId:t,features:i}){let a={};null!=e.availableFeaturesByCompanyId[t]&&(a={...e.availableFeaturesByCompanyId[t]}
1),Object.keys(i).forEach((e=>{if(null==Hr[e]&&console.error(`availableFeatures: Invalid feature "${e}". Add the feature, including proper documentation, to availableFeatures.ts.`),"boolean"===typeof i[e])return console.error(`availableFeatures: Invalid feature type "${e}".`),void(a[e]={visible:i[e],enabled:i[e]});const t={...i[e]};Object.keys(t).forEach((i=>{null!=Wr[i]?"function"===typeof Wr[i].validator&&!1===Wr[i].validator(t[i])&&console.error(`availableFeatures: Invalid value for feature property "${i}" for feature "${e}". Allowed types see availableFeatures.ts.`):console.error(`availableFeatures: Unknown feature property "${i}" for feature "${e}".`)})),a[e]=t})),b["default"].set(e.availableFeaturesByCompanyId,t,a)}};var Dv=_v;function Mv(){return{availableFeaturesByCompanyId:{}}}const Pv={namespaced:!0,state:Mv(),mutations:Dv,getters:Iv};var Tv=Pv;async function xv(e,t){const{storagePlacesApi:i}=b["default"].prototype.$api,a={companyId:e.rootGetters["auth/currentCompanyIds"][0]},n=sr(i,"storagePlaceList",a,t);return n}async function Bv(e,t,i){const{storagePlacesApi:a}=b["default"].prototype.$api,{data:n}=await a.storagePlaceObjects({objectIds:e.join(",")},i);return n}const Ov=Fe(xv,Bv,[Hr.FEATURE_STOCK_MOVEMENT]);function $v(){return{...be()}}const Rv={namespaced:!0,state:$v(),mutations:{...Ov.mutations},actions:{...Ov.actions},getters:{...Ov.getters}};var Nv=Rv;function zv(){return{version:"2.0",status:"success",data:[]}}async function Lv(){throw new Error("not implemented yet!")}function Vv(e,t){return{...e,data:[{id:t,...e.data}]}}async function Uv(e){if(0===e.length)return zv();const{tracksApi:t}=b["default"].prototype.$api,i=e.map((e=>t.tracksGpsTrack({trackId:e}).then((e=>e.data)).then((t=>Vv(t,e))))),a=await Promise.all(i);return A(a)}
1const jv=Fe(Lv,Uv),Hv={...jv.actions};var Gv=Hv;const Wv={...jv.getters};var Zv=Wv;function Kv(){return{...be()}}const qv={...jv.mutations};var Yv=qv;const Jv={namespaced:!0,state:Kv(),mutations:Yv,actions:Gv,getters:Zv};var Xv=Jv;async function Qv(e,t={itemsPerPage:5e3}){const i=Oo(t);i.append("version","2.0");const a=`${To}/unit?${$o(i)}`;return l().get(a,e)}var eb=Qv;async function tb(e,t){const{data:i}=await eb(t);return i}async function ib(e,t,i){throw new Error("NOT IMPLEMENTED")}const ab=Fe(tb,ib),nb={...ab.actions};var rb=nb,sb=JSON.parse('{"3C52DB9A-6337-11E7-8CCD-08606E6810DA":{"waad":["BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA"],"crop":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"seed":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031FB3-01B8-11E7-BE5A-08606E6810DA","BE031CFC-01B8-11E7-BE5A-08606E6810DA","BE031C71-01B8-11E7-BE5A-08606E6810DA","BE032436-01B8-11E7-BE5A-08606E6810DA","BE0322E2-01B8-11E7-BE5A-08606E6810DA","C4F26B99-01C0-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"harvest":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"feco":["BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"],"femi":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA"],"herb":["BE0327F7-01B8-11E7-BE5A-08606E6810DA","C4F88F51-01C0-11E7-BE5A-08606E6810DA","BE032B24-01B8-11E7-BE5A-08606E6810DA","78FCE61F-2CD1-4EC7-8D2D-C650CB75DECA","C5152BA9-01C0-11E7-BE5A-08606E6810DA","BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","991452B6-7B41-11EA-9A08-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","BE03225E-01B8-11E7-BE5A-08606E6810DA","BE032A17-01B8-11E7-BE5A-08606E6810DA","933DB978-7B41-11EA-9A08-0242AC120002","C50A07FD-01C0-11E7-BE5A-08606E6810DA","BE03298F-01B8-11E7-BE5A-08606E6810DA","A1F31FA0-2845-4F40-859B-4AF130F5CB5E","C505C53F-01C0-11E7-BE5A-08606E6810DA","BE03290C-01B8-11E7-BE5A-08606E6810DA","42CE3104-9104-4B86-9DC7-B8626167A16B","C5017E17-01C0-11E7-BE5A-08606E6810DA","BE032881-01B8
1-11E7-BE5A-08606E6810DA","867E9D55-7157-4009-8713-3B81A355B992","C4FD33D3-01C0-11E7-BE5A-08606E6810DA","BE032A9D-01B8-11E7-BE5A-08606E6810DA","B23DE574-1910-45D4-8801-444CDFA33E54","C51087B0-01C0-11E7-BE5A-08606E6810DA","BE032BAA-01B8-11E7-BE5A-08606E6810DA","B2D7E615-4FED-468D-88FE-C96DD69845EB","C519DEE3-01C0-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA","F239374B-BBBF-46AC-8BF8-398BE697F54B","8540E252-F506-4465-94C0-E54E278853C6","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"fesec":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"]},"71C1454A-6337-11E7-8CCD-08606E6810DA":{"waad":["BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA"],"crop":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"seed":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031FB3-01B8-11E7-BE5A-08606E6810DA","BE031CFC-01B8-11E7-BE5A-08606E6810DA","BE031C71-01B8-11E7-BE5A-08606E6810DA","BE032436-01B8-11E7-BE5A-08606E6810DA","BE0322E2-01B8-11E7-BE5A-08606E6810DA","C4F26B99-01C0-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"harvest":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"feco":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","B7CC1482-BB20-11E8-8ED5-0242AC120003","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"],"femi":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA"],"herb":["BE0327F7-01B8-11E7-BE5A-08606E6810DA","C4F88F51-01C0-11E7-BE5A-08606E6810DA","BE032B24-01B8-11E7-BE5A-08606E6810DA","78FCE61F-2CD1-4EC7-8D2D-C650CB75DECA","C5152BA9-01C0-11E7-BE5A-08606E6810DA","BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","991452B6-7B41-11EA-9A08-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","BE03225E-01B8-11E7-BE5A-08606E6810DA","BE032A17-01B8-11E7-BE5A-08606E6810DA","933DB978-7B41-11EA-9A08-0242AC120002","C50A07FD-01C0-11E7-BE5A-08606E6810DA","BE03298F-01B8-11E7-BE5A-08606E6810DA","A1F31FA0-2845-4F40-859B-4AF130F5CB5E","C505C53F-01C0-11E7-BE5A-08606E6810DA","BE03290C-01B8-11E7-BE5A-08606E6810DA","42CE3104-9104-4B86-9DC7-B8626167A16B","C5017E17-01C0-11E7-BE5A-08606E6810DA","BE032881-01B8
1-11E7-BE5A-08606E6810DA","867E9D55-7157-4009-8713-3B81A355B992","C4FD33D3-01C0-11E7-BE5A-08606E6810DA","BE032A9D-01B8-11E7-BE5A-08606E6810DA","B23DE574-1910-45D4-8801-444CDFA33E54","C51087B0-01C0-11E7-BE5A-08606E6810DA","BE032BAA-01B8-11E7-BE5A-08606E6810DA","B2D7E615-4FED-468D-88FE-C96DD69845EB","C519DEE3-01C0-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA","F239374B-BBBF-46AC-8BF8-398BE697F54B","8540E252-F506-4465-94C0-E54E278853C6","1B39CA9A-7AB7-4405-AAE3-6E69776AE27F","CBB98F8A-43D8-426D-9F0A-70FB0CBE294A","5E234039-F52A-496B-A74D-F3ACA24E3843","705F1BB7-93E3-4C7B-ABAD-C3D48BC48228","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"feoa":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","BE03225E-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA"],"fesec":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"]},"CC35BF02-99FD-4096-909D-CA2B361C3F5F":{"crop":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"seed":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031FB3-01B8-11E7-BE5A-08606E6810DA","BE031CFC-01B8-11E7-BE5A-08606E6810DA","BE031C71-01B8-11E7-BE5A-08606E6810DA","BE032436-01B8-11E7-BE5A-08606E6810DA","BE0322E2-01B8-11E7-BE5A-08606E6810DA","C4F26B99-01C0-11E7-BE5A-08606E6810DA","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"harvest":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"feco":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","B7CC1482-BB20-11E8-8ED5-0242AC120003","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"],"femi":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA"],"herb":["BE0327F7-01B8-11E7-BE5A-08606E6810DA","C4F88F51-01C0-11E7-BE5A-08606E6810DA","BE032B24-01B8-11E7-BE5A-08606E6810DA","78FCE61F-2CD1-4EC7-8D2D-C650CB75DECA","C5152BA9-01C0-11E7-BE5A-08606E6810DA","BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","991452B6-7B41-11EA-9A08-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","BE03225E-01B8-11E7-BE5A-08606E6810DA","BE032A17-01B8-11E7-BE5A-08606E6810DA","933DB978-7B41-11EA-9A08-0242AC120002","C50A07FD-01C0-11E7-BE5A-08606E6810DA","BE03298F-01B8-11E7-BE5A-08606E6810DA","A1F31FA0-2845-4F40-859B-4AF130F5CB5E","C505C53F-01C0-11E7-BE5A-08606E6810DA","BE03290C-01B8-11E7-BE5A-08606E6810DA","42CE3104-9104-4B86-9DC7-B8626167A16B","C5017E17-01C0-11E7-BE5A-08606E6810DA","BE032881-01B8
1-11E7-BE5A-08606E6810DA","867E9D55-7157-4009-8713-3B81A355B992","C4FD33D3-01C0-11E7-BE5A-08606E6810DA","BE032A9D-01B8-11E7-BE5A-08606E6810DA","B23DE574-1910-45D4-8801-444CDFA33E54","C51087B0-01C0-11E7-BE5A-08606E6810DA","BE032BAA-01B8-11E7-BE5A-08606E6810DA","B2D7E615-4FED-468D-88FE-C96DD69845EB","C519DEE3-01C0-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA","F239374B-BBBF-46AC-8BF8-398BE697F54B","8540E252-F506-4465-94C0-E54E278853C6","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"fesec":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"]},"":{"waad":["BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA"],"crop":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"seed":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031FB3-01B8-11E7-BE5A-08606E6810DA","BE031CFC-01B8-11E7-BE5A-08606E6810DA","BE031C71-01B8-11E7-BE5A-08606E6810DA","BE032436-01B8-11E7-BE5A-08606E6810DA","BE0322E2-01B8-11E7-BE5A-08606E6810DA","C4F26B99-01C0-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"harvest":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002","FF42F070-729F-11EA-AA40-0242AC120002","659D671B-9062-11EA-BAE3-0242AC120002","0C20BCAC-72A0-11EA-AA40-0242AC120002","6DA301C6-9062-11EA-BAE3-0242AC120002"],"feco":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","B7CC1482-BB20-11E8-8ED5-0242AC120003","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"],"femi":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA"],"herb":["BE0327F7-01B8-11E7-BE5A-08606E6810DA","C4F88F51-01C0-11E7-BE5A-08606E6810DA","BE032B24-01B8-11E7-BE5A-08606E6810DA","78FCE61F-2CD1-4EC7-8D2D-C650CB75DECA","C5152BA9-01C0-11E7-BE5A-08606E6810DA","BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE03203B-01B8-11E7-BE5A-08606E6810DA","EDEB065A-40CC-11E9-A0C1-6B3CE8D881FE","991452B6-7B41-11EA-9A08-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE03276F-01B8-11E7-BE5A-08606E6810DA","BE0325D2-01B8-11E7-BE5A-08606E6810DA","BE03225E-01B8-11E7-BE5A-08606E6810DA","BE032A17-01B8-11E7-BE5A-08606E6810DA","933DB978-7B41-11EA-9A08-0242AC120002","C50A07FD-01C0-11E7-BE5A-08606E6810DA","BE03298F-01B8-11E7-BE5A-08606E6810DA","A1F31FA0-2845-4F40-859B-4AF130F5CB5E","C505C53F-01C0-11E7-BE5A-08606E6810DA","BE03290C-01B8-11E7-BE5A-08606E6810DA","42CE3104-9104-4B86-9DC7-B8626167A16B","C5017E17-01C0-11E7-BE5A-08606E6810DA","BE032881-01B8
1-11E7-BE5A-08606E6810DA","867E9D55-7157-4009-8713-3B81A355B992","C4FD33D3-01C0-11E7-BE5A-08606E6810DA","BE032A9D-01B8-11E7-BE5A-08606E6810DA","B23DE574-1910-45D4-8801-444CDFA33E54","C51087B0-01C0-11E7-BE5A-08606E6810DA","BE032BAA-01B8-11E7-BE5A-08606E6810DA","B2D7E615-4FED-468D-88FE-C96DD69845EB","C519DEE3-01C0-11E7-BE5A-08606E6810DA","FA7BF42C-592F-11E8-8541-000000000000","166DFC74-54E5-11E8-B791-000000000000","BE032CB7-01B8-11E7-BE5A-08606E6810DA","BE031BE4-01B8-11E7-BE5A-08606E6810DA","BE031B57-01B8-11E7-BE5A-08606E6810DA","BE0321D5-01B8-11E7-BE5A-08606E6810DA","BE03214D-01B8-11E7-BE5A-08606E6810DA","F239374B-BBBF-46AC-8BF8-398BE697F54B","8540E252-F506-4465-94C0-E54E278853C6","58674BDB-729F-11EA-AA40-0242AC120002","4BEFAA1D-9062-11EA-BAE3-0242AC120002"],"fesec":["BE031E19-01B8-11E7-BE5A-08606E6810DA","BE0324C3-01B8-11E7-BE5A-08606E6810DA","BE031D8B-01B8-11E7-BE5A-08606E6810DA","B7CC1482-BB20-11E8-8ED5-0242AC120003","0468E70C-BCCD-11E8-9F32-0242AC120002","77DB0580-BFBF-11E8-9C07-0242AC120002","BE0318CF-01B8-11E7-BE5A-08606E6810DA","BE03254D-01B8-11E7-BE5A-08606E6810DA","BE03171E-01B8-11E7-BE5A-08606E6810DA","BE031AAE-01B8-11E7-BE5A-08606E6810DA","BE0320C3-01B8-11E7-BE5A-08606E6810DA","BE03199B-01B8-11E7-BE5A-08606E6810DA"]}}');function ob(e,t){return e.groupId===t}function lb(e){return null!==e.byUnitId&&!e.isPerLoad}function db(e,t,i){const a=sb,n=i.map((e=>a[e.regionId][t]));return n.flat().includes(e.id)}const cb={...ab.getters,allUnits:e=>Object.values(e.data),compatibleUnits:(e,t)=>(e,i,a)=>{const n=t.allUnits.filter((t=>ob(t,e))).filter((e=>db(e,a,i))).filter((e=>lb(e)));return n}};var ub=cb;function pb(){return{...be()}}const hb={...ab.mutations};var mb=hb;const fb={namespaced:!0,state:pb(),mutations:mb,actions:rb,getters:ub};var gb=fb;async function yb(e,t){const i=e.rootGetters["auth/currentCompanyIds"],a=["companyId","IN",i],n=["user"],{data:r}=await l().get(`/admin/rest/companyUser?version=2.0&disablePagination=1&filter=${Ro(a)}&resolve=${Ro(n)}`,t),s=Cb(r.data),o={...r,data:s};return o}async function vb(e,t,i){throw new Error("API NOT AVAILABLE")}const bb=Fe(yb,vb);var wb=bb;function Cb(e){if(!e)return[];const t=e.map((e=>{const{user:t}=e;return t}));return t}function Fb(){return{...be()}}const Ab={namespaced:!0,state:Fb(),mutations:{...wb.mutations},actions:{...wb.actions},getters:{...wb.getters}};var kb=Ab;async function Sb(e,t){const i=e.rootGetters["auth/currentCompanyIds"],a=e.rootState.auth.currentCompanies.map((e=>e.regionId)),{plantVarietiesApi:n}=b["default"].prototype.$api,r=await Promise.all(i.map((e=>{const i={companyId:e,deleted:!1};return sr(n,"plantVarietyList",i,t)}))),s=await Promise.all(a.map((e=>{const i={regionId:e,deleted:!1};return sr(n,"plantVarietyList",i,t)}))),o=r.concat(s),l=A(o);return l}async function Eb(e,t,i){const{plantVarietiesApi:a}=b["default"].prototype.$api,{data:n}=await a.plantVarietyObjects({objectIds:e.join(",")},i);return n}const Ib=Fe(Sb,Eb),_b={...Ib.actions,...tl.actions};var Db=_b;const Mb={...Ib.getters,...tl.getters};var Pb=Mb;const Tb={...Ib.mutations,...tl.mutations};var xb=Tb;function Bb(){return{...be(),...Qo()}}const Ob={namespaced:!0,state:Bb(),mutations:xb,actions:Db,getters:Pb};var $b=Ob;b["default"].use(C.ZP);const Rb=["cs","de","en","hu","sk","sl"];function Nb(){let e="en-US";return navigator.languages.some((t=>!!Rb.includes(t.substring(0,2))&&(e=t,!0))),{locale:e,fetchingTranslation:!1,navbar:{expanded:null!=jl(ne)&&jl(ne)},redirectingToAgriDat:!1}}const zb=new C.ZP.Store({state:Nb(),mutations:{afterResetData(){},startFetchingTranslation(e){b["default"].set(e,"fetchingTranslation",!0)},finishFetchingTranslation(e){b["default"].set(e,"fetchingTranslation",!1)},selectLocale(e,t){b["default"].set(e,"locale",t)},toggleNavbar(e){Ul(ne,!e.navbar.expanded),b["default"].set(e.navbar,"expanded",!e.navbar.expanded)},redirectToAgriDat(e){b["default"].set(e,"redirectingToAgriDat",!0)}},actions:{async checkLocale({state:e,dispatch:t}){t("selectLocale",e.locale)},async selectLocale({commit:e,state:t},a){e("selectLocale",a);const n=a.includes("-")?a.substring(0,2):a;if(Object.keys(t.i18n.translations).includes(n))return;let r=null;switch(e("startFetchingTranslation"),n){case"cs":r=await i.e(836).then(i.bind(i,52743));break;case"hu":r=await i.e(982).then(i.bind(i,5806));break;case"sk":r=await i.e(533).then(i.bind(i,89563));break;case"sl":r=await i.e(405).then(i.bind(i,84657));break;case"xjs":r=await i.e(244).then(i.bind(i,23698));break;default:break}e("finishFetchingTranslation"),null!=r&&"function"===typeof r.default&&b["default"].i18n.replace(n,r.default())},resetData({dispatch:e,commit:t}){e("activityTypes/reset"),e("activityTypesRough/reset"),e("activities/reset"),e("activities/gpsTrack/reset"),e("activities/gpsLog/reset"),e("activities/ruleCheck/rules/reset"),e("activities/ruleCheck/activityRuleViolations/reset"),e("activities/sharedActivities/reset"),e("activities/importActivities/reset"),e("equipments/reset"),e("sharedActivityTypes/reset"),e("customers/reset"),e("fieldGroups/reset"),e("fields/reset"),e("sharedFields/reset"),e("products/reset"),e("productVisibilities/reset"),e("pesticideIndications/reset"),e("notes/reset"),e("sharedNotes/reset"),e("varieties/reset"),e("digitalContracting/reset"),e("managedContracts/reset"),e("pests/reset"),e("pesticideIndications/reset"),e("precisionFarming/applicationMaps/resetAll"),e("precisionFarming/monitoring/reset"),e("productCategories/reset"),e("storagePlaces/reset"),e("users/reset"),e("geoObjects/reset"),e("tracks/reset"),e("datura/history/reset"),e("datura/assessments/reset"),t("afterResetData")}},modules:{activities:Po,activityTypes:ll,sharedActivityTypes:Tl,activityTypesRough:wl,auth:_d,users:kb,customers:Od,digitalContracting:Qc,equipments:lu,features:Tv,fieldGroups:_u,fields:mp,sharedFields:qu,managedContracts:Yc,notes:jp,sharedNotes:Np,notifications:Qp,precisionFarming:ly,pests:Ch,pesticideIndications:mh,products:Av,productVisibilities:Sy,productCategories:gy,regions:Sv,satellite:Tp,units:gb,varieties:$b,storagePlaces:Nv,geoObjects:Mp,tracks:Xv,datura:Cc},getters:{locale:e=>e.locale,satellite:e=>e.satellite,datepickerTranslation:e=>{let t="en";return Rb.some((i=>!!e.locale.includes(i)&&(t=i,!0))),Rd[t]},activityTypes:e=>e.activityTypes.data,customers:e=>e.customers.data,fields:e=>e.fields.data,varieties:e=>e.varieties.data,companyFeatureVisible:(e,t)=>
1(e,i)=>t["features/companyFeatureVisible"](e,i),companyFeatureEnabled:(e,t)=>(e,i)=>t["features/companyFeatureEnabled"](e,i),companyFeatureReadonly:(e,t)=>(e,i)=>t["features/companyFeatureEnabled"](e,i),currentCompaniesHaveFeatureVisible:(e,t)=>e=>t["features/currentCompaniesHaveFeatureVisible"](e),currentCompaniesHaveFeatureEnabled:(e,t)=>e=>t["features/currentCompaniesHaveFeatureEnabled"](e),currentCompaniesHaveFeatureReadonly:(e,t)=>e=>t["features/currentCompaniesHaveFeatureReadonly"](e),currentCompaniesHaveFeature:(e,t)=>e=>({visible:t["features/currentCompaniesHaveFeatureVisible"](e),enabled:t["features/currentCompaniesHaveFeatureEnabled"](e),readonly:t["features/currentCompaniesHaveFeatureReadonly"](e)})}});var Lb=zb;const Vb=()=>zb;function Ub(){return{"":"","#FEHLER":"#FEHLER","(Alle auswählen)":"(Alle auswählen)","(leer)":"(leer)","(verschiedene)":"(verschiedene)","1 Feld mit Erntemaßnahme":"1 Feld mit Erntemaßnahme","1 Feld ohne Erntemaßnahme":"1 Feld ohne Erntemaßnahme","1 Fläche ({area} ha) an {partner} gesendet.":"1 Fläche ({area} ha) an {partner} gesendet.","404: Nicht gefunden.":"404: Nicht gefunden.","<Bezeichnung>":"<Bezeichnung>","<strong>Lege die Datei hier ab</strong> <small>oder drücke hier, um eine Datei hinzuzufügen.</small>":"<strong>Lege die Datei hier ab</strong> <small>oder drücke hier, um eine Datei hinzuzufügen.</small>","AGRANA FSNr - Feldname":"AGRANA FSNr - Feldname","AMA Code":"AMA Code","AMA Code in der Datenquelle (aus dem Import)":"AMA Code in der Datenquelle (aus dem Import)","AMA Codes":"AMA Codes",Anonym:"Anonym",Abbrechen:"Abbrechen",Abgeschlossen:"Abgeschlossen",Ablaufdatum:"Ablaufdatum","Ablaufdatum:":"Ablaufdatum:",Abmelden:"Abmelden","Abschließen":"Abschließen",Absenden:"Absenden","Abstand prüfen":"Abstand prüfen",Achtung:"Achtung","Die Saatstärke ist in einer oder mehreren Zonen beträchtlich {comparative} als üblich.":"Die Saatstärke ist in einer oder mehreren Zonen beträchtlich {comparative} als üblich.","Achtung! Beim Verlassen der Seite wird das Hochladen abgebrochen!":"Achtung! Beim Verlassen der Seite wird das Hochladen abgebrochen!",Ackerkulturen:"Ackerkulturen",Adresse:"Adresse","Adresse suchen":"Adresse suchen","Aktion sicher ausführen?":"Aktion sicher ausführen?",Aktionsgebiet:"Aktionsgebiet",Aktiv:"Aktiv","Aktiv setzen":"Aktiv setzen","Aktiviere deinen sicheren Zugang!":"Aktiviere deinen sicheren Zugang!","Aktiviere den Schalter, um Unterebenen in der Karte anzuzeigen.":"Aktiviere den Schalter, um Unterebenen in der Karte anzuzeigen.",Aktivieren:"Aktivieren","Aktivität konnte nicht importiert werden. Fehler: ":"Aktivität konnte nicht importiert werden. Fehler: ","Aktualisiere den in der Arbeitsplanung geplanten Auftrag und füge die eben erstellte Applikationskarte hinzu.":"Aktualisiere den in der Arbeitsplanung geplanten Auftrag und füge die eben erstellte Applikationskarte hinzu.","Aktuell unterstützt FARMDOK Applikationskarten nur für Mineraldüngung.":"Aktuell unterstützt FARMDOK Applikationskarten nur für Mineraldüngung.","Aktuell:":"Aktuell:",Alle:"Alle","Alle ausblenden":"Alle ausblenden","Alle Dateien entfernen":"Alle Dateien entfernen","Alle Einträge":"Alle Einträge","Alle Farmen":"Alle Farmen","Alle Felder":"Alle Felder","Alle Werte in kg/ha":"Alle Werte in kg/ha","Alle Werte in Körner/m^2":"Alle Werte in Körner/m²","Alle Werte in Körner/ha":"Alle Werte in Körner/ha","Alle anzeigen":"Alle anzeigen","Alle auswählen":"Alle auswählen","Alle wählen":"Alle wählen","Alle ausgewählten Polygone werden zu einem vereint. Willst du fortsetzen?":"Alle ausgewählten Polygone werden zu einem vereint. Willst du fortsetzen?","Allgemeinen Geschäftsbedingungen (AGB)":"Allgemeinen Geschäftsbedingungen (AGB)","Als Excel-Datei exportieren":"Als Excel-Datei exportieren","An angegebene Betriebe zum Lesen freigegeben.":"An angegebene Betriebe zum Lesen freigegeben.","An diesem Datum wurde das Satellitenbild aufgenommen. Alle 5 Tage passiert der Satellit die gleiche Stelle. Bedingt durch Wolken und Wetter ist nicht jedes Bild verwendbar.":"An diesem Datum wurde das Satellitenbild aufgenommen. Alle 5 Tage passiert der Satellit die gleiche Stelle. Bedingt durch Wolken und Wetter ist nicht jedes Bild verwendbar.",Anbau:"Anbau",Anbauplanung:"Anbauplanung",Andere:"Andere","Andere Tätigkeiten":"Andere Tätigkeiten","Angezeigt: {visible} von {total}":"Angezeigt: {visible} von {total}","Anleitung: Woher bekomme ich eine Datei mit meinen Feldern?":"Anleitung: Woher bekomme ich eine Datei mit meinen Feldern?","Anleitung: Woher bekomme ich eine ISOXML Datei mit meinen Maßnahmen?":"Anleitung: Woher bekomme ich eine ISOXML Datei mit meinen Maßnahmen?","Anleitung: Die KI-unterstützte Auswertung von Drohnenbilder ermöglicht es Stechapfelpflanzen im Soja zu erkennen und geolokalisiert in einer Karte zu kennzeichnen. Woher bekomme ich geeignete Drohnenbilder für diese Auswertung?":"Anleitung: Die KI-unterstützte Auswertung von Drohnenbilder ermöglicht es Stechapfelpflanzen im Soja zu erkennen und geolokalisiert in einer Karte zu kennzeichnen. Woher bekomme ich geeignete Drohnenbilder für diese Auswertung?","Anleitung: Der Umfang au
1szuwertender Bilddaten kann sehr groß sein. Es können Einzelbilder, eine .zip-Datei mit Bildern oder ein Order mit Bildern hochgeladen werden. Bei großen Datenmengen oder schlechter Internetverbindung kann das Hochladen mehrere Stunden dauern. Achtung: Die Benennung der Dateien muss eindeutig sein. Duplikate überschreiben das Original.":"Anleitung: Der Umfang auszuwertender Bilddaten kann sehr groß sein. Es können Einzelbilder, eine .zip-Datei mit Bildern oder ein Order mit Bildern hochgeladen werden. Bei großen Datenmengen oder schlechter Internetverbindung kann das Hochladen mehrere Stunden dauern. Achtung: Die Benennung der Dateien muss eindeutig sein. Duplikate überschreiben das Original.",Ansehen:"Ansehen",Antrag:"Antrag","Anwendungszeitpunkt:":"Anwendungszeitpunkt:","Anzahl Einträge: {total}":"Anzahl Einträge: {total}","Anzahl der Tasks auf der CNH-Plattform:":"Anzahl der Tasks auf der CNH-Plattform:","Anzahl der Zonen:":"Anzahl der Zonen:","Anzahl Felder":"Anzahl Felder","Anzahl Packungen":"Anzahl Packungen","Anzahl Bilder":"Anzahl Bilder",Anzeige:"Anzeige",Anzeigen:"Anzeigen","Anzeige der Unterebenen von Isolationszonen":"Anzeige der Unterebenen von Isolationszonen","Applikationskarte an John Deere senden":"Applikationskarte an John Deere senden","Applikationskarte erstellen":"Applikationskarte erstellen","Applikationskarte senden an ...":"Applikationskarte senden an ...",Applikationskarte:"Applikationskarte",Applikationskarten:"Applikationskarten","Applikationskarten für Ausgleichs- oder Qualitätsdüngung. Zonierung mittels Satelliten oder importierten Daten.":"Applikationskarten für Ausgleichs- oder Qualitätsdüngung. Zonierung mittels Satelliten oder importierten Daten.","Applikationskarten für Ausgleichs- oder Qualitätsdüngung von Getreide. Ein Projekt von Josephinum Research.":"Applikationskarten für Ausgleichs- oder Qualitätsdüngung von Getreide. Ein Projekt von Josephinum Research.","Applikationskarten für die variable Ausbringung von Wachstumsregler und Fungiziden auf Basis von Satellitendaten.":"Applikationskarten für die variable Ausbringung von Wachstumsregler und Fungiziden auf Basis von Satellitendaten.","Applikationskarten für Saatbau Soja Aussaat.":"Applikationskarten für Saatbau Soja Aussaat.","Applikationskarten für Saatbau Mais Aussaat.":"Applikationskarten für Saatbau Mais Aussaat.",Arbeitsplanung:"Arbeitsplanung",Arbeitszeit:"Arbeitszeit","Archiv editieren":"Archiv editieren",Archivieren:"Archivieren",Archiviert:"Archiviert","Archivierte ausblenden":"Archivierte ausblenden","Archivierte einblenden":"Archivierte einblenden",'Auf diesem Feld wurde bereits eine Erntemaßnahme für das Erntejahr {current} gebucht. Schließe das Erntejahr für das Feld jetzt ab, es wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Auf diesem Feld wurde bereits eine Erntemaßnahme für das Erntejahr {current} gebucht. Schließe das Erntejahr für das Feld jetzt ab, es wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.','Auf diesen Feldern wurden bereits Erntemaßnahmen für das Erntejahr {current} gebucht. Schließe das Erntejahr für die Felder jetzt ab, sie werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Auf diesen Feldern wurden bereits Erntemaßnahmen für das Erntejahr {current} gebucht. Schließe das Erntejahr für die Felder jetzt ab, sie werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',"Auf welches Feld sollen bereits gebuchte Maßnahmen übernommen werden?":"Auf welches Feld sollen bereits gebuchte Maßnahmen übernommen werden?",Aufteilen:"Aufteilen","Aufteilen beenden":"Aufteilen beenden","Aufteilen eines Polygons":"Aufteilen eines Polygons",Auftrag:"Auftrag","Auftrag aktualisieren":"Auftrag aktualisieren","Auftrag erstellen":"Auftrag erstellen","Auftrag planen":"Auftrag planen","Auftrag/Applikationskarte":"Auftrag/Applikationskarte",Auftragsnummer:"Auftragsnummer","Aufzeichnungspflichten erfüllen":"Aufzeichnungspflichten erfüllen","Aus importierter Datei.":"Aus importierter Datei.","Ausgewählt: {selected} von {total}":"Ausgewählt: {selected} von {total}","Ausgewählte Felder in ein anderes Erntejahr verschieben":"Ausgewählte Felder in ein anderes Erntejahr verschieben","Ausgewählte Maßnahmen in ein anderes Erntejahr oder in eine andere Farm verschieben":"Ausgewählte Maßnahmen in ein anderes Erntejahr oder in eine andere Farm verschieben","Ausgleichsdüngung (1. Gabe)":"Ausgleichsdüngung (1. Gabe)",Aussaat:"Aussaat",AUSSAAT:"AUSSAAT","Auswahl aufheben":"Auswahl aufheben","Auswahl exportieren":"Auswahl exportieren","Auswahl umkehren":"Auswahl umkehren",Auswertung:"Auswertung",B:"B","Basissaatstärke":"Basissaatstärke",Basistemperatur:"Basistemperatur","Basistemperatur ist relevant für die Wärmesumme. Es wird angenommen, dass unter ihr kein Wachstum stattfindet.":"Basistemperatur ist relevant für die Wärmesumme. Es wird angenommen, dass unter ihr kein Wachstum stattfindet.","BMMY - Mehrjährige Biomasse (3 Jahre)":"BMMY - Mehrjährige Biomasse (3 Jahre)",Bearbeiten:"Bearbeiten","Bearbeitete Fläche":"Bearbeitete Fläche",Bedarf:"Bedarf","Begrünung":"Begrünung","Begrünung (Zwischenfrucht)":"Begrünung (Zwischenfrucht)","Behalte diese Option bei den folgenden Konflikten bei":"Behalte diese Option bei den folgenden Konflikten bei","Bei Wintergetreide wird für die 2. Gabe eine konstante Düngermenge empfohlen. Wurde die erste Gabe nicht mittels Applikationskarte ausgleichend gedüngt, so kann für die 2. Gabe der Berechnungsvorschlag der erste Gabe angewendet werden.":"Bei Wintergetreide wird für die 2. Gabe eine konstante Düngermenge empfohlen. Wurde die erste Gabe nicht mittels Applikationskarte ausgleichend gedüngt, so kann für die 2. Gabe der Berechnungsvorschlag der erste Gabe angewendet werden.","Beim Laden der Wetterdaten ist ein Fehler aufgetreten.":"Beim Laden der Wetterdaten ist ein Fehler aufgetreten.","Beistrich-getrennt":"Beistrich-getrennt","Bekannt, unter anderem dafür in Google Earth angezeigt zu werden":"Bekannt, unter anderem dafür in Google Earth angezeigt zu werden",Bemerkung:"Bemerkung",Benachrichtigungen:"Benachrichtigungen",Benutzer:"Benutzer","Benutzername oder Passwort ungültig.":"Benutzername oder Passwort ungültig.","Berater-Tipp":"Berater-Tipp","Berater-Tipp: Hast du Verluste durch mechanische Pflege, Wild oder ähnliche Einflüsse berücksichtigt?":"Berater-Tipp: Hast du Verluste durch mechanische Pflege, Wild oder ähnliche Einflüsse berücksichtigt?","Berechnen ...":"Berechnen ...","Berechne einen Vorschlag für ...":"Berechne einen Vorschlag für ...",Berichte:"Berichte","Bericht erstellen":"Bericht erstellen",Beschreibung:"Beschreibung","BBCH Beschreibung":"BBCH Beschreibung","Beschränkungen bei der Ernte:":"Beschränkungen bei der Ernte:","Beschränkungen für Schädlinge:":"Beschränkungen für Schädlinge:",Betrieb:"Betrieb","Betrieb erstellen":"Betrieb erstellen","Betrieb fehlt.":"Betrieb fehlt.","Betrieb wählen":"Betrieb wählen",Betriebe:"Betriebe",Betriebsbezeichnung:"Betriebsbezeichnung",Betriebsmittel:"Betriebsmittel",Betriebsmittelkategorien:"Betriebsmittelkategorien",Betriebsname:"Betriebsname",Betriebsnummer:"Betriebsnummer","Betriebsnummer des Sender-Betriebs":"Betriebsnummer des Sender-Betriebs",Bezeichnung:"Bezeichnung","Bezeichnung fehlt.":"Bezeichnung fehlt.","Bezeichnung für Feld {number} fehlt.":"Bezeichnung für Feld {number} fehlt.",Bilder:"Bilder",Biologisch:"Biologisch",'Bitte achte darauf, die gleiche E-Mail-Adresse wie in der FARMDOK App am Smartphone oder Tablet zu verwenden. Du findest die E-Mail-Adresse in der FARMDOK App im Menüpunkt "Mehr".':'Bitte achte darauf, die gleiche E-Mail-Adresse wie in der FARMDOK App am Smartphone oder Tablet zu verwenden. Du findest die E-Mail-Adresse in der FARMDOK App im Menüpunkt "Mehr".',"Bitte beachte das Risiko von Resistenzbildung bei zu geringen Ausbringmengen von Insektiziden.":"Bitte beachte das Risiko von Resistenzbildung bei zu geringen Ausbringmengen von Insektiziden.","Bitte beachte die Risiken von Resistenzbildung und abgeschwächter oder ausbleibender Wirkung bei zu geringen Ausbringmengen von Herbiziden.":"Bitte beachte die Risiken von Resistenzbildung und abgeschwächter oder ausbleibender Wirkung bei zu geringen Ausbringmengen von Herbiziden.","Bitte wähle eine Option und klicke auf Weiter.":"Bitte wähle eine Option und klicke auf Weiter.","Bitte wähle einen Eintrag aus.":"Bitte wähle einen Eintrag aus.","Bitte wähle wie Duplikate behandelt werden sollen.":"Bitte wähle wie Duplikate behandelt werden sollen.","Bitte überprüfe deine E-Mails":"Bitte überprüfe deine E-Mails","Bitte überprüfe deine E-Mails!":"Bitte überprüfe deine E-Mails!","Bitte wähle ein Feld aus, bevor du fortfährst."
1:"Bitte wähle ein Feld aus, bevor du fortfährst.","Bitte wähle ein Produkt und eine Produktmenge aus, bevor du fortfährst.":"Bitte wähle ein Produkt und eine Produktmenge aus, bevor du fortfährst.","Bitte wähle eine Sorte aus, bevor du fortfährst.":"Bitte wähle eine Sorte aus, bevor du fortfährst.","Bitte beachte die technischen Möglichkeiten deiner Feldspritze. Prüfe ob deine Feldspritze in der Lage ist die festgelegte Menge Spritzbrühe auszubringen.":"Bitte beachte die technischen Möglichkeiten deiner Feldspritze. Prüfe ob deine Feldspritze in der Lage ist die festgelegte Menge Spritzbrühe auszubringen.",Bodenproben:"Bodenproben","Bodenproben teilen":"Bodenproben teilen",Bodenfeuchtigkeit:"Bodenfeuchtigkeit",Bodentemperatur:"Bodentemperatur",Ca:"Ca","Ca-Klasse":"Ca-Klasse",Christbaumkulturen:"Christbaumkulturen",Chronologisch:"Chronologisch","CIre - Chlorophyll":"CIre - Chlorophyll","CNH CONNECT Plattform":"CNH CONNECT Plattform","Dabei werden {count} bestehende Felder verändert.":"Dabei werden {count} bestehende Felder verändert.","Dabei wird ein bestehendes Feld verändert.":"Dabei wird ein bestehendes Feld verändert.","Danke, dass Du Dich bei Farmdok registriert hast! Deine E-Mail {email} ist jetzt bestätigt. Klicke auf Weiter und danach helfen wir Dir beim Einstieg.":"Danke, dass Du Dich bei Farmdok registriert hast! Deine E-Mail {email} ist jetzt bestätigt. Klicke auf Weiter und danach helfen wir Dir beim Einstieg.",Darstellung:"Darstellung","Das Abrufen der Maschinenliste von John Deere fehlgeschlagen.":"Das Abrufen der Maschinenliste von John Deere fehlgeschlagen.",'Die Karte auf der rechten Seite zeigt den bedruckbaren Bereich. Du kannst eine Legende erstellen und sie irgendwo im druckbaren Bereich platzieren. Die Legende wird auf der Grundlage der Kulturen erstellt (Du kannst dies mit der Einstellung "Einfärben nach..." im Menü ändern).':'Die Karte auf der rechten Seite zeigt den bedruckbaren Bereich. Du kannst eine Legende erstellen und sie irgendwo im druckbaren Bereich platzieren. Die Legende wird auf der Grundlage der Kulturen erstellt (Du kannst dies mit der Einstellung "Einfärben nach..." im Menü ändern).',"Die zulässige Größe für ausstehende Uploads wurde überschritten. Limit wird in ca. 1 Woche automatisch zurückgesetzt.":"Die zulässige Größe für ausstehende Uploads wurde überschritten. Limit wird in ca. 1 Woche automatisch zurückgesetzt.","Die Variation von Ausbringmengen bei der Applikation von Herbiziden birgt das Risiko, dass der Schaderreger nicht effektiv bekämpft wird. Die variable Ausbringung von Herbiziden wir nicht empfohlen.":"Die Variation von Ausbringmengen bei der Applikation von Herbiziden birgt das Risiko, dass der Schaderreger nicht effektiv bekämpft wird. Die variable Ausbringung von Herbiziden wir nicht empfohlen.","Die Variation von Ausbringmengen bei der Applikation von Insektiziden birgt hohes Risiko der Bildung von Resistenzen. Die variable Ausbringung von Insektiziden wird nicht empfohlen.":"Die Variation von Ausbringmengen bei der Applikation von Insektiziden birgt hohes Risiko der Bildung von Resistenzen. Die variable Ausbringung von Insektiziden wird nicht empfohlen.","Das Erntejahr {current} für die ausgewählten Felder befindet sich in Planung.":"Das Erntejahr {current} für die ausgewählten Felder befindet sich in Planung.","Das Erntejahr {current} für dieses Feld befindet sich in Planung.":"Das Erntejahr {current} für dieses Feld befindet sich in Planung.","Das Erntejahr {newYear} wurde hinzugefügt.":"Das Erntejahr {newYear} wurde hinzugefügt.","Das Feld besitzt keine Kontur":"Das Feld besitzt keine Kontur","Das Feld der folgenden Maßnahme konnte im Ziel nicht gefunden werden.":"Das Feld der folgenden Maßnahme konnte im Ziel nicht gefunden werden.","Das Feld konnte nicht wieder hergestellt werden.":"Das Feld konnte nicht wieder hergestellt werden.","Das Feld wird derzeit im angezeigten Erntejahr {current} bewirtschaftet.":"Das Feld wird derzeit im angezeigten Erntejahr {current} bewirtschaftet.","Das Feld wurde erfolgreich geteilt.":"Das Feld wurde erfolgreich geteilt.","Das gewählte Feld existiert bereits am Ziel. Wähle wie dieses Feld behandelt werden soll.":"Das gewählte Feld existiert bereits am Ziel. Wähle wie dieses Feld behandelt werden soll.","Das manuelle Mapping für Werte dieser Datenquelle wird zurückgesetzt in den Originalzustand.":"Das manuelle Mapping für Werte dieser Datenquelle wird zurückgesetzt in den Originalzustand.","Das Startdatum ist standardmäßig das Aussaatdatum der Maßnahme oder alternativ der Jahresbeginn. Es ist relevant für die Wärmesumme und die Niederschlagssumme.":"Das Startdatum ist standardmäßig das Aussaatdatum der Maßnahme oder alternativ der Jahresbeginn. Es ist relevant für die Wärmesumme und die Niederschlagssumme.","Datei hochladen":"Datei hochladen",Dateien:"Dateien","Datei herunterladen":"Datei herunterladen","Dateien hochladen":"Dateien hochladen","Datei wird hochgeladen":"Datei wird hochgeladen","Dateien erfolgreich an John Deere gesendet.":"Dateien erfolgreich an John Deere gesendet.",Dateiformat:"Dateiformat",Dateiname:"Dateiname","Datei-Import":"Datei-Import","Dateien hochladen und mit einem Link mit anderen teilen":"Dateien hochladen und mit einem Link mit anderen teilen","Dateien werden für den Maßnahmenimport nicht unterstützt.":"Dateien werden für den Maßnahmenimport nicht unterstützt.",Dateityp:"Dateityp",Daten:"Daten","Daten werden importiert...":"Daten werden importiert...","Daten Ursprung":"Daten Ursprung","Daten in FARMDOK zuordnen.":"Daten in FARMDOK zuordnen.","Daten laden":"Daten laden","Daten-Vorschau":"Daten-Vorschau",Datenquelle:"Datenquelle",Datum:"Datum","Datum an dem die Freigabe verfällt":"Datum an dem die Freigabe verfällt","Datum an dem die Datei hochgeladen wurde":"Datum an dem die Datei hochgeladen wurde","Datum bis":"Datum bis","Datum von":"Datum von","Deaktiviere das Kontrollkästchen um Spalten zu verstecken. Zum Ändern der Spaltenreihenfolge in der Tabelle klicke auf das Feld und ziehe es an die gewünschte Stelle.":"Deaktiviere das Kontrollkästchen um Spalten zu verstecken. Zum Ändern der Spaltenreihenfolge in der Tabelle klicke auf das Feld und ziehe es an die gewünschte Stelle.","Ändere Dezimalstellen von Zahlen.":"Ändere Dezimalstellen von Zahlen.","Dein Betrieb wurde erfolgreich erstellt.":"Dein Betrieb wurde erfolgreich erstellt.","Dein Partner hat Felder für diesen Vertrag bereitgestellt. Dein Partner kann die Felder jederzeit aktualisieren.":"Dein Partner hat Felder für diesen Vertrag bereitgestellt. Dein Partner kann die Felder jederzeit aktualisieren.","Dein Passwort wurde erfolgreich gespeichert.":"Dein Passwort wurde erfolgreich gespeichert.","Dein Profil wird für dich angepasst!":"Dein Profil wird für dich angepasst!","Deine Auswahl enthält Felder mit abgeschlossener Kontrahierung. Ändere den Partner-Status, um die Einträge zu löschen.":"Deine Auswahl enthält Felder mit abgeschlossener Kontrahierung. Ändere den Partner-Status, um die Einträge zu löschen.","Deine E-Mail ist bestätigt.":"Deine E-Mail ist bestätigt.","Deine Maschinen in MyJohnDeere.com":"Deine Maschinen in MyJohnDeere.com","Deine Organisationen in MyJohnDeere":"Deine Organisationen in MyJohnDeere","Demnächst verfügbar":"Demnächst verfügbar","Der Erntejahr-Status konnte nicht geändert werden.":"Der Erntejahr-Status konnte nicht geändert werden.","Der Index wird aus Satellitendaten berechnet und bildet die Basis für die Teilflächen (Zonen).":"Der Index wird aus Satellitendaten berechnet und bildet die Basis für die Teilflächen (Zonen).","Der Status der gewählten Felder wurde aktualisiert.":"Der Status der gewählten Felder wurde aktualisiert.","Der Vertragsabschluss ist erfolgt. Dein Partner kann keine Aktualisierungen senden.":"Der Vertragsabschluss ist erfolgt. Dein Partner kann keine Aktualisierungen senden.","Der Vertrag wurde storniert. Die bereitgestellten Felder werden nicht mehr berücksichtigt.":"Der Vertrag wurde storniert. Die bereitgestellten Felder werden nicht mehr berücksichtigt.","Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.":"Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.","Der Upload der Drohnenbilder wurde erfolgreich abgeschlossen und die Analyse der Drohnenbilder gestartet. Sobald die Ergebnisse verfügbar sind, werden sie im Datura control center angezeigt. Du kannst den aktuellen Status des Assessments in der “Job history” verfolgen.":"Der Upload der Drohnenbilder wurde erfolgreich abgeschlossen und die Analyse der Drohnenbilder gestartet. Sobald die Ergebnisse verfügbar sind, werden sie im Datura control center angezeigt. Du kannst den aktuellen Status des Assessments in der “Job history” verfolgen.","Derzeit werden nur Zip-Dateien unter
1stützt.":"Derzeit werden nur Zip-Dateien unterstützt.","Deshalb wurde keine Aktivität verschoben nach {cropYear} auf {companyName}":"Deshalb wurde keine Aktivität verschoben nach {cropYear} auf {companyName}","Detaillierte Tätigkeiten":"Detaillierte Tätigkeiten","Details anzeigen":"Details anzeigen","Den Status des aktuellen Auftrags und den Auftragsverlauf anzeigen":"Den Status des aktuellen Auftrags und den Auftragsverlauf anzeigen","Die AGB konnten nicht geladen werden.":"Die AGB konnten nicht geladen werden.","Die aktuelle Tabelle enthält Sub-Tabellen. Bitte wähle für welche die Einträge im exportieren XLS in einer eigenen Zeile dargestellt werden sollen.":"Die aktuelle Tabelle enthält Sub-Tabellen. Bitte wähle für welche die Einträge im exportieren XLS in einer eigenen Zeile dargestellt werden sollen.","Die aktuelle Trennlinie ist ungültig. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt. Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.":"Die aktuelle Trennlinie ist ungültig. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt. Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.","Die Daten wurden erfolgreich versendet.":"Die Daten wurden erfolgreich versendet.","Die Datei ist zu groß. (max. {maxFileSize} MB)":"Die Datei ist zu groß. (max. {maxFileSize} MB)","Die E-Mail-Adresse ist ungültig.":"Die E-Mail-Adresse ist ungültig.",'Die Ernte für das Erntejahr {current} ist auf den ausgewählten Feldern bereits abgeschlossen. Sie sind zur Zeit in einem zukünftigen Erntejahr "aktiv".':'Die Ernte für das Erntejahr {current} ist auf den ausgewählten Feldern bereits abgeschlossen. Sie sind zur Zeit in einem zukünftigen Erntejahr "aktiv".','Die Ernte für das Erntejahr {current} ist bereits abgeschlossen. Das Feld ist in einem zukünftigen Erntejahr "aktiv".':'Die Ernte für das Erntejahr {current} ist bereits abgeschlossen. Das Feld ist in einem zukünftigen Erntejahr "aktiv".',"Die Felder aus dem nachfolgenden Erntejahr {sourceYear} übernehmen.":"Die Felder aus dem nachfolgenden Erntejahr {sourceYear} übernehmen.","Die Felder aus dem vorangehenden Erntejahr {sourceYear} werden übernommen.":"Die Felder aus dem vorangehenden Erntejahr {sourceYear} werden übernommen.","Die Felder werden derzeit im angezeigten Erntejahr {current} bewirtschaftet.":"Die Felder werden derzeit im angezeigten Erntejahr {current} bewirtschaftet.","Die Felder wurden aus {sourceYear} übernommen.":"Die Felder wurden aus {sourceYear} übernommen.","Die Felder wurden erfolgreich erstellt.":"Die Felder wurden erfolgreich erstellt.","Die Felder wurden erfolgreich kopiert.":"Die Felder wurden erfolgreich kopiert.","Die Felder wurden erfolgreich vereint. Du kannst die Eigenschaften des neuen Felds jetzt anpassen.":"Die Felder wurden erfolgreich vereint. Du kannst die Eigenschaften des neuen Felds jetzt anpassen.","Die Felder wurden erfolgreich verschoben.":"Die Felder wurden erfolgreich verschoben.","Die Felder wurden erfolgreich zusammengefügt.":"Die Felder wurden erfolgreich zusammengefügt.","Die Felder wurden noch nicht erstellt. Bist du sicher, dass du den Import abbrechen willst?":"Die Felder wurden noch nicht erstellt. Bist du sicher, dass du den Import abbrechen willst?","Die Feldkontur konnte nicht aktualisiert werden.":"Die Feldkontur konnte nicht aktualisiert werden.","Die Feldkonturen konnten nicht kombiniert werden.":"Die Feldkonturen konnten nicht kombiniert werden.","Die Flächen wurden nicht über FARMDOK an {partner} gemeldet.":"Die Flächen wurden nicht über FARMDOK an {partner} gemeldet.","Die Gesamt-Erntemengen wurden von {partner} geladen. Klicke hier, um im nächsten Schritt Maßnahmen auf deinen Feldern zu erstellen.":"Die Gesamt-Erntemengen wurden von {partner} geladen. Klicke hier, um im nächsten Schritt Maßnahmen auf deinen Feldern zu erstellen.","Die Importvorschau wird geladen. Hier kannst du bereits Anpassungen vornehmen.":"Die Importvorschau wird geladen. Hier kannst du bereits Anpassungen vornehmen.","Die Liste der verfügbaren Länder konnte nicht geladen werden. Bitte überprüfe deine Internetverbindung und lade die Seite neu.":"Die Liste der verfügbaren Länder konnte nicht geladen werden. Bitte überprüfe deine Internetverbindung und lade die Seite neu.","Die minimale Saatstärke darf nicht größer als die maximale Saatstärke sein.":"Die minimale Saatstärke darf nicht größer als die maximale Saatstärke sein.","Die maximale Saatstärke darf nicht kleiner als die minimale Saatstärke sein.":"Die maximale Saatstärke darf nicht kleiner als die minimale Saatstärke sein.","Die Partnernummer ist deine Identifikationsnummer bei SAATBAU LINZ eGen.":"Die Partnernummer ist deine Identifikationsnummer bei SAATBAU LINZ eGen.","Die Produktmenge wurde als Gesamtmenge eingegeben. Die Menge pro Hektar hängt von der bearbeiteten Fläche ab.":"Die Produktmenge wurde als <strong>Gesamtmenge</strong> eingegeben. Die Menge <strong>pro Hektar</strong> hängt von der bearbeiteten Fläche ab.","Die Produktmenge wurde pro Hektar eingegeben. Die Gesamtmenge hängt von der bearbeiteten Fläche ab.":"Die Produktmenge wurde <strong>pro Hektar</strong> eingegeben. Die <strong>Gesamtmenge</strong> hängt von der bearbeiteten Fläche ab.","Die Werte konnten nicht geladen werden.":"Die Werte konnten nicht geladen werden.","Die aktuelle Trennl
1inie ist ungülitg. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt.":"Die aktuelle Trennlinie ist ungülitg. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt.","Die folgenden Felder existieren bereits am Ziel.":"Die folgenden Felder existieren bereits am Ziel.","Die gewählten Feldstücke wurden erfolgreich archiviert.":"Die gewählten Feldstücke wurden erfolgreich archiviert.","Die gewählten Feldstücke wurden wieder aktiviert.":"Die gewählten Feldstücke wurden wieder aktiviert.","Die gewählten Kulturen wurden abgeschlossen. Die entsprechenden Felder sind jetzt für {next} aktiv.":"Die gewählten Kulturen wurden abgeschlossen. Die entsprechenden Felder sind jetzt für {next} aktiv.","Die hochgeladenen Zonen stimmen nicht mit den selektierten Feldern überein. FARMDOK erstellt eine Zone für jedes Feld ohne Zone. Welcher Wert soll diesen Zonen zugewiesen werden?":"Die hochgeladenen Zonen stimmen nicht mit den selektierten Feldern überein. FARMDOK erstellt eine Zone für jedes Feld ohne Zone. Welcher Wert soll diesen Zonen zugewiesen werden?","Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert oder verschoben werden.":"Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert oder verschoben werden.","Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert werden.":"Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert werden.","Diese Eigenschaft kann nicht verschoben werden.":"Diese Eigenschaft kann nicht verschoben werden.","Diese Funktion ist sehr beliebt. Jetzt im Shop freischalten und weitere Vorteile nutzen!":"Diese Funktion ist sehr beliebt. Jetzt im Shop freischalten und weitere Vorteile nutzen!","Dieses Feature unterstützt derzeit nur einen gewählten Betrieb.":"Dieses Feature unterstützt derzeit nur einen gewählten Betrieb.","Dieses Dateiformat wird nicht unterstützt":"Dieses Dateiformat wird nicht unterstützt","Dieses Produkt in anderen Lagern":"Dieses Produkt in anderen Lagern","Dieses Problem nicht mehr anzeigen":"Dieses Problem nicht mehr anzeigen","Differenz zwischen Zonen (%)":"Differenz zwischen Zonen (%)","Direkt von eAMA":"Direkt von eAMA",Dosierung:"Dosierung",Download:"Download",Drill:"Drillsaat","Drück bei Datenempfänger FARMDOK GmbH die Taste „Einwilligung starten“ und folge den Anweisungen.":"Drück bei Datenempfänger FARMDOK GmbH die Taste „Einwilligung starten“ und folge den Anweisungen.",'Drücke "Importieren" um den Import abzuschließen.':'Drücke "Importieren" um den Import abzuschließen.',"Du verfügst auf diesem Betrieb über keine Berechtigung für dieses Feature.":"Du verfügst auf diesem Betrieb über keine Berechtigung für dieses Feature.","Du bist derzeit bei CNH-Industrial als {userEmail} eingeloggt. Wenn du mehr als ein Unternehmen, eine Landwirtschaft oder einen Betrieb hast, wähle bitte aus.":"Du bist derzeit bei CNH-Industrial als {userEmail} eingeloggt.  Wenn du mehr als ein Unternehmen, eine Landwirtschaft oder einen Betrieb hast, wähle bitte aus.","Du bist auf MyJohnDeere mit <u>{userEmail}</u> eingeloggt. Falls du mehr als eine Organisation auf MyJohnDeere hast wähle bitte die passende aus der Liste.":"Du bist auf MyJohnDeere mit <u>{userEmail}</u> eingeloggt. Falls du mehr als eine Organisation auf MyJohnDeere hast wähle bitte die passende aus der Liste.","Du entfernst ein Feld, das von deinem Vertragspartner bereitgestellt wurde. Gewählten Eintrag wirklich löschen?":"Du entfernst ein Feld, das von deinem Vertragspartner bereitgestellt wurde. Gewählten Eintrag wirklich löschen?","Du entfernst Felder, die von deinem Vertragspartner bereitgestellt wurden. Gewählte Einträge wirklich löschen?":"Du entfernst Felder, die von deinem Vertragspartner bereitgestellt wurden. Gewählte Einträge wirklich löschen?","Du hast bereits ein Konto?":"Du hast bereits ein Konto?","Du hast derzeit keine Berechtigung auf einen Betrieb zuzugreifen.":"Du hast derzeit keine Berechtigung auf einen Betrieb zuzugreifen.","Du hast keine Berechtigung ein neues Erntejahr hinzuzufügen.":"Du hast keine Berechtigung ein neues Erntejahr hinzuzufügen.","Du hast keine E-Mail bekommen? Überprüfe bitte den Spam-Ordner.":"Du hast keine E-Mail bekommen? Überprüfe bitte den Spam-Ordner.","Du hast noch kein Konto?":"Du hast noch kein Konto?","Du hast noch keine Kontrakte angenommen.":"Du hast noch keine Kontrakte angenommen.","Du importierst ein Feld.":"Du importierst ein Feld.","Du importierst {count} Felder.":"Du importierst {count} Felder.","Du kannst Flächen mit Dateien im Format Shape, XML, KML, XLS, XLSX und CSV hochladen.":"Du k
1annst Flächen mit Dateien im Format Shape, XML, KML, XLS, XLSX und CSV hochladen.","Du kannst aber Erntedaten importieren, sobald sie bei {partner} verfügbar sind.":"Du kannst aber Erntedaten importieren, sobald sie bei {partner} verfügbar sind.","Du kannst das auch bequem mit dem Smartphone oder Tablet auf der Couch machen oder auch alle deine Flächen auf einmal importieren.":"Du kannst das auch bequem mit dem Smartphone oder Tablet auf der Couch machen oder auch alle deine Flächen auf einmal importieren.","Du kannst deine Felder anderen Benutzern freigeben. Du musst dafür lediglich die E-Mail des Empfängers angeben.":"Du kannst deine Felder anderen Benutzern freigeben. Du musst dafür lediglich die E-Mail des Empfängers angeben.","Du kannst die Eigenschaften der neuen Felder noch anpassen.":"Du kannst die Eigenschaften der neuen Felder noch anpassen.","Du kannst die Flächen direkt von eAMA mit AMA-Betriebsnummer und AMA-Pin importieren.":"Du kannst die Flächen direkt von eAMA mit AMA-Betriebsnummer und AMA-Pin importieren.","Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.":"Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.","Du löschst damit auch alle zugehörigen Felder in allen Erntejahren.":"Du löschst damit auch alle zugehörigen Felder in allen Erntejahren.","Du musst in eAMA einmalig die Erlaubnis geben, dass deine Flächen in FARMDOK importieren werden dürfen.":"Du musst in eAMA einmalig die Erlaubnis geben, dass deine Flächen in FARMDOK importieren werden dürfen.","Du musst zumindest ein Feld für den Import wählen.":"Du musst zumindest ein Feld für den Import wählen.","Duplikate erstellen.":"Duplikate erstellen.","Duplikate im Ziel-Betrieb/Ziel-Erntejahr":"Duplikate im Ziel-Betrieb/Ziel-Erntejahr","Duplikate im Ziel-Erntejahr":"Duplikate im Ziel-Erntejahr","Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden.":"Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden.","Durch die Freigabe der ausgewählten Felder erhält Dein Vertragspartner SAATBAU LINZ eGen lesenden Zugriff auf die Felder sowie die darauf gebuchten Maßnahmen und das Schlagblatt.":"Durch die Freigabe der ausgewählten Felder erhält Dein Vertragspartner SAATBAU LINZ eGen lesenden Zugriff auf die Felder sowie die darauf gebuchten Maßnahmen und das Schlagblatt.","Durch erstellen eines FARMDOK Accounts stimmst du den {agb} von FARMDOK zu.":"Durch erstellen eines FARMDOK Accounts stimmst du den {agb} von FARMDOK zu.","Durchführungsdatum":"Durchführungsdatum","Durchschnitt:":"Durchschnitt:","Durchschnittlicher NDVI-Index":"Durchschnittlicher NDVI-Index","Mehrjähriger Biomasseindex auf Basis Blattflächenindex":"Mehrjähriger Biomasseindex auf Basis Blattflächenindex","Düngekarte":"Düngekarte","Düngekarte für alle Kulturen":"Düngekarte für alle Kulturen","Düngekarte für Getreide":"Düngekarte für Getreide","Düngeplanung":"Düngeplanung","Düngeverordnung":"Düngeverordnung","Düngeziel":"Düngeziel","Düngung":"Düngung","DÜNGUNG":"DÜNGUNG",Ebenen:"Ebenen","E-Mail-Adresse":"E-Mail-Adresse","E-Mail-Adresse eingeben":"E-Mail-Adresse eingeben","E-mail des Users, der freigegeben hat":"E-mail des Users, der freigegeben hat","Eigene Saatstärke":"Eigene Saatstärke","Eigener Betrieb":"Eigener Betrieb","Eigener Dünger":"Eigener Dünger","Eigentümer":"Eigentümer","Ein oder mehrere Felder haben eine ungültige Kontur":"Ein oder mehrere Felder haben eine ungültige Kontur","Ein Feld mit diesem Namen existiert bereits.":"Ein Feld mit diesem Namen existiert bereits. Da Sie die Option 'Feldname eindeutig erforderlich' aktiviert haben, müssen Sie einen anderen Namen wählen.","Ein Betriebsleiter kann dir Zugriff gewähren, oder du erstellst dir hier deinen eigenen Betrieb.":"Ein Betriebsleiter kann dir Zugriff gewähren, oder du erstellst dir hier deinen eigenen Betrieb.","Eine ähnliche Maßnahme mit gleichen Datum, Tätigkeit, Feld und Produkten existiert bereits.":"Eine ähnliche Maßnahme mit gleichen Datum, Tätigkeit, Feld und Produkten existiert bereits.","Eine Zeile pro Maschine":"Eine Zeile pro Maschine","Eine Zeile pro Maßnahme":"Eine Zeile pro Maßnahme","Eine Zeile pro Produkt":"Eine Zeile pro Produkt","Einfügen (oberhalb)":"Einfügen (oberhalb)",Einheit:"Einheit","Einheit kg/ha":"Einheit kg/ha",Einheiten:"Einheiten",Einloggen:"Einloggen",Einstellungen:"Einstellungen","Einstellungen anzeigen":"Einstellungen anzeigen","Einstellungen für die Zonierung":"Einstellungen für die Zonierung","Einstellungen verstecken":"Einstellungen verstecken",'Einzelne, vollständige TASKDATA-Dateien müssen die Bezeichnung "TASKDATA" beinhalten. Zusammengehörige Dateien können nur gezipped hochgeladen werden.':'Einzelne, vollständige TASKDATA-Dateien müssen die Bezeichnung "TASKDATA" beinhalten. Zusammengehörige Dateien können nur gezipped hochgeladen werden.',Empfangen:"Empfangen","Empfänger":"Empfänger","Enthält nicht:":"Enthält nicht:","Enthält:":"Enthält:","Ergebnis anpassen":"Ergebnis anpassen",Erhalten:"Received",Erledigt:"Erledigt","
1Erledigt!":"Erledigt!","Erneut senden":"Erneut senden",Ernte:"Ernte","Ernte abschließen":"Ernte abschließen",Erntedaten:"Erntedaten","Erntedaten für Flächen laden, die nicht über FARMDOK an {partner} gemeldet wurden.":"Erntedaten für Flächen laden, die nicht über FARMDOK an {partner} gemeldet wurden.","Erntedaten für {processOrderName} von {partner} importieren.":"Erntedaten für {processOrderName} von {partner} importieren.","Erntedaten laden":"Erntedaten laden","Erntedatenimport von {partner}":"Erntedatenimport von {partner}","Erntefläche gesamt (ha)":"Erntefläche gesamt (ha)","Erntegüter":"Erntegüter",Erntejahr:"Erntejahr","Erntejahr abschließen":"Erntejahr abschließen","Erntejahr beginnen":"Erntejahr beginnen","Erntejahr wählen":"Erntejahr wählen","Erntejahr wählen...":"Erntejahr wählen...","Erntejahr {current} für die gewählten Kulturen abschließen und {next} als das aktive Jahr setzen.":"Erntejahr {current} für die gewählten Kulturen abschließen und {next} als das aktive Jahr setzen.","Erntejahr {newYear} hinzufügen":"Erntejahr {newYear} hinzufügen","Erntejahr-Status":"Erntejahr-Status","Erntejahr:":"Erntejahr:","Erntemaßnahmen vorhanden":"Erntemaßnahmen vorhanden","Erntemenge gesamt (t)":"Erntemenge gesamt (t)","Erntemenge gesamt: {totalPotatoes} t":"Erntemenge gesamt: {totalPotatoes} t","Ersetze das Feld im Ziel":"Ersetze das Feld im Ziel","Erstelle eine Kopie des Feldes im Ziel":"Erstelle eine Kopie des Feldes im Ziel","Erstelle ein neues Erntejahr":"Erstelle ein neues Erntejahr",Erstellt:"Erstellt","Ertrag maximieren":"Ertrag maximieren","Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch kopieren?":"Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch kopieren?","Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch verschieben?":"Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch verschieben?","Es existieren mehrere Felder am Ziel.":"Es existieren mehrere Felder am Ziel.","Es hat noch kein Partner Felder bereitgestellt. Lade deine Partner ein, Felder in Farmdok zu kontrahieren.":"Es hat noch kein Partner Felder bereitgestellt. Lade deine Partner ein, Felder in Farmdok zu kontrahieren.","Es ist ein unbekannter Fehler aufgetreten.":"Es ist ein unbekannter Fehler aufgetreten.","Es können Dateien im Format {fileFormat} importiert werden.":"Es können Dateien im Format {fileFormat} importiert werden.","Es können Dateien im Format ISOXML Taskdata oder CSV importiert werden.":"Es können Dateien im Format ISOXML Taskdata oder CSV importiert werden.","Es können Dateien in den Formaten Shape, XML, KML, XLS, XLSX und CSV importiert werden.":"Es können Dateien in den Formaten Shape, XML, KML, XLS, XLSX und CSV importiert werden.","Es konnte keine Task-Datei heruntergeladen werden":"Es konnte keine Task-Datei heruntergeladen werden","Es konnten nicht alle Dateien hochgeladen werden":"Es konnten nicht alle Dateien hochgeladen werden","Es können Dateien in den Formaten {fileFormats} und {lastFileFormat} importiert werden.":"Es können Dateien in den Formaten {fileFormats} und {lastFileFormat} importiert werden.","Es müssen mindestens 2 Felder gewählt sein.":"Es müssen mindestens 2 Felder gewählt sein.","Es sind Filter aktiv. Die folgenden Daten werden exportiert:":"Es sind Filter aktiv. Die folgenden Daten werden exportiert:","Es sind {count} Felder ausgewählt.":"Es sind {count} Felder ausgewählt.","Es trat ein Fehler auf, bitte versuchen Sie es erneut.":"Es trat ein Fehler auf, bitte versuchen Sie es erneut.","Es werden keine Felder in {newYear} erstellt.":"Es werden keine Felder in {newYear} erstellt.","Es wurden mehrere Operationen durchgeführt. Bei mindestens einer ist ein Fehler aufgetreten.":"Es wurden mehrere Operationen durchgeführt. Bei mindestens einer ist ein Fehler aufgetreten.","Es wurden noch keine Felder angelegt. Erstelle neue Felder!":"Es wurden noch keine Felder angelegt. Erstelle neue Felder!","Es wurden noch keine Felder übermittelt. Lade deine Partner ein, Felder in Farmdok freizugeben.":"Es wurden noch keine Felder übermittelt. Lade deine Partner ein, Felder in Farmdok freizugeben.","Es wurden noch keine Maßnahmen angelegt. Erstelle neue Maßnahmen!":"Es wurden noch keine Maßnahmen angelegt. Erstelle neue Maßnahmen!","Es wurden noch keine Dateien hochgeladen!":"Es wurden noch keine Dateien hochgeladen!","Es wurden {count} Felder ausgewählt. Die Felder werden im nächsten Schritt zu einem vereint.":"Es wurden {count} Felder ausgewählt. Die Felder werden im nächsten Schritt zu einem vereint.","Es wurden Felder mit verschiedenen Kulturen oder Sorten ausgewählt. Bitte beachte den Sorteneinfluss bei der Wahl der Mittel und Mengen. Mittel und Aufwandmengen müssen für alle ausgewählten Kulturen und Sorten geeignet sein!":"Es wurden Felder mit verschiedenen Kulturen oder Sorten ausgewählt. Bitte beachte den Sorteneinfluss bei der Wahl der Mittel und Mengen. Mittel und Aufwandmengen müssen für alle ausgewählten Kulturen und Sorten geeignet sein!",Export:"Export",Exporte:"Exporte",Exportieren:"Exportieren","Export pro Tabellenzeile":"Export pro Tabellenzeile","FARMDOK Eigenschaft":"FARMDOK Eigenschaft",'FARMDOK Eigenschaft "{fieldName}" muss gewählt sein.':'FARMDOK Eigenschaft "{fieldName}" muss gewählt sein.',"FARMDOK Feldpositionen":"FARMDOK Feldpositionen","FARMDOK konnte den Ursprung deiner Daten leider nicht eindeutig feststellen. Bitte wähle aus der folgenden Liste den richtigen Eintrag aus:":"FARMDOK konnte den Ursprung deiner Daten leider nicht eindeutig feststellen. Bitte wähle aus der folgenden Liste den richtigen Eintrag aus:",FSNr:"FSNr","FSNr - Schlag":"FSNr - Schlag",Fahrzeit:"Fahrzeit","Fahrzeit minimieren":"Fahrzeit minimieren","Falls deine Exportdateien als zip-Datei zur Verfügung stehen, kannst du ganz einfach diese zip-Datei inkl. aller Daten in das weiße Rechteck ziehen.":"Falls deine Exportdateien als zip-Datei zur Verfügung stehen, kannst du ganz einfach diese zip-Datei inkl. aller Daten in das weiße Rechteck ziehen.","Falls du einen anderen MyJo
1hnDeere Account verwenden möchtest logge dich bitte auf MyJohnDeere.com aus. Dann trenne die Verbindung in FARMDOK. Danach kannst du dich mit dem neuen Account verbinden.":"Falls du einen anderen MyJohnDeere Account verwenden möchtest logge dich bitte auf MyJohnDeere.com aus. Dann trenne die Verbindung in FARMDOK. Danach kannst du dich mit dem neuen Account verbinden.","Fast am Ziel!":"Fast am Ziel!",Favoriten:"Favoriten",Fehler:"Fehler","Fehlerhaft/unvollständig":"Fehlerhaft/unvollständig",Feld:"Feld","Feld befindet sich im Wasserschutzgebiet":"Feld befindet sich im Wasserschutzgebiet","Feld 1":"Feld 1","Feld 2":"Feld 2","Feld Nr":"Feld Nr","Feld Nummer:":"Feld Nummer:","Feld aufteilen":"Feld aufteilen","Feld auswählen":"Feld auswählen","Feld verschieben":"Feld verschieben","Feld {number}":"Feld {number}","Feld-Nummer":"Feld-Nummer","Feld-Übersicht":"Feld-Übersicht",Felder:"Felder","Felder aktualisieren.":"Felder aktualisieren.","Felder auswählen":"Felder auswählen","Felder bearbeiten":"Felder bearbeiten","Felder dürfen nicht die gleichen Namen enthalten.":"Sie haben die Option 'Feldname eindeutig erforderlich' aktiviert. Daher müssen Feldernamen einzigartig sein.","Felder einfärben":"Felder einfärben","Felder exportieren":"Felder exportieren","Felder freigeben":"Felder freigeben","Felder hinzufügen":"Felder hinzufügen","Felder importieren":"Felder importieren","Felder kombinieren":"Felder kombinieren","Felder kopieren":"Felder kopieren","Felder kopieren anstatt zu verschieben.":"Felder kopieren anstatt zu verschieben.","Felder nicht kopieren.":"Felder nicht kopieren.","Felder nicht verschieben.":"Felder nicht verschieben.","Felder teilen ist nur für Einzelpolygone möglich":"Felder teilen ist nur für Einzelpolygone möglich","Felder und Geodaten teilen":"Felder und Geodaten teilen","Felder verschieben":"Felder verschieben","Felder wiederherstellen":"Felder wiederherstellen","Felder wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Felder wiederherstellen, die in den letzten 90 Tagen gelöscht wurden","Felder zusammenlegen":"Felder zusammenlegen","Feldgröße":"Feldgröße","Feldkontur löschen":"Feldkontur löschen","Feldkontur zeichnen":"Feldkontur zeichnen","Feldname immer anzeigen":"Feldname immer anzeigen",Feldnutzung:"Feldnutzung",Fortschritt:"Fortschritt","Feldmitte markieren":"Feldmitte markieren",Feldpositionen:"Feldpositionen","Feldstück":"Feldstück","Kunde - Feldstück - Feld":"Kunde - Feldstück - Feld","Feldstück - Feldnummer - Feld":"Feldstück - Feldnummer - Feld","Feldstück Nr":"Feldstück Nr","Feldstück Nummer":"Feldstück Nummer","Feldstück Nummer:":"Feldstück Nummer:","Feldstück hinzufügen":"Feldstück hinzufügen","Feldstück konnte nicht wieder hergestellt werden.":"Feldstück konnte nicht wieder hergestellt werden.","Feldstück-Nummer":"Feldstück-Nummer","Feldstücke":"Feldstücke","Feldstücke wiederherstellen":"Feldstücke wiederherstellen","Feldstücke wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Feldstücke wiederherstellen, die in den letzten 90 Tagen gelöscht wurden","Feldstücknummer - Feldname":"Feldstücknummer - Feldname","Feldstücksliste":"Feldstücksliste","Fertig! Die Felder/Feldstücke inkl. Geokonturen wurden importiert und stehen für die Maßnahmenbuchung zur Verfügung!":"Fertig! Die Felder/Feldstücke inkl. Geokonturen wurden importiert und stehen für die Maßnahmenbuchung zur Verfügung!",Fertigstellen:"Fertigstellen",Feuchtgebiet:"Feuchtgebiet","Fileupload zu John Deere fehlgeschlagen.":"Fileupload zu John Deere fehlgeschlagen.","Filter aktiviert - {linkStart}Filter deaktivieren{linkEnd} um alle Einträge anzuzeigen.":"Filter aktiviert - {linkStart}Filter deaktivieren{linkEnd} um alle Einträge anzuzeigen.","Filter entfernen":"Filter entfernen","Flächen":"Flächen","Flächen ansehen":"Flächen ansehen","Flächen aus dem Nachfolgejahr übernehmen":"Flächen aus dem Nachfolgejahr übernehmen","Flächen aus dem Vorjahr übernehmen":"Flächen aus dem Vorjahr übernehmen","Flächen senden":"Flächen senden","Flächennutzung":"Flächennutzung","Flächensumme":"Flächensumme","Flächenübermittlung":"Flächenübermittlung",Frei:"Frei",Freigabedatum:"Freigabedatum","Freigaben entfernen":"Freigaben entfernen","Freigaben jetzt entfernen.":"Freigaben jetzt entfernen.",Freigeben:"Freigeben","Freigeben bis {date}.":"Freigeben bis {date}.","Freigeben bis:":"Freigeben bis:",Freigegeben:"Freigegeben","Freigegebene Felder":"Freigegebene Felder","Freigabe entfernen":"Freigabe entfernen","Freunde einladen":"Freunde einladen",Fruchtfolge:"Fruchtfolge","FSNr-Schlag":"FSNr-Schlag",Futter:"Futter","Für das ausgewählte Feld fehlen die Geo-Daten.":"Für das ausgewählte Feld fehlen die Geo-Daten.","Für die Auswertung werden Daten der Sentinel Erdbeobachtungs­satelliten verwendet. Satelliten- & Wetterdaten zeigen Biomassezuwachs (NDVI- und MSAVI2-Index), Stickstoffverbrauch (REIP-Index) und Wassergehalt (NDWI-Index) auf. Sie sind die optimale Unterstützung für effektive Produktionsentscheidungen.":"Für die Auswertung werden Daten der Sentinel Erdbeobachtungs­satelliten verwendet. Satelliten- & Wetterdaten zeigen Biomassezuwachs (NDVI- und MSAVI2-Index), Stickstoffverbrauch (REIP-Index) und Wassergehalt (NDWI-Index) auf. Sie sind die optimale Unterstützung für effektive Produktionsentscheidungen.","Für diese Einheit ist eine Gesamteingabe nicht möglich.":"Für diese Einheit ist eine Gesamteingabe nicht möglich.","Für Fragen steht Ihr regionaler Berater gerne zur Verfügung (Beraterzuordnung nach Region).":"Für Fragen steht Ihr regionaler Berater gerne zur Verfügung (Beraterzuordnung nach Region).","Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden. Max. 10 MB pro Datei.":"Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden. Max. 10 MB pro Datei.","GW Gebiete":"GW Gebiete","GW-Gebiet":"GW-Gebiet","Feuchtgebiet oder Trockengebiet":"Feuchtgebiet oder Trockengebiet","Gedüngt":"Gedüngt",Gemeinde:"Gemeinde","Gemüse":"Gemüse",Geplant:"Geplant","Geplant setzen":"Geplant setzen",Gering:"Gering",gering:"gering","Gesamtanzahl der bereitgestellten Felder":"Gesamtanzahl der bereitgestellten Felder",Gesamtanzahl:"Gesamtanzahl","Gesamtfläche":"Gesamtfläche","Gesamtfläche aus Erntedaten: {totalSize} ha":"Gesamtfläche aus Erntedaten: {totalSize} ha","Gesamtfläche {totalArea} ha":"Gesamtfläche {totalArea} ha","Gesamtfläche in ha":"Gesamtfläche in ha",Gesamt:"Gesamt",Gesamtmenge:"Gesamtmenge","Geschafft!":"Geschafft!",Gesendet:"Gesendet","Geteilt von":"Geteilt von","Geteilte Informationen:":"Geteilte Informationen:","GIS-Layer":"GIS-Layer","Gewählten Eintrag wirklich löschen?":"Gewählten Eintrag wirklich löschen?","Gewählte Einträge wirklich löschen?":"Gewählte Einträge wirklich löschen?","Gewählte Fläche: {sizeTotalFormatted} ha":"Gewählte Fläche: {sizeTotalFormatted} ha","Gleiche Zonengröße":"Gleiche Zonengröße","Gleicher Indexabstand":"Gleicher Indexabstand","Grobe Tätigkeiten":"Grobe Tätigkeiten",Gruppiert:"Gruppiert","Größe":"Größe","Größe (ha)":"Größe (ha)","Größe (in ha)":"Größe (in ha)","Größe in ha":"Größe in ha","Größe (in ha):":"Größe (in ha):","Größer als:":"Größer als:","Grünland und Feldfutterbau":"Grünland und Feldfutterbau","Gutscheine verwalten":"Gutsc
1heine verwalten","Heil- und Gewürzpflanzen":"Heil- und Gewürzpflanzen",Hektar:"Hektar","Herbstantrag (HA)":"Herbstantrag (HA)",Herunterladen:"Herunterladen","Hier gehts zur Registrierung.":"Hier gehts zur Registrierung.","Hier kannst du alle Freigaben für einen Betrieb im aktuellen Erntejahr entfernen.":"Hier kannst du alle Freigaben für einen Betrieb im aktuellen Erntejahr entfernen.","Hier kannst du dein neues Passwort eingeben.":"Hier kannst du dein neues Passwort eingeben.","Hier kannst du deine eigenen Zonenkarten hochladen um daraus eine Applikationskarte zu erstellen. Bitte verwende Daten im Shape-Format.":"Hier kannst du deine eigenen Zonenkarten hochladen um daraus eine Applikationskarte zu erstellen. Bitte verwende Daten im Shape-Format.",Hilfe:"Hilfe",Low:"Niedrig",Medium:"Mittel",High:"Hoch",niedriger:"niedriger","höher":"höher","Hinweise für":"Hinweise für","Hinweis: die maximale Prüfdistanz beträgt":"Hinweis: die maximale Prüfdistanz beträgt {maxDistance}.",Hoch:"Hoch",hoch:"hoch",Hochgeladen:"Hochgeladen",Hochformat:"Hochformat",Humus:"Humus","Häufigkeit":"Häufigkeit",Isolationszonen:"Isolationszonen","Isolationszone erstellen":"Isolationszone erstellen","Isolationszone bearbeiten":"Isolationszone bearbeiten","Isolationszone löschen":"Isolationszone löschen",ISOXML:"ISOXML","Ich habe bereits einen Account":"Ich habe bereits einen Account","Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung von FARMDOK zu {partner} zu genannten Zwecken ausdrücklich zu.":"Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung von FARMDOK zu {partner} zu genannten Zwecken ausdrücklich zu.","Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung zu genannten Zwecken ausdrücklich zu.":"Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung zu genannten Zwecken ausdrücklich zu.","Ich verstehe, Services & Support erfolgen per E-Mail.":"Ich verstehe, Services & Support erfolgen per E-Mail.","Ihre Organisation auf MyPLM® Connect, AFS Connect oder S-FLEET":"Ihre Organisation auf MyPLM® Connect, AFS Connect oder S-FLEET","Im Erntejahr {previous} wurde ein Feld auf aktiv gestellt.":"Im Erntejahr {previous} wurde ein Feld auf aktiv gestellt.","Im Erntejahr {previous} wurden {numberOfNewActiveFieldsInPrevious} Felder auf aktiv gestellt.":"Im Erntejahr {previous} wurden {numberOfNewActiveFieldsInPrevious} Felder auf aktiv gestellt.","Im Shape-Format exportieren":"Im Shape-Format exportieren","Import in Farmdok":"Import in Farmdok","Import zurücksetzen":"Import zurücksetzen",importiert:"importiert",Importieren:"Importieren","Importiere Dateien in den Formaten Shape und GeoJSON.":"Importiere Dateien in den Formaten Shape und GeoJSON.","Importieren von Maßnahmen aus externen Quellen":"Importieren von Maßnahmen aus externen Quellen","Importiere Dateien in den Formaten Shape und GeoJSON. Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden.":"Dateien im Format Shape oder GeoJSON importieren. Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden.","Maßnahmen aus AFS Connect, S-Fleet und PLMConnect importieren":"Maßnahmen aus AFS Connect, S-Fleet und PLMConnect importieren",Impressum:"Impressum","In FARMDOK nach dem Import.":"In FARMDOK nach dem Import.","In der hochgeladenen Datei befinden sich mehrere Werte. Welcher davon soll zum Erstellen der Zonen benutzt werden?":"In der hochgeladenen Datei befinden sich mehrere Werte. Welcher davon soll zum Erstellen der Zonen benutzt werden?","In diesem Erntejahr sind noch keine Flächen verfügbar.":"In diesem Erntejahr sind noch keine Flächen verfügbar.","Index auswählen":"Index auswählen","Inhaltsstoffe des Düngers in %":"Inhaltsstoffe des Düngers in %","Inhaltsstoffe des Düngers in % und Ausbringmenge am Feld in kg/ha":"Inhaltsstoffe des Düngers in % und Ausbringmenge am Feld in kg/ha","Inhaltsstoffe in %":"Inhaltsstoffe in %","Ist genau:":"Ist genau:","Ja, Maßnahmen auch in das Ziel-Erntejahr kopieren.":"Ja, Maßnahmen auch in das Ziel-Erntejahr kopieren.","Ja, Maßnahmen auch in das Ziel-Erntejahr verschieben.":"Ja, Maßnahmen auch in das Ziel-Erntejahr verschieben.","Ja, ich will den FARMDOK Newsletter bekommen!":"Ja, ich will den FARMDOK Newsletter bekommen!",Ja:"Ja",Jahr:"Jahr",Jahre:"Jahre","Jetzt Lizenz upgraden":"Jetzt Lizenz upgraden","Jetzt kaufen":"Jetzt kaufen","Jetzt starten":"Jetzt starten","Jetzt starten!":"Jetzt starten!","Jetzt verschieben":"Jetzt verschieben","Jetzt kopieren":"Jetzt kopieren","Jetzt upgraden auf FARMDOK PERFORMANCE!":"Jetzt upgraden auf FARMDOK PERFORMANCE!",K:"K",K
1arte:"Karte","Karte erstellen":"Karte erstellen","Karte anzeigen":"Karte anzeigen",Katastralgemeinde:"Katastralgemeinde","Kein Betrieb gewählt":"Kein Betrieb gewählt","Kein Enddatum festlegen":"Kein Enddatum festlegen","Kein Enddatum gesetzt.":"Kein Enddatum gesetzt.","Kein gültiger Schädling vorhanden":"Kein gültiger Schädling vorhanden","Kein weiteres Feld":"Kein weiteres Feld","Kein Vorschlag (manuelle Eingabe)":"Kein Vorschlag (manuelle Eingabe)",Keine:"Keine","Keine Daten verfügbar.":"Keine Daten verfügbar.","Keine Einträge vorhanden.":"Keine Einträge vorhanden.","Keine Ergebnisse gefunden. Ändere den Suchbegriff.":"Keine Ergebnisse gefunden. Ändere den Suchbegriff.","Keine Felder vorhanden":"Keine Felder vorhanden","Keine Feldposition":"Keine Feldposition","Keine Kontrakte vorhanden.":"Keine Kontrakte vorhanden.","Keine Kultur":"Keine Kultur","Keine Tätigkeit":"Keine Tätigkeit","Keine Kultur gepflegt":"Keine Kultur gepflegt","Keine Kulturdaten vorhanden.":"Keine Kulturdaten vorhanden.","Keine Organisation in deinem John Deere Account vorhanden.":"Keine Organisation in deinem John Deere Account vorhanden.","Keine Satellitendaten für den ausgewählten Zeitraum verfügbar.":"Keine Satellitendaten für den ausgewählten Zeitraum verfügbar.","Keine Wetterdaten für den ausgewählten Zeitraum verfügbar.":"Keine Wetterdaten für den ausgewählten Zeitraum verfügbar.","Keine Shape-Datei im Zip gefunden.":"Keine Shape-Datei im Zip gefunden.","Keine Sorte":"Keine Sorte","Keine aktiven Kulturen im aktuellen Erntejahr vorhanden.":"Keine aktiven Kulturen im aktuellen Erntejahr vorhanden.","Keine Warnhinweise gefunden":"Keine Warnhinweise gefunden","Keines der gewählten Felder besitzt eine Kontur.":"Keines der gewählten Felder besitzt eine Kontur.","Kleiner als:":"Kleiner als:",'Klicke auf "Aufteilen" um zwei neue Felder zu erstellen.':'Klicke auf "Aufteilen" um zwei neue Felder zu erstellen.',"Klicke auf den Link in der E-Mail um dein Passwort zurückzusetzen.":"Klicke auf den Link in der E-Mail um dein Passwort zurückzusetzen.","Klicke auf den Link in der E-Mail um deinen Account zu aktivieren.":"Klicke auf den Link in der E-Mail um deinen Account zu aktivieren.","Klicke hier für mehr Infos ...":"Klicke hier für mehr Infos ...","Klicke hier um dich einzuloggen.":"Klicke hier um dich einzuloggen.","Klicke hier um die Gesamtmenge festzulegen.":"Klicke hier um die Gesamtmenge festzulegen.","Klicke hier um die Menge pro Hektar festzulegen.":"Klicke hier um die Menge pro Hektar festzulegen.","Klicke in der Karte auf ein Feld um es hinzuzufügen.":"Klicke in der Karte auf ein Feld um es hinzuzufügen.","Klicke in der Karte um ein neues Feld hinzuzufügen.":"Klicke in der Karte um ein neues Feld hinzuzufügen.","Klicke in der Karte um eine Trennlinie zu zeichnen. Klicke zwei mal schnell hintereinander um das Zeichnen zu beenden.":"Klicke in der Karte um eine Trennlinie zu zeichnen. Klicke zwei mal schnell hintereinander um das Zeichnen zu beenden.","Klicke in die Karte, um die Auswahl zu verändern.":"Klicke in die Karte, um die Auswahl zu verändern.","Klicken oder Zip-Datei hier ablegen.":"Klicken oder Zip-Datei hier ablegen.",KMZ:"KMZ",Kombinieren:"Kombinieren",Kommentar:"Kommentar","Kontakt E-Mail":"Kontakt E-Mail",Kontrahiert:"Kontrahiert","Kontrollgang durchgeführt oder Warndienstmeldung beachtet.":"Kontrollgang durchgeführt oder Warndienstmeldung beachtet.","Kontrollgang wurde schlagbezogen durchgeführt und/oder eine Warndienstmeldung beachtet":"Kontrollgang wurde schlagbezogen durchgeführt und/oder eine Warndienstmeldung beachtet",Konventionell:"Konventionell",Konflikt:"Konflikt","Kornqualität":"Kornqualität","Kosten senken":"Kosten senken",Kostenrechnung:"Kostenrechnung",Kultur:"Kultur","Kultur für alle Felder übernehmen":"Kultur für alle Felder übernehmen","Kultur in der Datenquelle (aus dem Import)":"Kultur in der Datenquelle (aus dem Import)","Kultur:":"Kultur:",Kulturen:"Kulturen","Kulturen & Greening-Kennzahlen":"Kulturen & Greening-Kennzahlen","Kulturen ohne Erntemaßnahmen":"Kulturen ohne Erntemaßnahmen","Kulturen, Feldstücknutzung, Anbaudiversivizierung und ökologische Vorrangflächen.":"Kulturen, Feldstücknutzung, Anbaudiversivizierung und ökologische Vorrangflächen.","Kulturverhältnis":"Kulturverhältnis",Kunde:"Kunde",Kunden:"Kunden",Kundennummer:"Kundennummer",Kundenverwaltung:"Kundenverwaltung","Kundenzufriedenheit erhöhen":"Kundenzufriedenheit erhöhen","K₂O-Klasse":"K₂O-Klasse","LAI - Blattflächenindex":"LAI - Blattflächenindex","Lade hoch ...":"Lade hoch ...","Lade..":"Lade..","Lade...":"Lade...","Drohnenbilder hochladen, um ein neues Assessment zu starten":"Drohnenbilder hochladen, um ein neues Assessment zu starten",Lager
1:"Lager",Lagerbewegungen:"Lagerbewegungen","Lagerbewegung anlegen":"Lagerbewegung anlegen","Lagerstände":"Lagerstände","Lagerstand anwenden":"Lagerstand anwenden","Lagerstand zu niedrig":"Lagerstand zu niedrig",Land:"Land","Grundstückskataster":"Grundstückskataster",Landwirt:"Landwirt","Lass uns zusammen arbeiten!":"Lass uns zusammen arbeiten!","Leg deine Datei hier ab":"Leg deine Datei hier ab",Legendentitel:"Legendentitel",Legende:"Legende","Leider können für dieses Feld keine Wetterdaten geladen werden.":"Leider können für dieses Feld keine Wetterdaten geladen werden.",Link:"Link","Link kopieren":"Link kopieren","Link in die Zwischenablage kopieren":"Link in die Zwischenablage kopieren","Link zu AGES Register":"Link zu AGES Register","Link zur Datei":"Link zur Datei","Liste aller Felder gruppiert nach Kulturen.":"Liste aller Felder gruppiert nach Kulturen.","Liste aller Feldgruppen und Felder im gewählten Erntejahr.":"Liste aller Feldgruppen und Felder im gewählten Erntejahr.","Liste aller Feldstücke und Schläge im gewählten Erntejahr.":"Liste aller Feldstücke und Schläge im gewählten Erntejahr.","Liter pro m² Niederschlag im {month} {year}":"Liter pro m² Niederschlag im {month} {year}","Liter pro m² Niederschlag in {year}":"Liter pro m² Niederschlag in {year}","Live check läuft...":"Live check läuft...",Login:"Login","Login mit MyJohnDeere":"Login mit MyJohnDeere","Login mit CNH Platformen":"Login mit CNH Platformen",Lohnunternehmer:"Lohnunternehmer","Löschen":"Löschen","MSAVI2 - Biomasse":"MSAVI2 - Biomasse","MAISBUTLER Anfrage":"MAISBUTLER Anfrage",Mais:"Mais","Manuelle Eingabe":"Manuelle Eingabe",Maschine:"Maschine",Mahlen:"Mahlen","Maschine auswählen":"Maschine auswählen","Maschine entfernen":"Maschine entfernen","Maschine hinzufügen":"Maschine hinzufügen",Maschinen:"Maschinen","Maschinen & Geräte":"Maschinen & Geräte","Maschinen & Geräte Kategorien":"Maschinen & Geräte Kategorien","Maschinen & Geräte Listen":"Maschinen & Geräte Listen",Material:"Material",Materialauswahl:"Materialauswahl","Max. Dateigröße: {maxFileSize} MB":"Max. Dateigröße: {maxFileSize} MB","Maximale Anzahl von Anwendungen:":"Maximale Anzahl von Anwendungen:","Maximale Anzahl von Anwendungen pro Erntejahr:":"Maximale Anzahl von Anwendungen pro Erntejahr:","Maximale Saatstärke":"Maximale Saatstärke","Maximale Menge":"Maximale Menge","Maximale Reduktion der Produkt-Konzentration":"Maximale Reduktion der Produkt-Konzentration","Maximum:":"Maximum:","Maximale Anwendungsmenge überschritten!":"Maximale Anwendungsmenge überschritten!","Maßnahme erfolgreich {mode} nach {cropYear} auf {companyName}":"Maßnahme erfolgreich {mode} nach {cropYear} auf {companyName}","Maßnahmen erfolgreich {mode} nach {cropYear} auf {companyName}":"Maßnahmen erfolgreich {mode} nach {cropYear} auf {companyName}","Maßnahme konnte nicht wieder hergestellt werden.":"Maßnahme konnte nicht wieder hergestellt werden.","Maßnahme hinzufügen":"Maßnahme hinzufügen","Maßnahme und Datum auswählen":"Maßnahme und Datum auswählen","Maßnahmen":"Maßnahmen","Maßnahmen Neu - Work In Progress":"Maßnahmen Neu - Work In Progress","Maßnahmen auf beide Felder kopieren":"Maßnahmen auf beide Felder kopieren","Maßnahmen auf {fieldName} ({fieldSize} ha) übernehmen":"Maßnahmen auf {fieldName} ({fieldSize} ha) übernehmen","Maßnahmen buchen":"Maßnahmen buchen","Maßnahme duplizieren":"Maßnahme duplizieren","Maßnahmen duplizieren":"Maßnahmen duplizieren","Maßnahme erfolgreich dupliziert":"Maßnahme erfolgreich dupliziert","Maßnahmen erfolgreich dupliziert":"Maßnahmen erfolgreich dupliziert","Maßnahmen importieren":"Maßnahmen importieren","Maßnahme konnte nicht dupliziert werden":"Maßnahme konnte nicht dupliziert werden","Maßnahmen konnten nicht dupliziert werden":"Maßnahmen konnten nicht dupliziert werden","Maßnahmen löschen":"Maßnahmen löschen","Maßnahme konnte nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}":"Maßnahme konnte nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}","Maßnahmen konnten nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}":"Maßnahmen konnten nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}","Maßnahmen mit ISOXML Taskdata importieren":"Maßnahmen mit ISOXML Taskdata importieren","Maßnahmen speichern":"Maßnahmen speichern","Maßnahmen teilen":"Maßnahmen teilen","Maßnahme verschieben":"Maßnahme verschieben","Maßnahmen verschieben":"Maßnahmen verschieben","Maßnahmen wiederherstellen":"Maßnahmen wiederherstellen","Maßnahmen wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Maßnahmen wiederherstellen, die in den letzten 90 Tagen gelöscht wurden","Maßnahmen übernehmen":"Maßnahmen übernehmen","Maßnahmen von CNH-Industrial importieren":"Maßnahmen von CNH-Industrial importieren","Maßnahmen kopieren anstatt zu verschieben":"Maßnahmen kopieren anstatt zu verschieben","Mapping zurücksetzen":"Mapping zurücksetzen",MBI:"MBI","MBI - Mehrjährige Biomasse":"MBI - Mehrjährige Biomasse","mechanische Pflegemaßnahmen":"mechanische Pflegemaßnahmen",Mehr:"Mehr","Mehr anzeigen":"Mehr anzeigen","Mehr Details":"Mehr Details","Mehr erfahren":"Mehr erfahren","Mehr Dezimalstellen":"Mehr Dezimalstellen","Mehr Infos":"Mehr Infos","Mehr infos...":"Mehr infos...","Mehrfachantrag (MFA)":"Mehrfachantrag (MFA)","Mein Profil":"Mein Profil","Meine aktuellen Favoriten":"Meine aktuellen Favoriten","Meine Rechnungen":"Meine Rechnungen","Meine Verträge":"Meine Verträge","Meinen persönlichen Berater kontaktieren...":"Meinen persönlichen Berater kontaktieren...",Menge:"Menge","Menge (t)":"Menge (t)","Menge in kg/ha":"Menge in kg/ha","Menge teilflächen-spezifisch verteilen":"Menge teilflächen-spezifisch verteilen",Mengenangabe:"Mengenangabe","Menü":"Menü","pro Hektar":"pro Hektar","Menü einklappen":"Menü einklappen","Messen beenden":"Messen beenden","Messen von Strecken":"Messen von Strecken",Mg:"Mg","Mg-Klasse":"Mg-Klasse",Mindestabstand:"Mindestabstand","Mineraldünger":"Mineraldünger","Mineraldüngung":"Mineraldüngung","Minimum:":"Minimum:","Minimale Saatstärke":"Minimale Saatstärke","Minimale & maximale Saatstärke":"Minimale & maximale Saatstärke","Min/max Saatstärke ändern":"Min/max Saatstärke ändern","Mit diesem Schieberegler kannst du k
1alkulierbare Verluste berücksichtigen und die Saatstärke pauschal korrigieren (1-15%). Pflanzenverluste können beispielsweise auftreten durch:":"Mit diesem Schieberegler kannst du kalkulierbare Verluste berücksichtigen und die Saatstärke pauschal korrigieren (1-15%). Pflanzenverluste können beispielsweise auftreten durch:","Mit Farmdok können Sie die Dokumentation der durchgeführten Feldarbeiten direkt von der CNH-Plattform laden und automatisch Maßnahmen in Farmdok erstellen. Alles, was du dazu brauchst, ist ein Account bei New Holland MyPLM® Connect, Case AFS Connect oder STEYR S-FLEET und ein geeingetes ISOBUS Display auf deinem Traktor.":"Mit Farmdok können Sie die Dokumentation der durchgeführten Feldarbeiten direkt von der CNH-Plattform laden und automatisch Maßnahmen in Farmdok erstellen. Alles, was du dazu brauchst, ist ein Account bei New Holland MyPLM® Connect, Case AFS Connect oder STEYR S-FLEET und ein geeingetes ISOBUS Display auf deinem Traktor.","Mit FARMDOK kannst du Aufträge bzw. Applikationskarten direkt an deine John Deere Maschinen schicken. Dafür benötist du lediglich einen Account auf MyJohnDeere.com und musst deine Maschinen mit diesem Account verknüpfen. Du kannst die Applikationskarte auch ohne Account übertragen indem du sie herunterlädst und händisch mit einem USB-Stick überträgst.":"Mit FARMDOK kannst du Aufträge bzw. Applikationskarten direkt an deine John Deere Maschinen schicken. Dafür benötist du lediglich einen Account auf MyJohnDeere.com und musst deine Maschinen mit diesem Account verknüpfen. Du kannst die Applikationskarte auch ohne Account übertragen indem du sie herunterlädst und händisch mit einem USB-Stick überträgst.","Mit Google anmelden":"Mit Google anmelden",Mittel:"Mittel",mittel:"mittel","Mittlere Dosierung (kg/ha)":"Mittlere Dosierung (kg/ha)","Mittlere Dosierung in kg/ha über alle ausgewählten Flächen, Nährstoffe in kg/ha":"Mittlere Dosierung in kg/ha über alle ausgewählten Flächen, Nährstoffe in kg/ha",Monate:"Monate",Monitoring:"Monitoring","Variable Pflanzenschutzkarte":"Variable Pflanzenschutzkarte",Vermehrungsgemeinschaft:"Vermehrungsgemeinschaft",Vermehrungsgemeinschaften:"Vermehrungsgemeinschaften","Vermehrungsgemeinschaft erstellen":"Vermehrungsgemeinschaft erstellen","Vermehrungsgemeinschaft bearbeiten":"Vermehrungsgemeinschaft bearbeiten","Vermehrungsgemeinschaft löschen":"Vermehrungsgemeinschaft löschen",MyJohnDeere:"MyJohnDeere","MyJohnDeere öffnen":"MyJohnDeere öffnen","Mähdrusch":"Mähdrusch","Möchtest Du mit diesen Werten fortsetzten oder die Einstellungen auf die empfohlenen Werte zurücksetzen?":"Möchtest Du mit diesen Werten fortsetzten oder die Einstellungen auf die empfohlenen Werte zurücksetzen?","Möchtest du fortfahren?":"Möchtest du fortfahren?",N:"N",NDVI:"NDVI","NDVI - Biomasse":"NDVI - Biomasse","NDWI - Wassergehalt":"NDWI - Wassergehalt",Nachname:"Nachname","nach Kultur":"nach Kultur","nach letzter Tätigkeit":"nach letzter Tätigkeit","nach NDVI":"nach NDVI","nach MBI":"nach MBI","nach Sorte":"nach Sorte","Nächster Konflikt":"Nächster Konflikt","Nächster Schritt":"Nächster Schritt",Name:"Name","Name des Sender-Betriebs":"Name des Sender-Betriebs","Nein, Maßnahmen an der Quelle löschen.":"Nein, Maßnahmen an der Quelle löschen.","Nein, nur Felder kopieren.":"Nein, nur Felder kopieren.",Nein:"Nein",Neu:"Neu","Neu laden":"Neu laden","Neues Feld":"Neues Feld","Neues Assessment starten":"Neues Assessment starten","Nicht alle importierten Kulturen konnten FARMDOK Kulturen zugeordnet werden.":"Nicht alle importierten Kulturen konnten FARMDOK Kulturen zugeordnet werden.","Nicht gepflegt":"Nicht gepflegt","Nicht übernehmen":"Nicht übernehmen",Niederschlag:"Niederschlag","Kumulierter Niederschlag":"Kumulierter Niederschlag","Noch keine Einträge vorhanden.":"Noch keine Einträge vorhanden.","Noch keine Erntedaten für <strong>{name}</strong> verfügbar.":"Noch keine Erntedaten für <strong>{name}</strong> verfügbar.","Noch keine Fruchtfolge vorhanden.":"Noch keine Fruchtfolge vorhanden.","Noch keine Maßnahmen vorhanden.":"Noch keine Maßnahmen vorhanden.","Noch keine Notizen vorhanden.":"Noch keine Notizen vorhanden.",Notizen:"Notizen","Notizen und Arbeitsanweisungen":"Notizen und Arbeitsanweisungen","NPK in %":"NPK in %",Nr:"Nr",Nummer:"Nummer","Nutzung durch":"Nutzung durch",Nutzungsart:"Nutzungsart",Nutzungsarten:"Nutzungsarten","Nuzungsart in der Datenquelle (aus dem Import)":"Nuzungsart in der Datenquelle (aus dem Import)","Nährstoffbilanz":"Nährstoffbilanz","Nährstoffbilanz teilen":"Nährstoffbilanz teilen","Nährstoffe eingeben":"Nährstoffe eingeben","Nährstoffmenge":"Nährstoffmenge","Nährstoffmenge ändern":"Nährstoffmenge ändern","Nährstoffvergleich":"Nährstoffvergleich","N-Rate 1. Gabe (kg/ha)":"N-Rate 1. Gabe (kg/ha)","N-Rate 2. Gabe (kg/ha)":"N-Rate 2. Gabe (kg/ha)",OK:"OK","Obst und Hopfen":"Obst und Hopfen","Offene Verträge":"Offene Verträge",Optionen:"Optionen","Optionen schließen":"Optionen schließen",Organisation:"Organisation","Organisation verbessern":"Organisation verbessern","Originalgröße":"Originalgröße",Ort:"Ort",Other:"Other",P:"P","PDF Herunterladen":"PDF Herunterladen",PLZ:"PLZ",Packungen:"Packungen","Papierlos arbeiten":"Papierlos arbeiten",Partner:"Partner","Partner-Nummer":"Partner-Nummer",'Partner-Nummer – Siehe Zugangsdaten auf <a href="https://ris.agrana.com" target="_blank">https://ris.agrana.com</a>':'Partner-Nummer – Siehe Zugangsdaten auf <a href="https://ris.agrana.com" target="_blank">https://ris.agrana.com</a>',"Partner-Nummer, Kunden-Nummer, CRM Id":"Partner-Nummer, Kunden-Nummer, CRM Id","Partner-Status":"Partner-Status","Partner wählen":"Partner wählen",Parzellen:"Parzellen","Parzellen Nr.":"Parzellen Nr.","Parzellennummer suchen":"Parzellennummer suchen","Passende Kulturen":"Passende Kulturen","Passende Sorten":"Passende Sorten",Passwort:"Passwort","Passwort speichern":"Passwort speichern","Passwort vergessen?":"Passwort vergessen?","Passwort zurücksetzen":"Passwort zurücksetzen",Pause:"Pause",Permissions:"Permissions",Personen:"Personen","Persönliche Einstellungen":"Persönliche Einstellungen",PFLANZENSCHUTZ:"PFLANZENSCHUTZ",Pflanze:"Pflanze",Pflanzenschutz:"Pflanzenschutz",Pflanzenschutzmittel:"Pflanzenschutzmittel","Pflanzenschutzmittelkatalog öffnen":"Pflanzenschutzmittelkatalog öffnen",Pflichtfeld:"Pflichtfeld",Planung:"Planung",Plattform:"Plattform","Plattform öffnen":"Plattform öffnen","Positionen senden":"Positionen senden",Postleitzahl:"Postleitzahl","Precision Farming":"Precision Farming",Premium:"Premium","Probleme? Bitte schreib uns an [email protected] und übermittle die verwendeten Importdateien.":"Probleme? Bitte schreib uns an [email protected] und übermittle die verwendeten Importdateien.",Produkt:"Produkt","Produkt auswählen":"Produkt auswählen","Produkt entfernen":"Produkt entfernen","Produkt hinzufügen":"Produkt hinzufügen",Produkte:"Produkte","Produkt vor Menge einstellen":"Produkt vor Menge einstellen","Produkt wählen":"Produkt wählen","Produkt- & Maschinenauswahl":"Produkt- & Maschinenauswahl","Produktivität steigern":"Produktivität steigern",Produktkombination:"Produktkombination",Profil:"Profil",Prognose:"Prognose","Prüfstand in m":"Prüfstand in m","P₂O₅-Klasse":"P₂O₅-Klasse","Randbereich korrigiert"
1:"Randbereich korrigiert","Randbereich nicht korrigiert":"Randbereich nicht korrigiert","REIP - Stickstoffgehalt":"REIP - Stickstoffgehalt","Referenz oder Freigabegrund":"Referenz oder Freigabegrund","Referenz-Nummer":"Referenz-Nummer","Reine Kartoffel (t)":"Reine Kartoffel (t)","Reine Rübe (t)":"Reine Rübe (t)","Reinekartoffel: {amountPotato} Stärkegehalt: {amountStarch}":"Reinekartoffel: {amountPotato} Stärkegehalt: {amountStarch}",Report:"Report",Reports:"Reports","Rüstzeit":"Rüstzeit",Risiko:"Risiko",Risikokategorie:"Risikokategorie","Saatbau Mais Aussaatkarte":"Saatbau Mais Aussaatkarte","Saatbau Soja Aussaatkarte":"Saatbau Soja Aussaatkarte","Saatbett-Bedingungen (Scholligkeit, Wasserverfügbarkeit, …)":"Saatbett-Bedingungen (Scholligkeit, Wasserverfügbarkeit, …)",Saatgut:"Saatgut",Saatdatum:"Saatdatum","Saatgut jetzt bestellen SESAM24":"Saatgut jetzt bestellen SESAM24","Saatstärke":"Saatstärke","Saatstärke in Körner/ha":"Saatstärke in Körner/ha","Saatzeitpunkt außerhalb des Optimums":"Saatzeitpunkt außerhalb des Optimums",Sales:"Sales",Satellit:"Satellit",Satellitenbild:"Satellitenbild",Satellitenbilder:"Satellitenbilder","Satellitenbilder am gewählten Datum anzeigen":"Satellitenbilder am gewählten Datum anzeigen",Satellitenindex:"Satellitenindex",Schlag:"Schlag","Schlag Nr":"Schlag Nr",Schlagblatt:"Schlagblatt","Schlagblatt für {fieldName}":"Schlagblatt für {fieldName}","Schlagblatt teilen":"Schlagblatt teilen","Schließen":"Schließen",Schnee:"Schnee","Schritt zurück":"Schritt zurück","Schädling auswählen":"Schädling auswählen","Seite drucken":"Seite drucken","Seite verlassen":"Seite verlassen","Sekundärrohstoffe":"Sekundärrohstoffe","Selektierte Felder exportieren":"Selektierte Felder exportieren","Sende Applikationskarte":"Sende Applikationskarte","Sende die Applikationskarte direkt an die Cloud-Plattform deines Maschinenherstellers.":"Sende die Applikationskarte direkt an die Cloud-Plattform deines Maschinenherstellers.","Sende deinem Partner einen Link, der ihn direkt zum Vertrag führt. Er kann dort mit wenigen Klicks Felder freigeben.":"Sende deinem Partner einen Link, der ihn direkt zum Vertrag führt. Er kann dort mit wenigen Klicks Felder freigeben.",Senden:"Senden","Senden an":"Senden an",Sender:"Sender","Sender-Referenz":"Sender-Referenz",'Setze das Feld "aktiv", wenn es ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden soll. Vorangehende Erntejahre werden auf diesem Feld abgeschlossen.':'Setze das Feld "aktiv", wenn es ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden soll. Vorangehende Erntejahre werden auf diesem Feld abgeschlossen.','Setze das Feld auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Das Feld wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Setze das Feld auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Das Feld wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.','Setze das Feld auf "geplant", wenn das Erntejahr {current} auf diesem Feld noch nicht begonnen hat.':'Setze das Feld auf "geplant", wenn das Erntejahr {current} auf diesem Feld noch nicht begonnen hat.',"Setze dein neues Passwort":"Setze dein neues Passwort",'Setze den Status auf "geplant", wenn das Erntejahr {current} auf den ausgewählten Feldern noch nicht begonnen hat.':'Setze den Status auf "geplant", wenn das Erntejahr {current} auf den ausgewählten Feldern noch nicht begonnen hat.','Setze die ausgewählten Felder "aktiv", wenn sie ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden sollen. Vorangehende Erntejahre werden auf diesen Feldern abgeschlossen.':'Setze die ausgewählten Felder "aktiv", wenn sie ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden sollen. Vorangehende Erntejahre werden auf diesen Feldern abgeschlossen.','Setze die ausgewählten Felder auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Die Felder werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Setze die ausgewählten Felder auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Die Felder werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',"Setze mittlere Dosierung in kg/ha":"Setze mittlere Dosierung in kg/ha",Seitenausrichtung:"Seitenausrichtung",Shapef
1ile:"Shapefile",Shop:"Shop","Sichtbare Einträge":"Sichtbare Einträge","Sie sind nun im Erntejahr {current} aktiv und werden in den vorangehenden Erntejahren auf abgeschlossen gestellt.":"Sie sind nun im Erntejahr {current} aktiv und werden in den vorangehenden Erntejahren auf abgeschlossen gestellt.","Sie wurden für {current} auf geplant gestellt.":"Sie wurden für {current} auf geplant gestellt.","Sie wurden im Erntejahr {current} abgeschlossen und werden in {next} aktiv gestellt.":"Sie wurden im Erntejahr {current} abgeschlossen und werden in {next} aktiv gestellt.",SingleSeed:"Einzelkornsaat","Sollen bereits gebuchte Maßnahmen für das neue Feld übernommen werden?":"Sollen bereits gebuchte Maßnahmen für das neue Feld übernommen werden?","Sollen die Flächen aus dem Vorjahr übernommen werden?":"Sollen die Flächen aus dem Vorjahr übernommen werden?","Sollen die Flächen aus dem nachfolgenden Erntejahr übernommen werden?":"Sollen die Flächen aus dem nachfolgenden Erntejahr übernommen werden?","Sollte die E-Mail nicht auffindbar sein, {linkStart}klicke hier, um sie nochmal zu senden.{linkEnd}":"Sollte die E-Mail nicht auffindbar sein, {linkStart}klicke hier, um sie nochmal zu senden.{linkEnd}",Sonstige:"Sonstige","Sonstige Grünlandarbeiten":"Sonstige Grünlandarbeiten","Sonstige Hilfsstoffe und Dünger":"Sonstige Hilfsstoffe und Dünger","Sonstige organische Düngemittel":"Sonstige organische Düngemittel",Sorte:"Sorte","Sorte in der Datenquelle (aus dem Import)":"Sorte in der Datenquelle (aus dem Import)","Sorte:":"Sorte:",Sorten:"Sorten","Sorte wählen":"Sorte wählen","Sortieren: A {arrowRight} Z":"Sortieren: A {arrowRight} Z","Sortieren: Z {arrowRight} A":"Sortieren: Z {arrowRight} A","Sortieren: absteigend":"Sortieren: absteigend","Sortieren: aufsteigend":"Sortieren: aufsteigend","Spaltenreihenfolge ändern":"Spaltenreihenfolge ändern","Spaltenüberschrift aus Datei":"Spaltenüberschrift aus Datei",Speichern:"Speichern","Spritzbrühe":"Spritzbrühe",Standard:"Standard","Standard - Shapefile":"Standard - Shapefile","Standardeinheit {amount} Körner je Packung":"Standardeinheit {amount} Körner je Packung",Status:"Status",Startdatum:"Startdatum",Start:"Start",Startzeit:"Startzeit","Steig auf www.eama.at mit Betriebsnummer und Pincode (oder Handysignatur) ein.":"Steig auf www.eama.at mit Betriebsnummer und Pincode (oder Handysignatur) ein.","Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu FARMDOK Monitoring. Die Anwendung ermöglicht es Vegetations­unterschiede teilflächenspezifisch in der Karte darzustellen und den zeitlichen Verlauf zu analysieren.":"Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu FARMDOK Monitoring. Die Anwendung ermöglicht es Vegetations­unterschiede teilflächenspezifisch in der Karte darzustellen und den zeitlichen Verlauf zu analysieren.","Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu Freigegebenen Feldern.":"Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu Freigegebenen Feldern.",Stoffstrombilanz:"Stoffstrombilanz",Storniert:"Storniert","Straße":"Straße","Straße, Hausnummer, Tür":"Straße, Hausnummer, Tür","Stärkegehalt":"Stärkegehalt","Stärkegehalt (t)":"StärkeLehalt (t)","Stärkegehalt gesamt (t)":"Stärkegehalt gesamt (t)","Stärkegehalt gesamt: {totalStarch} t":"Stärkegehalt gesamt: {totalStarch} t","Suchbegriff eingeben ...":"Suchbegriff eingeben ...",Unterebene:"Unterebene",Unterebenen:"Unterebenen","Suche zurücksetzen":"Suche zurücksetzen",Suchen:"Suchen",Summe:"Summe","Summe Größe: {sizeTotalFormatted} ha":"Summe Größe: {sizeTotalFormatted} ha","Summe Hektar: {processedAreaTotalFormatted} ha":"Summe Hektar: {processedAreaTotalFormatted} ha",Superuser:"Superuser","Tabelle zurücksetzen":"Tabelle zurücksetzen",Tage:"Tage",Teilnehmen:"Teilnehmen",Telefonnummer:"Telefonnummer",Feuchtigkeit:"Feuchtigkeit",Hektolitergewicht:"Hektolitergewicht",Proteingehalt:"Proteingehalt","Relative Feuchtigkeit":"Relative Feuchtigkeit",Temperatur:"Temperatur",Tausendkorngewicht:"Tausendkorngewicht","Tausendkorngewicht (g)":"Tausendkorngewicht (g)","tierische Schäden (Bsp.: Wild, Vögel, Insekten, …)":"tierische Schäden (Bsp.: Wild, Vögel, Insekten, …)","Tierkategorien und Nährstoffanfall":"Tierkategorien und Nährstoffanfall","Tippen um zu suchen":"Tippen um zu suchen","Trennlinie fertigstellen":"Trennlinie fertigstellen",Trockengebiet:"Trockengebiet","Tätigkeit":"Tätigkeit","Tätigkeit wählen":"Tätigkeit wählen","Tätigkeiten":"Tätigkeiten",UBB:"UBB","Um Polygone kombinieren zu können, m
1üssen Sie mindestens 2 Polygone ausgewählt haben.":"Um Polygone kombinieren zu können, müssen Sie mindestens 2 Polygone ausgewählt haben.","Um dieses Feld zu bearbeiten, ändere die Mengenangabe auf der rechten Seite.":"Um dieses Feld zu bearbeiten, ändere die Mengenangabe auf der rechten Seite.","Umweltgerechte und biodiversitätsfördernde Bewirtschaftung.":"Umweltgerechte und biodiversitätsfördernde Bewirtschaftung.","Unbekannter Fehler":"Unbekannter Fehler","Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.":"Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.","Unerwarteter Fehler.":"Unerwarteter Fehler.","Ungültige Trennlinie":"Ungültige Trennlinie","Ungültiger Wert.":"Ungültiger Wert.",Upload:"Upload","Upload fehlgeschlagen! Die Datei scheint defekt zu sein. Probiere den Export aus der Quellapplikation zu einem späteren Zeitpunkt nochmal. Sollte das Problem weiterhin auftreten, sende die Datei bitten an den Support.":"Upload fehlgeschlagen! Die Datei scheint defekt zu sein. Probiere den Export aus der Quellapplikation zu einem späteren Zeitpunkt nochmal. Sollte das Problem weiterhin auftreten, sende die Datei bitten an den Support.","Upload in Arbeit ... DIESES FENSTER NICHT SCHLIESSEN!":"Upload in Arbeit ... DIESES FENSTER NICHT SCHLIESSEN!","Upload verlassen":"Upload verlassen","Users and Companies":"Users and Companies",Vegetation:"Vegetation","Datum der Vegetationskarte":"Datum der Vegetationskarte","Datura-Kontrollzentrum":"Datura-Kontrollzentrum",Drohnenassessments:"Drohnenassessments","Drohnenbilder hochladen":"Drohnenbilder hochladen",Vegetationsmonitoring:"Vegetationsmonitoring","Verbindung trennen":"Verbindung trennen","Verbindung trennen fehlgeschlagen.":"Verbindung trennen fehlgeschlagen.","Verbindung zu CNH Industria":"Verbindung zu CNH Industria","Verbindung zu MyJohnDeere trennen":"Verbindung zu MyJohnDeere trennen","Vereinbarungen zur Flächenmeldung":"Vereinbarungen zur Flächenmeldung","Verfügbare Maschinen":"Verfügbare Maschinen",Verkleinern:"Verkleinern","Verlustausgleich (%)":"Verlustausgleich (%)",Verlauf:"Verlauf","Job history öffnen":"Job history öffnen",verschiedene:"verschiedene",Verstecken:"Verstecken","Verteilung auf dem Feld":"Verteilung auf dem Feld",Vertrag:"Vertrag","Vertrag wählen":"Vertrag wählen",Vertragsnehmer:"Vertragsnehmer",Vertragsproduktion:"Vertragsproduktion","Vervollständige die Ernte-Maßnahmen und klicke dann hier, um sie in FARMDOK zu buchen.":"Vervollständige die Ernte-Maßnahmen und klicke dann hier, um sie in FARMDOK zu buchen.","Verwalte hier deine Flächen":"Verwalte hier deine Flächen","Verwaltete Verträge":"Verwaltete Verträge",Verwaltung:"Verwaltung","Verwendbar bis:":"Verwendbar bis:",Verwendungszweck:"Verwendungszweck",Verwerfen:"Verwerfen","Verwirkliche deinen Erfolg am Feld!":"Verwirkliche deinen Erfolg am Feld!","Von der Aussaat bis zur Ernte, alles über deine Felder an einem Ort.":"Von der Aussaat bis zur Ernte, alles über deine Felder an einem Ort.","Von dort kannst du sie vom Terminal deines Traktors abrufen ohne einen USB-Stick.":"Von dort kannst du sie vom Terminal deines Traktors abrufen ohne einen USB-Stick.","Voraussetzung: Einverständnis in eAMA abgeben!":"Voraussetzung: Einverständnis in eAMA abgeben!",Vorfrucht:"Vorfrucht","Vorfrucht in der Datenquelle (aus dem Import)":"Vorfrucht in der Datenquelle (aus dem Import)","Vorlage im Format .CSV {linkStart}herunterladen{linkEnd}":"Vorlage im Format .CSV {linkStart}herunterladen{linkEnd}",Vorname:"Vorname",Vorschau:"Vorschau","Vordefinierte Notizen":"Vordefinierte Notizen","Warnhinweise gefunden: {count}":"Warnhinweise gefunden: {count}","Wartezeit bis zur Ernte:":"Wartezeit bis zur Ernte:","Wartezeit zwischen Anwendungen:":"Wartezeit zwischen Anwendungen:","Wachstumsstadium (BBCH)":"Wachstums­stadium (BBCH)","Wachstumsstadium eingeben":"Wachstumsstadium eingeben","Wachstumsstadium wählen":"Wachstumsstadium wählen",Wasserschutzgebiet:"Wasserschutzgebiet","Was ist dein Beruf?":"Was ist dein Beruf?","Was machst du?":"Was machst du?","Was sind deine Ziele?":"Was sind deine Ziele?","Wechsle zum Reiter Kundendaten, Menüpunkt Datenfreigabe > Übersicht.":"Wechsle zum Reiter Kundendaten, Menüpunkt Datenfreigabe > Übersicht.",Wegzeit:"Wegzeit",Wein:"Wein",Weiter:"Weiter","Weitere Dateien durch Ablegen hinzufügen":"Weitere Dateien durch Ablegen hinzufügen","Weitere Details erfassen":"Weitere Details erfassen","Welche Kulturen baust du an?":"Welche Kulturen baust du an?","Weniger anzeigen":"Weniger anzeigen","Weniger Dezimalstellen":"Weniger Dezimalstellen","Wenn du den Lagerstand sehen möchtest, führe eine Lagerbewegung durch.":"Wenn du den Lagerstand sehen möchtest, führe eine Lagerbewegung durch.",Wert:"Wert","Wert muss zwischen {min} und {max} sein":"Wert muss zwischen {min} und {max} sein","Werte:":"Werte:",Wetter:"Wetter","Wetter für:":"Wetter für:",Wetterdiagramm:"Wetterdiagramm",Windgeschwindigkeit:"Windgeschwindigkeit","Wie bewirtschaftest du?":"Wie bewirtschaftest du?","Wie möchtest du importieren?":"Wie möchtest du importieren?","Wie viele Hektar werden bewirtschaftet?":"Wie viele Hektar werden bewirtschaftet?","Wie viele Kunden werden betreut?":"Wie viele Kunden werden betreut?","Wie viele Mitarbeiter gibt es?":"Wie viele Mitarbeiter gibt es?",Wiederherstellen:"Wiederherstellen","Willst du Ernte-Maßnahmen in FARMDOK erstellen? Aktiviere die Kontrollkästchen in der ersten Spalte, dann klicke hier um zum nächsten Schritt zu gehen.":"Willst du Ernte-Maßnahmen in FARMDOK erstellen? Aktiviere die Kontrollkästchen in der ersten Spalte, dann klicke hier um zum nächsten Schritt zu gehen.","Willst du ein neues Erntejahr {newYear} hinzufügen?":"Willst du ein neues Erntejahr {newYear} hinzufügen?","Willst du wirklich das gewählte Feldstück löschen?":"Willst du wirklich das gewählte Feldstück löschen?","Willst du wirklich {count} Feldstücke löschen?":"Willst du wirklich {count} Feldstücke löschen?","Willst du wirklich {name} löschen?":"Willst du wirklich {name} löschen?",Winterdienst:"Winterdienst","Wintergetreide {n}. Gabe":"Wintergetreide {n}. Gabe","Wir fühlen uns dazu verpflichtet dir maßgeschneiderte Unterstützung zu bieten!":"Wir fühlen uns dazu verpflichtet dir maßgeschneiderte Unterstützung zu bieten!","Wir haben dir eine E-Mail an {email} gesendet.":"Wir haben dir eine E-Mail an {email} gesendet.","Wir senden dir ein E-Mail zu, mit Hilfe dessen du ein neues Passwort setzen kannst.":"Wir senden dir ein E-Mail zu, mit Hilfe dessen du ein neues Passwort setzen kannst.","Wirtschaftsdünger":"Wirtschaftsdünger",Wolken:"Wolken","Wähle das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.":"Wähle das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.","Wähle das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.":"Wähle das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.","Wähle das Ziel-Erntejahr, wohin {field} kopiert werden soll.":"Wähle das Ziel-Erntejahr, wohin {field} kopiert werden soll.","Wähle das Ziel-Erntejahr, wohin {field} verschoben werden soll.":"Wähle das Ziel-Erntejahr, wohin {field} verschoben werden soll.","Wähle dein Land und melde dich an.":"Wähle dein Land und melde dich an.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.":"Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.":"Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} kopiert werden soll.":"Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} kopiert werden soll.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} verschoben werden soll.":"Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} verschoben werden soll.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Maßnahmen verschoben werden sollen.":"Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Maßnahmen verschoben werden sollen.","Wähle den ausführenden Betrieb":"Wähle den ausführenden Betrieb","Wähle die Felder in der Karte oder in der Liste.":"Wähle die Felder in der Karte oder in der Liste.","Wähle die Felder, auf denen du Ernte-Maßnahmen erstellen möchtest, vervollständige die Informationen und klicke dann hier, um zu speichern.":"Wähle die Felder, auf denen du Ernte-Maßnahmen erstellen möchtest, vervollständige die Informationen und klicke dann hier, um zu speichern.","Wähle die Maschine an die du den Auftrag bz
1w. die Applikationskarte senden möchtest. Wähle <b>MyJohnDeere</b> falls du die Daten in die MyJohnDeere Plattform senden möchtest.":"Wähle die Maschine an die du den Auftrag bzw. die Applikationskarte senden möchtest. Wähle <b>MyJohnDeere</b> falls du die Daten in die MyJohnDeere Plattform senden möchtest.","Wähle ein Dateiformat abhängig vom Terminal, auf dem die Applikationskarte verwendet werden soll.":"Wähle ein Dateiformat abhängig vom Terminal, auf dem die Applikationskarte verwendet werden soll.","Wähle ein Produkt":"Wähle ein Produkt","Wähle eine Option um fortzufahren":"Wähle eine Option um fortzufahren","Wähle einen Betrieb um deine Berichte anzuzeigen.":"Wähle einen Betrieb um deine Berichte anzuzeigen.","Wähle mindesten ein Feld mit dem Kontrollkästchen in der ersten Spalte. Alle ausgewählten Felder müssen eine Kultur haben.":"Wähle mindesten ein Feld mit dem Kontrollkästchen in der ersten Spalte. Alle ausgewählten Felder müssen eine Kultur haben.","Wähle zumindest 1":"Wähle zumindest 1","Wähle zumindest 2":"Wähle zumindest 2","Wähle “Standard” wenn dein Terminal-Hersteller nicht in der Liste angeführt ist.":"Wähle “Standard” wenn dein Terminal-Hersteller nicht in der Liste angeführt ist.","Wählen":"Wählen","Wählen ...":"Wählen ...","Wählen...":"Wählen...","Wählen Sie Polygone in der Karte aus, um Felder zu erstellen. Sie können mehrere Polygone zusammenführen, wenn sie mehrere Polygone zu einem Feld zusammenführen möchten.":"Wählen Sie Polygone in der Karte aus, um Felder zu erstellen. Sie können mehrere Polygone zusammenführen, wenn sie mehrere Polygone zu einem Feld zusammenführen möchten.","Wähle ein Feld in der Karte und gib den Prüfabstand ein. Die Feldkontur wird um den Prüfabstand nach außen verschoben und alle Felder gekennzeichnet, die vom Prüfabstand geschnitten werden.":"Wähle ein Feld in der Karte und gib den Prüfabstand ein. Die Feldkontur wird um den Prüfabstand nach außen verschoben und alle Felder gekennzeichnet, die vom Prüfabstand geschnitten werden.","Wärmesumme":"Wärmesumme","Qualität":"Qualität","Qualitätsdüngung (3. Gabe)":"Qualitätsdüngung (3. Gabe)",Querformat:"Querformat",XLS:"XLS","ZIEHE DIE DATEI HIER HER":"ZIEHE DIE DATEI HIER HER","Zeichnen beenden":"Zeichnen beenden","Zeichnen eines Polygons":"Zeichnen eines Polygons","Zeichnen einer Polyline":"Zeichnen einer Polyline","Zeichnen Sie Polygone oder Linien in die Karte, um Ihr GIS-Objekt darzustellen.":"Zeichnen Sie Polygone oder Linien in die Karte, um Ihr GIS-Objekt darzustellen.","Zeitraum von {periodStart} bis {periodEnd}":"Zeitraum von {periodStart} bis {periodEnd}","Zeitraum:":"Zeitraum:",Zeitstempel:"Zeitstempel","Ziehe die exportierte(n) Datei(en) mit der Maus in das weiße Rechteck mit dem strichlierten Rahmen (Drag &amp; Drop).":"Ziehe die exportierte(n) Datei(en) mit der Maus in das weiße Rechteck mit dem strichlierten Rahmen (Drag &amp; Drop).","Ziel auswählen":"Ziel auswählen","Ziel N-Rate (kg/ha)":"Ziel N-Rate (kg/ha)","Ziel-Betrieb":"Ziel-Betrieb","Ziel-Erntejahr":"Ziel-Erntejahr","Zielbetrieb: In welchen Betrieb sollen die Daten importiert werden?":"Zielbetrieb: In welchen Betrieb sollen die Daten importiert werden?","Zielertrag (kg/ha)":"Zielertrag (kg/ha)",Zone:"Zone",Zonen:"Zonen","Zonen Ergebnis":"Zonen Ergebnis","Zonen erstellen":"Zonen erstellen","Zonenkarte erstellen":"Zonenkarte erstellen","Zonen basiert auf {indexType}, Anzahl der Zonen: {quantisationCode}":"Zonen basiert auf {indexType}, Anzahl der Zonen: {quantisationCode}",Zonierung:"Zonierung","Zu den Berichten":"Zu den Berichten","Zu den offenen Verträgen":"Zu den offenen Verträgen","Zu meinen Verträgen":"Zu meinen Verträgen","Zuckergehalt (t)":"Zuckergehalt (t)",Zuckergehalt:"Zuckergehalt","Zugelassen bis:":"Zugelassen bis:",Zugeordnet:"Zugeordnet","Zuletzt aktualisiert":"Zuletzt aktualisiert","Zuletzt verwendet":"Zuletzt verwendet","Zum Bericht":"Zum Bericht","Zum Vertrag":"Zum Vertrag","Zum Import in dein ISOBUS-Terminal":"Zum Import in dein ISOBUS-Terminal","Zur Startseite":"Zur Startseite","Zurück":"Zurück","Zurück zu":"Zurück zu","Zurück zum Login":"Zurück zum Login","Zurück zum Login.":"Zurück zum Login.","Zurück zur Dateien-Übersicht":"Zurück zur Dateien-Übersicht","Zurück zu Felder":"Zurück zu Felder","Zurück zur Feldstücke-Startseite":"Zurück zur Feldstücke-Startseite","Zurück zu Maßnahmen":"Zurück zu Maßnahmen","Zurück zur Maßnahmen-Startseite":"Zurück zur Maßnahmen-Startseite","Zurück zur Vertragsansicht":"Zurück zur Vertragsansicht","Zurück zur Vertrags-Über
1sicht":"Zurück zur Vertrags-Übersicht","Zurück zur Verwaltungs-Übersicht":"Zurück zur Verwaltungs-Übersicht","Zurücksetzen":"Zurücksetzen","Zusammenarbeit verbessern":"Zusammenarbeit verbessern","Zusammenfassung je Schlag":"Zusammenfassung je Schlag","Zusammenführen von Polygonen":"Zusammenführen von Polygonen",Zwischenfrucht:"Zwischenfrucht","ab BBCH":"ab BBCH","aus Import":"aus Import","Assessment erstellen":"Assessment erstellen","Assessment Name":"Assessment Name","bearbeitete Fläche (ha)":"bearbeitete Fläche (ha)","bis BBCH":"bis BBCH","eAMA Online Flächen Import":"eAMA Online Flächen Import","eAMA PIN":"eAMA PIN","eAMA öffnen":"eAMA öffnen","eAMA-Betriebsnummer":"eAMA-Betriebsnummer",empfohlen:"empfohlen","für Mineraldünger":"für Mineraldünger","gelöscht am":"gelöscht am",ha:"ha","in FARMDOK":"in FARMDOK","je mehr desto mehr":"je mehr desto mehr","je weniger desto mehr":"je weniger desto mehr","keine Angabe":"keine Angabe","Keine gültigen Schadfaktoren für Mittel <strong>{pesticide}</strong> und <strong>{culture}</strong> gewählt":"Keine gültigen Schadfaktoren für Mittel <strong>{pesticide}</strong> und <strong>{culture}</strong> gewählt","Ko/m^2":"Kö/m²","kg/ha":"kg/ha","manuelle Dosierung":"manuelle Dosierung","Möchten Sie die Bewertung wirklich abbrechen?":"Möchten Sie die Bewertung wirklich abbrechen?","oder klicke Datei auswählen oder Ordner auswählen, um eine Datei hinzuzufügen.":"oder klicke {0}Datei auswählen{0} oder {0}Ordner auswählen{0}, um eine Datei hinzuzufügen.",pH:"pH",t:"t",und:"und","{countSelected} von {countAvailable} Betrieben ausgewählt":"{countSelected} von {countAvailable} Betrieben ausgewählt","{count} Felder":"{count} Felder","{count} Felder ohne Erntemaßnahme":"{count} Felder ohne Erntemaßnahme","{count} von {total} Feldern mit Erntemaßnahme":"{count} von {total} Feldern mit Erntemaßnahme","{field} ist ein Pflichtfeld.":"{field} ist ein Pflichtfeld.","{field} muss mindestens {length} Zeichen lang sein.":"{field} muss mindestens {length} Zeichen lang sein.","{name}: {sizeFormatted} ha":"{name}: {sizeFormatted} ha","{number} Flächen ({area} ha) an {partner} gesendet.":"{number} Flächen ({area} ha) an {partner} gesendet.","{seedrateMin} bis {seedrateMax} Körner pro Hektar":"{seedrateMin} bis {seedrateMax} Körner pro Hektar","{seedrateMin} bis {seedrateMax} Körner pro m^2":"{seedrateMin} bis {seedrateMax} Kö/m²","{size} ha":"{size} ha","{value} %":"{value} %","°C Wärmesumme in {year}":"°C Wärmesumme in {year}","Überspringen":"Überspringen","„hoch“ ergibt mehrere, kleine Teilflächen; „niedrig“ weniger, größere":"„hoch“ ergibt mehrere, kleine Teilflächen; „niedrig“ weniger, größere","Übrig in":"Übrig in","Übrig am Betrieb (kein spezifisches Lager)":"Übrig am Betrieb (kein spezifisches Lager)",UploadPending:"Ausstehend",UploadExpired:"Abgelaufen",Calculating:"Wird analysiert",Finished:"Abgeschlossen",Failed:"Fehlgeschlagen"}}function jb(){return{"":"","#FEHLER":"#ERROR","(Alle auswählen)":"(Select all)","(leer)":"(empty)","(verschiedene)":"(various)","1 Feld mit Erntemaßnahme":"1 field with harvest activity","1 Feld ohne Erntemaßnahme":"1 field without harvest activity","1 Fläche ({area} ha) an {partner} gesendet.":"1 field ({area} ha) transmitted to {partner}.","404: Nicht gefunden.":"404: Not found.","<Bezeichnung>":"<Name>","<strong>Lege die Datei hier ab</strong> <small>oder drücke hier, um eine Datei hinzuzufügen.</small>":"<strong>Drop the file here</strong <small> or click here to select a file.</small>","AGRANA FSNr - Feldname":"AGRANA Field group no - field name","AMA Code":"AMA code","AMA Code in der Datenquelle (aus dem Import)":"AMA code in the data source (from import)","AMA Codes":"AMA codes",Anonym:"Anonymous",Abbrechen:"Cancel",Abgeschlossen:"Completed",Ablaufdatum:"Date of expiry","Ablaufdatum:":"Expiry date:",Abmelden:"Logout","Abschließen":"Complete",Absenden:"Send","Abstand prüfen":"Check distance",Achtung:"Warning","Die Saatstärke ist in einer oder mehreren Zonen beträchtlich {comparative} als üblich.":"The seed rate is considerably {comparative} than usual in one or more zones.","Die Variation von Ausbringmengen bei der Applikation von Herbiziden birgt das Risiko, dass der Schaderreger nicht effektiv bekämpft wird. Die variable Ausbringung von Herbiziden wir nicht empfohlen.":"Varying application rates when applying herbicides harbours the risk that the pest is not effectively controlled. The variable application of herbicides is not recommended.","Die Variation von Ausbringmengen bei der Applikation von Insektiziden birgt hohes Risiko der Bildung von Resistenzen. Die variable Ausbringung von Insektiziden wird nicht empfohlen.":"Varying application rates when applying insecticides involves a high risk of resistance developing. The variable application of insecticides is not recommended.","Achtung! Beim Verlassen der Seite wird das Hochladen abgebrochen!":"Warning! The upload will be cancelled when you leave the page!",Ackerkulturen:"Arable crops",Adresse:"Address","Adresse suchen":"Search adress","Aktion sicher ausführen?":"Are you sure to perform this action?",Aktionsgebiet:"Action area",Aktiv:"Active","Aktiv setzen":"Set active","Aktiviere deinen sicheren Zugang!":"Activate your account!","Aktiviere den Schalter, um Unterebenen in der Karte anzuzeigen.":"Activate the switch to display sublayers in the map.",Aktivieren:"Activate","Aktivität konnte nicht importiert werden. Fehler: ":"Activity could not be imported. Error: ","Aktualisiere den in der Arbeitsplanung geplanten Auftrag und füge die eben erstellte Applikationskarte hinzu.":"Add the application map you just created to the task from the task plan.","Aktuell unterstützt FARMDOK Applikationskarten nur für Mineraldüngung.":"Currently FARMDOK only supports application maps for mineral fertilization.","Aktuell:":"Current:",Alle:"All","Alle ausblenden":"Hide all","Alle Dateien entfernen":"Remove all files","Alle Einträge":"All entr
1ies","Alle Farmen":"All farms","Alle Felder":"All fields","Alle Werte in kg/ha":"Values in kg/ha","Alle Werte in Körner/ha":"Values in grains/ha","Alle Werte in Körner/m^2":"Values in grains/m²","Alle anzeigen":"Show all","Alle auswählen":"Select all","Alle wählen":"Select all","Alle ausgewählten Polygone werden zu einem vereint. Willst du fortsetzen?":"All selected polygons will be combined into one. Do you want to continue?","Allgemeinen Geschäftsbedingungen (AGB)":"Terms of service","Als Excel-Datei exportieren":"Export as Excel file","An angegebene Betriebe zum Lesen freigegeben.":"Shared with specified accounts for read-only access.","An diesem Datum wurde das Satellitenbild aufgenommen. Alle 5 Tage passiert der Satellit die gleiche Stelle. Bedingt durch Wolken und Wetter ist nicht jedes Bild verwendbar.":"On this date, the satellite image was taken. The satellite passes the same location every 5 days. Due to clouds and weather not every image is usable.",Anbau:"Cultivation",Anbauplanung:"Cultivation plan",Andere:"Other","Andere Tätigkeiten":"Other activities","Angezeigt: {visible} von {total}":"Displaying: {visible} of {total}","Anleitung: Woher bekomme ich eine Datei mit meinen Feldern?":"Guide: Where can I get a file with my fields?","Anleitung: Woher bekomme ich eine ISOXML Datei mit meinen Maßnahmen?":"Hint: Where can I get an ISOXML file with my activities?","Anleitung: Die KI-unterstützte Auswertung von Drohnenbilder ermöglicht es Stechapfelpflanzen im Soja zu erkennen und geolokalisiert in einer Karte zu kennzeichnen. Woher bekomme ich geeignete Drohnenbilder für diese Auswertung?":"Instructions: The AI-supported evaluation of drone images makes it possible to recognise datura plants in soybeans and mark them geolocated on a map. Where can I get suitable drone images for this analysis?","Anleitung: Der Umfang auszuwertender Bilddaten kann sehr groß sein. Es können Einzelbilder, eine .zip-Datei mit Bildern oder ein Order mit Bildern hochgeladen werden. Bei großen Datenmengen oder schlechter Internetverbindung kann das Hochladen mehrere Stunden dauern. Achtung: Die Benennung der Dateien muss eindeutig sein. Duplikate überschreiben das Original.":"Instructions: The volume of image data to be evaluated can be very large. Individual images, a .zip file with images or a folder with images can be uploaded. If the data volume is large or the internet connection is poor, the upload can take several hours. Important: The file names must be unique. Duplicates overwrite the original.",Ansehen:"View",Antrag:"Application","Anwendungszeitpunkt:":"Application time:","Anzahl Einträge: {total}":"Number of entries: {total}","Anzahl der Tasks auf der CNH-Plattform:":"Number of tasks on the CNH platform:","Anzahl der Zonen":"Number of zones","Anzahl Felder":"Qty fields","Anzahl Packungen":"Number of packages","Anzahl Bilder":"Number of images",Anzeige:"Display",Anzeigen:"Show","Anzeige der Unterebenen von Isolationszonen":"Display of sublevels of isolation zones","Analyse gestartet":"Analysis started","Assessment erstellen":"New assessment","Assessment Name":"Assessment name","Applikationskarte an John Deere senden":"Send application map to John Deere","Applikationskarte erstellen":"Create application map","Applikationskarte senden an ...":"Send application map to ...",Applikationskarte:"Application map",Applikationskarten:"Application maps","Applikationskarten für Ausgleichs- oder Qualitätsdüngung. Zonierung mittels Satelliten oder importierten Daten.":"Application maps for balancing or quality fertilization. Zoning by means of satellites or imported data.","Applikationskarten für Ausgleichs- oder Qualitätsdüngung von Getreide. Ein Projekt von Josephinum Research.":"Application maps for compensatory or quality fertilisation of cereals. A project of Josephinum Research.","Applikationskarten für die variable Ausbringung von Wachstumsregler und Fungiziden auf Basis von Satellitendaten.":"Application maps for the variable application of growth regulators and fungicides based on satellite data.","Applikationskarten für Sa
1atbau Mais Aussaat.":"Prescription map for sowing maize.","Applikationskarten für Saatbau Soja Aussaat.":"Prescription map for sowing soybeans.",Arbeitsplanung:"Activity plan",Arbeitszeit:"Working time","Archiv editieren":"Edit archive",Archivieren:"Put in archive",Archiviert:"Archived","Archivierte ausblenden":"Hide archived","Archivierte einblenden":"Show archived",'Auf diesem Feld wurde bereits eine Erntemaßnahme für das Erntejahr {current} gebucht. Schließe das Erntejahr für das Feld jetzt ab, es wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'A harvest activity has already been logged on this field for the crop year {current}. Complete the crop year for the field now, it will automatically be created in the next crop year {next} and set "active".','Auf diesen Feldern wurden bereits Erntemaßnahmen für das Erntejahr {current} gebucht. Schließe das Erntejahr für die Felder jetzt ab, sie werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'These fields have already harvest activities logged for the crop year {current}. Complete the crop year for the fields now, they will be automatically created and set "active" in the next crop year {next}.',"Auf welches Feld sollen bereits gebuchte Maßnahmen übernommen werden?":"To which field should already logged activites be transferred?","Aufteilen beenden":"Close splitting",Aufteilen:"Split","Aufteilen eines Polygons":"Split a polygon",Auftrag:"Task","Auftrag aktualisieren":"Update task","Auftrag erstellen":"Create a task","Auftrag planen":"Plan task","Auftrag/Applikationskarte":"Task/application map",Auftragsnummer:"Task number","Aufzeichnungspflichten erfüllen":"Meet legal obligations","Aus importierter Datei.":"From imported file.","Ausgewählt: {selected} von {total}":"Selected: {selected} of {total}","Ausgewählte Felder in ein anderes Erntejahr verschieben":"Move selected fields to another crop year","Ausgewählte Maßnahmen in ein anderes Erntejahr oder in eine andere Farm verschieben":"Move selected activities to another crop year or farm","Ausgleichsdüngung (1. Gabe)":"Balancing fertilization (1. application)",Aussaat:"Seeding",AUSSAAT:"SEEDING","Auswahl aufheben":"Deselect all","Auswahl exportieren":"Export selection","Auswahl umkehren":"Invert selection",Auswertung:"Reporting",B:"B","Basissaatstärke":"Basic seed strength",Basistemperatur:"Base temperature","Basistemperatur ist relevant für die Wärmesumme. Es wird angenommen, dass unter ihr kein Wachstum stattfindet.":"Base temperature is relevant for the heat sum. It is assumed that no growth takes place below it.","BMMY - Mehrjährige Biomasse (3 Jahre)":"BMMY - Multi year biomass (3 years)",Bearbeiten:"Edit","Bearbeitete Fläche":"Processed area",Bedarf:"Demand","Begrünung":"Greening","Begrünung (Zwischenfrucht)":"Greening (catch crop)","Behalte diese Option bei den folgenden Konflikten bei":"Keep this option for the following conflicts","Bei Wintergetreide wird für die 2. Gabe eine konstante Düngermenge empfohlen. Wurde die erste Gabe nicht mittels Applikationskarte ausgleichend gedüngt, so kann für die 2. Gabe der Berechnungsvorschlag der erste Gabe angewendet werden.":"For winter cereals, a constant fertiliser quantity is recommended for the second application. If the first application was not fertilised by means of an application card, the recommendation for the first application can be used for the second application.","Beim Laden der Wetterdaten ist ein Fehler aufgetreten.":"An error occurred when loading weather data.","Beistrich-getrennt":"Comma separated","Bekannt, unter anderem dafür in Google Earth angezeigt zu werden":"Known, for being displayed in Google Earth (and others)",Bemerkung:"Comment",Benachrichtigungen:"Notifications",Benutzer:"User","Benutzername oder Passwort ungültig.":"Username or password invalid.","Berater-Tipp":"Expert-Hint","Berater-Tipp: Hast du Verluste durch mechanische Pflege, Wild oder ähnliche Einflüsse berücksichtigt?":"Advisor tip: Have you considered losses caused by mechanical care, game or similar influences?","Berechnen ...":"Calculating ...","Berechne einen Vorschlag für ...":"Prepare a recommendation for ...",Berichte:"Reports","Bericht erstellen":"Create report",Beschreibung:"Description","BBCH Beschreibung":"Bbch Description","Beschränkungen bei der Ernte:":"Crop limitations:","Beschränkungen für Schädlinge:":"Pest limitations:",Betrieb:"Farm","Betrieb erstellen":"Create farm","Betrieb fehlt.":"Company missing.","Betrieb wählen":"Choose farm",Betriebe:"Farms",Betriebsbezeichnung:"Farm name",Betriebsmittel:"Products",Betriebsmittelkategorien:"Product categories",Betriebsname:"Farm name",Betriebsnummer:"Farm number","Betriebsnummer des Sender-Betriebs":"Farm number of the sender farm",Bezeichnung:"Name","Bezeichnung fehlt.":"Name is missing.","Bezeichnung für Feld {number} fehlt.":"Name for field {number} is missing.",Bilder:"Images",Biologisch:"Organic",'Bitte achte darauf, die gleiche E-Mail-Adresse wie in der FARMDOK App am Smartphone oder Tablet zu verwenden. Du findest die E-Mail-Adresse in der FARMDOK App im Menüpunkt "Mehr".':'Please make sure to use the same e-mail address as in the FARMDOK app on your smartphone or tablet. You can find the e-mail address in the FARMDOK app in the menu item "More".',"Bitte beachte das Risiko von Resistenzbildung bei zu geringen Ausbringmengen von Insektiziden.":"Please bear in mind the risk of resistance developing if too little insecticide is applied.","Bitte beachte die Risiken von Resistenzbildung und abgeschwächter oder ausbleibender Wirkung bei zu geringen Ausbringmengen von Herbiziden.":"Please note the risks of resistance development and weakened or absent effect if herbicide application rates are too low.","Bitte wähle eine Option und klicke auf Weiter.":"Please select an option and click next.","Bitte wähle einen Eintrag aus.":"Please select an entry.","Bitte wähle wie Duplikate behandelt werden sollen.":"Please select how duplicates should be handled.","Bitte überprüfe deine E-Mails":"Please check your emails","Bitte überprüfe deine E-Mails!":"Please check your e-mails!","Bitte wähle ein Feld aus, bevor du fortfährst."
1:"Please select a field before proceeding.","Bitte wähle ein Produkt und eine Produktmenge aus, bevor du fortfährst.":"Please select a product and a product amount before proceeding.","Bitte wähle eine Sorte aus, bevor du fortfährst.":"Please select a variety before proceeding.","Bitte beachte die technischen Möglichkeiten deiner Feldspritze. Prüfe ob deine Feldspritze in der Lage ist die festgelegte Menge Spritzbrühe auszubringen.":"Please note the technical capabilities of your field sprayer. Check whether your field sprayer is able to apply the specified quantity of spray liquid.",Bodenproben:"Soil samples","Bodenproben teilen":"Share soil samples",Bodenfeuchtigkeit:"Soil moisture",Bodentemperatur:"Soil temperature",Ca:"Ca","Ca-Klasse":"Ca class",Christbaumkulturen:"Christmas trees",Chronologisch:"Chronological","CIre - Chlorophyll":"CIre - Chlorophyll","CNH CONNECT Plattform":"CNH CONNECT Platform","Dabei werden {count} bestehende Felder verändert.":"This changes {count} existing fields.","Dabei wird ein bestehendes Feld verändert.":"This changes one existing field.","Danke, dass Du Dich bei Farmdok registriert hast! Deine E-Mail {email} ist jetzt bestätigt. Klicke auf Weiter und danach helfen wir Dir beim Einstieg.":"Thank you for joining Farmdok! Your email {email} is now confirmed. Click on Continue and we will help you get started.",Darstellung:"Appearance","Das Abrufen der Maschinenliste von John Deere fehlgeschlagen.":"An error occurred when loading the equipment list from MyJohnDeere.","Das Erntejahr {current} für die ausgewählten Felder befindet sich in Planung.":"The crop year {current} for the selected fields is in the planning stage.","Das Erntejahr {current} für dieses Feld befindet sich in Planung.":"The crop year {current} for this field is in the planning stage.","Das Erntejahr {newYear} wurde hinzugefügt.":"The crop year {newYear} was added.","Das Feld besitzt keine Kontur":"The field has no contour","Das Feld der folgenden Maßnahme konnte im Ziel nicht gefunden werden.":"The field of the following activity could not be found in the target.","Das Feld konnte nicht wieder hergestellt werden.":"The field could not be restored.","Das Feld wird derzeit im angezeigten Erntejahr {current} bewirtschaftet.":"The field is currently cultivated in the indicated crop year {current}.","Das Feld wurde erfolgreich geteilt.":"The field was successfully split.","Das gewählte Feld existiert bereits am Ziel. Wähle wie dieses Feld behandelt werden soll.":"The selected field already exists at the destination. Choose how this field should be treated.","Das manuelle Mapping für Werte dieser Datenquelle wird zurückgesetzt in den Originalzustand.":"The manual mapping for values of this data source is reset to the original state.","Das Startdatum ist standardmäßig das Aussaatdatum der Maßnahme oder alternativ der Jahresbeginn. Es ist relevant für die Wärmesumme und die Niederschlagssumme.":"The start date is by default the sowing date of the measure or alternatively the beginning of the year. It is relevant for the heat sum and the precipitation sum.",'Die Karte auf der rechten Seite zeigt den bedruckbaren Bereich. Du kannst eine Legende erstellen und sie irgendwo im druckbaren Bereich platzieren. Die Legende wird auf der Grundlage der Kulturen erstellt (Du kannst dies mit der Einstellung "Einfärben nach..." im Menü ändern).':'The map on the right-hand side indicates the printable are. You can create a legend and place it anywhere within the printable area. The legend\'s based on the crops chosen colors (you can change this with the "Color by..." setting in the menu).',"Die zulässige Größe für ausstehende Uploads wurde überschritten. Limit wird in ca. 1 Woche automatisch zurückgesetzt.":"Exceeded maximum allowed size for pending uploads. Limit will be reset automatically in ~ 1 week.","Datei hochladen":"Upload file",Dateien:"Files","Datei herunterladen":"Download file","Dateien hochladen":"Upload files","Datei wird hochgeladen":"Uploading file","Dateien erfolgreich an John Deere gesendet.":"Files were sent to John Deere succesfully.",Dateiname:"File name","Datei-Import":"File import","Dateien hochladen und mit einem Link mit anderen teilen":"Upload files and share them via a link with others","Dateien werden für den Maßnahmenimport nicht unterstützt.":"files are not supported for importing activities.",Dateiformat:"File format",Dateityp:"File type",Daten:"Data","Daten werden importiert...":"Importing data...","Daten Ursprung":"Data origin","Daten in FARMDOK zuordnen.":"Assign data in FARMDOK.","Daten laden":"Load data","Daten-Vorschau":"Data preview",Datenquelle:"Data source",Datum:"Date","Datum an dem die Freigabe verfällt":"Date on which the share expires","Datum an dem die Datei hochgeladen wurde":"Date on which the file was uplaoded","Datum bis":"Date to","Datum von":"Date from","Deaktiviere das Kontrollkästchen um Spalten zu verstecken. Zum Ändern der Spaltenreihenfolge in der Tabelle klicke auf das Feld und ziehe es an die gewünschte Stelle.":"Deactivate the checkbox to hide columns. To change the order of columns, click on the entry and drag it to your desired position.","Ändere Dezimalstellen von Zahlen.":"Change the number of decimal places of numbers.","Dein Betrieb wurde erfolgreich erstellt.":"Your farm has been created successfully.","Dein Partner hat Felder für diesen Vertrag bereitgestellt. Dein Partner kann die Felder jederzeit aktualisieren.":"Your partner provided fields for this contract. Your partner may update the fields anytime.","Dein Passwort wurde erfolgreich gespeichert.":"Your password has been saved successfully.","Dein Profil wird für dich angepasst!":"Your profile is being be customized for you.","Deine Auswahl enthält Felder mit abgeschlossener Kontrahierung. Ändere den Partner-Status, um die Einträge zu löschen.":"Your selection contains contracted fields. Change the partner status to remove fields.","Deine E-Mail ist bestätigt.":"Your email is confirmed.","Deine Maschinen in MyJohnDeere.com":"Your machines in MyJohnDeere","Deine Organisationen in MyJohnDeere":"Your organizations in MyJohnDeere","Demnächst verfügbar":"Coming soon","Der Erntejahr-Status konnte nicht geändert werden.":"The crop year status could not be changed.","Der Index wird aus Satellitendaten berechnet und bildet die Basis für die Teilflächen (Zonen).":"The index gets calculated from satellite imagery and is the basis for subareas (zones).","Der Status der gewählten Felder wurde aktualisiert.":"The status of the selected fields has been updated.","Der Vertragsabschluss ist erfolgt. Dein Partner kann keine Aktualisierungen senden.":"Contracting is done. Your partner can not send any updates.","Der Vertrag wurde storniert. Die bereitgestellten Felder werden nicht mehr berücksichtigt.":"The contract is canceled. The provided fields are not considered anymore.","Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.":"The value from the data source (import) could not be recognized 
1with certainty. Please select an entry from the list. Otherwise, the value cannot be imported.","Der Upload der Drohnenbilder wurde erfolgreich abgeschlossen und die Analyse der Drohnenbilder gestartet. Sobald die Ergebnisse verfügbar sind, werden sie im Datura control center angezeigt. Du kannst den aktuellen Status des Assessments in der “Job history” verfolgen.":'The upload of the drone images has been successfully completed and the analysis of the drone images has been started. As soon as the results are available, they will be displayed in the Datura control centre. You can track the current status of the assessment in the "Job history".',"Deshalb wurde keine Aktivität verschoben nach {cropYear} auf {companyName}":"Therefore no activity has been moved to {cropYear} on {companyName}","Derzeit werden nur Zip-Dateien unterstützt.":"Currently only ZIP files are supported.","Detaillierte Tätigkeiten":"Detailed activity types","Details anzeigen":"Show details","Den Status des aktuellen Auftrags und den Auftragsverlauf anzeigen":"View the status of the current order and the order history","Die AGB konnten nicht geladen werden.":"Terms and conditions could not be loaded.","Die aktuelle Tabelle enthält Sub-Tabellen. Bitte wähle für welche die Einträge im exportieren XLS in einer eigenen Zeile dargestellt werden sollen.":"The current table contains sub-tables. Please select for which ones the entries in the exported XLS should be displayed in a separate row.","Die aktuelle Trennlinie ist ungültig. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt. Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.":"The current dividing line is invalid. Draw a line that divides the current field into exactly two parts. You can adjust the dividing line by dragging the corner points.","Die Daten wurden erfolgreich versendet.":"The data has been sent successfully.","Die Datei ist zu groß. (max. {maxFileSize} MB)":"The file is too big. (max. {maxFileSize} MB)","Die E-Mail-Adresse ist ungültig.":"The e-mail address is invalid.",'Die Ernte für das Erntejahr {current} ist auf den ausgewählten Feldern bereits abgeschlossen. Sie sind zur Zeit in einem zukünftigen Erntejahr "aktiv".':'The harvest for the crop year {current} is already completed on the selected fields. They are currently "active" in a future crop year.','Die Ernte für das Erntejahr {current} ist bereits abgeschlossen. Das Feld ist in einem zukünftigen Erntejahr "aktiv".':'The harvest for the crop year {current} is already completed. The field is "active" in a future harvest year.',"Die Felder aus dem nachfolgenden Erntejahr {sourceYear} übernehmen.":"Import the fields from the following crop year {sourceYear}.","Die Felder aus dem vorangehenden Erntejahr {sourceYear} werden übernommen.":"The same fields like in the previous crop year {sourceYear} will get created.","Die Felder werden derzeit im angezeigten Erntejahr {current} bewirtschaftet.":"The fields are currently being farmed in the indicated crop year {current}.","Die Felder wurden aus {sourceYear} übernommen.":"The fields were imported from {sourceYear}.","Die Felder wurden erfolgreich erstellt.":"The fields were created successfully.","Die Felder wurden erfolgreich kopiert.":"The fields have been copied successfully.","Die Felder wurden erfolgreich vereint. Du kannst die Eigenschaften des neuen Felds jetzt anpassen.":"The fields have been successfully merged. You can now customize the properties of the new field.","Die Felder wurden erfolgreich verschoben.":"The fields have been moved successfully.","Die Felder wurden erfolgreich zusammengefügt.":"The fields were successfully merged.","Die Felder wurden noch nicht erstellt. Bist du sicher, dass du den Import abbrechen willst?":"The fields have not been created yet. Are you sure you want to cancel the import?","Die Feldkontur konnte nicht aktualisiert werden.":"The field contour could not be updated.","Die Feldkonturen konnten nicht kombiniert werden.":"The field contours could not be combined.","Die Flächen wurden nicht über FARMDOK an {partner} gemeldet.":"The fields have not been transmitted to {partner} via FARMDOK.","Die Gesamt-Erntemengen wurden von {partner} geladen. Klicke hier, um im nächsten Schritt Maßnahmen auf deinen Feldern zu erstellen.":"The total harvesting amounts have been imported from {partner}. Click here to create activities on your fields in the next step.","Die Importvorschau wird geladen. Hier kannst du bereits Anpassungen vornehmen.":"Loading the import preview. Here you can make adjustments.","Die Liste der verfügbaren Länder konnte nicht geladen werden. Bitte überprüfe deine Internetverbindung und lade die Seite neu.":"The list of available countries could not be loaded. Please check your internet connection and reload the page.","Die minimale Saatstärke darf nicht größer als die maximale Saatstärke sein.":"The minimum seed rate must not be greater than the maximum seed rate.","Die maximale Saatstärke darf nicht kleiner als die minimale Saatstärke sein.":"The maximum seed rate must not be smaller than the minimum seed rate.","Die Partnernummer ist deine Identifikationsnummer bei SAATBAU LINZ eGen.":"The partner number is your identification number at SAATBAU LINZ eGen.","Die Produktmenge wurde als Gesamtmenge eingegeben. Die Menge pro Hektar hängt von der bearbeiteten Fläche ab.":"The product amount was entered as a <strong>total amount</strong>. The amount <strong>per hectare</strong> depends on the area being treated.","Die Produktmenge wurde pro Hektar eingegeben. Die Gesamtmenge hängt von der bearbeiteten Fläche ab.":"The product amount was entered <strong>per hectare</strong>. The <strong>total amount</strong> depends on the area treated.","Die Werte konnten nicht geladen werden.":"Values could not be loaded.","Die aktuelle Trennl
1inie ist ungülitg. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt.":"The current dividing line is invalid. Draw a line that splits the current field into exactly two parts.","Die folgenden Felder existieren bereits am Ziel.":"The following fields already exist at the destination.","Die gewählten Feldstücke wurden erfolgreich archiviert.":"The selected field groups were successfully archived.","Die gewählten Feldstücke wurden wieder aktiviert.":"The selected field groups were reactivated.","Die gewählten Kulturen wurden abgeschlossen. Die entsprechenden Felder sind jetzt für {next} aktiv.":"The selected crops have been completed. The corresponding fields are now active for {next}.","Die hochgeladenen Zonen stimmen nicht mit den selektierten Feldern überein. FARMDOK erstellt eine Zone für jedes Feld ohne Zone. Welcher Wert soll diesen Zonen zugewiesen werden?":"The uploaded zones do not match the selected fields. FARMDOK creates a zone for each field without a zone. What value should be assigned to these zones?","Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert oder verschoben werden.":"This attribute is required and cannot be deactivated or moved.","Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert werden.":"This attribute is required and cannot be deactivated.","Diese Eigenschaft kann nicht verschoben werden.":"This attribute cannot be moved.","Diese Funktion ist sehr beliebt. Jetzt im Shop freischalten und weitere Vorteile nutzen!":"This service is very popular. Activate it now in the shop and enjoy further benefits!","Dieses Feature unterstützt derzeit nur einen gewählten Betrieb.":"This feature currently supports only one selected company.","Dieses Dateiformat wird nicht unterstützt":"This file format is not supported","Dieses Produkt in anderen Lagern":"This product on other storages","Dieses Problem nicht mehr anzeigen":"Do not show this problem again","Differenz zwischen Zonen (%)":"Difference from zone to zone (%)","Direkt von eAMA":"Directly from eAMA",Dosierung:"Dosage",Download:"Download",Drill:"Drill Seed","Drück bei Datenempfänger FARMDOK GmbH die Taste „Einwilligung starten“ und folge den Anweisungen.":'Click the "Einwilligung starten" button at data recipient FARMDOK GmbH and follow the instructions.','Drücke "Importieren" um den Import abzuschließen.':'Click "Import" to complete the import.',"Du verfügst auf diesem Betrieb über keine Berechtigung für dieses Feature.":"You do not have permission for this feature on this farm.","Du bist derzeit bei CNH-Industrial als {userEmail} eingeloggt. Wenn du mehr als ein Unternehmen, eine Landwirtschaft oder einen Betrieb hast, wähle bitte aus.":"You are currently logged in on CNH-Industrial as {userEmail}. If you have more than one company, grower or farm, please select.","Du bist auf MyJohnDeere mit <u>{userEmail}</u> eingeloggt. Falls du mehr als eine Organisation auf MyJohnDeere hast wähle bitte die passende aus der Liste.":"You are logged in on MyJohnDeere with <u>{userEmail}</u>. If you have access to more than one organization in MyJohnDeere, please select one from the list.","Du entfernst ein Feld, das von deinem Vertragspartner bereitgestellt wurde. Gewählten Eintrag wirklich löschen?":"You are removing a field, provided from your contract partner. Do you really want to delete the selected entry?","Du hast bereits ein Konto?":"You already have an account?","Du hast derzeit keine Berechtigung auf einen Betrieb zuzugreifen.":"You do not currently have permission to access a farm.","Du hast keine Berechtigung ein neues Erntejahr hinzuzufügen.":"You do not have permission to add a new crop year.","Du hast keine E-Mail bekommen? Überprüfe bitte den Spam-Ordner.":"You did not receive an e-mail? Please check your spam folder.","Du hast noch kein Konto?":"You don't have an account yet?","Du hast noch keine Kontrakte angenommen.":"You do not have any contracts yet.","Du importierst ein Feld.":"You are about to import one field.","Du importierst {count} Felder.":"You are about to import {count} fields.","Du kannst Flächen mit Dateien im Format Shape, XML, KML, XLS, XLSX und CSV hochladen.":"You can upload fields using files in formats Shape, XML, KML, XLS, XLSX or CSV.","Du kannst aber Erntedaten importieren, sobald sie bei {partner} verfügbar sind.":"But you can import harvesting data as soon as they are available at {partner}.","Du kannst das auch bequem mit dem Smartphone oder Tablet auf der Couch machen oder auch alle deine Flächen auf einmal importieren.":"You can also do this comfortably on your smartphone or tablet on the couch, or import all your fields at once.","Du kannst deine Felder anderen Benutzern freigeben. Du musst dafür lediglich die E-Mail des Empfängers angeben.":"You can share your fields with other users. All you have to do is enter the recipient's e-mail address.","Du kannst die Eigenschaften der neuen Felder noch anpassen.":"You can still customize the properties of the new fields.","Du kannst die Flächen direkt von eAMA mit AMA-Betriebsnummer und AMA-Pin 
1importieren.":"You can import the fields directly from eAMA with AMA farm number and AMA pin code.","Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.":"You can adjust the dividing line by dragging the corner points.","Du löschst damit auch alle zugehörigen Felder in allen Erntejahren.":"You also delete all associated fields in all crop years.","Du musst in eAMA einmalig die Erlaubnis geben, dass deine Flächen in FARMDOK importieren werden dürfen.":"You have to give permission once in eAMA to import your areas into FARMDOK.","Du musst zumindest ein Feld für den Import wählen.":"You have to select at least one field for import.","Duplikate erstellen.":"Create duplicates.","Duplikate im Ziel-Betrieb/Ziel-Erntejahr":"Duplicates in target farm/target crop year","Duplikate im Ziel-Erntejahr":"Duplicates in target crop year","Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden.":"The ingredients (N, P₂O₅, K₂O) are being defined by the selected product. You can also enter ingredients (% and amount in kg/ha) manually.","Durch die Freigabe der ausgewählten Felder erhält Dein Vertragspartner SAATBAU LINZ eGen lesenden Zugriff auf die Felder sowie die darauf gebuchten Maßnahmen und das Schlagblatt.":"By sharing selected fields, your contractual partner SAATBAU LINZ eGen receives read-only access to the fields as well as the activities and the field record.","Durch erstellen eines FARMDOK Accounts stimmst du den {agb} von FARMDOK zu.":"By creating a FARMDOK account you agree to the {agb} of FARMDOK.","Durchführungsdatum":"Execution date",Durchschnitt:"Average","Durchschnitt:":"Average:","Durchschnittlicher NDVI-Index":"Average NDVI index","Mehrjähriger Biomasseindex auf Basis Blattflächenindex":"Multi-year biomass-index based on the Leaf area index","Düngekarte":"Fertilization map","Düngekarte für alle Kulturen":"Fertilization map for any crop","Düngekarte für Getreide":"Fertilization map for cereals","Düngeplanung":"Fertilisation plan","Düngeverordnung":"Fertilizer regulation","Düngung":"Fertilisation","DÜNGUNG":"FERTILIZATION","Düngeziel":"Objective of the fertilization",Ebenen:"Layer","E-Mail-Adresse":"E-mail address","E-Mail-Adresse eingeben":"Enter email address","E-mail des Users, der freigegeben hat":"E-mail of the user who shared","Eigene Saatstärke":"Custom seed rate","Eigener Betrieb":"Own company","Eigener Dünger":"Custom fertilizer","Eigentümer":"Owner","Ein oder mehrere Felder haben eine ungültige Kontur":"One or more fields have an invalid contour","Ein Feld mit diesem Namen existiert bereits.":"A field with this name already exists. Since you have activated the option 'Field name uniquely required', you must choose another name.","Ein Betriebsleiter kann dir Zugriff gewähren, oder du erstellst dir hier deinen eigenen Betrieb.":"A farm manager can grant you access, or you can create your own farm here.","Eine ähnliche Maßnahme mit gleichen Datum, Tätigkeit, Feld und Produkten existiert bereits.":"A similar activity with the same date, activity type, field and products already exists.","Eine Zeile pro Maschine":"One line per equipment","Eine Zeile pro Maßnahme":"One line per activity","Eine Zeile pro Produkt":"One line per product","Einfügen (oberhalb)":"Insert (above)",Einheit:"Unit","Einheit kg/ha":"Unit kg/ha",Einheiten:"Units",Einloggen:"Login",Einstellungen:"Settings","Einstellungen anzeigen":"Show settings","Einstellungen für die Zonierung":"Settings for zoning","Einstellungen verstecken":"Hide settings",'Einzelne, vollständige TASKDATA-Dateien müssen die Bezeichnung "TASKDATA" beinhalten. Zusammengehörige Dateien können nur gezipped hochgeladen werden.':'Individual, complete TASKDATA files must contain the term "TASKDATA". Files that belong together can only be uploaded in zipped form.',Empfangen:"Receive","Empfänger":"Recipient","Enthält nicht:":"Does not contain:","Enthält:":"Contains:","Ergebnis anpassen":"Customize result",Erhalten:"Received",Erledigt:"Done","Erledigt!":"Done!","Erneut senden":"Send again",Ernte:"Harvest","Ernte abschließen":"Complete harvest",Erntedaten:"Harvesting data","Erntedaten für Flächen laden, die nicht über FARMDOK an {partner} gemeldet wurden.":"Load harvesting data for fields that were not transmitted to {partner} via FARMDOK.","Erntedaten für {processOrderName} von {partner} importieren.":"Import harvesting data for {processOrderName} from {partner}.","Erntedaten laden":"Load data","Erntedatenimport von {partner}":"Harvesting data import from {partner}","Erntefläche gesamt (ha)":"Total harvesting area (ha)","Erntegüter":"Harvested crops",Erntejahr:"Crop year","Erntejahr abschließen":"Complete harvesting year","Erntejahr beginnen":"Start new crop year","Erntejahr wählen":"Select crop year","Erntejahr wählen...":"Select crop year...","Erntejahr {current} für die gewählten Kulturen abschließen und {next}
1 als das aktive Jahr setzen.":"Complete crop year {current} for the selected crops and set {next} as active crop year.","Erntejahr {newYear} hinzufügen":"Add crop year {newYear}","Erntejahr-Status":"Crop year status","Erntejahr:":"Crop year:","Erntemaßnahmen vorhanden":"Harvest activities available","Erntemenge gesamt (t)":"Total harvesting amount (t)","Erntemenge gesamt: {totalPotatoes} t":"Total harvesting amount: {totalPotatoes} t","Ersetze das Feld im Ziel":"Replace the field in the target","Erstelle eine Kopie des Feldes im Ziel":"Create a copy of the field in the target","Erstelle ein neues Erntejahr":"Create a new crop year",Erstellt:"Created","Ertrag maximieren":"Maximize yield","Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch kopieren?":"Activities exist for the selected fields. Do you want to copy the activities as well?","Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch verschieben?":"Activities exist for the selected fields. Do you want to move the activities as well?","Es existieren mehrere Felder am Ziel.":"There are several fields at the target.","Es hat noch kein Partner Felder bereitgestellt. Lade deine Partner ein, Felder in Farmdok zu kontrahieren.":"No partner has provided fields yet. Invite your partners to share fields in Farmdok.","Es ist ein unbekannter Fehler aufgetreten.":"An unknown error has occurred.","Es können Dateien im Format {fileFormat} importiert werden.":"Files in {fileFormat} format can be imported.","Es können Dateien im Format ISOXML Taskdata importiert werden.":"Files in ISOXML Taskdata format can be imported.","Es können Dateien in den Formaten Shape, XML, KML, XLS, XLSX und CSV importiert werden.":"Files in formats Shape, XML, KML, XLS, XLSX and CSV can be imported.","Es konnte keine Task-Datei heruntergeladen werden":"No task file could be downloaded","Es konnten nicht alle Dateien hochgeladen werden":"Could not upload all files","Es können Dateien in den Formaten {fileFormats} und {lastFileFormat} importiert werden.":"Files in formats {fileFormats} and {lastFileFormat} can be imported.","Es müssen mindestens 2 Felder gewählt sein.":"At least 2 fields must be selected.","Es sind Filter aktiv. Die folgenden Daten werden exportiert:":"Filters are active. The following data is exported:","Es sind {count} Felder ausgewählt.":"{count} fields are selected.","Es trat ein Fehler auf, bitte versuchen Sie es erneut.":"An error occured, please try it once more.","Es werden keine Felder in {newYear} erstellt.":"No fields will get created in {newYear}.","Es wurden mehrere Operationen durchgeführt. Bei mindestens einer ist ein Fehler aufgetreten.":"Several operations have been performed. An error occurred in at least one of them.","Es wurden noch keine Dateien hochgeladen!":"There are no files available yet!","Es wurden noch keine Felder angelegt. Erstelle neue Felder!":"No fields have been created yet. Create new fields!","Es wurden noch keine Felder übermittelt. Lade deine Partner ein, Felder in Farmdok freizugeben.":"No fields have been provided yet. Invite your partners to share fields in Farmdok.","Es wurden noch keine Maßnahmen angelegt. Erstelle neue Maßnahmen!":"No activities have been created yet. Create new activities!","Es wurden {count} Felder ausgewählt. Die Felder werden im nächsten Schritt zu einem vereint.":"{count} fields have been selected. The fields will be merged into one in the next step.","Es wurden Felder mit verschiedenen Kulturen oder Sorten ausgewählt. Bitte beachte den Sorteneinfluss bei der Wahl der Mittel und Mengen. Mittel und Aufwandmengen müssen für alle ausgewählten Kulturen und Sorten geeignet sein!":"Fields with different crops or varieties were selected. Please consider the influence of the variety when selecting the products and quantities. Products and application rates must be suitable for all selected crops and varieties!",Export:"Export",Exporte:"Exports",Exportieren:"Export","Export pro Tabellenzeile":"Export per table row","FARMDOK Eigenschaft":"FARMDOK property",'FARMDOK Eigenschaft "{fieldName}" muss gewählt sein.':'FARMDOK property "{fieldName}
1" must be selected.',"FARMDOK Feldpositionen":"FARMDOK field locations","FARMDOK konnte den Ursprung deiner Daten leider nicht eindeutig feststellen. Bitte wähle aus der folgenden Liste den richtigen Eintrag aus:":"Unfortunately, FARMDOK could not clearly determine the origin of your data. Please select the correct entry from the following list:",FSNr:"Group No.","FSNr - Schlag":"Group No. - Field",Fahrzeit:"Driving time","Fahrzeit minimieren":"Minimize travel time","Falls deine Exportdateien als zip-Datei zur Verfügung stehen, kannst du ganz einfach diese zip-Datei inkl. aller Daten in das weiße Rechteck ziehen.":"If your export files are available as a zip file, you can simply drag this zip file including all data into the white rectangle.","Falls du einen anderen MyJohnDeere Account verwenden möchtest logge dich bitte auf MyJohnDeere.com aus. Dann trenne die Verbindung in FARMDOK. Danach kannst du dich mit dem neuen Account verbinden.":"If you want to use another MyJohnDeere account, logout on MyJohnDeere.com. After that, disconnect in FARMDOK and you will be able to sign in with the other account.","Fast am Ziel!":"Almost there!",Favoriten:"Favorites",Fehler:"error","Fehlerhaft/unvollständig":"Incorrect/incomplete",Feld:"Field","Feld befindet sich im Wasserschutzgebiet":"Field located in water protection zone","Feld 1":"Field 1","Feld 2":"Field 2","Feld Nr":"Field no","Feld Nummer:":"Field number:","Feld aufteilen":"Split field","Feld auswählen":"Select field","Feld verschieben":"Move field","Feld {number}":"Field {number}","Feld-Nummer":"Field number","Feld-Übersicht":"Field overview",Felder:"Fields","Felder aktualisieren.":"Update fields.","Felder auswählen":"Select fields","Felder bearbeiten":"Edit fields","Felder dürfen nicht die gleichen Namen enthalten.":"Fields must not have the same names, since you have activated the option 'Field name uniquely required'.","Felder einfärben":"Color fields","Felder exportieren":"Export fields","Felder freigeben":"Share fields","Felder hinzufügen":"Add fields","Felder importieren":"Import fields","Felder kombinieren":"Combine fields","Felder kopieren":"Copy fields","Felder kopieren anstatt zu verschieben.":"Copy fields instead of moving them.","Felder nicht kopieren.":"Do not copy fields.","Felder nicht verschieben.":"Do not move fields.","Felder teilen ist nur für Einzelpolygone möglich":"Split fields is only availble for single polygons","Felder und Geodaten teilen":"Share fields and geodata","Felder verschieben":"Move fields","Felder wiederherstellen":"Restore fields","Felder wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Restore fields that have been deleted in the last 90 days","Felder zusammenlegen":"Merge fields","Feldgröße":"Total field size","Feldkontur löschen":"Delete field contour","Feldkontur zeichnen":"Draw field contour","Feldname immer anzeigen":"Always show field name",Feldnutzung:"Field utilization","Feldmitte markieren":"Mark field middle",Feldpositionen:"Field locations","Feldstück":"Field group","Kunde - Feldstück - Feld":"Customer - Field group - field","Feldstück - Feldnummer - Feld":"Field group - field number - field","Feldstück Nr":"Field group no","Feldstück Nummer":"Field group number","Feldstück Nummer:":"Field group number:","Feldstück hinzufügen":"Add field group","Feldstück konnte nicht wieder hergestellt werden.":"Field group could not be restored.","Feldstück-Nummer":"Field group number","Feldstücke":"Field groups","Feldstücke wiederherstellen":"Restore field groups","Feldstücke wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Restore field groups that have been deleted in the last 90 days","Feldstücknummer - Feldname":"Field group number - field number","Feldstücksliste":"Field group list","Fertig! Die Felder/Feldstücke inkl. Geokonturen wurden importiert und stehen für die Maßnahmenbuchung zur Verfügung!":"Ready! The fields/field groups incl. geo contours have been imported and are available for the activity recording.",Fertigstellen:"Finish",Feuchtgebiet:"Humid region","Fileupload zu John Deere fehlgeschlagen.":"File upload to John Deere failed.","Filter aktiviert - {linkStart}Filter deaktivieren{linkEnd} um alle Einträge anzuzeigen.":"Filter is active - {linkStart}Deactivate filter{linkEnd} to see all entries.","Filter entfernen":"Remove filters","Flächen":"Fields","Flächen ansehen":"View fields","Flächen aus dem Nachfolgejahr übernehmen":"Import fields from next year","Flächen aus dem Vorjahr übernehmen":"Import fields from previous year","Flächen senden":"Send fields","Flächennutzung":"Field usage","Flächensumme":"Total area","Flächenübermittlung":"Field transmission",Frei:"Remaining","Freigaben entfernen":"Remove shares","Freigaben jetzt entfernen.":"Remove shares now.",Freigeben:"Share","Freigeben bis {date}.":"Shared until {date}.","Freigeben bis:":"Share until:",Freigegeben:"Shared","Freigegebene Felder":"Shared fields",Freigabedatum:"Date shared","Freigabe entfernen":"Disable sharing","Freunde einladen":"Invite friends",Fruchtfolge:"Crop rotation","FSNr-Schlag":"FSNr-Field",Fortschritt:"Progress",Futter:"Live stock","Für das ausgewählte Feld fehlen die Geo-Daten.":"Geo data is missing for the selected field.","Für die Auswertung werden Daten der Sentinel Erdbeobachtungs­satelliten verwendet. Satelliten- & Wetterdaten zeigen Biomassezuwachs (NDVI- und MSAVI2-Index), Stickstoffverbrauch (REIP-Index) und Wassergehalt (NDWI-Index) auf. Sie sind die optimale Unterstützung für effektive Produktionsentscheidungen.":"Data from the Sentinel earth observation satellites in combination with weather data are used to visualize the biomass (NDVI and MSAVI2), the nitrogen content (REIP) and the water content (NDWI) of crops. These indices are the optimal basis for efficient production decisions.","Für diese Einheit ist eine Gesamteingabe nicht möglich.":"Total entry is not possible for this unit.","Für Fragen steht Ihr regionaler Berater gerne zur Verfügung (Beraterzuordnung nach Region).":"If you have any questions, please do not hesitate to contact your regional consultant (consultant assignment according to region).","Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden. Max. 10 MB pro Datei.":"For each file a link 
1will be generated. GeoJSON-Links can be viewed in the web browser. Max.size 10 MB per file.","GW Gebiete":"Groundwater area","GW-Gebiet":"Groundwater-area","Feuchtgebiet oder Trockengebiet":"Region (humidity)","Gedüngt":"Fertilised","gelöscht am":"deleted on",Gemeinde:"Local community","Gemüse":"Vegetable",Geplant:"Planned","Geplant setzen":"Set planned",Gering:"Low",gering:"low","Gesamtanzahl der bereitgestellten Felder":"Total amount of provided fields","Gesamtfläche":"Total area","Gesamtfläche aus Erntedaten: {totalSize} ha":"Total area from harvesting data: {totalSize} ha","Gesamtfläche {totalArea} ha":"Total area {totalArea} ha","Gesamtfläche in ha":"Total area in ha",Gesamt:"Total",Gesamtanzahl:"Total",Gesamtmenge:"Total amount","Geschafft!":"You made it!",Gesendet:"Sent","Geteilt von":"Shared by","Geteilte Informationen:":"Shared information:","Gewählten Eintrag wirklich löschen?":"Do you really want to delete the selected entry?","Gewählte Einträge wirklich löschen?":"Do you really want to delete the selected entries?","Gewählte Fläche: {sizeTotalFormatted} ha":"Selected area: {sizeTotalFormatted} ha","GIS-Layer":"GIS-Layer","Gleiche Zonengröße":"Equal zone size","Gleicher Indexabstand":"Equal index distance","Grobe Tätigkeiten":"Rough activity types",Gruppiert:"Grouped","Größe":"Size","Größe (ha)":"Size (ha)","Größe in ha":"Size in ha","Größe (in ha)":"Size (ha)","Größe (in ha):":"Size (ha):","Größer als:":"Greater than:","Grünland und Feldfutterbau":"Greenland and forage cropping","Gutscheine verwalten":"Manage vouchers","Heil- und Gewürzpflanzen":"Medicinal and aromatic plants",Hektar:"Hectare","Herbstantrag (HA)":"Autumn application (HA)",Herunterladen:"Download","Hier gehts zur Registrierung.":"Click here to register.","Hier kannst du alle Freigaben für einen Betrieb im aktuellen Erntejahr entfernen.":"Here you can remove all shares for an account in the current crop year.","Hier kannst du dein neues Passwort eingeben.":"You can enter your new password here.","Hier kannst du deine eigenen Zonenkarten hochladen um daraus eine Applikationskarte zu erstellen. Bitte verwende Daten im Shape-Format.":"Here you can upload your own zone maps to create an application map. Please use data in shape format.",Hilfe:"Help","Hinweise für":"Indication for","Hinweis: die maximale Prüfdistanz beträgt":"Note: the maximum inspection distance is {maxDistance}.",Humus:"Humus",Hoch:"High",hoch:"high",Low:"Low",Medium:"Medium",High:"High",niedriger:"lower","höher":"higher",Hochformat:"Portrait",Hochgeladen:"Uploaded","Häufigkeit":"Occurrences",Isolationszonen:"Isolation zones","Isolationszone erstellen":"Create isolation zone","Isolationszone bearbeiten":"Edit isolation zone","Isolationszone löschen":"Delete isolation zone",ISOXML:"ISOXML","Ich habe bereits einen Account":"I already have an account","Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung von FARMDOK zu {partner} zu genannten Zwecken ausdrücklich zu.":"I have read the agreements and agree to the transmission of data from FARMDOK to {partner} for the aforementioned reasons.","Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung zu genannten Zwecken ausdrücklich zu.":"I have read the agreements and agree to the transmission of data for the aforementioned reasons.","Ich verstehe, Services & Support erfolgen per E-Mail.":"I understand, services & support are provided by email.","Ihre Organisation auf MyPLM® Connect, AFS Connect oder S-FLEET":"Your organization on MyPLM® Connect, AFS Connect or S-FLEET","Im Erntejahr {previous} wurde ein Feld auf aktiv gestellt.":"In crop year {previous} one field was set to active.","Im Erntejahr {previous} wurden {numberOfNewActiveFieldsInPrevious} Felder auf aktiv gestellt.":"In crop year {previous}, {numberOfNewActiveFieldsInPrevious} fields were set to active.","Im Shape-Format exportieren":"Export in shape format","Import in Farmdok":"Import to Farmdok","Import zurücksetzen":"Reset import",importiert:"imported",Importieren:"Import","Importiere Dateien in den Formaten Shape und GeoJSON.":"Import files in the format Shape or GeoJSON.","Importieren von Maßnahmen aus externen Quellen":"Import activities from a third party source","Importiere Dateien in de
1n Formaten Shape und GeoJSON. Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden.":"Import files in the format Shape or GeoJSON. For each file a link will be generated. GeoJSON-Links can be viewed in the FARMDOK mobile app.","Maßnahmen aus AFS Connect, S-Fleet und PLMConnect importieren":"Import activities from AFS Connect, S-Fleet and PLMConnect","Möchten Sie die Bewertung wirklich abbrechen?":"Do you really want to cancel the assessment?",Impressum:"Legal notice","In FARMDOK nach dem Import.":"In FARMDOK after importing.","In der hochgeladenen Datei befinden sich mehrere Werte. Welcher davon soll zum Erstellen der Zonen benutzt werden?":"There are multiple values in the uploaded file. Which one of them should be used to create the zones?","In diesem Erntejahr sind noch keine Flächen verfügbar.":"There are no fields available yet this crop year.","Index auswählen":"Select index","Inhaltsstoffe des Düngers in %":"Ingredients of the fertilizer in %","Inhaltsstoffe des Düngers in % und Ausbringmenge am Feld in kg/ha":"Ingredients of the fertilizer in % and application rate on the field in kg/ha","Inhaltsstoffe in %":"Ingredients in %","Ist genau:":"Equals:","Ja, Maßnahmen auch in das Ziel-Erntejahr kopieren.":"Yes, copy activities into the target crop year as well.","Ja, Maßnahmen auch in das Ziel-Erntejahr verschieben.":"Yes, move activities into the target crop year as well.","Ja, ich will den FARMDOK Newsletter bekommen!":"Yes, I want to receive the FARMDOK newsletter.",Jahr:"Year",Ja:"Yes",Jahre:"Years","Jetzt Lizenz upgraden":"Upgrade license now","Jetzt kaufen":"Buy now","Jetzt starten":"START NOW","Jetzt starten!":"Start now!","Jetzt verschieben":"Move now","Jetzt kopieren":"Copy now","Jetzt upgraden auf FARMDOK PERFORMANCE!":"Upgrade now to FARMDOK PERFORMANCE!",K:"K",Karte:"Map","Karte erstellen":"Create map","Karte anzeigen":"View map",Katastralgemeinde:"Cadastral district","Kein Betrieb gewählt":"No company selected","Kein Enddatum festlegen":"Do not set an end date","Kein Enddatum gesetzt.":"No end date set.","Kein gültiger Schädling vorhanden":"No valid pest available","Kein weiteres Feld":"No further field","Kein Vorschlag (manuelle Eingabe)":"No recommendation (manual entry)",Keine:"None","Keine Daten verfügbar.":"No data available.","Keine Einträge vorhanden.":"No entries available.","Keine Ergebnisse gefunden. Ändere den Suchbegriff.":"No results found. Change the search term.","Keine Felder vorhanden":"No fields available","Keine Feldposition":"No field location","Keine Kontrakte vorhanden.":"No contracts found","Keine Kultur":"Crop missing","Keine Tätigkeit":"No activity","Keine Kultur gepflegt":"No crop selected","Keine Kulturdaten vorhanden.":"Crop data not available.","Keine Organisation in deinem John Deere Account vorhanden.":"No organizations available in your John Deere account.","Keine Satellitendaten für den ausgewählten Zeitraum verfügbar.":"No satellite data available for the selected time period.","Keine Wetterdaten für den ausgewählten Zeitraum verfügbar.":"No weather data available for the selected time period.","Keine Shape-Datei im Zip gefunden.":"No shape file found in the ZIP archive.","Keine Sorte":"No variety","Keine aktiven Kulturen im aktuellen Erntejahr vorhanden.":"No active crops available in the current crop year.","Keine Warnhinweise gefunden":"No warnings found","Keines der gewählten Felder besitzt eine Kontur.":"None of the selected fields has a contour.","Kleiner als:":"Smaller than:",'Klicke auf "Aufteilen" um zwei neue Felder zu erstellen.':'Click on "Split" to create two new fields.',"Klicke auf den Link in der E-Mail um dein Passwort zurückzusetzen.":"Click on the link in the e-mail to reset your password.","Klicke auf den Link in der E-Mail um deinen Account zu aktivieren.":"Click on the link in the e-mail to activate your account.","Klicke hier für mehr Infos ...":"Click here for more info ...","Klicke hier um dich einzuloggen.":"Click here to log in.","Klicke hier um die Gesamtmenge festzulegen.":"Click here to set the total amount.","Klicke hier um die Menge pro Hektar festzulegen.":"Click here to set the amount per hectare.","Klicke in der Karte auf ein Feld um es hinzuzufügen.":"Click on a field in the map to add it.","Klicke in der Karte um ein neues Feld hinzuzufügen.":"Click on the map to add a new field.","Klicke in der Karte um eine Trennlinie zu zeichnen. Klicke zwei mal schnell hintereinander um das Zeichnen zu beenden.":"Click on the map to draw a dividing line. Double click to finish drawing.","Klicke in die Karte, um die Auswahl zu verändern.":"Click on the map to change the selection.","Klicken oder Zip-Datei hier ablegen.":"Click or drag and drop a ZIP file here",KMZ:"KMZ",Kombinieren:"Combine",Kommentar:"Comment",Konflikt:"Conflict",Kontrahiert:"Contracted","Kontrollgang durchgeführt oder Warndienstmeldu
1ng beachtet.":"Inspection carried out or warning service advisory observed.","Kontrollgang wurde schlagbezogen durchgeführt und/oder eine Warndienstmeldung beachtet":"An inspection was carried out for the specific field and/or a warning service advisory was observed","Kontakt E-Mail":"Contact email","Kornqualität":"Grain quality",Konventionell:"Conventional","Kosten senken":"Reduce costs",Kostenrechnung:"Cost accounting","Ko/m^2":"seeds/m²",Kultur:"Crop","Kultur für alle Felder übernehmen":"Apply crop for all fields","Kultur in der Datenquelle (aus dem Import)":"Crop in the data source (from import)","Kultur:":"Crop:",Kulturen:"Crops","Kulturen & Greening-Kennzahlen":"Crops & Greening Key Figures","Kulturen ohne Erntemaßnahmen":"Crops without harvesting activities","Kulturen, Feldstücknutzung, Anbaudiversivizierung und ökologische Vorrangflächen.":"Crops, field plot use, cropping diversification, and ecological priority areas.","Kulturverhältnis":"Crop ratio",Kunde:"Customer",Kunden:"Customers",Kundennummer:"Customer number",Kundenverwaltung:"Customer management","Kundenzufriedenheit erhöhen":"Increase customer satisfaction","K₂O-Klasse":"K₂O class","LAI - Blattflächenindex":"LAI - Leaf area index","Lade hoch ...":"Uploading ...","Lade..":"Loading ...","Lade...":"Loading...","Drohnenbilder hochladen, um ein neues Assessment zu starten":"Upload drone images to start a new assessment",Lager:"Storage",Lagerbewegungen:"Stock movement","Lagerbewegung anlegen":"Create stock movement","Lagerstände":"Stock","Lagerstand anwenden":"Apply leftover storage","Lagerstand zu niedrig":"Stock level too low",Land:"Country","Grundstückskataster":"Land cadastres",Landwirt:"Farmer","Lass uns zusammen arbeiten!":"Let's work together!","Leg deine Datei hier ab":"Drop your file here",Legendentitel:"Legend title",Legende:"Legend","Leider können für dieses Feld keine Wetterdaten geladen werden.":"Unfortunately, weather data cannot be loaded for this field.",Link:"Link","Link kopieren":"Copy link","Link in die Zwischenablage kopieren":"Copy link to clipboard","Link zu AGES Register":"Link to AGES register","Link zur Datei":"Link to the file","Liste aller Felder gruppiert nach Kulturen.":"List of all fields grouped by crops.","Liste aller Feldgruppen und Felder im gewählten Erntejahr.":"List of all field groups and fields in the selected crop year.","Liste aller Feldstücke und Schläge im gewählten Erntejahr.":"List of all field groups and fields in the selected crop year.","Liter pro m² Niederschlag im {month} {year}":"Liters per m² rainfall in {month} {year}","Liter pro m² Niederschlag in {year}":"Liters per m² rainfall in {year}","Live check läuft...":"Live check in progress...",Login:"Login","Login mit MyJohnDeere":"Login with MyJohnDeere","Login mit CNH Platformen":"Login with CNH platforms",Lohnunternehmer:"Contractor","Löschen":"Delete","MSAVI2 - Biomasse":"MSAVI2 - Biomass","MAISBUTLER Anfrage":"MAISBUTLER demand",Mais:"Maize",Mahlen:"Milling","Manuelle Eingabe":"Manual values",Maschine:"Equipment","Maschine auswählen":"Select equipment","Maschine entfernen":"Remove equipment","Maschine hinzufügen":"Add equipment",Maschinen:"Machines","Maschinen & Geräte":"Machinery and equipment","Maschinen & Geräte Kategorien":"Machinery & equipment categories","Maschinen & Geräte Listen":"Machinery & equipment lists","Max. Dateigröße: {maxFileSize} MB":"Max. file size: {maxFileSize} MB",Material:"Product",Materialauswahl:"Select product","Maximale Anzahl von Anwendungen:":"Max. number of treatments:","Maximale Anzahl von Anwendungen pro Erntejahr:":"Max. number of treatments per crop year:","Maximale Saatstärke":"Maximum seed rate","Maximale Menge":"Maximum amount","Maximale Reduktion der Produkt-Konzentration":"Maximum reduction of product concentration","Maximum:":"Maximum:","Maximale Anwendungsmenge überschritten!":"Maximum amount of application exceeded!","Maßnahme erfolgreich {mode} nach {cropYear} auf {companyName}":"Activity successfully {mode} to {cropYear} on {companyName}","Maßnahmen erfolgreich {mode} nach {cropYear} auf {companyName}":"Activities successfully {mode} to {cropYear} on {companyName}","Maßnahme konnte nicht wieder hergestellt werden.":"Activity could not be restored.","Maßnahme hinzufügen":"Add activity","Maßnahme und Datum auswählen":"Select activity type and date","Maßnahmen":"Activities","Maßnahmen Neu - Work In Progress":"Activities new - Work in progress","Maßnahmen auf beide Felder kopieren":"Copy activities to both fields","Maßnahmen auf {fieldName} ({fieldSize} ha) übernehmen":"Apply activities to {fieldName} ({fieldSize} ha)","Maßnahmen buchen":"Create activities","Maßnahme duplizieren":"Duplicate activity","Maßnahmen duplizieren":"Duplicate activities","Maßnahme erfolgreich dupliziert"
1:"Activity successfully duplicated","Maßnahmen erfolgreich dupliziert":"Activities successfully duplicated","Maßnahmen importieren":"Import activities","Maßnahme konnte nicht dupliziert werden":"Activity could not be duplicated","Maßnahmen konnten nicht dupliziert werden":"Activities could not be duplicated","Maßnahmen löschen":"Delete activities","Maßnahme konnte nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}":"Activity could not be {mode} to {cropYear} on {companyName}","Maßnahmen konnten nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}":"Activities could not be {mode} to {cropYear} on {companyName}","Maßnahmen mit ISOXML Taskdata importieren":"Import activities with ISOXML Taskdata","Maßnahmen speichern":"Save activities","Maßnahmen teilen":"Share activities","Maßnahme verschieben":"Move activity","Maßnahmen verschieben":"Move activities","Maßnahmen wiederherstellen":"Restore activity","Maßnahmen wiederherstellen, die in den letzten 90 Tagen gelöscht wurden":"Restore activities that have been deleted in the last 90 days","Maßnahmen übernehmen":"Apply activities","Maßnahmen von CNH-Industrial importieren":"Import activities from CNH-Industrial","Maßnahmen kopieren anstatt zu verschieben":"Copy activities instead of moving them","Mapping zurücksetzen":"Reset mapping",MBI:"MBI","MBI - Mehrjährige Biomasse":"MBI - Perennial biomass","mechanische Pflegemaßnahmen":"mechanical maintenance measures",Mehr:"More","Mehr anzeigen":"Show more","Mehr Details":"More details","Mehr Dezimalstellen":"More decimal places","Mehr Infos":"More information","Mehr Infos...":"More infos...","Mehr erfahren":"Learn more","Mehrfachantrag (MFA)":"Mehrfachantrag (MFA)","Mein Profil":"My profile","Meine aktuellen Favoriten":"My recent favourites","Meine Rechnungen":"My invoices","Meine Verträge":"My contracts","Meinen persönlichen Berater kontaktieren...":"Contact my personal adviser...",Menge:"Amount","Menge (t)":"Amount (t)","Menge in kg/ha":"Amount in kg/ha","Menge teilflächen-spezifisch verteilen":"Distribute the amount per zone",Mengenangabe:"Amount type","pro Hektar":"per hectare","Menü":"Menu","Menü einklappen":"Close menu","Messen beenden":"Close measuring","Messen von Strecken":"Measure distances",Mg:"Mg","Mg-Klasse":"Mg class",Mindestabstand:"Min. Distance","Mineraldünger":"Mineral fertilizer","Mineraldüngung":"Mineral fertilzation","Minimum:":"Minimum:","Minimale Saatstärke":"Minimum seed rate","Minimale & maximale Saatstärke":"Minimum & maximum seed rate","Min/max Saatstärke ändern":"Change min/max seed rate","Mit diesem Schieberegler kannstt assignment according to region) du kalkulierbare Verluste berücksichtigen und die Saatstärke pauschal korrigieren (1-15%). Pflanzenverluste können beispielsweise auftreten durch:":"With this slider you can take calculable losses into account and correct the seed rate (1-15%). Plant losses can occur, for example, due to:","Mit Farmdok können Sie die Dokumentation der durchgeführten Feldarbeiten direkt von der CNH-Plattform laden und automatisch Maßnahmen in Farmdok erstellen. Alles, was du dazu brauchst, ist ein Account bei New Holland MyPLM® Connect, Case AFS Connect oder STEYR S-FLEET und ein geeingetes ISOBUS Display auf deinem Traktor.":"With Farmdok, you can load documentation of field work performed directly from the CNH platform and automatically create activities in Farmdok. All you need is an account with New Holland MyPLM® Connect, Case AFS Connect or STEYR S-FLEET and a set-up ISOBUS display on your tractor.","Mit FARMDOK kannst du Aufträge bzw. Applikationskarten direkt an deine John Deere Maschinen schicken. Dafür benötist du lediglich einen Account auf MyJohnDeere.com und musst deine Maschinen mit diesem Account verknüpfen. Du kannst die Applikationskarte auch ohne Account übertragen indem du sie herunterlädst und händisch mit einem USB-Stick überträgst.":"With FARMDOK you can send tasks or application maps directly to your John Deere machines. You need a MyJohnDeere.com account and connect your machines with it. Alternatively you can download the application map and transfer it to your machines via USB drive.","Mit Google anmelden":"Login with Google",Mittel:"Medium",mittel:"medium","Mittlere Dosierung (kg/ha)":"Medium dosage (kg/ha)","Mittlere Dosierung in kg/ha über alle ausgewählten Flächen, Nährstoffe in kg/ha":"Average dosage in kg/ha for all selected areas,\nnutrient values in kg/ha",Monate:"Months",Monitoring:"Monitoring","Variable Pflanzenschutzkarte":"Variable spraying map",Vermehrungsgemeinschaft:"Multiplier group",Vermehrungsgemeinschaften:"Multiplier groups","Vermehrungsgemeinschaft erstellen":"Create multiplier group","Vermehrungsgemeinschaft bearbeiten":"Edit multiplier group","Vermehrungsgemeinschaft löschen":"Delete multiplier group",MyJohnDeere:"MyJohnDeere","MyJohnDeere öffnen":"Open MyJohnDeere","Mähdrusch":"Combining","Möchtest Du mit diesen Werten fortsetzten oder die Einstellungen auf die empfohlenen Werte zurücksetzen?":"Do you want to continue with these values or reset the settings to the recommended values?","Möchtest du fortfahren?":"Would you like to continue?",N:"N",NDVI:"NDVI","NDVI - Biomasse":"NDVI - Biomass","NDWI - Wassergehalt":"NDWI - Water contents",Nachname:"Last name","nach Kultur":"by crop","nach letzter Tätigkeit":"by last activity","nach NDVI":"by NDVI","nach MBI":"by MBI","nach Sorte":"by variety","Nächster Konflikt":"Next conflict","Nächster Schritt":"Next step",Name:"Name","Name des Sender-Betriebs":"Name of the sender account","Nein, Maßnahmen an der Quelle löschen.":"No, delete activities at the source.","Nein, nur Felder kopieren.":"No, only copy fields.",Nein:"No",Neu:"New","Neu laden":"Reload","Neues Feld":"New field","Neues Assessment starten":"Start new assessment","Nicht alle importierten Kulturen konnten FARMDOK Kulturen zugeordnet werden.":"Not all imported crops could be mapped to FARMDOK crops.","Nicht gepflegt":"Not set","Nicht übernehmen":"Do not apply",Niederschlag:"Rainfall","Kumulierter Niederschlag":"Accumulated precipitation","Noch keine Einträge vorhanden.":"No entries available yet.","Noch keine Erntedaten für <strong>{name}</strong> verfügbar.":"No harvesting data available for <strong>{name}</strong>.","Noch keine Fruchtfolge vorhanden.":"No crop rotation available yet.","Noch keine Maßnahmen vorhanden.":"No activities available yet.","Noch keine Notizen vorhanden.":"No notes available yet.","NPK in %":"NPK in %",Notizen:"Notes","Notizen und Arbeitsanweisungen":"Notes and work instructions",Nr:"No.",Nummer:"Number","Nutzung durch":"User",Nutzungsart:"Type of use",Nutzungsarten:"Types of usage","Nuzungsart in der Datenquelle (aus dem Import)":"Kind of use in the data source (from the import)","Nährstoffbilanz":"Nutrient balance","Nährstoffbilanz teilen":"Share nutrient balance","Nährstoffe eingeben":"Enter nutrient values","Nährstoffmenge":"Nutrient amount","Nährstoffmenge ändern":"Change nutrient amount","Nährstoffvergleich":"Nutritient comparison","N-Rate 1. Gabe (kg/ha)":"N-rate 1st application (kg/ha)","N-Rate 2. Gabe (kg/ha)":"N-rate 2st application (kg/ha)",OK:"OK","Obst und Hopfen":"Fruits and hops","Offene Verträge":"Open calls",Optionen:"Options","Optionen schließen":"Close options",Organisation:"Organisation","Organisation verbessern":"Improve organization","Originalgröße":"Original size",Ort:"Location",Other:"Other",P:"P","PDF Herunterladen":"Download PDF",PLZ:"Postal code",Packungen:"packages","Papierlos arbeiten":"Work paperless",Partner:"Partners","Partner-Nummer":"Partner number",'Partner-Nummer – Siehe Zugangsdaten auf <a href="https://ris.agrana.com" target="_blank">https://ris.agrana.com</a>':'Partner number – see login data at <a href="https://ris.agrana.com" target="_blank">https://ris.agrana.com</a>',"Partner-Nummer, Kunden-Nummer, CRM Id":"Partner Number, Customer Number, CRM Id","Partner-Status":"Partner status","Partner wählen":"Select partner",Parzellen:"Plot","Parzellen Nr.":"Plot number","Parzellennummer suchen":"Search parcel number","Passende Kulturen":"Matching crops","Passende Sorten":"Matching varieties",Passwort:"Password","Passwort speichern":"Save password","Passwort vergessen?":"Forgot password?","Passwort zurücksetzen":"Reset password",Pause:"Break",Permissions:"Permissions",Personen:"People","Persönliche Einstellungen":"Personal settings",PFLANZENSCHUTZ:"SPRAYING",Pflanze:"Plant",Pflanzenschutz:"Plant protection","Pflanzenschutzmittelkatalog öffnen":"Open plant protection",Pflanzenschutzmittel:"Plant protection products",Pflichtfeld:"Required",Planung:"Planning",Plattform:"Platform","Plattform öffnen":"Open platform","Positionen senden":"Send locations",Postleitzahl:"Postal code","Precision Farming":"Precision farming",Premium:"Premium","Probleme? Bitte schreib uns an [email protected] und übermittle die verwendeten Importdateien.":"Problems? Please write to us at [email protected] and submit the import files used.",Produkt:"Product","Produkt auswählen":"Select product","Produkt entfernen":"Remove product","Produkt hinzufügen":"Add product",Produkte:"Products","Produkt vor Menge einstellen":"Set product before setting amount","Produkt wählen":"Select product","Produkt- & Maschinenauswahl":"Select product & equipment","Produktivität steigern":"Increase productivity",Produktkombination:"Product combination",Profil:"Profile",Prognose:"Forecast","Prüfstand in m":"Distance in m","P₂O₅-Klasse":"P₂O₅ class","Randbereich korrigiert"
1:"Border area corrected","Randbereich nicht korrigiert":"Border area not corrected","REIP - Stickstoffgehalt":"REIP - Nitrogen content","Referenz oder Freigabegrund":"Reference or share reason","Referenz-Nummer":"Reference number","Reine Kartoffel (t)":"Pure potato (t)","Reine Rübe (t)":"Pure beets (t)","Reinekartoffel: {amountPotato} Stärkegehalt: {amountStarch}":"Pure potatoes: {amountPotato} Starch content: {amountStarch}",Report:"Report",Reports:"Reports","Rüstzeit":"Set-up time",Risiko:"Risk",Risikokategorie:"Risk category","Saatbau Mais Aussaatkarte":"Saatbau maize seeding map","Saatbau Soja Aussaatkarte":"Saatbau soya seeding map","Saatbett-Bedingungen (Scholligkeit, Wasserverfügbarkeit, …)":"seedbed conditions (pout, water availability, ...)",Saatgut:"Seeds",Saatdatum:"Seeding date","Saatgut jetzt bestellen SESAM24":"Order seeds now SESAM24","Saatstärke in Körner/ha":"Seed rate in grains/ha","Saatstärke":"Seed strength","Saatzeitpunkt außerhalb des Optimums":"sowing time outside the optimum",Sales:"Sales",Satellit:"Satellite",Satellitenbild:"Satellite image",Satellitenbilder:"Satellite images","Satellitenbilder am gewählten Datum anzeigen":"Show satellite images for selected date",Satellitenindex:"Satellite index",Schlag:"Field","Schlag Nr":"Field No",Schlagblatt:"Field record","Schlagblatt für {fieldName}":"Field record for {fieldName}","Schlagblatt teilen":"Share field record","Schließen":"Close",Schnee:"Snow","Schritt zurück":"Previous step","Schädling auswählen":"Select pest","Seite drucken":"Print page","Seite verlassen":"Leave","Sekundärrohstoffe":"Secondary raw materials","Selektierte Felder exportieren":"Export selected fields","Sende Applikationskarte":"Send application map","Sende die Applikationskarte direkt an die Cloud-Plattform deines Maschinenherstellers.":"Send your application map directly to the cloud platform of your machines' manufacturer.","Sende deinem Partner einen Link, der ihn direkt zum Vertrag führt. Er kann dort mit wenigen Klicks Felder freigeben.":"Send your partner a link that takes them directly to the contract. They can contract fields there with a few clicks.",Senden:"Send","Senden an":"Send to",Sender:"Sender","Sender-Referenz":"Sender reference",'Setze das Feld "aktiv", wenn es ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden soll. Vorangehende Erntejahre werden auf diesem Feld abgeschlossen.':'Set the field "active" if it is to be farmed from now on in the displayed crop year {current}. Previous crop years will be completed for this field.','Setze das Feld auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Das Feld wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Set the field to "completed" once the harvest for crop year {current} is finished. The field will be automatically created and set "active" in the next crop year {next}.','Setze das Feld auf "geplant", wenn das Erntejahr {current} auf diesem Feld noch nicht begonnen hat.':'Set the field to "planned" if the crop year {current} has not yet started on this field.',"Setze dein neues Passwort":"Set your new password",'Setze den Status auf "geplant", wenn das Erntejahr {current} auf den ausgewählten Feldern noch nicht begonnen hat.':'Set the status to "planned" if the crop year {current} has not yet started on the selected fields.','Setze die ausgewählten Felder "aktiv", wenn sie ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden sollen. Vorangehende Erntejahre werden auf diesen Feldern abgeschlossen.':'Set the selected fields "active" if they are to be farmed from now on in the displayed crop year {current}. Previous crop years will be completed on these fields.','Setze die ausgewählten Felder auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Die Felder werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.':'Set the selected fields to "completed" once the harvest for crop year {current} is finished. The fields will be automatically created and set "active" in the next crop year {next}.',"Setze mittlere Dosierung in kg/ha":"Set average amount in kg/ha",Seitenausrichtung:"Orientation",Shapefile:"Shapefile",Shop:"Shop","Sichtbare Einträge":"Visible entr
1ies","Sie sind nun im Erntejahr {current} aktiv und werden in den vorangehenden Erntejahren auf abgeschlossen gestellt.":"They are now active in crop year {current} and are set to complete in previous crop years.","Sie wurden für {current} auf geplant gestellt.":"They were set to planned for {current}.","Sie wurden im Erntejahr {current} abgeschlossen und werden in {next} aktiv gestellt.":"They were completed in the {current} crop year and will be set to active in {next}.",SingleSeed:"Single Seed","Sollen bereits gebuchte Maßnahmen für das neue Feld übernommen werden?":"Should activities that have already been recorded be transferred to the new field?","Sollen die Flächen aus dem Vorjahr übernommen werden?":"Should the areas from the previous year be taken over?","Sollen die Flächen aus dem nachfolgenden Erntejahr übernommen werden?":"Should the land be taken over from the following crop year?","Sollte die E-Mail nicht auffindbar sein, {linkStart}klicke hier, um sie nochmal zu senden.{linkEnd}":"If the e-mail cannot be found, {linkStart}click here to resend it.{linkEnd}",Sonstige:"Other operations","Sonstige Grünlandarbeiten":"Other grassland work","Sonstige Hilfsstoffe und Dünger":"Other auxiliary materials and fertilisers","Sonstige organische Düngemittel":"Additional farm fertiliser",Sorte:"Variety","Sorte in der Datenquelle (aus dem Import)":"Variety in the data source (from import)","Sorte:":"Variety:",Sorten:"Varieties","Sorte wählen":"Select Variety","Sortieren: A {arrowRight} Z":"Sort: A {arrowRight} Z","Sortieren: Z {arrowRight} A":"Sort: Z {arrowRight} A","Sortieren: absteigend":"Sort: descending","Sortieren: aufsteigend":"Sort: ascending","Spaltenreihenfolge ändern":"Change column sequence","Spaltenüberschrift aus Datei":"Column header from file",Speichern:"Save","Spritzbrühe":"Spray mix",Standard:"Default","Standard - Shapefile":"Default - Shapefile","Standardeinheit {amount} Körner je Packung":"Standard unit {amount} grains per package",Status:"Status",Startdatum:"Start date",Start:"Start",Startzeit:"Start time","Steig auf www.eama.at mit Betriebsnummer und Pincode (oder Handysignatur) ein.":"Login on www.eama.at with company number and pin code (or cell phone signature).","Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu FARMDOK Monitoring. Die Anwendung ermöglicht es Vegetations­unterschiede teilflächenspezifisch in der Karte darzustellen und den zeitlichen Verlauf zu analysieren.":"Upgrade to FARMDOK PERFORMANCE and you will get access to FARMDOK crop monitoring. This module allows visualizing site-specific vegetation differences, analyzing time series of satellite images and creating application maps from the satellite data.","Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu Freigegebenen Feldern.":"Switch to FARMDOK PERFORMANCE and get access to Shared Fields.",Stoffstrombilanz:"Substance flow",Storniert:"Canceled","Straße":"Street","Straße, Hausnummer, Tür":"Street, number, doornumber","Stärkegehalt":"Starch content","Stärkegehalt (t)":"Starch contents (t)","Stärkegehalt gesamt (t)":"Total starch amount (t)","Stärkegehalt gesamt: {totalStarch} t":"Total starch amount: {totalStarch} t",Unterebene:"Sublayer",Unterebenen:"Sublayers","Suchbegriff eingeben ...":"Enter search term ...","Suche zurücksetzen":"Reset search",Suchen:"Search",Summe:"Sum","Summe Größe: {sizeTotalFormatted} ha":"Total size: {sizeTotalFormatted} ha","Summe Hektar: {processedAreaTotalFormatted} ha":"Sum hectare: {processedAreaTotalFormatted} ha",Superuser:"Super user","Tabelle zurücksetzen":"Reset table",Tage:"Days",Feuchtigkeit:"Moisture content",Hektolitergewicht:"Hectoliter weight",Proteingehalt:"Protein content","Relative Feuchtigkeit":"Relative humidity",Tausendkorngewicht:"Thousand-grain weight","Tausendkorngewicht (g)":"thousand grain weight (g)",Teilnehmen:"Participate",Telefonnummer:"Phone number",Temperatur:"Temperature","tierische Schäden (Bsp.: Wild, Vögel, Insekten, …)":"animal damage (e.g. game, birds, insects, …)","Tierkategorien und Nährstoffanfall":"Animal categories and amount of nutrients","Tippen um zu suchen":"Type to search","Trennlinie fertigstellen":"Finish dividing line",Trockengebiet:"Dry region","Tätigkeit":"Activity type","Tätigkeit wählen":"Choose activity type","Tätigkeiten":"Activity types",UBB:"UBB","Um Polygone kombinieren zu können, m
1üssen Sie mindestens 2 Polygone ausgewählt haben.":"To merge polygons, you need to have at least 2 polygons selected","Um dieses Feld zu bearbeiten, ändere die Mengenangabe auf der rechten Seite.":"To edit this field, change the amount type on the right.","Umweltgerechte und biodiversitätsfördernde Bewirtschaftung.":"Environmentally sound and biodiversity enhancing management.","Unbekannter Fehler":"Unknown error","Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.":"Unknown error. Please check your internet connection.","Unerwarteter Fehler.":"Unexpected error.","Ungültige Trennlinie":"Invalid separator line","Ungültiger Wert.":"Invalid value.",Upload:"Upload","Upload verlassen":"Cancel upload","Upload fehlgeschlagen! Die Datei scheint defekt zu sein. Probiere den Export aus der Quellapplikation zu einem späteren Zeitpunkt nochmal. Sollte das Problem weiterhin auftreten, sende die Datei bitten an den Support.":"Upload failed! The file seems to be corrupted. Try exporting it from the source application again at a later time. If the problem remains, please send the file to support.","Upload in Arbeit ... DIESES FENSTER NICHT SCHLIESSEN!":"Upload in progress ... DO NOT CLOSE THIS WINDOW!","Users and Companies":"Users and companies",Vegetation:"Vegetation","Datum der Vegetationskarte":"Vegetation map date","Datura-Kontrollzentrum":"Datura control center",Drohnenassessments:"Drone assessments","Drohnenbilder hochladen":"Upload drone images",Vegetationsmonitoring:"Crop monitoring","Verbindung trennen":"Disconnect from platform","Verbindung trennen fehlgeschlagen.":"Disconnection failed.","Verbindung zu CNH Industria":"Connect to CNH Industrial","Verbindung zu MyJohnDeere trennen":"Disconnect from MyJohnDeere","Vereinbarungen zur Flächenmeldung":"Terms and agreements for field transmission","Verfügbare Maschinen":"Available machines",Verkleinern:"Reduce","Verlustausgleich (%)":"Loss compensation (%)",Verlauf:"Job history","Job history öffnen":"Open job history",verschiedene:"various",Verstecken:"Hide","Verteilung auf dem Feld":"Distribution on the field",Vertrag:"Contract","Vertrag wählen":"Select contract",Vertragsnehmer:"Contractor",Vertragsproduktion:"Contract farming","Vervollständige die Ernte-Maßnahmen und klicke dann hier, um sie in FARMDOK zu buchen.":"Complete the harvesting activities and click here to save them in FARMDOK.","Verwalte hier deine Flächen":"Manage your fields here","Verwaltete Verträge":"Managed contracts",Verwaltung:"Administration","Verwendbar bis:":"Use until:",Verwendungszweck:"Purpose",Verwerfen:"Discard","Verwirkliche deinen Erfolg am Feld!":"Realize your success on the field!","Von der Aussaat bis zur Ernte, alles über deine Felder an einem Ort.":"From sowing to harvesting, everything about your fields in one place.","Von dort kannst du sie vom Terminal deines Traktors abrufen ohne einen USB-Stick.":"You can select them directly on your tractor's terminal without the need of a USB drive.","Voraussetzung: Einverständnis in eAMA abgeben!":"Prerequisite: Submit consent in eAMA!",Vorfrucht:"Preceding crop","Vorfrucht in der Datenquelle (aus dem Import)":"Previous crop in the data source (from import)","Vorlage im Format .CSV {linkStart}herunterladen{linkEnd}":"{linkStart}Download template{linkEnd} in .CSV format",Vorname:"First name",Vorschau:"Preview","Vordefinierte Notizen":"Pre-defined notes","Warnhinweise gefunden: {count}":"Warnings found: {count}","Wartezeit bis zur Ernte:":"Waiting period until harvest:","Wartezeit zwischen Anwendungen:":"Waiting period between treatments:","Wachstumsstadium (BBCH)":"Growth stage (bbch)","Wachstumsstadium eingeben":"Enter a bbch stage","Wachstumsstadium wählen":"Select a bbch stage",Wasserschutzgebiet:"Water protection zone","Was ist dein Beruf?":"What is your profession?","Was machst du?":"What are you doing?","Was sind deine Ziele?":"What are your objectives?","Wechsle zum Reiter Kundendaten, Menüpunkt Datenfreigabe > Übersicht.":"Switch to the Customer Data tab, menu item Data Sharing > Overview.",Wegzeit:"Driving time",Wein:"Wine",Weiter:"Continue","Weitere Dateien durch Ablegen hinzufügen":"Add more files by drop","Weitere Details erfassen":"Enter more details","Welche Kulturen baust du an?":"What crops are you growing?",Wert:"Value","Wert muss zwischen {min} und {max} sein":"Value must be between {min} and {max}","Weniger anzeigen":"Show less","Weniger Dezimalstellen":"Fewer decimal places","Wenn du den Lagerstand sehen möchtest, führe eine Lagerbewegung durch.":"Please enter a stock movement for this product, if you want to see the stock level here.","Werte:":"Values:",Wetter:"Weather","Wetter für:":"Weather for:",Wetterdiagramm:"Weather diagram",Windgeschwindigkeit:"Wind speed","Wie bewirtschaftest du?":"How do you farm?","Wie möchtest du importieren?":"How do you want to import?","Wie viele Hektar werden bewirtschaftet?":"How many hectares are farmed?","Wie viele Kunden werden betreut?":"How many customers do you have?","Wie viele Mitarbeiter gibt es?":"How many employees do you have?",Wiederherstellen:"Restore","Willst du Ernte-Maßnahmen in FARMDOK erstellen? Aktiviere die Kontrollkästchen in der ersten Spalte, dann klicke hier um zum nächsten Schritt zu gehen.":"Do you want to create harvesting activities in FARMDOK? Activate the checkboxes and click here to proceed.","Willst du ein neues Erntejahr {newYear} hinzufügen?":"Do you want to add a new crop year {newYear}?","Willst du wirklich das gewählte Feldstück löschen?":"Do you really want to delete the selected field group?","Willst du wirklich {count} Feldstücke löschen?":"Do you really want to delete {count} field groups?","Willst du wirklich {name} löschen?":"Do you really want to delete {name}?",Winterdienst:"Winter service","Wintergetreide {n}. Gabe":"Winter grain {n}. application","Wir fühlen uns dazu verpflichtet dir maßgeschneiderte Unterstützung zu bieten!":"We are committed to providing you with customized support!","Wir haben dir eine E-Mail an {email} gesendet.":"We sent you an e-mail to {email}.","Wir senden dir ein E-Mail zu, mit Hilfe dessen du ein neues Passwort setzen kannst.":"We will send you an e-mail with a link that allows you to set a new password.","Wirtschaftsdünger":"Farm fertiliser",Wolken:"Clouds","Wähle das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.":"Select the target crop year where the selected fields should be copied to.","Wähle das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.":"Select the target crop year where the selected fields should be moved to.","Wähle das Ziel-Erntejahr, wohin {field} kopiert werden soll.":"Select the target crop year where {field} should be copied to.","Wähle das Ziel-Erntejahr, wohin {field} verschoben werden soll.":"Select the target crop year where {field} should be moved to.","Wähle dein Land und melde dich an.":"Choose your country and sign up.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.":"Select the target farm and crop year where to copy the selected fields.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.":"Select the target farm and crop year where to move the selected fields.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} kopiert werden soll.":"Select the target farm and crop year where {field} should be copied.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} verschoben werden soll.":"Select the target farm and crop year where {field} should be moved to.","Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Maßnahmen verschoben werden sollen.":"Select the target farm and crop year where the selected activities should be moved to.","Wähle die Felder in der Karte oder in der Liste.":"Select the fields in the map or the filter below to get started.","Wähle die Felder, auf denen du Ernte-Maßnahmen erstellen möchtest, vervollständige die Informationen und klicke dann hier, um zu speichern.":"Select the fields where you want to create harvesting activities, then complete the informations and click here to save.","Wähle die Maschine an die du den Auftrag bz
1w. die Applikationskarte senden möchtest. Wähle <b>MyJohnDeere</b> falls du die Daten in die MyJohnDeere Plattform senden möchtest.":"Select the machine, you want to send the application map to. Select <b>MyJohnDeere</b> if you want to send the data to the MyJohnDeere platform.","Wähle ein Dateiformat abhängig vom Terminal, auf dem die Applikationskarte verwendet werden soll.":"Select a file format matching the terminal where you want to use the application map.","Wähle ein Produkt":"Select a product","Wähle eine Option um fortzufahren":"Choose an option to continue","Wähle einen Betrieb um deine Berichte anzuzeigen.":"Select one farm to view your reports.","Wähle mindesten ein Feld mit dem Kontrollkästchen in der ersten Spalte. Alle ausgewählten Felder müssen eine Kultur haben.":"Select at least one field via the checkbox. A crop is required for selected fields.","Wähle zumindest 1":"Select at least 1","Wähle zumindest 2":"Select at least 2","Wähle “Standard” wenn dein Terminal-Hersteller nicht in der Liste angeführt ist.":'Select "Default" if the manufacturer of your terminal is not listed.',"Wähle den ausführenden Betrieb":"Select the operating farm.","Wählen":"Select","Wählen ...":"Select ...","Wählen...":"Select...","Wählen Sie Polygone in der Karte aus, um Felder zu erstellen. Sie können mehrere Polygone zusammenführen, wenn sie mehrere Polygone zu einem Feld zusammenführen möchten.":"Select polygons in the map to create fields. You can merge multiple polygones if you want to create one field.","Wähle ein Feld in der Karte und gib den Prüfabstand ein. Die Feldkontur wird um den Prüfabstand nach außen verschoben und alle Felder gekennzeichnet, die vom Prüfabstand geschnitten werden.":"Select a field in the map and enter the distance to be validated. The field contour is shifted outwards by this distance and all fields that are intersected by the distance are highlighted.","Wärmesumme":"Heat units","Qualität":"Quality","Qualitätsdüngung (3. Gabe)":"Quality fertilization (3. application)",Querformat:"Landscape",XLS:"XLS","ZIEHE DIE DATEI HIER HER":"DRAG AND DROP THE FILE HERE","Zeichnen beenden":"Close drawing","Zeichnen eines Polygons":"Draw a polygon","Zeichnen einer Polyline":"Draw a polyline","Zeichnen Sie Polygone oder Linien in die Karte, um Ihr GIS-Objekt darzustellen.":"Draw polygons or lines in the map to represent your GIS-Object.","Zeitraum von {periodStart} bis {periodEnd}":"Contracting period {periodStart} to {periodEnd}","Zeitraum:":"Time period:",Zeitstempel:"Timestamps","Ziehe die exportierte(n) Datei(en) mit der Maus in das weiße Rechteck mit dem strichlierten Rahmen (Drag &amp; Drop).":"Drag and drop the exported file(s) into the white rectangle with the dashed frame.","Ziel auswählen":"Select target","Ziel N-Rate (kg/ha)":"Target N-Rate (kg/ha)","Ziel-Betrieb":"Target farm","Ziel-Erntejahr":"Target crop year","Zielbetrieb: In welchen Betrieb sollen die Daten importiert werden?":"Target farm: To which farm should the data be imported?","Zielertrag (kg/ha)":"Target yield (kg/ha)",Zone:"Zone",Zonen:"Zones","Zonen Ergebnis":"Zones result","Zonen erstellen":"Create zones","Zonen basiert auf {indexType}, Anzahl der Zonen: {quantisationCode}":"Zones based on {indexType}, Number of zones: {quantisationCode}","Zonenkarte erstellen":"Create zone map",Zonierung:"Zoning","Zu den Berichten":"To reports","Zu den offenen Verträgen":"View open calls","Zu meinen Verträgen":"View my contracts","Zuckergehalt (t)":"Sugar contents (t)",Zuckergehalt:"Sugar content","Zugelassen bis:":"Approved until:",Zugeordnet:"Assigned","Zuletzt aktualisiert":"Last update","Zuletzt verwendet":"Last used","Zum Bericht":"View report","Zum Vertrag":"View contract","Zum Import in dein ISOBUS-Terminal":"To import into your ISOBUS terminal","Zur Startseite":"Back to your home page","Zurück":"Back","Zurück zu":"Back to","Zurück zum Login":"Back to login","Zurück zum Login.":"Back to login.","Zurück zur Dateien-Übersicht":"Back to the files page","Zurück zu Felder":"Back to the Fields","Zurück zur Feldstücke-Startseite":"Back to the field groups page","Zurück zu Maßnahmen":"Back to the Activities","Zurück zur Maßnahmen-Startseite":"Back to the activities page","Zurück zur Vertragsansicht":"Back to the contract page","Zurück zur Vertrags-Über
1sicht":"Back to the contracts overview","Zurück zur Verwaltungs-Übersicht":"Back to the administration overview","Zurücksetzen":"Reset","Zusammenarbeit verbessern":"Improve collaboration","Zusammenfassung je Schlag":"Summary per field","Zusammenführen von Polygonen":"Merge polygons",Zwischenfrucht:"Catch crop","ab BBCH":"from BBCH","aus Import":"From import","bearbeitete Fläche (ha)":"cultivated field (ha)","bis BBCH":"up to BBCH","eAMA Online Flächen Import":"eAMA Online field import","eAMA PIN":"eAMA PIN","eAMA öffnen":"Open eAMA","eAMA-Betriebsnummer":"eAMA company number",empfohlen:"recommended","für Mineraldünger":"for mineral fertilizer",ha:"ha","in FARMDOK":"in FARMDOK","je mehr desto mehr":"The more, the more","je weniger desto mehr":"The less, the more","keine Angabe":"Not specified","Keine gültigen Schadfaktoren für Mittel <strong>{pesticide}</strong> und <strong>{culture}</strong> gewählt":"Selected amount for agents {pesticide} and {culture} is not amount","kg/ha":"kg/ha","manuelle Dosierung":"Manual dosage","oder klicke Datei auswählen oder Ordner auswählen, um eine Datei hinzuzufügen.":"or click {0}Select File{0} or {0}select directory{0} to add a file.",pH:"pH",t:"t",und:"and","{countSelected} von {countAvailable} Betrieben ausgewählt":"{countSelected} of {countAvailable} farms selected","{count} Felder":"{count} fields","{count} Felder ohne Erntemaßnahme":"{count} fields without harvest activity","{count} von {total} Feldern mit Erntemaßnahme":"{count} of {total} fields with harvest activity","{field} ist ein Pflichtfeld.":"{field} is required.","{field} muss mindestens {length} Zeichen lang sein.":"{field} needs to be minimum {length} characters long.","{name}: {sizeFormatted} ha":"{name}: {sizeFormatted} ha","{number} Flächen ({area} ha) an {partner} gesendet.":"{number} fields ({area} ha) transmitted to {partner}.","{seedrateMin} bis {seedrateMax} Körner pro Hektar":"{seedrateMin} to {seedrateMax} seeds per hectare","{seedrateMin} bis {seedrateMax} Körner pro m^2":"{seedrateMin} to {seedrateMax} seeds per m²","{size} ha":"{size} ha","{value} %":"{value} %","°C Wärmesumme in {year}":"°C heat total in {year}","Überspringen":"Skip","„hoch“ ergibt mehrere, kleine Teilflächen; „niedrig“ weniger, größere":'"high" results in more and smaller subareas; "low" results in less and larger subareas',"Übrig in":"Available on","Übrig am Betrieb (kein spezifisches Lager)":"Available on the farm (no specific storage)",UploadPending:"Pending",UploadExpired:"Expired",Calculating:"In progress",Finished:"Completed",Failed:"Failed"}}b["default"].use(w.Z.plugin,Lb,{onTranslationNotFound:(e,t)=>Lb.state.fetchingTranslation?"...":"de"===e.substring(0,2)?t:null}),b["default"].i18n.add("de",Ub()),b["default"].i18n.add("en",jb()),b["default"].i18n.fallback("en"),b["default"].i18n.set(Lb.state.locale);const{i18n:Hb}=b["default"];var Gb=Hb,Wb=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app",class:{"app--content-fullscreen":e.isFullscreen},attrs:{id:"app"}},[e.initialFetching||e.$store.state.redirectingToAgriDat?t("div",{staticClass:"loading-global-wrapper"},[t("LoadingGlobal")],1):e._e(),e.$store.state.auth.loggedIn&&!e.isFullscreen?t("TheNavbar"):e._e(),!e.initialFetching||e.$store.state.auth.loggedIn?t("div",{staticClass:"page"},[e.isFullscreen?e._e():t("TheTopbar"),e.hasTabs&&!e.isFullscreen?t("ThePagebar"):e._e(),!e.initialFetching&&e.noMultiCompanySupport?t("PageNoMultiCompanySupport"):e.initialFetching||e.$store.state.redirectingToAgriDat?e._e():t("RouterView")],1):e._e()],1)},Zb=[],Kb=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"scroll-y":"","content-flex":""}},[t("div",{staticClass:"page-no-multi-company-support__content"},[t("LogoAuthPages"),t("p",[e._v(e._s(e.$t("Dieses Feature unterstützt derzeit nur einen gewählten Betrieb.")))]),t("CompanySwitch",{attrs:{block:"",right:!1}})],1)])},qb=[],Yb=function(){var e=this,t=e._self._c;return t("a",{attrs:{href:"https://www.farmdok.com"}},[t("svg",{staticStyle:{"fill-rule":"evenodd","clip-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"1.41421"},attrs:{width:"300",viewBox:"0 0 9450 3413",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","xml:space":"preserve"}},[t("rect",{staticStyle:{fill:"none"},attrs:{id:"FARMDOK-Logo-Bild.2f.Text.--Farbe-RGB-.--800mm",x:"0.83",y:"0.391",width:"9448.82",height:"3410.59"}}),t("clipPath",{attrs:{id:"_clip1"}},[t("rect",{attrs:{x:"0.83",y:"0.391",width:"9448.82",height:"3410.59"}})]),t("g",{attrs:{"clip-path":"url(#_clip1)"}},[t("g",{attrs:{id:"Logo-Weisser-BG"}},[t("rect",{staticStyle:{fill:"#fff"},attrs:{id:"BG",x:"0.83",y:"0.391",width:"9448.82",height:"3410.59"}}),t("g",{attrs:{id:"Schriftzug-Braun"}},[t("g",[t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M2968.94,2090.67l135.574,0l0,-313.987l389.085,0l0,-123.391l-389.085,
10l0,-210.427l438.685,0l0,-123.391l-574.259,0l0,771.196Z"}})]),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M3481.85,2090.67l138.88,0l79.36,-186.189l364.836,0l78.258,186.189l143.289,0l-339.485,-776.704l-125.653,0l-339.485,776.704Zm267.84,-306.275l132.267,-308.478l133.369,308.478l-265.636,0Z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M4365.88,2090.67l135.574,0l0,-268.817l169.742,0l189.583,268.817l159.822,0l-208.32,-291.953c108.018,-30.848 184.071,-106.865 184.071,-233.562l0,-2.203c0,-67.205 -23.147,-124.493 -63.929,-166.358c-49.6,-48.475 -125.653,-77.12 -222.649,-77.12l-343.894,0l0,771.196Zm135.574,-388.903l0,-258.902l197.298,0c100.302,0 159.822,45.171 159.822,127.799l0,2.203c0,78.221 -61.724,128.9 -158.72,128.9l-198.4,0Z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M5117.88,2090.67l133.37,0l0,-550.854l241.386,361.36l4.409,0l243.592,-363.564l0,553.058l135.573,0l0,-771.196l-144.391,0l-234.774,364.666l-234.773,-364.666l-144.392,0l0,771.196Z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M6010.29,2090.67l287.68,0c242.489,0 410.027,-168.561 410.027,-385.598l0,-2.203c0,-217.037 -167.538,-383.395 -410.027,-383.395l-287.68,0l0,771.196Zm135.573,-123.391l0,-524.414l152.107,0c162.027,0 267.84,111.273 267.84,262.207l0,2.203c0,150.935 -105.813,260.004 -267.84,260.004l-152.107,0Z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M7193.39,2101.14c236.978,0 404.516,-181.782 404.516,-398.818l0,-2.204c0,-217.036 -165.334,-396.615 -402.312,-396.615c-236.978,0 -404.516,181.782 -404.516,398.819l0,2.203c0,217.037 165.334,396.615 402.312,396.615Zm2.204,-124.493c-153.209,0 -262.329,-124.493 -262.329,-274.325l0,-2.204c0,-149.832 106.916,-272.122 260.125,-272.122c153.209,0 262.329,124.493 262.329,274.326l0,2.203c0,149.833 -106.916,272.122 -260.125,272.122Z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{d:"M7679.91,2090.67l135.574,0l0,-223.647l120.142,-123.391l263.432,347.038l164.231,0l-335.076,-439.582l320.747,-331.614l-166.436,0l-367.04,387.801l0,-387.801l-135.574,0l0,771.196Z"}})]),t("path",{staticStyle:{fill:"#3cc961"},attrs:{id:"Icon",d:"M1101.56,2243.38c-44.11,-36.381 -76.461,-79.885 -85.566,-141.334c-6.658,-44.935 0.769,-89.108 16.097,-131.008c27.319,-74.662 57.47,-148.262 87.182,-224.282c3.031,23.364 5.345,44.57 8.609,65.616c7.365,47.416 26.701,90.502 54.236,128.897c46.994,65.538 54.104,135.119 29.461,208.773l0,50.731l-18.867,0l88.215,0c15.733,-21.118 33.002,-41.032 52.795,-59.172c39.166,-35.863 86.932,-46.648 137.726,-47.908c70.538,-1.754 135.545,-20.354 194.157,-60.126c0.718,-0.491 6.429,-5.962 9.878,-6.53c-46.479,70.282 -94.83,145.155 -141.83,212.178c-29.834,42.53 -68.618,76.513 -119.102,93.89c-62.121,21.366 -122.086,9.016 -181.151,-13.17c-6.722,-2.52 -13.211,-5.702 -21.073,-9.143l-110.767,0l0,-67.412Zm852.646,-1142.8l357.562,0l0,1210.21l-632.609,0l0,-110.019l522.59,0l0,-990.17l-247.543,0l0,-110.019Zm-121.594,599.65c-46.479,70.282 -94.831,145.155 -141.831,212.178c-29.834,42.531 -68.618,76.513 -119.101,93.89c-62.121,21.366 -122.086,9.016 -181.151,-13.169c-6.759,-2.535 -13.281,-5.737 -21.2,-9.199c35.025,-61.72 69.585,-121.536 121.521,-169.136c39.167,-35.862 86.932,-46.648 137.726,-47.907c70.538,-1.754 135.546,-20.355 194.158,-60.127c0.718,-0.491 6.428,-5.962 9.878,-6.53Zm-515.92,257.381c-72.423,-45.41 -130.813,-96.277 -143.57,-182.372c-6.657,-44.935 0.769,-89.108 16.098,-131.008c27.319,-74.662 57.469,-148.262 87.182,-224.282c3.03,23.364 5.344,44.57 8.609,65.617c7.364,47.416 26.7,90.501 54.235,128.896c48.362,67.446 54.484,139.173 27.231,215.215c-15.064,42.071 -32.374,83.396 -49.785,127.934Zm680.346,-579.737c-45.146,68.27 -89.236,137.303 -136.049,204.413c-15.756,22.617 -36.908,42.338 -58.349,60.022c-58.329,48.077 -125.471,54.477 -196.259,35.548c-22.301,-5.936 -43.926,-14.472 -67.652,-22.398c38.381,-67.102 74.697,-132.106 134.342,-179.926c32.899,-26.355 71.588,-36.396 112.403,-37.479c75.626,-1.974 146.66,-17.955 211.564,-60.18Zm-510.004,249.569c-40.278,-24.035 -73.218,-49.408 -99.869,-82.343c-54.498,-67.421 -56.218,-143.39 -30.436,-220.775c21.819,-65.535 49.657,-129.046 74.74,-193.507c4.758,-12.23 9.009,-24.665 16.074,-37.202c1.06,11.979 2.012,23.954 3.181,35.909c5.919,61.749 31.483,115.757 65.39,166.538c29.286,43.827 43.887,91.414 34.568,144.311c-3.671,20.75 -7.81,41.756 -14.883,61.508c-14.887,41.59 -31.856,82.385 -48.765,125.561Zm-165.436,-416.844l-110.019,0l0,220.038l-110.019,0l0,-330.057l220.038,0l0,110.019Zm554.821,-302.552c-3.406,98.296 2.751,193.267 -19.844,286.372c-19.28,79.478 -68.223,133.388 -143.091,164.006c-26.716,10.926 -54.613,18.951 -81.738,28.215c-54.859,-122.753 -49.843,-222.431 36.272,-306.238c49.829,-48.504 106.496,-90.038 160.253,-134.501c14.619,-12.113 29.838,-23.504 48.148,-37.854Z"}}
1)])])])])},Jb=[],Xb={name:"LogoAuthPages"},Qb=Xb,ew=i(1001),tw=(0,ew.Z)(Qb,Yb,Jb,!1,null,null,null),iw=tw.exports,aw=function(){var e=this,t=e._self._c;return t("main",{staticClass:"page-skeleton"},[t("div",{staticClass:"page-skeleton__content-wrapper-outer"},[e._t("contentbar"),t("div",{staticClass:"page-skeleton__content-wrapper-inner"},[null!=e.$slots.sidebar&&e.pageFeatureVisible&&e.pageFeatureEnabled?t("aside",{staticClass:"page-skeleton__sidebar-wrapper"},[t("button",{staticClass:"page-skeleton__sidebar-toggle bg-dark text-white border-0",on:{click:function(t){e.isSidebarVisible=!e.isSidebarVisible}}},[e.isSidebarVisible?t("FontAwesomeIcon",{attrs:{icon:"chevron-left"}}):t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isSidebarVisible,expression:"isSidebarVisible"}],staticClass:"page-skeleton__sidebar-area overflow-auto"},[e._t("sidebar")],2)]):e._e(),t("div",{staticClass:"page-skeleton__content-area",class:{"page-skeleton__content-area--scroll-y":e.scrollY,"page-skeleton__content-area--flex":e.contentFlex}},[e.pageFeatureVisible&&e.pageFeatureEnabled?e._t("default"):e._e(),e.pageFeatureVisible&&e.pageFeatureEnabled?e._t("content"):e._e(),e.multiCompany?e._t("noMultiCompanySupport"):e._e(),!e.pageFeatureVisible||e.pageFeatureEnabled||e.multiCompany?e._e():e._t("featureNotEnabled",(function(){return[t("MaxWidthContainer",{attrs:{left:""}},[t("FeatureNotAvailable",{attrs:{"feature-name":e.pageFeatureTitle}})],1)]})),e.pageFeatureVisible?e._e():e._t("featureNotVisible",(function(){return[t("MaxWidthContainer",{attrs:{left:""}},[t("FeatureNotAvailable",{attrs:{"feature-name":e.pageFeatureTitle,"feature-visible":!1}})],1)]}))],2)])],2),e.pageFeatureVisible&&e.pageFeatureEnabled?e._t("satellite"):e._e()],2)},nw=[],rw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"feature-not-available"},[e.$slots.featureName||"function"!==typeof e.featureName?e._e():t("h2",{staticClass:"my-4"},[e._v(" "+e._s(e.featureName())+" ")]),e._t("featureName"),e.featureVisible?t("p",[e._v(" "+e._s(e.$t("Diese Funktion ist sehr beliebt. Jetzt im Shop freischalten und weitere Vorteile nutzen!"))+" ")]):t("p",[e._v(e._s(e.$t("Du verfügst auf diesem Betrieb über keine Berechtigung für dieses Feature.")))]),e.addLinkToShopComputed?t("div",{staticClass:"d-print-none"},[t("Button",{attrs:{size:"sm",variant:"danger","leading-icon":"",icon:["far","shopping-cart"]},on:{click:()=>e.$router.push({name:"shop"})}},[e._v(" "+e._s(e.$t("Jetzt Lizenz upgraden"))+" ")])],1):e.noBackLink?e._e():t("div",{staticClass:"d-print-none"},[t("ButtonLink",{on:{click:function(t){return e.$router.push({name:"home"})}}},[e._v(" "+e._s(e.$t("Zur Startseite"))+" ")])],1)],2)},sw=[],ow=i(23636),lw=i(68779),dw=function(){var e=this,t=e._self._c;return t("BButton",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom.d500",value:e.tooltipOptions,expression:"tooltipOptions",modifiers:{hover:!0,bottom:!0,d500:!0}}],staticClass:"button",class:[`button--${e.variantComputed}`,`button--${e.size}`,{"button--has-next-sibling":e.hasNextSibling,"button--has-transparent-next-sibling":e.hasTransparentNextSibling}],style:e.buttonStyle,attrs:{size:e.size,variant:e.variantComputed,title:e.iconOnly||e.tooltipOptions?e.title:"",block:e.block,disabled:e.disabled||e.fetching,"data-namespace":e.componentNamespace,"data-testid":"button"},on:{click:e.onClick}},[null!=e.iconComputed&&e.leadingIcon?t("span",{staticClass:"button__leading-icon",class:{"button__leading-icon--icon-only":e.iconOnly,"button__leading-icon--with-notification":null!=e.notificationComputed}},[t("FontAwesomeIcon",{staticClass:"mx-0",attrs:{icon:e.iconComputed,spin:e.fetching}})],1):e._e(),e.iconOnly?e._e():t("span",{staticClass:"button__label",class:{"button__label--with-notification":null==e.iconComputed&&null!=e.notificationComputed}},[e._t("default",(function(){return[e._v(" "+e._s(e.title)+" ")]}))],2),null==e.iconComputed||e.leadingIcon?e._e():t("span",{staticClass:"button__trailing-icon",class:{"button__trailing-icon--icon-only":e.iconOnly,"button__trailing-icon--with-notification":null!=e.notificationComputed}},[t("FontAwesomeIcon",{staticClass:"mx-0",attrs:{icon:e.iconComputed,spin:e.fetching}}
1)],1)])},cw=[],uw=i(73582),pw={props:{componentNamespaceName:{type:String,default:null}},computed:{componentNamespace(){const e=[];null!=this.componentNamespaceName&&e.push(this.componentNamespaceName);for(let t=this.$parent;null!=t;t=t.$parent)"string"===typeof t.$options.name&&e.push(t.$options.name);return e.join(".")}}};ow.vI.add(uw.IJ7);var hw={name:"Button",mixins:[pw],props:{size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},color:{type:String,default:"primary",validator:e=>["primary","danger","black","medium","white","lightest"].includes(e)},outline:{type:Boolean,default:!1},variant:{type:String,default:null},icon:{type:[String,Array],default:null},leadingIcon:{type:Boolean,default:!1},iconOnly:{type:Boolean,default:!1},title:{type:String,default:""},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},tooltipOptions:{type:Object,default:null},notification:{type:[Boolean,String],default:!1}},data(){return{hasNextSibling:!1,hasTransparentNextSibling:!1}},computed:{variantComputed(){let e=this.variant;return null==this.variant&&(e=this.outline?`outline-${this.color}`:this.color),["primary","danger","black","white","lightest","white-black"].includes(e)||["outline-primary","outline-danger","outline-black","outline-medium"].includes(e)||console.error('[Vue warn]: Invalid prop: custom validator check failed for prop "variantComputed".',e),e},iconComputed(){return this.fetching?"circle-notch":this.icon},notificationComputed(){return"string"===typeof this.notification?this.notification:!0===this.notification?"danger":null},buttonStyle(){return null!=this.notificationComputed?{"--notification-color":`var(--${this.notificationComputed})`}:null}},mounted(){null!=this.$el.nextElementSibling&&(this.hasNextSibling=!0,[...this.$el.nextElementSibling.classList].some((e=>["button--lightest","button--white"].includes(e)))&&(this.hasTransparentNextSibling=!0))},methods:{onClick(e){this.$root.$emit("button--click",this.componentNamespace),this.$emit("click",e)}}},mw=hw,fw=(0,ew.Z)(mw,dw,cw,!1,null,"b103178c",null),gw=fw.exports,yw=function(){var e=this,t=e._self._c;return t("BLink",{staticClass:"button-link",class:[`button-link--${e.color}`,{"button-link--disabled":e.disabled}],attrs:{href:e.href,target:e.target,to:e.to,disabled:e.disabled},on:{click:t=>e.onClick(t)}},[e.icon?t("FontAwesomeIcon",{staticClass:"button-link__icon",attrs:{icon:e.icon}}):e._e(),e._t("default")],2)},vw=[],bw={name:"ButtonLink",mixins:[pw],props:{href:{type:String,default:null},target:{type:String,default:"_self"},to:{type:[Object,String],default:null},color:{type:String,default:"primary",validator:e=>["primary","black","red"].includes(e)},icon:{type:[String,Array],default:null},disabled:{type:Boolean,default:!1}},methods:{onClick(e){this.$root.$emit("button--click",this.componentNamespace),this.$emit("click",e)}}},ww=bw,Cw=(0,ew.Z)(ww,yw,vw,!1,null,"1bfa9140",null),Fw=Cw.exports;ow.vI.add(lw.sq$);var Aw={name:"FeatureNotAvailable",components:{Button:gw,ButtonLink:Fw},props:{featureName:{type:String,default:null},featureVisible:{type:Boolean,default:!0},addLinkToShop:{type:Boolean,default:null},noBackLink:{type:Boolean,default:!1}},computed:{addLinkToShopComputed(){return null!=this.addLinkToShop?this.addLinkToShop:!1!==this.featureVisible&&this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.CAN_PURCHASE_LICENSE)}}},kw=Aw,Sw=(0,ew.Z)(kw,rw,sw,!1,null,null,null),Ew=Sw.exports,Iw=function(){var e=this,t=e._self._c;return t("div",{staticClass:"max-width-container",class:[`max-width-container--${e.size}`,{"max-width-container--grid":e.grid},{"max-width-container--left":e.left}]},[e._t("default")],2)},_w=[],Dw={name:"MaxWidthContainer",props:{size:{type:String,validator:e=>["md","lg","xl"].includes(e),default:"md"},grid:{type:Boolean,default:!1},left:{type:Boolean,default:!1}}},Mw=Dw,Pw=(0,ew.Z)(Mw,Iw,_w,!1,null,"6673236b",null),Tw=Pw.exports,xw={name:"ThePageSkeleton",components:{FeatureNotAvailable:Ew,MaxWidthContainer:Tw},props:{scrollY:{type:Boolean,default:!1},contentFlex:{type:Boolean,default:!1},pageFeatureTitle:{type:Function,default:null},pageFeatureVisible:{type:Boolean,default:!0},pageFeatureEnabled:{type:Boolean,default:!0},multiCompany:{type:Boolean,default:!1}},data(){return{isSidebarVisible:!0}}},Bw=xw,Ow=(0,ew.Z)(Bw,aw,nw,!1,null,"469737e2",null),$w=Ow.exports,Rw=function(){var e=this,t=e._self._c;return e.companies.length>1||e.$store.state.auth.user.superAdmin?t("div",{staticClass:"company-switch",class:{"company-switch--block":e.block}},[1===e.companies.length&&e.$store.state.auth.user.superAdmin?t("span",{staticClass:"company-switch__label",class:{"company-switch__label--slim":e.slim}},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.slim&&1===e.currentCompanies.length,expression:"!slim && currentCompanies.length === 1"}]},[e._v(e._s(e.$t("Betrieb"))+":")]),e._v(" "+e._s(e.title)+" ")]):e._e(
1),e.companies.length>1?t("BDropdown",{ref:"dropdown",attrs:{variant:"lightest","menu-class":"company-switch__dropdown-menu shadow mt-1","no-caret":"","no-flip":"",right:e.right,block:e.block}},[t("template",{slot:"button-content"},[t("span",{staticClass:"company-switch__label",class:{"company-switch__label--slim":e.slim},attrs:{title:e.title}},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.slim&&1===e.currentCompanies.length,expression:"!slim && currentCompanies.length === 1"}]},[e._v(e._s(e.$t("Betrieb"))+":")]),e._v(" "+e._s(e.title)+" ")]),e.companies.length>1?t("FontAwesomeIcon",{attrs:{icon:"chevron-circle-down"}}):e._e()],1),e._l(e.companiesWithoutCluster,(function(i){return t("BDropdownForm",{key:i.id,staticClass:"company-switch__dropdown-form",class:{"company-switch__dropdown-form--active":i.isActive},on:{submit:function(e){e.preventDefault()}}},[t("div",{staticClass:"company-switch__item-container"},[t("div",{staticClass:"company-switch__checkbox"}),t("button",{staticClass:"company-switch__company-name btn btn-link",attrs:{"data-company-id":i.id,title:i.name},on:{click:()=>e.selectCompany(i)}},[e._v(" "+e._s(i.name)+" ")]),t("div",{staticClass:"company-switch__package-name"},[e._v(e._s(i.licensePackageName))])])])})),e._l(Object.keys(e.companiesByCluster),(function(i){return t("div",{key:i},[t("div",{staticClass:"company-switch__select-all-button-container"},[t("BButton",{staticClass:"company-switch__select-all-button",attrs:{variant:"outline-lightest"},on:{click:()=>e.selectAllCompanies(i)}},[e._v(" "+e._s(e.$t("Alle wählen"))+" ")]),e.currentCompanies.length>0&&String(e.currentCompanies[0].clusterId)===i?t("BButton",{staticClass:"company-switch__select-all-button",attrs:{variant:"outline-lightest"},on:{click:e.deselectAllCompanies}},[e._v(" "+e._s(e.$t("Auswahl aufheben"))+" ")]):e._e()],1),e._l(e.companiesByCluster[i],(function(i){return t("BDropdownForm",{key:i.id,staticClass:"company-switch__dropdown-form",class:{"company-switch__dropdown-form--active":i.isActive},on:{submit:function(e){e.preventDefault()}}},[t("div",{staticClass:"company-switch__item-container"},[t("div",{staticClass:"company-switch__checkbox"},[t("FormCheckbox",{attrs:{"data-company-id":i.id,checked:i.isActive},on:{change:()=>e.selectCompany(i)}})],1),t("button",{staticClass:"company-switch__company-name btn btn-link",attrs:{"data-company-id":i.id},on:{click:()=>e.selectCompany(i)}},[e._v(" "+e._s(i.name)+" ")]),t("div",{staticClass:"company-switch__package-name"},[e._v(e._s(i.licensePackageName))])])])}))],2)}))],2):e._e()],1):e._e()},Nw=[],zw=function(){var e=this,t=e._self._c;return t("BFormCheckbox",{staticClass:"form-checkbox",class:[`form-checkbox--${this.size}`,{"form-checkbox--in-group":e.isInGroup,"form-checkbox--slim":e.slim,"form-checkbox--switch":e.isSwitch,"form-checkbox--empty":null==e.$slots.default}],attrs:{checked:e.isInGroup?null:e.checked,disabled:e.disabled,value:e.value},on:{change:e.change,input:e.input}},[t("span",{staticClass:"form-checkbox__icon-wrapper",class:[`form-checkbox__icon-wrapper--${e.size}`,{"form-checkbox__icon-wrapper--switch":e.isSwitch},{"form-checkbox__icon-wrapper--checked":e.checkedComputed},{"form-checkbox__icon-wrapper--empty":null==e.$slots.default}]},[t("FontAwesomeIcon",{attrs:{icon:e.icon,flip:e.isSwitch&&!e.checkedComputed?"horizontal":null}})],1),t("span",{staticClass:"form-checkbox__title",class:`form-checkbox__title--${e.size}`},[e._t("default")],2)])},Lw=[],Vw=i(19692);ow.vI.add(lw.pL1,lw.a3n,lw.WZW);var Uw={name:"FormCheckbox",components:{FontAwesomeIcon:s.GN,BFormCheckbox:Vw.l},model:{prop:"checked",event:"input"},inject:{bvGroup:{from:"bvCheckGroup",default:!1}},props:{size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},switch:{type:Boolean,default:!1},slim:{type:Boolean,default:!1},value:{default:void 0},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},computed:{isSwitch(){return this.switch},isInGroup(){return!!this.bvGroup},checkedComputed(){return this.isInGroup?this.bvGroup.localChecked.includes(this.value):this.checked},icon(){return this.switch?["far","toggle-on"]:this.checkedComputed?["far","check-square"]:["far","square"]}},methods:{input(e){this.$emit("input",e)},change(e){this.$emit("change",e)}}},jw=Uw,Hw=(0,ew.Z)(jw,zw,Lw,!1,null,"7d846def",null),Gw=Hw.exports;ow.vI.add(uw.yh$);var Ww={name:"CompanySwitch",components:{FormCheckbox:Gw},props:{slim:{type:Boolean,default:!1},right:{type:Boolean,default:!0},block:{type:Boolean,default:!1}},computed:{currentCompanies(){return this.$store.state.auth.currentCompanies},title(){if(1===this.currentCompanies.length)return this.currentCompanies[0].name;if(0===this.currentCompanies.length)return this.$t("Kein Betrieb gewählt");let e=this.currentCompanies.length;const{clusterId:t}=this.currentCompanies[0];return null!=this.companiesByCluster[t]&&(e=this.companiesByCluster[t].length),this.$t("{countSelected} von {countAvailable}
1 Betrieben ausgewählt",{countSelected:this.currentCompanies.length,countAvailable:e})},companies(){return this.$store.state.auth.userCompanies.filter((e=>e.active&&null!=e.company)).map((e=>({id:e.company.id,name:e.company.name,licensePackageName:e.company.licensePackageName,clusterId:e.company.clusterId,isActive:this.currentCompanies.some((t=>t.id===e.company.id))})))},companiesWithoutCluster(){return this.companies.filter((e=>null==e.clusterId)).sort(this.sortByCompanyName)},companiesByCluster(){return this.companies.filter((e=>null!=e.clusterId)).reduce(((e,t)=>{const i={...e};return null==i[t.clusterId]&&(i[t.clusterId]=[]),i[t.clusterId]=[...i[t.clusterId],t].sort(this.sortByCompanyName),i}),{})}},methods:{sortByCompanyName(e,t){return e.name<t.name?-1:e.name>t.name?1:0},selectCompany(e){const t=this.$store.state.auth.companiesById[e.id];if(null==t.clusterId)return this.$store.dispatch("auth/setCurrentCompanies",[t]),void this.$refs.dropdown.hide();let i=this.currentCompanies.filter((e=>e.id!==t.id));if(e.isActive)return this.$store.dispatch("auth/setCurrentCompanies",i),void this.updateDropdownPosition();i.length>0&&i[0].clusterId!==t.clusterId&&(i=[]),i.push(t),this.$store.dispatch("auth/setCurrentCompanies",i),this.updateDropdownPosition()},selectAllCompanies(e){const t=this.companiesByCluster[e].map((e=>this.$store.state.auth.companiesById[e.id]));this.$store.dispatch("auth/setCurrentCompanies",t),this.updateDropdownPosition()},deselectAllCompanies(){this.$store.dispatch("auth/setCurrentCompanies",[]),this.updateDropdownPosition()},updateDropdownPosition(){this.$refs.dropdown.hide(),this.$nextTick((()=>{null!=this.$refs.dropdown&&this.$refs.dropdown.show()}))}}},Zw=Ww,Kw=(0,ew.Z)(Zw,Rw,Nw,!1,null,"5b08e822",null),qw=Kw.exports,Yw={name:"PageNoMultiCompanySupport",components:{CompanySwitch:qw,ThePageSkeleton:$w,LogoAuthPages:iw}},Jw=Yw,Xw=(0,ew.Z)(Jw,Kb,qb,!1,null,"21f4c3c4",null),Qw=Xw.exports,eC=function(){var e=this,t=e._self._c;return e.showNavbar?t("aside",{staticClass:"navbar bg-primary",class:{"navbar--expanded":e.expanded}},[t("div",{staticClass:"navbar__inner-wrapper",class:{"navbar__inner-wrapper--expanded":e.expanded}},[t("div",{staticClass:"navbar__top"},[t("button",{staticClass:"navbar__burger",on:{click:e.toggleNavbarVisibility}},[e.expanded?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:["far","times"]}}):t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:["far","bars"]}})],1),t("RouterLink",{staticClass:"navbar__logo",class:{"navbar__logo--expanded":e.expanded},attrs:{to:e.baseUrl}},[t("IconBase",{attrs:{name:"Farmdok",width:"129",height:"25",viewBox:"0 0 197 39",iconColor:"white"}},[t("IconLogo")],1)],1),t("span",{staticClass:"flex-grow-1"}),t("MetaNav",{staticClass:"navbar__meta-nav",attrs:{slim:""}})],1),t("div",{ref:"navbarBottom",staticClass:"navbar__bottom",class:{"navbar__bottom--expanded":e.expanded}},[t("nav",{staticClass:"navbar__primary-nav"},[t("NavbarItem",{attrs:{icon:["fass","fa-grid-2"],to:{name:"fields"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:"pencil-alt",to:{name:"activities"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:"map",to:{name:"map"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:"chart-pie",to:{name:"reports"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),e.$store.getters.currentCompaniesHaveFeatureVisible(e.availableFeatures.FEATURE_DATURA_CONTROL)?t("NavbarItem",{attrs:{icon:"badge-check",to:{name:"datura"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}):e._e()],1),t("DebugComponentWrapper",[t("nav",{staticClass:"navbar__primary-nav my-3"},[t("NavbarItem",{attrs:{icon:"map",to:{name:"map"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:["far","rectangle-wide"],to:{name:"button-test"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:["far","file-alt"],to:{name:"form-test"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}})],1)]),t("span",{staticClass:"navbar__vertical-spacer flex-grow-1"}),t("nav",{staticClass:"navbar__secondary-nav"},[t("NavbarItem",{attrs:{icon:"ellipsis-v",expanded:e.expanded,label:e.$t("Mehr"),to:{name:"more"},disabled:!0,submenu:[{headline:e.$t("Mehr"),links:[{to:{name:"notes"}},{to:{name:"stock-movement"}},{to:{name:"cost-accounting"}},{to:{name:"digital-contracting"}},{to:{name:"more/shared-fields"}}]},{headline:e.$t("Planung"),links:[{to:{name:"task-plan"}},{to:{name:"fertilization-plan"}}]},{headline:e.$t("Düngeverordnung"),links:[{to:{name:"fertilizer-regulation"}},{to:{name:"nutrient-comparison"}},{to:{name:"substance-flow"}}]},{headline:e.$t("Precision Farming"),links:[{to:{name:"monitoring"}},{to:{name:"application-maps"}}]}]},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:"cog",to:{name:"management"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),t("NavbarItem",{attrs:{icon:"shopping-cart",to:{name:"shop"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}),e.$store.state.auth.user.superAdmin||e.$store.state.auth.user.isPartner?t("NavbarItem",{attrs:{icon:"qrcode",to:{name:"partner/voucher-bundles"},expanded:e.expanded},on:{navigationLinkClicked:e.onNavigationLinkClicked}}
1):e._e(),e.$store.state.auth.user.superAdmin?t("NavbarItem",{attrs:{icon:"fire",expanded:e.expanded,label:e.$t("Superuser"),submenu:[{headline:e.$t("Users and Companies"),links:[{to:{name:"admin/users"}},{to:{name:"admin/app-instances"}},{to:{name:"admin/partners"}},{to:{name:"admin/companies"}},{to:{name:"admin/switch-company"}},{to:{name:"admin/multi-companies"}}]},{headline:e.$t("Sales"),links:[{to:{name:"partner/voucher-bundles"}},{to:{name:"admin/used-vouchers"}},{to:{name:"admin/agb"}},{to:{name:"admin/orders"}},{to:{name:"admin/licenses"}},{to:{name:"admin/invoices"}}]},{headline:e.$t("Reports"),links:[{to:{name:"admin/reports"}}]},{headline:e.$t("Permissions"),links:[{to:{name:"admin/permission-groups"}},{to:{name:"admin/user-roles"}},{to:{name:"admin/license-modules"}},{to:{name:"admin/license-packages"}}]},{headline:e.$t("Other"),links:[{to:{name:"admin/languages"}},{to:{name:"admin/material-import"}},{to:{name:"admin/field-import-mappings"}}]}]},on:{navigationLinkClicked:e.onNavigationLinkClicked}}):e._e()],1),t("button",{staticClass:"navbar__toggle",on:{click:e.toggleNavbarVisibility}},[e.expanded?e._e():t("FontAwesomeIcon",{attrs:{icon:"arrow-circle-right"}}),t("span",{staticClass:"navbar__toggle-text",class:{"navbar__toggle-text--expanded":e.expanded}},[e._v(e._s(e.$t("Menü einklappen")))]),t("span",{staticClass:"flex-grow-1"}),e.expanded?t("FontAwesomeIcon",{attrs:{icon:"arrow-circle-left"}}):e._e()],1)],1)])]):e._e()},tC=[],iC=i(87072);const aC="FARMDOK_SHOW_DEBUG_COMPONENTS";document.addEventListener("keydown",(e=>{if("KeyB"!==e.code||!e.ctrlKey||!e.altKey)return;let t;try{t=JSON.parse(localStorage.getItem(aC))}catch(i){t=!1}localStorage.setItem(aC,JSON.stringify(!t))}));var nC,rC,sC={name:"DebugComponentWrapper",data(){return{show:!1,instance:window.location.hostname.split(".")[0]}},created(){this.updateShow(),document.addEventListener("keydown",this.updateShow)},beforeDestroy(){document.removeEventListener("keydown",this.updateShow)},methods:{updateShow(){if("app"!==this.instance)try{this.show=JSON.parse(localStorage.getItem(aC))}catch(e){this.show=!1}else this.show=!1}},render(){return this.show&&Array.isArray(this.$slots.default)?(this.$slots.default.length>1&&console.error("DebugComponentWrapper: multiple root nodes in default template. This component supports only a single root node."),this.$slots.default[0]):null}},oC=sC,lC=(0,ew.Z)(oC,nC,rC,!1,null,null,null),dC=lC.exports,cC=function(){var e=this,t=e._self._c;return t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:e.width,height:e.height,viewBox:"0 0 18 18","aria-labelledby":e.iconName,role:"presentation",fill:e.iconColor}},[t("title",{attrs:{id:e.iconName,lang:"en"}},[e._v(e._s(e.iconName)+" icon")]),t("g",[e._t("default")],2)])},uC=[],pC={props:{iconName:{type:String,default:"box"},width:{type:[Number,String],default:18},height:{type:[Number,String],default:18},iconColor:{type:String,default:"currentColor"}}},hC=pC,mC=(0,ew.Z)(hC,cC,uC,!1,null,"0bdb5268",null),fC=mC.exports,gC=function(){var e=this,t=e._self._c;return t("g",{attrs:{fill:e.fill,"fill-rule":"evenodd"}},[t("path",{attrs:{d:"M52.314 31.64h3.627v-8.4h10.41v-3.302H55.94v-5.63h11.736v-3.3H52.314zM66.036 31.64h3.715l2.123-4.982h9.761l2.094 4.981h3.833L78.48 10.86h-3.362l-9.082 20.78zm7.165-8.195l3.54-8.252 3.567 8.252h-7.107zM89.687 31.64h3.627v-7.192h4.541l5.072 7.191h4.276l-5.573-7.81c2.89-.826 4.925-2.86 4.925-6.249v-.059c0-1.798-.62-3.33-1.711-4.45-1.327-1.297-3.362-2.064-5.957-2.064h-9.2V31.64zm3.627-10.405v-6.927h5.279c2.683 0 4.275 1.209 4.275 3.42v.058c0 2.093-1.651 3.449-4.246 3.449h-5.308zM109.806 31.64h3.568V16.901l6.458 9.668h.117l6.518-9.727V31.64h3.627V11.007h-3.864l-6.28 9.756-6.281-9.756h-3.863zM133.68 31.64h7.697c6.487 0 10.97-4.51 10.97-10.317v-.059c0-5.806-4.483-10.257-10.97-10.257h-7.697V31.64zm3.627-3.302v-14.03h4.07c4.335 0 7.166 2.977 7.166 7.015v.06c0 4.037-2.83 6.955-7.166 6.955h-4.07zM165.333 31.92c6.34 0 10.822-4.864 10.822-10.67v-.06c0-5.806-4.423-10.61-10.763-10.61s-10.822 4.863-10.822 10.67v.059c0 5.806 4.423 10.61 10.763 10.61zm.059-3.331c-4.099 0-7.019-3.33-7.019-7.34v-.058c0-4.009 2.861-7.28 6.96-7.28 4.098 0 7.018 3.33 7.018 7.339v.059c0 4.008-2.86 7.28-6.96 7.28zM178.35 31.64h3.626v-5.984l3.214-3.301 7.048 9.284h4.393l-8.964-11.76 8.582-8.872h-4.454l-9.819 10.375V11.007h-3.627zM2.355 35.725c-1.18-.974-2.046-2.137-2.29-3.781-.178-1.203.021-2.384.431-3.505.731-1.998 1.538-3.967 2.333-6 .08.624.143 1.192.23 1.755.197 1.268.714 2.421 1.45 3.448 1.258 1.754 1.448 3.615.79 5.586v1.357h-.506 2.36c.421-.565.883-1.098 1.413-1.583 1.048-.96 2.326-1.248 3.685-1.282 1.887-.047 3.626-.544 5.194-1.608.02-.014.172-.16.264-.175-1.243 1.88-2.537 3.883-3.794 5.676-.798 1.138-1.836 2.047-3.187 2.512-1.662.572-3.266.241-4.846-.352-.18-.068-.353-.153-.564-.245H2.355v-1.803zM25.166 5.15h9.566v32.377H17.808v-2.943h13.98V8.095h-6.622V5.15zm-3.253 16.043c-1.244 
11.88-2.537 3.883-3.794 5.676-.799 1.138-1.836 2.047-3.187 2.512-1.662.572-3.266.241-4.846-.352-.181-.068-.356-.154-.567-.246.937-1.652 1.861-3.252 3.25-4.525 1.048-.96 2.326-1.248 3.685-1.282 1.887-.047 3.627-.545 5.195-1.609.019-.013.172-.16.264-.174zM8.11 28.08c-1.937-1.215-3.5-2.576-3.84-4.88-.179-1.202.02-2.383.43-3.504.73-1.998 1.537-3.967 2.332-6 .081.624.143 1.192.23 1.755.198 1.268.715 2.42 1.452 3.448 1.294 1.804 1.457 3.723.728 5.758-.403 1.125-.866 2.231-1.332 3.423zm18.202-15.51c-1.208 1.826-2.387 3.673-3.64 5.468-.421.605-.987 1.133-1.56 1.606-1.561 1.286-3.358 1.458-5.252.951-.596-.159-1.175-.387-1.81-.6 1.027-1.794 1.999-3.533 3.595-4.813.88-.705 1.915-.973 3.007-1.002 2.023-.053 3.924-.48 5.66-1.61zm-13.645 6.676c-1.077-.643-1.958-1.321-2.671-2.203-1.458-1.803-1.504-3.836-.815-5.906.584-1.753 1.329-3.453 2-5.177.127-.327.241-.66.43-.995.028.32.054.64.085.96.158 1.652.842 3.097 1.75 4.456.783 1.172 1.174 2.445.924 3.86-.098.556-.209 1.118-.398 1.646-.398 1.113-.852 2.204-1.305 3.36zM8.242 8.094H5.298v5.887H2.355v-8.83h5.887v2.943zM23.085 0c-.091 2.63.074 5.17-.53 7.661-.517 2.127-1.826 3.569-3.83 4.388-.714.293-1.46.507-2.186.755-1.468-3.284-1.333-5.95.97-8.193 1.334-1.298 2.85-2.409 4.288-3.598.39-.324.798-.63 1.288-1.013z"}})])},yC=[],vC={name:"IconLogo",props:{fill:{type:String,default:"#FFF"}}},bC=vC,wC=(0,ew.Z)(bC,gC,yC,!1,null,null,null),CC=wC.exports,FC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"meta-nav",class:{"meta-nav--slim":e.slim}},[e.canPurchaseLicenses?t("Button",{class:e.btnClass,attrs:{"leading-icon":"",size:e.btnSize,variant:e.shopButtonVariant,icon:e.slim?["fas","shopping-cart"]:["far","shopping-cart"],"icon-only":e.slim},on:{click:()=>e.$router.push({name:"shop"})}},[e._v(" "+e._s(e.companiesHaveOnlyFreeLicenses||e.companiesHaveNoLicense?e.$t("Jetzt kaufen"):e.$t("Shop"))+" ")]):e._e(),t("Button",{class:e.btnClass,attrs:{icon:"bell",size:e.btnSize,variant:e.btnVariant,"icon-only":e.slim},on:{click:e.toggleNotificationsOverlay}},[e._v(" "+e._s(e.$t("Benachrichtigungen"))+" "),e.unreadNotifications>0&&!e.slim?t("span",{staticClass:"meta-nav__btn-pill bg-danger text-white"},[e._v(e._s(e.unreadNotifications))]):e._e()]),t("Button",{class:e.btnClass,attrs:{icon:"question-circle",size:e.btnSize,variant:e.btnVariant,"icon-only":e.slim},on:{click:e.showHelp}},[e._v(" "+e._s(e.$t("Hilfe"))+" ")]),t("BDropdown",{attrs:{"menu-class":"shadow mt-1 p-2","no-caret":"",right:"",size:e.btnSize,"toggle-class":e.btnClass,variant:e.btnVariant}},[t("template",{slot:"button-content"},[e.slim?e._e():t("span",[e._v(e._s(e.$t("Mein Profil")))]),t("FontAwesomeIcon",{attrs:{icon:"user-circle"}})],1),t("BDropdownHeader",[e._v(" "+e._s(e.$store.state.auth.user.firstname)+" "+e._s(e.$store.state.auth.user.lastname)+" ")]),t("BDropdownDivider"),t("BDropdownItem",{staticClass:"text-black font-weight-bold",attrs:{to:{name:"profile"}}},[t("FontAwesomeIcon",{staticClass:"mr-1",attrs:{icon:"user"}}),e._v(" "+e._s(e.$t("Persönliche Einstellungen"))+" ")],1),t("BDropdownItem",{staticClass:"text-black font-weight-bold",attrs:{to:{name:"my-invoices"}}},[t("FontAwesomeIcon",{staticClass:"mr-1",attrs:{icon:"envelope"}}),e._v(" "+e._s(e.$t("Meine Rechnungen"))+" ")],1),t("BDropdownItem",{staticClass:"text-black font-weight-bold",attrs:{to:{name:"about-us"}}},[t("FontAwesomeIcon",{staticClass:"mr-1",attrs:{icon:"info-circle"}}),e._v(" "+e._s(e.$t("Impressum"))+" ")],1),t("BDropdownDivider"),t("BDropdownItem",{staticClass:"text-black font-weight-bold",attrs:{to:{name:"logout"}}},[t("FontAwesomeIcon",{staticClass:"text-danger mr-1",attrs:{icon:"sign-out-alt"}}),e._v(" "+e._s(e.$t("Abmelden"))+" ")],1)],2),t("NotificationsOverlay")],1)},AC=[],kC=function(){var e=this,t=e._self._c;return t("div",[t("div",{directives:[{name:"show",rawName:"v-show",value:e.$store.state.notifications.visible,expression:"$store.state.notifications.visible"},{name:"click-outside",rawName:"v-click-outside",value:()=>e.$store.commit("notifications/hide"),expression:"() => $store.commit('notifications/hide')"}],staticClass:"notifications-overlay bg-lightest"},[t("div",{staticClass:"notifications-overlay__list"},[e.$store.state.notifications.fetching?t("div",{staticClass:"notifications-overlay__fetching text-primary"},[t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}
1)],1):e._e(),e._l(e.latestNotifications,(function(i){return t("Notification",{key:i.id,attrs:{priority:i.priority,read:!!i.read,title:i.subject,content:i.messageText},on:{click:()=>e.handleClick(i)}})}))],2),t("RouterLink",{staticClass:"all-notifications text-dark",attrs:{to:{name:"notifications"}}},[e._v(e._s(e.$t("Alle anzeigen"))+" ")])],1),t("ModalWrapper",{ref:"modal",attrs:{size:"lg",noCancelButton:"",static:"",title:e.notificationTitle,okTitle:e.$t("Schließen")}},[t("div",{domProps:{innerHTML:e._s(e.notificationMessage)}})])],1)},SC=[],EC=i(65284),IC=i.n(EC);const _C={...IC().defaults,allowedTags:[...IC().defaults.allowedTags,"img"],transformTags:{a:(e,t)=>({tagName:e,attribs:{...t,target:"_blank"}})}};var DC=_C;b["default"].use(IC(),_C);var MC=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BModal",{ref:"modal",attrs:{"hide-header":"","hide-footer":"","no-close-on-backdrop":"",centered:"","body-class":e.bodyClassComputed,visible:e.visible,size:e.size,static:e.staticComputed},on:{change:e.change,hide:e.onHide}},[t("div",{staticClass:"modal-wrapper__content-wrapper",class:{"modal-wrapper__content-wrapper--max":"max"===e.size}},[e.$slots["side-column"]?t("div",{staticClass:"modal-wrapper__side-column w-25"},[e._t("side-column")],2):e._e(),t("div",{staticClass:"modal-wrapper__content",class:{"modal-wrapper__content--max":"max"===e.size,"modal-wrapper__content--with-map":e.$slots["map-container"]&&!e.$slots["side-column"]}},[e.hideCustomHeader?e._e():t("header",{staticClass:"modal-wrapper__header p-3"},[t("h1",{staticClass:"modal-wrapper__title m-0"},[e._v(" "+e._s(e.title)+" ")])]),t("div",{staticClass:"modal-wrapper__content-inner",class:{"modal-wrapper__content-inner--max":"max"===e.size}},[e.$slots["top-content"]?t("div",{staticClass:"modal-wrapper__top-content p-3"},[e._t("top-content")],2):e._e(),t("div",{staticClass:"modal-wrapper__body p-3",class:[`modal-wrapper__body--${e.size}`,{"modal-wrapper__body--fixed-height":null!=e.innerContentHeight}],style:{height:null!=e.innerContentHeight?`${e.innerContentHeight}px`:"auto"}},[e._t("default")],2),e.$slots["bottom-content"]?t("div",{staticClass:"modal-wrapper__bottom-content p-3",class:{"bg-lightest":e.bottomBgGray}},[e._t("bottom-content")],2):e._e()]),"content"===e.footerVariant?t("footer",{staticClass:"modal-wrapper__content-footer p-3",class:{"bg-lightest":e.bottomBgGray}},[e.$slots["buttons"]?e._e():t("Button",{staticClass:"mr-3",attrs:{"component-namespace-name":"ButtonOK",variant:e.okVariant},on:{click:e.ok}},[e._v(" "+e._s(e.okTitle)+" ")]),e.$slots["buttons"]||e.noCancelButton?e._e():t("Button",{attrs:{variant:"white","component-namespace-name":"ButtonCancel"},on:{click:e.cancel}},[e._v(" "+e._s(e.cancelTitle)+" ")]),e._t("buttons")],2):e._e()]),e.$slots["map-container"]&&!e.$slots["side-column"]?t("div",{staticClass:"modal-wrapper__map-container",class:{"modal-wrapper__map-container--max":"max"===e.size,"modal-wrapper__map-container--with-content":!e.mapFull}},[e._t("map-container")],2):e._e()]),"full"===e.footerVariant?t("footer",{staticClass:"modal-wrapper__full-footer p-3",class:{"bg-lightest":e.bottomBgGray}},[e.$slots["buttons"]||e.noOkButton?e._e():t("Button",{staticClass:"mr-3",attrs:{"component-namespace-name":"ButtonOK",variant:e.okVariant},on:{click:e.ok}},[e._v(" "+e._s(e.okTitle)+" ")]),e.$slots["buttons"]||e.noCancelButton?e._e():t("Button",{attrs:{variant:"white","component-namespace-name":"ButtonCancel"},on:{click:e.cancel}},[e._v(" "+e._s(e.cancelTitle)+" ")]),e._t("buttons"),null!=e.$slots["footer-content-right"]?t("div",{staticClass:"modal-wrapper__footer-content-right ml-auto"},[e._t("footer-content-right")],2):e._e()],2):e._e(),t("Button",{staticClass:"modal-wrapper__close m-0 border-white bg-black text-white",attrs:{"component-namespace-name":"ButtonX"},on:{click:e.cancel}},[t("FontAwesomeIcon",{attrs:{icon:["far","times"]}})],1)],1)},PC=[];ow.vI.add(lw.NBC);var TC=(0,b.defineComponent)({name:"ModalWrapper",mixins:[pw],components:{Button:gw},model:{prop:"visible",event:"change"},emits:["change","hide","cancel","ok"],props:{bodyClass:{type:[Array,Object,String],default:null},visible:{type:Boolean,default:!1},size:{type:String,default:"md",validator:e=>-1!==["md","lg","xl","max"].indexOf(e)},mapFull:{type:Boolean,default:!1},title:{type:String,default:""},okTitle:{type:String,default(){return this.$t("OK")??"OK"}},okVariant:{type:String,default:"primary"},cancelTitle:{type:String,default(){return this.$t("Abbrechen")??"Abbrechen"}},bottomBgGray:{type:Boolean,default:!1},noCancelButton:{type:Boolean,default:!1},noOkButton:{type:Boolean,default:!1},innerContentHeight:{type:Number,default:null},footerVariant:{type:String,default:"full",validator:e=>["full","content","none"].includes(e)},static:{type:Boolean,default:!1},hideCustomHeader:{type:Boolean,default:!1}},data(){return{resolves:[],hiddenEventTriggered:!1}},computed:{bodyClassComputed(){return null==this.bodyClass?"modal-wrapper":"string"===typeof this.bodyClass?["modal-wrapper",this.bodyClass]:Array.isArray(this.bodyClass)?["modal-wrapper",...this.bodyClass]:{...this.bodyClass,"modal-wrapper":!0}},staticComputed(){return this.static}},mounted(){this.visible&&this.onShown(),this.preventModalsFromStealingFocus()},beforeDestroy(){this.visible&&this.onHidden()},watch:{visible(e,t){e&&!t&&this.onShown(),!e&&t&&this.onHidden()}},methods:{async show(){return new Promise((e=>{this.resolves=[...this.resolves,e],this.$refs.modal.show(),this.onShown()}))},hide(){this.cancel()},change(e){this.$emit("change",e)},ok(){this.$emit("ok"),this.$refs.modal.hide(),this.resolves.forEac
1h((e=>e(!0))),this.resolves=[],this.onHidden()},cancel(){this.$emit("cancel"),this.$refs.modal.hide(),this.resolves.forEach((e=>e(!1))),this.resolves=[],this.onHidden()},onHide(e){"backdrop"===e.trigger&&this.$nextTick((()=>{this.resolves.forEach((e=>e(!1))),this.resolves=[]}))},onShown(){this.$root.$emit("modal-wrapper--shown",this.componentNamespace),this.hiddenEventTriggered=!1},onHidden(){this.hiddenEventTriggered||(this.$root.$emit("modal-wrapper--hidden",this.componentNamespace),this.hiddenEventTriggered=!0)},preventModalsFromStealingFocus(){const e=document.querySelectorAll(".modal-content");e.forEach((e=>e.removeAttribute("tabindex")))}}}),xC=TC,BC=(0,ew.Z)(xC,MC,PC,!1,null,"d196f46a",null),OC=BC.exports,$C=function(){var e=this,t=e._self._c;return t("div",{staticClass:"notification bg-white border-medium",on:{click:function(t){return e.$emit("click")}}},[t("span",{staticClass:"notification__icon text-white",class:e.iconColor},[t("FontAwesomeIcon",{attrs:{icon:e.icon}})],1),t("div",{staticClass:"notification__text"},[t("h4",{class:e.titleColor},[e._v(e._s(e.title))]),t("p",[e._v(e._s(e.content))])]),t("FontAwesomeIcon",{staticClass:"notification__chevron text-dark",attrs:{icon:["fas","chevron-right"]}})],1)},RC=[];ow.vI.add(uw._tD,uw.eHv,uw.sqG);const NC="WW",zC="W";var LC={name:"Notification",props:{priority:{type:String,default:""},read:{type:Boolean,required:!0},title:{type:String,required:!0},content:{type:String,required:!0}},computed:{iconColor(){return this.read?"bg-medium":this.priority===NC?"bg-danger":this.priority===zC?"bg-warning":"bg-secondary"},icon(){return this.priority===NC||this.priority===zC?"exclamation-triangle":"info-circle"},titleColor(){return this.read?"":this.priority===NC?"text-danger":this.priority===zC?"text-warning":"text-secondary"}}},VC=LC,UC=(0,ew.Z)(VC,$C,RC,!1,null,"ef77b7c0",null),jC=UC.exports;ow.vI.add(uw.IJ7);var HC={name:"NotificationsOverlay",components:{ModalWrapper:OC,Notification:jC},data(){return{baseUrl:M,notificationTitle:null,notificationMessage:null}},computed:{...(0,C.Se)({notifications:"notifications/data"}),latestNotifications(){return Object.values(this.notifications).sort(((e,t)=>t.sendTime-e.sendTime)).slice(0,5).map((e=>{if(null==e.template)return e;const t={...e};return null==t.subject&&(t.subject=e.template.subject),null==t.messageText&&(t.messageText=e.template.messageText,t.message=e.template.message),t}))}},methods:{handleClick(e){this.$store.dispatch("notifications/markRead",e),this.$store.commit("notifications/toggleVisibility"),this.notificationTitle=e.subject,this.notificationMessage=this.$sanitize(e.message,{...DC,allowedAttributes:{...DC.allowedAttributes,p:["style"],span:["style"]}}),this.$refs.modal.show()}}},GC=HC,WC=(0,ew.Z)(GC,kC,SC,!1,null,"6b1210bb",null),ZC=WC.exports;ow.vI.add(uw.sq$,uw.qmU,uw.Fuz,uw.m08,uw.ILF,uw.FU$,uw.sqG,uw.jLD,lw.sq$);var KC={name:"MetaNav",components:{Button:gw,NotificationsOverlay:ZC},props:{slim:{type:Boolean,default:!1}},computed:{unreadNotifications(){return Object.values(this.$store.state.notifications.data).filter((e=>!e.read)).length},shopButtonVariant(){return this.slim?"primary":this.companiesHaveOnlyFreeLicenses||this.companiesHaveNoLicense?"danger":"outline-primary"},btnSize(){return this.slim?"lg":"sm"},btnVariant(){return this.slim?"primary":"white-black"},btnClass(){return this.slim?["text-white","m-0","p-2"]:null},canPurchaseLicenses(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.CAN_PURCHASE_LICENSE)},companiesHaveOnlyFreeLicenses(){return this.$store.state.auth.currentCompanies.every((e=>e.licensePackageId===ae.FARMDOK_FREE))},companiesHaveNoLicense(){return this.$store.state.auth.currentCompanies.every((e=>e.licensePackageId===ae.NO_LICENSE))}},async created(){await this.$store.dispatch("auth/subscribe"),this.$store.dispatch("notifications/subscribe")},methods:{toggleNotificationsOverlay(e){e.stopPropagation(),this.$store.commit("notifications/toggleVisibility")},showHelp(){window.open("https://www.farmdok.com/support/")}}},qC=KC,YC=(0,ew.Z)(qC,FC,AC,!1,null,"49dbb8a2",null),JC=YC.exports,XC=function(){var e=this,t=e._self._c;return t("div",{staticClass:"navbar-item",class:[{"navbar-item--has-submenu":e.hasSubmenu},{"navbar-item--submenu-open":e.submenuOpen}],on:{mouseenter:e.onMouseEnter,mouseleave:e.onMouseLeave}},[null!=e.to?t("RouterLink",{staticClass:"navbar-link",class:{"navbar-link--expanded":e.expanded},attrs:{disabled:e.disabled,event:e.disabled?"":"click",to:e.to,"data-to":"string"===typeof e.to?e.to:e.to.name},nativeOn:{click:function(t){return(t=>
1e.linkClick(t,e.hasSubmenu)).apply(null,arguments)},focus:function(t){return e.onFocus.apply(null,arguments)},blur:function(t){return e.onBlur.apply(null,arguments)}}},[t("FontAwesomeIcon",{attrs:{icon:e.icon}}),t("span",{staticClass:"navbar-link__text",class:{"navbar-link__text--expanded":e.expanded}},[e._v(e._s(e.labelComputed))]),e.hasSubmenu?t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}}):e._e()],1):t("a",{staticClass:"navbar-link navbar-link--no-link",class:{"navbar-link--expanded":e.expanded},attrs:{tabindex:"0"},on:{click:t=>e.linkClick(t,e.hasSubmenu),focus:e.onFocus,blur:e.onBlur}},[t("FontAwesomeIcon",{attrs:{icon:e.icon}}),t("span",{staticClass:"navbar-link__text",class:{"navbar-link__text--expanded":e.expanded}},[e._v(e._s(e.labelComputed))]),e.hasSubmenu?t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}}):e._e()],1),e.hasSubmenu?t("div",{staticClass:"sub-menu"},e._l(e.submenuComputed,(function(i,a){return t("div",{key:a,staticClass:"sub-menu__inner bg-black"},[t("h4",{staticClass:"sub-menu__headline"},[e._v(e._s(i.headline))]),e._l(i.links,(function(i,a){return t("RouterLink",{key:a,staticClass:"sub-menu__link text-white",attrs:{to:i.to,"data-to":"string"===typeof i.to?i.to:i.to.name},nativeOn:{click:function(t){return e.linkClick.apply(null,arguments)},focus:function(t){return e.onFocus.apply(null,arguments)},blur:function(t){return e.onBlur.apply(null,arguments)}}},[e._v(" "+e._s(i.label)+" ")])}))],2)})),0):e._e()],1)},QC=[],eF=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-login",attrs:{"scroll-y":"","content-flex":""}},[t("div")])},tF=[],iF={name:"PageHome",components:{ThePageSkeleton:$w},async mounted(){if("fields".length>0)return void this.$router.push({name:"fields"});await this.$store.dispatch("auth/subscribe");const e=this.$store.getters.auth?.currentProcessOrderIds;if(e&&0!==e.length)try{const{data:t}=await Vo(e,void 0,void 0,void 0,{itemsPerPage:1});0===t.data.length?await this.$router.replace({name:"fields"}):window.location.replace(`${P}`)}catch(t){window.location.replace(`${P}`)}else await this.$router.replace({name:"fields"})}},aF=iF,nF=(0,ew.Z)(aF,eF,tF,!1,null,"45ed3af5",null),rF=nF.exports,sF=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbarContainer",{attrs:{filterString:e.filterString,leftSectionVisible:e.featureEnabled&&e.featureVisible&&!e.featureReadonly},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},onCreateButtonClick:e.onCreateButtonClick,onDuplicateButtonClick:e.onDuplicateButtonClick,onShowSettings:e.onShowSettings,onExportSelected:e.onExportSelected,onExportData:e.onExportData,onEditButtonClick:e.onEditButtonClick,onMoveButtonClick:e.onMoveButtonClick,onSelectAll:e.onSelectAll,onDeselectAll:e.onDeselectAll,onInvertSelection:e.onInvertSelection}})]},proxy:!0},{key:"content",fn:function(){return[t("TableActivitiesContainer",{directives:[{name:"show",rawName:"v-show",value:e.featureEnabled&&e.featureVisible,expression:"featureEnabled && featureVisible"}],ref:"table",attrs:{filterString:e.filterString,columns:e.activitiesColumns},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},createActivity:e.onCreateButtonClick,"update:hot":e.updateHot}}),t("ModalPageSettingsContainer",{ref:"modalPageSettings"}),t("ModalCreateActivity",{ref:"modalCreateActivity"}),t("ModalEditActivity",{ref:"modalEditActivity"}),t("ModalTableExport",{ref:"modalTableExport",attrs:{availableTypes:[{value:"xls",label:e.$t("XLS"),text:e.$t("Als Excel-Datei exportieren")}],filtered:!e.allRowsVisible,hot:e.hot,tableData:e.tableData,columns:e.columns,dropdownItemsWithSubtableColumnData:e.dropdownItemsWithSubtableColumnData}}),t("ModalDuplicateActivity",{ref:"modalDuplicateActivity"}),t("ModalMoveActivity",{ref:"modalMoveActivity",attrs:{selectedActivityIds:e.selectedActivityIds}}),t("ModalRuleCheckViolations"),e.featureEnabled?e._e():t("div",{staticClass:"feature-not-enabled"},[t("FeatureNotAvailable",{attrs:{featureName:e.$t("Aktivitäten"),addLinkToShop:!0,featureVisible:e.featureVisible}})],1)]},proxy:!0}])})},oF=[],lF=i(59417),dF=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max",title:e.title},on:{cancel:e.cancel},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:4,current:e.currentStep}}),0===e.currentStep?t("FirstStepContainer"):e._e(),1===e.currentStep?t("SecondStepContainer",{attrs:{customColumnDefinition:e.customColumnDefinition}}
1):e._e(),2===e.currentStep?t("ThirdStepContainer"):e._e(),3===e.currentStep?t("FourthStepContainer"):e._e()]},proxy:!0},1===e.currentStep?{key:"map-container",fn:function(){return[t("MapContainer")]},proxy:!0}:null,{key:"buttons",fn:function(){return[2===e.currentStep||3===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary"},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" ")])]):e._e(),0===e.currentStep||1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:!e.paginationNextEnabled},on:{click:e.next}},[t("span",[e._v(e._s(e.$t("Weiter")))])]):e._e(),0===e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:e.reset}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])]):e._e(),2===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"white"},on:{click:e.next}},[t("span",[e._v(e._s(e.$t("Mehr Details")))])]):e._e(),1===e.currentStep||2===e.currentStep||3===e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:e.back}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"white",disabled:!e.paginationNextEnabled},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" ")])]):e._e()]},proxy:!0}],null,!0)})},cF=[];const uF={key:"processOrder.companyId",header:{title:()=>b["default"].i18n.translate("Betrieb")},type:"dropdown",width:130,required:!0,readOnly:!0},pF={key:"deleted",header:{title:()=>b["default"].i18n.translate("gelöscht am")},type:"date",width:130},hF=e=>{if("string"!==typeof e)return e;const t=e.split(/[-/]/g).map((e=>e.trim()));return t.length<1||Number.isNaN(Number(t[0]))?e:Number(t[0])},mF=e=>null==e||"string"===typeof e&&0===e.length,fF=(e,t,i=1,a=!1)=>mF(e)&&mF(t)?0:mF(e)&&a?1:mF(t)&&a?-1:"string"===typeof e&&"string"===typeof t?i*e.localeCompare(t,void 0,{numeric:!0}):"number"===typeof hF(e)&&"number"===typeof hF(t)?i*(hF(e)-hF(t)):0,gF=(e,t,i=1)=>fF(e,t,i,!0);var yF=i(21702);function vF(e,t,i,a,n){if(t.classList.add("read-only"),"function"===typeof n){const[e]=(0,ow.qv)({prefix:"fas",iconName:"lock-alt"}).node;e.classList.add("lock-icon"),t.append(e)}}function bF(e,t,i,a,n,r,s,...o){Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,"Pflichtfeld",s,...o]),t.classList.add("text-italic");const[l]=(0,ow.qv)({prefix:"fas",iconName:"exclamation-square"}).node;l.style.float="right",l.style.marginTop="3px",l.classList.add("text-secondary"),t.append(l)}function wF(e,t){"string"===typeof t&&t.length>0?new ResizeObserver((()=>{e.scrollWidth>e.clientWidth?e.setAttribute("title",t):e.removeAttribute("title")})).observe(e):e.removeAttribute("title")}function CF(e,t,i,a,n,r,s,...o){if(Bu.Z.dom.empty(t),s.required&&("string"!==typeof r||0===r.length))return void bF.apply(this,[e,t,i,a,n,r,s,...o]);const l="function"===typeof s.getRendererValue?s.getRendererValue({value:r,row:i}):r;wF(t,l);let d=t.querySelector("span.hot-floating-cell-icon");null==d&&(d=document.createElement("span"),d.className="hot-floating-cell-icon"),Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,r,s,...o]),t.classList.add("hot-cell-with-floating-cell-icon");const c=s.getStatusReadOnly(i);d.onmousedown=e=>{e.stopPropagation()},d.onclick=()=>{c||"function"===typeof s.onClick&&s.onClick({target:d,visualRow:i})};let u=null;"function"===typeof s.getStatus&&(u=s.getStatus(i));const p={completed:{icon:{prefix:"fas",iconName:"check-circle"},className:"hot-floating-cell-icon__status--completed"},active:{icon:{prefix:"fas",iconName:"dot-circle"},className:"hot-floating-cell-icon__status--active"},planned:{icon:{prefix:"fas",iconName:"clock"},className:"hot-floating-cell-icon__status--planned"},calculating:{icon:{prefix:"fad",iconName:"spinner-third"},className:"hot-floating-cell-icon__status--calculating"}};if(null!=p[u]&&!d.classList.contains(p[u].className)){d.className="hot-floating-cell-icon",d.innerHTML="";const[e]=(0,ow.qv)(p[u].icon).node;d.append(e),d.classList.add(p[u].className)}"calculating"===u&&(d.onclick=null),t.append(d),"active"===u&&"function"===typeof s.hasHarvestingMeasures&&s.hasHarvestingMeasures(i)&&d.classList.add("hot-floating-cell-icon--with-notification"),c&&d.classList.add("hot-floating-cell-icon--read-only"),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o])}function FF(e){null!=e.currentTarget&&e.currentTarget instanceof HTMLElement&&null!=e.currentTarget.querySelector("button")&&e.currentTarget.querySelector("button").click()}
1function AF(e,t,i,a,n,r,s,...o){[...t.childNodes].forEach((e=>{e instanceof HTMLElement&&e.matches("button.hot-btn-field-status")||t.removeChild(e)}));const l=s.getStatusReadOnly(i);let d=t.querySelector(".hot-btn-field-status");null==d&&(d=document.createElement("button")),d.innerHTML="",d.className="",d.classList.add("hot-btn-field-status");let c=null;"function"===typeof s.getStatus&&(c=s.getStatus(i),d.innerText=s.getDisplayValue(r),d.classList.add(`hot-btn-field-status--${c}`)),d.disabled=!0,t.removeEventListener("dblclick",FF),"calculating"!==c&&(d.disabled=!1,t.addEventListener("dblclick",FF),d.onclick=()=>{l||"function"===typeof s.onClick&&s.onClick({target:d,visualRow:i})},d.onmousedown=e=>{e.stopPropagation()}),t.append(d),"active"===c&&"function"===typeof s.hasHarvestingMeasures&&s.hasHarvestingMeasures(i)&&d.classList.add("hot-btn-field-status__with-notification"),l&&(d.disabled=!0,d.classList.add("hot-btn-field-status--read-only")),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o])}ow.vI.add(uw.bkV),ow.vI.add(uw.lpZ),ow.vI.add(uw.f8k,uw.SZw,uw._1v,yF.AX7),Bu.Z.cellTypes.registerCellType("fieldName",{editor:Bu.Z.editors.TextEditor,renderer:CF}),Bu.Z.cellTypes.registerCellType("fieldStatus",{renderer:AF});const kF="";function SF(e,t,i,a,n,r,s,...o){Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,r,s,...o]),Array.isArray(r)&&(t.innerHTML="",t.style.textOverflow="clip",t.style.position="relative",t.classList.add("py-2","px-3"),r.forEach((e=>
1{const{name:n,sharingLogoUrl:r,sharingBackground:o,shareId:l}=e,d=!r&&o?o:"white ",c=document.createElement("div"),u=document.createElement("span"),p=`cell-${i}-${a}`;if(r){const e=document.createElement("img");e.src=kF+r,e.style.maxHeight="100%",e.style.height="auto",e.style.maxWidth="100%",e.style.width="auto",e.style.paddingTop="2px",e.style.paddingBottom="2px",e.style.objectFit="contain",c.prepend(e)}else{u.innerText=n,u.style.overflow="hidden",u.style.whiteSpace="nowrap",u.style.textOverflow="ellipsis",u.style.fontSize="12px",u.style.fontWeight="600",u.style.color=Vm(d);const[e]=(0,ow.qv)({prefix:"far",iconName:"share-alt"}).node;e.classList.add("mr-2"),u.prepend(e),c.appendChild(u)}c.title=n,c.classList.add("badge","badge-pill","badge-white","border","mr-3"),c.style.minWidth="130px",c.style.maxWidth="130px",c.style.height="25px",c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.background=d,c.addEventListener("click",(()=>s.onClick({shareId:l}))),c.style.cursor="pointer";let h=document.getElementById(p);null===h&&(h=document.createElement("div")),h.style.width="100%",h.style.height="25px",h.style.display="flex",h.style.flexDirection="row",h.style.alignItems="center",h.id=`cell-${i}-${a}`,h.appendChild(c),t.appendChild(h)})))}ow.vI.add(lw.EfQ),Bu.Z.cellTypes.registerCellType("sharedFieldInfo",{renderer:SF});const EF={key:"name",header:{title:()=>b["default"].i18n.translate("Bezeichnung"),description:()=>b["default"].i18n.translate("Feld")},type:"text",placeholder:b["default"].i18n.translate("<Bezeichnung>"),required:!0,className:"border-right text-bold",width:270},IF={key:"fieldNumber",header:{title:()=>b["default"].i18n.translate("Nr"),description:()=>b["default"].i18n.translate("Feld-Nummer")},type:"text",width:70},_F={key:"fieldSize",header:{title:()=>b["default"].i18n.translate("Größe"),description:()=>b["default"].i18n.translate("ha")},type:"numeric",width:100,configurableDecimalPlaces:!0,decimalPlaces:2},DF={key:"cropId",header:{title:()=>b["default"].i18n.translate("Kultur")},type:"dropdown",width:350},MF={key:"varietyId",header:{title:()=>b["default"].i18n.translate("Sorte")},type:"dropdown",width:350},PF={key:"preCropId",header:{title:()=>b["default"].i18n.translate("Vorfrucht")},type:"dropdown",width:350},TF={key:"catchcropVariant",header:{title:()=>b["default"].i18n.translate("Begrünung"),description:()=>b["default"].i18n.translate("Zwischenfrucht")},type:"dropdown",width:220},xF={key:"kindofuse",header:{title:()=>b["default"].i18n.translate("Nutzungsart")},type:"dropdown",width:350},BF={key:"comment",header:{title:()=>b["default"].i18n.translate("Kommentar")},type:"text",width:350},OF={key:"amaCode",header:{title:()=>b["default"].i18n.translate("AMA Code")},type:"dropdown",width:90},$F={key:"additionalData.cadastralCommunity",header:{title:()=>b["default"].i18n.translate("Gemeinde"),description:()=>b["default"].i18n.translate("Katastralgemeinde")},type:"text",width:350},RF={key:"additionalData.plots",header:{title:()=>b["default"].i18n.translate("Parzellen Nr."),description:()=>b["default"].i18n.translate("Beistrich-getrennt")},type:"text",width:350},NF={key:"additionalData.owner",header:{title:()=>b["default"].i18n.translate("Eigentümer")},type:"text",width:350},zF={key:"additionalData.rightOfUse",header:{title:()=>b["default"].i18n.translate("Nutzung durch")},type:"text",width:350},LF={key:"ndvi",header:{title:()=>b["default"].i18n.translate("NDVI"),description:()=>b["default"].i18n.translate("Durchschnittlicher NDVI-Index")},type:"numeric",width:85,readOnly:!0},VF={key:"mbi",header:{title:()=>b["default"].i18n.translate("MBI"),description:()=>b["default"].i18n.translate("Mehrjähriger Biomasseindex auf Basis Blattflächenindex")},type:"numeric",width:85,readOnly:!0},UF={key:"gwArea",header:{title:()=>b["default"].i18n.translate("Aktionsgebiet")},type:"dropdown",width:85,required:!0},jF={key:"inWaterProtectionZone",header:{title:()=>b["default"].i18n.translate("Wasserschutzgebiet"),description:()=>b["default"].i18n.translate("Feld befindet sich im Wasserschutzgebiet")},type:"checkbox",checkedTemplate:1,uncheckedTemplate:0,width:120},HF={key:"sharedFieldInfo",header:{title:()=>b["default"].i18n.translate("Freigegeben"),description:()=>b["default"].i18n.translate("An angegebene Betriebe zum Lesen freigegeben.")},type:"sharedFieldInfo",readOnly:!0,data(e){return null==e?null:null!=e.sharedFieldInfo?e.sharedFieldInfo:null!=this.$parent.sharedFieldsByFieldId&&Array.isArray(this.$parent.sharedFieldsByFieldId[e.id])&&null!=this.$parent.sharedFieldsCompaniesById?this.$parent.sharedFieldsByFieldId[e.id].filter((e=>null!=this.$parent.sharedFieldsByShareId[e])).map((e=>({...this.$parent.sharedFieldsCompaniesById[this.$parent.sharedFieldsByShareId[e].companyId],shareId:e}))).sort(((e,t)=>gF(e,t,1))):null},onClick(e){this.$emit("click:sharedFieldInfo",e)}},GF={key:"fieldShare.senderReference",header:{title:()=>b["default"].i18n.translate("Referenz-Nummer"),description:()=>b["default"].i18n.translate("Partner-Nummer, Kunden-Nummer, CRM Id")},type:"text",width:150},WF={key:"fieldShare.farmNumber",header:{title:()=>b["default"].i18n.translate("Betriebsnummer"),description:()=>b["default"].i18n.translate("Betriebsnummer des Sender-Betriebs")},type:"text",width:120},ZF={key:"fieldShare.farmName",header:{title:()=>b["default"].i18n.translate("Betriebsname"),description:()=>b["default"].i18n.translate("Name des Sender-Betriebs")},type:"text",width:220},KF={key:"fieldShare.message",header:{title:()=>b["default"].i18n.translate("Bemerkung"),description:()=>b["default"].i18n.translate("Referenz oder Freigabegrund")},type:"text",width:170}
1,qF={key:"fieldShare.userEmail",header:{title:()=>b["default"].i18n.translate("Geteilt von"),description:()=>b["default"].i18n.translate("E-mail des Users, der freigegeben hat")},type:"text",width:120},YF={key:"fieldShare.created",header:{title:()=>b["default"].i18n.translate("Freigabedatum"),description:()=>b["default"].i18n.translate("Freigabedatum")},type:"date",width:120},JF={key:"fieldShare.expiryDate",header:{title:()=>b["default"].i18n.translate("Ablaufdatum"),description:()=>b["default"].i18n.translate("Datum an dem die Freigabe verfällt")},type:"date",width:120},XF={...uF,key:"processOrder.companyId"},QF={key:"crop.name",header:{title:()=>b["default"].i18n.translate("Kultur")},type:"text",readOnly:!0,width:170},eA={key:"fieldGroup.mfa",header:{title:()=>b["default"].i18n.translate("FSNr"),description:()=>b["default"].i18n.translate("Feldstück-Nummer")},type:"text",width:70},tA={key:"fieldGroup.customerId",header:{title:()=>b["default"].i18n.translate("Kunde")},type:"dropdown",width:170},iA={key:"processOrder.name",header:{title:()=>b["default"].i18n.translate("Erntejahr")},type:"text",readOnly:!0,width:100},aA={...EF,type:"fieldName",getStatus(e){if("function"!==typeof this.visualRowToGuid||null==this.tableData)return null;const t=this.visualRowToGuid(e),i=this.tableData[t];return null==i?null:i.status},hasHarvestingMeasures(e){if("function"!==typeof this.visualRowToGuid||null==this.tableData)return!1;const t=this.visualRowToGuid(e);return!(null==this.$parent||!Array.isArray(this.$parent.fieldIdsWithHarvestingMeasure))&&this.$parent.fieldIdsWithHarvestingMeasure.includes(t)},onClick(e){this.$emit("click:status",e)},getStatusReadOnly(){return this.$parent.processOrdersReadOnly||this.$parent.fieldsReadOnly}},nA={key:"status",header:{title:()=>b["default"].i18n.translate("Erntejahr-Status")},type:"fieldStatus",getStatus:aA.getStatus,hasHarvestingMeasures:aA.hasHarvestingMeasures,onClick(e){this.$emit("click:status",e)},getStatusReadOnly(){return this.$parent.processOrdersReadOnly},width:140},rA={key:"combinedNameExclCrop",header:{title:()=>b["default"].i18n.translate("Bezeichnung"),description:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld")},type:"text",placeholder:b["default"].i18n.translate("<Bezeichnung>"),required:!0,readOnly:!0,className:"border-right text-bold",width:270,data(e){if(null==e)return"";const t=e[R];let i,a,n="";null!=this.tableDataComputed&&null!=t&&null!=this.tableDataComputed[t]?(i=Ru(this.tableDataComputed[t],tA.key),n=Ru(this.tableDataComputed[t],EF.key),a=Ru(this.tableDataComputed[t],eA.key)):(i=Ru(e,tA.key),n=Ru(e,EF.key),a=Ru(e,eA.key));const r=rp(i,Lb.state.customers.data);return"string"===typeof a&&a.length>0?`${r}${[a,n].join(" - ")}`:`${r}${n}`}},sA={key:"fullFieldName",header:{title:()=>b["default"].i18n.translate("Bezeichnung"),description:()=>b["default"].i18n.translate("Feldstück - Feldnummer - Feld")},type:"text",placeholder:b["default"].i18n.translate("<Bezeichnung>"),readOnly:!0,data(e){if(null==e)return"";const t=Ru(e,eA.key),i=Ru(e,IF.key),a=Ru(e,EF.key);if("string"!==typeof a||a.length<1)return"";const n=[a];return"string"===typeof i&&i.length>0&&n.splice(0,0,i),"string"===typeof t&&t.length>0&&n.splice(0,0,t),n.join(" - ")}};ow.vI.add(lw.pL1,lw.a3n);const oA={type:"checkbox",className:"select-rows border-right-0",width:45,key:"__select",data(e,t){const i=e[R];return"undefined"===typeof t?this.selectedRowsComputed.includes(i):this.updateSelection(i,t)},hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0,noHeaderContextMenu:!0};var lA={props:{selectedRows:{type:Array,default:null}},data(){return{selectedRowsInternal:[],selectedRowsMultiUpdateTarget:null}},computed:{selectedRowsComputed:{get(){return Array.isArray(this.selectedRows)?this.selectedRows:this.selectedRowsInternal},set(e){this.selectedRowsInternal=e,this.$emit("update:selectedRows",e)}},selectColumnPhysicalIndex(){let e=null;return this.tableSettingsComputed.columns.some(((t,i)=>t.key===oA.key&&(e=i,!0))),e}},watch:{selectedRowsComputed(){this.hotRender()},tablePhysicalRowByGuid(){const e=this.selectedRowsComputed.filter((e=>Object.keys(this.tablePhysicalRowByGuid).includes(e)));e.length!==this.selectedRowsComputed&&(this.selectedRowsComputed=e)}},created(){this.tableHooks.colHeaders.push(this.selectableRowsColHeaders)},mounted(){this.$el.addEventListener("click",(e=>(null!=e.target&&null!=e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("header-checkbox--select-rows")>-1&&this.toggleAllRowsSelected(),!0))),this.addHotHook("afterRenderer",this.selectableRowsAfterRenderer),this.addHotHook("beforeOnCellMouseDown",this.selectableRowsBeforeOnCellMouseDown),this.addHotHook("afterOnCellMouseUp",this.selectableRowsAfterOnCellMouseUp)},methods:{updateSelection(e,t){const i=this.selectedRowsComputed.filter((t=>t!==e));t&&i.push(e),this.selectedRowsComputed=i},toggleAllRowsSelected(){if(null==this.hot)return;const e=this.getSelectableRows();this.selectedRowsComputed.length===e.length?this.selectedRowsComputed=[]:this.selectedRowsComputed=e},selectableRowsColHeaders(e){if(null==this.hot||e.key!==oA.key)return null;const t=this.getSelectableRows(),i=document.createElement("div");let[a]=(0,ow.qv)({prefix:"far",iconName:"square"}).node;return t.length>0&&this.selectedRowsComputed.length===t.length?([a]=(0,ow.qv)({prefix:"far",iconName:"
1check-square"}).node,i.classList.add("text-black")):i.classList.add("text-medium"),i.classList.add("header-checkbox--select-rows"),a.style.pointerEvents="none",i.appendChild(a),i.outerHTML},selectableRowsAfterRenderer(e,t){if(null==this.hot)return;const i=this.visualRowToGuid(t);this.selectedRowsComputed.includes(i)&&e.classList.add("selected")},selectableRowsBeforeOnCellMouseDown(e,{row:t,col:i}){const a=this.hot.toPhysicalColumn(i);if(this.tableSettingsComputed.columns[a].key!==oA.key)return;if(!e.shiftKey)return;const n=this.hot.getSelected();if(!Array.isArray(n)||0===n.length)return;const[[r]]=n;if(r===t)return;const s=Math.min(r,t),o=Math.max(r,t),l=[];for(let d=s;d<=o;d+=1)l.push(this.visualRowToGuid(d));this.selectedRowsMultiUpdateTarget={targetRow:t,selectedIds:l,selected:!this.selectedRowsComputed.includes(this.visualRowToGuid(t))}},async selectableRowsAfterOnCellMouseUp(e,{row:t,col:i}){if(null==this.selectedRowsMultiUpdateTarget||this.selectedRowsMultiUpdateTarget.targetRow!==t)return;const a=this.hot.toPhysicalColumn(i);if(this.tableSettingsComputed.columns[a].key!==oA.key)return;await new Promise((e=>setTimeout(e,10)));const{selected:n,selectedIds:r}=this.selectedRowsMultiUpdateTarget,s=this.selectedRowsComputed.filter((e=>!r.includes(e)));this.selectedRowsComputed=n?[...s,...r]:s},getSelectableRows(){return null==this.selectColumnPhysicalIndex?[]:[...new Array(this.hot.countRows()).keys()].map((e=>this.visualRowToGuid(e))).filter((e=>{const t=this.guidToPhysicalRow(e),{readOnly:i}=this.cellsInternal(t,this.selectColumnPhysicalIndex);return!i}))},selectableRowsBatchAction(e="clear"){"clear"===e?this.selectedRowsComputed=[]:"all"===e?this.selectedRowsComputed=this.getSelectableRows():"reverse"===e&&(this.selectedRowsComputed=this.getSelectableRows().filter((e=>!this.selectedRowsComputed.includes(e))))}}};ow.vI.add(lw.iV1);const dA={header:{title:()=>"",description:()=>b["default"].i18n.translate("Einstellungen")},data:()=>null,key:"__dotmenu",readOnly:!0,type:"text",width:45,fixedEnd:!0,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0,noHeaderContextMenu:!0};var cA={created(){this.tableHooks.colHeaders.push(this.tableSettingsColHeader)},mounted(){this.$el.addEventListener("click",(e=>(null!=e.target&&null!=e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("header-tablesettings")>-1&&this.openTableSettingsModal(),!0)))},methods:{tableSettingsColHeader(e){if(null==this.hot||e.key!==dA.key)return this.selectableRowsColHeaders(e);const t=document.createElement("div"),[i]=(0,ow.qv)({prefix:"far",iconName:"ellipsis-v"}).node;return t.classList.add("header-tablesettings"),i.style.pointerEvents="none",t.appendChild(i),t.outerHTML},openTableSettingsModal(){this.$emit("showTableSettings")}}};const uA=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...rA,header:{title:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld"),description:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld")},width:145,lockedPosition:!0,sortOrder:"asc",readOnly:!0},{..._F,key:"processedAreaOrFieldSize"},{...DF,lockedPosition:!1,readOnly:!0},{...MF,readOnly:!0},{...IF,hiddenPerDefault:!0,readOnly:!0},{...tA,hiddenPerDefault:!0,readOnly:!0},{...EF,hiddenPerDefault:!0,className:"",width:145,readOnly:!0},{...nA,hiddenPerDefault:!0,readOnly:!0},dA];var pA={international:uA},hA=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FourthStep",{attrs:{id:"modal-step-content",showDropdown:e.showDropdown,showNoValidBbchRangeWarning:e.showNoValidBbchRangeWarning,selectedBbchCode:e.selectedBbchCode,selectedDropdownItem:e.selectedDropdownItem,dropdownItems:e.dropdownItems,dropdownItemsLoading:e.dropdownItemsLoading,bbchDescription:e.selectedBbchDescription,additionalPropertyGroups:e.additionalPropertyGroups,showInspectionConducted:e.showInspectionConducted,inspectionConducted:e.inspectionConducted},on:{updateBbchCode:e.updateBbchCode,updateAdditionalProperty:e.updateAdditionalProperty,updateInspectionConducted:e.updateInspectionConducted}})},mA=[];function fA(e){return Boolean(e.productId&&e.pesticideIndicationId)}function gA(e){const t=e.flatMap((e=>e.products)).filter(fA).map((e=>e.productId));return[...new Set(t)]}function yA(e,t){const i=[],a=new Set;return e.forEach((e=>{e.products.filter(fA).forEach((e=>{const n=t[e.productId]?.find((t=>t.id===e.pesticideIndicationId));if(!n)return;const r=`${e.productId}:${n.id}`;a.has(r)||(i.push(n),a.add(r))}))})),i}function vA(e,t,i){return e.filter((e=>{const a=oo(e.bbchCode);return null!==a&&(!(t.length>0&&!t.includes(e.bbchGroupId||""))&&i.every((e=>bA(e,a))))})).sort(((e,t)=>(e.bbchCode??Number.POSITIVE_INFINITY)-(t.bbchCode??Number.POSITIVE_INFINITY)||(e.description??"").localeCompare(t.description??"")))}function bA(e,t){const i=e.bbchStages?.filter((e=>null!==e.lowerBound||null!==e.upperBound)).map((e=>{const t=oo(e.lowerBound??0),i=oo(e.upperBound??99);return null===t||null===i?null:{lowerBound:Math.min(t,i),upperBound:Math.max(t,i)}})).filter(ka);return!i||i.length<1||i.some((e=>t>=e.lowerBound&&t<=e.upperBound))}let wA=null,CA=null;async function FA(e,t){const i=await e.bbchApi.bbchStageList({pageKey:t}),a=i.data.data??[],n=i.data.pageKey??void 0;return n?a.concat(await FA(e,n)):a}function AA(){return wA}async function kA(e){if(wA)return wA;if(!e)return[];if(CA)return CA;CA=FA(e).then((e=>(wA=e,e))).catch((()=>(wA=[],[])));try{return await CA}finally{CA=null}}var SA=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"fourth-step-content-wrapper"},[t("div",{staticClass:"left-side"},[t("FormFieldSet",{staticClass:"pb-2",attrs:{collapsible:"",headline:e.$t("Pflanze")||""}},[t("div",{staticClass:"bbch-section"},[e.showDropdown?t("FormFieldDropdown",{attrs:{label:e.$t("Wachstumsstadium (BBCH)")||"",placeholder:e.$t("Wachstumsstadium wählen")||"",value:e.selectedDropdownItem,items:e.dropdownItems,itemsLoading:e.dropdownItemsLoading,positionFixed:!1,boundary:"modal-step-content"},on:{update:e.updateDropdown}}):t("FormFieldInput",{attrs:{type:"number",label:e.$t("Wachstumsstadium (BBCH)")||"",placeholder:e.$t("Wachstumsstadium eingeben")||"",value:e.selectedBbchCode,min:0,max:99,step:1},on:{update:e.updateManualBbchCode}}
1),e.showNoValidBbchRangeWarning?t("div",{staticClass:"alert alert-warning bbch-warning",attrs:{role:"alert"}},[e._v(" Es ist kein gültiger BBCH-Bereich verfügbar. ")]):e._e(),e.bbchDescription?t("BaseFormField",{staticClass:"bbch-description",attrs:{type:"text",label:e.$t("BBCH Beschreibung")||""},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",{staticClass:"bbch-description__text"},[e._v(" "+e._s(e.bbchDescription)+" ")])]},proxy:!0}],null,!1,1175242166)}):e._e()],1),e.showInspectionConducted?t("div",{staticClass:"plant-property-section"},[t("FormCheckbox",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport",value:{title:e.$t("Kontrollgang wurde schlagbezogen durchgeführt und/oder eine Warndienstmeldung beachtet")},expression:"{\n            title: $t('Kontrollgang wurde schlagbezogen durchgeführt und/oder eine Warndienstmeldung beachtet'),\n          }",modifiers:{hover:!0,viewport:!0}}],attrs:{checked:e.inspectionConducted},on:{change:e.updateInspectionConducted}},[e._v(" "+e._s(e.$t("Kontrollgang durchgeführt oder Warndienstmeldung beachtet."))+" ")])],1):e._e()]),e._l(e.additionalPropertyGroups.filter((e=>"weather"!==e.key)),(function(i){return t("FormFieldSet",{key:i.key,staticClass:"pb-2",attrs:{collapsible:"",headline:i.headline}},[t("div",{staticClass:"additional-property-section"},e._l(i.properties,(function(i){return t("FormFieldInput",{key:i.key,attrs:{type:"number",label:i.label,value:i.value,various:i.various,step:.01},on:{update:function(t){return e.updateAdditionalProperty(i.key,t)}}})})),1)])}))],2),t("div",e._l(e.additionalPropertyGroups.filter((e=>"weather"===e.key)),(function(i){return t("FormFieldSet",{key:i.key,staticClass:"pb-2",attrs:{collapsible:"",headline:i.headline}},[t("div",{staticClass:"additional-property-section"},e._l(i.properties,(function(i){return t("FormFieldInput",{key:i.key,attrs:{type:"number",label:i.label,value:i.value,various:i.various,step:.01},on:{update:function(t){return e.updateAdditionalProperty(i.key,t)}}})})),1)])})),1)])},EA=[],IA=function(){var e=this,t=e._self._c;return t("BFormGroup",{class:[`base-form-field--${e.variant}`,{"base-form-field--slim-margin":e.slimMargin}],attrs:{"label-class":"base-form-field__label","label-cols":"horizontal"===e.variant?3:null,id:e.idFormGroup,label:e.label,"label-for":e.idFormInputComputed,description:e.description},scopedSlots:e._u(["vertical"===e.variant||"vertical-lg"===e.variant?{key:"label",fn:function(){return[t("div",{directives:[{name:"show",rawName:"v-show",value:!e.hideLabel,expression:"!hideLabel"}],staticClass:"base-form-field__label-wrapper"},[t("span",[e._v(e._s(e.label))]),"password"===e.type?t("span",{staticClass:"base-form-field__label-floating-text base-form-field__label-floating-text--password",on:{click:function(t){e.showPassword=!e.showPassword}}},[t("FontAwesomeIcon",{staticClass:"base-form-field__label-floating-icon",attrs:{icon:["far","eye"]}}),e._v(" "+e._s(e.showPassword?e.$t("Verstecken"):e.$t("Anzeigen"))+" ")],1):e.required?t("span",{staticClass:"base-form-field__label-floating-text"},[t("FontAwesomeIcon",{staticClass:"base-form-field__label-floating-icon base-form-field__label-floating-icon--asterisk",attrs:{icon:"asterisk"}}),e._v(" "+e._s(e.$t("Pflichtfeld"))+" ")],1):e._e()])]},proxy:!0}:null],null,!0)},[t("div",{staticClass:"base-form-field__form-input-wrapper"},[e._t("default",null,{id:e.idFormInputComputed,iconCount:e.iconCount,showPassword:e.showPassword}),e.iconCount>0?t("div",{staticClass:"base-form-field__icons",class:"vertical-lg"===e.variant?"base-form-field__icons--vertical-lg":null},[e.showIconDelete?t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"base-form-field__icon-container-with-tooltip",attrs:{title:e.$t("Löschen")},on:{click:function(t){return e.$emit("delete")}}},[t("FontAwesomeIcon",{staticClass:"base-form-field__icon base-form-field__icon--times",attrs:{icon:["far","times"]}})],1):e._e(),e.showIconAsterisk?t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"base-form-field__icon-container-with-tooltip",attrs:{title:e.$t("Pflichtfeld")}},[t("FontAwesomeIcon",{staticClass:"base-form-field__icon base-form-field__icon--asterisk",attrs:{icon:"asterisk"}}
1)],1):e._e(),e.showIconPassword?t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"base-form-field__icon-container-with-tooltip",attrs:{title:e.showPassword?e.$t("Verstecken"):e.$t("Anzeigen")},on:{click:function(t){e.showPassword=!e.showPassword}}},[t("FontAwesomeIcon",{staticClass:"base-form-field__icon base-form-field__icon--password",attrs:{icon:["far","eye"]}})],1):e._e(),e.showIconCheck?t("FontAwesomeIcon",{staticClass:"base-form-field__icon base-form-field__icon--check",attrs:{icon:["far","check-circle"]}}):e._e(),e.showIconExclamation?t("FontAwesomeIcon",{staticClass:"base-form-field__icon base-form-field__icon--exclamation",attrs:{icon:["far","exclamation-circle"]}}):e._e(),e.showIconCaretDown?t("FontAwesomeIcon",{staticClass:"base-form-field__icon",style:{opacity:"dropdown"===e.type?0:1},attrs:{icon:"caret-down"}}):e._e()],1):e._e()],2),(e.stateMessage,t("span",{class:{"error-state-message":!1===e.state,"success-state-message":!0===e.state}},[e._v(e._s(e.stateMessage))]))])},_A=[],DA=i(46709);ow.vI.add(lw.f8k,lw.RLE,lw.Mdf,lw.NBC,uw.$X1,uw.eW2);let MA=0;var PA={name:"BaseFormField",components:{FontAwesomeIcon:s.GN,BFormGroup:DA.x},props:{id:{type:String,default:null},type:{type:String,default:"text",validator:e=>["text","number","email","password","select","dropdown","radio","checkbox","time","datepicker"].includes(e)},required:{type:Boolean,default:!1},label:{type:String,default:null},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},slimMargin:{type:Boolean,default:!1},state:{type:Boolean,default:null},dropdownValue:{type:Object,default:null},various:{type:Boolean,default:!1},disableDelete:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},stateMessage:{type:String,default:null},description:{type:String,default:""}},data(){return{idFormGroup:`base-form-field__form-group--${MA}`,idFormInput:`base-form-field__form-input--${MA}`,showPassword:!1}},computed:{idFormInputComputed(){return null!=this.id?this.id:this.idFormInput},showIconDelete(){return!this.disableDelete&&("dropdown"===this.type&&(null!=this.dropdownValue&&null!=this.dropdownValue.id||this.various))},showIconAsterisk(){return"horizontal"===this.variant&&!0===this.required&&"boolean"!==typeof this.state},showIconPassword(){return"horizontal"===this.variant&&"password"===this.type},showIconCheck(){return!0===this.state},showIconExclamation(){return!1===this.state},showIconCaretDown(){return"select"===this.type||"dropdown"===this.type},iconCount(){let e=0;return this.showIconDelete&&(e+=1),this.showIconAsterisk&&(e+=1),this.showIconPassword&&(e+=1),this.showIconCheck&&(e+=1),this.showIconExclamation&&(e+=1),this.showIconCaretDown&&(e+=1),e}},created(){MA+=1}},TA=PA,xA=(0,ew.Z)(TA,IA,_A,!1,null,"591d3b8a",null),BA=xA.exports,OA=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BaseFormField",{attrs:{type:"dropdown",id:e.id,required:e.required,label:e.label,variant:e.variant,state:e.state,"dropdown-value":e.value,various:e.various,disableDelete:e.disableDelete,slimMargin:e.slimMargin,hideLabel:e.hideLabel},on:{delete:e.deleteValue},scopedSlots:e._u([{key:"default",fn:function({id:i,iconCount:a}){return[t("Dropdown",{ref:"dropdown",staticClass:"form-field-dropdown__dropdown",class:`form-field-dropdown__dropdown--${e.variant}`,attrs:{variant:"vertical-lg"===e.variant?"form-field-lg":"form-field",variantVariation:e.variantVariation,id:i,items:e.itemsComputed,"icon-count":a,state:e.state,placeholder:e.placeholder,various:e.various,disabled:e.disabled,boundary:e.boundary,colorCoded:e.colorCoded,positionFixed:e.positionFixed},on:{select:e.update,open:e.open}})]}}])})},$A=[],RA=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.clickOutside,expression:"clickOutside"}],ref:"dropdown",staticClass:"dropdown bg-transparent",class:{"float-right":e.overflowRight,"dropdown--table-editor":"table-editor"===e.variant,"dropdown--form-field":"form-field"===e.variant,"dropdown--form-field-lg":"form-field-lg"===e.variant}},[t("div",{staticClass:"dropdown__search",class:{"dropdown__search--open":e.isOpen,"dropdown__search--required":e.required&&null==e.items.selected.id,"bg-white":"table-editor"===e.variant,"dropdown__search--form-field":"form-field"===e.variant,"dropdown__search--form-field-lg":"form-field-lg"===e.variant,"is-valid":!0===e.state,"is-invalid":!1===e.state}},[t("label",{style:e.styleFormField(e.iconCount)},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],ref:"search",class:{"cursor-not-allowed":e.disabled},attrs:{type:"text",placeholder:e.internalPlaceholder,disabled:e.disabled,readonly:e.preventMobileKeyboard},domProps:{value:e.search},on:{input:[function(t){t.target.composing||(e.search=t.target.value)},e.open],blur:e.blur,click:t=>e.open(t,!0),keydown:e.keydown,keyup:e.keyup}})]),t("FontAwesomeIcon",{staticClass:"dropdown__search-icon dropdown__search-icon--caret-down",attrs:{icon:"caret-down"},on:{click:e.open}}),t("FontAwesomeIcon",{staticClass:"dropdown__search-icon dropdown__search-icon--search",attrs:{icon:"search"}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isOpen,expression:"isOpen"}],staticClass:"dropdown__select-wrapper bg-white",class:{"dropdown__select-wrapper--top":e.overflowBottom,"dropdown__select-wrapper--small-modal":"small-modal"===e.variantVariation,"dropdown__select-wrapper--form-field":"form-field"===e.variant,"dropdown__select-wrapper--form-field-lg":"form-field-lg"===e.variant},style:e.selectWrapperStyle},[t("div",{ref:"select",staticClass:"dropdown__select",on:{"&scroll":function(t){return e.onScroll.apply(null,arguments)}}},[t("div",{staticClass:"dropdown__item-wrapper",style:{height:e.itemWrapperHeight}},[e.items.loading?t("div",{staticClass:"dropdown__select-loading text-primary"},[t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}
1)],1):e._e(),null!=e.comparableItemValue?t("div",{staticClass:"dropdown__item dropdown__item--comparable-item"},[null!=e.comparableItemCategory?t("div",{staticClass:"dropdown__comparable-item-category"},[e._v(" "+e._s(e.comparableItemCategory)+" ")]):e._e(),t("div",{staticClass:"dropdown__comparable-item-value"},[e._v(" "+e._s(e.comparableItemValue)+" ")])]):e._e(),e._l(e.visibleOptions,(function(i){return t("div",{key:i.key,staticClass:"dropdown__item",class:{"dropdown__item--category":i.isCategory,"bg-lightest":i.isCategory,"dropdown__item--option":i.isOption,"dropdown__item--option-focused":i.key===e.focused,"dropdown__item--option-selected":i.id===e.items.selected.id,"dropdown__item--option-disabled":i.disabled},style:{top:i.top},on:{click:function(t){return e.select(i.key)}}},[i.isOption?t("BaseSearchTerm",{attrs:{haystack:i.name,needle:e.filter}}):e._e(),e.colorCoded?t("ColorBadge",{attrs:{color:i.id}}):e._e(),i.isCategory?t("span",[e._v(" "+e._s(i.name)+" ")]):e._e()],1)}))],2)])])])},NA=[],zA=i(73560),LA=i.n(zA),VA=i(93096),UA=i.n(VA),jA=function(){var e=this,t=e._self._c;return t("span",{staticClass:"base-search-term"},[e._v(" "+e._s(e.preSearch)),e.search?t("strong",[e._v(e._s(e.search))]):e._e(),e._v(e._s(e.postSearch)+" ")])},HA=[],GA={name:"BaseSearchTerm",props:{haystack:{type:String,required:!0},needle:{type:String,default:null}},computed:{indexOfMatch(){return null==this.needle?-1:this.haystack.toLowerCase().indexOf(this.needle)},preSearch(){return this.indexOfMatch<0?this.haystack:this.haystack.substring(0,this.indexOfMatch)},search(){return this.indexOfMatch<0?null:this.haystack.substring(this.indexOfMatch,this.indexOfMatch+this.needle.length)},postSearch(){return this.indexOfMatch<0?null:this.haystack.substring(this.indexOfMatch+this.needle.length)}}},WA=GA,ZA=(0,ew.Z)(WA,jA,HA,!1,null,null,null),KA=ZA.exports,qA=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"badge text-white text-outline-sm"},[e._v(e._s(e.label))])},YA=[],JA=(0,b.defineComponent)({__name:"ColorBadge",props:{color:{type:String,validator:Um,required:!0,default:"#FFFFFF"},label:{type:String,required:!1,default:" "}},setup(e){return(0,b.useCssVars)(((e,t)=>({"1b905369":e.color}))),{__sfc:!0}}}),XA=JA,QA=(0,ew.Z)(XA,qA,YA,!1,null,"6c8b8e88",null),ek=QA.exports;ow.vI.add(uw.IJ7,uw.wn1,uw.eW2);var tk={name:"Dropdown",components:{ColorBadge:ek,BaseSearchTerm:KA},props:{items:{type:Object,validator(e){return!!Array.isArray(e.data)&&("boolean"===typeof e.loading&&null!=e.selected)},default(){return this.dropdownItems}},variant:{type:String,validator:e=>["table-editor","form-field","form-field-lg"].includes(e),default(){return this.dropdownVariant}},variantVariation:{type:String,validator:e=>["small-modal"].includes(e)},various:{type:Boolean,default:!1},placeholder:{type:String,default(){return this.$t("Tippen um zu suchen")}},required:{type:Boolean,default:()=>!1},boundary:{type:[Window,HTMLElement,String,Function],default(){return this.dropdownBoundary}},iconCount:{type:Number,default:0},state:{type:Boolean,default:null},disabled:{type:Boolean,default:!1},comparableItem:{type:[String,Object],default(){return this.dropdownComparableItem}},colorCoded:{type:Boolean,required:!1,default:!1},preventMobileKeyboard:{type:Boolean,default:!1}},data(){return{overflowRight:!1,overflowBottom:!1,selectScrollTop:0,isOpen:!1,focused:null,search:"",filter:null}},inject:{dropdownItems:{default:{data:[],loading:!0,selected:{id:null,name:"",value:void 0}}},dropdownVariant:{default:"form-field"},dropdownBoundary:{default:window},dropdownComparableItem:{type:Object,default:null}},computed:{comparableItemCategory(){return null==this.comparableItem||"string"===typeof this.comparableItem?null:this.comparableItem.category},comparableItemValue(){return null==this.comparableItem||"string"===typeof this.comparableItem?this.comparableItem:this.comparableItem.value},comparableItemHeight(){return null==this.comparableItemValue?0:null==this.comparableItemCategory?36:60},itemWrapperHeight(){if(this.items.loading)return"36px";const e=36*this.options.length+this.comparableItemHeight;return`${e}px`},selectWrapperStyle(){if(this.overflowBottom){let e=42;return this.options.some((t=>(t.isOption?e+=36:t.isCategory&&(e+=24),e>282&&(e=282,!0)))),e*=-1,{marginTop:`${e}px`}}return null},options(){if(this.items.loading)return[];const e=[];return this.items.data.forEach((t=>{let{items:i}=t;if(null!=this.filter&&(i=t.items.filter((e=>
1e.name.toLowerCase().includes(this.filter)))),!(i.length<1)){if((this.items.data.length>1||null!=this.comparableItemValue)&&null!=t.name){const i=36*e.length+12+this.comparableItemHeight;e.push({key:e.length,isCategory:!0,name:t.name,top:`${i}px`})}t.sort&&(i=LA()(i,((e,t)=>e.name.toLowerCase()<t.name.toLowerCase()?-1:e.name.toLowerCase()>t.name.toLowerCase()?1:0))),i.forEach((t=>{const i=36*e.length+this.comparableItemHeight,a={key:e.length,isOption:!0,name:t.name,id:t.id,value:t.value,top:`${i}px`,disabled:!!t.disabled};e.push(a)}))}})),e},visibleOptions(){const e=[];let t=0;return this.options.some((i=>{if(t>this.selectScrollTop+500)return!0;if(t<this.selectScrollTop&&i.isCategory){const t=this.selectScrollTop+this.comparableItemHeight;e.push({...i,top:`${t}px`})}else t>this.selectScrollTop-500&&e.push(i);return t+=36,!1})),e},internalPlaceholder(){return this.various?this.$t("(verschiedene)"):this.placeholder}},watch:{options(){this.isOpen||(null==this.items.selected.name?this.search="":this.search=this.items.selected.name),null!=this.filter||null==this.items.selected.id?null==this.focused&&null!=this.filter&&this.options.some((e=>!!e.isOption&&(this.focused=e.key,requestAnimationFrame((()=>{this.moveFocusedIntoView()})),!0))):this.options.some((e=>this.items.selected.id===e.id&&(this.focused=e.key,requestAnimationFrame((()=>{this.moveFocusedIntoView()})),!0)))}},created(){null==this.items.selected.name?this.search="":this.search=this.items.selected.name},methods:{styleFormField(e){return e>0?{paddingRight:`calc(${e} * (16px + 1.2rem) - 22px)`}:null},onScroll(){this.selectScrollTop=this.$refs.select.scrollTop},blur(){"table-editor"!==this.variant&&setTimeout(this.close,200)},open(e,t=!1){this.isOpen||(this.overflowRight=!1,this.options.some(((e,t)=>(null==this.items.selected.id&&e.isOption||this.items.selected.id===e.id)&&(this.focused=t,!0))),this.filter=null,this.$refs.search.focus(),requestAnimationFrame((()=>{this.$refs.select.scrollTop=0,this.moveFocusedIntoView(),this.checkPosition()})),(t||"table-editor"===this.variant)&&(this.search=""),this.isOpen=!0,this.$emit("open"))},close(){this.open&&(this.overflowRight=!1,this.focused=null,this.filter=null,null==this.items.selected.name?this.search="":this.search=this.items.selected.name,this.isOpen=!1,this.$emit("close"))},select(e){if(!this.options[e].isOption||this.options[e].disabled)return;const t={id:this.options[e].id,name:this.options[e].name,value:this.options[e].value};this.$emit("select",t),this.$nextTick((()=>{this.close()}))},keydown(e){if(e.stopPropagation(),this.isOpen||e.key===$.ESCAPE){if(e.key===$.ENTER)null!=this.focused&&this.select(this.focused);else if(e.key===$.ESCAPE)this.close();else if(e.key===$.ARROW_DOWN){e.preventDefault();let t=!1;null==this.focused?t=!0:this.options.some((e=>
1t&&e.isOption?(this.focused=e.key,t=!1,!0):(e.key===this.focused&&(t=!0),!1))),t&&this.options.some((e=>!!e.isOption&&(this.focused=e.key,!0))),this.moveFocusedIntoView()}else if(e.key===$.ARROW_UP){e.preventDefault();let t=null;if(this.options[this.options.length-1].isOption&&(t=this.options[this.options.length-1].key),null==this.focused)return this.focused=t,void this.moveFocusedIntoView();this.options.some((e=>e.key===this.focused?(this.focused=t,!0):(e.isOption&&(t=e.key),!1))),this.moveFocusedIntoView()}}else[$.ARROW_DOWN,$.ARROW_UP,$.ENTER].includes(e.key)&&this.open()},keyup(e){[$.ENTER,$.ESCAPE,$.ARROW_UP,$.ARROW_DOWN,$.ARROW_LEFT,$.ARROW_RIGHT].includes(e.key)||this.updateFilter()},updateFilter:UA()((function(){let e=this.search.trim().toLowerCase();0===e.length&&(e=null),this.filter!==e&&(this.focused=null,this.filter=e)}),300),moveFocusedIntoView(){if(null==this.focused)return;const{scrollTop:e}=this.$refs.select,t=this.$refs.select.clientHeight;e>36*this.focused?this.$refs.select.scrollTop=36*this.focused-24:e<36*(this.focused+1)-t&&(this.$refs.select.scrollTop=Math.max(36*(this.focused+1)-t,0))},checkPosition(){const e=this.$refs.dropdown.getBoundingClientRect();let t=window.innerWidth-20,i=window.innerHeight-20,{boundary:a}=this;"function"===typeof a&&(a=a()),a instanceof HTMLElement?(t=a.getBoundingClientRect().right,i=a.getBoundingClientRect().bottom):"string"===typeof a&&(t=document.querySelector(`#${a}`).getBoundingClientRect().right,i=document.querySelector(`#${a}`).getBoundingClientRect().bottom),this.overflowRight=e.left+this.$refs.dropdown.clientWidth>t,this.overflowBottom=e.top+this.$refs.dropdown.clientHeight+this.$refs.select.clientHeight>i&&e.top>450},clickOutside(){"table-editor"!==this.variant&&this.close()}}},ik=tk,ak=(0,ew.Z)(ik,RA,NA,!1,null,"7b18f64b",null),nk=ak.exports,rk=(0,b.defineComponent)({name:"FormFieldDropdown",components:{BaseFormField:BA,Dropdown:nk},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},required:{type:Boolean,default:!1},label:{type:String,required:!0},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg"].includes(e)},variantVariation:{type:String,validator:e=>["small-modal"].includes(e)},state:{type:Boolean,default:null},value:{type:Object,required:!0},items:{type:Array,required:!0},itemsLoading:{type:Boolean,default:!1},boundary:{type:[Window,HTMLElement,String,Function]},placeholder:{type:String,default(){return this.$t("Tippen um zu suchen")}},various:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disableDelete:{type:Boolean,default:!1},slimMargin:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},positionFixed:{type:Boolean,default:!0},colorCoded:{type:Boolean,required:!1,default:!1}},computed:{itemsComputed(){return{selected:this.value,data:this.items,loading:this.itemsLoading}}},methods:{update(e){this.$emit("update",e)},deleteValue(){this.$emit("update",{id:null,name:null,value:void 0})},open(){this.$emit("open")}}}),sk=rk,ok=(0,ew.Z)(sk,OA,$A,!1,null,"38345354",null),lk=ok.exports,dk=function(){var e=this,t=e._self._c;return t("BaseFormField",{attrs:{id:e.id,required:e.required,label:e.label,variant:e.variant,type:e.type,state:e.state,stateMessage:e.stateMessage,description:e.description},scopedSlots:e._u([{key:"default",fn:function({id:i,iconCount:a,showPassword:n}){return[t("div",{staticClass:"input-group"},[t("BFormInput",{staticClass:"form-field-input__input",class:{[`form-field-input__input--${e.variant}`]:!0,"form-field-input__input--with-icon":!0===e.required||"boolean"===typeof e.state,"cursor-not-allowed":e.disabled},style:e.style(a),attrs:{id:i,type:"password"===e.type&&n?"text":e.type,autocomplete:e.autocomplete,name:e.name,required:e.required,placeholder:e.placeholderComputed,disabled:e.disabled,value:e.valueComputed,number:"number"===e.type,lazy:e.lazy,state:e.state,step:e.step,max:e.max,min:e.min,list:e.dataListId,"lazy-formatter":e.lazyFormatter,formatter:e.formatter},on:{input:e.input,change:e.change,update:e.update,blur:e.blur,focu
1s:e.focus,keypress:e.keypress}}),e._t("append"),e.clearIcon&&e.valueComputed&&!e.disabled?[t("span",{staticClass:"clear-icon",on:{click:e.clearInput}},[t("FontAwesomeIcon",{attrs:{icon:["far","xmark"]}})],1)]:e._e()],2),e.dataList.length>0?t("datalist",{attrs:{id:e.dataListId}},e._l(e.dataList,(function(i){return t("option",{key:i},[e._v(e._s(i))])})),0):e._e()]}}],null,!0)})},ck=[],uk=i(22183);ow.vI.add(lw.g82);var pk={name:"FormFieldInput",components:{BaseFormField:BA,BFormInput:uk.e},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},type:{type:String,default:"text",validator:e=>["text","number","email","password","tel","time"].includes(e)},autocomplete:{type:String,default:null},value:{type:[String,Number],default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},name:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},step:{type:[String,Number],default:void 0},number:{type:Boolean,default:null},lazyFormatter:{type:Boolean,default:!1},formatter:{type:Function,default:null},lazy:{type:Boolean,default:!1},stateMessage:{type:String,default:null},description:{type:String,default:""},min:{type:Number,default:null},max:{type:Number,default:null},dataList:{type:Array,default:()=>[]},dataListId:{type:String,default:void 0},clearIcon:{type:Boolean,default:!1}},computed:{valueComputed(){return this.various?null:this.value},placeholderComputed(){return this.various?this.$t("(verschiedene)"):this.placeholder}},methods:{style(e){let t="0px";return"vertical-lg"===this.variant&&(t="10px"),e>0?{paddingRight:`calc(${e} * (16px + 1.2rem) + ${t})`}:null},input(e){this.$emit("input",e)},change(e){this.$emit("change",e)},update(e){"number"!==this.type||""!==e?this.$emit("update",e):this.$emit("update",null)},blur(){this.$emit("blur")},focus(){this.$emit("focus")},keypress(e){this.$emit("keypress",e)},clearInput(){this.$emit("update","")}}},hk=pk,mk=(0,ew.Z)(hk,dk,ck,!1,null,"3dcc6cfa",null),fk=mk.exports,gk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-field-set"},[t("FormHeadline",{staticClass:"form-field-set__headline",class:{"form-field-set__headline--collapsible":e.collapsible},on:{click:e.toggleCollapsed}},[e.$slots["header"]?t("span",{staticClass:"form-field-set__headline-text"},[e._t("header")],2):t("span",{staticClass:"form-field-set__headline-text"},[e._v(" "+e._s(e.headline)+" ")]),e.collapsible?t("span",{staticClass:"form-field-set__headline-collapsible-icon"},[t("FontAwesomeIcon",{attrs:{icon:e.contentVisible?["far","angle-up"]:["far","angle-down"]}})],1):e._e()]),t("BCollapse",{class:{"form-field-set__content":e.indented},model:{value:e.contentVisible,callback:function(t){e.contentVisible=t},expression:"contentVisible"}},[e._t("default")],2)],1)},yk=[],vk=i(11688),bk=function(){var e=this,t=e._self._c;return t("h3",{staticClass:"form-headline",on:{click:t=>e.$emit("click",t)}},[e._t("default")],2)},wk=[],Ck={name:"FormHeadline"},Fk=Ck,Ak=(0,ew.Z)(Fk,bk,wk,!1,null,"281be1f4",null),kk=Ak.exports;ow.vI.add(lw.onQ,lw.gc2);var Sk={name:"FormFieldSet",components:{BCollapse:vk.k,FontAwesomeIcon:s.GN,FormHeadline:kk},model:{prop:"collapsed",event:"update"},props:{headline:{type:String,default:null},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},indented:{type:Boolean,required:!1,default:!0}},data(){return{collapsedInternal:this.collapsed}},watch:{collapsed(){this.collapsedInternal=this.collapsed}},computed:{contentVisible:{get(){return!this.collapsible||!this.collapsedInternal},set(e){this.collapsedInternal=!e,this.$emit("update",this.collapsedInternal)}}},methods:{toggleCollapsed(){this.contentVisible=this.collapsedInternal}}},Ek=Sk,Ik=(0,ew.Z)(Ek,gk,yk,!1,null,"153e4cec",null),_k=Ik.exports,Dk=(0,b.defineComponent)({name:"FourthStep",components:{BaseFormField:BA,FormCheckbox:Gw,FormFieldDropdown:lk,FormFieldInput:fk,FormFieldSet:_k},props:{showDropdown:{type:Boolean,required:!0},showNoValidBbchRangeWarning:{type:Boolean,default:!1},selectedBbchCode:{type:Number,default:null},selectedDropdownItem:{type:Object,required:!0},dropdownItems:{type:Array,required:!0},dropdownItemsLoading:{type:Boolean,default:!1},bbchDescription:{type:String,default:null},additionalPropertyGroups:{type:Array,default:()=>[]},showInspectionConducted:{type:Boolean,default:!1},inspectionConducted:{type:Boolean,default:!1}},methods:{updateDropdown(e){if(!e.id)return void this.$emit("updateBbchCode",null);const t=Number.parseInt(String(e.id),10);Number.isNaN(t)||t<0||t>99?this.$emit("updateBbchCode",null):this.$emit("updateBbchCode",t)},updateManualBbchCode(e){if(null===e||""===e)return void this.$emit("updateBbchCode",null);const t="number"===typeof e?e:Number.parseInt(e,10);Number.isNaN(t)?this.$emit("updateBbchCode",null):t<0||t>99||this.$emit("updateBbchCode",Math.floor(t))},updateAdditionalProperty(e,t){if(null===t||""===t)return void this.$emit("updateAdditionalProperty",{key:e,value:null});const i="number"===typeof t?t:Number.parseFloat(t);Number.isNaN(i)?this.$emit("updateAdditionalProperty",{key:e,value:null}):this.$emit("updateAdditionalProperty",{key:e,value:i})},updateInspectionConducted(e){this.$emit("updateInspectionConducted",!!e)}}}),Mk=Dk,Pk=(0,ew.Z)(Mk,SA,EA,!1,null,"edfec1f6",null),Tk=Pk.exports;function xk(e){const t=e.macroStageName?.trim()??"",i=e.description?.trim()??"";return t&&i?`${t} - ${i}`:t||i}function Bk(e,t){const i=`${Math.floor(e)}X`,a=t?.trim()??"";return a?`BBCH ${i} - ${a}`:`BBCH ${i}`}function Ok(e){return"number"===typeof e.macroStage&&!Number.isNaN(e.macroStage)&&e.macroStage>=0?Math.floor(e.macroStage):"number"===typeof e.bbchCode&&!Number.isNaN(e.bbchCode)&&e.bbchCode>=0?Math.floor(e.bbchCode/10):null}const $k=[At.Crop,At.Harvest],Rk=[{key:"thousandGrainWeight",name:"Tausendkorngewicht",unit:"g",category:"product",visibleForProductCategoryTypes:[At.Seed]},{key:"moistureContent",name:"Feuchtigkeit",unit:"%",category:"product",visibleForProductCategoryTypes:$k},{key:"proteinContent",name:"Proteingehalt",unit:"%",category:"product",visibleForProductCategoryTypes:$k},{key:"hectoliterWeight",name:"Hektolitergewicht",unit:"kg/hl",category:"product",visibleForProductCategoryTypes:$k}
1,{key:"sugarContent",name:"Zuckergehalt",unit:"%",category:"product",visibleForProductCategoryTypes:$k},{key:"starchContent",name:"Stärkegehalt",unit:"%",category:"product",visibleForProductCategoryTypes:$k},{key:"temperature",name:"Temperatur",unit:"°C",category:"weather"},{key:"windSpeed",name:"Windgeschwindigkeit",unit:"km/h",category:"weather"},{key:"relativeHumidity",name:"Relative Feuchtigkeit",unit:"%",category:"weather"}],Nk={product:"Produkt",weather:"Wetter"};function zk(e,t){return"weather"===e.category||(!e.visibleForProductCategoryTypes||e.visibleForProductCategoryTypes.length<1||!!t&&e.visibleForProductCategoryTypes.includes(t))}var Lk=(0,b.defineComponent)({name:"FourthStepContainer",components:{FourthStep:Tk},data(){return{bbchStages:[],bbchStagesLoading:!1}},created(){this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("products/subscribe"),this.$store.dispatch("productCategories/subscribe"),this.fetchBbchStages()},computed:{activities(){return this.$store.state.activities.createEditActivity.activities??[]},selectedBbchCode(){const e=this.activities.map((e=>oo(e.bbchCode))),t=[...new Set(e)];return 1!==t.length?null:t[0]},selectedFieldIds(){return this.activities.map((e=>e.fieldId)).filter(ka)},selectedProductIdsForIndications(){return gA(this.activities)},mergedActivityProducts(){return this.$store.getters["activities/createEditActivity/mergedActivityProducts"]??[]},currentActivityProductId(){return this.$store.state.activities.createEditActivity.currentActivityProductId},selectedProductCategoryType(){const e=this.selectedProductId();if(!e)return null;const t=this.findProductById(e);if(!t?.categoryId)return null;const i=this.$store.state.productCategories.data;return i[t.categoryId]?.type??null},showInspectionConducted(){const e=this.$store.state.productCategories.data;return this.mergedActivityProducts.some((t=>{const{productId:i}=t;if(null==i)return!1;const a=this.findProductById(i)?.categoryId;return null!=a&&e[a]?.type===At.Herb}))},additionalPropertyGroups(){const e=Rk.reduce(((e,t)=>{if(!zk(t,this.selectedProductCategoryType))return e;const i=e.get(t.category)??[],{value:a,various:n}=this.getUnifiedActivityPropertyValue(t.key);return e.set(t.category,i.concat({key:t.key,label:this.formatAdditionalPropertyLabel(t.name,t.unit),value:a,various:n})),e}),new Map),t=["product","weather"];return t.map((t=>{const i=e.get(t)??[];return i.length<1?null:{key:t,headline:this.$t(Nk[t])??"",properties:i}})).filter(ka)},inspectionConducted(){return!(this.activities.length<1)&&this.activities.every((e=>!0===e.inspectionConducted))},selectedBbchGroupIds(){const e=this.$store.state.fields.data,t=this.selectedFieldIds.map((t=>e[t]?.cropId)).filter(ka).map((e=>this.findCropById(e)?.bbchGroupId)).filter(ka);return[...new Set(t)]},indicationFilterLoading(){if(this.selectedProductIdsForIndications.length<1)return!1;const e=this.$store.state.pesticideIndications.data;return this.selectedProductIdsForIndications.some((t=>void 0===e[t]))},cropsLoading(){return this.$store.getters["products/crops/loading"]},dropdownItemsLoading(){return this.bbchStagesLoading||this.cropsLoading||this.indicationFilterLoading},selectedPesticideIndications(){const e=this.$store.state.pesticideIndications.data;return yA(this.activities,e)},filteredBbchStages(){if(this.dropdownItemsLoading)return[];const{selectedBbchGroupIds:e,selectedPesticideIndications:t}=this;return vA(this.bbchStages,e,t)},showDropdown(){return!!this.dropdownItemsLoading||this.filteredBbchStages.length>0},showNoValidBbchRangeWarning(){return!(this.dropdownItemsLoading||this.selectedPesticideIndications.length<1)&&this.filteredBbchStages.length<1},selectedDropdownItem(){if(null===this.selectedBbchCode)return{id:null,name:""};const e=this.findBbchStageByCode(this.selectedBbchCode);if(!e){const e=lo(this.selectedBbchCode);return{id:e,name:`BBCH ${e}`}}return this.toDropdownItem(e)},dropdownItems(){const e=this.filteredBbchStages.reduce(((e,t)=>{const i=Ok(t);if(null===i)return e;const a=e.get(i)??{items:[],macroStageName:""},n=t.macroStageName?.trim()??"";return e.set(i,{items:a.items.concat(this.toDropdownItem(t)),macroStageName:a.macroStageName||n}),e}),new Map);return[...e.entries()].sort(((e,t)=>e[0]-t[0])).map((([e,t])=>({name:Bk(e,t.macroStageName),items:t.items})))},selectedBbchDescription(){if(null===this.selectedBbchCode)return null;const e=this.findBbchStageByCode(this.selectedBbchCode);if(!e)return`BBCH ${lo(this.selectedBbchCode)}`;const t=xk(e);return t||`BBCH ${lo(this.selectedBbchCode)}`}},watch:{selectedProductIdsForIndications:{handler(e){if(e.length<1)return;const t=e;this.$store.dispatch("pesticideIndications/loadByIds",t)},immediate:!0}},methods:{async fetchBbchStages(){this.bbchStagesLoading=!0;try{const e=this.$api;this.bbchStages=await kA(e)}catch(e){console.error(e),this.bbchStages=[]}finally{this.bbchStagesLoading=!1}},updateBbchCode(e){this.$store.commit("activities/createEditActivity/setBbchCode",oo(e))},updateAdditionalProperty(e){this.$store.commit("activities/createEditActivity/setActivityNumericProperty",e)},updateInspectionConducted(e){this.$store.commit("activities/createEditActivity/setActivityBooleanProperty",{key:"inspectionConducted",value:e})},findBbchStageByCode(e){return this.filteredBbchStages.find((t=>t.bbchCode===e))??this.bbchStages.find((t=>t.bbchCode===e))},selectedProductId(){if(this.currentActivityProductId){const e=this.mergedActivityProducts.find((e=>e.id===this.currentActivityProductId));if(e?.productId)return e.productId}return this.mergedActivityProducts.find((e=>!!e.productId))?.productId??null},findProductById(e){return this.$store.getters["products/findProductById"](e)},getUnifiedActivityPropertyValue(e){const t=this.activities.map((t=>this.sanitizeNumericValue(t[e])));if(t.length<1)return{value:null,various:!1};const i=t[0],a=t.every((e=>e===i));return a?{value:i,various:!1}:{value:null,various:!0}},sanitizeNumericValue(e){return"number"!==typeof e||Number.isNaN(e)?null:e},formatAdditionalPropertyLabel(e,t){return`${this.$t(e)} in ${t}`},toDropdownItem(e){const t=oo(e.bbchCode);if(null===t)return{id:null,name:""};const i=e.description?.trim()??"",a=lo(t);return{id:a,name:i?`BBCH ${a} - ${i}`:`BBCH ${a}`}},findCropById(e){const t=this.$store.state.products.crops.data;if(t[e])return t[e];const i=Object.values(t).find((t=>String(t.id)===String(e)));return i??null}}}),Vk=Lk,Uk=(0,ew.Z)(Vk,hA,mA,!1,null,null,null),jk=Uk.exports,Hk=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pagination"},e._l(e.indices,(function(i){return t("span",{key:i,staticClass:"pagination__dot",class:{"bg-primary border-primary":i===e.current,"border-medium":i!==e.current}})})),0)},Gk=[],Wk={name:"Pagination",props:{pages:{type:Number,required:!0},current:{type:Number,required:!0}},computed:{indices(){return[...new Array(this.pages).keys()]}}},Zk=Wk,Kk=(0,ew.Z)(Zk,Hk,Gk,!1,null,"2f86f895",null),qk=Kk.exports,Yk=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FirstStep",{attrs:{availableIconTypes:e.availableIconTypes,selectedIconTypes:e.selectedIconTypes,selectedDates:e.timeStarts,startTime:e.startTime,workingTime:e.workingTime,setupTime:e.setupTime,drivingTime:e.drivingTime,pauseTime:e.pauseTime,userComments:e.userComments,regionCodes:e.regionCodes},on:{setSelectedDate:e.setTimeStart,setStartTime:e.setStartTimeFromString,setWorkingTime:e.setWorkingTime,setDrivingTime:e.setDrivingTime,setSetupTime:e.setSetupTime,setPauseTime:e.setPauseTime,setComment:e.setUserComment,setIconType:e.setIconType}})},Jk=[],Xk=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"first-step-content-wrapper"},[t(i.DatepickerSection,{attrs:{headline:e.$t("Durchführungsdatum"),selectedDates:e.selectedDates,startTime:e.startTime,workingTime:e.workingTime,setupTime:e.setupTime,drivingTime:e.drivingTime,pauseTime:e.pauseTime},on:{setSelectedDate:i.setSelectedDate,setStartTime:i.setStartTime,setWorkingTime:i.setWorkingTime,setDrivingTime:i.setDrivingTime,setSetupTime:i.setSetupTime,setPauseTime:i.setPauseTime}}),t(i.IconSelectSection,{staticClass:"icon-section",attrs:{headline:e.$t("Tätigkeit"),types:e.availableIconTypes,selectedTypes:e.selectedIconTypes},on:{setType:i.setIconType}}),t("div",[t(i.NoteWorkInstructionSection,{attrs:{headline:e.$t("Notizen und Arbeitsanweisungen"),notes:e.userComments},on:{update:i.setComment}})],1)],1)},Qk=[],eS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{attrs:{headline:e.headlineAdditionalInfo}},[t("div",{staticClass:"date-select-section"},[t("div",{staticClass:"datepicker-inputfield-wrapper"},[t("Datepicker",{staticClass:"datepicker",style:{border:0},attrs:{inline:!0,"monday-first":!0,"calendar-class":"activity-datepicker",value:e.selectedDate,highlighted:e.highlightedDates,includeDisabled:!0},on:{selected:e.setSelectedDate}}),t("div",{staticClass:"inputfield-wrapper"},[t("FormFieldInputTimePicker",{staticClass:"datepicker-time-input",attrs:{name:"startTime",value:e.startTime,variant:"vertical",placeholder:e.$t("hh:mm"),label:e.$t("Start")},on:{update:e.setStartTime}}),t("FormFieldInputTimePicker",{staticClass:"datepicker-time-input",attrs:{name:"workingTime",value:e.workingTime,variant:"vertical",placeholder:"hh:mm",label:e.$t("Arbeitszeit")},on:{update:e.setWorkingTime}}),t("FormFieldInputTimePicker",{staticClass:"datepicker-time-input",attrs:{name:"drivingTime",value:e.drivingTime,variant:"vertical",placeholder:e.$t("hh:mm"),label:e.$t("Wegzeit")},on:{update:e.setDrivingTime}}),t("FormFieldInputTimePicker",{staticClass:"datepicker-time-input",attrs:{name:"setupTime",value:e.setupTime,variant:"vertical",placeholder:e.$t("hh:mm"),label:e.$t("Rüstzeit")},on:{update:e.setSetupTime}}),t("FormFieldInputTimePicker",{staticClass:"datepicker-time-input",attrs:{name:"pauseTime",value:e.pauseTime,variant:"vertical",placeholder:e.$t("hh:mm"),label:e.$t("Pause")},on:{update:e.setPauseTime}})],1)],1)])])},tS=[],iS=i(67540),aS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInput",e._b({staticClass:"form-field-time-input",attrs:{type:"text",value:e.displayValue,disabled:e.disabled},on:{input:e.onInput,change:e.onChange,blur:e.onBlur,focus:e.onFocus,keypress:e.onKeypress},scopedSlots:e._u([{key:"append",fn:function(){return[t("button",{staticClass:"form-field-time-input__picker-button",attrs:{type:"button",disabled:e.disabled,"aria-label":e.$t("Uhrzeit auswählen")},on:{click:e.openNativeTimePicker}},[t("FontAwesomeIcon",{attrs:{icon:["far","clock"]}})],1),t("input",{ref:"nativeTimeInput",staticClass:"form-field-time-input__native-input",attrs:{type:"time",disabled:e.disabled,"aria-label":e.$t("Uhrzeit auswählen"),tabindex:"-1"},domProps:{value:e.nativeTimeValue},on:{input:e.onNativeTimeInput}})]},proxy:!0}])},"FormFieldInput",e.$attrs,!1))},nS=[];function rS(e){const t=e.replaceAll(",","."),i=t.split(".");if(1===i.length)return parseInt(i[0],10);const a=i.slice(0,-1).join(""),n=i[i.length-1],r=parseFloat(`${a}.${n}`);return r}function sS(e){const t=rS(e);return Number.isNaN(t)?null:t<10?3600*t:60*t}function oS(e){const t=e.match(/(?:(\d+)?d\s?)?(?:(\d+)?h\s?)?(?:(\d+)?m\s?)?(?:(\d+)?s)?/);if(null==t)return null;const i=t.slice(1).reduce(((e,t,i)=>{const a=parseInt(t,10);
1return Number.isNaN(a)||(0===i?e+=3600*a*24:1===i?e+=3600*a:2===i?e+=60*a:3===i&&(e+=a)),e}),0);return 0===i?null:i}function lS(e){const t=e.match(/^(?:(\d{1,2}):)?(\d{1,2}):?(?:(\d{1,2}))?$/);if(null==t)return null;const i=e.match(/:/g);if(!i)return null;const a=t.slice(1).reduce(((e,t,i)=>{if(!t)return e;const a=parseInt(t,10);return Number.isNaN(a)||(0===i?e+=3600*a:1===i?e+=60*a:2===i&&(e+=a)),e}),0);return 0===a?null:a}function dS(e){if(null==e)return null;const t=e.trim();if(""===t)return null;let i=null;return i=oS(t),null!==i?i:(i=lS(t),null!==i?i:(i=sS(t),null!==i?i:null))}function cS(e){const t=/(\d\d):(\d\d)/,i=t.exec(e);if(!i)throw new Error(`Could not parse ${e}`);const a=Number(i[1]),n=Number(i[2]);return 3600*a+60*n}function uS(e){const t=Math.round(e),i=Math.floor(t/3600),a=pS(i),n=Math.floor((t-3600*i)/60),r=pS(n);return`${a}:${r}`}function pS(e){return e.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1})}ow.vI.add(lw.SZw);var hS=(0,b.defineComponent)({name:"FormFieldInputTimePicker",components:{FormFieldInput:fk},inheritAttrs:!1,model:{prop:"value",event:"update"},props:{value:{type:String,default:null},disabled:{type:Boolean,default:!1},parser:{type:Function,default:e=>{const t=dS(e);return null!==t?uS(t):null}}},data(){return{displayValue:this.value||"",hasPendingCommit:!1}},computed:{nativeTimeValue(){return/^\d{2}:\d{2}$/.test(this.displayValue)?this.displayValue:""}},watch:{value(e){this.displayValue=e||"",this.hasPendingCommit=!1}},methods:{commitParsedValue(e,t=!1){this.hasPendingCommit=!1;const i=""===e.trim()?"00:00":e,a=this.parser(i);null!==a?(this.displayValue=a,this.$emit("update",a),t&&this.$emit("change",a)):this.$emit("invalid",e)},onInput(e){this.displayValue=e,this.hasPendingCommit=!0,this.$emit("input",e)},onChange(e){this.displayValue=e,this.commitParsedValue(e,!0)},onBlur(){this.hasPendingCommit&&this.commitParsedValue(this.displayValue),this.$emit("blur")},onFocus(){this.$emit("focus")},onKeypress(e){this.$emit("keypress",e)},onNativeTimeInput(e){const t=e.target instanceof HTMLInputElement?e.target.value:"";this.displayValue=t,this.$emit("input",t),this.commitParsedValue(t,!0)},openNativeTimePicker(){const e=this.$refs.nativeTimeInput;if(!e||this.disabled)return;const t=e;"function"!==typeof t.showPicker?(e.focus(),e.click()):t.showPicker()}}}),mS=hS,fS=(0,ew.Z)(mS,aS,nS,!1,null,"483809dc",null),gS=fS.exports,yS=(0,b.defineComponent)({name:"DatepickerSection",model:{prop:"date",event:"setDate"},props:{selectedDates:{type:Array,default:void 0},headline:{type:String,default:""},workingTime:{type:String,default:""},setupTime:{type:String,default:""},drivingTime:{type:String,default:""},pauseTime:{type:String,default:""},startTime:{type:String,default:""}},components:{Datepicker:iS.Z,FormFieldSet:_k,FormFieldInputTimePicker:gS},computed:{headlineAdditionalInfo(){return this.highlightedDates?.dates&&!this.isEqual(this.highlightedDates.dates)?`${this.headline} (${this.$t("verschiedene")})`:this.headline},selectedDate(){return this.selectedDates&&1===this.selectedDates.length?this.selectedDates[0]:null},highlightedDates(){return this.selectedDates&&this.selectedDates.length>1?{dates:this.selectedDates}:{}}},methods:{isEqual(e){return!!e.every(((e,t,i)=>e.getTime()===i[0].getTime()))},setSelectedDate(e){this.$emit("setSelectedDate",e)},setWorkingTime(e){this.$emit("setWorkingTime",e)},setDrivingTime(e){this.$emit("setDrivingTime",e)},setSetupTime(e){this.$emit("setSetupTime",e)},setPauseTime(e){this.$emit("setPauseTime",e)},setStartTime(e){this.$emit("setStartTime",e)}
1}}),vS=yS,bS=(0,ew.Z)(vS,eS,tS,!1,null,"c12b531e",null),wS=bS.exports,CS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{attrs:{headline:e.headlineAdditionalInfo}},[t("div",{staticClass:"icon-select-section"},[t("div",{staticClass:"button-wrapper"},e._l(e.types,(function(i,a){return t("button",{key:`activity-${a}`,class:{selected:e.isSelected(i)},attrs:{type:"button"},on:{click:function(t){return e.setType(i)}}},[t("div",{staticClass:"image-desc-wrapper"},[t("img",{staticClass:"icon",attrs:{src:i.iconPath,alt:`${i.displayName} icon`}}),t("span",[e._v(e._s(i.displayName))])])])})),0)])])},FS=[],AS=(0,b.defineComponent)({name:"IconSelectSection",components:{FormFieldSet:_k},props:{headline:{type:String,default:""},types:{type:Array,required:!0},selectedTypes:{type:Array,required:!0}},computed:{headlineAdditionalInfo(){return 1===this.selectedTypes.length||this.isEqual(this.selectedTypes)?this.headline:`${this.headline} (${this.$t("verschiedene")})`}},methods:{setType(e){this.$emit("setType",e)},isSelected(e){return!!this.selectedTypes.some((t=>t.id===e.id))},isEqual(e){return!!e.every(((e,t,i)=>e===i[0]))}}}),kS=AS,SS=(0,ew.Z)(kS,CS,FS,!1,null,"03d6a2ba",null),ES=SS.exports,IS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{attrs:{headline:e.headlineAdditionalInfo}},[t("FormFieldTextArea",{attrs:{label:e.$t("Notizen"),text:e.text,variant:"horizontal",rows:"4"},on:{update:e.update}})],1)},_S=[],DS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BaseFormField",{attrs:{id:e.id,required:e.required,label:e.label,variant:e.variant,type:"text",state:e.state},scopedSlots:e._u([{key:"default",fn:function({id:i}){return[t("BFormTextarea",{staticClass:"form-field-input__text-area",attrs:{id:i,value:e.text,placeholder:e.placeholder,disabled:e.disabled,rows:e.rows,"max-rows":e.maxRows,"no-resize":e.noResize,"no-auto-shrink":e.noAutoShrink,state:e.state},on:{update:e.update}})]}}])})},MS=[],PS=i(333),TS=(0,b.defineComponent)({name:"FormFieldTextArea",components:{BFormTextarea:PS.y,BaseFormField:BA},model:{prop:"text",event:"update"},props:{id:{type:String,default:null},text:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String,default:null},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},rows:{type:String,default:"2"},maxRows:{type:String,default:"6"},noResize:{type:Boolean,default:!1},noAutoShrink:{type:Boolean,default:!1},state:{type:Boolean,default:null}},methods:{update(e){this.$emit("update",e)}}}),xS=TS,BS=(0,ew.Z)(xS,DS,MS,!1,null,"65a79b42",null),OS=BS.exports,$S=(0,b.defineComponent)({name:"NoteWorkInstructionSection",components:{FormFieldSet:_k,FormFieldTextArea:OS},data(){return{text:this.notes.filter(ka).join(", ")}},model:{prop:"text",event:"update"},props:{headline:{type:String,default:""},notes:{type:Array,required:!0,default:()=>[]}},computed:{headlineAdditionalInfo(){return this.notes&&this.notes.length>1&&!this.isEqual(this.notes)?`${this.headline} (${this.$t("verschiedene")})`:this.headline}},methods:{update(e){this.text=e,this.$emit("update",e)},isEqual(e){return!!e.every(((e,t,i)=>e===i[0]))},truncateText(e){return e.length>70?`${e.slice(0,70)}...`:e}}}),RS=$S,NS=(0,ew.Z)(RS,IS,_S,!1,null,"7eadf7fc",null),zS=NS.exports,LS=(0,b.defineComponent)({__name:"FirstStep",props:{availableIconTypes:{default:null},selectedIconTypes:null,selectedDates:null,startTime:null,workingTime:null,setupTime:null,drivingTime:null,pauseTime:null,userComments:null,regionCodes:null},emits:["setSelectedDate","setStartTime","setWorkingTime","setDrivingTime","setSetupTime","setPauseTime","setIconType","setComment"],setup(e,{emit:t}){function i(e){t("setSelectedDate",e)}function a(e){t("setStartTime",e)}
1function n(e){t("setWorkingTime",e)}function s(e){t("setDrivingTime",e)}function o(e){t("setSetupTime",e)}function l(e){t("setPauseTime",e)}function d(e){t("setIconType",e)}function c(e){t("setComment",e)}return{__sfc:!0,emit:t,setSelectedDate:i,setStartTime:a,setWorkingTime:n,setDrivingTime:s,setSetupTime:o,setPauseTime:l,setIconType:d,setComment:c,DatepickerSection:wS,IconSelectSection:ES,IconType:r.IconType,NoteWorkInstructionSection:zS}}}),VS=LS,US=(0,ew.Z)(VS,Xk,Qk,!1,null,"13ca4180",null),jS=US.exports;const HS="",GS=`${HS}/assets/img/`,WS=e=>{const t=new RegExp("^(https?:\\/\\/)((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)},ZS=(e,t="")=>`${GS}${t}/${e}`,KS=(e,t,i)=>fetch(e).then((e=>e.arrayBuffer())).then((e=>new File([e],t,{type:i})));var qS=(0,b.defineComponent)({name:"FirstStepContainer",components:{FirstStep:jS},created(){this.$store.dispatch("activityTypes/subscribe")},computed:{...(0,C.rn)("auth",["currentCompanies"]),...(0,C.Se)({regionCodes:"auth/currentCompaniesRegionCodes"}),activityTypesSorted(){const e=this.$store.getters["activityTypes/compatibleActivityTypesWithoutSyncNameDuplicates"](this.currentCompanies);return e.sort(((e,t)=>
1e.sortKey-t.sortKey))},selectedActivityTypeIds(){const e=this.$store.state.activities.createEditActivity.activities.map((e=>e.activityTypeId?e.activityTypeId:null)).filter(ka);return e},availableIconTypes(){return this.activityTypesSorted.map(this.toIconType)},selectedIconTypes(){return this.selectedActivityTypeIds.map((e=>this.toIconType(this.$store.getters["activityTypes/getById"](e))))},timeStarts(){const e=this.$store.state.activities.createEditActivity.activities?.map((e=>e.timeStart?new Date(ca(e.timeStart)):new Date));return e},startTime(){const e=this.$store.state.activities.createEditActivity.activities?.[0],t=e?.timeStart?new Date(ca(e.timeStart)):new Date,i=3600*t.getHours()+60*t.getMinutes();return uS(i)},workingTime(){const e=this.$store.getters["activities/createEditActivity/sumWorkingTime"];return e?uS(e):null},drivingTime(){const e=this.$store.getters["activities/createEditActivity/sumDrivingTime"];return e?uS(e):null},setupTime(){const e=this.$store.getters["activities/createEditActivity/sumSetupTime"];return e?uS(e):null},pauseTime(){const e=this.$store.getters["activities/createEditActivity/sumPauseTime"];return e?uS(e):null},userComments(){const e=this.$store.state.activities.createEditActivity.activities?.map((e=>e.userComment?e.userComment:null));return e}},methods:{toIconType(e){return{id:rr(e),displayName:e.displayName,iconPath:ZS(`${e.appIconName}.svg`,"icons/activity_type")}},setIconType(e){this.$store.dispatch("activities/createEditActivity/updateActivityType",e.id)},setTimeStart(e){const t=this.getCurrentTimeStartDate(),i=new Date(e);i.setHours(t.getHours(),t.getMinutes(),0,0),this.$store.commit("activities/createEditActivity/setTimeStart",da(i.getTime()))},setStartTimeFromString(e){const t=cS(e),i=Math.floor(t/3600),a=Math.floor(t%3600/60),n=this.getCurrentTimeStartDate();n.setHours(i,a,0,0),this.$store.commit("activities/createEditActivity/setTimeStart",da(n.getTime()))},getCurrentTimeStartDate(){const e=this.$store.state.activities.createEditActivity.activities?.[0];return e?.timeStart?new Date(ca(e.timeStart)):new Date},setWorkingTime(e){this.$store.commit("activities/createEditActivity/distributeWorkingTimeToActivities",cS(e))},setDrivingTime(e){this.$store.commit("activities/createEditActivity/distributeDrivingTimeToActivities",cS(e))},setSetupTime(e){this.$store.commit("activities/createEditActivity/distributeSetupTimeToActivities",cS(e))},setPauseTime(e){this.$store.commit("activities/createEditActivity/distributePauseTimeToActivities",cS(e))},setUserComment(e){this.$store.commit("activities/createEditActivity/setUserComment",e)}}}),YS=qS,JS=(0,ew.Z)(YS,Yk,Jk,!1,null,null,null),XS=JS.exports,QS=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MapSelectFields",{attrs:{fields:e.filteredFields,polygons:e.polygons,crops:e.crops,selectDisabled:"editActivity"===e.workflowKey},on:{addPolygon:e.addPolygon,polygonSetState:e.polygonSetState},model:{value:e.selectedFields,callback:function(t){e.selectedFields=t},expression:"selectedFields"}})},eE=[],tE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[null!=e.map?t("MapItemTooltip",{staticClass:"map-tooltip",attrs:{map:e.map,polygon:e.polygons[e.polygonHovered]}},[t("div",{staticClass:"text-left"},[t("ul",{staticClass:"map-tooltip-list"},[t("li",{staticClass:"map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.name)+" ")]),null!=e.polygonHoveredData.crop?t("li",{staticClass:"map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.crop)+" ")]):e._e(),null!=e.polygonHoveredData.size?t("li",{staticClass:"map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.size)+" ")]):e._e()])])]):e._e(),t("div",{ref:"map-container",staticClass:"map-container"})],1)},iE=[],aE=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showTooltip?t("div",{staticClass:"map-item-tooltip tooltip b-tooltip bs-tooltip-top",style:e.tooltipPosition},[t("div",{staticClass:"arrow",style:e.getArrowStyle}),t("div",{staticClass:"tooltip-inner",style:e.getStyle},[e._t("default")],2)]):e._e()},nE=[];const rE="googleMapsApiCallback";let sE,oE,lE=!!window.google;const dE=new Promise(((e,t)=>{sE=e,oE=t}));function cE(){if(lE)return dE;lE=!0,window[rE]=()=>sE(window.google);const e=document.createElement("script");e.async=!0,e.defer=!0;
1let t=`https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=geometry&callback=${rE}&loading=async`;return t+=`&key=${x}`,e.src=t,e.onerror=oE,document.querySelector("head").appendChild(e),dE}var uE,pE=(0,b.defineComponent)({name:"MapItemTooltip",props:{map:{type:Object,required:!0},marker:{type:Object,default:null},polygon:{type:Object,default:null},drawOnCenter:{type:Boolean,default:!1},drawOnMarker:{type:Boolean,default:!1},colorTheme:{type:String,default:"dark",validator:e=>["dark","light"].includes(e)}},computed:{showTooltip(){return null!=this.tooltipPosition},getStyle(){return{backgroundColor:"dark"===this.colorTheme?"var(--black)":"#fff",color:"dark"===this.colorTheme?"#fff":"#000",fontWeight:"dark"===this.colorTheme?400:600,padding:"dark"===this.colorTheme?".4rem .7rem":"0",lineHeight:1}},getArrowStyle(){return{"--arrow-color":"dark"===this.colorTheme?"var(--black)":"#fff"}}},data(){return{google:null,overlayView:null,tooltipPosition:null}},async created(){this.google=await cE(),this.google&&(this.overlayView=new this.google.maps.OverlayView,this.overlayView&&(this.overlayView.onAdd=()=>null,this.overlayView.draw=()=>{this.tooltipPosition=this.calcTooltipPosition()},this.overlayView.onRemove=()=>null,this.overlayView.setMap(this.map)))},beforeDestroy(){null!=this.overlayView&&this.overlayView.setMap(null)},methods:{calcTooltipPosition(){return null==this.google||null==this.overlayView||null==this.overlayView.getProjection()?null:null!=this.marker?this.getTooltipPositionForMarker(this.marker):null!=this.polygon?this.getTooltipPositionForPolygon(this.polygon):null},getTooltipPositionForMarker(e){const t=this.overlayView?.getProjection().fromLatLngToContainerPixel(e.getPosition()),i=t?.y??0,a=t?.x??0;return{top:`${this.drawOnMarker?i:i-50}px`,left:`${a}px`}},getTooltipPositionForPolygon(e){const t=new this.google.maps.LatLngBounds;e.getPath().getArray().forEach((e=>{t.extend(e)}));const i=this.drawOnCenter?new this.google.maps.LatLng(t.getCenter().lat(),t.getCenter().lng()):new this.google.maps.LatLng(t.getNorthEast().lat(),t.getCenter().lng()),a=this.overlayView?.getProjection().fromLatLngToContainerPixel(i);return{top:`${a?.y??0}px`,left:`${a?.x??0}px`}}}}),hE=pE,mE=(0,ew.Z)(hE,aE,nE,!1,null,"17b7997e",null),fE=mE.exports;(function(e){e["INACTIVE"]="inactive",e["ACTIVE"]="active"})(uE||(uE={}));let gE=null;var yE=(0,b.defineComponent)({name:"MapSelectFields",components:{MapItemTooltip:fE},model:{prop:"selectedFields",event:"update:selectedFields"},props:{fields:{type:Object,default:()=>{},required:!0},selectedFields:{type:Array,default:()=>[],required:!0},polygons:{type:Object,default:()=>{},required:!0},crops:{type:Object,required:!0},selectDisabled:{type:Boolean,default:!1}},data(){return{map:null,polygonHovered:null,googleMapsSettings:X}},watch:{fieldsSelected(e,t){this.fieldsSelectedOnUpdate(e,t),this.polygonsRedraw(),this.$emit("update:selectedFieldsData",this.selectedFieldsData)},polygons(){this.polygonsRedraw()}},computed:{fieldsSelected:{get(){return this.selectedFields},set(e){this.$emit("update:selectedFields",e)}},selectedFieldsData(){return Object.entries(this.fields).filter((([e])=>this.selectedFields.includes(e))).reduce(((e,[t,i])=>(e[t]=i,e)),{})},polygonHoveredData(){if(null==this.polygonHovered||null==this.polygons[this.polygonHovered])return{color:"",name:"",crop:"",size:""};const{crop:e,lineChartColor:t,name:i}=this.polygons[this.polygonHovered];let a="";e&&(a=this.crops[e]?.name??"");let{size:n}=this.polygons[this.polygonHovered];return null==n&&null!=gE&&(n=gE.maps.geometry.spherical.computeArea(this.polygons[this.polygonHovered].getPath())/1e4),n=this.$t("{size} ha",{size:Bl()(n).format()})||"",{color:t,name:i,crop:a,size:n}}},mounted(){this.initMap()},methods:{async initMap(){if(gE=await cE(),null==gE)return;const e={tilt:0,mapTypeId:gE.maps.MapTypeId.HYBRID,disableDefaultUI:!0,mapTypeControl:!0,mapTypeControlOptions:{style:gE.maps.MapTypeControlStyle.DROPDOWN_MENU,position:gE.maps.ControlPosition.RIGHT_TOP,mapTypeIds:[gE.maps.MapTypeId.SATELLITE,gE.maps.MapTypeId.ROADMAP,gE.maps.MapTypeId.HYBRID]},zoomControl:!0,zoomControlOptions:{position:gE.maps.ControlPosition.RIGHT_CENTER},fullscreenControl:!1,isFractionalZoomEnabled:!0,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]};this.map=new gE.maps.Map(this.$refs["map-container"],e),await this.initFields()},async initFields(){const e=new gE.maps.LatLngBounds;
1Object.keys(this.fields).forEach((t=>{const i=this.fields[t];if(null==i.fieldContour||null==i.fieldContour.geoJson||"Polygon"!==i.fieldContour.geoJson.type)return;const{geoJson:a}=i.fieldContour,n={name:rA.data.call(this,i),crop:i.cropId,size:i.fieldSize},{lat:r,lon:s}=i,o={lat:r,lon:s};if(null!=a){this.polygonAdd(t,o,a,n),this.polygonsRedraw();const i=a.coordinates[0];i.forEach((t=>e.extend({lng:t[0],lat:t[1]})))}})),Object.values(this.fields).length>0?this.mapFitBounds({bounds:e}):this.map&&this.map.setOptions(this.googleMapsSettings.GOOGLE_MAPS_DEFAULT_CENTER),this.fieldsSelectedOnUpdate(this.fieldsSelected,[]),this.polygonsRedraw()},mapFitBounds({bounds:e,maxZoom:t=16,usePan:i=!1}){this.map&&(gE.maps.event.addListenerOnce(this.map,"bounds_changed",(()=>{this.map?.setOptions({maxZoom:null})})),this.map.setOptions({maxZoom:t}),i?(this.map.setZoom(t),this.map.panToBounds(e,500)):this.map.fitBounds(e))},fieldsSelectedOnUpdate(e,t){const i=e.filter((e=>!t.includes(e)&&this.polygons[e])),a=t.filter((t=>!e.includes(t)&&this.polygons[t]));i.forEach((e=>{this.activatePolygon(e)})),a.forEach((e=>{this.deactivatePolygon(e)}))},polygonAdd(e,t,i,a){const n=new gE.maps.Polygon({...a,field_key:e,paths:i.coordinates[0].map((e=>({lng:e[0],lat:e[1]}))),strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeOpacity:1,strokeWeight:2,fillColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,state:uE.INACTIVE,lat:t.lat,lon:t.lon});[n.pathsForAxios]=i.coordinates,this.selectDisabled||gE.maps.event.addListener(n,"click",(()=>{const t=this.polygons[e].state;this.polygonSwitchState(e,t)})),gE.maps.event.addListener(n,"mouseover",(()=>{this.polygonHovered=e})),gE.maps.event.addListener(n,"mouseout",(()=>{this.polygonHovered===e&&(this.polygonHovered=null)})),this.$emit("addPolygon",n)},polygonsRedraw(){Object.values(this.polygons).forEach((e=>{const{state:t}=e;let i={};t===uE.ACTIVE?i={strokeColor:this.googleMapsSettings.POLYGON_ACTIVE_STROKE_COLOR,fillColor:this.googleMapsSettings.POLYGON_ACTIVE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1}:t===uE.INACTIVE&&(i={fillColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1}),e.setMap(this.map),e.setOptions(i),this.centerOnFields({fields:this.selectedFieldsData,usePan:!0})}))},activatePolygon(e){this.$emit("polygonSetState",{key:e,state:uE.ACTIVE})},deactivatePolygon(e){this.$emit("polygonSetState",{key:e,state:uE.INACTIVE})},addToSelected(e){this.fieldsSelected.includes(e)||(this.fieldsSelected=[...this.fieldsSelected,e])},removeFromSelected(e){this.fieldsSelected.includes(e)&&(this.fieldsSelected=this.fieldsSelected.filter((t=>t!==e)))},polygonSwitchState(e,t){t===uE.INACTIVE?this.addToSelected(e):this.removeFromSelected(e)},centerOnFields({fields:e,usePan:t=!1}){let i=!1;const a=new gE.maps.LatLngBounds;Object.values(e).forEach((e=>{null!=e.fieldContour&&null!=e.fieldContour.geoJson&&"Polygon"===e.fieldContour.geoJson.type?(i=!0,e.fieldContour.geoJson.coordinates.forEach((e=>{e.forEach((e=>{a.extend({lat:e[1],lng:e[0]})}))}))):null!=e.lat&&null!=e.lon&&(i=!0,a.extend({lat:e.lat,lng:e.lon}))})),i&&this.mapFitBounds({bounds:a,maxZoom:16,usePan:t})}}}),vE=yE,bE=(0,ew.Z)(vE,tE,iE,!1,null,"ae887c58",null),wE=bE.exports,CE=(0,b.defineComponent)({name:"MapContainer",components:{MapSelectFields:wE},created(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("products/crops/subscribe")},computed:{...(0,C.rn)("products/crops",{crops:"data"}),...(0,C.rn)({polygons(e){return e.activities.createEditActivity.polygons}}),...(0,C.Se)({fields:"fields"}),selectedFields:{get(){return this.$store.getters["activities/createEditActivity/selectedFields"]},set(e){this.$store.dispatch("activities/createEditActivity/updateActivitiesBasedOnSelectedFields",e)}},filteredFields(){if("editActivity"===this.workflowKey){const e=Object.keys(this.fields).filter((e=>this.selectedFields.includes(e))).reduce(((e,t)=>(e[t]=this.fields[t],e)),{});return e}return this.fields},workflowKey(){return this.$store.state.activities.createEditActivity.workflowKey}},methods:{addPolygon(e){this.$store.commit("activities/createEditActivity/addPolygon",e)},polygonSetState({key:e,state:t}){this.$store.commit("activities/createEditActivity/polygonSetState",{key:e,state:t})}}}),FE=CE,AE=(0,ew.Z)(FE,QS,eE,!1,null,null,null),kE=AE.exports,SE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("SecondStep",{attrs:{"selected-rows":e.selectedFields,customColumnDefinition:e.customColumnDefinition,customTableData:e.customTableData,sumProcessedArea:e.sumProcessedArea},on:{"update:selectedRows":e.updateSelectedFields,"update:cell":e.updateCell}})},EE=[],IE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"second-step-content-wrapper"},[t("SidebarFields",e._g(e._b({attrs:{tableId:"sidebar-fields-create-edit-activity",description:e.$t("Wähle die Felder in der Karte oder in der Liste."),customColumnDefinition:e.customColumnDefinition,customTableData:e.customTableData,sumProcessedArea:e.sumProcessedArea,allowFieldsWithNoContour:""}},"SidebarFields",e.$props,!1),e.$listeners))],1)},_E=[],DE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-fields bg-white border-dark",attrs:{id:"sidebar-fields"}},[t("div",{staticClass:"sidebar-fields__content-area"},[e.description?t("p",{staticClass:"sidebar-fields__description"},[e._v(e._s(e.description))]):t("SidebarHeadline",{attrs:{text:e.headlineLabel}}),t("SearchBar",{attrs:{type:"aside",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("CropFilters",{attrs:{fields:Object.values(e.fields),activeFilters:e.$refs.table?.$refs.table.filtersByColumnKey["cropId"]?.selectedValues?e.$refs.table.$refs.table.filtersByColumnKey["cropId"].selectedValues:[],"crops-by-id":e.crops},on:{"update:filter":t=>e.onFilterChange(t)}
1}),t("SidebarTableFieldsContainer",{ref:"table",attrs:{tableId:e.tableId,"allow-fields-with-no-contour":e.allowFieldsWithNoContour,"visible-rows":e.visibleRows,"filter-string":e.filterString,selectedRows:e.selectedRows,customColumnDefinition:e.customColumnDefinition,customTableData:e.customTableData,sumProcessedArea:e.sumProcessedArea},on:{"update:visibleRows":[function(t){e.visibleRows=t},t=>e.$emit("update:visibleRows",t)],"update:visible-rows":function(t){e.visibleRows=t},"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:cellReadOnly":e.updateCellReadOnly,showTableSettings:e.showTableSettings,"update:cell":e.updateCell}})],1),e.cellReadOnly?t("BTooltip",{attrs:{placement:"rightbottom",container:"sidebar-fields",target:e.cellReadOnly.target}},[e._v(" "+e._s(e.cellReadOnly.message)+" ")]):e._e(),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}})],1)},ME=[],PE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",staticClass:"modal-page-settings",attrs:{size:"lg",title:e.title,"ok-title":e.$t("Speichern")},on:{change:function(t){return e.$emit("close")},ok:function(t){return e.$emit("close")},cancel:function(t){return e.$emit("close")}}},[null!=e.columns?t("div",[t("p",{staticClass:"mt-3 mb-3"},[e._v(e._s(e.columnDescription))]),t("div",{staticClass:"m-3"},[e._l(e.columnsFixed,(function(i,a){return t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom.d500",modifiers:{hover:!0,bottom:!0,d500:!0}}],key:`${i.key??i.data} ${a}`,staticClass:"modal-page-settings__column",attrs:{title:e.columnTitle(i)}},[t("FontAwesomeIcon",{staticClass:"modal-page-settings__column-fixed-icon mr-2 text-medium",attrs:{icon:"grip-lines"}}),t("span",{staticClass:"modal-page-settings__column-label"},[e._v(" "+e._s(i.header.title())+" ")]),i.configurableDecimalPlaces?t("DecimalPlacesStepper",{staticClass:"modal-page-settings__column-decimals mr-3",model:{value:e.columnsFixed[a].decimalPlaces,callback:function(t){e.$set(e.columnsFixed[a],"decimalPlaces",t)},expression:"columnsFixed[index].decimalPlaces"}}):e._e(),t("FormCheckbox",{staticClass:"modal-page-settings__column-checkbox",attrs:{disabled:i.lockedVisibility},model:{value:e.columnsFixed[a].visible,callback:function(t){e.$set(e.columnsFixed[a],"visible",t)},expression:"columnsFixed[index].visible"}})],1)})),t("Draggable",{staticClass:"mb-2",model:{value:e.columnsMovable,callback:function(t){e.columnsMovable=t},expression:"columnsMovable"}},e._l(e.columnsMovable,(function(i,a){return t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom.d500",modifiers:{hover:!0,bottom:!0,d500:!0}}],key:`${i.key??i.data} ${a}`,staticClass:"modal-page-settings__column",attrs:{title:e.columnTitle(i)}},[t("FontAwesomeIcon",{staticClass:"modal-page-settings__column-fixed-icon mr-2",attrs:{icon:"grip-lines"}}),t("span",{staticClass:"modal-page-settings__column-label"},[e._v(" "+e._s(i.header.title())+" ")]),i.configurableDecimalPlaces?t("DecimalPlacesStepper",{staticClass:"modal-page-settings__column-decimals mr-3",model:{value:e.columnsMovable[a].decimalPlaces,callback:function(t){e.$set(e.columnsMovable[a],"decimalPlaces",t)},expression:"columnsMovable[index].decimalPlaces"}}):e._e(),t("FormCheckbox",{staticClass:"modal-page-settings__column-checkbox",attrs:{disabled:i.lockedVisibility},model:{value:e.columnsMovable[a].visible,callback:function(t){e.$set(e.columnsMovable[a],"visible",t)},expression:"columnsMovable[index].visible"}})],1)})),0)],2),t("div",{staticClass:"mb-3"},[t("BLink",{on:{click:e.columnsReset}},[e._v(" "+e._s(e.$t("Zurücksetzen"))+" ")])],1)]):e._e(),null!=e.pageSettings?t("div",[t("header",[t("h4",[e._v("Not implemented yet!")])])]):e._e()])},TE=[],xE=i(9980),BE=i.n(xE),OE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"decimal-places-stepper",on:{click:function(e){e.stopPropagation()}}},[t("button",{staticClass:"decimal-places-stepper__button",attrs:{type:"button",disabled:e.value<=e.min,"aria-label":e.$t("Weniger Dezimalstellen")},on:{click:e.decrement}},[t("FontAwesomeIcon",{attrs:{icon:"minus-circle"}})],1),t("span",{staticClass:"decimal-places-stepper__value"},[e._v(e._s(e.value))]),t("button",{staticClass:"decimal-places-stepper__button",attrs:{type:"button",disabled:e.value>=e.max,"aria-label":e.$t("Mehr Dezimalstellen")},on:{click:e.increment}},[t("FontAwesomeIcon",{attrs:{icon:"plus-circle"}})],1)])},$E=[];ow.vI.add(uw.uMC,uw.KtF);var RE=(0,b.defineComponent)({name:"DecimalPlacesStepper",props:{value:{type:Number,default:Du},min:{type:Number,default:Du},max:{type:Number,default:Mu}}
1,methods:{decrement(){this.value<=this.min||this.$emit("input",Pu(this.value-1))},increment(){this.value>=this.max||this.$emit("input",Pu(this.value+1))}}}),NE=RE,zE=(0,ew.Z)(NE,OE,$E,!1,null,"5c0608f0",null),LE=zE.exports;ow.vI.add(uw.hx$,uw.mTx,uw.ptq);var VE=(0,b.defineComponent)({name:"ModalPageSettings",components:{Draggable:BE(),ModalWrapper:OC,FormCheckbox:Gw,DecimalPlacesStepper:LE},props:{columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>!!e.hiddenInPageSettings||null!=e&&"number"===typeof e.physicalColumn&&"number"===typeof e.visualColumn&&(e.hiddenInPageSettings||null!=e.header&&"string"===typeof e.header.title())&&("string"===typeof e.key||"string"===typeof e.data)&&"boolean"===typeof e.fixed&&"boolean"===typeof e.visible))}},pageSettings:{type:Array,default:null}},data(){return{columnsFixed:null,columnsFixedHidden:null,columnsMovable:null,columnsMovableHidden:null}},computed:{title(){return null!=this.columns?this.$t("Spaltenreihenfolge ändern"):"PageSettings not implemented yet!"},columnDescription(){let e=this.$t("Deaktiviere das Kontrollkästchen um Spalten zu verstecken. Zum Ändern der Spaltenreihenfolge in der Tabelle klicke auf das Feld und ziehe es an die gewünschte Stelle.")??"";return null!=this.columns&&this.columns.some((e=>e.configurableDecimalPlaces))&&(e+=` ${this.$t("Ändere Dezimalstellen von Zahlen.")??""}`),e}},methods:{async show(){this.$nextTick(this.columnsInit);const e=await this.$refs.modalWrapper.show();if(!e)return null;if(!this.columnsFixed||!this.columnsFixedHidden||!this.columnsMovable||!this.columnsMovableHidden||!this.columns)return null;const t={columns:[...this.columnsFixedHidden,...this.columnsFixed,...this.columnsMovable,...this.columnsMovableHidden]};return t.columns=this.updateVisualColumnIndices(t.columns),t},columnsInit(){null!=this.columns&&(this.columnsInitFixed(),this.columnsInitMovable())},columnsInitFixed(){null!=this.columns&&(this.columnsFixed=this.columns.filter((e=>!e.hiddenInPageSettings&&e.fixed)).map((e=>({...e}))),this.columnsFixedHidden=this.columns.filter((e=>e.hiddenInPageSettings&&e.fixed)).map((e=>({...e}))))},columnsInitMovable(){null!=this.columns&&(this.columnsMovable=this.columns.filter((e=>!e.hiddenInPageSettings&&!e.fixed)).map((e=>({...e}))).sort(((e,t)=>e.visualColumn-t.visualColumn)),this.columnsMovableHidden=this.columns.filter((e=>e.hiddenInPageSettings&&!e.fixed)).map((e=>({...e}))).sort(((e,t)=>e.visualColumn-t.visualColumn)))},columnsReset(){null!=this.columns&&(this.columnsInitFixed(),this.columnsResetMovable())},columnsResetMovable(){null!=this.columns&&(this.columnsMovable=this.columns.filter((e=>!e.hiddenInPageSettings&&!e.fixed)).map((e=>({...e}))).sort(((e,t)=>e.physicalColumn-t.physicalColumn)),this.columnsMovableHidden=this.columns.filter((e=>e.hiddenInPageSettings&&!e.fixed)).map((e=>({...e}))).sort(((e,t)=>e.physicalColumn-t.physicalColumn)))},columnTitle(e){return e.fixed&&e.lockedVisibility?this.$t("Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert oder verschoben werden."):e.fixed?this.$t("Diese Eigenschaft kann nicht verschoben werden."):e.lockedVisibility?this.$t("Diese Eigenschaft ist ein Pflichtfeld und kann nicht deaktiviert werden."):""},updateVisualColumnIndices(e){return e.map(((e,t)=>({...e,visualColumn:t})))}},expose:["show"]}),UE=VE,jE=(0,ew.Z)(UE,PE,TE,!1,null,"0b7fd7a9",null),HE=jE.exports,GE=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("label",{staticClass:"search text-dark",class:[{"search--filled":e.searchFilter.length},`search--${e.type}`]},[t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport",value:{title:e.$t("Suchen")},expression:"{ title: $t('Suchen') }",modifiers:{hover:!0,viewport:!0}}],staticClass:"p-1"},[t("FontAwesomeIcon",{attrs:{icon:"search"}})],1),t("input",{staticClass:"bg-transparent border-0",attrs:{type:"search",placeholder:e.$t("Suchbegriff eingeben ...")},domProps:{value:e.searchFilter},on:{input:function(t){return e.$emit("update:searchFilter",t.target.value)},keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.target.blur(),e.$emit("update:searchFilter",t.target.value)}}})])},WE=[],ZE=(0,b.defineComponent)({__name:"SearchBar",props:{type:{default:""},searchFilter:{default:""}},setup(e){return ow.vI.add(lw.wn1),{__sfc:!0}}}),KE=ZE,qE=(0,ew.Z)(KE,GE,WE,!1,null,"42372802",null),YE=qE.exports,JE=function(){var e=this,t=e._self._c;return t("h2",{staticClass:"sidebar-headline"},[e._v(" "+e._s(e.text)+" ")])},XE=[],QE={name:"SidebarHeadline",props:{text:{type:String,required:!0}}},eI=QE,tI=(0,ew.Z)(eI,JE,XE,!1,null,"22a88371",null),iI=tI.exports,aI=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableBase",{ref:"table",staticClass:"hot-sidebar-fields",attrs:{id:e.tableId,"disable-read-only-bg":"","filter-string":e.filterString,"
1selected-rows":e.selectedRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.customTableDataOrDefault,"table-errors":e.tableErrors,cells:e.cells},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:cell":e.updateCell,reload:e.loadData,showTableSettings:function(t){return e.$emit("showTableSettings")},"update:tableSettings":e.onTableSettingsChanged},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.processedAreaOrFieldSizeTotal}))+" ")])]},proxy:!0}])})},nI=[];function rI(e){return{data(){return{columnSettingsMiddleware:[]}},created(){this.columnSettingsMiddleware.push(this.columnDropdownCompaniesColumnSettings)},methods:{columnDropdownCompaniesCells(t,i,a){if(null==this.tableSettings||null==this.tableSettings.columns||this.tableSettings.columns[i].key!==e)return a;const n=this.$refs.table.physicalRowToGuid(t);return null==this.tableData||null==this.tableData[n]||this.tableData[n].storeStatus!==N?a:{...a,readOnly:!1}},columnDropdownCompaniesColumnSettings(t){return t.map((t=>t.key!==e?t:{...t,getRendererValue:e=>this.columnDropdownCompaniesGetRendererValue(e),getItems:()=>this.columnDropdownCompaniesGetItems()}))},columnDropdownCompaniesGetRendererValue({value:e}){if(null==e)return"";let t="";return Object.values(this.$store.state.auth.companiesById).some((i=>i.id===e&&(t=i.abbreviation,!0))),t},async columnDropdownCompaniesGetItems(){return[{name:this.$t("Betriebe"),id:"companies",items:this.$store.state.auth.currentCompanies.map((e=>({id:e.id,name:e.abbreviation}))),sort:!0}]}}}}function sI(e){return{data(){return{columnSettingsMiddleware:[]}},computed:{...(0,C.Se)({customers:"customers",customersById:"customers/byId"})},created(){this.columnSettingsMiddleware.push(this.columnDropdownCustomersColumnSettings),this.addHotHook("afterSelection",this.columnDropdownCustomersAfterSelection)},methods:{columnDropdownCustomersColumnSettings(t){return t.map((t=>Object.keys(e).includes(t.key)?{...t,getRendererValue:(...i)=>this.columnDropdownCustomersGetRendererValue(e[t.key],...i),getItems:(...e)=>this.columnDropdownCustomersGetItems(...e)}:t))},columnDropdownCustomersGetRendererValue(e,{value:t,visualRow:i,guid:a}){if(!t||"object"===typeof t)return"";if(null!=this.customers[t]&&"string"===typeof this.customers[t].name)return this.customers[t].name;let n=a;return null==n&&(n=this.$refs.table.visualRowToGuid(i)),null!=n&&null!=this.tableData[n]&&null!=Ru(this.tableData[n],e)&&"string"===typeof Ru(this.tableData[n],e).name?Ru(this.tableData[n],e).name:this.$t("#FEHLER")},async columnDropdownCustomersGetItems(e){await this.$store.dispatch("customers/subscribe");const t=this.$refs.table.visualRowToGuid(e),i=this.tableData[t]?.fieldGroup?.companyId,a=i?Object.values(this.customers).filter((e=>e.companyId===i)):Object.values(this.customers);return[{name:this.$t("Kunden"),id:"customers",items:a,sort:!0}]},columnDropdownCustomersAfterSelection(t,i){const a=this.hot.toPhysicalColumn(i);Object.keys(e).includes(this.tableSettings.columns[a].key)&&this.$store.dispatch("customers/subscribe")}}}}var oI={computed:{sizeTotal(){let e=0;return null!=this.selectedRows&&this.selectedRows.length>0?this.selectedRows.filter((e=>null!=this.tableData[e])).forEach((t=>{e=this.calculateSizeTotalAddFieldSize(e,this.tableData[t])})):this.visibleRows.length<Object.keys(this.tableData).length?this.visibleRows.filter((e=>null!=this.tableData[e])).forEach((t=>{e=this.calculateSizeTotalAddFieldSize(e,this.tableData[t])})):Object.values(this.tableData).forEach((t=>{e=this.calculateSizeTotalAddFieldSize(e,t)})),e},sizeTotalFormatted(){return Bl()(this.sizeTotal).format()}},methods:{calculateSizeTotalAddFieldSize(e,t){const i=Number(t.fieldSize);return Number.isNaN(i)?e:e+i}}},lI={computed:{...(0,C.Se)({crops:"products/crops",cropsUsed:"products/crops/used"}),cropsToDropdownItems(){if(0===this.$store.state.auth.currentCompanies.length)return[];const e=this.$store.state.auth.currentCompanies.length>1,t=this.$store.state.auth.currentCompanies[0].id,i=Object.values(this.crops).filter((i=>!this.cropsUsed.includes(i.id)&&(!e||(null==i.companyId||i.companyId===t&&null!=i.relatedMaterialId))));return[{name:this.$t("Zuletzt verwendet"),id:"crops-used",items:this.cropsUsed.filter((e=>null!=this.crops[e])).map((e=>({id:e,name:this.crops[e].name}))),sort:!1},{name:this.$t("Kulturen"),id:"crops",items:i.map((e=>({id:e.id,name:e.name}))),sort:!0}]}}};function dI(e={}){return{data(){return{columnSettingsMiddleware:[]}},computed:{...(0,C.Se)({crops:"products/crops",cropsUsed:"products/crops/used"}),...lI.computed},created(){this.columnSettingsMiddleware.push(this.columnDropdownCropsColumnSettings),this.addHotHook("afterOnCellMouseOver",this.columnDropdownCropsAfterOnCellMouseOver),this.addHotHook("afterChange",this.columnDropdownCropsAfterChange)},methods:{columnDropdownCropsColumnSettings(t){return t.map((t=>Object.keys(e).includes(t.key)?{...t,getRendererValue:(...i)=>this.columnDropdownCropsGetRendererValue(e[t.key],...i),getItems:(...e)=>this.columnDropdownCropsGetItems(...e)}:t))},columnDropdownCropsGetRendererValue(e,{value:t,visualRow:i,guid:a}){let n=a;null==n&&(n=this.$refs.table.visualRowToGuid(i));let r="";return null!=this.crops[t]&&"string"===typeof this.crops[t].name?r=this.crops[t].name:null!=n&&null!=this.tableData[n]&&null!=Ru(this.tableData[n],e)&&"string"===typeof Ru(this.tableData[n],e).name&&(r=Ru(this.tableData[n],e).name),r},async columnDropdownCropsGetItems(){return await this.$store.dispatch("products/crops/subscribe"),this.cropsToDropdownItems},columnDropdownCropsAfterOnCellMouseOver(t,i){const a=this.hot.toPhysicalColumn(i.col);Object.keys(e).includes(this.tableSettings.columns[a].key)&&this.$store.dispatch("products/crops/subscribe")},columnDropdownCropsAfterChange(t,i){["edit","CopyPaste.paste"].includes(i)&&Array.isArray(t)&&t.forEach((([,t,,i])=>{const a=this.hot.propToCol(t);Object.keys(e).includes(this.tableSettings.columns[a].key)&&null!=this.crops[i]&&this.$store.commit("products/crops/useItem",i)}))}}}}var cI=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-base",on:{drag:function(e){e.preventDefault()},dragstart:function(e){e.preventDefault()},dragend:function(t){return t.preventDefault(),e.$emit("update:isDragover",!1)},dragover:function(t){return t.preventDefault(),e.$emit("update:isDragover",!0)},dragenter:function(t){return t.preventDefault(),e.$emit("update:isDragover",!0)},dragleave:function(t){return t.preventDefault(),e.$emit("update:isDragover",!1)},drop:function(t){return t.preventDefault(),(t=>e.$emit("drop",t)).apply(null,arguments)}}},[e.loading?t("TableLoading",{staticClass:"flex-grow-1",attrs:{columns:e.tableSettingsComputed.columns}}):e.fetchingError?t("FetchingError",{on:{reload:function(t){return e.$emit("reload")}}}):e.noContent?t("div",{staticClass:"table-base__no-content"},[e._t("no-content")],2):t("div",{staticClass:"table-base__table-container"},[t("HotWrapper",{ref:"table",class:{"handsontable--read-only-default-bg":e.disableReadOnlyBg,"handsontable--invert-selection-background":e.invertSelectionBg,[e.innerClass]:!0},attrs:{id:e.id,"table-settings":e.tableSettingsForHot},on:{"hook:mounted":e.tableMounted,"hook:beforeDestroy":e.tableDestroyed}}),e.hoverButtons&&e.contextMenu&&!e.loading?t("TableRowHoverButtons",{ref:"tableRowHoverButtons",attrs:{target:e.featureRowHoverTarget,"no-main-button":e.hoverButtonsNoMainButton,"main-button-icon":e.hoverButtonsMainButtonIcon,"main-button-title":e.hoverButtonsMainButtonTitle,"read-only":e.readOnly},on:{mainButton:function(t){return e.$emit("rowHoverMainButton",[e.featureRowHoverGuid])},contextmenu:t=>e.featureTableContextMenuShow(t,e.featureRowHoverGuid)}}
1):e._e(),e.contextMenu&&!e.loading?t("TableContextMenu",{ref:"tableContextMenu",attrs:{boundary:e.$el,"hide-edit":e.contextMenuHideEdit,"hide-insert":e.contextMenuHideInsert},on:{insert:function(t){return e.insert({guid:e.featureTableContextMenuGuid})},edit:function(t){return e.$emit("edit",[e.featureTableContextMenuGuid])},remove:function(t){return e.$emit("remove:row",e.tableDataComputed[e.featureTableContextMenuGuid])}}},[e._t("context-menu")],2):e._e(),t("TooltipCellError",{attrs:{"cell-error":e.cellError}}),t("TooltipRowError",{attrs:{"row-error":e.rowError}}),t("TooltipTableHeader",{attrs:{"table-header-tooltips":e.tableHeaderTooltips}}),t("TableHeaderContextMenu",{attrs:{target:e.tableHeaderContextMenuTarget,filter:e.tableHeaderContextMenuFilter,"available-values":e.tableHeaderContextMenuAvailableValues},on:{close:e.tableHeaderContextMenuClose,sort:e.tableHeaderContextMenuSort,"update:filter":e.tableHeaderContextMenuUpdateFilter}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.fetchingError&&!e.noContent,expression:"!fetchingError && !noContent"}]},[e._t("footer")],2),e.noSearchResults?t("div",{staticClass:"table-base__no-search-results"},[e._t("no-search-results")],2):e._e()],1)},uI=[],pI={mounted(){this.addHotHook("afterRenderer",this.featureDeletableTableDataAfterRenderer)},methods:{featureDeletableTableDataAfterRenderer(e,t,i,a,n,r){if(null!=r&&"loading"===r.renderer)return;const s=this.visualRowToGuid(t);if(null==this.tableData[s])return;const{storeStatus:o}=this.tableData[s];o===K&&e.classList.add("recently-restored")}}};const hI={key:R,type:"text",hiddenPerDefault:!0,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},mI={type:"text",width:190,readOnly:!0,key:"__placeholder",data:()=>null,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0,noHeaderContextMenu:!0};var fI={props:{tableSettings:{type:Object,default:null},tableData:{type:Object,default:null},loading:{type:Boolean,default:!1},tableErrors:{type:Array,default:null},cells:{type:Function,default:(e,t,i)=>i},readOnly:{type:Boolean,default:!1}},data(){return{hot:null,hotHooks:[],tableDataInternal:{},tablePhysicalRowByGuid:{},tableGuidByPhysicalRow:[],decimalPlacesByColumnKey:{},tableHooks:{setData:[],property:[],cells:[],staticHeight:[],comparator:[gF],colHeaders:[]},tableSettingsInternal:{selectionMode:"single",persistentState:!0,manualColumnResize:!0,manualColumnMove:!0,hiddenColumns:{indicators:!1},columnSorting:{indicator:!0,sortEmptyCells:!0,headerAction:!0,compareFunctionFactory:this.compareFunctionFactory},licenseKey:B,rowHeights:40,outsideClickDeselects:!0,stretchH:"last",cells:(...e)=>this.cellsInternal(...e),colHeaders:(...e)=>this.colHeaders(...e),afterGetColHeader:(...e)=>this.afterGetColHeader(...e),afterColumnResize:(...e)=>this.afterColumnResize(...e),beforeColumnMove:(...e)=>this.beforeColumnMove(...e),afterColumnMove:(...e)=>this.afterColumnMove(...e),columns:[]},tableSettingsForHot:{},tableErrorsInternal:[]}},computed:{noContent(){return!this.loading&&!this.fetchingError&&0===Object.keys(this.tableDataComputed).length&&null!=this.$slots["no-content"]},noSearchResults(){return!this.loading&&!this.fetchingError&&!this.noContent&&Object.keys(this.tableDataComputed).length>0&&null!=this.$slots["no-search-results"]&&0===this.visibleRows.length},fetchingError(){return 0!==this.tableErrorsComputed.length&&this.tableErrorsComputed.some((e=>e.type===q))},tableSettingsComputed(){const e=D()({},this.tableSettingsInternal,this.tableSettings);return e.columns=e.columns.map(this.setupColumn),e},tableDataComputed(){return null!=this.tableData?this.tableData:this.tableDataInternal},tableErrorsComputed(){return Array.isArray(this.tableErrors)?this.tableErrors:this.tableErrorsInternal}},created(){this.tableSettingsForHot=this.tableSettingsComputed},mounted(){"1"==={VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"}.VUE_APP_EXPOSE&&(window.FARMDOK.tables[this.id]=this),this.addHotHook("afterScrollVertically",(()=>this.$emit("afterScrollVertically"))),this.addHotHook("afterScrollHorizontally",(()=>this.$emit("afterScrollHorizontally"))),this.addHotHook("afterLoadData",this.restoreFromPersistentState)},beforeDestroy(){delete window.FARMDOK.tables[this.id]},methods:{addHotHook(e,t){this.hotHooks.push({key:e,callback:t})},async tableMounted(){await this.$nextTick(),null!=this.$refs.table&&null!=this.$refs.table.hotInstance?this.hot=this.$refs.table.hotInstance:null!=this.$refs.table&&Array.isArray(this.$refs.table.$children)&&1===this.$refs.table.$children.length&&null!=this.$refs.table.$children[0]&&null!=this.$refs.table.$children[0].hotInstance&&(this.hot=this.$refs.table.$children[0].hotInstance),null!=this.hot&&(this.hotHooks.forEach((({key:e,callback:t})=>this.hot.addHook(e,t))),await this.$nextTick(),this.$emit("tableMounted"),this.setData())},tableDestroyed(){this.hot=null},setupColumn(e){const t={...e};if(Object.keys(t).forEach((i=>{"function"===typeof e[i]&&(t[i]=(...t)=>e[i].call(this,...t))})),null==e.data&&(t.data=(...t)=>this.property(e.key)(...t)),e.configurableDecimalPlaces){const i=this.decimalPlacesByColumnKey[e.key];t.decimalPlaces=null!=i?i:e.decimalPlaces}return t.columnSorting={compareFunctionFactory:e=>this.compareFunctionFactory(e,t)},this.readOnly&&e.key!==oA.key&&(t.readOnly=!0),t},restoreFromPersistentState(){if(null==this.hot||this.hot.isDestroyed)return;const e={};this.hot.getPlugin("persistentState").loadValue("decimalPlaces",e),null!=e.value&&"object"===typeof e.value&&(this.decimalPlacesByColumnKey=e.value,this.hot.updateSettings({columns:this.tableSettingsComputed.columns}));const t={};if(this.hot.getPlugin("persistentState").loadValue("manualColumnMove",t),Array.isArray(t.value)){let e=0,i=t.value.length;"number"===typeof this.tableSettings.fixedColumnsLeft&&(e=this.tableSettings.fixedColumnsLeft),this.tableSettingsComputed.columns[this.tableSettingsComputed.columns.length-1].key===mI.key&&(i-=1);const a=t.value.slice(e,i);this.hot.getPlugin("manualColumnMove").moveColumns(a,e)}const i={indicators:!1,columns:[]},a={};this.hot.getPlugin("persistentState").loadValue("hiddenColumns",a),Array.isArray(a.value)?i.columns=a.value:null!=this.tableSettingsComputed.hiddenColumns&&Array.isArray(this.tableSettingsComputed.hiddenColumns.columns)&&(i.columns=this.tableSettingsComputed.hiddenColumns.columns),this.hot.updateSettings({hiddenColumns:i}),this.$nextTick(this.restoreSortFromPersistentState)},restoreSortFromPersistentState(){if(null==this.hot)return;let e;const t={};this.hot.getPlugin("persistentState").loadValue("columnSorting",t),null!=t.value?e=t.value.initialConfig:null!=this.tableSettingsComputed.columnSorting&&null!=this.tableSettingsComputed.columnSorting.initialConfig&&(e=this.tableSettingsComputed.columnSorting.initialConfig),this.hot.getPlugin("c
1olumnSorting").sort(e)},async setData(){this.tableSettingsForHot=this.tableSettingsComputed,await this.$nextTick(),this.tablePhysicalRowByGuid={},this.tableGuidByPhysicalRow=[];const e=Object.values(this.tableDataComputed).filter((e=>e.storeStatus!==N&&e.storeStatus!==Z));e.forEach(((e,t)=>{const i=e[R];this.tablePhysicalRowByGuid[i]=t,this.tableGuidByPhysicalRow[t]=i})),this.tableHooks.setData.forEach((e=>e())),this.hot.loadData(e)},hotRender(){null!=this.hot&&this.hot.render()},property(e){return t=>{if(null==t)return null;const i=this.tableHooks.property.reduce(((i,a)=>a(t,e,i)),null);return null!=i?i:null!=t[R]&&null!=this.tableDataComputed[t[R]]?Ru(this.tableDataComputed[t[R]],e):Ru(t,e)}},visualRowToGuid(e){if(null==this.hot)return null;const t=this.hot.toPhysicalRow(e);return this.physicalRowToGuid(t)},physicalRowToGuid(e){return this.tableGuidByPhysicalRow[e]},guidToPhysicalRow(e){return this.tablePhysicalRowByGuid[e]},guidToVisualRow(e){if(null==this.hot)return null;const t=this.guidToPhysicalRow(e);return this.hot.toVisualRow(t)},getColumnByKey(e){const t=this.getPhysicalColByKey(e);return null==t?null:this.tableSettingsComputed.columns[t]},getPhysicalColByKey(e){let t=null;return this.tableSettingsComputed.columns.some(((i,a)=>i.key===e&&(t=a,!0))),t},cellsInternal(e,t){let i={};return null==this.tableSettingsComputed.columns||null==this.tableSettingsComputed.columns[t]||(i.readOnly=this.tableSettingsComputed.columns[t].readOnly,i.renderer=this.tableSettingsComputed.columns[t].renderer,i.getDisplayValue=e=>{const i=this.tableSettingsComputed.columns[t];return null==i?"":zu({[i.key]:e},i)},i=this.tableHooks.cells.reduce(((i,a)=>a(e,t,i)),i),i=this.cells(e,t,i)),i},colHeaders(e){const t=this.tableSettingsComputed.columns[e];if(null==t)return"";const i=this.tableHooks.colHeaders.reduce(((e,i)=>i(t,e)),null);return null!=i?i:null!=t.header&&"string"===typeof t.header.title()?`<span class="colHeaderInner">${t.header.title()}</span>`:""},afterGetColHeader(e,t){if(null==this.hot)return;const i=this.hot.toPhysicalColumn(e),a=this.tableSettingsComputed.columns[i];null!=a&&"checkbox"===a.type&&t.classList.add("checkbox")},compareFunctionFactory(e,t){let i=1;return"desc"===e&&(i=-1),(e,a)=>{let n=e,r=a;if(null!=t&&["dropdown","fieldStatus","fieldGroupArchived","sharedFieldInfo"].includes(t.type)&&(n=zu({[t.key]:e},t),r=zu({[t.key]:a},t)),null!=t&&["subtable"].includes(t.type)){const{0:t}=e,{0:i}=a;n=t,r=i}return this.tableHooks.comparator.reduce(((e,t)=>t(n,r,i,e)),0)}},afterColumnResize(e,t){const i=this.hot.toPhysicalColumn(t);let a=70;"checkbox"===this.tableSettingsComputed.columns[i].type?a=40:this.tableSettingsComputed.columns[i].key===mI.key&&(a=mI.width),e<a&&(this.hot.getPlugin("manualColumnResize").setManualSize(t,a),this.hotRender())},beforeColumnMove(e,t){return!this.hot||("number"!==typeof this.tableSettings.fixedColumnsLeft||!e.some((e=>{if(e<this.tableSettings.fixedColumnsLeft)return!0;const t=this.hot.toPhysicalColumn(e);return null==this.tableSettingsComputed.columns||null==this.tableSettingsComputed.columns[t]||this.tableSettingsComputed.columns[t].key===mI.key}))&&t>=this.tableSettings.fixedColumnsLeft)},afterColumnMove(e,t,i,a,n){null!=i&&n&&this.updatePersistentState()},getColumnsForPageSettings(){let e=null;return null!=this.hot&&(e=this.hot.getPlugin("hiddenColumns").getHiddenColumns().map((e=>this.hot.toPhysicalColumn(e)))),this.tableSettingsComputed.columns.map(((t,i)=>({...t,physicalColumn:i,visualColumn:null!=this.hot?this.hot.toVisualColumn(i):i,fixed:i<this.tableSettings.fixedColumnsLeft,visible:null!=this.hot?!e.includes(i):!t.hiddenPerDefault}))).sort(((e,t)=>e.visualColumn-t.visualColumn))},getVisibleColumns(){return this.getColumnsForPageSettings().filter((e=>e.visible))},updateColumnsFromPageSettings(e){this.decimalPlacesByColumnKey=e.reduce(((e,t)=>(t.configurableDecimalPlaces&&"number"===typeof t.decimalPlaces&&(e[t.key]=t.decimalPlaces),e)),{}),this.hot.updateSettings({columns:this.tableSettingsComputed.columns});const t=e.filter((e=>!e.fixed&&!e.hiddenInPageSettings)).map((e=>this.hot.toVisualColumn(e.physicalColumn)));this.hot.getPlugin("manualColumnMove").moveColumns(t,this.tableSettings.fixedColumnsLeft),this.hot.updateSettings({hiddenColumns:{indicators:!1,columns:e.filter((e=>!e.visible)).map((e=>this.hot.toVisualColumn(e.physicalColumn)))}}),this.hotRender(),this.updatePersistentState(),this.$emit("update:tableSettings")},updatePersistentState(){this.hot.getPlugin("persistentState").saveValue("manualColumnMove",this.tableSettingsComputed.columns.map(((e,t)=>this.hot.toPhysicalColumn(t)))),this.hot.getPlugin("persistentState").saveValue("hiddenColumns",this.hot.getPlugin("hiddenColumns").getHiddenColumns()),this.hot.getPlugin("persistentState").saveValue("decimalPlaces",this.decimalPlacesByColumnKey)},validatePersistentState(){if(!Array.isArray(this.tableSettingsComputed.columns)||0===this.tableSettingsComputed.columns.length)return;const e=this.tableSettingsComputed.columns.reduce(((e,t)=>`${e}${t.key}`),""),t=localStorage.getItem(`${this.id}_checkSum`);e!==t&&(localStorage.removeItem(`${this.id}_manualColumnMove`),localStorage.removeItem(`${this.id}_hiddenColumns`),localStorage.removeItem(`${this.id}_columnSorting`),localStorage.removeItem(`${this.id}_decimalPlaces`),localStorage.removeItem(`${this.id}__persistentStateKeys`),localStorage.setItem(`${this.id}_checkSum`,e))}},watch:{tableSettingsComputed(){this.validatePersistentState()},tableErrorsComputed(){this.hotRender()},tableDataComputed(){this.hotRender()}}},gI={data(){return{cellError:null,rowError:null}},mounted(){this.addHotHook("afterRenderer",this.featureEditableTableDataAfterRenderer),this.addHotHook("beforeOnCellMouseOver",this.featureEditableTableDataBeforeOnCellMouseOver),this.addHotHook("afterChange",this.featureEditableTableDataAfterChange),this.tableHooks.cells.push(this.featureEditableTableDataCells)},methods:{property(e){return(t,i)=>{if("undefined"===typeof i)return fI.methods.property.call(this,e)(t);if(e===R)return null==t[R]&&(t[R]=i),null;const a=t[R];this.$emit("update:cell",{guid:a,columnKey:e,value:i});const n={...this.tableData,[a]:{...this.tableData[a]}};return Nu(n[a],e,i),this.$emit("update:tableData",n),null}},featureEditableTableDataCells(e,t,i){const a=this.physicalRowToGuid(e),n=this.tableSettingsComputed.columns[t],r=this.tableErrorsComputed.some((e=>e.guid===a&&e.key===n.key));
1return!r||["checkbox"].includes(n.type)||i.readOnly?i:{...i,renderer:"error"}},featureEditableTableDataAfterRenderer(e,t,i){const a=this.visualRowToGuid(t),n=this.hot.toPhysicalColumn(i);if(null==this.tableData[a])return;const{storeStatus:r}=this.tableData[a];r===j?e.classList.add("updating"):r===U?e.classList.add("dirty"):r===H&&e.classList.add("error"),this.tableErrorsComputed.some((e=>e.type===J&&e.guid===a&&(null==e.key||e.key===this.tableSettingsComputed.columns[n].key)))&&e.classList.add("error")},featureEditableTableDataBeforeOnCellMouseOver(e,{row:t,col:i},a){this.cellError=null,this.rowError=null;const n=this.visualRowToGuid(t),r=this.hot.toPhysicalColumn(i);if(null==this.tableData[n])return;const s=this.tableErrorsComputed.some((e=>e.guid===n&&e.key===this.tableSettingsComputed.columns[r].key&&(this.$nextTick((()=>{this.cellError={target:a,errorUserMessage:e.errorUserMessage}})),!0)));s||this.tableErrorsComputed.some((e=>e.guid===n&&null==e.key&&(this.$nextTick((()=>{this.rowError={target:a,errorUserMessage:e.errorUserMessage}})),!0)))},featureEditableTableDataAfterChange(e,t){if("edit"!==t||!Array.isArray(e))return;const[i,a]=e[0],n=this.hot.propToCol(a);this.$nextTick((()=>{this.hot.selectCell(i,n)}))}}};ow.vI.add(uw.mTx,uw.ptq);const yI={type:"expand",className:"expand border-right-0",width:45,key:"__expand",data({id:e},t){return"undefined"===typeof t?this.expandedRowsComputed.includes(e):this.updateExpansion(e,t)},expandableForRenderer(e){return this.isRowExpandable(this.visualRowToGuid(e))},toggleExpand(e){this.toggleExpand(e)},hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0,noHeaderContextMenu:!0};var vI={props:{expandedRows:{type:Array,default:null}},data(){return{expandedRowsInternal:[]}},computed:{expandedRowsComputed:{get(){return Array.isArray(this.expandedRows)?this.expandedRows:this.expandedRowsInternal},set(e){this.expandedRowsInternal=e,this.$emit("update:expandedRows",e)}}},watch:{expandedRowsComputed(){this.hotRender()}},created(){this.tableHooks.colHeaders.push(this.expandableRowsColHeaders)},mounted(){this.$el.addEventListener("click",(e=>(null!=e.target&&null!=e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("header-checkbox--expand-rows")>-1&&this.toggleAllRowsExpanded(),!0)))},methods:{updateExpansion(e,t){if(!this.isRowExpandable(e))return;const i=this.expandedRowsComputed.includes(e);t!==i&&(this.expandedRowsComputed=t?[...this.expandedRowsComputed,e]:this.expandedRowsComputed.filter((t=>t!==e)))},toggleAllRowsExpanded(){if(null==this.hot)return;const e=this.getExpandableRows();this.expandedRowsComputed.length>0?this.expandedRowsComputed=[]:this.expandedRowsComputed=e},expandableRowsColHeaders(e,t){if(null==this.hot||e.key!==yI.key)return t;const i=this.getExpandableRows();if(0===i.length)return null;const a=document.createElement("div");let[n]=(0,ow.qv)({prefix:"fas",iconName:"chevron-down"}).node;return this.expandedRowsComputed.length>0&&([n]=(0,ow.qv)({prefix:"fas",iconName:"chevron-up"}).node),a.classList.add("text-black"),a.classList.add("header-checkbox--expand-rows"),n.style.pointerEvents="none",a.appendChild(n),a.outerHTML},isRowExpandable(e){return!!Array.isArray(this.tableSettingsComputed.columns)&&this.tableSettingsComputed.columns.some((t=>!0===t.expandable||"function"===typeof t.expandable&&t.expandable(e)))},getExpandableRows(){if(!Array.isArray(this.tableSettingsComputed.columns))return[];const e=this.tableSettingsComputed.columns.filter((e=>null!=e.expandable));return[...new Array(this.hot.countRows()).keys()].map((e=>this.visualRowToGuid(e))).filter((t=>e.some((e=>!0===e.expandable||"function"===typeof e.expandable&&e.expandable(t)))))},toggleExpand(e){const t=this.visualRowToGuid(e);if(!t)return;const i=this.expandedRowsComputed.includes(t);this.updateExpansion(t,!i)}}},bI={methods:{export(e){const t=document.createElement("input");t.type="hidden",t.name="data",t.value=this.exportBuildJson(e);const i=document.createElement("form");i.method="POST",i.action="/admin/reports/generate/xls",i.target="_blank",i.appendChild(t),document.body.appendChild(i),i.submit(),document.body.removeChild(i)},exportBuildJson(e){const t=[{bold:!0},{fontSize:10},{format:"default"},{format:"numeric"},{format:"datetime"}],i=[],a=[],n=[],r=[];this.tableSettingsComputed.columns.forEach(((t,s)=>{if(t.key===oA.key||t.key===mI.key||this.hot.getPlugin("hiddenColumns").isHidden(s))return;const o=this.hot.toVisualColumn(s);r.push(this.hot.getColWidth(o)),a.push("function"===typeof t.header.title?t.header.title():""),n.push("function"===typeof t.header.description?t.header.description():"");const l=[0,1];let d=2;"numeric"===t.type?d=3:["date","datetime"].includes(t.type)&&(d=4),e.forEach((()=>{l.push(d)})),i.push(l)}));const s=[];
1s.push(a),s.push(n),e.forEach((e=>{const t=[];this.tableSettingsComputed.columns.forEach(((i,a)=>{i.key===oA.key||i.key===mI.key||this.hot.getPlugin("hiddenColumns").isHidden(a)||t.push(zu(this.tableData[e],i))})),s.push(t)}));const o=[{sheetSettings:{},sheetName:"Sheet 1",metadata:{cells:i,lut:t},data:s,columnWidths:r,rowHeights:[],images:[]}];return JSON.stringify(o)}}};function wI(e,t,i){const a=String(e).toLowerCase(),n=String(t).toLowerCase();return"contains"===i?a.includes(n):"not"===i?!a.includes(n):"equals"===i?a===n:"greater"===i?Nl.unformat(a)>parseFloat(n):"less"===i?Nl.unformat(a)<parseFloat(n):a.includes(n)}function CI(e="",t=[],i=[],a=null){if(0===e.length&&(null==a||0===Object.keys(a).length))return[];const n=[];return t.forEach(((t,r)=>{let s=i.some((i=>{const a=zu(t,i);return 0!==a.length&&(Array.isArray(a)?a.some((t=>t.toLowerCase().includes(e.toLowerCase()))):a.toLowerCase().includes(e.toLowerCase()))}));s?null!=a&&0!==Object.keys(a).length&&(s=i.every((e=>{const i=Lu(e);if(null==a[i])return!0;const n=zu(t,e);return Array.isArray(a[i].selectedValues)?Array.isArray(n)?n.some((e=>a[i].selectedValues.includes(e))):a[i].selectedValues.includes(n):"string"!==typeof a[i].value||0===a[i].value.length||wI(n,a[i].value,a[i].type)})),s||n.push({entry:t,index:r})):n.push({entry:t,index:r})})),n}var FI={props:{filterString:{type:String,default:""},visibleRows:{type:Array,default:()=>[]}},data(){return{tableSettingsInternal:{trimRows:!0},filterStringInternal:"",filtersByColumnKey:{}}},computed:{filterStringComputed(){return"string"===typeof this.filterString&&this.filterString.length>0?this.filterString:this.filterStringInternal},filterActive(){return"string"===typeof this.filterStringComputed&&this.filterStringComputed.length>0||Object.keys(this.filtersByColumnKey).length>0}},watch:{filterStringComputed(){null!=this.hot&&(this.$emit("update:filterString",this.filterStringComputed),this.filterTable())},filterActive(){this.updateFilterBar()},tablePhysicalRowByGuid(){this.filterTable()}},created(){this.tableHooks.setData.push((()=>{this.$emit("update:visibleRows",[...this.tableGuidByPhysicalRow]),this.filtersByColumnKey={},this.$nextTick(this.filterTable),this.updateFilterBar()}))},mounted(){this.$nextTick(this.filterTable)},methods:{updateFilterBar(){const e=this.$el.querySelector(".ht_master .wtHolder"),t=this.$el.querySelector(".ht_clone_left .wtHolder");if(null!=e&&null!=t)if(this.filterActive){const i=this.filterTableGetNewBar("999");e.prepend(i),this.$el.querySelector(".ht_master .filter-table__filter-bar-link").addEventListener("click",(e=>{e.preventDefault(),this.clearAllFilters()}));const a=this.filterTableGetNewBar("99");t.prepend(a)}else this.$el.querySelectorAll(".filter-table__filter-bar").forEach((e=>{e.parentNode.removeChild(e)}))},clearAllFilters(){this.$el.querySelectorAll(".table-header-context-menu__icon--filtered").forEach((e=>{e.classList.remove("table-header-context-menu__icon--filtered")})),this.$emit("update:filterString",""),this.filtersByColumnKey={},this.filterTable()},setColumnFilter(e,t){null==e?b["default"]["delete"](this.filtersByColumnKey,t):b["default"].set(this.filtersByColumnKey,t,e),this.filterTable()},filterTable:UA()((function(){if(null==this.hot)return;const e=this.hot.getPlugin("trimRows");if(e.untrimAll(),!this.filterActive)return this.$emit("update:visibleRows",this.tableGuidByPhysicalRow),void this.hotRender();const t=CI(this.filterStringComputed,Object.values(this.tableDataComputed),this.tableSettingsComputed.columns,this.filtersByColumnKey).map((({entry:e})=>this.guidToPhysicalRow(e[R])));e.trimRows(t),this.$emit("update:visibleRows",this.tableGuidByPhysicalRow.filter(((e,i)=>!t.includes(i)))),this.hotRender()}),300),filterTableGetNewBar(e){let t=0;const i=this.$el.querySelector(".ht_master .htCore thead");null!=i&&(t=i.getBoundingClientRect().height);const a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.position="sticky",a.style.top=`${t}px`,a.style.left="0px",a.style.right="0px",a.style.padding="var(--spacer_2)",a.style.zIndex=e,a.style.fontSize="12px",a.className="filter-table__filter-bar bg-secondary text-white";const n=this.$t("Filter aktiviert - {linkStart}Filter deaktivieren{linkEnd} um alle Einträge anzuzeigen.",{linkStart:"#####",linkEnd:"#####"}).split("#####"),r=document.createElement("span");r.innerText+=n[0];const s=document.createElement("a");return s.innerHTML=n[1],s.href="#",s.style.textDecoration="underline",s.className="filter-table__filter-bar-link text-white",r.appendChild(s),r.innerHTML+=n[2],r.style.whiteSpace="nowrap",r.style.overflow="hidden",a.appendChild(r),a}
1}},AI={data(){return{featureHighlightedFixedColumnsScrolled:!1}},mounted(){this.addHotHook("afterScrollHorizontally",Xl()(this.featureHighlightedFixedColumnsAfterScrollHorizontally,100))},methods:{featureHighlightedFixedColumnsAfterScrollHorizontally(){if(this.tableSettingsComputed.fixedColumnsLeft<1)return;const e=this.hot.container.querySelector(".wtHolder").scrollLeft>10;if(e===this.featureHighlightedFixedColumnsScrolled)return;this.featureHighlightedFixedColumnsScrolled=e;const t=this.hot.toVisualColumn(this.tableSettingsComputed.fixedColumnsLeft-1),i=this.hot.countRows();for(let a=0;a<i;a+=1){let{className:e}=this.hot.getCellMeta(a,t);"string"===typeof e?e=e.split(" "):Array.isArray(e)||(e=[]),this.featureHighlightedFixedColumnsScrolled?e.push("shadow-right"):e=e.filter((e=>"shadow-right"!==e)),this.hot.setCellMeta(a,t,"className",e.join(" "))}this.hotRender()}}},kI={mounted(){this.addHotHook("afterCreateRow",this.featureInsertAfterCreateRow),this.addHotHook("afterRenderer",this.featureInsertRowAfterRenderer)},computed:{guidColumnPhysicalIndex(){let e=null;return this.tableSettingsComputed.columns.some(((t,i)=>t.key===R&&(e=i,!0))),e}},methods:{insert({visualRow:e,physicalRow:t,guid:i}){null!=this.hot&&(null!=e?this.hot.alter("insert_row",e,1,"featureInsertRow.rowAbove"):null!=t?this.hot.alter("insert_row",this.hot.toVisualRow(t),1,"featureInsertRow.rowAbove"):null!=i&&this.hot.alter("insert_row",this.guidToVisualRow(i),1,"featureInsertRow.rowAbove"))},insertEntryFromStore(e){const t=e[R];null==this.tablePhysicalRowByGuid[t]&&this.hot.alter("insert_row",0,1,`featureInsertRow.insertEntryFromStore.${t}`)},featureInsertAfterCreateRow(e,t,i){"featureInsertRow.rowAbove"===i?this.featureInsertRowCreateGuid(e):"string"===typeof i&&0===i.indexOf("featureInsertRow.insertEntryFromStore")&&this.featureInsertRowSetGuid(e,t,i)},featureInsertRowCreateGuid(e){const t=ma();if(null!=this.guidColumnPhysicalIndex){const i=this.hot.toVisualColumn(this.guidColumnPhysicalIndex);this.hot.setDataAtCell(e,i,t,"featureInsertRow.createGuid")}const i=this.hot.toPhysicalRow(e);this.tableGuidByPhysicalRow=[...this.tableGuidByPhysicalRow.slice(0,i),t,...this.tableGuidByPhysicalRow.slice(i)];for(let n=i;n<this.tableGuidByPhysicalRow.length;n+=1)this.tablePhysicalRowByGuid[this.tableGuidByPhysicalRow[n]]=n;const a={[R]:t};this.$emit("create:newRow",a),this.$emit("update:tableData",{...this.tableData,[t]:a})},featureInsertRowSetGuid(e,t,i){const[,,a]=i.split(".");if(null!=this.tablePhysicalRowByGuid[a]||null==this.guidColumnPhysicalIndex)return;const n=this.hot.toVisualColumn(this.guidColumnPhysicalIndex);this.hot.setDataAtCell(e,n,a,"tableBase.setGuidForInsertedRow");const r=this.hot.toPhysicalRow(e);this.tableGuidByPhysicalRow=[...this.tableGuidByPhysicalRow.slice(0,r),a,...this.tableGuidByPhysicalRow.slice(r)],this.tablePhysicalRowByGuid={};for(let s=0;s<this.tableGuidByPhysicalRow.length;s+=1)this.tablePhysicalRowByGuid[this.tableGuidByPhysicalRow[s]]=s},featureInsertRowAfterRenderer(e,t){const i=this.visualRowToGuid(t);if(null==i||null==this.tableData[i])return;const{storeStatus:a}=this.tableData[i];a===N?e.classList.add("new"):a===z?e.classList.add("inserting"):a===L&&e.classList.add("error")}}},SI={props:{observeTableDataDisable:{type:Boolean,default:!1}},watch:{async tableDataComputed(){this.observeTableDataDisable||null==this.hot||(Object.keys(this.tableDataComputed).forEach((e=>{null==this.tableDataComputed[e]||[Z,G,W].includes(this.tableDataComputed[e].storeStatus)||null!=this.tablePhysicalRowByGuid[e]||this.insertEntryFromStore(this.tableDataComputed[e])})),await new Promise((e=>setTimeout(e,30))),this.tableGuidByPhysicalRow.forEach((e=>{null!=this.tableDataComputed[e]&&this.tableDataComputed[e].storeStatus!==Z||this.removeEntryFromStore({id:e})})))}}},EI={props:{preventWrapAround:{type:Boolean,default:!0}},mounted(){this.preventWrapAround&&this.addHotHook("beforeKeyDown",this.preventWrapAroundBeforeKeyDown)},methods:{preventWrapAroundBeforeKeyDown(e){if("ArrowUp"!==e.code&&"ArrowDown"!==e.code||this.$nextTick(this.preventWrapAroundFixViewport),"ArrowUp"!==e.code){if("ArrowDown"===e.code){const t=this.hot.getSelected(),i=this.hot.getData();if(!t)return;t[0]===i.length-1&&e.stopImmediatePropagation()}}else{const t=this.hot.getSelected();if(!t)return;0===t[0]&&e.stopImmediatePropagation()}},preventWrapAroundFixViewport(){if(null==this.hot)return;const e=this.hot.getSelected();if(null==e||null==e[0])return;const[t,i]=e[0],a=this.hot.getCell(t,i);if(null==a)return;let n=a.parentNode;while(null!=n){if(n.classList.contains("wtHolder"))break;n=n.parentNode}const r=a.getBoundingClientRect(),s=n.getBoundingClientRect();(r.top<s.top||r.bottom>s.bottom)&&this.hot.scrollViewportTo(t,i)}}},II={mounted(){this.addHotHook("afterRemoveRow",this.featureRemoveRowAfterRemoveRow),this.addHotHook("afterRenderer",this.featureRemoveRowAfterRenderer)},methods:{removeEntryFromStore({id:e}){null!=this.hot&&this.hot.alter("remove_row",this.guidToVisualRow(e),1,`featureRemoveRow.remove.${e}`)},featureRemoveRowAfterRemoveRow(e,t,i,a){if("string"!==typeof a||0!==a.indexOf("featureRemoveRow.remove"))return;const n=a.split(".")[2],r=this.tablePhysicalRowByGuid[n];this.tableGuidByPhysicalRow=[...this.tableGuidByPhysicalRow.slice(0,r),...this.tableGuidByPhysicalRow.slice(r+1)],this.tablePhysicalRowByGuid={};for(let s=0;s<this.tableGuidByPhysicalRow.length;s+=1)this.tablePhysicalRowByGuid[this.tableGuidByPhysicalRow[s]]=s},featureRemoveRowAfterRenderer(e,t){const i=this.visualRowToGuid(t);if(null==i||null==this.tableData[i])return;const{storeStatus:a}=this.tableData[i];a!==W&&a!==G||e.classList.add("removing")}}},_I={props:{contextMenu:{type:Boolean,default:!1},contextMenuHideEdit:{type:Boolean,default:!1},contextMenuHideInsert:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1}},data(){return{featureTableContextMenuGuid:null}},mounted(){this.addHotHook("afterOnCellContextMenu",this.featureTableContextMenuBeforeOnCellContextMenu)},methods:{featureTableContextMenuBeforeOnCellContextMenu(e,{row:t}){this.readOnly||!this.contextMenu||t<0||(e.preventDefault(),this.featureTableContextMenuShow(e,this.visualRowToGuid(t)))},featureTableContextMenuShow(e,t){null!=this.$refs.tableContextMenu&&null!=t&&(this.featureTableContextMenuGuid=t,this.$refs.tableContextMenu.show({left:e.clientX,top:e.clientY}))}}};ow.vI.add(uw.yh$,lw.G_j);const DI=e=>null==e||null==e.classList?null:e.classList.contains("table-header-context-menu__icon")?e:DI(e.parentNode);var MI={data(){return{tableHeaderContextMenuTarget:null,tableHeaderContextMenuAvailableValues:null}},mounted(){this.addHotHook("afterGetColHeader",this.tableHeaderContextMenuAfterGetColHeaders),this.addHotHook("afterScrollHorizontally",this.tableHeaderContextMenuClose)},computed:{tableHeaderContextMenuFilter(){if(null==this.tableHeaderContextMenuTarget)return null;const e=this.tableHeaderContextMenuTarget.column.key;return null==this.filtersByColumnKey||null==this.filtersByColumnKey[e]?null:this.filtersByColumnKey[e]}},methods:{tableHeaderContextMenuClose(){null!=this.tableHeaderContextMenuTarget&&this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--clicked"),this.tableHeaderContextMenuTarget=null,this.tableHeaderContextMenuAvailableValues=null},tableHeaderContextMenuSort(e){if(null==this.tableHeaderContextMenuTarget)return;const t=this.getPhysicalColByKey(this.tableHeaderContextMenuTarget.column.key),i=this.hot.toVisualColumn(t);
1this.hot.getPlugin("columnSorting").sort({column:i,sortOrder:e}),this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--clicked"),this.tableHeaderContextMenuTarget=null,this.tableHeaderContextMenuAvailableValues=null},tableHeaderContextMenuUpdateFilter(e){this.setColumnFilter(e,this.tableHeaderContextMenuTarget.column.key),null!=e&&("string"===typeof e.value&&e.value.length>0||Array.isArray(e.selectedValues)&&Array.isArray(this.tableHeaderContextMenuAvailableValues)&&e.selectedValues.length!==this.tableHeaderContextMenuAvailableValues.length)?this.tableHeaderContextMenuTarget.element.classList.add("table-header-context-menu__icon--filtered"):this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--filtered")},tableHeaderContextMenuAfterGetColHeaders(e,t){const i=this.hot.toPhysicalColumn(e),a=this.tableSettingsComputed.columns[i];if(null==a)return;let n=t.querySelector(".table-header-context-menu__icon");if(a.noHeaderContextMenu)return void(null!=n&&n.remove());if(null!=n&&n.dataset.columnKey===a.key)return;null!=n&&n.remove(),n=document.createElement("span"),n.dataset.columnKey=a.key,n.addEventListener("click",this.tableHeaderContextMenuClick),n.classList.add("table-header-context-menu__icon");const[r]=(0,ow.qv)({prefix:"fas",iconName:"chevron-circle-down"}).node;r.classList.add("table-header-context-menu__icon-chevron-circle-down"),n.append(r);const[s]=(0,ow.qv)({prefix:"far",iconName:"filter"}).node;s.classList.add("table-header-context-menu__icon-filter"),n.append(s),t.firstChild.append(n)},async tableHeaderContextMenuClick(e){e.preventDefault(),e.stopPropagation();const t=DI(e.target);t.classList.add("table-header-context-menu__icon--clicked");const i=this.getColumnByKey(t.dataset.columnKey);let a=null;if(null!=this.tableHeaderContextMenuTarget&&(this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--clicked"),a=this.tableHeaderContextMenuTarget.column),this.tableHeaderContextMenuTarget=null,this.tableHeaderContextMenuAvailableValues=null,null!=a&&i.key===a.key)return;await new Promise((e=>this.$nextTick(e)));const n=this.hot.toVisualColumn(this.getPhysicalColByKey(i.key)),r=this.hot.getPlugin("columnSorting").getSortConfig(n);let s=null;null!=r&&({sortOrder:s}=r),this.tableHeaderContextMenuTarget={element:t,column:i,sortOrder:s};const o=new Set;Object.values(this.tableData).forEach((e=>{const t=zu(e,i);Array.isArray(t)?t.forEach((e=>o.add(e))):o.add(zu(e,i))})),this.tableHeaderContextMenuAvailableValues=[...o]}}},PI={mounted(){this.addHotHook("afterGetColHeader",this.tableHeaderLinkAfterGetColHeader)},methods:{tableHeaderLinkAfterGetColHeader(e,t){const i=this.hot.toPhysicalColumn(e),a=this.tableSettingsComputed.columns[i];if(null==a||null==a.header||!Array.isArray(a.header.links))return;const n=t.querySelector(".colHeader");if(null==n||null==n.parentNode)return;let r=t.querySelector(".table-header-link");null==r&&(r=document.createElement("div"),r.classList.add("table-header-link"),n.parentNode.appendChild(r)),r.innerHTML="";let s=null;"function"===typeof a.getCurrentHeaderLinkValue&&(s=a.getCurrentHeaderLinkValue()),a.header.links.forEach((e=>{const t=document.createElement("a");t.classList.add("d-inline-block","mr-2"),e.value!==s&&t.classList.add("text-black"),t.innerText=e.text,t.oncl
1ick=()=>{this.$emit("click:columnHeaderLink",{column:a,link:e})},r.appendChild(t)}))}}},TI={data(){return{tableHeaderElementsByVisualCol:{},tableHeaderTooltips:[]}},mounted(){this.addHotHook("afterGetColHeader",this.tableHeaderTooltipsAfterGetColHeader),this.addHotHook("afterRender",this.tableHeaderTooltipsAfterRender)},methods:{tableHeaderTooltipsAfterGetColHeader(e,t){this.tableHeaderElementsByVisualCol[e]={visualCol:e,th:t}},async tableHeaderTooltipsAfterRender(){if(this.tableHeaderTooltips=[],await this.$nextTick(),null==this.hot)return;const e=this.hot.getPlugin("hiddenColumns").getHiddenColumns(),t=[];Object.values(this.tableHeaderElementsByVisualCol).forEach((({visualCol:i,th:a})=>{if(e.includes(i))return;const n=this.hot.toPhysicalColumn(i),r=this.tableSettingsComputed.columns[n];if(null==r||null==r.header)return;const s=a.querySelector(".colHeader");null!=s&&t.push({key:r.key,header:r.header,target:s,physicalCol:n,visualCol:i})})),this.tableHeaderTooltips=t}}},xI={props:{hoverButtons:{type:Boolean,default:!1},hoverButtonsNoMainButton:{type:Boolean,default:!1},hoverButtonsMainButtonIcon:{type:[String,Array],default:void 0},hoverButtonsMainButtonTitle:{type:String,default:void 0}},data(){return{featureRowHoverTd:null,featureRowHoverTarget:null,featureRowHoverGuid:null,featureRowHoverCurrentRow:null}},mounted(){this.addHotHook("afterRender",this.featureRowHoverAfterRender),this.addHotHook("beforeOnCellMouseOver",this.featureRowHoverBeforeOnCellMouseOver),this.addHotHook("afterScrollVertically",this.featureRowHoverAfterScrollVertically)},methods:{featureRowHoverAfterRender(){this.$el.querySelectorAll(".handsontable tbody tr").forEach((e=>{e.removeEventListener("mouseenter",this.featureRowHoverOnRowMouseEnter),e.addEventListener("mouseenter",this.featureRowHoverOnRowMouseEnter)})),this.$el.querySelectorAll(".table-base__table-container").forEach((e=>{e.removeEventListener("mouseleave",this.featureRowHoverOnTableMouseLeave),e.addEventListener("mouseleave",this.featureRowHoverOnTableMouseLeave)}))},featureRowHoverOnTableMouseLeave(){this.$el.querySelectorAll(".handsontable tr.hovering").forEach((e=>{e.classList.remove("hovering")})),this.featureRowHoverTd=null,this.featureRowHoverTarget=null,this.featureRowHoverCurrentRow=null},featureRowHoverOnRowMouseEnter(e){this.$el.querySelectorAll(".handsontable tr.hovering").forEach((e=>{e.classList.remove("hovering")}));let t=0;for(let{target:i}=e;null!=i.previousElementSibling;i=i.previousElementSibling)t+=1;this.$el.querySelectorAll(".handsontable tbody").forEach((e=>{const i=e.children.item(t);null!=i&&i.classList.add("hovering")}))},featureRowHoverBeforeOnCellMouseOver(e,{row:t},i){this.featureRowHoverCurrentRow!==t&&(this.featureRowHoverRowIndex=t,this.featureRowHoverTd=i,this.featureRowHoverTarget=i.parentElement,this.featureRowHoverGuid=this.visualRowToGuid(t))},featureRowHoverAfterScrollVertically(){null!=this.$refs.featureRowHoverButtons&&this.$refs.featureRowHoverButtons.updatePosition()}}},BI=i(91033),OI={data(){return{resizeObserver:null,resizeObserverSize:{width:0,height:0}}},beforeDestroy(){this.destroy()},mounted(){this.initResizeObserver()},methods:{initResizeObserver(){this.resizeObserver=new BI.Z((([e])=>{const{height:t,width:i}=e.contentRect;this.resizeObserverSize={height:t,width:i}})).observe(this.$el)},destroy(){this.resizeObserver&&this.resizeObserver.disconnect()}}},$I=function(){var e=this,t=e._self._c;return t("div",{staticClass:"fetching-error"},[t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.userMessage)+" ")]),e._t("default"),t("BButton",{attrs:{variant:"lightest"},on:{click:()=>e.$emit("reload")}},[e._v(" "+e._s(e.$t("Neu laden"))+" ")])],2)},RI=[],NI={name:"FetchingError",props:{userMessage:{type:String,default(){return this.$t("\n          Die Daten konnten nicht geladen werden. Bitte überprüfe die Internetverbindung.\n          Falls der Fehler weiterhin auftritt wende dich an [email protected]\n        ")}}}},zI=NI,LI=(0,ew.Z)(zI,$I,RI,!1,null,"4d229038",null),VI=LI.exports,UI=function(){var e=this,t=e._self._c;return t("HotTable",{attrs:{id:e.id,settings:e.tableSettings,data:[]}})},jI=[],HI=i(69170),GI={name:"HotWrapper",components:{HotTable:HI.sZ},props:{id:{type:String,required:!0},tableSettings:{type:Object,required:!0}}},WI=GI,ZI=(0,ew.Z)(WI,UI,jI,!1,null,"f778fb9e",null),KI=ZI.exports,qI=function(){var e=this,t=e._self._c;
1return t("div",{staticClass:"table-context-menu",style:{top:e.top,left:e.left}},[t("BDropdown",{ref:"dropdown",staticClass:"show",attrs:{variant:"lightest","menu-class":"shadow",boundary:e.boundary}},[e.hideInsert?e._e():t("BDropdownItem",{attrs:{"data-namespace":`ButtonInsertEntry.${e.componentNamespace}`},on:{click:function(t){return e.$emit("insert")}}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"plus-circle"}}),e._v(" "+e._s(e.$t("Einfügen (oberhalb)"))+" ")],1),e.hideEdit?e._e():t("BDropdownItem",{attrs:{"data-namespace":`ButtonEditEntry.${e.componentNamespace}`},on:{click:function(t){return e.$emit("edit")}}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"pencil-alt"}}),e._v(" "+e._s(e.$t("Bearbeiten"))+" ")],1),t("BDropdownItem",{attrs:{"data-namespace":`ButtonRemoveEntry.${e.componentNamespace}`},on:{click:function(t){return e.$emit("remove")}}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"trash-alt"}}),e._v(" "+e._s(e.$t("Löschen"))+" ")],1),null!=e.$slots.default?t("BDropdownDivider"):e._e(),e._t("default")],2)],1)},YI=[];ow.vI.add(uw.KtF,uw.UJf,uw.I7k);var JI={name:"TableContextMenu",mixins:[pw],props:{boundary:{type:[HTMLElement,String],default:()=>"window"},hideEdit:{type:Boolean,default:!1},hideInsert:{type:Boolean,default:!1}},data(){return{topBase:0,leftBase:0}},computed:{top(){return this.topBase<=0||"number"!==typeof this.topBase?0:this.topBase-33+"px"},left(){return this.leftBase<=0||"number"!==typeof this.leftBase?0:`${this.leftBase}px`}},methods:{show({top:e,left:t}){this.topBase=e,this.leftBase=t,this.$refs.dropdown.show()}}},XI=JI,QI=(0,ew.Z)(XI,qI,YI,!1,null,"5a32704d",null),e_=QI.exports,t_=function(){var e=this,t=e._self._c;return null!=e.computedTarget?t("BPopover",{ref:"popover",attrs:{show:"",placement:"bottomleft","custom-class":"table-header-context-menu",target:e.computedTarget}},[t("BForm",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.close,expression:"close"}],staticClass:"table-header-context-menu__inner",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.close.apply(null,arguments)}}},[t("h3",{staticClass:"table-header-context-menu__title"},[e._v(" "+e._s(e.title)+" ")]),e.target.sortDisabled?e._e():t("BButton",{staticClass:"table-header-context-menu__button",class:"asc"===e.target.sortOrder?"table-header-context-menu__button--active":null,attrs:{variant:"black",block:""},on:{click:()=>e.sort("asc")}},["numeric"!==e.target.column.type?t("FontAwesomeIcon",{attrs:{icon:["far","sort-alpha-down"]}}):e._e(),"numeric"!==e.target.column.type?t("span",{staticClass:"table-header-context-menu__button-text"},[e._v(e._s(e.labelSortAscParts[0])+" "),t("FontAwesomeIcon",{attrs:{size:"sm",icon:["fal","arrow-right"]}}),e._v(" "+e._s(e.labelSortAscParts[1])+" ")],1):t("span",{staticClass:"table-header-context-menu__button-text"},[e._v(e._s(e.$t("Sortieren: aufsteigend"))+" ")])],1),e.target.sortDisabled?e._e():t("BButton",{staticClass:"table-header-context-menu__button",class:"desc"===e.target.sortOrder?"table-header-context-menu__button--active":null,attrs:{variant:"black",block:""},on:{click:()=>e.sort("desc")}},["numeric"!==e.target.column.type?t("FontAwesomeIcon",{attrs:{icon:["far","sort-alpha-up"]}}):e._e(),"numeric"!==e.target.column.type?t("span",{staticClass:"table-header-context-menu__button-text"},[e._v(e._s(e.labelSortDescParts[0])+" "),t("FontAwesomeIcon",{attrs:{size:"sm",icon:["fal","arrow-right"]}}),e._v(" "+e._s(e.labelSortDescParts[1])+" ")],1):t("span",{staticClass:"table-header-context-menu__button-text"},[e._v(e._s(e.$t("Sortieren: absteigend"))+" ")])],1),t("hr",{staticClass:"table-header-context-menu__hr"}),e.isDateColumn?[t("FormFieldDatepicker",{staticClass:"table-filter-datepicker",attrs:{selectedDate:e.selectedDateFrom,label:e.$t("Datum von"),variant:"vertical","calendar-class":"filter-datepicker",theme:"light"},on:{setSelectedDate:e.setSelectedDateFrom}}),t("FormFieldDatepicker",{staticClass:"table-filter-datepicker",attrs:{selectedDate:e.selectedDateTo,label:e.$t("Datum bis"),variant:"vertical","calendar-class":"filter-datepicker",theme:"light"},on:{setSelectedDate:e.setSelectedDateTo}})]:e._e(),t("BFormSelect",{staticClass:"table-header-context-menu__search-type",attrs:{value:e.filterType,options:e.filterTypeOptions},on:{input:e.inputFilterType}}),t("label",{staticClass:"table-header-context-menu__search-label",class:"string"!==typeof e.filterString||0===e.filterString.length?"table-header-context-menu__search-label--empty":null},[t("FontAwesomeIcon",{attrs:{size:"sm",icon:["far","filter"]}}),t("BFormInput",{staticClass:"table-header-context-menu__search-field",class:"string"!==typeof e.filterString||0===e.filterString.length?"table-header-context-menu__search-field--empty":null,attrs:{type:"search",placeholder:e.$t("Suchbegriff eingeben ..."),value:e.filterString},on:{input:e.inputFilterString}})],1),t("hr",{staticClass:"table-header-context-menu__hr"}),t("h6",{staticClass:"table-header-context-menu__subtitle"},[e._v(e._s(e.$t("Werte:")))]),t("div",{staticClass:"table-header-context-menu__value-checkbox-group"},[t("FormCheckbox",{staticClass:"table-header-context-menu__value-checkbox m-0",attrs:{checked:e.filterSelectedValues.length===e.availableValuesFiltered.length,indeterminate:e.filterSelectedValues.length>0&&e.filterSelectedValues.length!==e.availableValuesFiltered.length},on:{change:e.inputValueCheckboxAll}},[t("span",{staticClass:"table-header-context-menu__value-checkbox-inner"},[e._v(" "+e._s(e.$t("(Alle auswählen)"))+" ")])]),t("FormFieldCheckboxGroup",{staticClass:"m-0",attrs:{variant:"no-label",checked:e.filterSelectedValues},on:{change:e.inputValueCheckbox}},e._l(e.availableValuesFiltered,(function(i){return t("FormCheckbox",{key:i,staticClass:"table-header-context-menu__value-checkbox",attrs:{value:i}},[t("span",{staticClass:"table-header-context-menu__value-checkbox-inner"},[e._v(" "+e._s("string"!==typeof i||""===i?e.$t("(leer)"):i)+" ")])])})),1)],1),e.showClearFilter?t("BButton",{staticClass:"table-header-context-menu__button",attrs:{variant:"black",block:""},on:{click:e.clearFilter}},[t("span",{staticClass:"table-header-context-menu__button-text"}
1,[e._v(e._s(e.$t("Filter entfernen"))+" ")])]):e._e()],2)],1):e._e()},i_=[],a_=i(65735),n_=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BaseFormField",{attrs:{type:"datepicker",label:e.label,variant:e.variant,description:e.description}},[t("div",{staticClass:"form-field-datepicker"},[e.loading?t("div",{staticClass:"text-primary"},[t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}})],1):t("div",{staticClass:"datepicker-container"},[t("BButton",{class:"dark"===e.theme?"text-black":"text-white",attrs:{variant:"link"},on:{click:e.onCalendarIconClick}},[t("FontAwesomeIcon",{staticClass:"calendar-icon",attrs:{icon:["fa","calendar-alt"]}})],1),t("VuejsDatepicker",{ref:"datepicker",staticClass:"datepicker",attrs:{"calendar-class":"datepicker-calendar "+(e.calendarClass?`custom-class ${e.calendarClass}`:""),"input-class":"dark"===e.theme?"datepicker-input-dark":"datepicker-input-light","maximum-view":"day",format:"dd.MM.yyyy",language:e.language,value:e.selectedDate,disabledDates:e.disabledDates,highlighted:e.highlightedDates,mondayFirst:!0,dayCellContent:e.dayCellContent},on:{selected:t=>{e.$emit("setSelectedDate",t)}}}),t("BButton",{class:"dark"===e.theme?"text-black":"text-white",attrs:{variant:"link",disabled:e.selectedPreviousDateClickDisabled},on:{click:e.onSelectPreviousDateClick}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-left"}})],1),t("BButton",{class:"dark"===e.theme?"text-black":"text-white",attrs:{variant:"link",disabled:e.selectedNextDateClickDisabled},on:{click:e.onSelectNextDateClick}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}})],1)],1)])])},r_=[];function s_(e,t){return!!t&&(!!t.dates?.some((t=>e.getTime()===t.getTime()))||(!!(t.to&&e<=t.to)||(!!(t.from&&e>=t.from)||(!!t.ranges?.some((t=>e<=t.to||e>=t.from))||(!(!t.days||-1===t.days?.indexOf(e.getDay()))||(!(!t.daysOfMonth||-1===t.daysOfMonth?.indexOf(e.getDate()))||!!t.customPredictor?.(e)))))))}function o_(e,t,i=1){if(!t)return!0;if(t.from&&e>=p_(t.from,i))return!1;if(t.days){const e=Array.from(Array(6).keys());return!e.every((e=>t.days?.includes(e)))}if(t.daysOfMonth){const e=Array.from(Array(31).keys());return!e.every((e=>t.daysOfMonth?.includes(e)))}return!0}function l_(e,t,i=1){if(!t)return!0;if(t.to&&e<=u_(t.to,i))return!1;if(t.days){const e=Array.from(Array(6).keys());return!e.every((e=>t.days?.includes(e)))}if(t.daysOfMonth){const e=Array.from(Array(31).keys());return!e.every((e=>t.daysOfMonth?.includes(e)))}return!0}function d_(e,t,i=1){if(!o_(e,t,i))return null;let a=0;const n=60;let r=u_(e,i);while(a<n){if(!s_(r,t))return r;r=u_(r),a+=1}return null}function c_(e,t,i=1){if(!l_(e,t))return null;let a=0;const n=60;let r=p_(e,i);while(a<n){if(!s_(r,t))return r;r=p_(r),a+=1}return null}function u_(e,t=1){const i=new Date(e);return i.setDate(e.getDate()+t),i}function p_(e,t=1){const i=new Date(e);return i.setDate(e.getDate()-t),i}ow.vI.add(uw.IV4,uw.A35,uw._tD);var h_=(0,b.defineComponent)({name:"FormFieldDatepicker",components:{BaseFormField:BA,VuejsDatepicker:iS.Z},model:{prop:"selectedDate",event:"setSelectedDate"},props:{label:{type:String,default:null},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label"].includes(e)},calendarClass:{type:String,default:""},selectedDate:{type:Date,default:null},disabledDates:{type:Object,default:void 0},highlightedDates:{type:Object,default:void 0},dayCellContent:{type:Function,default:void 0},loading:{type:Boolean,default:!1},theme:{type:String,default:"dark",validator:e=>["dark","light"].includes(e)},step:{type:Number,default:1},description:{type:String,default:""}},emits:["setSelectedDate"],computed:{language(){return this.$store?.getters?.datepickerTranslation||"de"},selectedPreviousDateClickDisabled(){return!this.selectedDate||!l_(this.selectedDate,this.disabledDates)},selectedNextDateClickDisabled(){return!this.selectedDate||!o_(this.selectedDate,this.disabledDates)}},methods:{onCalendarIconClick(){this.$refs.datepicker?.showCalendar()},onSelectNextDateClick(){if(!this.selectedDate)return;const e=d_(this.selectedDate,this.disabledDates,this.step);e&&this.$emit("setSelectedDate",e)},onSelectPreviousDateClick(){if(!this.selectedDate)return;const e=c_(this.selectedDate,this.disabledDates,this.step);e&&this.$emit("setSelectedDate",e)}}}),m_=h_,f_=(0,ew.Z)(m_,n_,r_,!1,null,null,null),g_=f_.exports,y_=function(){var e=this,t=e._self._c;return t("BaseFormField",{attrs:{type:"checkbox",label:e.label,variant:e.variant}},[t("BFormCheckboxGroup",{attrs:{stacked:e.stacked,checked:e.checked},on:{change:e.change,input:e.input}}
1,[e._t("default",(function(){return e._l(e.options,(function(i){return t("FormCheckbox",{key:i.value,attrs:{value:i.value,disabled:i.disabled}},[e._v(" "+e._s(i.text)+" ")])}))}))],2)],1)},v_=[],b_=i(64431),w_={name:"FormFieldCheckboxGroup",components:{BFormCheckboxGroup:b_.x,FormCheckbox:Gw,BaseFormField:BA},model:{prop:"checked",event:"input"},props:{label:{type:String,default:null},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label"].includes(e)},options:{type:Array,default:null},checked:{type:Array,default:null},stacked:{type:Boolean,default:!0}},methods:{input(e){this.$emit("input",e)},change(e){this.$emit("change",e)}}},C_=w_,F_=(0,ew.Z)(C_,y_,v_,!1,null,"29c6c38b",null),A_=F_.exports;ow.vI.add(lw.tHg,lw.sr,lw.G_j,a_.eFW);var k_={name:"TableHeaderContextMenu",components:{FormFieldCheckboxGroup:A_,FormCheckbox:Gw,FormFieldDatepicker:g_},props:{target:{type:Object,default:null,validator(e){return null==e||null!=e.column&&null!=e.element}},filter:{type:Object,default:null},availableValues:{type:Array,default:()=>[]}},data(){return{selectedDateTo:null,selectedDateFrom:null,computedTarget:this.target?.element?.id||this.target?.element,labelSortAsc:this.$t("Sortieren: A {arrowRight} Z",{arrowRight:"#####"}),labelSortDesc:this.$t("Sortieren: Z {arrowRight} A",{arrowRight:"#####"}),filterTypeOptionsText:[{value:"contains",text:this.$t("Enthält:")},{value:"not",text:this.$t("Enthält nicht:")},{value:"equals",text:this.$t("Ist genau:")}],filterTypeOptionsNumber:[{value:"greater",text:this.$t("Größer als:")},{value:"less",text:this.$t("Kleiner als:")},{value:"equals",text:this.$t("Ist genau:")}]}},watch:{target:{handler(){this.computedTarget=null,this.$nextTick((()=>{this.computedTarget=this.target?.element?.id||this.target?.element}))},deep:!0}},computed:{title(){return null==this.target||null==this.target.column||null==this.target.column.header?null:this.target.column.header.title()},isDateColumn(){return"date"===this.target.column.type||"datetime"===this.target.column.type},filterTypeOptions(){return"numeric"===this.target.column.type?this.filterTypeOptionsNumber:this.filterTypeOptionsText},filterType(){return null!=this.filter&&this.filterTypeOptions.map((e=>e.value)).includes(this.filter.type)?this.filter.type:this.filterTypeOptions.length>0?this.filterTypeOptions[0].value:null},filterString(){return null!=this.filter?this.filter.value:null},filterSelectedValues(){return null!=this.filter&&Array.isArray(this.filter.selectedValues)?this.filter.selectedValues:this.availableValuesFiltered},labelSortAscParts(){return this.labelSortAsc.split("#####")},labelSortDescParts(){return this.labelSortDesc.split("#####")},availableValuesFiltered(){if("string"!==typeof this.filterString||0===this.filterString.length)return this.isDateColumn?this.sortDates(this.availableValues):[...this.availableValues].sort();const e=this.availableValues.filter((e=>null!=e&&wI(e,this.filterString,this.filterType)));return this.isDateColumn?this.sortDates(e):e.sort()},showClearFilter(){return"string"===typeof this.filterString&&this.filterString.length>0||this.filterSelectedValues.length!==this.availableValues.length}},mounted(){document.addEventListener("keyup",this.onKeyUp)},beforeDestroy(){document.removeEventListener("keyup",this.onKeyUp)},methods:{resetFilterDates(){this.selectedDateFrom=null,this.selectedDateTo=null},sortDates(e){const t=(e,t)=>{const i=e=>
1{if(/\d{2}\/\d{2}\/\d{4}/.test(e)){const[t,i,a]=e.split("/");return new Date(`${a}-${i}-${t}`)}if(/\d{2}\.\d{2}\.\d{4}/.test(e)){const[t,i,a]=e.split(".");return new Date(`${a}-${i}-${t}`)}return null},a=i(e),n=i(t);return a&&n?a-n:null};return e.slice().sort(t)},setSelectedDateFrom(e){this.selectedDateFrom=e,this.$emit("update:dateFilter",{dateFrom:this.selectedDateFrom,dateTo:this.selectedDateTo})},setSelectedDateTo(e){this.selectedDateTo=e,this.$emit("update:dateFilter",{dateFrom:this.selectedDateFrom,dateTo:this.selectedDateTo})},onKeyUp(e){"Escape"===e.key&&this.close()},close(){this.$emit("close")},sort(e){this.$emit("sort",e)},inputFilterType(e){this.$emit("update:filter",{type:e,value:this.filterString,selectedValues:null})},inputFilterString(e){this.$emit("update:filter",{type:this.filterType,value:e,selectedValues:null})},clearFilter(){this.$emit("update:filter",null),this.$emit("close")},inputValueCheckboxAll(e){let t=[];e&&(t=[...this.availableValuesFiltered]),this.$emit("update:filter",{type:this.filterType,value:this.filterString,selectedValues:t})},inputValueCheckbox(e){this.$emit("update:filter",{type:this.filterType,value:this.filterString,selectedValues:e})}}},S_=k_,E_=(0,ew.Z)(S_,t_,i_,!1,null,"7754ef6d",null),I_=E_.exports,__=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-loading"},[t("div",{staticClass:"table-loading__header"},e._l(e.columnsComputed,(function(i){return t("div",{key:`header_${i.key}`,staticClass:"table-loading__header-content",style:i.width?`flex: 0 1 ${i.width}px;`:""},[e._v(" "+e._s(null!=i.header?i.header.title():"")+" ")])})),0),e._l(e.rows,(function(i){return t("div",{key:i,staticClass:"table-loading__row"},e._l(e.columnsComputed,(function(e){return t("div",{key:`${i}_${e.key}`,staticClass:"table-loading__row-content",style:e.width?`flex: 0 1 ${e.width}px`:""})})),0)}))],2)},D_=[],M_={name:"TableLoading",props:{columns:{type:Array,default:null}},computed:{rows(){return[...new Array(5).keys()]},columnsComputed(){return this.columns.filter((e=>null!=e&&!e.hiddenPerDefault)).map((e=>({key:e.key??e.data,header:e.header,width:"number"===typeof e.width?e.width:null}))).slice(0,7)}}},P_=M_,T_=(0,ew.Z)(P_,__,D_,!1,null,"a8dba85c",null),x_=T_.exports,B_=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:null!=e.target||e.hovered,expression:"target != null || hovered"}
1],staticClass:"table-row-hover-buttons",style:{top:e.top,height:e.height,marginRight:e.marginRight}},[e.noMainButton?e._e():t("BButton",{staticClass:"table-row-hover-buttons__btn-edit bg-white text-black",attrs:{variant:"outline-medium"},on:{click:function(t){return e.$emit("mainButton")}}},[t("FontAwesomeIcon",{attrs:{icon:e.mainButtonIcon}}),e._v(" "+e._s(null!=e.mainButtonTitle?e.mainButtonTitle:e.$t("Bearbeiten"))+" ")],1),e.readOnly?e._e():t("BButton",{staticClass:"table-row-hover-buttons__btn-context-menu ml-2 bg-white text-black",attrs:{variant:"outline-medium"},on:{click:function(t){return e.$emit("contextmenu",t)}}},[t("FontAwesomeIcon",{attrs:{icon:["far","ellipsis-h"]}})],1)],1)},O_=[];ow.vI.add(lw.cNd),ow.vI.add(uw.TzT);var $_={name:"TableRowHoverButtons",props:{target:{type:HTMLElement,default:null},noMainButton:{type:Boolean,default:!1},mainButtonIcon:{type:[String,Array],default:"pencil"},mainButtonTitle:{type:String,default:null},readOnly:{type:Boolean,default:!1}},data(){return{hovered:!1,top:0,height:0,marginRight:0}},watch:{target(){this.updatePosition()}},mounted(){this.$el.addEventListener("mouseenter",(()=>{this.hovered=!0})),this.$el.addEventListener("mouseleave",(()=>{this.hovered=!1}))},methods:{updatePosition(){if(this.hovered)return;if(null==this.target)return this.top=0,void(this.height=0);const e=this.target.closest(".wtHolder"),t=e.getBoundingClientRect(),i=this.target.getBoundingClientRect(),a=i.top-t.top,{offsetHeight:n}=e;this.top=`${a+1}
1px`,this.height=this.target.offsetHeight-2+"px";const{offsetHeight:r}=this.target.closest(".wtSpreader");this.marginRight=r>n?"16px":0},hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}}},R_=$_,N_=(0,ew.Z)(R_,B_,O_,!1,null,"28394202",null),z_=N_.exports,L_=function(){var e=this,t=e._self._c;return e.cellError?t("BTooltip",{attrs:{target:e.cellError.target,placement:"rightbottom","custom-class":"handsontable-error-tooltip"}},[t("p",[e._v(e._s(e.$t("Fehler")))]),t("p",[e._v(e._s(e.cellError.errorUserMessage))]),t("FontAwesomeIcon",{attrs:{icon:"exclamation-square"}})],1):e._e()},V_=[],U_={name:"TooltipCellError",props:{cellError:{type:Object,default:null}}},j_=U_,H_=(0,ew.Z)(j_,L_,V_,!1,null,"cf3ae140",null),G_=H_.exports,W_=function(){var e=this,t=e._self._c;return e.rowError?t("BTooltip",{attrs:{target:e.rowError.target,placement:"bottom","custom-class":"handsontable-error-tooltip"}},[t("p",[e._v(e._s(e.$t("Fehler")))]),t("p",[e._v(e._s(e.rowError.errorUserMessage))]),t("FontAwesomeIcon",{attrs:{icon:"exclamation-square"}})],1):e._e()},Z_=[],K_={name:"TooltipRowError",props:{rowError:{type:Object,default:null}}},q_=K_,Y_=(0,ew.Z)(q_,W_,Z_,!1,null,"5710adb0",null),J_=Y_.exports,X_=function(){var e=this,t=e._self._c;return t("div",e._l(e.tableHeaderTooltips,(function(i){return t("BTooltip",{key:`tooltip-table-header--${i.key}-${i.visualCol}`,attrs:{placement:"bottomright",delay:"500","custom-class":"b-tooltip--margin-1",target:i.target}},[t("div",{staticClass:"text-left"},[t("strong",{staticClass:"mb-1"},[e._v(" "+e._s(i.header.title())+" ")]),"function"===typeof i.header.description?t("p",{staticClass:"mb-0"},[e._v(" "+e._s(i.header.description())+" ")]):e._e()])])})),1)},Q_=[],eD={name:"TooltipTableHeader",props:{tableHeaderTooltips:{type:Array,required:!0}}},tD=eD,iD=(0,ew.Z)(tD,X_,Q_,!1,null,"987780d8",null),aD=iD.exports,nD={name:"TableBase",components:{TableHeaderContextMenu:I_,FetchingError:VI,HotWrapper:KI,TableRowHoverButtons:z_,TooltipCellError:G_,TooltipRowError:J_,TooltipTableHeader:aD,TableContextMenu:e_,TableLoading:x_},mixins:[fI,bI,lA,gI,pI,FI,AI,TI,xI,_I,MI,kI,II,SI,EI,PI,vI,cA,OI],props:{id:{type:String,required:!0},innerClass:{type:String,default:""},disableReadOnlyBg:{type:Boolean,default:!1},invertSelectionBg:{type:Boolean,default:!1}},watch:{resizeObserverSize(){this.$nextTick((()=>{this.hotRender()}))}}},rD=nD,sD=(0,ew.Z)(rD,cI,uI,!1,null,"4bf9de40",null),oD=sD.exports,lD=function(){var e=this,t=e._self._c;return t("div",{staticClass:"table-footer bg-lightest"},[t("div",{staticClass:"table-footer__row-count bg-medium"},[e._v(" "+e._s(e.rowCount)+" ")]),t("div",{staticClass:"table-footer__additional-info"},[e._t("default")],2)])},dD=[],cD={name:"TableFooter",props:{totalRows:{type:Number,default:0},visibleRows:{type:Number,default:0},selectedRows:{type:Number,default:0}},computed:{rowCount(){return this.selectedRows>0?this.$t("Ausgewählt: {selected} von {total}",{selected:this.selectedRows,total:this.totalRows}):this.visibleRows<this.totalRows?this.$t("Angezeigt: {visible} von {total}",{visible:this.visibleRows,total:this.totalRows}):this.$t("Anzahl Einträge: {total}",{visible:this.visibleRows,total:this.totalRows})}}},uD=cD,pD=(0,ew.Z)(uD,lD,dD,!1,null,"41017e28",null),hD=pD.exports;function mD(e,{forceReset:t=!1,forceRefresh:i=!1}={}){return{data(){return{subscribableDataUnsubscribe:()=>null}},computed:{...(0,C.Se)({loading:`${e}/loading`,tableData:`${e}/data`,tableErrors:`${e}/errors`})},mounted(){this.subscribableDataUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.loadData()})),this.loadData()},beforeDestroy(){this.subscribableDataUnsubscribe()},methods:{async loadData(){await new Promise((e=>setTimeout(e,30))),await this.$store.dispatch("auth/subscribe"),await this.$store.dispatch(`${e}/subscribe`,{forceReset:t,forceRefresh:i}),await this.loadAdditionalData()},async loadAdditionalData(){return null}}}}function fD(e){return{props:{selectedRows:{type:Array,default:null},removeRowConfirmMessage:{type:[String,Function],default(){return e=>{let t=this.$t("Gewählte Einträge wirklich löschen?");return 1===e.length&&(t=this.$t("Gewählten Eintrag wirklich löschen?")),t}}}},computed:{...(0,C.Se)({tableData:`${e}/data`,tableErrors:`${e}/errors`})},methods:{updateEntryByKeyAndValue({guid:t,columnKey:i,value:a}){if(null==t||null==this.tableData[t])return;const n=this.tableSettings.columns.some((e=>
1!!e.required&&((e.key!==i||null==a)&&null==Ru(this.tableData[t],e.key))));if(n)this.$store.commit(`${e}/updateEntryByKeyAndValue`,{guid:t,key:i,value:a});else{const n={...this.tableData[t],[i]:a};this.$store.dispatch(`${e}/updateAndSyncEntry`,{entry:n})}},insertAndSyncNewEntry(t){const i=t[R];if(null==i)return;const a=this.tableSettings.columns.some((e=>!!e.required&&null==t[e.key]));a?this.$store.dispatch(`${e}/insertNewEntry`,{entry:t}):this.$store.dispatch(`${e}/insertAndSyncNewEntry`,{entry:t})},removeSelectedEntries(){Array.isArray(this.selectedRows)&&this.removeEntries(this.selectedRows.map((e=>this.tableData[e])))},async removeEntries(t){const i=await this.$confirm({message:this.removeRowConfirmMessage(t),okTitle:this.$t("Löschen"),okVariant:"danger"});i&&t.forEach((t=>{this.$store.dispatch(`${e}/removeAndSyncEntry`,{entry:t})}))}}}}var gD={props:{filterString:{type:String,default:""},selectedRows:{type:Array,default:()=>[]},visibleRows:{type:Array,default:()=>[]}},data(){return{hot:null,hotHooks:[],tableSettingsInternal:{},columnDefinition:null,columnSettingsMiddleware:[]}},computed:{tableSettings(){return D()({},this.tableSettingsInternal,this.columnSettings)},columnSettings(){if(null==this.columnDefinition)return{};let e=[];
1if(Array.isArray(this.columnDefinition))e=this.columnDefinition;else if(Array.isArray(this.columnDefinition.international)){e=this.columnDefinition.international;const t=this.$store.getters["auth/currentCompaniesRegionIds"];1===t.length&&Array.isArray(this.columnDefinition[t[0]])&&(e=this.columnDefinition[t[0]])}this.columnSettingsMiddleware.forEach((t=>{e=t(e)}));let t=0;const i={indicators:!1,columns:[]},a={};let n=!0;return e.forEach(((e,r)=>{n&&e.lockedPosition?t+=1:n=!1,e.hiddenPerDefault&&i.columns.push(r),"string"===typeof e.sortOrder&&(a.initialConfig={column:r,sortOrder:e.sortOrder}),e.disableSorting&&(a.indicator=!1)})),window.matchMedia("(max-width: 767px)").matches&&(t=0),e=e.map((e=>{let t=!1;return["checkbox"].includes(e.type)&&(t=!0),null!=e.noHeaderContextMenu&&({noHeaderContextMenu:t}=e),{...e,noHeaderContextMenu:t}})),{columns:e,hiddenColumns:i,fixedColumnsLeft:t,columnSorting:a}},allVisible(){return!(null!=this.tableData&&!this.loading)||Object.values(this.tableData).length===this.visibleRows.length}},created(){this.columnSettingsMiddleware.push(this.columnSettingsCheckFeatures),this.columnSettingsMiddleware.push(this.columnSettingsAddBoundary),this.columnSettingsMiddleware.push(this.columnSettingsAddGuidColumn)},methods:{addHotHook(e,t){this.hotHooks.push({key:e,callback:t})},tableMounted(){this.hot=this.$refs.table.hot,this.hotHooks.forEach((({key:e,callback:t})=>this.hot.addHook(e,t)))},columnSettingsCheckFeatures(e){return e.filter((e=>"function"!==typeof e.requiredFeatures||e.requiredFeatures(this.$store,this)))},columnSettingsAddBoundary(e){return e.map((e=>"dropdown"!==e.type||null!=e.dropdownBoundary?e:{...e,getDropdownBoundary:e.getDropdownBoundary||(()=>this.$el)}))},columnSettingsAddGuidColumn(e){return e.some((e=>e.key===hI.key))?e:[hI,...e]}}};function yD(e={}){return{data(){return{columnSettingsMiddleware:[]}},computed:{...(0,C.Se)({varieties:"varieties",varietiesUsed:"varieties/used"})},created(){this.columnSettingsMiddleware.push(this.columnDropdownVarietiesColumnSettings),this.addHotHook("afterSelection",this.columnDropdownVarietiesAfterSelection),this.addHotHook("afterChange",this.columnDropdownVarietiesAfterChange)},methods:{columnDropdownVarietiesColumnSettings(t){return t.map((t=>Object.keys(e).includes(t.key)?{...t,getRendererValue:(...i)=>this.columnDropdownVarietiesGetRendererValue(e[t.key],...i),getItems:(...e)=>this.columnDropdownVarietiesGetItems(...e)}:t))},columnDropdownVarietiesGetRendererValue(e,{value:t,visualRow:i,guid:a}){let n=a;null==n&&(n=this.$refs.table.visualRowToGuid(i));let r="";return null!=this.varieties[t]&&"string"===typeof this.varieties[t].name?r=this.varieties[t].name:null!=n&&null!=this.tableData[n]&&null!=Ru(this.tableData[n],e)&&"string"===typeof Ru(this.tableData[n],e).name&&(r=Ru(this.tableData[n],e).name),r},async columnDropdownVarietiesGetItems(){return await this.$store.dispatch("varieties/subscribe"),[{name:this.$t("Zuletzt verwendet"),id:"varieties-used",items:this.varietiesUsed.map((e=>({id:e,name:this.varieties[e].name}))),sort:!1},{name:this.$t("Sorten"),id:"varieties",items:Object.values(this.varieties).filter((e=>!this.varietiesUsed.includes(e[R]))).map((e=>({id:e[R],name:e.name}))),sort:!0}]},columnDropdownVarietiesAfterSelection(t,i){const a=this.hot.toPhysicalColumn(i);Object.keys(e).includes(this.tableSettings.columns[a].key)&&this.$store.dispatch("varieties/subscribe")},columnDropdownVarietiesAfterChange(t,i){["edit","CopyPaste.paste"].includes(i)&&Array.isArray(t)&&t.forEach((([,t,,i])=>{const a=this.hot.propToCol(t);Object.keys(e).includes(this.tableSettings.columns[a].key)&&null!=this.varieties[i]&&this.$store.commit("varieties/useItem",i)}))}}}}const vD=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...rA,header:{title:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld"),description:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld")},width:145,lockedPosition:!0,sortOrder:"asc"},{..._F,readOnly:!0,width:85},{...DF,lockedPosition:!1,readOnly:!0,width:95},{...MF,readOnly:!0,width:95},{...eA,hiddenPerDefault:!0,readOnly:!0},{...IF,hiddenPerDefault:!0,readOnly:!0},{...tA,hiddenPerDefault:!0,readOnly:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>=0},{...aA,hiddenPerDefault:!0,readOnly:!0,width:145},{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},{...PF,hiddenPerDefault:!0,readOnly:!0},{...TF,hiddenPerDefault:!0,readOnly:!0},{...xF,hiddenPerDefault:!0,readOnly:!0},{...BF,hiddenPerDefault:!0,readOnly:!0},{...$F,hiddenPerDefault:!0,readOnly:!0},{...RF,hiddenPerDefault:!0,readOnly:!0},{...NF,hiddenPerDefault:!0,readOnly:!0},{...zF,hiddenPerDefault:!0,readOnly:!0},{...nA,hiddenPerDefault:!0,readOnly:!0},{...LF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...VF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},dA],bD=[...vD,{...OF,hiddenPerDefault:!0,readOnly:!0},{...UF,hiddenPerDefault:!0,readOnly:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_GROUNDWATER_PROTECTION)}];var wD={international:vD,[ee.AT]:bD,[ee.DE]:vD};const CD="kindOfUseTypes",FD="catchCropVariants",AD="amaCodes",kD="gwAreas";function SD(e,t){const i=[{name:"keines",id:"gwNone"}];return t.oepulGw&&i.push({name:"ÖPUL GWA",id:"gwOepul"}),t.gradGw&&i.push({name:"WRRL GW GRAD",id:"gwGrad"}
1),"sgd8"===e&&t.nRisiko&&(i.push({name:"N-RISIKO",id:"nRisiko"}),t.oepulGw&&i.push({name:"N-RISIKO + ÖPUL GWA",id:"nRisikoGw"})),i}var ED={computed:{...(0,C.Se)({kindOfUseTypes:"fields/kindOfUseTypes",kindOfUseTypesById:"fields/kindOfUseTypesById",catchCropVariants:"fields/catchCropVariants",catchCropVariantsById:"fields/catchCropVariantsById",amaCodes:"fields/amaCodes",amaCodesById:"fields/amaCodesById",gwAreas:"fields/gwAreas",gwAreasById:"fields/gwAreasById"})},methods:{dropdownItemsForFieldsGetRendererValue(e,{value:t}){const i=`${e}ById`;return null==this[i]||null==this[i][t]?"":this[i][t].name},dropdownItemsForFieldsGetItems(e){let t;if(e===CD)t=this.$t("Nutzungsarten");else{if(e===FD)return t=this.$t("Begrünung"),[{name:t,id:e,items:"sgd8"===this.sgdVersion?this[e].slice(22):this[e].slice(0,22)}];if(e===AD)t=this.$t("AMA Codes");else if(e===kD)return t=this.$t("Aktionsgebiet"),[{name:t,id:e,items:SD(this.sgdVersion,this.currentCompanies.find(ka))}]}return[{name:t,id:e,items:this[e]}]}}};function ID(e={}){return{data(){return{columnSettingsMiddleware:[]}},computed:ED.computed,created(){this.columnSettingsMiddleware.push(this.columnDropdownForFieldsColumnSettings)},methods:{...ED.methods,columnDropdownForFieldsColumnSettings(t){return t.map((t=>Object.keys(e).includes(t.key)?{...t,getRendererValue:(...i)=>this.dropdownItemsForFieldsGetRendererValue(e[t.key],...i),getItems:async(...i)=>this.dropdownItemsForFieldsGetItems(e[t.key],...i)}:t))}}}}var _D=(0,b.defineComponent)({name:"TableFieldsContainer",components:{TableBase:oD,TableFooter:hD},props:{tableId:{type:String,required:!0},allowFieldsWithNoContour:{type:Boolean,default:!1},filterString:{type:String,default:""},selectedRows:{type:Array,default:null},customColumnDefinition:{type:Object,default:null},customTableData:{type:Object,default:null},sumProcessedArea:{type:Number,default:null}},mixins:[gD,mD("fields"),fD("fields"),rI(XF.key),dI({[DF.key]:"crop",[PF.key]:"preCrop"}),sI({[tA.key]:"fieldGroup.customer"}),yD({[MF.key]:"variety"}),ID({[xF.key]:CD,[TF.key]:FD,[OF.key]:AD,[UF.key]:kD}),oI],data(){return{columnDefinition:wD}},watch:{customColumnDefinition:{handler(){this.customColumnDefinition&&(this.columnDefinition=this.customColumnDefinition)},immediate:!0}},created(){this.addHotHook("beforeOnCellMouseOver",((e,{row:t,col:i})=>{if(this.allowFieldsWithNoContour)return;const a=this.$refs.table.visualRowToGuid(t),n=this.hot.toPhysicalColumn(i);a&&(this.tableSettings.columns[n].key!==oA.key||this.hasFieldContour(a)||this.$emit("update:cellReadOnly",e.target))}))},computed:{processedAreaOrFieldSizeTotal(){return this.sumProcessedArea?Bl()(this.sumProcessedArea).format():this.sizeTotalFormatted},...(0,C.rn)("fields",{loadingNdvi:e=>e.loadingNdvi,pendingNdvi(e){return Object.values(e.data).filter((e=>void 0===e.ndvi))},loadingMbi:e=>e.loadingMbi,pendingMbi:e=>Object.values(e.data).filter((e=>void 0===e.mbi))}),loading(){const e=!!this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.getters["customers/loading"];return this.$store.getters["fields/loading"]||this.$store.getters["products/crops/loading"]||this.$store.getters["varieties/loading"]||e},customTableDataOrDefault(){return this.customTableData||this.tableData}},methods:{async loadNdviData(){if(!this.$refs.table)return;await this.$refs.table.$nextTick(),await this.$refs.table.$nextTick();const e=this.$refs.table.getColumnsForPageSettings().find((e=>"ndvi"===e.key));e&&e.visible&&!this.loadingNdvi&&await this.$store.dispatch("fields/loadNdvi",this.pendingNdvi)},async onTableSettingsChanged(){this.loadNdviData(),this.loadMbiData()},async loadMbiData(){if(!this.$refs.table)return;await this.$refs.table.$nextTick(),await this.$refs.table.$nextTick();const e=this.$refs.table.getColumnsForPageSettings().find((e=>"mbi"===e.key));e&&e.visible&&!this.loadingMbi&&await this.$store.dispatch("fields/loadMbi",this.pendingMbi)},cells(e,t,i){if(this.allowFieldsWithNoContour||this.tableSettings.columns[t].key!==oA.key)return i;const a=this.$refs.table.physicalRowToGuid(e);return null==this.tableData[a]?i:{...i,readOnly:!this.hasFieldContour(a)}},selectAllRows(){let e=[...new Array(this.hot.countRows()).keys()].map((e=>this.$refs.table.visualRowToGuid(e)));this.allowFieldsWithNoContour||(e=e.filter((e=>this.hasFieldContour(e)))),this.$emit("update:selectedRows",e)},hasFieldContour(e){const t=this.tableData[e];return null!=t&&null!=t.fieldContour&&null!=t.fieldContour.geoJson&&"Polygon"===t.fieldContour.geoJson.type},loadAdditionalData(){this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe"),this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.dispatch("customers/subscribe")},updateCell(e){this.$emit("update:cell",e)},async tableMounted(){this.loadNdviData(),this.loadMbiData()}}}),DD=_D,MD=(0,ew.Z)(DD,aI,nI,!1,null,"6712e107",null),PD=MD.exports,TD=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.SidebarFilterBadgesContainer,{attrs:{allFilters:i.filteredCrops,activeFilters:e.activeFilters,emptyFilterLabel:e.$t("Keine Kultur")},on:{"update:filter":t=>e.$emit("update:filter",t)}})},xD=[],BD=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.allFilters.length?t("div",{staticClass:"filterContainer"},[t("div",{staticClass:"badgeContainer",class:{"additional-visible":i.additionalVisible}},e._l(e.allFilters.slice(0,e.allFilters.length),(function(a){return t(i.Badge,{key:a,attrs:{label:""!==a?a:e.emptyFilterLabel,isActive:i.activeFilters.includes(a)},on:{onBadgeClick:()=>i.toggleFilter(a)}})})),1),e.allFilters.length>5?t(i.ButtonLink,{staticClass:"text-small collapsable__toggle",on:{click:function(e){i.additionalVisible=!i.additionalVisible}}},[e._v(e._s(i.additionalVisible?e.$t("Weniger anzeigen"):e.$t("Mehr anzeigen"))+" ")]):e._e(
1)],1):e._e()},OD=[],$D=function(){var e=this,t=e._self._c;return t("div",[t("div",{ref:"badge",staticClass:"badge",class:{"badge-active":e.isActive},attrs:{id:`badge-${e.label}`},on:{click:function(t){return e.$emit("onBadgeClick")}}},[t("span",{staticClass:"label"},[e._v(e._s(e.label))])]),t("BTooltip",{attrs:{target:`badge-${e.label}`,placement:"bottomright"}},[e._v(e._s(e.label))])],1)},RD=[],ND={name:"Badge",props:{label:{type:String,required:!0},isActive:{type:Boolean,default:!1}}},zD=ND,LD=(0,ew.Z)(zD,$D,RD,!1,null,"468d6990",null),VD=LD.exports,UD=(0,b.defineComponent)({__name:"SidebarFilterBadgesContainer",props:{allFilters:{default:()=>[]},activeFilters:{default:()=>[]},emptyFilterLabel:{default:"(empty)"}},emits:["update:filter"],setup(e,{emit:t}){const i=e;ow.vI.add(uw._tD);const a=(0,b.ref)([]),n=(0,b.ref)(!1);function r(e){a.value.includes(e)?a.value=a.value.filter((t=>t!==e)):a.value.push(e),a.value.length?t("update:filter",{type:"contains",value:"",selectedValues:a.value}):t("update:filter",null)}return(0,b.watch)((()=>i.activeFilters),(()=>{i.activeFilters&&i.activeFilters.length!==i.allFilters.length?a.value=i.activeFilters:a.value=[]})),{__sfc:!0,props:i,activeFilters:a,additionalVisible:n,emit:t,toggleFilter:r,Badge:VD,ButtonLink:Fw}}}),jD=UD,HD=(0,ew.Z)(jD,BD,OD,!1,null,"e75744e2",null),GD=HD.exports,WD=(0,b.defineComponent)({__name:"CropFilters",props:{fields:{default:()=>[]},cropsById:{default:()=>({})},activeFilters:{default:()=>[]}},setup(e){const t=e,i=(0,b.computed)((()=>{const e={};t.fields.forEach((i=>{let{cropId:a}=i;const{fieldSize:n}=i;if(null==a)a="no-crop";else if(null==t.cropsById[a]||n<=0)return;null==e[a]&&(e[a]={id:a,name:"no-crop"===a?"":t.cropsById[a].name,area:0}),e[a].area+=n}));const i=Object.values(e).sort(((e,t)=>t.area-e.area));return i.map((e=>e.name))})),a=(0,b.computed)((()=>[...new Set(i.value)]));return{__sfc:!0,props:t,cropsData:i,filteredCrops:a,SidebarFilterBadgesContainer:GD}}}),ZD=WD,KD=(0,ew.Z)(ZD,TD,xD,!1,null,null,null),qD=KD.exports,YD=(0,b.defineComponent)({name:"SidebarFields",components:{SearchBar:YE,SidebarHeadline:iI,CropFilters:qD,SidebarTableFieldsContainer:PD,ModalPageSettings:HE},props:{tableId:{type:String,required:!0},allowFieldsWithNoContour:{type:Boolean,default:!1},selectedRows:{type:Array,default:()=>[]},description:{type:String,default:""},customColumnDefinition:{type:Object,default:null},customTableData:{type:Object,default:null},headlineLabel:{type:String,default(){return this.$t("Felder auswählen")}},sumProcessedArea:{type:Number,default:null}},data(){return{visibleRows:[],filterString:"",cellReadOnly:null,columnsForPageSettings:null}},created(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("products/crops/subscribe")},methods:{updateCellReadOnly(e){this.cellReadOnly=null,null!=e&&this.$nextTick((()=>{this.cellReadOnly={target:e,message:this.$t("Das Feld besitzt keine Kontur")||"Das Feld besitzt keine Kontur"}}))},async showTableSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},onFilterChange(e){this.$refs.table.$refs.table.setColumnFilter(e,"cropId")},updateCell(e){this.$emit("update:cell",e)}},computed:{...(0,C.Se)({fields:"fields/data",crops:"products/crops/data"})}}),JD=YD,XD=(0,ew.Z)(JD,DE,ME,!1,null,"b6ea0dda",null),QD=XD.exports,eM=(0,b.defineComponent)({name:"SecondStep",components:{SidebarFields:QD},props:{selectedRows:{type:Array,default:()=>[]},customColumnDefinition:{type:Object,default:null},customTableData:{type:Object,default:null},sumProcessedArea:{type:Number,default:null}}}),tM=eM,iM=(0,ew.Z)(tM,IE,_E,!1,null,"10fbb2ba",null),aM=iM.exports,nM=(0,b.defineComponent)({name:"SecondStepContainer",components:{SecondStep:aM},props:{customColumnDefinition:{type:Object,default:null}},computed:{selectedFields(){return this.$store.getters["activities/createEditActivity/selectedFields"]},sumProcessedArea(){return this.$store.getters["activities/createEditActivity/sumProcessedArea"]},activities(){return this.$store.state.activities.createEditActivity.activities},customTableData(){const e=new La(this.$store.state.products.mineralFertilizers.data,this.$store.state.products.companyFertilizers.data,this.$store.state.products.secondaryFertilizers.data,this.$store.state.products.herbizides.data,this.$store.state.products.crops.data,this.$store.state.products.miscellaneous.data,this.$store.state.products.harvests.data,this.$store.state.products.seeds.data,this.$store.state.products.otherProductsAndFertilizers.data,this.$store.state.products.waads.data),t=new Aa(this.$store.state.units.data,e,$a),i=new at(this.activities,t),a=this.$store.state.fields.data,n={};
1return Object.entries(a).forEach((([e,t])=>{const a=i.findActivityByFieldId(t.id);n[e]={...t,processedAreaOrFieldSize:a?.processedArea??t.fieldSize}})),n}},methods:{updateSelectedFields(e){Ha()(e,this.selectedFields)||this.$store.dispatch("activities/createEditActivity/updateActivitiesBasedOnSelectedFields",e)},updateCell({guid:e,columnKey:t,value:i}){"processedAreaOrFieldSize"===t&&this.$store.dispatch("activities/createEditActivity/updateActivitiesBasedOnProcessedArea",{fieldId:e,processedArea:i})}}}),rM=nM,sM=(0,ew.Z)(rM,SE,EE,!1,null,null,null),oM=sM.exports,lM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ThirdStep",{attrs:{id:"modal-step-content"},on:{addActivityProduct:e.addActivityProduct}})},dM=[],cM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"third-step-content-wrapper"},[t("div",[t("ProductAmountModeSectionContainer"),t("ProductSelectSectionContainer"),t("AddSectionButton",{attrs:{label:e.$t("Produkt hinzufügen")||""},on:{click:e.addActivityProduct}})],1),t("div",{staticClass:"product-detail-section"},[t("FavouriteProductsSectionContainer"),t("ProductDetailsContainer")],1),t("div",[t("EquipmentSelectSectionsContainer")],1)])},uM=[],pM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[e.featureEquipmentEnabled&&e.featureEquipmentVisible?t("MultiRootWrapper",[e._l(e.activityEquipments,(function(i){return t("EquipmentSelectSection",{key:i.id,attrs:{dropdownItem:e.getDropdownItem(i.equipmentId),dropdownItemsPerCategory:e.compatibleEquipments,activityEquipment:i,fieldNamesPerActivity:e.fieldNamesPerActivity},on:{"update:activityEquipment":e.updateActivityEquipment,"remove:activityEquipment":e.removeActivityEquipment}})})),t("AddSectionButton",{attrs:{label:e.$t("Maschine hinzufügen")},on:{click:e.createActivityEquipment}})],2):e.featureEquipmentVisible?t("EquipmentSelectSectionNotAvailable"):e._e()],1)},hM=[],mM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ButtonLink",{attrs:{icon:["fal","plus-circle"],"leading-icon":"",disabled:e.disabled},on:{click:function(t){return e.$emit("click")}}},[e._v(" "+e._s(e.label)+" ")])},fM=[],gM=(0,b.defineComponent)({name:"AddSectionButton",components:{ButtonLink:Fw},props:{label:{type:String,required:!0},disabled:{type:Boolean,required:!1,default:!1}}}),yM=gM,vM=(0,ew.Z)(yM,mM,fM,!1,null,null,null),bM=vM.exports,wM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{staticClass:"pb-2",attrs:{collapsible:"",headline:e.headline}},[t("div",{staticClass:"equipment-section"},[t("div",[t("FormFieldDropdown",{ref:"equipments",staticClass:"equipment-dropdown",attrs:{label:e.$t("Maschine auswählen"),value:e.dropdownItem,items:e.dropdownItemsPerCategory,disableDelete:"",slimMargin:"",positionFixed:!1,boundary:"modal-step-content"},on:{update:e.update}})],1),t("RemoveSectionButton",{attrs:{label:e.$t("Maschine entfernen")||"Maschine entfernen"},on:{remove:e.remove}})],1)])},CM=[],FM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ButtonLink",{attrs:{color:"red",icon:"trash-alt","leading-icon":"",disabled:e.disabled},on:{click:function(t){return e.$emit("remove")}}},[e._v(" "+e._s(e.label)+" ")])},AM=[];ow.vI.add(uw.I7k);var kM=(0,b.defineComponent)({name:"ProductSelectSection",components:{ButtonLink:Fw},props:{label:{type:String,required:!0},disabled:{type:Boolean,required:!1,default:!1}}}),SM=kM,EM=(0,ew.Z)(SM,FM,AM,!1,null,null,null),IM=EM.exports;ow.vI.add(uw.I7k);var _M=(0,b.defineComponent)({name:"EquipmentSelectSection",components:{FormFieldSet:_k,FormFieldDropdown:lk,RemoveSectionButton:IM},props:{dropdownItem:{type:Object,required:!0},dropdownItemsPerCategory:{type:Array,required:!0},activityEquipment:{type:Object,required:!0},fieldNamesPerActivity:{type:Object,required:!0}},computed:{headline(){return""!==this.dropdownItem.name?this.activityEquipment.activityIds.length!==Object.keys(this.fieldNamesPerActivity).length?1===this.activityEquipment.activityIds.length?`${this.dropdownItem.name} (${this.fieldNamesPerActivity[this.activityEquipment.activityIds[0]]})`:`${this.dropdownItem.name} (${this.$t("verschiedene")})`:this.dropdownItem.name:this.$t("Maschine")}},methods:{update(e){const t={...this.activityEquipment,equipmentId:e.id??""};this.$emit("update:activityEquipment",t)},remove(){this.$emit("remove:activityEquipment",this.activityEquipment)}}}),DM=_M,MM=(0,ew.Z)(DM,wM,CM,!1,null,"46297f16",null),PM=MM.exports,TM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{staticClass:"pb-2",attrs:{collapsible:"",headline:e.$t("Maschine")}},[t("FeatureNotAvailable",{attrs:{featureVisible:!0}})],1)},xM=[],BM=(0,b.defineComponent)({name:"EquipmentSelectSectionNotAvailable",components:{FeatureNotAvailable:Ew,FormFieldSet:_k}}),OM=BM,$M=(0,ew.Z)(OM,TM,xM,!1,null,null,null),RM=$M.exports,NM=function(){var e=this,t=e._self._c;return t("div",{staticClass:"multi-root-wrapper"},[e._t("default")],2)},zM=[],LM={name:"MultiRootWrapper"},VM=LM,UM=(0,ew.Z)(VM,NM,zM,!1,null,"0af37d1c",null),jM=UM.exports,HM=(0,b.defineComponent)({name:"EquipmentSelectSectionContainer",components:{AddSectionButton:bM,EquipmentSelectSection:PM,MultiRootWrapper:jM,EquipmentSelectSectionNotAvailable:RM},created(){this.$store.dispatch("equipments/subscribe")},data(){return{defaultDropdownItem:{id:"",name:""}}},computed:{currentCompanies(){const e=this.$store.getters["activities/createEditActivity/selectedCompanyIds"];return e.map((e=>this.$store.getters["auth/getCompanyById"](e)))},compatibleEquipments(){if(!this.currentCompanies||0===this.activityTypes.length)return[];const e=new Wa(this.$store.state.equipments.data),t=this.$store.state.equipments.used,i=e.getCompatibleEquipmentsToDropdownItems(this.activityTypes,this.currentCompanies,t);return i},activityTypes(){const e=this.$store.state.activities.createEditActivity.activities?.map((e=>
1e.activityTypeId))??[],t=e.map((e=>this.$store.state.activityTypes.data[e])).filter(ka);return t},activityEquipments(){return this.$store.getters["activities/createEditActivity/mergedActivityEquipment"]},fieldNamesPerActivity(){const e=this.$store.state.activities.createEditActivity.activities??[],t=this.$store.state.fields.data,i={};return e.forEach((e=>{const a=t[e.fieldId??""]?.name??"";i[e.id]=a})),i},featureEquipmentEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EQUIPMENT)},featureEquipmentVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_EQUIPMENT)},equipmentService(){return new Wa(this.$store.state.equipments.data)}},methods:{getDropdownItem(e){return this.equipmentService.findDropdownItem(e)??this.defaultDropdownItem},createActivityEquipment(){this.$store.commit("activities/createEditActivity/createActivityEquipment")},updateActivityEquipment(e){this.$store.dispatch("activities/createEditActivity/updateEquipmentOnActivityEquipmentInAllActivities",{activityEquipmentId:e.ids[0],equipmentId:e.equipmentId})},removeActivityEquipment(e){this.$store.dispatch("activities/createEditActivity/removeActivityEquipmentInAllActivities",e.ids[0]),0===this.activityEquipments.length&&this.createActivityEquipment()}}}),GM=HM,WM=(0,ew.Z)(GM,pM,hM,!1,null,null,null),ZM=WM.exports,KM=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showFavouriteProducts?t("FavouriteProductsSection",{attrs:{favouriteProducts:e.favouriteProducts,units:e.units,products:e.products,processedArea:e.processedArea},on:{addFavouriteProducts:e.addFavouriteProducts}}):e._e()},qM=[],YM=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"favourite-products-section"},[t("div",{staticClass:"favourite-products-header"},[t("h2",[e._v(e._s(e.$t("Meine aktuellen Favoriten")))])]),t("div",{staticClass:"favourite-products-body"},e._l(e.filterEmptyFavouriteProducts,(function(i,a){return t("div",{key:`${a} - product-combinations`,staticClass:"product-combination"},[t("div",{staticClass:"heading-button-wrapper"},[t("h3",[e._v(e._s(`${e.$t("Produktkombination")} ${a+1}`))]),t("Button",{attrs:{variant:"outline-primary",title:e.$t("Wählen")},on:{click:function(t){return e.addFavouriteProducts(i)}}})],1),e._l(i.products,(function(i,a){return t("div",{key:`${a} - product-combination`},[t("div",{staticClass:"favourite-product"},[t("span",{key:`${i.productId} - ${a}`},[e._v(" "+e._s(e.productName(i))+" ")])])])}))],2)})),0)])},JM=[],XM=(0,b.defineComponent)({name:"FavouriteProducts",components:{Button:gw},props:{favouriteProducts:{type:Array,required:!0},products:{type:Array,required:!0},units:{type:Object,required:!0},processedArea:{type:Number,required:!0}},computed:{filterEmptyFavouriteProducts(){return this.favouriteProducts.filter((e=>!!e.products))}},methods:{productName(e){const t=this.products.find((t=>t.id===e.productId))||null,i=e?.unitId||"",a=this.units[i]?.name||"",n=e.amount?Nl(e.amount).format({thousandSeparated:!0,mantissa:2}):"";return`${t?.name} ${n} ${a}`},addFavouriteProducts(e){this.$emit("addFavouriteProducts",e)}}}),QM=XM,eP=(0,ew.Z)(QM,YM,JM,!1,null,"21b4794f",null),tP=eP.exports,iP=(0,b.defineComponent)({name:"FavouriteProductsSectionContainer",components:{FavouriteProductsSection:tP},created(){this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("products/subscribe"),this.$store.dispatch("units/subscribe"),this.$store.dispatch("fields/subscribe")},data(){const e=[];return{favouriteProducts:e}},computed:{findService(){const e=new La(this.$store.state.products.mineralFertilizers.data,this.$store.state.products.companyFertilizers.data,this.$store.state.products.secondaryFertilizers.data,this.$store.state.products.herbizides.data,this.$store.state.products.crops.data,this.$store.state.products.miscellaneous.data,this.$store.state.products.harvests.data,this.$store.state.products.seeds.data,this.$store.state.products.otherProductsAndFertilizers.data,this.$store.state.products.waads.data),t=new Aa(this.$store.state.units.data,e,$a);return new at(this.activities,t)},units(){return this.$store.state.units.data},...(0,C.Se)({currentProcessOrderIds:"auth/currentProcessOrderIds",currentCompanyIds:"auth/currentCompanyIds",products:"products/allProducts"}),fields(){return this.$store.state.fields.data},processedArea(){const e=this.$store.getters["activities/createEditActivity/sumProcessedArea"];return e},activityType(){const e=this.$store.state.activities.createEditActivity.activities?.[0].activityTypeId;if(e)return this.$store.state.activityTypes.data[e]},activities(){return this.$store.state.activities.createEditActivity.activities},currentActivityProduct(){const{currentActivityProductId:e}=this.$store.state.activities.createEditActivity;if(e)return this.findService.findActivityProduct(e)},showFavouriteProducts(){return 0!==this.favouriteProducts.length&&(!this.currentActivityProduct||null===this.currentActivityProduct.productId)},selectedFieldsCropIds(){const e=this.$store.getters["activities/createEditActivity/selectedFields"],t=this.$store.state.fields.data,i=e?.map((e=>t[e]?.cropId)).filter(ka);if(!i)return[];const a=[...new Set(i)];return a},loadFavouriteProductsTriggerKey(){if(this.activityType){const e=this.currentProcessOrderIds?.[0].id,t=[...this.currentCompanyIds].sort().join("-"),i=this.activityType.id,a=[...this.selectedFieldsCropIds].sort().join("-");return`${e}_${t}_${i}_${a}`}return""}},watch:{loadFavouriteProductsTriggerKey:{handler(){this.loadFavouriteProducts()},immediate:!0}},methods:{async loadFavouriteProducts(){if(!this.activityType)return;const{activitiesApi:e}=this.$api,t={companyIds:this.currentCompanyIds.join(","),processOrderId:this.currentProcessOrderIds[0],activityTypeId:this.activityType.id,cropIds:this.selectedFieldsCropIds.join(",")};let i;try{const a=await e.activityFavouriteProducts(t);i=a.data}catch(a){console.error(a),this.favouriteProducts=[]}i&&("success"===i.status?this.favouriteProducts=i.data||[]:this.favouriteProducts=[])},addFavouriteProducts(e){this.$store.dispatch("activities/createEditActivity/addFavouriteProducts",e)}}}),aP=iP,nP=(0,ew.Z)(aP,KM,qM,!1,null,null,null),rP=nP.exports,sP=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.visible?t("ProductAmountModeSection",{attrs:{mode:e.mode},on:{switch:e.switchMode}}
1):e._e()},oP=[],lP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"product-amount-mode"},[t("p",{staticClass:"product-amount-mode__text",domProps:{innerHTML:e._s(e.description)}}),t("ButtonLink",{on:{click:function(t){return e.$emit("switch")}}},[e._v(e._s(e.linkLabel))])],1)},dP=[],cP=(0,b.defineComponent)({name:"ProductAmountModeSection",components:{ButtonLink:Fw},props:{mode:{type:String,required:!0}},computed:{isTotal(){return this.mode===ua.Total},description(){return this.isTotal?this.$t("Die Produktmenge wurde als Gesamtmenge eingegeben. Die Menge pro Hektar hängt von der bearbeiteten Fläche ab.")??"":this.$t("Die Produktmenge wurde pro Hektar eingegeben. Die Gesamtmenge hängt von der bearbeiteten Fläche ab.")??""},linkLabel(){return this.isTotal?this.$t("Klicke hier um die Menge pro Hektar festzulegen.")??"Klicke hier um die Menge pro Hektar festzulegen.":this.$t("Klicke hier um die Gesamtmenge festzulegen.")??"Klicke hier um die Gesamtmenge festzulegen."}}}),uP=cP,pP=(0,ew.Z)(uP,lP,dP,!1,null,"bfd73f48",null),hP=pP.exports,mP=(0,b.defineComponent)({name:"ProductAmountModeSectionContainer",components:{ProductAmountModeSection:hP},computed:{mergedActivityProducts(){return this.$store.getters["activities/createEditActivity/mergedActivityProducts"]},mode(){return this.$store.getters["activities/createEditActivity/productAmountMode"]},visible(){return this.mergedActivityProducts.some((e=>e.unitId))}},methods:{switchMode(){const e=this.mode===ua.Total?ua.PerHa:ua.Total;this.$store.dispatch("activities/createEditActivity/setProductAmountModeForAllProducts",e)}}}),fP=mP,gP=(0,ew.Z)(fP,sP,oP,!1,null,null,null),yP=gP.exports,vP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ProductDetails",{attrs:{activityProducts:e.activityProductsWithProductId,currentActivityProductId:e.currentActivityProductId,products:e.products,storagePlaces:e.storagePlaces},on:{"update:currentActivityProductId":e.updateCurrentActivityProductId}})},bP=[],wP=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.visibleProduct?t("div",{staticClass:"product-details"},[t("div",{staticClass:"product-details-header"},[t("h2",[e._v(e._s(e.visibleProductName))]),t("PageNavigation",{attrs:{current:e.pagination,pages:e.activityProducts.length},on:{back:e.back,next:e.next}})],1),t("div",{staticClass:"product-details-body"},[t("UnitSelectionContainer",{attrs:{selectedProduct:e.visibleProduct}}),t("StorageSelectSectionContainer"),t("PestDetailsContainer")],1)]):e._e()},CP=[],FP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"page-navigation"},[t("Button",{staticClass:"mr-2 p-1",attrs:{variant:"white",disabled:e.disableBackButton},on:{click:e.back}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-left"}})],1),t("Button",{staticClass:"p-1",attrs:{variant:"white",disabled:e.disableNextButton},on:{click:e.next}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}})],1)],1)},AP=[];ow.vI.add(uw.A35,uw._1v,uw._tD);var kP=(0,b.defineComponent)({name:"Page-Navigation",components:{Button:gw},props:{pages:{type:Number,required:!0},current:{type:Number,required:!0}},computed:{disableBackButton(){return 1===this.pages||0===this.current},disableNextButton(){return 1===this.pages||this.current===this.pages-1}},methods:{back(){this.disableBackButton||this.$emit("back")},next(){this.disableNextButton||this.$emit("next")}}}),SP=kP,EP=(0,ew.Z)(SP,FP,AP,!1,null,"bbf40988",null),IP=EP.exports,_P=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showPestDetails?t("PestDetails",{attrs:{selectedPestId:e.currentActivityProduct?.pestId,selectedPestName:e.pestName,selectedPestIndicationId:e.currentActivityProduct?.pesticideIndicationId,selectedProduct:e.selectedProduct,compatiblePestIndications:e.compatiblePestIndications,units:e.units,regionCodes:e.currentRegionCodes,selectedFieldsCropIds:e.selectedFieldsCropIds}}):e.showFeatureNotAvailable?t("FeatureNotAvailable",{scopedSlots:e._u([{key:"featureName",fn:function(){return[t("h3",[e._v(e._s(`${e.$t("Hinweise für")} "${e.pestName}"`))])]},proxy:!0}])}
1):e._e()},DP=[],MP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"pest-details"},[t("h3",[e._v(e._s(`${e.$t("Hinweise für")} "${e.selectedPestName}"`))]),t("ul",[t("li",[e._v(e._s(`${e.$t("Maximale Menge")}: ${e.maxAmount}`))]),t("li",[e._v(e._s(`${e.$t("Maximale Anzahl von Anwendungen pro Erntejahr:")} ${e.maxTreatmentsPerCropYear} `))]),t("li",[e._v(e._s(`${e.$t("Maximale Anzahl von Anwendungen:")} ${e.maxTreatments}`))]),t("li",[e._v(e._s(`${e.$t("Wartezeit bis zur Ernte:")} ${e.waitPeriodUntilHarvest}`))]),t("li",[e._v(e._s(`${e.$t("Wartezeit zwischen Anwendungen:")} ${e.waitPeriodBetweenTreatments}`))]),t("li",[e._v(e._s(`${e.$t("Beschränkungen bei der Ernte:")} ${e.cropLimitations}`))]),t("li",[e._v(e._s(`${e.$t("Beschränkungen für Schädlinge:")} ${e.pestLimitation}`))]),e._l(e.bbchStageItems,(function(i,a){return t("li",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.viewport",value:e.bbchStageTooltipOptions(i),expression:"bbchStageTooltipOptions(bbchStage)",modifiers:{hover:!0,viewport:!0}}],key:`bbch-stage-${a}`,attrs:{title:i.hoverText||""}},[e._v(" "+e._s(i.text)+" ")])})),t("li",[e._v(e._s(`${e.$t("Zugelassen bis:")} ${e.approvedUntil}`))]),t("li",[e._v(e._s(`${e.$t("Verwendbar bis:")} ${e.useUntil}`))])],2),e._l(e.pesticideCatalogues,(function(i,a){return t("ButtonLink",{key:a,attrs:{href:i.link,target:"_blank",disabled:0===Object.keys(e.pesticideCatalogues).length}},[e._v(" "+e._s(`${Object.keys(e.pesticideCatalogues).length>1?a+":":""} ${i.name}`)+" ")])}))],2)},PP=[],TP=(0,b.defineComponent)({name:"PestDetails",components:{ButtonLink:Fw},props:{selectedPestId:{type:String,required:!0},selectedPestName:{type:String,required:!0},selectedPestIndicationId:{type:String,required:!0},selectedProduct:{type:Object,required:!0},compatiblePestIndications:{type:Array,required:!0},units:{type:Object,required:!0},selectedFieldsCropIds:{type:Array,required:!0},regionCodes:{type:Array,required:!0}},computed:{pesticideIndication(){return this.compatiblePestIndications.find((e=>e.id===this.selectedPestIndicationId))},maxAmount(){if(this.pesticideIndication?.maxAmount||this.pesticideIndication?.maxAmountUnitId){const e=this.pesticideIndication.maxAmountUnitId?this.units[this.pesticideIndication.maxAmountUnitId]:void 0;return`${this.pesticideIndication.maxAmount||""} ${e?.name||""}${this.pesticideIndication.isSplitting?", Splitting":""}`}return"-"},maxTreatmentsPerCropYear(){return`${this.pesticideIndication?.maxApplicationsPerVegetation||"-"}`},maxTreatments(){return`${this.pesticideIndication?.maxApplicationsPerInfestation||"-"}`},waitPeriodUntilHarvest(){return`${this.pesticideIndication?.waitPeriod||"-"}`},waitPeriodBetweenTreatments(){return this.pesticideIndication?.minTimeBetweenApplicationsOriginal&&this.pesticideIndication?.maxTimeBetweenApplicationsOriginal&&this.pesticideIndication?.timeBetweenApplicationsUnit?`${this.pesticideIndication.minTimeBetweenApplicationsOriginal} - ${this.pesticideIndication.maxTimeBetweenApplicationsOriginal} ${this.pesticideIndication.timeBetweenApplicationsUnit} `:"-"},cropLimitations(){if(this.pesticideIndication?.cropLimitations){const e=Object.fromEntries(Object.entries(this.pesticideIndication?.cropLimitations).filter((([e],t)=>e.includes(this.selectedFieldsCropIds[t]))));return Object.values(e).flat().join(", ")}return"-"},pestLimitation(){return this.pesticideIndication?.pestLimitations&&this.selectedPestId?`${this.pesticideIndication.pestLimitations[this.selectedPestId]||"-"}`:"-"},approvedUntil(){if(this.pesticideIndication?.approvalEnd){const e=new Date(ca(this.pesticideIndication.approvalEnd)).toLocaleDateString("de-AT");return`${e}`}return"-"},useUntil(){if(this.selectedProduct?.pesticide?.gracePeriodUsageDate){const{gracePeriodUsageDate:e}=this.selectedProduct.pesticide,t=new Date(ca(e)).toLocaleDateString("de-AT");return`${t}`}return"-"},bbchStageItems(){const e=this.pesticideIndication?.bbchStages??[];return e.reduce(((e,t)=>{const i=this.formatBbchStageText(t);return i?(e.push({text:i,hoverText:this.getBbchStageHoverText(t)}),e):e}),[])},pesticideCatalogues(){const e={},t={name:"",link:""};
1return this.regionCodes.forEach((i=>{if(this.pesticideIndication?.externalId)if("de"===i){const e=this.pesticideIndication.externalId.split("/"),i=e[0];t.name=this.$t("Pflanzenschutzmittelkatalog öffnen")||"Pflanzenschutzmittelkatalog öffnen",t.link=`https://psm-zulassung.bvl.bund.de/psm/jsp/BlattAnwendg.jsp?awg_id=${this.pesticideIndication.externalId}&kennr=${i}`}else{const e=this.pesticideIndication?.externalId.split("/"),i=e[0],a=e[1];t.name=this.$t("Link zu AGES Register")||"Link zu AGES Register",t.link=`https://psmregister.baes.gv.at/psmregister/faces/indication.jspx?refNr=${i}&indNr=${a}&locale=de`}e[i.toUpperCase()]=t})),e}},methods:{bbchStageTooltipOptions(e){return e.hoverText?{title:e.hoverText,boundary:"viewport"}:null},formatBbchStageText(e){const{lowerBound:t}=e,{upperBound:i}=e,a=e.text||"",n=a.trim(),r=this.$t("Anwendungszeitpunkt:");let s=null;return null!==t&&void 0!==t&&null!==i&&void 0!==i?s=`BBCH ${t} - ${i}`:null!==t&&void 0!==t?s=`${this.$t("ab BBCH")} ${t}`:null!==i&&void 0!==i&&(s=`${this.$t("bis BBCH")} ${i}`),n&&s?`${r} ${s} (${n})`:n?`${r} ${n}`:s?`${r} ${s}`:null},getBbchStageHoverText(e){const t=e.descriptionLowerBound?.trim(),i=e.descriptionUpperBound?.trim(),a=[];return t&&a.push(`BBCH ${e.lowerBound}: ${t}`),i&&a.push(`BBCH ${e.upperBound}: ${i}`),a.length>0?a.join("; "):void 0}}}),xP=TP,BP=(0,ew.Z)(xP,MP,PP,!1,null,"68d60b95",null),OP=BP.exports,$P=(0,b.defineComponent)({name:"PestDetailsContainer",components:{PestDetails:OP,FeatureNotAvailable:Ew},data(){const e=[];return{pestIndications:e}},created(){this.$store.dispatch("units/subscribe"),this.$store.dispatch("pests/subscribe")},computed:{...(0,C.rn)("auth",["currentCompanies"]),...(0,C.rn)("pests",{pests:"data"}),...(0,C.rn)("units",{units:"data"}),...(0,C.rn)("fields",{fields:"data"}),...(0,C.rn)("productCategories",{productCategories:"data"}),activityTimeStarts(){return this.$store.getters["activities/createEditActivity/activityTimeStarts"]},currentActivityProduct(){return this.$store.getters["activities/createEditActivity/currentActivityProduct"]},selectedProduct(){return this.currentActivityProduct?.productId?this.$store.getters["products/findProductById"](this.currentActivityProduct.productId):null},selectedFieldsCropIds(){const e=this.$store.getters["activities/createEditActivity/selectedFields"],t=this.$store.state.fields.data,i=e?.map((e=>t[e]?.cropId)).filter(ka);if(!i)return[];const a=[...new Set(i)];return a},compatiblePestIndications(){if(!this.selectedProduct||!Ki(this.selectedProduct,this.productCategories))return[];const e=this.$store.getters["pesticideIndications/compatiblePesticideIndications"](this.selectedProduct.id,this.selectedFieldsCropIds,this.activityTimeStarts);return e},pestName(){return this.currentActivityProduct?.pestId?this.pests[this.currentActivityProduct?.pestId].name:""},showPestDetails(){return!!this.featurePesticideDetailsEnabled&&(!!this.featurePesticideDetailsVisible&&this.herbicideSelected)},showFeatureNotAvailable(){return!this.featurePesticideDetailsEnabled&&(!!this.featurePesticideDetailsVisible&&this.herbicideSelected)},herbicideSelected(){return!!this.selectedProduct&&(!(!this.currentActivityProduct?.pestId||!this.currentActivityProduct?.pesticideIndicationId)&&Ki(this.selectedProduct,this.productCategories))},featurePesticideDetailsEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_ACTIVITIES_PESTICIDE_DETAILS)},featurePesticideDetailsVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_ACTIVITIES_PESTICIDE_DETAILS)},currentRegionCodes(){const e=new Set;return this.currentCompanies.forEach((t=>e.add(t.region.code))),Array.from(e)}},watch:{selectedProduct:{handler(e){if(Ki(e,this.productCategories)){const t=[e.id];this.$store.dispatch("pesticideIndications/loadByIds",t)}},immediate:!0}}}),RP=$P,NP=(0,ew.Z)(RP,_P,DP,!1,null,null,null),zP=NP.exports,LP=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showStorageSelectSection?t("StorageSelectSection",{attrs:{currentStorageSelection:e.currentStorageSelection,otherStorageSelections:e.otherStorageSelections},on:{applyStockLevel:e.applyStockLevel,addProductWithStockLevel:e.addProductWithStockLevel}}):e.showStorageSelectSectionEmpty?t("StorageSelectSectionEmpty"):e.showFeatureNotAvailable?t("FeatureNotAvailable",{scopedSlots:e._u([{key:"featureName",fn:function(){return[t("h3",[e._v(e._s(e.$t("Lager")))])]},proxy:!0}])}
1):e._e()},VP=[],UP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"storage-select-section"},[t("div",[t("h3",{staticClass:"storage-details-header"},[e._v(e._s(e.$t("Lager")))]),t("div",{staticClass:"storage-selection-container"},[t("StorageSelection",{attrs:{storageSelection:e.currentStorageSelection},on:{applyStockLevel:e.applyStockLevel}})],1)]),e.otherStorageSelections.length>0?t("div",[t("h3",{staticClass:"storage-details-header"},[e._v(e._s(e.$t("Dieses Produkt in anderen Lagern")))]),t("div",{staticClass:"storage-selection-container"},e._l(e.otherStorageSelections,(function(i){return t("StorageSelection",{key:i.storagePlace?.id??"general-storage",attrs:{storageSelection:i},on:{applyStockLevel:e.addProductWithStockLevel}})})),1)]):e._e()])},jP=[],HP=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"storage-selection"},[t("span",[e._v(e._s(e.leftOnStorageDescription))]),t("div",{attrs:{id:`button-apply-storage-${e.stockLevel.storagePlaceId??"general-storage"}`}},[t("Button",{class:{"text-medium bg-white":!e.applyButtonEnabled},attrs:{variant:e.applyButtonEnabled?"outline-primary":"outline-medium",size:"md",disabled:!e.applyButtonEnabled},on:{click:e.onApplyClick}},[e._v(" "+e._s(e.$t("Lagerstand anwenden"))+" ")])],1),e.applyButtonEnabled?e._e():t("BTooltip",{attrs:{target:`button-apply-storage-${e.stockLevel.storagePlaceId??"general-storage"}`,placement:"bottom",delay:"500"}},[e._v(" "+e._s(e.$t("Lagerstand zu niedrig"))+" ")])],1)},GP=[],WP=(0,b.defineComponent)({name:"StorageSelection",components:{Button:gw},props:{storageSelection:{type:Object,required:!0}},data(){return{applyButtonClicked:!1}},computed:{stockLevel(){return this.storageSelection.stockLevel},storagePlace(){return this.storageSelection.storagePlace},unit(){return this.storageSelection.unit},leftOnStorageDescription(){const{name:e}=this.storagePlace??{name:null};return null===e?`${this.$t("Übrig am Betrieb (kein spezifisches Lager)")}: ${this.amountFormatted} ${this.unit.name}`:`${this.$t("Übrig in")} ${e}: ${this.amountFormatted} ${this.unit.name}`},amountFormatted(){const e=this.applyButtonClicked?0:this.stockLevel.amount;return Bl()(e).format({mantissa:this.unit.ddiDecimals})},hasValidAmount(){return this.stockLevel.amount>0},applyButtonEnabled(){return this.hasValidAmount&&!this.applyButtonClicked}},methods:{onApplyClick(){this.stockLevel&&this.applyButtonEnabled&&(this.$emit("applyStockLevel",this.stockLevel),this.applyButtonClicked=!0)}}}),ZP=WP,KP=(0,ew.Z)(ZP,HP,GP,!1,null,"f5204032",null),qP=KP.exports,YP=(0,b.defineComponent)({name:"StorageSelectSection",components:{StorageSelection:qP},props:{currentStorageSelection:{type:Object,default:null},otherStorageSelections:{type:Array,default:[]}},methods:{applyStockLevel(e){this.$emit("applyStockLevel",e)},addProductWithStockLevel(e){this.$emit("addProductWithStockLevel",e)}}}),JP=YP,XP=(0,ew.Z)(JP,UP,jP,!1,null,"196450f4",null),QP=XP.exports,eT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"storage-select-section"},[t("h3",{staticClass:"storage-details-header"},[e._v(e._s(e.$t("Lager")))]),t("div",[e._v(" "+e._s(e.$t("Wenn du den Lagerstand sehen möchtest, führe eine Lagerbewegung durch."))+" ")]),t("RouterLink",{attrs:{to:{name:"stock-movement"}}},[e._v(e._s(e.$t("Lagerbewegung anlegen")))])],1)},tT=[],iT=(0,b.defineComponent)({name:"StorageSelectSectionEmpty",components:{RouterLink:zl.rH}}),aT=iT,nT=(0,ew.Z)(aT,eT,tT,!1,null,"28eb53af",null),rT=nT.exports;class sT{constructor(e,t,i){(0,tt.Z)(this,"stockLevels",void 0),(0,tt.Z)(this,"storagePlaces",void 0),(0,tt.Z)(this,"units",void 0),this.stockLevels=e,this.storagePlaces=t,this.units=i}getAllExcept(e){const{stockLevel:{productId:t,storagePlaceId:i}}=e,a=this.getAll(t);return a.filter((e=>e.stockLevel.storagePlaceId!==i))}get(e,t){const i=this.stockLevels.find((i=>i.productId===e&&i.storagePlaceId===t));if(!i)return null;const a=this.getStoragePlace(i),n=this.getUnit(i);return{stockLevel:i,storagePlace:a,unit:n}}getAll(e){const t=this.stockLevels.filter((t=>t.productId===e));return t.map((({storagePlaceId:t})=>this.get(e,t))).filter(ka)}getStoragePlace(e){if(!e.storagePlaceId)return null;const t=this.storagePlaces[e.storagePlaceId];if(!t)throw new Error(`Storage place not found: ${e.storagePlaceId}`);return t}getUnit(e){const t=this.units[e.unitId];if(!t)throw new Error(`Unit not found: ${e.unitId}`);return t}}var oT=(0,b.defineComponent)({name:"StorageSelectSectionContainer",components:{StorageSelectSection:QP,StorageSelectSectionEmpty:rT,FeatureNotAvailable:Ew},data(){const e=[];return{stockLevels:e}},created(){this.$store.dispatch("units/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.loadStockLevels()},computed:{...(0,C.Se)({currentCompanyIds:"auth/currentCompanyIds",units:"units/data"}),activityProducts(){return this.$store.getters["activities/createEditActivity/mergedActivityProducts"]??[]},currentActivityProductId(){return this.$store.state.activities.createEditActivity.currentActivityProductId},currentActivityProduct(){return this.$store.getters["activities/createEditActivity/currentActivityProduct"]},storagePlaces(){return this.$store.state.storagePlaces.data},storageSelectionService(){return new sT(this.stockLevels,this.storagePlaces,this.units)},productService(){const e=this.$store.state;
1return new La(e.products.mineralFertilizers.data,e.products.companyFertilizers.data,e.products.secondaryFertilizers.data,e.products.herbizides.data,e.products.crops.data,e.products.miscellaneous.data,e.products.harvests.data,e.products.seeds.data,e.products.otherProductsAndFertilizers.data,e.products.waads.data)},activityProductService(){return new Aa(this.units,this.productService,$a)},currentStorageSelection(){return this.currentActivityProduct?.productId?this.storageSelectionService.get(this.currentActivityProduct.productId,this.currentActivityProduct.storagePlaceId):null},otherStorageSelections(){return this.currentStorageSelection?this.storageSelectionService.getAllExcept(this.currentStorageSelection):[]},storageSelectionsAvailable(){return!!this.currentStorageSelection||this.otherStorageSelections.length>0},featureEnabledAndVisible(){return this.featureStockMovementEnabled&&this.featureStockMovementVisible},showStorageSelectSection(){return!!this.featureEnabledAndVisible&&this.storageSelectionsAvailable},showStorageSelectSectionEmpty(){return!!this.featureEnabledAndVisible&&!this.storageSelectionsAvailable},showFeatureNotAvailable(){return!this.featureStockMovementEnabled&&this.featureStockMovementVisible},featureStockMovementEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_STOCK_MOVEMENT)},featureStockMovementVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_STOCK_MOVEMENT)}},methods:{applyStockLevel(e){this.$store.dispatch("activities/createEditActivity/applyStockLevelOnActivityProductInAllActivities",{activityProductId:this.currentActivityProductId,updateValues:e,rootState:this.$store.state})},addProductWithStockLevel(e){let t=Aa.createActivityProduct();t={...t,...Aa.setStockLevelValues(t,e)},this.$store.commit("activities/createEditActivity/addActivityProductToAllActivities",t)},async loadStockLevels(){const{stockMovementsApi:e}=this.$api,t={companyId:this.currentCompanyIds[0],timestamp:da(Date.now())};let i;try{const a=await e.stockMovementsStockLevels(t);i=a.data}catch(a){console.error(a),this.stockLevels=[]}i&&("success"===i.status?this.stockLevels=i.data||[]:this.stockLevels=[])}}}),lT=oT,dT=(0,ew.Z)(lT,LP,VP,!1,null,null,null),cT=dT.exports,uT=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.currentActivityProduct&&e.baseUnits?t("UnitSelection",{attrs:{selectedUnitId:e.selectedUnitId,units:e.baseUnits},on:{"update:unit":e.updateUnit}}):e._e()},pT=[],hT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldRadioGroup",{attrs:{checked:e.selectedUnitId,label:e.$t("Einheit"),variant:"vertical",options:e.unitValues},on:{change:e.updateUnit}})},mT=[],fT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BaseFormField",{attrs:{type:"radio",label:e.label,variant:e.variant}},[t("BFormRadioGroup",{class:e.innerContainerClass,attrs:{stacked:e.stacked,checked:e.checked},on:{change:e.change,input:e.input}},[e._t("default",(function(){return e._l(e.options,(function(i){return t("FormRadio",{key:i.value,attrs:{value:i.value,disabled:i.disabled}},[e._v(" "+e._s(i.text)+" ")])}))}))],2)],1)},gT=[],yT=i(87167),vT=function(){var e=this,t=e._self._c;return t("BFormRadio",{staticClass:"form-radio",class:e.classes,attrs:{value:e.value,checked:e.isInGroup?null:e.checked,disabled:e.disabled},on:{change:e.change,input:e.input},nativeOn:{click:function(t){return e.onClick.apply(null,arguments)}}},[t("FontAwesomeIcon",{staticClass:"form-radio__icon",class:[`form-radio__icon--${e.size}`,`form-radio__icon--${e.variant}`,{"form-radio__icon--checked":e.checkedComputed}],attrs:{icon:e.checkedComputed?["far","dot-circle"]:["far","circle"]}}),null!=e.$slots.image?t("span",{staticClass:"form-radio__image",class:[`form-radio__image--${e.size}`,`form-radio__image--${e.variant}`,{"form-radio__image--checked":e.checkedComputed}]},[e._t("image")],2):e._e(),t("span",{staticClass:"form-radio__title",class:[`form-radio__title--${e.size}`,`form-radio__title--${e.variant}`,{"form-radio__title--checked":e.checkedComputed}]},[e._t("default")],2),null!=e.$slots.text?t("span",{staticClass:"form-radio__text",class:[`form-radio__text--${e.size}`,`form-radio__text--${e.variant}`,{"form-radio__text--checked":e.checkedComputed}]},[e._t("text")],2):e._e()],1)},bT=[],wT=i(76398);ow.vI.add(lw.diR,lw._1v);var CT={name:"FormRadio",components:{FontAwesomeIcon:s.GN,BFormRadio:wT.g},model:{prop:"checked",event:"input"},inject:{bvGroup:{from:"bvRadioGroup",default:!1}},props:{size:{type:String,default:"md",validator:e=>["sm","md","lg"].includes(e)},variant:{type:String,default:"default",validator:e=>["default","bordered","card"].includes(e)},value:{required:!0},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},computed:{isInGroup(){return!!this.bvGroup},checkedComputed(){return this.isInGroup?this.bvGroup.localChecked===this.value:this.checked},classes(){const e=[`form-radio--${this.size}`];return"default"!==this.variant&&e.push(`form-radio--${this.variant}`),this.checkedComputed&&e.push("form-radio--checked"),e}},methods:{async onClick(){this.$el.querySelector("input").focus(),this.disabled||(this.$emit("input",this.value),this.isInGroup&&(this.bvGroup.localChecked=this.value,this.bvGroup.$emit("input",this.value)),await this.$nextTick(),this.$emit("change",this.value),this.isInGroup&&this.bvGroup.$emit("change",this.value))},input(e){this.$emit("input",e)},change(e){this.$emit("change",e)}}},FT=CT,AT=(0,ew.Z)(FT,vT,bT,!1,null,"bbcb08cc",null),kT=AT.exports,ST=(0,b.defineComponent)({name:"FormFieldRadioGroup",components:{BFormRadioGroup:yT.Q,FormRadio:kT,BaseFormField:BA},model:{prop:"checked",event:"input"},props:{label:{type:String,default:null},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label"].includes(e)},options:{type:Array,default:null},checked:{default:null},stacked:{type:Boolean,default:!0},innerContainerClass:{type:String,default:null}},methods:{input(e){this.$emit("input",e)},change(e){this.$emit("change",e)}}}),ET=ST,IT=(0,ew.Z)(ET,fT,gT,!1,null,"b6bfa332",null),_T=IT.exports,DT=(0,b.defineComponent)({name:"UnitSelection",components:{FormFieldRadioGroup:_T},props:{units:{type:Array,required:!0},selectedUnitId:{type:String,default:""}},computed:{unitValues(){return this.units.map((e=>({text:e.name,value:e.id})))}},methods:{updateUnit(e){this.$emit("update:unit",e)}}}),MT=DT,PT=(0,ew.Z)(MT,hT,mT,!1,null,null,null),TT=PT.exports,xT=(0,b.defineComponent)({name:"UnitSelectionContainer",components:{UnitSelection:TT},props:{selectedProduct:{type:Object,required:!0}},created(){this.$store.dispatch("units/subscribe")},computed:{...(0,C.rn)("auth",["currentCompanies"]),...(0,C.rn)("productCategories",{productCategories:"data"}),units(){return this.$store.state.units.data},currentActivityProduct(){return this.$store.getters["activities/createEditActivity/currentActivityProduct"]},selectedUnitId(){const e=this.currentActivityProduct?this.activityProductService.findUnitIdWithFallback(this.currentActivityProduct):null;if(!e)return null;const t=this.units[e];if(!t)return null;const i=Fa(t)?ba(t,this.units):t;return i?.id??null},unit(){return this.currentActivityProduct?.unitId?this.units[this.currentActivityProduct.unitId]:this.selectedProduct?.unitId?this.units[this.selectedProduct.unitId]:null},productCategoryType(){return this.selectedProduct?.categoryId&&this.productCategories[this.selectedProduct.categoryId]?.type||null},compatibleUnits(){if(!this.currentCompanies||!this.unit||!this.productCategoryType)return null;const e=this.$store.getters["units/compatibleUnits"](this.unit.groupId,this.currentCompanies,this.productCategoryType);return 0===e.length?[this.unit]:e},baseUnits(){if(!this.compatibleUnits)return null;const e=new Set;return this.compatibleUnits.reduce(((t,i)=>{const a=Fa(i)?ba(i,this.units):i;return a&&!e.has(a.id)&&(e.add(a.id),t.push(a)),t}),[])},productService(){const e=this.$store.state;
1return new La(e.products.mineralFertilizers.data,e.products.companyFertilizers.data,e.products.secondaryFertilizers.data,e.products.herbizides.data,e.products.crops.data,e.products.miscellaneous.data,e.products.harvests.data,e.products.seeds.data,e.products.otherProductsAndFertilizers.data,e.products.waads.data)},activityProductService(){return new Aa(this.units,this.productService,$a)}},methods:{updateUnit(e){if(this.currentActivityProduct){const t=this.$store.getters["activities/createEditActivity/sumProcessedArea"],i=this.activityProductService.findUnitIdWithFallback(this.currentActivityProduct),a=i?this.units[i]:null,n=this.units[e],r=a&&Fa(a)?wa(n,this.units):n,s=r?.id??e,o=this.activityProductService.updateUnit(this.currentActivityProduct,s,t),l=o.unitId?this.units[o.unitId]:null;this.$store.commit("activities/createEditActivity/updateAmountAndUnitOnActivityProductInAllActivities",{activityProductId:this.currentActivityProduct.id,updateValues:{amount:o.amount,unit:l},rootState:this.$store.state})}}}}),BT=xT,OT=(0,ew.Z)(BT,uT,pT,!1,null,null,null),$T=OT.exports,RT=(0,b.defineComponent)({name:"ProductDetails",components:{PageNavigation:IP,UnitSelectionContainer:$T,PestDetailsContainer:zP,StorageSelectSectionContainer:cT},props:{activityProducts:{type:Array,required:!0},currentActivityProductId:{type:String,default:null},products:{type:Array,required:!0},storagePlaces:{type:Array,required:!0}},computed:{pagination(){if(null===this.currentActivityProductId)return 0;const e=this.activityProducts.findIndex((e=>e.id===this.currentActivityProductId));return-1===e?0:e},visibleProduct(){if(!this.currentActivityProductId)return null;const e=this.activityProducts.find((e=>e.id===this.currentActivityProductId));return e?.productId?this.products.find((t=>t.id===e.productId))??null:null},visibleProductName(){return this.visibleProduct?this.visibleProduct.name:""}},methods:{back(){const e=this.pagination-1;e<0||this.$emit("update:currentActivityProductId",this.activityProducts[e].id)},next(){const e=this.pagination+1;e>=this.activityProducts.length||this.$emit("update:currentActivityProductId",this.activityProducts[e].id)}}}),NT=RT,zT=(0,ew.Z)(NT,wP,CP,!1,null,"15c71810",null),LT=zT.exports,VT=(0,b.defineComponent)({name:"ProductDetailsContainer",components:{ProductDetails:LT},computed:{currentActivityProductId(){return this.$store.state.activities.createEditActivity.currentActivityProductId},products(){return this.$store.getters["products/allProducts"]},storagePlaces(){return Object.values(this.$store.state.storagePlaces.data)},activityProductsWithProductId(){const e=this.$store.getters["activities/createEditActivity/mergedActivityProducts"]??[];return e.filter((e=>e.productId))}},methods:{updateCurrentActivityProductId(e){this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",e)}}}),UT=VT,jT=(0,ew.Z)(UT,vP,bP,!1,null,"09be4dee",null),HT=jT.exports,GT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",e._l(e.activityProducts,(function(i){return t("ProductSelectSection",{key:i.id,attrs:{selectedProduct:e.selectedProduct(i),activityProduct:i,fieldNamesPerActivity:e.fieldNamesPerActivity},on:{"remove:activityProduct":e.removeActivityProductInAllActivities}})})),1)},WT=[],ZT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSet",{staticClass:"pb-2",attrs:{collapsible:"",headline:e.headline}},[t("div",{staticClass:"product-section"},[t("div",[t("ProductDropdownContainer",{staticClass:"product-section-dropdown",attrs:{selectedProduct:e.selectedProduct,activityProduct:e.activityProduct}}),t("PestSelectSectionContainer",{staticClass:"product-section-dropdown",attrs:{activityProduct:e.activityProduct}}),t("AmountSectionContainer",{staticClass:"amounts-section form-row",attrs:{activityProduct:e.activityProduct}})],1),t("RemoveSectionButton",{attrs:{label:e.$t("Produkt entfernen")||"Produkt entfernen"},on:{remove:e.remove}})],1)])},KT=[],qT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("label",{staticClass:"amount-input",attrs:{for:"relative"}}
1,[e._v(e._s(e.labelRelative))]),t("FormFieldInputNumberFormattedDisplayValue",{staticClass:"amount-input",attrs:{variant:"no-label",id:"relative",placeholder:e.numbro(0).format({mantissa:e.defaultNDecimals}),value:e.amountRelative,formatter:e.inputFormatterRelative,various:e.variousRelative,lazy:!0,boundary:"modal-step-content"},on:{update:e.updateAmountRelative}}),t("label",{staticClass:"label-total",attrs:{for:"total"}},[e._v(e._s(e.labelTotal)+" ")]),t("FormFieldInputNumberFormattedDisplayValue",{staticClass:"amount-input",attrs:{variant:"no-label",id:"total",placeholder:e.numbro(0).format({mantissa:e.defaultNDecimals}),value:e.amountTotal,formatter:e.inputFormatterTotal,various:e.variousTotal,lazy:!0,boundary:"modal-step-content"},on:{update:e.updateAmountTotal}}),e.productIsMissing?t("div",{staticClass:"alert alert-info",attrs:{role:"alert"}},[e._v(e._s(e.$t("Produkt vor Menge einstellen")))]):e._e()],1)},YT=[],JT=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInput",{attrs:{id:e.id,required:e.required,label:e.label,name:e.name,placeholder:e.placeholder,disabled:e.disabled,variant:e.variant,state:e.state,stateMessage:e.stateMessage,various:e.various,lazy:e.lazy,type:"text","data-testid":"form-field-input-number-formatted-without-changing-value"},on:{blur:e.onBlur,focus:e.onFocus,keypress:t=>e.$emit("keypress",t)},model:{value:e.displayValue,callback:function(t){e.displayValue=t},expression:"displayValue"}})},XT=[],QT=(0,b.defineComponent)({name:"FormFieldInputNumberFormattedDisplayValue",components:{FormFieldInput:fk},model:{prop:"value",event:"update"},emits:["update","focus","blur"],props:{id:{type:String,default:null},value:{type:Number,default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},name:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},stateMessage:{type:String,default:null},min:{type:Number,default:null},max:{type:Number,default:null},formatter:{type:Function,required:!0},parser:{type:Function,default:rS},lazy:{type:Boolean,default:!1}},data(){return{isInputActive:!1,validationStateMessage:null,validationState:null}},computed:{displayValue:{get(){return this.isInputActive?this.value?this.value.toString():"":this.formatter(this.value)},set(e){const t=this.parser(e);Number.isNaN(t)?this.$emit("update",null):this.$emit("update",t)}},computedState(){return this.validationState??this.state},computedStateMessage(){return this.validationStateMessage??this.stateMessage}},methods:{onBlur(){this.isInputActive=!1,this.$emit("blur")},onFocus(){this.isInputActive=!0,this.$emit("focus")}}}),ex=QT,tx=(0,ew.Z)(ex,JT,XT,!1,null,null,null),ix=tx.exports,ax=(0,b.defineComponent)({name:"AmountSectionContainer",components:{FormFieldInputNumberFormattedDisplayValue:ix},props:{activityProduct:{type:Object,required:!0}},data(){return{productIsMissing:!1}},computed:{activities(){return this.$store.state.activities.createEditActivity.activities},units(){return this.$store.state.units.data},processedArea(){return this.$store.getters["activities/createEditActivity/sumProcessedArea"]},amountsAndUnits(){return this.activityProductService.getAmountsAndUnits(this.activityProduct,this.processedArea)},amountRelative(){const{amountUnitRelative:{amount:e}}=this.amountsAndUnits;return e},amountTotal(){const{amountUnitTotal:{amount:e}}=this.amountsAndUnits;return e},variousRelative(){return this.isVarious(this.amountsAndUnits.amountUnitRelative)},variousTotal(){return this.isVarious(this.amountsAndUnits.amountUnitTotal)},labelRelative(){const{amountUnitRelative:{unitId:e,isFixed:t}}=this.amountsAndUnits;if(e){const i=this.units[e];return`${t?"• ":""}${this.$t("Menge")} in ${i.name}`}return this.$t("Menge")},labelTotal(){const{amountUnitTotal:{unitId:e,isFixed:t}}=this.amountsAndUnits;if(e){const i=this.units[e];return`${t?"• ":""}${this.$t("Gesamt")} in ${i.name}`}return this.$t("Gesamt")},productService(){const e=this.$store.state;
1return new La(e.products.mineralFertilizers.data,e.products.companyFertilizers.data,e.products.secondaryFertilizers.data,e.products.herbizides.data,e.products.crops.data,e.products.miscellaneous.data,e.products.harvests.data,e.products.seeds.data,e.products.otherProductsAndFertilizers.data,e.products.waads.data)},activityProductService(){return new Aa(this.units,this.productService,$a)},isAvailableOnAllActivities(){return this.activityProduct.activityIds.length===this.activities.length},selectedProduct(){return this.$store.getters["products/findProductById"](this.activityProduct.productId)},isHerbicide(){return this.$store.getters["productCategories/isHerbicide"](this.selectedProduct?.categoryId??"")},defaultNDecimals(){return this.isHerbicide?3:2}},methods:{setProductIsMissing(e){this.productIsMissing=e},isVarious(e){const{amount:t}=e;return t&&t<0||!this.isAvailableOnAllActivities},updateAmountTotal(e){const t=this.updateAmountAndUnit(e,this.amountsAndUnits.amountUnitTotal.unitId);t&&this.setProductAmountModeForAllProducts(ua.Total)},updateAmountRelative(e){const t=this.updateAmountAndUnit(e,this.amountsAndUnits.amountUnitRelative.unitId);t&&this.setProductAmountModeForAllProducts(ua.PerHa)},updateAmountAndUnit(e,t){const i=t?this.units[t]:null;return i?(this.$store.commit("activities/createEditActivity/updateAmountAndUnitOnActivityProductInAllActivities",{activityProductId:this.activityProduct.id,updateValues:{amount:e,unit:i},rootState:this.$store.state}),this.setProductIsMissing(!1),!0):(this.setProductIsMissing(!0),!1)},setProductAmountModeForAllProducts(e){this.$store.dispatch("activities/createEditActivity/setProductAmountModeForAllProducts",e)},inputFormatterRelative(e){const t=this.units[this.amountsAndUnits.amountUnitRelative.unitId??""];return this.inputFormatter(e,t)},inputFormatterTotal(e){const t=this.units[this.amountsAndUnits.amountUnitTotal.unitId??""];return this.inputFormatter(e,t)},inputFormatter(e,t){if(""===e)return e;try{return Nl(e).format({mantissa:this.isHerbicide?this.defaultNDecimals:t.ddiDecimals})}catch(i){return""}},updateCurrentActivityProductId(){this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",this.activityProduct.id)},numbro:Nl}}),nx=ax,rx=(0,ew.Z)(nx,qT,YT,!1,null,"452975ee",null),sx=rx.exports,ox=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showPestSelectSection?t("PestSelectSection",{staticClass:"product-section-dropdown",attrs:{selectedDropdownItem:e.selectedDropdownItem,dropdownItems:e.dropdownItems},on:{update:e.updateSelection,open:e.updateCurrentActivityProductId}}):e._e()},lx=[],dx=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"pest-section"},[t("FormFieldDropdown",{ref:"pests",attrs:{label:e.$t("Schädling auswählen")||"",placeholder:e.showPestSelection?e.$t("Tippen um zu suchen"):e.$t("Kein gültiger Schädling vorhanden"),value:e.selectedDropdownItem,items:e.dropdownItems,disableDelete:"",positionFixed:!1,boundary:"modal-step-content"},on:{update:e.updateSelection,open:e.open}})],1)},cx=[],ux=(0,b.defineComponent)({name:"PestSelectSection",components:{FormFieldDropdown:lk},props:{selectedDropdownItem:{type:Object,required:!0},dropdownItems:{type:Array,required:!0}},data(){return{defaultSelectedItem:{id:"",name:""}}},computed:{showPestSelection(){const e=this.dropdownItems.map((e=>e.items)).flat();return 0!==e.length}},methods:{open(){this.$emit("open")},updateSelection(e){if(null===e.id)this.$emit("update",null,null);else{const[t,i]=e.id.split("_");this.$emit("update",t,i)}}}}),px=ux,hx=(0,ew.Z)(px,dx,cx,!1,null,null,null),mx=hx.exports,fx=(0,b.defineComponent)({name:"PestSelectSectionContainer",components:{PestSelectSection:mx},props:{activityProduct:{type:Object,required:!0}},created(){this.$store.dispatch("units/subscribe"),this.$store.dispatch("pests/subscribe")},computed:{...(0,C.rn)("pests",{pests:"data"}),...(0,C.rn)("fields",{fields:"data"}),...(0,C.rn)("productCategories",{productCategories:"data"}),activityTimeStarts(){return this.$store.getters["activities/createEditActivity/activityTimeStarts"]},selectedProduct(){return this.$store.getters["products/findProductById"](this.activityProduct.productId)},selectedFields(){return this.$store.state.activities.createEditActivity.activities?.map((e=>e.fieldId)).filter(ka)??[]},selectedFieldsCropIds(){const e=this.selectedFields.map((e=>this.fields[e]?.cropId)).filter((e=>!!e)),t=[...new Set(e)];return t},selectedDropdownItem(){return this.selectedProduct?.id&&this.activityProduct.pestId&&this.activityProduct.pesticideIndicationId?this.$store.getters["pesticideIndications/dropdownItem"](this.selectedProduct.id,this.activityProduct.pestId,this.activityProduct.pesticideIndicationId):{id:"",name:""}},dropdownItems(){return this.selectedProduct&&Ki(this.selectedProduct,this.productCategories)?this.$store.getters["pesticideIndications/dropdownItems"](this.selectedProduct.id,this.selectedFieldsCropIds,this.activityTimeStarts):[]},featurePestsEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_PESTS)},featurePestsVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_PESTS)},showPestSelectSection(){return this.featurePestsEnabled&&this.featurePestsVisible&&Ki(this.selectedProduct,this.productCategories)}},watch:{selectedProduct:{handler(e){if(Ki(e,this.productCategories)){const t=[e.id];this.$store.dispatch("pesticideIndications/loadByIds",t)}},immediate:!0}},methods:{updateSelection(e,t){this.$store.dispatch("activities/createEditActivity/updatePestOnActivityProductInAllActivities",{updateV
1alues:{pestId:e,pesticideIndicationId:t},activityProductId:this.activityProduct.id})},updateCurrentActivityProductId(){this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",this.activityProduct.id)}}}),gx=fx,yx=(0,ew.Z)(gx,ox,lx,!1,null,null,null),vx=yx.exports,bx=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDropdown",{ref:"products",staticClass:"product-section-dropdown",attrs:{id:"products",label:e.$t("Produkt auswählen")||"",value:e.productDropdownValue,items:e.productDropdownItems,disableDelete:"",positionFixed:!1,boundary:"modal-step-content"},on:{open:e.updateCurrentActivityProductId,update:e.updateProduct}})},wx=[];function Cx(e){if(null===e)return{productId:null,storagePlaceId:null};const t=e.split("_");return 1===t.length?{productId:e,storagePlaceId:null}:{productId:t[0],storagePlaceId:t[1]}}ow.vI.add(uw.I7k);var Fx=(0,b.defineComponent)({name:"ProductDropdownContainer",components:{FormFieldDropdown:lk},props:{selectedProduct:{type:Object,required:!1},activityProduct:{type:Object,required:!0}},data(){return{defaultSelectedDropdownValue:{id:"",name:""}}},created(){this.$store.dispatch("products/subscribe"),this.$store.dispatch("productVisibilities/subscribe"),this.$store.dispatch("productCategories/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.$store.dispatch("activityTypes/subscribe")},computed:{activityType(){const e=this.$store.state.activities.createEditActivity.activities?.[0].activityTypeId;if(e)return this.$store.state.activityTypes.data[e]},activityTimeStarts(){return this.$store.getters["activities/createEditActivity/activityTimeStarts"]},currentCompanies(){return this.$store.state.auth.currentCompanies},currentProcessOrders(){return this.$store.getters["auth/currentProcessOrders"]},productDropdownValue(){return this.selectedProduct?this.selectedProduct:this.defaultSelectedDropdownValue},productVisibilities(){return Object.values(this.$store.state.productVisibilities.data)},productCategories(){return this.$store.state.productCategories.data},selectedFields(){return this.$store.state.activities.createEditActivity.activities?.map((e=>e.fieldId)).filter(ka)??[]},storagePlaces(){return Object.values(this.$store.state.storagePlaces.data)},products(){return this.$store.getters["products/allProducts"]},productDropdownItems(){if(!this.activityType||!this.currentCompanies||!this.currentProcessOrders||!this.productVisibilities||!this.productCategories)return[];const e=this.selectedFields.map((e=>this.$store.state.fields.data[e])).filter((e=>void 0!==e)),t=this.$store.getters["products/compatibleProductsToDropdownItems"](this.activityType,this.currentCompanies,this.currentProcessOrders,this.productVisibilities,Object.values(this.productCategories),e,this.storagePlaces,this.activityTimeStarts);return t}},methods:{updateProduct(e){const{productId:t,storagePlaceId:i}=Cx(e.id);this.$store.dispatch("activities/createEditActivity/updateProductOnActivityProductInAllActivities",{activityProductId:this.activityProduct.id,updateValues:{referenceProductId:t,storagePlaceId:i}})},updateCurrentActivityProductId(){this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",this.activityProduct.id)}}}),Ax=Fx,kx=(0,ew.Z)(Ax,bx,wx,!1,null,null,null),Sx=kx.exports,Ex=(0,b.defineComponent)({name:"ProductSelectSection",components:{FormFieldSet:_k,PestSelectSectionContainer:vx,ProductDropdownContainer:Sx,AmountSectionContainer:sx,RemoveSectionButton:IM},props:{selectedProduct:{type:Object,required:!1},activityProduct:{type:Object,required:!0},fieldNamesPerActivity:{type:Object,required:!0}},computed:{headline(){return this.selectedProduct?this.activityProduct.activityIds.length!==Object.keys(this.fieldNamesPerActivity).length?1===this.activityProduct.activityIds.length?`${this.selectedProduct.name} (${this.fieldNamesPerActivity[this.activityProduct.activityIds[0]]})`:`${this.selectedProduct.name} (${this.$t("verschiedene")})`:this.selectedProduct.name:this.$t("Produkt")}},methods:{remove(){this.$emit("remove:activityProduct",this.activityProduct.id)}}}),Ix=Ex,_x=(0,ew.Z)(Ix,ZT,KT,!1,null,"d7f8c956",null),Dx=_x.exports,Mx=(0,b.defineComponent)({name:"ProductSelectSectionContainer",components:{ProductSelectSection:Dx,MultiRootWrapper:jM},created(){this.$store.dispatch("products/subscribe"),this.$store.dispatch("units/subscribe"),this.$store.dispatch("storagePlaces/subscribe")},computed:{activityProducts(){return this.$store.getters["activities/createEditActivity/mergedActivityProducts"]??[]},storagePlaces(){return Object.values(this.$store.state.storagePlaces.data)},products(){return this.$store.getters["products/allProducts"]},fieldNamesPerActivity(){const e=this.$store.state.activities.createEditActivity.activities??[],t=this.$store.state.fields.data,i={};return e.forEach((e=>{const a=t[e.fieldId??""]?.name??"";i[e.id]=a})),i}},methods:{selectedProduct(e){if(e.productId){const t=this.products.find((t=>t.id===e.productId));if(!t)return null;const{storagePlaceId:i}=e;
1return i?this.getStorageProductDropdownItem(e,t):{id:t.id,name:t.name}}return null},getStorageProductDropdownItem(e,t){const{storagePlaceId:i}=e;if(!i)return null;const a=this.storagePlaces.find((e=>e.id===i));return a?{id:`${t.id}_${i}`,name:`${t.name} (${a.name})`}:null},createActivityProduct(){this.$store.commit("activities/createEditActivity/createActivityProduct")},removeActivityProductInAllActivities(e){this.$store.dispatch("activities/createEditActivity/removeActivityProductInAllActivities",e),0===this.activityProducts.length&&this.createActivityProduct(),null!==this.$store.state.activities.createEditActivity.currentActivityProductId&&this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",null)}}}),Px=Mx,Tx=(0,ew.Z)(Px,GT,WT,!1,null,null,null),xx=Tx.exports,Bx=(0,b.defineComponent)({name:"ThirdStep",components:{AddSectionButton:bM,ProductAmountModeSectionContainer:yP,ProductSelectSectionContainer:xx,EquipmentSelectSectionsContainer:ZM,ProductDetailsContainer:HT,FavouriteProductsSectionContainer:rP},methods:{addActivityProduct(){this.$emit("addActivityProduct")}}}),Ox=Bx,$x=(0,ew.Z)(Ox,cM,uM,!1,null,"ef85cfd0",null),Rx=$x.exports,Nx=(0,b.defineComponent)({name:"ThirdStepContainer",components:{ThirdStep:Rx},methods:{addActivityProduct(){this.$store.commit("activities/createEditActivity/createActivityProduct"),null!==this.$store.state.activities.createEditActivity.currentActivityProductId&&this.$store.commit("activities/createEditActivity/setCurrentActivityProductId",null)}}}),zx=Nx,Lx=(0,ew.Z)(zx,lM,dM,!1,null,"4a6ab210",null),Vx=Lx.exports,Ux=(0,b.defineComponent)({name:"ModalCreateActivity",components:{ModalWrapper:OC,Pagination:qk,FirstStepContainer:XS,SecondStepContainer:oM,FourthStepContainer:jk,MapContainer:kE,ThirdStepContainer:Vx},data(){return{currentStep:0,customColumnDefinition:pA}},computed:{selectedFields(){return this.$store.getters["activities/createEditActivity/selectedFields"]},timeStart(){if(!this.$store.state.activities.createEditActivity.activities)return null;const e=this.$store.state.activities.createEditActivity.activities.map((e=>e.timeStart));return e[0]},activityTypeId(){if(!this.$store.state.activities.createEditActivity.activities)return null;const e=this.$store.state.activities.createEditActivity.activities.map((e=>e.activityTypeId?e.activityTypeId:null));return e[0]},title(){switch(this.currentStep){case 0:return`1. ${this.$t("Maßnahme und Datum auswählen")}`;case 1:return`2. ${this.$t("Felder auswählen")}`;case 2:return`3. ${this.$t("Produkt- & Maschinenauswahl")}`;case 3:return`4. ${this.$t("Weitere Details erfassen")}`;default:return this.$t("Maßnahme hinzufügen")}},paginationNextEnabled(){switch(this.currentStep){case 0:if(this.timeStart&&this.activityTypeId)return!0;break;case 1:if(this.selectedFields&&this.selectedFields.length>0)return!0;break;case 2:return!0;case 3:return!0;default:break}return!1}},methods:{show(){this.$refs.modalWrapper?.show()},reset(){this.$refs.modalWrapper?.hide()},cancel(){this.currentStep=0,this.$store.commit("activities/createEditActivity/reset")},next(){this.currentStep+=1},back(){this.currentStep-=1},save(){this.$store.dispatch("activities/createEditActivity/save"),this.$refs.modalWrapper?.hide()}}}),jx=Ux,Hx=(0,ew.Z)(jx,dF,cF,!1,null,null,null),Gx=Hx.exports,Wx=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max",title:e.title},on:{cancel:e.cancel},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:4,current:e.currentStep}}),0===e.currentStep?t("FirstStepContainer"):e._e(),1===e.currentStep?t("SecondStepContainer",{attrs:{customColumnDefinition:e.customColumnDefinition}}):e._e(),2===e.currentStep?t("ThirdStepContainer"):e._e(),3===e.currentStep?t("FourthStepContainer"):e._e()]},proxy:!0},1===e.currentStep?{key:"map-container",fn:function(){return[t("MapContainer")]},proxy:!0}:null,{key:"buttons",fn:function(){return[2===e.currentStep||3===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary"},on:{click:e.save}}
1,[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" ")])]):e._e(),0===e.currentStep||1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:!e.paginationNextEnabled},on:{click:e.next}},[t("span",[e._v(e._s(e.$t("Weiter")))])]):e._e(),0===e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:e.reset}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])]):e._e(),2===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"white"},on:{click:e.next}},[t("span",[e._v(e._s(e.$t("Mehr Details")))])]):e._e(),1===e.currentStep||2===e.currentStep||3===e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:e.back}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"white",disabled:!e.paginationNextEnabled},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" ")])]):e._e()]},proxy:!0}],null,!0)})},Zx=[];const Kx=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...rA,header:{title:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld"),description:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld")},width:145,lockedPosition:!0,sortOrder:"asc",readOnly:!0},{..._F,key:"processedAreaOrFieldSize"},{...DF,lockedPosition:!1,readOnly:!0},{...MF,readOnly:!0},{...IF,hiddenPerDefault:!0,readOnly:!0},{...tA,hiddenPerDefault:!0,readOnly:!0},{...EF,hiddenPerDefault:!0,className:"",width:145,readOnly:!0},{...nA,hiddenPerDefault:!0,readOnly:!0},dA];var qx,Yx,Jx={international:Kx},Xx=(0,b.defineComponent)({name:"ModalEditActivity",components:{ModalWrapper:OC,Pagination:qk,FirstStepContainer:XS,FourthStepContainer:jk,MapContainer:kE,SecondStepContainer:oM,ThirdStepContainer:Vx},data(){return{currentStep:0,customColumnDefinition:Jx}},computed:{selectedFields(){return this.$store.getters["activities/createEditActivity/selectedFields"]},timeStart(){if(!this.$store.state.activities.createEditActivity.activities)return null;const e=this.$store.state.activities.createEditActivity.activities.map((e=>e.timeStart));return e[0]},activityTypeId(){if(!this.$store.state.activities.createEditActivity.activities)return null;const e=this.$store.state.activities.createEditActivity.activities.map((e=>e.activityTypeId?e.activityTypeId:null));return e[0]},title(){switch(this.currentStep){case 0:return`1. ${this.$t("Maßnahme und Datum auswählen")}`;case 1:return`2. ${this.$t("Felder auswählen")}`;case 2:return`3. ${this.$t("Produkt- & Maschinenauswahl")}`;case 3:return`4. ${this.$t("Weitere Details erfassen")}`;default:return this.$t("Maßnahme hinzufügen")}},paginationNextEnabled(){switch(this.currentStep){case 0:if(this.timeStart&&this.activityTypeId)return!0;break;case 1:if(this.selectedFields&&this.selectedFields?.length>0)return!0;break;case 2:return!0;case 3:return!0;default:break}return!1}},methods:{show(){this.$refs.modalWrapper?.show()},reset(){this.$refs.modalWrapper?.hide()},cancel(){this.currentStep=0,this.$store.commit("activities/createEditActivity/reset")},next(){this.currentStep+=1},back(){this.currentStep-=1},save(){this.$store.dispatch("activities/createEditActivity/save"),this.$refs.modalWrapper?.hide()}}}),Qx=Xx,eB=(0,ew.Z)(Qx,Wx,Zx,!1,null,null,null),tB=eB.exports,iB=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",staticClass:"modal-table-export",attrs:{title:e.titleComputed,"ok-title":e.$t("Exportieren"),visible:e.visible},on:{change:t=>e.$emit("change",t),cancel:e.reset},scopedSlots:e._u([{key:"default",fn:function(){return[e.pages?t("Pagination",{attrs:{pages:e.pages,current:e.currentStep}}):e._e(),0===e.currentStep?t("div",[Array.isArray(e.availableTypes)&&e.availableTypes.length>0?t("FormFieldRadioGroup",{attrs:{variant:"no-label",stacked:""},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}},e._l(e.availableTypes,(function(i){return t("FormRadio",{key:i.value,attrs:{variant:"bordered",value:i.value},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(i.label)+" ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(i.text)+" ")]},proxy:!0}],null,!0)})}
1)),1):e._e(),e.filtered?t("div",[e._v(" "+e._s(e.$t("Es sind Filter aktiv. Die folgenden Daten werden exportiert:"))+" "),t("FormCheckbox",{staticClass:"mt-1",attrs:{switch:""},model:{value:e.exportFiltered,callback:function(t){e.exportFiltered=t},expression:"exportFiltered"}},[e._v(" "+e._s(e.exportFiltered?e.$t("Sichtbare Einträge"):e.$t("Alle Einträge"))+" ")])],1):e._e()],1):e._e(),1===e.currentStep?t("div",[t("span",[e._v(e._s(e.$t("Die aktuelle Tabelle enthält Sub-Tabellen. Bitte wähle für welche die Einträge im exportieren XLS in einer eigenen Zeile dargestellt werden sollen.")))]),t("FormFieldDropdown",{attrs:{label:e.$t("Optionen")||"Optionen",variantVariation:"small-modal",variant:"vertical",hideLabel:"",disableDelete:"",value:e.selectedOption,items:e.dropdownItems},on:{update:e.dropdownSelect}})],1):e._e()]},proxy:!0},e.pages?{key:"buttons",fn:function(){return[e.currentStep!==e.pages-1?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary"},on:{click:()=>e.currentStep+=1}},[t("span",[e._v(e._s(e.$t("Weiter")))])]):t("BButton",{staticClass:"mr-3",attrs:{variant:"primary"},on:{click:e.ok}},[t("span",[e._v(e._s(e.$t("Exportieren")))])]),0!==e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:()=>e.currentStep-=1}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),t("BButton",{attrs:{variant:"white"},on:{click:e.cancel}},[e._v(" "+e._s(e.$t("Abbrechen"))+" ")])]},proxy:!0}:null],null,!0)})},aB=[];function nB(e,t){const i=[];return t.forEach((t=>{const a=[Yx.HEADER,Yx.SUBHEADER];let n=Yx.DEFAULT;"numeric"===t.type?n=Yx.NUMERIC:"string"===typeof t.type&&["date","datetime"].includes(t.type)&&(n=Yx.DATETIME);for(let i=0;i<e;i+=1)a.push(n);i.push(a)})),i}function rB(e,t){const i=[];return e.forEach((e=>{e.isSubtableColumn?(e.isFirstSubtableColumn||e.isPartOfSubtable===t)&&sB(e,i):sB(e,i)})),i}function sB(e,t){"farmdok.amountUnit"===e.type?t.push(...oB(e)):t.push(e)}function oB(e){if("farmdok.amountUnit"!==e.type)throw new Error("Column is not of type 'farmdok.amountUnit'");const t={...e,type:"numeric",header:{title:()=>"Amount"}},i={...e,type:"text",header:{title:()=>"Unit"}};return[t,i]}function lB(e,t){const i=[],a=[],n=[];return e.forEach((e=>{if("string"!==typeof e.data)throw new Error("column.data is not a string");const r=t.propToCol(e.data);a.push("function"===typeof e.header?.title?e.header?.title():""),n.push("function"===typeof e.header?.description?e.header?.description():""),i.push(t.getColWidth(r)||45)})),{columnWidths:i,columnTitles:a,columnDescriptions:n}}(function(e){e["PER_ROW_ID"]="PER_ROW_ID",e["PER_SUBTABLE"]="PER_SUBTABLE"})(qx||(qx={})),function(e){e[e["HEADER"]=0]="HEADER",e[e["SUBHEADER"]=1]="SUBHEADER",e[e["DEFAULT"]=2]="DEFAULT",e[e["NUMERIC"]=3]="NUMERIC",e[e["DATETIME"]=4]="DATETIME"}(Yx||(Yx={}));var dB=i(29208),cB=i.n(dB);function uB(e,t,i,a,n,r){const s=[];return s.push(i),s.push(a),r?pB(n,t,e,s,r):fB(n,t,e,s)}function pB(e,t,i,a,n){const r=e.filter((e=>i.includes(e.id))),s=mB(hB(r,t,n),t,n);return s.forEach((i=>{const r=[];t.forEach((t=>{if(t.isSubtableColumn&&t.isPartOfSubtable!==n){if(t.isPartOfSubtable!==n&&t.isFirstSubtableColumn){const a=gB(i.id,e,t);yB(a,t.type,r)}}else{const e=zu(i,t);yB(e,t.type,r)}})),a.push(r)})),a}function hB(e,t,i){const a=t.find((e=>e.isFirstSubtableColumn&&e.isPartOfSubtable===i));if(!a)throw new Error("No primary column found");return e.filter((e=>{const t=zu(e,a);return t!==$u}))}function mB(e,t,i){const a=t.find((e=>e.isFirstSubtableColumn&&e.isPartOfSubtable===i));if(!a)throw new Error("No primary column found");const n=e.reduce(((e,t)=>(e[t.id]=e[t.id]||[],e[t.id].push(t),e)),{}),r=[];return Object.keys(n).forEach((e=>{const t=[],i=n[e];i.length>1?i.forEach((e=>{const i=zu(e,a);i&&t.push(e)})):t.push(...i),0===t.length?r.push(i[0]):r.push(...t)})),r}function fB(e,t,i,a){return i.forEach((i=>{const n=[];t.forEach((t=>{if(t.isSubtableColumn){if(t.isFirstSubtableColumn){const a=gB(i,e,t);yB(a,t.type,n)}}else{const a=e.find((e=>e.id===i)),r=zu(a,t);yB(r,t.type,n)}})),a.push(n)})),a}function gB(e,t,i){if("string"!==typeof i.data)throw new Error("column.data must be a string");if("farmdok.subtablePrimaryColumn"!==i.type)throw new Error("column.type must be farmdok.subtablePrimaryColumn");const a=t.filter((t=>
1t.id===e)),n=a.map((e=>cB()(e,i.data,null))).filter((e=>e&&"HOT_DISPLAY_BUTTON_RENDERER"!==e)),r=zu(n,i);return r}function yB(e,t,i){if("farmdok.amountUnit"===t){const t=e.split(" ");return 1===t.length&&t.push(""),void i.push(...t)}i.push(e)}function vB(e,t,i,a,n){const r=[{bold:!0},{fontSize:10},{format:"default"},{format:"numeric"},{format:"datetime"}],s=bB(t,a),o=rB(s,n),{columnWidths:l,columnTitles:d,columnDescriptions:c}=lB(o,a),u=uB(e,s,d,c,i,n),p=nB(u.length,o),h=[{sheetSettings:{},sheetName:"Sheet 1",metadata:{cells:p,lut:r},data:u,columnWidths:l,rowHeights:[],images:[]}];return JSON.stringify(h)}function bB(e,t){return 0===t.countRows()?e:e.map((e=>{if("string"!==typeof e.data)return e;const i=t.propToCol(e.data);if("number"!==typeof i||i<0)return e;const{decimalPlaces:a}=t.getCellMeta(0,i);return"number"!==typeof a?e:{...e,decimalPlaces:a}}))}function wB(e){return e<0?-1:e>0?1:0}function CB(e,t){return function(t,i){if("asc"===e){const e=t-i;return wB(e)}const a=i-t;return wB(a)}}var FB={compareFunctionFactory:CB};const AB={id:null,name:""};class kB extends Bu.Z.editors.TextEditor{init(){super.init(),this.dropdownItems={data:[],loading:!0,selected:{id:null,name:""}},this.dropdownComparableItem={category:null,value:null},this.dropdownBoundary=null}prepare(e,t,i,a,n,r){super.prepare(e,t,i,a,n,r);const s=r;"function"===typeof s.getDropdownBoundary&&(this.dropdownBoundary=s.getDropdownBoundary());const o=n??AB;b["default"].set(this.dropdownItems,"data",[]),b["default"].set(this.dropdownItems,"loading",!0),b["default"].set(this.dropdownItems,"selected",o);const l=+new Date;this.getItemsToken=l,s.dropdown.getItems(e,this.instance).then((e=>{this.getItemsToken===l&&(b["default"].set(this.dropdownItems,"data",e),b["default"].set(this.dropdownItems,"loading",!1))})),null!=s.dropdownComparableItem?(b["default"].set(this.dropdownComparableItem,"category",s.dropdownComparableItem.category),b["default"].set(this.dropdownComparableItem,"value",s.dropdownComparableItem.value)):(b["default"].set(this.dropdownComparableItem,"category",null),b["default"].set(this.dropdownComparableItem,"value",null))}createElements(){super.createElements();const e=this.TEXTAREA_PARENT.appendChild(document.createElement("div")),t={dropdownItems:this.dropdownItems,dropdownComparableItem:this.dropdownComparableItem,dropdownVariant:"table-editor",dropdownBoundary:()=>null==this.dropdownBoundary?window:this.dropdownBoundary};this.dropdown=new b["default"]({render:e=>e(nk),provide:t}).$mount(e),this.dropdown.$children[0].$on("select",(e=>{this.setValue(e),this.finishEditing(!1)})),this.dropdown.$children[0].$on("close",(()=>{this.finishEditing(!0)}))}getValue(){const{selected:e}=this.dropdownItems;if(e.id)return e}setValue(e){la(e)?b["default"].set(this.dropdownItems,"selected",e):void 0!==e&&null!==e&&""!==e||b["default"].set(this.dropdownItems,"selected",AB)}open(){super.open(),this.TEXTAREA_PARENT.getElementsByClassName("handsontableInput")[0].style.display="none",this.TEXTAREA_PARENT.style.width=`${this.TD.clientWidth}px`,this.TEXTAREA_PARENT.style.zIndex="200",this.dropdown.$children[0].open()}finishEditing(e,t,i){const a=this.getValue();null==a||"STATE_EDITING"===this.state&&a===this.originalValue?super.finishEditing(!0,t,i
1):super.finishEditing(e,t,i)}saveValue(e,t){let i,a;if(t){console.warn("DropdownEditor can only update single cells. Don't select multiple cells");const e=this.hot.getSelectedLast();if(!e)throw new Error("selectedLast is null");i=Math.max(Math.min(e[0],e[2]),0),a=Math.max(Math.min(e[1],e[3]),0)}else[i,a]=[this.row,this.col];const n=this.hot.runHooks("modifyGetCellCoords",i,a);Array.isArray(n)&&([i,a]=n),this.hot.setDataAtCell(i,a,e[0][0],"edit")}close(){this.TEXTAREA_PARENT.style.removeProperty("z-index"),this.TEXTAREA_PARENT.getElementsByClassName("handsontableInput")[0].style.display="block",this.dropdown.$children[0].close(),super.close(),this.hot.listen()}}function SB(e,t){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e-1,"id");return i!==a}function EB(e,t){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e+1,"id");return i!==a}function IB(e,t,i){const a=i.getDataAtRowProp(t,"expand");a&&((SB(t,i)&&!EB(t,i)||!SB(t,i))&&e.classList.add("merge-rows"),EB(t,i)&&e.classList.add("merge-rows-last"))}function _B(e){return!(!Array.isArray(e)||!(0===e.length||"id"in e[0]&&"expand"in e[0]))}function DB(e,t){return _B(t)?MB(e,t):PB(e,t)}function MB(e,t){return TB(e,t)?e:MB(e+1,t)}function PB(e,t){return xB(e,t)?e:PB(e+1,t)}function TB(e,t){if(e===t.length-1)return!0;const i=t[e+1].id,a=t[e].id;return i!==a}function xB(e,t){if(e===t.countRows()-1)return!0;const i=t.getDataAtRowProp(e+1,"id"),a=t.getDataAtRowProp(e,"id");return i!==a}function BB(e,t,i,a){if(!i.isSubtableColumn)return;e.classList.add("subtable");const n=a.getDataAtRowProp(t,"expand");n&&e.classList.add("subtable-expanded"),i.isLastSubtableColumn&&e.classList.add("subtable-last-column"),xB(t,a)&&e.classList.add("subtable-last-row")}function OB(e,t,i,a,n,r,s,...o){if(s.required&&null==r)return RB(s,r,i,e)&&NB(t,s),void bF.apply(this,[e,t,i,a,n,r,s,...o]);const l=s.dropdown.getDisplayValue?.(r,i,e)??r?.name??"";Bu.Z.renderers.AutocompleteRenderer(e,t,i,a,n,l,s),s.dropdown.isReadOnly&&(s.readOnly=s.dropdown.isReadOnly(i,a,e)),s.readOnly&&t.classList.add("read-only"),$B(t,l,r,i,e,s),BB(t,i,s,e),IB(t,i,e),s.showNotification&&zB(t,s),RB(s,r,i,e)&&NB(t,s)}function $B(e,t,i,a,n,r){const s=r.dropdown.getTooltipLabel?.(i,a,n)?.trim();s?e.setAttribute("title",s):wF(e,t)}function RB(e,t,i,a){if("function"===typeof e.showWarning){if(e.showWarning(t,i,a))return!0}else if(e.showWarning)return!0;return!1}function NB(e,t){e.classList.add("warning"),zB(e,t)}function zB(e,t){const i=e.querySelector("span.hot-floating-cell-icon")||document.createElement("span");i.className="hot-floating-cell-icon hot-floating-cell-icon--plain hot-floating-cell-icon--dropdown",i.innerHTML="";const[a]=(0,ow.qv)({prefix:"fal",iconName:"exclamation-circle"}).node;i.append(a),t.warningIcon?.tooltipLabel&&(i.title=t.warningIcon.tooltipLabel),e.classList.add("hot-cell-with-floating-cell-icon"),e.classList.add("hot-cell-with-floating-cell-icon--dropdown"),e.append(i)}function LB(e,t){return function(t,i){const a=t?.name??"",n=i?.name??"",r=a.localeCompare(n);return wB("asc"===e?r:-1*r)}}ow.vI.add(a_.RLE);var VB={compareFunctionFactory:LB};function UB(e,t,i,a,n,r,s){if(!jB(i,e))return Bu.Z.dom.empty(t),void IB(t,i,e);Bu.Z.renderers.CheckboxRenderer.apply(this,[e,t,i,a,n,r,s]);const o=t.firstChild,l=r?"chevron-up":"chevron-down",[d]=(0,ow.qv)({prefix:"fas",iconName:l}).node;t.classList.add("text-black"),t.classList.add("expand"),t.insertBefore(d,o),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s]),IB(t,i,e)}function jB(e,t){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e+1,"id"),n=i!==a;return SB(e,t)&&!n}function HB(e,t){return e<0||t<0}function GB(e){function t(t){if(e&&"Enter"===t.key){const t=e.getSelected();if(!t)return;const i=t[0][0],a=t[0][1];if(HB(i,a))return;const n=e.getCellMeta(i,a);if("farmdok.expand"===n.type){const t=e.getDataAtCell(i,a);e.setDataAtRowProp(i,"expand",!t)}}}return t}function WB(e){function t(t,i){e&&"edit"===i&&t?.forEach((t=>{if(!t)return;const[i,a,n,r]=t;if("expand"===a&&n!==r){const t=e.getPlugin("hiddenRows");if(!t)throw new Error("hiddenRows plugin must be activated for ExpandRenderer");const a=ZB(i,e);r?t.showRows(a):t.hideRows(a)}}))}return t}function ZB(e,t){const i=[],a=t.getDataAtRow(e),n=a[0];for(let r=e+1;r<t.countRows();r+=1){const e=t.getDataAtRow(r),a=e[0];if(a!==n)break;i.push(r)}return i}ow.vI.add(uw.mTx,uw.ptq);const KB={beforeChange:{showHideRowsFactory:WB},beforeKeyDown:{handleKeyClickFactory:GB}};var qB=KB;const YB={data:"expand",type:"farmdok.expand",noHeaderContextMenu:!0,hiddenInPageSettings:!0,fixed:!0,width:45,disableColumnResize:!0};var JB=YB;const XB={data:"placeholderColumn",type:"farmdok.placeholder",width:190,readOnly:!0,hiddenInPageSettings:!0,noHeaderContextMenu:!0};var QB=XB;
1const eO={data:"storeStatus",hiddenInPageSettings:!0,hidden:!0};var tO=eO;let iO=null;const aO=new Map,nO=[{id:"bbch-fallback",items:Array.from({length:100},((e,t)=>({id:lo(t),name:lo(t)}))),sort:!1}],rO=(e,t)=>!SB(e,t);function sO(e,t){const i=`${Math.floor(e)}X`;return t?`BBCH ${i} - ${t}`:`BBCH ${i}`}function oO(e){const t=oo(e.bbchCode);return null===t?null:{bbchCode:t,description:e.description?.trim()??"",macroStage:Math.floor(e.macroStage??0),macroStageName:e.macroStageName?.trim()??""}}function lO(e){const t=Lb.state.products.crops.data;if(t[e])return t[e];const i=Object.values(t).find((t=>String(t.id)===String(e)));return i??null}function dO(e,t){const i=t.getDataAtRowProp(e,"fieldDropdownItem")?.id;if(!i)return null;const a=Lb.state.fields.data[i];return a?.cropId?lO(a.cropId)?.bbchGroupId??null:null}function cO(e,t){const i=dO(e,t);return i?[i]:[]}function uO(e){const t=Lb.state,i=t.activities.data[e];if(i)return i;const{activities:a}=t.activities.createEditActivity;return a.find((t=>t.id===e))??null}function pO(e,t){const i=t.getDataAtRowProp(e,"id");return i?uO(i):null}function hO(e,t){const i=pO(e,t);return i?gA([i]):[]}function mO(e,t){const i=pO(e,t);if(!i)return[];const a=Lb.state.pesticideIndications.data;return yA([i],a)}async function fO(e){const t=e.filter((e=>void 0===Lb.state.pesticideIndications.data[e]));if(t.length<1)return;const i=t.filter((e=>!aO.has(e)));if(i.length>0){const e=Promise.resolve(Lb.dispatch("pesticideIndications/loadByIds",i)).then((()=>{})).finally((()=>{i.forEach((e=>{aO.delete(e)}))}));i.forEach((t=>{aO.set(t,e)}))}const a=t.map((e=>aO.get(e))).filter((e=>void 0!==e));await Promise.all(a)}function gO(e,t,i=[]){const a=AA();return!a||a.length<1?null:vA(a,cO(e,t),i).map(oO).filter((e=>null!==e))}function yO(e){const t=lo(e.bbchCode);return{id:t,name:`${t} - ${e.description}`}}function vO(e){const t=e.reduce(((e,t)=>{const i=e.get(t.macroStage);return i?(i.items.push(yO(t)),e):(e.set(t.macroStage,{id:`bbch-${t.macroStage}`,name:sO(t.macroStage,t.macroStageName),items:[yO(t)],sort:!1}),e)}),new Map);return[...t.entries()].sort(((e,t)=>e[0]-t[0])).map((([,e])=>e))}function bO(e){if(!e?.id)return null;const t=oo(e.id);return null===t?null:lo(t)}function wO(e){return`${e.macroStageName}: ${e.description}`}function CO(e){const t=AA();if(t)return;if(iO)return;const{$api:i}=Lb;i&&(iO=kA(i).then((()=>{e.render()})).finally((()=>{iO=null})))}function FO(e,t,i){if(!e?.id)return null;const a=oo(e.id);if(null===a)return null;if(!dO(t,i))return null;const n=gO(t,i);if(!n)return CO(i),null;const r=n.find((e=>e.bbchCode===a));return r?wO(r):null}async function AO(e,t){const{$api:i}=Lb;await kA(i);const a=hO(e,t);await fO(a);const n=mO(e,t),r=gO(e,t,n);return r?r.length<1?[]:vO(r):nO}const kO={data:"bbchDropdownItem",header:{title:()=>"BBCH"},type:"farmdok.dropdown",renderer:"farmdok.optional",width:100,renderEmpty:rO,dropdown:{getItems:AO,getDisplayValue:bO,getTooltipLabel:FO},columnSorting:VB};var SO=kO;function EO(e,t,i,a,n,r,s,...o){const l=new b["default"]({render:t=>t(Fw,{props:{color:s.button.color},on:{click:t=>{s.readOnly||s.button.onClick({event:t,visualRow:i,instance:e})}}},[s.button.label()])});return l.$mount(),t.innerText="",t.style.fontSize="12px",s.readOnly&&l.$el.classList.add("disabled"),BB(t,i,s,e),t.appendChild(l.$el),t}function IO(e,t){return _B(t)?_O(e,t):DO(e,t)}function _O(e,t){return MO(e,t)?e:_O(e-1,t)}function DO(e,t){return PO(e,t)?e:DO(e-1,t)}function MO(e,t){if(0===e)return!0;const i=t[e-1].id,a=t[e].id;return i!==a}function PO(e,t){if(0===e)return!0;const i=t.getDataAtRowProp(e-1,"id"),a=t.getDataAtRowProp(e,"id");return i!==a}function TO(e,t,i,a,n,r,s,...o){const l=xO(i,a,e),d=l.filter((e=>"HOT_DISPLAY_BUTTON_RENDERER"!==e)),c=s.collapsedSubtable.getRendererValue({values:d,visualRow:i,instance:e});Bu.Z.renderers.BaseRenderer(e,t,i,a,n,c,s,...o);const u=document.createElement("button"),p=document.createElement("span");p.innerText=c,p.classList.add("text-wrapper"),u.appendChild(p);const h=document.createElement("span");h.innerText=d.length.toString(),h.classList.add("indicator"),u.appendChild(h),t.innerHTML="",t.classList.add("collapsed-subtable-renderer"),t.appendChild(u)}function xO(e,t,i){const a=[],n=IO(e,i),r=DB(e,i);for(let s=n;s<=r;s+=1){const e=i.getDataAtCell(s,t);null!==e&&a.push(e)}return a}function BO(e,t,i,a,n,r,s,...o){if(s.readOnly&&vF(e,t,i,a,n),null===r)return void OB(e,t,i,a,n,r,s,...o);if(r===$u)return void EO(e,t,i,a,n,r,s,...o);const l=e.getDataAtRowProp(i,"expand");l?OB(e,t,i,a,n,r,s,...o):TO(e,t,i,a,n,r,s,...o)}function OO(e,t){return function(e,t){return 0}}var $O={indicator:!1,headerAction:!1,compareFunctionFactory:OO};const RO=(e,t,i)=>{const a=i.getDataAtRowProp(e,"expand");return a&&null!==t&&"HOT_DISPLAY_BUTTON_RENDERER"!==t&&t.id?1:2},NO={data:"equipment",header:{title:()=>b["default"].i18n.translate("Maschinen & Geräte")??""},requiredFeatures:()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EQUIPMENT)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_EQUIPMENT),type:"subtable",subtableColumns:[{data:"equipment.dropdownItem",type:"farmdok.subtablePrimaryColumn",width:200,colspan:(e,t,i,a)=>RO(e,i,a),collapsedSubtable:{getRendererValue({values:e}){const t=e.map((e=>e.name??"")).filter((e=>""!==e));return t.join(", ")},onClick({event:e,visualRow:t,instance:i}){e.preventDefault(),i.setDataAtRowProp(t,"expand",!0)}},button:{label:()=>`+ ${b["default"].i18n.translate("Maschine hinzufügen")}`||"+ Maschine hinzufügen",color:"primary",onClick({visualRow:e,instance:t}){const i=t.getDataAtRowProp(e,"id");Lb.dispatch("activities/addActivityEquipment",i)}},dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"activityTypeDropdownItem")?.id;if(!i)return[];const a=Lb.state.activityTypes.data[i],n=t.getDataAtRowProp(e,"processOrderId");if(!n)return[];const r=Lb.getters["auth/findCompanyByProcessOrderId"](n);if(!r)return[];const s=new Wa(Lb.state.equipments.data),o=Lb.state.equipments.used,l=s.getCompatibleEquipmentsToDropdownItems([a],[r],o);return l}},columnSorting:$O},{data:"equipment.id",type:"text",hidden:!0},{data:"equipmentTrashIcon",type:"farmdok.trashIcon",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:45,disableColumnResize:!0,renderEmpty(e,t){const i=t.getDataAtRowProp(e,"equipment.id");return!i},renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"equipment.dropdownItem");return 2===RO(e,i,t)},onClick(e,t){if(!this.readOnly){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e,"equipment.id");Lb.dispatch("activities/removeOrDeleteActivityEquipmentAndSync",{activityId:i,activityEquipmentId:a})}}}]};var zO=NO;const LO=(e,t)=>
1{const i=t.getDataAtRowProp(e,"expand");return!i},VO=(e,t,i)=>{const a=KO.subtableColumns.filter((e=>!e.hidden)).length,n=!jO.requiredFeatures||jO.requiredFeatures(),r=i.getDataAtRowProp(e,"expand");if(!r)return n?a:a-1;if(null===t||"HOT_DISPLAY_BUTTON_RENDERER"===t||!t.id)return n?2:1;const[s]=t.id.split("_"),o=Lb.getters["products/findProductById"](s);return Lb.getters["productCategories/isHerbicide"](o?.categoryId)?1:n?2:1},UO={data:"product.productStorageDropdownItem",type:"farmdok.subtablePrimaryColumn",renderer:"farmdok.optional",width:200,colspan:(e,t,i,a)=>VO(e,i,a),renderLoading:(e,t,i)=>{if(t&&""!==t.id)return!1;const a=i.getDataAtRowProp(e,"product.isLoading");return a},collapsedSubtable:{getRendererValue({values:e}){const t=e.map((e=>e?.name??"")),i=t.join(", ");return i},onClick({event:e,visualRow:t,instance:i}){e.preventDefault(),i.setDataAtRowProp(t,"expand",!0)}},button:{label:()=>`+ ${b["default"].i18n.translate("Produkt hinzufügen")}`||"+ Produkt hinzufügen",color:"primary",onClick({visualRow:e,instance:t}){const i=t.getDataAtRowProp(e,"id");Lb.dispatch("activities/addActivityProduct",i)}},dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"activityTypeDropdownItem")?.id;if(!i)return[];const a=Lb.state.activityTypes.data[i],n=t.getDataAtRowProp(e,"processOrderId");if(!n)return[];const r=Lb.getters["auth/findCompanyByProcessOrderId"](n);if(!r)return[];const s=Lb.getters["auth/currentProcessOrders"],o=Object.values(Lb.state.productVisibilities.data),l=Object.values(Lb.state.productCategories.data),d=Lb.state.activities.createEditActivity.activities.map((e=>e?.timeStart)).filter(ka),c=t.getDataAtRowProp(e,"fieldDropdownItem")?.id;if(!c)return[];const u=Lb.state.fields.data[c]??null,p=Object.values(Lb.state.storagePlaces.data),h=Lb.getters["products/compatibleProductsToDropdownItems"](a,[r],s,o,l,[u],p,d);return h}},columnSorting:$O},jO={data:"product.pesticideIndicationDropdownItem",type:"farmdok.dropdown",renderer:"farmdok.optional",width:200,requiredFeatures:()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_PESTS)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_PESTS),renderEmpty:LO,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return VO(e,i,t)>1},dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");if(!i)return[];const[a]=i.id.split("_"),n=t.getDataAtRowProp(e,"fieldDropdownItem"),r=t.getDataAtRowProp(e,"timeStart"),s=n.id;if(!a||!s)return[];const o=Lb.getters["pesticideIndications/dropdownItemsForProductAndField"](a,s,[r]);return o??[]}}},HO={data:"product.amountUnitRelative",type:"farmdok.amountUnit",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:120,renderEmpty:LO,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return VO(e,i,t)>2},getUnitName(e){const t=Lb.state.units.data[e];return t?.name??null},getNDecimals:ZO},GO={data:"product.amountUnitTotal",type:"farmdok.amountUnit",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:120,renderEmpty:LO,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return VO(e,i,t)>3},getUnitName(e){const t=Lb.state.units.data[e];return t?.name??null},getNDecimals:ZO},WO={data:"productsTrashIcon",type:"farmdok.trashIcon",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:45,disableColumnResize:!0,renderEmpty(e,t){const i=t.getDataAtRowProp(e,"product.id");return!i},renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return VO(e,i,t)>3},onClick(e,t){if(!this.readOnly){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e,"product.id");Lb.dispatch("activities/removeOrDeleteActivityProductAndSync",{activityId:i,activityProductId:a})}}};function ZO(e){if(!e)return 2;const t=Lb.getters["products/findProductById"](e);if(!t)return 2;const i=Lb.getters["productCategories/isHerbicide"](t.categoryId);return i?3:2}const KO={data:"product",header:{title:()=>b["default"].i18n.translate("Produkte")??""},type:"subtable",subtableColumns:[UO,jO,HO,GO,{data:"product.id",type:"text",hidden:!0},WO]};var qO=KO;const YO=(e,t)=>!SB(e,t),JO={data:"id",header:{title:()=>"ID"},hiddenInPageSettings:!0,hidden:!0,width:200},XO={data:"select",type:"farmdok.checkbox.optional",renderEmpty:YO,noHeaderContextMenu:!0,hiddenInPageSettings:!0,width:45,disableColumnResize:!0},QO={data:"ruleCheckStatus",type:"farmdok.ruleCheckStatus",renderer:"farmdok.optional",noHeaderContextMenu:!0,hiddenInPageSettings:!0,renderEmpty:YO,requiredFeatures:()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_RULE_CHECK)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_RULE_CHECK),onClick(e,t){const i=t.getDataAtRowProp(e,"ruleCheckStatus");if(!i?.type)return;if(![kt.NotChecked,kt.Violation].includes(i.type))return;const a=t.getDataAtRowProp(e,"id");Lb.commit("activities/ruleCheck/showRuleViolationsModal",a)},width:45,disableColumnResize:!0},e$={data:"companyName",type:"text",renderer:"farmdok.optional",header:{title:()=>b["default"].i18n.translate("Betrieb")},readOnly:!0,width:200,renderEmpty:YO,requiredFeatures:()=>{const{currentCompanies:e}=Lb.state.auth;return e.length>1}},t$={data:"timeStart",header:{title:()=>b["default"].i18n.translate("Datum")},type:"datetime",renderer:"farmdok.optional",width:160,columnSorting:FB,initialSortOrder:"desc",renderEmpty:YO},i$={data:"activityTypeDropdownItem",header:{title:()=>b["default"].i18n.translate("Tätigkeit")??""},fixedColumnsLeftUntilHere:!0,className:"border-right text-bold",type:"farmdok.dropdown",renderer:"farmdok.optional",required:!0,width:200,renderEmpty:YO,dropdown:{async getItems(){const{currentCompanies:e}=Lb.state.auth,t=Lb.getters["activityTypes/dropdownItems"](e);return t}},columnSorting:VB},a$={data:"fieldDropdownItem",header:{title:()=>b["default"].i18n.translate("FSNr-Schlag")??"",description:()=>b["default"].i18n.translate("Feldstücknummer - Feldname")},type:"farmdok.dropdown",renderer:"farmdok.optional",width:250,renderEmpty:YO,dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"processOrderId");return i?Lb.getters["fields/dropdownItems"](i):[]}},columnSorting:VB},n$={data:"processedArea",header:{title:()=>b["default"].i18n.translate("Hektar"),description:()=>b["default"].i18n.translate("bearbeitete Fläche (ha)")},type:"numeric",renderer:"farmdok.optional",width:100,renderEmpty:YO,configurableDecimalPlaces:!0,decimalPlaces:2},r$={data:"workingTime",header:{title:()=>b["default"].i18n.translate("Arbeitszeit")},type:"farmdok.duration",renderer:"farmdok.optional",width:100,renderEmpty:YO},s$={data:"thousandGrainWeight",header:{title:()=>b["default"].i18n.translate("Tausendkorngewicht")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},o$={data:"moistureContent",header:{title:()=>
1b["default"].i18n.translate("Feuchtigkeit")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},l$={data:"proteinContent",header:{title:()=>b["default"].i18n.translate("Proteingehalt")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},d$={data:"hectoliterWeight",header:{title:()=>b["default"].i18n.translate("Hektolitergewicht")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},c$={data:"sugarContent",header:{title:()=>b["default"].i18n.translate("Zuckergehalt")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},u$={data:"starchContent",header:{title:()=>b["default"].i18n.translate("Stärkegehalt")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},p$={data:"temperature",header:{title:()=>b["default"].i18n.translate("Temperatur")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},h$={data:"windSpeed",header:{title:()=>b["default"].i18n.translate("Windgeschwindigkeit")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},m$={data:"relativeHumidity",header:{title:()=>b["default"].i18n.translate("Relative Feuchtigkeit")},type:"numeric",renderer:"farmdok.optional",width:110,renderEmpty:YO,hidden:!0,configurableDecimalPlaces:!0,decimalPlaces:2},f$={data:"drivingTime",header:{title:()=>b["default"].i18n.translate("Fahrzeit")},type:"farmdok.duration",renderer:"farmdok.optional",width:100,renderEmpty:YO,hidden:!0},g$={data:"setupTime",header:{title:()=>b["default"].i18n.translate("Rüstzeit")},type:"farmdok.duration",renderer:"farmdok.optional",width:100,renderEmpty:YO,hidden:!0},y$={data:"pauseTime",header:{title:()=>b["default"].i18n.translate("Pause")},type:"farmdok.duration",renderer:"farmdok.optional",width:100,renderEmpty:YO,hidden:!0},v$={data:"userComment",header:{title:()=>b["default"].i18n.translate("Bemerkung")},type:"text",renderer:"farmdok.optional",width:200,renderEmpty:YO},b$={data:"user",header:{title:()=>b["default"].i18n.translate("Benutzer")},type:"text",renderer:"farmdok.optional",width:200,readOnly:!0,renderEmpty:YO},w$={data:"fieldSize",header:{title:()=>b["default"].i18n.translate("Feldgröße"),description:()=>b["default"].i18n.translate("Gesamtfläche in ha")},type:"numeric",renderer:"farmdok.optional",width:100,hidden:!0,renderEmpty:YO,configurableDecimalPlaces:!0,decimalPlaces:2},C$=[JO,tO,XO,JB,QO,e$,t$,i$,a$,n$,qO,zO,SO,s$,o$,l$,d$,c$,u$,p$,h$,m$,r$,f$,g$,y$,v$,b$,w$,QB];var F$=C$;function A$(e,t){return e.filter(((e,i)=>{const a=t.toVisualColumn(i);return e.type!==XO.type&&e.type!==QB.type&&e.type!==JB.type&&e.type!==QO.type&&"farmdok.trashIcon"!==e.type&&!t.getPlugin("hiddenColumns").isHidden(a)}))}function k$(e,t,i,a,n){const r=document.createElement("input");r.type="hidden",r.name="data",r.value=vB(e,A$(t,a),i,a,n);const s=document.createElement("form");s.method="POST",s.action="/admin/reports/generate/xls",s.target="_blank",s.appendChild(r),document.body.appendChild(s),s.submit(),document.body.removeChild(s)}var S$=(0,b.defineComponent)({name:"ModalTableExport",components:{FormCheckbox:Gw,FormRadio:kT,FormFieldRadioGroup:_T,ModalWrapper:OC,Pagination:qk,BButton:u.T,FormFieldDropdown:lk},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},title:{type:String,default:null},availableTypes:{type:Array,default(){return[{value:"xls",label:this.$t("XLS"),text:this.$t("Als Excel-Datei exportieren")},{value:"shape",label:this.$t("Shapefile"),text:this.$t("Im Shape-Format exportieren")},{value:"iso-xml",label:this.$t("ISOXML"),text:this.$t("Zum Import in dein ISOBUS-Terminal")},{value:"kmz",label:this.$t("KMZ"),text:this.$t("Bekannt, unter anderem dafür in Google Earth angezeigt zu werden")}]}},filtered:{type:Boolean,default:!1},dropdownItemsWithSubtableColumnData:{type:Array,default(){return[{id:qx.PER_ROW_ID,name:this.$t("Export pro Tabellenzeile"),subtableColumnData:void 0}]}},hot:{type:Object,default:null},columns:{type:Array,default:null},tableData:{type:Array,default:null}},data(){let e=null;Array.isArray(this.availableTypes)&&this.availableTypes.length>0&&(e=this.availableTypes[0].value);const t=this.dropdownItemsWithSubtableColumnData[0];return{type:e,exportFiltered:!0,currentStep:0,pages:null,selectedOption:t}},computed:{titleComputed(){return"string"!==typeof this.title||0===this.title.length?this.$t("Export")||"Export":this.title},filteredColumns(){return this.columns&&this.hot?A$(this.columns,this.hot):null},dropdownItems(){return[{items:this.dropdownItemsWithSubtableColumnData.map((e=>({id:`${e.id}${e.subtableColumnData?`_${e.subtableColumnData}`:""}`,name:e.name,subtableColumnData:e.subtableColumnData})))}]}},methods:{async show(){this.type=null,Array.isArray(this.availableTypes)&&this.availableTypes.length>
10&&(this.type=this.availableTypes[0].value),this.exportFiltered=!0,this.tableDataIncludesSubtables()&&(this.pages=2);const e=await(this.$refs.modalWrapper?.show());return{type:this.type,exportFiltered:this.exportFiltered,okay:e}},dropdownSelect(e){const t=this.dropdownItems[0].items.find((t=>t.id===e.id));this.selectedOption=t||{...e,subtableColumnData:void 0}},async onExportSelected(e){if(!this.columns||!this.hot||!this.tableData)return this.reset(),void console.error("Columns, handsontable, or tableData are not defined");if("xls"===this.type){const{subtableColumnData:t}=this.selectedOption;k$(e,this.columns,this.tableData,this.hot,t)}this.reset()},tableDataIncludesSubtables(){return!!this.filteredColumns&&this.filteredColumns.some((e=>e.isSubtableColumn))},cancel(){this.$refs.modalWrapper?.cancel(),this.reset()},ok(){this.$refs.modalWrapper?.ok()},reset(){this.type=null,this.exportFiltered=!0,this.currentStep=0,this.pages=null,this.selectedOption=this.dropdownItemsWithSubtableColumnData[0]}}}),E$=S$,I$=(0,ew.Z)(E$,iB,aB,!1,null,null,null),_$=I$.exports;function D$(e){return{data(){return{buttonUpdateSelection:[{text:this.$t("Auswahl aufheben"),handler:()=>this.$refs[e].$refs.table.selectableRowsBatchAction("clear")},{text:this.$t("Auswahl umkehren"),handler:()=>this.$refs[e].$refs.table.selectableRowsBatchAction("reverse")},{text:this.$t("Alle auswählen"),handler:()=>this.$refs[e].$refs.table.selectableRowsBatchAction("all")}]}}}}var M$=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"md",title:e.$t("Maßnahme duplizieren")},scopedSlots:e._u([{key:"default",fn:function(){return[t("ActivityDuplicationsContainer",{attrs:{duplications:e.duplications}})]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{attrs:{variant:"primary"},on:{click:e.hide}},[t("span",[e._v("Ok")])])]},proxy:!0}])})},P$=[],T$=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e.syncing?t("div",[t("Loading")],1):t("div",[e.successfulDuplications.length>0?t("ActivityStatusIndicator",{attrs:{title:e.successTitle,activities:e.getOriginalActivities(e.successfulDuplications),activityTypes:e.activityTypes}}):e._e(),e.failedDuplications.length>0?t("ActivityStatusIndicator",{attrs:{title:e.errorsTitle,activities:e.getOriginalActivities(e.failedDuplications),activityTypes:e.activityTypes}}):e._e()],1)])},x$=[],B$=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{class:["loading",{large:!e.inline,"d-inline":e.inline,"text-primary":"primary"===e.color}]},[t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}})],1)},O$=[];ow.vI.add(uw.IJ7);var $$=(0,b.defineComponent)({name:"Loading",props:{inline:{type:Boolean,required:!1,default:!1},color:{type:String,required:!1,default:"primary"}}}),R$=$$,N$=(0,ew.Z)(R$,B$,O$,!1,null,"342402ab",null),z$=N$.exports,L$=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{attrs:{id:"activity-status-indicator-section"}},[t("div",{staticClass:"section-header"},[t("strong",[e._v(e._s(e.sectionHeader))])]),t("ul",e._l(e.activities,(function(i){return t("li",{key:i.id},[t("ActivitySummary",{attrs:{activity:i,activityTypes:e.activityTypes}})],1)})),0)])},V$=[],U$=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("span",[e._v(e._s(e.title))])},j$=[],H$=(0,b.defineComponent)({name:"ActivitySummary",props:{activity:{type:Object,required:!0},activityTypes:{type:Object,required:!0}},computed:{title(){const e=[];return this.activity.timeStart&&e.push(this.formatTime(this.activity.timeStart)),this.activity.activityTypeId&&e.push(this.getActivityTypeDisplayName(this.activity.activityTypeId)),e.push("on"),e.push(this.activity.fieldDisplayName),e.join(" ")}},methods:{formatTime(e){const t=new Date(1e3*e);return g()(t).format("L")},getActivityTypeDisplayName(e){const t=this.activityTypes[e];return t?t.displayName:""}}}),G$=H$,W$=(0,ew.Z)(G$,U$,j$,!1,null,"82883562",null),Z$=W$.exports,K$=(0,b.defineComponent)({name:"ActivityStatusIndicator",components:{ActivitySummary:Z$},props:{title:{type:String,required:!0},activities:{type:Array,required:!0},activityTypes:{type:Object,required:!0}},computed:{sectionHeader(){return`${this.activities.length} ${this.title}`}}}),q$=K$,Y$=(0,ew.Z)(q$,L$,V$,!1,null,"7e6b38ed",null),J$=Y$.exports,X$=(0,b.defineComponent)({name:"ActivityDuplicationsContainer",components:{ActivityStatusIndicator:J$,Loading:z$},props:{duplications:{type:Array,required:!0}},watch:{successfulDuplications:{handler(){this.selectSuccessfulDuplicates(),this.deselectActivities(this.successfulDuplications.map((e=>e.originalId)))},immediate:!0},failedDuplications:{handler(){this.deselectActivities(this.failedDuplications.map((e=>e.duplicateId)))},immediate:!0}},computed:{...(0,C.rn)("activities",{activities:e=>e.data,syncing:e=>e.syncing,errors:e=>{const t=Object.values(e.errors);return t.map((e=>e.guid))}}),...(0,C.Se)({activityTypes:"activityTypes/data",fields:"fields/data",customers:"customers/data",crops:"products/crops/data"}),successfulDuplications(){return this.duplications.filter((e=>!this.errors.includes(e.duplicateId)))},failedDuplications(){return this.duplications.filter((e=>this.errors.includes(e.duplicateId)))},successTitle(){return 1===this.successfulDuplications.length?this.$t("Maßnahme erfolgreich dupliziert"):this.$t("Maßnahmen erfolgreich dupliziert")},errorsTitle(){return 1===this.failedDuplications.length?this.$t("Maßnahme konnte nicht dupliziert werden"):this.$t("Maßnahmen konnten nicht dupliziert werden")}},methods:{getOriginalActivities(e){const t=e.map((e=>this.activities[e.originalId]));return Object.values(yo(t.reduce(((e,t)=>({...e,[t.id]:t})),{}),(()=>{}),!1,{},{},this.fields,this.customers,this.crops))},selectSuccessfulDuplicates(){this.successfulDuplications.forEach((e=>{this.$store.commit("activities/addOrUpdateTableDataMetadataByKeyAndValue",{activityId:e.duplicateId,key:"select",value:!0})}
1))},deselectActivities(e){e.forEach((e=>{this.$store.commit("activities/addOrUpdateTableDataMetadataByKeyAndValue",{activityId:e,key:"select",value:!1})}))}}}),Q$=X$,eR=(0,ew.Z)(Q$,T$,x$,!1,null,null,null),tR=eR.exports,iR=(0,b.defineComponent)({name:"ModalDuplicateActivity",components:{ModalWrapper:OC,ActivityDuplicationsContainer:tR},data(){return{duplications:[]}},methods:{async show(e){return this.duplications=e,this.$refs.modalWrapper.show()},hide(){this.duplications=[],this.$refs.modalWrapper.hide()}}}),aR=iR,nR=(0,ew.Z)(aR,M$,P$,!1,null,"7bb3e9b2",null),rR=nR.exports,sR=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}})},oR=[];function lR(e,t){const i=t.getSettings().fixedColumnsLeft??0;return e.map(((e,a)=>{if("string"!==typeof e.data)throw new Error("column.data is not a string");const n=cR(e),r=t.propToCol(n);return{...e,physicalColumn:a,visualColumn:r,fixed:r<i,visible:pR(r,t),decimalPlaces:uR(e,r,t)}}))}function dR(e){return e.reduce(((e,t)=>{if("string"!==typeof t.data)throw new Error("column.data is not a string");return{...e,[t.data]:{visualColumn:t.visualColumn,physicalColumn:t.physicalColumn,hidden:!t.visible,...t.configurableDecimalPlaces&&"number"===typeof t.decimalPlaces?{decimalPlaces:t.decimalPlaces}:{}}}}),{})}function cR(e){if("string"!==typeof e.data)throw new Error("column.data is not a string");return"subtable"===e.type?e.subtableColumns[0].data:e.data}function uR(e,t,i){if(0===i.countRows()||t<0)return e.decimalPlaces;const{decimalPlaces:a}=i.getCellMeta(0,t);return"number"===typeof a?a:e.decimalPlaces}function pR(e,t){const i=t.getPlugin("hiddenColumns");if(!i.isEnabled())return!0;const a=i.getHiddenColumns();return!a.includes(e)}class hR{constructor(e){(0,tt.Z)(this,"columns",void 0),this.columns=e}getColumnsForHandsontable(e){return this.columns.filter(hR.filterUnavailableColumns).map(hR.addUserColumnSettings(e))}getAvailableColumns(){return this.columns.filter(hR.filterUnavailableColumns)}static filterUnavailableColumns(e){return!e.requiredFeatures||e.requiredFeatures()}static addUserColumnSettings(e){return(t,i)=>{if("string"!==typeof t.data)throw new Error("column.data is not a string");const a=e[t.data]??{visualColumn:i,physicalColumn:i};return{...t,...a,hidden:a.hidden??t.hidden??!1,decimalPlaces:a.decimalPlaces??t.decimalPlaces}}}}var mR=(0,b.defineComponent)({name:"ModalPageSettingsContainer",components:{ModalPageSettings:HE},data(){return{columnsForPageSettings:null}},computed:{...(0,C.rn)("activities",["hot","userColumnSettings"])},methods:{async show(){if(this.hot){const e=new hR(F$).getColumnsForHandsontable(this.userColumnSettings);this.columnsForPageSettings=lR(e,this.hot)}const e=await this.$refs.modalPageSettings.show();if(e){const t=dR(e.columns);this.$store.commit("activities/setUserColumnSettings",t)}}}}),fR=mR,gR=(0,ew.Z)(fR,sR,oR,!1,null,"631d6ac0",null),yR=gR.exports,vR=function(){var e=this,t=e._self._c;e._self._setupProxy;return!e.loading&&e.tableData.length>0?t("TableActivities",{key:e.companyScopedTableId,ref:"table",attrs:{tableId:e.companyScopedTableId,tableData:e.tableData,columns:e.columnsForHandsontable,fixedColumnsLeft:e.fixedColumnsLeft,filterString:e.filterString},on:{"update:filterString":t=>e.$emit("update:filterString",t),onChange:e.onChange,"update:hot":e.onUpdateHot,"update:expandedTableData":e.onUpdateExpandedTableData},scopedSlots:e._u([{key:"footer",fn:function({hot:e,visibleRows:i,totalRows:a}){return[t("TableFooterContainer",{attrs:{hot:e,visibleRows:i,totalRows:a}})]}}],null,!1,3678674152)}):e.loading?t("TableActivitiesLoading",{attrs:{columns:e.columnsForHandsontable}}):t("NoContentContainer",{on:{createActivity:function(t){return e.$emit("createActivity")}}})},bR=[],wR=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableFooter",{attrs:{totalRows:e.totalRows,visibleRows:e.visibleRows,selectedRows:e.selectedRows}},[t("TableFooterRuleCheckStatusContainer")],1)},CR=[],FR=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.featureRuleCheckEnabled&&e.featureRuleCheckVisible?t("FooterRuleCheckStatus",{attrs:{status:e.status,violations:e.violations.length},on:{click:e.onClick}}
1):e._e()},AR=[],kR=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("button",{attrs:{disabled:e.disabled},on:{click:function(t){return e.$emit("click")}}},[t("FontAwesomeIcon",{class:e.iconColorClass,attrs:{icon:e.statusIcon,spin:"LOADING"===e.status}}),e._v(" "+e._s(e.statusText)+" ")],1)},SR=[];ow.vI.add(lw.xHz),ow.vI.add(uw.IJ7),ow.vI.add(uw.f8k);var ER=(0,b.defineComponent)({name:"FooterRuleCheckStatus",props:{status:{type:String,default:"OK"},violations:{type:Number,default:0},disabled:{type:Boolean,required:!1,default:!1}},computed:{statusText(){switch(this.status){case"LOADING":return this.$t("Live check läuft...")||"Live check läuft...";case kt.Violation:case kt.NotChecked:return this.$t("Warnhinweise gefunden: {count}",{count:this.violations})||`Warnhinweise gefunden: ${this.violations}`;default:return this.$t("Keine Warnhinweise gefunden")||"Keine Warnhinweise gefunden"}},statusIcon(){switch(this.status){case"LOADING":return["fas","circle-notch"];case kt.Violation:case kt.NotChecked:return["far","circle-exclamation"];default:return["fas","check-circle"]}},iconColorClass(){switch(this.status){case kt.Violation:return"text-danger-dark";default:return"text-gray-600"}}}}),IR=ER,_R=(0,ew.Z)(IR,kR,SR,!1,null,"cc537200",null),DR=_R.exports,MR=(0,b.defineComponent)({name:"TableFooterRuleCheckStatusContainer",components:{FooterRuleCheckStatus:DR},computed:{loading(){return this.$store.state.activities.ruleCheck.activityRuleViolations.fetching},violations(){return this.$store.getters["activities/ruleCheck/violations"]()},status(){return this.loading?"LOADING":po.getRuleCheckStatusType(this.violations)},featureRuleCheckEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_RULE_CHECK)},featureRuleCheckVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_RULE_CHECK)}},methods:{onClick(){const e=this.violations?.[0]?.activityId;e&&this.$store.commit("activities/ruleCheck/showRuleViolationsModal",e)}}}),PR=MR,TR=(0,ew.Z)(PR,FR,AR,!1,null,"8f2cc822",null),xR=TR.exports,BR=(0,b.defineComponent)({name:"TableFooterContainer",components:{TableFooter:hD,TableFooterRuleCheckStatusContainer:xR},props:{hot:{type:Object},visibleRows:{type:Number},totalRows:{type:Number}},computed:{selectedRows(){const e=new Set,t=this.hot?.getSourceData().filter((t=>{const{id:i}=t;return!e.has(i)&&(e.add(i),!0)})),i=t?.filter((e=>!0===e.select));return i?.length??0}}}),OR=BR,$R=(0,ew.Z)(OR,wR,CR,!1,null,"5f440124",null),RR=$R.exports,NR=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableWrapper",{scopedSlots:e._u([{key:"footer",fn:function(){return[e._t("footer",null,{hot:e.hot,visibleRows:e.visibleRows,totalRows:e.totalRows})]},proxy:!0}],null,!0)},[t("HotTable",{ref:"table",attrs:{id:e.tableId,settings:e.initialTableSettings,data:e.initialTableData}}),e.hot?t("TableHeaderContextMenuInjector",{ref:"contextMenuInjector",attrs:{tableRef:e.$refs.table,columns:e.tableColumns,filtersByColumnKey:e.filtersByColumnKey},on:{filtersByColumnKey:e.onFiltersByColumnKey,filtersByDate:e.onFiltersByDate}}):e._e(),e.hot?t("FilterInfoBarInjector",{attrs:{tableRef:e.$refs.table,filterActive:e.debouncedFilterActive},on:{onReset:e.clearAllFilters}}):e._e()],1)},zR=[],LR=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("TableHeaderContextMenu",{ref:"contextMenu",attrs:{target:e.tableHeaderContextMenuTarget,filter:e.tableHeaderContextMenuFilter,availableValues:e.tableHeaderContextMenuAvailableValues},on:{close:e.tableHeaderContextMenuClose,sort:e.tableHeaderContextMenuSort,"update:filter":e.tableHeaderContextMenuUpdateFilter,"update:dateFilter":e.tableHeaderContextMenuUpdateDateFilter}})],1)},VR=[];function UR(e,t){const i=jR(e,t);return i}function jR(e,t,i=""){const a=HR(e,t,i),n=GR(e,t,i);return{...a,...n}}function HR(e,t,i=""){const a={};return Object.keys(e).forEach((e=>{const n=""===i?e:`${i}.${e}`;void 0===t[e]&&(a[n]=null)})),a}function GR(e,t,i=""){let a={};return Object.entries(t).forEach((([n,r])=>{const s=WR(t,n,i);Ha()(r,e[n])||("object"===typeof r&&"object"===typeof e[n]?a={...a,...jR(e[n],r,s)}:a[s]=r)})),a}function WR(e,t,i=""){return Array.isArray(e)?`${i}[${t}]`:""===i?t:`${i}.${t}`}function ZR(e,t,i,a,n,r){let s=[];(t.length>0||null!==i)&&(s=XR(t,n,r,i));const o=QR(a,n);s=[...o,...s];const l=s.map((e=>e.index)),d=JR(e);qR(d),d.trimRows(l)}function KR(e,t){const i=JR(e);i.trimRows(t)}function qR(e){const t=e instanceof Bu.Z.plugins.TrimRows?e:JR(e);t.untrimAll()}function YR(e){const t=JR(e);
1return t.getTrimmedRows()}function JR(e){const t=e.getPlugin("trimRows");if(!t)throw new Error("TrimRows plugin not found");return t}function XR(e="",t=[],i=[],a=null){if(0===e.length&&(null==a||0===Object.keys(a).length))return[];const n=[];t.forEach((t=>{let r=!1;e&&(r=i.some((i=>{const a=zu(t,i);return 0!==a.length&&(Array.isArray(a)?a.some((t=>t.toLowerCase().includes(e.toLowerCase()))):a.toLowerCase().includes(e.toLowerCase()))})),r)?n.push(t):null!=a&&0!==Object.keys(a).length&&(r=i.every((e=>{const i=Lu(e);if(null==a[i])return!0;const n=zu(t,e);return Array.isArray(a[i].selectedValues)?Array.isArray(n)?n.some((e=>a[i].selectedValues.includes(e))):a[i].selectedValues.includes(n):"string"!==typeof a[i].value||0===a[i].value.length||wI(n,a[i].value,a[i].type)})),r&&n.push(t))}));const r=new Set(n.flatMap((e=>void 0===e.id?[]:[e.id]))),s=n.concat(t.filter((e=>r.has(e.id)))),o=t.map(((e,t)=>({entry:e,index:t}))).filter((e=>void 0===e.entry.id?!s.includes(e.entry):!s.some((t=>t.id===e.entry.id))));return o}function QR(e,t){let i=[];return e&&e.columnKey?(i=t.map(((e,t)=>({entry:e,index:t}))).filter((t=>{const i=t.entry[e.columnKey],a=new Date(1e3*i);return!(!e.dateFrom&&!e.dateTo)&&(e.dateFrom&&!e.dateTo?a.setHours(0,0,0)<e.dateFrom.setHours(0,0,0):e.dateTo&&!e.dateFrom?a.setHours(0,0,0)>e.dateTo.setHours(0,0,0):!e.dateFrom||!e.dateTo||(a.setHours(0,0,0)<e.dateFrom.setHours(0,0,0)||a.setHours(0,0,0)>e.dateTo.setHours(0,0,0)))})),i):[]}ow.vI.add(uw.yh$,lw.G_j);var eN=(0,b.defineComponent)({name:"TableHeaderContextMenuInjector",components:{TableHeaderContextMenu:I_},props:{tableRef:{type:Object,required:!0},columns:{type:Array,required:!0},filtersByColumnKey:{type:Object,required:!0}},data(){return{tableHeaderContextMenuTarget:null,tableHeaderContextMenuAvailableValues:null}},mounted(){this.hot.addHook("afterGetColHeader",this.afterGetColHeaderHook),this.hot.addHook("afterScrollHorizontally",this.tableHeaderContextMenuClose)},computed:{hot(){if(!("hotInstance"in this.tableRef))throw new Error("hotInstance is null");return this.tableRef.hotInstance},tableHeaderContextMenuFilter(){if(null===this.tableHeaderContextMenuTarget)return null;const e=Lu(this.tableHeaderContextMenuTarget.column);return null===this.filtersByColumnKey||null===this.filtersByColumnKey[e]?null:this.filtersByColumnKey[e]},computedFiltersByColumnKey(){return Xe()(this.filtersByColumnKey)}},watch:{computedFiltersByColumnKey:{handler(e,t){const i=this.detectDifferentFilters(t,e);i.forEach((({columnKey:e,filter:t})=>{t&&!this.allValuesSelected(e,t)?this.addFilteredIcon(e):this.removeFilteredIcon(e)}))},deep:!0}},methods:{detectDifferentFilters(e,t){const i=[],a=UR(e,t);return Object.entries(a).forEach((([e])=>{const a=e.split(".")[0],n=t[a];i.push({columnKey:a,filter:n})})),i},tableHeaderContextMenuClose(){null!=this.tableHeaderContextMenuTarget&&this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--clicked"),this.resetTargetAndAvailableValues()},afterGetColHeaderHook(e,t){const i=this.hot.toPhysicalColumn(e),a=this.columns[i];if(null==a)return;if(a.noHeaderContextMenu){const e=this.getMenuIcon(t);return void(e.length>0&&e.forEach((e=>e.remove())))}const n=Lu(a),r=this.getMenuIcon(t,n);r.length>0||this.addContextMenuIcon(e,a,t)},addContextMenuIcon(e,t,i){if(!i.firstChild)throw new Error("th.firstChild is null");const a=this.createContextMenuIcon(e,t,i);i.firstChild.appendChild(a)},createContextMenuIcon(e,t,i){if(!i.firstChild)throw new Error("th.firstChild is null");const a=document.createElement("span"),n=Lu(t),r=this.getDataAttributeSafeColumnKey(n);a.dataset.columnKey=r,a.addEventListener("click",(i=>this.tableHeaderContextMenuClick(i,e,t))),a.classList.add("table-header-context-menu__icon");const[s]=(0,ow.qv)({prefix:"fas",iconName:"chevron-circle-down"}).node;s.classList.add("table-header-context-menu__icon-chevron-circle-down"),a.appendChild(s);const[o]=(0,ow.qv)({prefix:"far",iconName:"filter"}).node;return o.classList.add("table-header-context-menu__icon-filter"),a.append(o),a},async tableHeaderContextMenuClick(e,t,i){if(e.preventDefault(),e.stopPropagation(),!(e.target instanceof Element))throw new Error("e.target is not an Element");const a=this.findContextMenuInParentDomElement(e.target);if(!a)throw new Error("Could not find context menu icon element.");if(a.classList.add("table-header-context-menu__icon--clicked"),null!=this.tableHeaderContextMenuTarget){this.tableHeaderContextMenuTarget.element.classList.remove("table-header-context-menu__icon--clicked");const e=this.tableHeaderContextMenuTarget.column;if(e===i)return void this.resetTargetAndAvailableValues()}const n=this.getCurrentSortOrder(t),r=this.isSortDisabled(t);this.tableHeaderContextMenuTarget={element:a,column:i,sortOrder:n,sortDisabled:r},this.tableHeaderContextMenuAvailableValues=this.getAvailableValuesFromColumnData(t,i)},tableHeaderContextMenuSort(e){if(null===this.tableHeaderContextMenuTarget)return;const t=Lu(this.tableHeaderContextMenuTarget.column),i=this.hot.propToCol(t);this.getEnabledSortPlugin()?.sort({column:i,sortOrder:e}),this.tableHeaderContextMenuClose()},tableHeaderContextMenuUpdateFilter(e){if(null===this.tableHeaderContextMenuTarget)return;const t=Lu(this.tableHeaderContextMenuTarget.column);e&&!this.allValuesSelected(t,e)?this.$emit("filtersByColumnKey",t,e):this.$emit("filtersByColumnKey",t,null)},tableHeaderContextMenuUpdateDateFilter(e){if(null===this.tableHeaderContextMenuTarget)return;const t=Lu(this.tableHeaderContextMenuTarget.column);e?this.$emit("filtersByDate",{...e,columnKey:t}):this.$emit("filtersByDate",null)},findContextMenuInParentDomElement(e){return null==e?null:e.classList.contains("table-header-context-menu__icon")?e:this.findContextMenuInParentDomElement(e.parentElement)},getCurrentSortOrder(e){return this.getEnabledSortPlugin()?.getSortConfig(e)?.sortOrder??null},isSortDisabled(e){const t=this.hot.toPhysicalColumn(e),i=this.columns[t];return void 0!==i.columnSorting&&(!1===i.columnSorting||!0!==i.columnSorting&&!1===i.columnSorting.headerAction)},getAvailableValuesFromColumnData(e,t){const i=new Set,a=YR(this.hot);qR(this.hot);const n=this.hot.getDataAtCol(e);
1return KR(this.hot,a),n.forEach((e=>{const a=zu(e,t);a!==$u&&(Array.isArray(a)?a.forEach((e=>i.add(e))):i.add(a))})),Array.from(i)},resetTargetAndAvailableValues(){this.tableHeaderContextMenuTarget=null,this.tableHeaderContextMenuAvailableValues=null},allValuesSelected(e,t){const i=this.hot.propToCol(e),a=this.hot.toPhysicalColumn(i),n=this.columns[a],r=this.getAvailableValuesFromColumnData(i,n);return!!t.selectedValues&&t.selectedValues.length===r.length},addFilteredIcon(e){const t=this.getMenuIcon(this.tableRef.$el,e);t.forEach((e=>e.classList.add("table-header-context-menu__icon--filtered")))},removeFilteredIcon(e){const t=this.getMenuIcon(this.tableRef.$el,e);t.forEach((e=>e.classList.remove("table-header-context-menu__icon--filtered")))},getMenuIcon(e,t){if(t){const i=this.getDataAttributeSafeColumnKey(t),a=e.querySelectorAll(`[data-column-key=${i}]`);return a}const i=e.querySelectorAll(".table-header-context-menu__icon");return i},getDataAttributeSafeColumnKey(e){return e.replaceAll(".","-")},getEnabledSortPlugin(){if(!this.hot)return null;const e=this.hot.getPlugin("columnSorting");if(e?.isEnabled())return e;const t=this.hot.getPlugin("multiColumnSorting");return t?.isEnabled()?t:null}}}),tN=eN,iN=(0,ew.Z)(tN,LR,VR,!1,null,null,null),aN=iN.exports,nN=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"table-base"},[t("div",{staticClass:"table-base__table-container"},[e._t("default"),e._t("settings")],2),e._t("footer")],2)},rN=[],sN=(0,b.defineComponent)({name:"TableWrapper"}),oN=sN,lN=(0,ew.Z)(oN,nN,rN,!1,null,"25300718",null),dN=lN.exports;function cN(e){function t(t){if(e&&"Enter"===t.key){const t=e.getSelected();if(!t)return;const i=t[0][0],a=t[0][1];if(HB(i,a))return;const n=e.getCellMeta(i,a);if("farmdok.checkbox.optional"===n.type&&"function"===typeof n.renderEmpty&&!n.renderEmpty(i,e)){const t=e.getDataAtCell(i,a);e.setDataAtRowProp(i,"select",!t)}}}return t}const uN={beforeKeyDown:{handleKeyClickFactory:cN}};var pN=uN;function hN(e){function t(t){if(!e)return;const i=e.getSelected();if(!i)return;const a=i[0][0],n=i[0][1];if("Enter"===t.key){if(HB(a,n))return;const i=e.getCellMeta(a,n),r=e.getDataAtRowProp(a,"expand");"farmdok.subtablePrimaryColumn"===i.type&&!1===r&&(t.stopImmediatePropagation(),i.collapsedSubtable.onClick({event:t,visualRow:a,instance:e}))}}return t}function mN(e){return function(t,i,a){if(!e)return;if(HB(i.row,i.col))return;const n=e.getCellMeta(i.row,i.col);if("farmdok.subtablePrimaryColumn"===n.type){const a=n,r=e.getDataAtRowProp(i.row,"expand");!1===r&&a.collapsedSubtable.onClick({event:t,visualRow:i.row,instance:e})}}}const fN={beforeKeyDown:{handleKeyClickFactory:hN},afterOnCellMouseDown:{triggerOnClickFactory:mN}};var gN=fN;function yN(e){function t(t){if(e&&"Enter"===t.key){const t=e.getSelected();if(!t)return;const i=t[0][0],a=t[0][1];if(HB(i,a))return;const n=e.getCellMeta(i,a);if("farmdok.optional"===n.renderer){const t=n;if(t.renderNone?.(i,e))return;if(t.renderEmpty?.(i,e))return;const r=e.getDataAtCell(i,a);if(t.renderLoading?.(i,r,e))return;t.onClick?.(i,e)}}}return t}function vN(e){return function(t,i,a){if(!e)return;const n=i.row,r=i.col;if(HB(n,r))return;const s=e.getCellMeta(n,r);if("farmdok.optional"===s.renderer){const t=s;if(t.renderNone?.(n,e))return;if(t.renderEmpty?.(n,e))return;const i=e.getDataAtCell(n,r);if(t.renderLoading?.(n,i,e))return;t.onClick?.(n,e)}}}const bN={beforeKeyDown:{handleKeyClickFactory:yN},afterOnCellMouseDown:{triggerOnClickFactory:vN}};var wN=bN;function CN(e){return function(t){let i;return e.some((e=>(i=e(t),void 0!==i))),i??""}}var FN={colHeaders:{colHeadersHooksFactory:CN}};function AN(e,t){return function(i){const a=e[i];if(null==a||void 0===a.type||!["checkbox","farmdok.checkbox.optional"].includes(a.type))return;const n=t(),r=kN(n);return r.outerHTML}}function kN(e){const t=document.createElement("div");let[i]=(0,ow.qv)({prefix:"far",iconName:"square"}).node;return e?([i]=(0,ow.qv)({prefix:"far",iconName:"check-square"}).node,t.classList.add("text-black")):t.classList.add("text-medium"),i.classList.add("checkbox-icon"),t.classList.add("header-checkbox--select-rows"),t.appendChild(i),t}function SN(e){function t(t,i){const a=e.toPhysicalColumn(t),{columns:n}=e.getSettings();if(!Array.isArray(n))throw new Error("columns must be an array");const r=n[a];null!=r&&void 0!==r.type&&["checkbox","farmdok.checkbox.optional"].includes(r.type)&&i.classList.add("checkbox")}
1return t}function EN(e){return function(t,{row:i,col:a}){if(!e)return;if(!t.shiftKey)return;const n=XO.data;if(e.colToProp(a)!==n)return;const r=e.getSelectedLast(),s=r?.[1]===a?r[0]:0,o=Math.min(s,i),l=Math.max(s,i),d=[];for(let e=o;e<=l;e+=1)d.push([e,n,!0]);e.setDataAtRowProp(d,"shift.select")}}function IN(e){return function(t,i,a){if(!a.classList.contains("checkbox"))return;const n=a.querySelector(".checkbox-icon");if(!n)return;const r="square-check"===n.dataset.icon;e(!r)}}ow.vI.add(lw.pL1,lw.a3n);var _N={afterGetColHeader:{addCheckboxClassToColumnHeadersFactory:SN},afterOnCellMouseDown:{selectClickHandlerFactory:IN},beforeOnCellMouseDown:{multiSelectClickHandlerFactory:EN}};function DN(e){return function(t){return e[t].header&&e[t].header?.title?.()}}function MN(e){function t(t,i,a,n,r,s){if(e)if("function"===typeof s.colspan){const n=s.colspan(i,a,r,e);t.colSpan=n}else t.removeAttribute("colspan")}return t}var PN={afterRenderer:{applyColspanFactory:MN}};function TN(e,t){const i=e.findIndex((e=>e.initialSortOrder));if(-1===i)return;const a=e[i];if("function"===typeof a.data||void 0===a.data)throw new Error("columnWithInitialSortOrder.data must be a string or number to enable initialSortOrder");const n=t.propToCol(a.data);return{column:n,sortOrder:a.initialSortOrder}}const xN="decimalPlaces";function BN(e){const t=localStorage.getItem(`${e}_${xN}`);if(!t)return{};try{const e=JSON.parse(t);if(null==e||"object"!==typeof e)return{};const i={};return Object.keys(e).forEach((t=>{"number"===typeof e[t]&&(i[t]=e[t])})),i}catch{return{}}}function ON(e,t){return 0===Object.keys(t).length?e:e.map((e=>"string"===typeof e.data&&"number"===typeof t[e.data]?{...e,decimalPlaces:t[e.data]}:e))}function $N(e,t,i){const a={};return i.forEach((i=>{const n=RN(e,t,i);"IS_EQUAL"!==n&&(a[i]=n)})),a}function RN(e,t,i){const a=cB()(e,i),n=cB()(t,i);return a===n||Ha()(a,n)?"IS_EQUAL":n}function NN(e,t,i){const a=[];if(e.length!==t.length)throw new Error("Cannot detect changes between two arrays of different length");return e.forEach(((e,n)=>{const r=t[n];if(e===r)return;const s=$N(e,r,i);Object.entries(s).forEach((([e,t])=>{a.push([n,e,t])}))})),a}function zN(e,t,i,a){const n=i.map((e=>e.data)).filter((e=>"string"===typeof e));return NN(e,t,n).map(LN(a)).filter(VN(a))}function LN(e){return t=>{const[i,a,n]=t,r=e.toVisualRow(i);return[r,a,n]}}function VN(e){return t=>{const[i,a,n]=t,r=e.getDataAtRowProp(i,a);return!Ha()(r,n)}}var UN=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div")},jN=[],HN=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"filter-table__filter-bar bg-secondary text-white",style:e.cssProps},[t("span",[e._v(" "+e._s(e.$t("Filter aktiviert - "))+" "),t("a",{staticClass:"filter-table__filter-bar-link text-white",attrs:{href:"#"},on:{click:e.onReset}},[e._v(e._s(e.$t("Filter deaktivieren")))]),e._v(" "+e._s(e.$t(" um alle Einträge anzuzeigen"))+" ")])])},GN=[],WN=(0,b.defineComponent)({name:"FilterInfoBar",props:{zindex:{type:Number,default:9999},top:{type:Number,default:0}},computed:{cssProps(){return{"--z-index":`${this.zindex}`,"--top":`${this.top}px`}}},methods:{onReset(){this.$emit("resetFilter")}}}),ZN=WN,KN=(0,ew.Z)(ZN,HN,GN,!1,null,"636dfa4a",null),qN=KN.exports,YN=(0,b.defineComponent)({name:"FilterInfoBarInjector",props:{filterActive:{type:Boolean,default:!1},tableRef:{type:Object,required:!0}},watch:{filterActive:{handler(){this.filterActive?this.mountFilterInfoBar():this.unmountFilterInfoBar()},immediate:!0}},methods:{mountFilterInfoBar(){const e=this.tableRef.$el;let t=0;const i=e.querySelector(".ht_master .htCore thead");null!=i&&(t=i.getBoundingClientRect().height);const a=e.querySelector(".ht_master .wtHolder");if(null==a)return;const n=b["default"].extend(qN),r=document.createElement("div");a.prepend(r),new n({propsData:{zIndex:999,top:t},methods:{onReset:this.onReset}}).$mount(r);const s=e.querySelector(".ht_clone_left .wtHolder");if(null==s)return;const o=document.createElement("div");s.prepend(o),new n({propsData:{zIndex:99,top:t},methods:{onReset:this.onReset}}).$mount(o)},unmountFilterInfoBar(){const e=this.tableRef.$el,t=e.querySelectorAll(".filter-table__filter-bar");t.forEach((e=>{e.remove()}))},onReset(e){e.preventDefault(),this.$emit("onReset")}}}),JN=YN,XN=(0,ew.Z)(JN,UN,jN,!1,null,null,null),QN=XN.exports;function ez(e){const t=e.map(((e,t)=>!0===e.hidden?t:null)).filter((e=>null!==e));return 0!==t.length&&{columns:t,indicators:!1}}var tz={hiddenColumns:ez};function iz(e,t){e.forEach(((t,i)=>{if(!t)return;const[,,a,n]=t;(a===n||"object"===typeof n&&Ha()(a,n))&&(e[i]=null)}))}var az={beforeChange:iz};function nz(e){function t(t){if(e){if("ArrowRight"===t.key||"Tab"===t.key){const i=e.getSelected();if(!i)return;const a=i[0][0],n=i[0][1],r=e.getCellMeta(a,n+1);if("function"===typeof r.renderNone&&r.renderNone(a,e)||r.hidden){t.stopImmediatePropagation();for(let t=n+1;t<e.countCols();t+=1){const i=e.getCellMeta(a,t),n="function"===typeof i.renderNone?i.renderNone(a,e):null;if(!n&&!i.hidden){e.selectCell(a,t);break}}}}if("ArrowLeft"===t.key){const i=e.getSelected();if(!i)return;const a=i[0][0],n=i[0][1],r=e.getCellMeta(a,n-1);if("function"===typeof r.renderNone&&r.renderNone(a,e)||r.hidden){t.stopImmediatePropagation();for(let t=n-1;t>1;t-=1){const i=e.getCellMeta(a,t),n="function"===typeof i.renderNone?i.renderNone(a,e):null;if(!n&&!i.hidden){e.selectCell(a,t);break}}}}if("ArrowDown"===t.key){const i=e.getSelected();if(!i)return;const a=i[0][0],n=i[0][1],r=a+1,s=e.getCellMeta(r,n);if("function"===typeof s.renderNone&&s.renderNone(r,e)||s.hidden){t.stopImmediatePropagation();for(let t=r;t<e.countRows();t+=1){const i=e.getCellMeta(t,n),a="function"===typeof i.renderNone?i.renderNone(t,e):null;if(!a&&!i.hidden){e.selectCell(t,n);break}}}}if("ArrowUp"===t.key){const i=e.getSelected();if(!i)return;const a=i[0][0],n=i[0][1],r=a-1,s=e.getCellMeta(r,n);if("function"===typeof s.renderNone&&s.renderNone(r,e)||s.hidden){t.stopImmediatePropagation();for(let t=r;t>1;t-=1){const i=e.getCellMeta(t,n),a="function"===typeof i.renderNone?i.renderNone(t,e):null;if(!a&&!i.hidden){e.selectCell(t,n);break}}}}}}return t}const rz={beforeKeyDown:{handleKeyClickFactory:nz}};var sz=rz;function oz(e,t){function i(i,a,n,r){const{columns:s}=e.getSettings();if(!Array.isArray(s))throw new Error("columns must be of type ColumnSettings[]");const o=i.some((i=>{const a=e.toPhysicalColumn(i);return a<t}));return!o||(!1,!1)}return i}function lz(e){function t(t,i,a,n){return!(i<e)||(!1,!1)}return t}function dz(e,t,i,a){return 1!==e.length||e[0]!==t||e[0]!==i||(!1,!1)}var cz={beforeColumnMove:{preventMoveToSamePosition:dz,preventMoveOfFixedColumnsFactory:oz,preventMoveIntoFixedColumnsFactory:lz}};function uz(e){return function(t,i,a){const n=e.toPhysicalColumn(i),{columns:r}=e.getSettings();if(!Array.isArray(r))throw new Error("columns must be an array");if(!0===r[n].disableColumnResize){const t=e.getPlugin("manualColumnResize");t.clearManualSize(i)}}}var pz={afterColumnResize:{disableColumnResizeFactory:uz}};function hz(e){let t=[];return e.forEach((e=>{if("subtable"===e.type&&e.subtableColumns){const i=new hR(e.subtableColumns),a=i.getAvailableColumns();let n=!1;const r=a.map(((t,i)=>{const r=0===i,s=i===a.length-1;let{header:o}=t;if(n||t.hidden||(o={...e.header,...t.header},n=!0),"string"!==typeof e.data)throw new Error("Column data not of type string");const l={...t,header:o,isFirstSubtableColumn:r,isLastSubtableColumn:s,isSubtableColumn:!0,isPartOfSubtable:e.data,hidden:void 0!==t.hidden?t.hidden:e.hidden,visualColumn:e.visualColumn+.1*i,physicalColumn:-1};return l}));t.push(...r)}else t.push(e)})),t=mz(t),t=fz(t),t}function mz(e){return e.map(((e,t)=>({...e,physicalColumn:t})))}function fz(e){const t=[...e].sort(((e,t)=>e.visualColumn-t.visualColumn)),i=t.map(((e,t)=>({...e,visualColumn:t})));return i.sort(((e,t)=>e.physicalColumn-t.physicalColumn)),i}function gz(e){const t=[];let i=null;return e.forEach(((e,a)=>{if(e.id!==i?.id)i=e;
1else if(null!==i){if("expand"in i&&!0===i.expand)return;t.push(a)}})),{indicators:!0,rows:t}}function yz(e,t,i){const a=[];return a.push(...vz(e,t,i)),a.push(...wz(e,t,i)),a}function vz(e,t,i){if(0===e.length)return[];const a=[];let n=0;while(n<e.length){const r=DB(n,e);a.push(...bz(n,r,t,i)),n=r+1}return a}function bz(e,t,i,a){if(e===t)return[];const n=[];return i.forEach(((i,r)=>{if("subtable"===i.type||i.isSubtableColumn)return;if("string"!==typeof i.data)throw new Error("data property of column must be a string");const s=a?.propToCol(i.data)??r;n.push({row:e,col:s,rowspan:t-e+1,colspan:1})})),n}function wz(e,t,i){const a=[];return t.forEach(((t,n)=>{if(!t.colspan||"function"!==typeof t.colspan)return;if("string"!==typeof t.data)throw new Error("data property of column must be a string");const r=i?.propToCol(t.data)??n,s=e.length;for(let o=0;o<s;o+=1){const n=i?.getDataAtCell(o,r)??void 0,s=i?.getDataAtRowProp(o,"expand")??e[o].expand,l=t.colspan(o,r,n,s,i);l>1&&a.push({row:o,col:r,rowspan:1,colspan:l})}})),a}const Cz={mergeCells:yz,columns:hz,hiddenRows:gz};var Fz=Cz;function Az(e,t){return Array(t-e+1).fill(0).map(((t,i)=>e+i))}function kz(e,t){return e[t].isFirstSubtableColumn?t:kz(e,t-1)}function Sz(e,t){return e[t].isLastSubtableColumn?t:Sz(e,t+1)}function Ez(e){function t(t,i,a,n){return Iz(t,e),_z(t),Dz(t,e),!0}return t}function Iz(e,t){const i=Tz(t),a=[...e];a.forEach((a=>{const n=t.toPhysicalColumn(a),r=i[n];if(r.isSubtableColumn&&!r.isFirstSubtableColumn){const r=kz(i,n),s=t.toVisualColumn(r),o=e.indexOf(a);Mz(e,o,s)}}))}function _z(e){for(let t=e.length;t>=0;t-=1){const i=e.slice(0,t);i.includes(e[t])&&e.splice(t,1)}}function Dz(e,t){const i=Tz(t),a=[...e];a.forEach((a=>{const n=t.toPhysicalColumn(a),r=i[n];if(r.isFirstSubtableColumn){const r=Sz(i,n),s=Az(n,r),o=xz(t,s),l=e.indexOf(a);Pz(e,l,o)}}))}function Mz(e,t,i){e.splice(t,1,i)}function Pz(e,t,i){e.splice(t,1,...i)}function Tz(e){const{columns:t}=e.getSettings();if(!Array.isArray(t))throw new Error("columns must be of type ColumnSettings[]");return t}function xz(e,t){return t.map((t=>e.toVisualColumn(t)))}function Bz(e){function t(t,i,a,n){const{columns:r}=e.getSettings();if(!Array.isArray(r))throw new Error("columns must be of type ColumnSettings[]");const s=t.every((e=>e<i)),o=t.every((e=>e>i)),l=s&&o;if(l)return console.warn("mixed move not supported"),!1,!1;let d,c;return s&&(d=r[e.toPhysicalColumn(i)],c=r[e.toPhysicalColumn(i+1)]),o&&(d=r[e.toPhysicalColumn(i-1)],c=r[e.toPhysicalColumn(i)]),!d?.isSubtableColumn||!c?.isSubtableColumn||(!(!d?.isLastSubtableColumn||!c?.isFirstSubtableColumn)||(!1,!1))}return t}function Oz(e){function t(t,i){return e&&t?($z(t,e),t):null}return t}function $z(e,t){const i=e.reduce(((e,i,a)=>{const[n,r]=i;if(SB(n,t))return e;const s=t.propToCol(r),o=t.getCellMeta(n,s);return o.isSubtableColumn||e.push(a),e}),[]);for(let a=e.length-1;a>=0;a-=1)i.includes(a)&&e.pop()}class Rz{constructor(e){(0,tt.Z)(this,"hot",void 0),this.hot=e}getMergePlugin(){const e=this.hot.getPlugin("mergeCells");if(!e||!e.isEnabled())throw new Error(Rz.errorMessage("mergeCells"));return e}static errorMessage(e){return`${e} plugin must be activated.`}}function Nz(e){function t(t,i){e&&"edit"===i&&t?.forEach((t=>{if(!t)return;const[i,a,n,r]=t;"expand"===a&&n!==r?zz(i,n,r,e):Lz(i,a,n,r,e)}))}return t}function zz(e,t,i,a){const{columns:n}=a.getSettings();if(!Array.isArray(n))throw new Error("columns must be an array");n.forEach(((n,r)=>{if("function"===typeof n.colspan){const s=a.toVisualColumn(r),o=a.getDataAtCell(e,s),l=n.colspan(e,s,o,t,a),d=n.colspan(e,s,o,i,a);Vz(e,s,l,d,a)}}))}function Lz(e,t,i,a,n){const r=n.propToCol(t),{columns:s}=n.getSettings();if(!Array.isArray(s))throw new Error("columns must be an array");const o=n.toPhysicalColumn(r),l=s[o];if(!l||"function"!==typeof l.colspan)return;const d=n.getDataAtRowProp(e,"expand"),c=l.colspan(e,r,i,d,n),u=l.colspan(e,r,a,d,n);Vz(e,r,c,u,n)}function Vz(e,t,i,a,n){const r=new Rz(n).getMergePlugin();i!==a&&(i>1&&(r.unmerge(e,t,e,t+i-1),n.setCellMeta(e,t,"colspan",1)),a>1&&r.merge(e,t,e,t+a-1))}function Uz(e){function t(t,i){e&&t.forEach((i=>
1{i&&t.push(...jz(i,e))}))}return t}function jz(e,t){const[i,a,n,r]=e,s=t.propToCol(a),o=t.getCellMeta(i,s),l=[];if(o.isSubtableColumn)return[];const d=IO(o.visualRow,t),c=DB(o.visualRow,t);for(let u=d;u<=c;u+=1)i!==u&&l.push([u,a,n,r]);return l}function Hz(e,t,i){const a=[];return e.forEach((e=>{const n={};t.forEach((t=>{if("string"!==typeof t.data)throw new Error(`Cannot convert to tableData because col.data is not a string ${t.data}}`);const a=t.data,r=i.propToCol(a),s=e[r];n[a]=s})),a.push(n)})),a}function Gz(e){function t(t){if(!e)return;const{columns:i}=e.getSettings();if(!Array.isArray(i))throw new Error("columns must be of type ColumnSettings[]");Kz(i,e)}return t}function Wz(e){function t(t,i){if(!e)return;const{columns:a}=e.getSettings();if(!Array.isArray(a))throw new Error("columns must be of type ColumnSettings[]");Kz(a,e)}return t}function Zz(e){function t(t,i,a,n,r){if(!e)return;const{columns:s}=e.getSettings();if(!Array.isArray(s))throw new Error("columns must be of type ColumnSettings[]");Kz(s,e)}return t}function Kz(e,t){const i=new Rz(t).getMergePlugin();i.clearCollections();const a=t.getData(),n=Hz(a,e,t),r=Fz.mergeCells(n,e,t);r.forEach((e=>{const{startRow:t,startColumn:a,endRow:n,endColumn:r}=qz(e);i.merge(t,a,n,r)}))}function qz(e){return{startRow:e.row,startColumn:e.col,endRow:e.row+e.rowspan-1,endColumn:e.col+e.colspan-1}}function Yz(e,t){e.forEach(((t,i)=>{if(!t)return;const[,,,a]=t;null===a&&(e[i]=null)}))}const Jz={beforeChange:{removeChangesToNulls:Yz,propagateChangesToMergedCellsFactory:Uz,mergeByColspanSettingFactory:Nz},beforeColumnMove:{moveAllColumnsOfSubtableFactory:Ez,preventMoveBetweenSubtableColumnsFactory:Bz},afterChange:{filterChangesToMergedCellsFactory:Oz},afterFilter:Gz,afterColumnSort:Wz,afterColumnMove:{reinitializeMergedCellsAfterColumnMoveFactory:Zz}};var Xz=Jz;function Qz(e){function t(t,a,n){const r=i(a);"farmdok.placeholder"===r.type&&"number"===typeof r.width&&t<r.width&&e.getPlugin("manualColumnResize").setManualSize(a,r.width)}function i(t){const i=e.getSettings();if(!Array.isArray(i.columns))throw new Error("columns must be of type ColumnSettings[]");const a=e.toPhysicalColumn(t);return i.columns[a]}return t}function eL(e){function t(t,i,a,n){const{columns:r}=e.getSettings();if(!Array.isArray(r))throw new Error("columns must be of type ColumnSettings[]");const s=t.some(((i,a)=>{const n=e.toPhysicalColumn(i);return!(!tL(r[n])||iL(t,a))}));return!s||(!1,!1)}return t}function tL(e){return"farmdok.placeholder"===e.type}function iL(e,t){return e.length-1===t}var aL={afterColumnResize:{setMinPlaceholderColumnWidthFactory:Qz},beforeColumnMove:{preventMoveOfPlaceholderColumnFactory:eL}};function nL(e){return function(t,i,a){if(!e)return;const n=e.getDataAtRowProp(i,"storeStatus");switch(n){case j:return void t.classList.add("updating");case U:return void t.classList.add("dirty");case H:return void t.classList.add("error");default:}}}const rL={afterRenderer:{addSyncStatusBackgroundFactory:nL}};var sL,oL=rL;function lL(e,t){return e.map((e=>{const[i,a,n,r]=e,s=t.getDataAtRowProp(i,"id"),o=t.getDataAtRowProp(i,"product.id"),l=t.getDataAtRowProp(i,"equipment.id");return[i,`${a}`,n,r,{id:s,activityProductId:o,activityEquipmentId:l}]}))}(function(e){e["populateFromTableDataChange"]="populateFromTableDataChange"})(sL||(sL={}));var dL=(0,b.defineComponent)({name:"TableActivities",components:{HotTable:HI.sZ,TableWrapper:dN,TableHeaderContextMenuInjector:aN,FilterInfoBarInjector:QN},props:{tableData:{type:Array,required:!0},columns:{type:Array,required:!0},fixedColumnsLeft:{type:Number,default:0},filterString:{type:String,default:""},tableId:{type:String,required:!0}},data(){return{initialTableData:[],initialTableSettings:{},hot:null,filtersByColumnKey:{},filtersByDate:null,debouncedFilterActive:!1,visibleRowsIdsSet:new Set}},created(){this.initialTableData=Xe()(this.tableData);const e=ON(this.columns,BN(this.tableId));this.initialTableSettings=Xe()(this.createTableSettings(this.initialTableData,e)),this.unwatchFilterString=this.$watch("filterWatchTrigger",Xl()(this.filterWatchHandler,200)),this.unwatchFilterActive=this.$watch("filterActive",Xl()((e=>{this.debouncedFilterActive=e}),200))},mounted(){this.hot=this.$refs.table.hotInstance,this.hasPersistentStateColumnSorting()||this.applyInitialSortConfig(),this.validatePersistentState(this.tableColumns),this.restorePersistentState(),this.$nextTick((()=>{this.updateVisibleRowsIds()}))},beforeDestroy(){this.hot=null,this.unwatchFilterString(),this.unwatchFilterActive()},computed:{tableColumns(){if(!this.hot)return[];const{columns:e}=this.hot.getSettings();if(!e)return[];if(!Array.isArray(e))throw new Error("columns must be of type Array");return e},filterActive(){const e=Object.keys(this.filtersByColumnKey).length>0;return""!==this.filterString||e||null!==this.filtersByDate},filterWatchTrigger(){return`${this.filterString}${JSON.stringify(this.filtersByColumnKey)}${this.filterActive}${this.tableData}${JSON.stringify(this.filtersByDate)}`},visibleRowsIds(){return this.visibleRowsIdsSet},visibleRows(){return this.visibleRowsIds.size},totalRows(){return new Set(this.tableData.map((e=>e.id))).size},allRowsVisible(){return this.visibleRowsIds.size===this.totalRows},groupedTableDataIds(){const e=new Set;return this.tableData.forEach((t=>{e.add(t.id)})),e},expandedTableData(){return this.tableData.filter((e=>e.expand))}},watch:{columns:{handler(e){if(!this.hot)return;const{colHeaders:t,columns:i,hiddenColumns:a}=this.tableSettingsThatDependOnColumns(e);this.updateSettings({colHeaders:t,columns:i,hiddenColumns:a}),this.moveColumnsByVisualColumn(i),this.hot.render(),this.validatePersistentState(i),this.updatePersistentState(i)}}
1,tableData:{handler(e,t){this.$emit("update:expandedTableData",this.expandedTableData),this.haveToLoadCompleteTableData(e,t)?this.loadTableData(e):this.detectCellChangesAndUpdateCells(e,t),this.$nextTick((()=>{this.updateVisibleRowsIds()}))}},hot:{handler(e){this.$emit("update:hot",e)}}},methods:{updateVisibleRowsIds(){if(!this.hot)return void(this.visibleRowsIdsSet=new Set);const e=this.hot.getPlugin("trimRows"),t=new Set(e.getTrimmedRows()),i=new Set;this.tableData.forEach(((e,a)=>{t.has(a)||i.add(e.id)})),this.visibleRowsIdsSet=i},haveToLoadCompleteTableData(e,t){return e.length!==t.length},loadTableData(e){if(!this.hot||!this.tableColumns.length)return;const t={...this.tableSettingsThatDependOnTableData(e),data:e};this.updateSettings(t)},detectCellChangesAndUpdateCells(e,t){if(!this.hot||!this.tableColumns.length)return;this.filterActive&&qR(this.hot);const i=zN(t,e,this.tableColumns,this.hot);this.updateCells(i),this.filterActive&&(ZR(this.hot,this.filterString,this.filtersByColumnKey,this.filtersByDate,this.tableData,this.tableColumns),this.hot.render())},updateSettings(e){if(!this.hot)return;const t=this.getCurrentSortConfig();this.hot.updateSettings(e),this.applySortConfig(t?.[0])},updateCells(e){0!==e.length&&this.hot?.setDataAtRowProp(e,sL.populateFromTableDataChange)},moveColumnsByVisualColumn(e){if(!this.hot)return;const t=this.getMoveColumns(e);this.hot.getPlugin("manualColumnMove").moveColumns(t,this.fixedColumnsLeft)},getMoveColumns(e){const t=[...e];t.sort(((e,t)=>e.visualColumn-t.visualColumn));const i=t.map((e=>e.physicalColumn)),a=i.slice(this.fixedColumnsLeft);return a},updatePersistentState(e){if(!this.hot)return;const t=this.hot.getPlugin("persistentState");t.isEnabled()&&(this.updatePersistentStateManualColumnMove(e,t),this.updatePersistentStateHiddenColumns(t),this.updatePersistentStateDecimalPlaces(e,t))},updatePersistentStateManualColumnMove(e,t){const i=e.map(((e,t)=>this.hot?.toPhysicalColumn(t))),a=Array.from(Array(i.length).keys());Ha()(i,a)?t.resetValue("manualColumnMove"):t.saveValue("manualColumnMove",i)},updatePersistentStateHiddenColumns(e){e.saveValue("hiddenColumns",this.hot?.getPlugin("hiddenColumns").getHiddenColumns())},updatePersistentStateDecimalPlaces(e,t){const i={};e.forEach((e=>{e.configurableDecimalPlaces&&"string"===typeof e.data&&"number"===typeof e.decimalPlaces&&(i[e.data]=e.decimalPlaces)})),0===Object.keys(i).length?t.resetValue(xN):t.saveValue(xN,i)},restorePersistentState(){if(!this.hot)return;const e=this.hot?.getPlugin("persistentState");e?.isEnabled()&&(this.restorePersistentStateManualColumnMove(e),this.restorePersistentStateHiddenColumns(e),this.restorePersistentStateColumnSorting(e))},restorePersistentStateManualColumnMove(e){if(!this.hot)return;const t={};e.loadValue("manualColumnMove",t),Array.isArray(t.value)&&Bu.Z.hooks.run(this.hot,"afterColumnMove")},restorePersistentStateHiddenColumns(e){if(!this.hot)return;const t={};if(e.loadValue("hiddenColumns",t),Array.isArray(t.value)){const e=this.hot.getPlugin("hiddenColumns"),i=this.tableColumns;e.showColumns(i.map((e=>e.visualColumn))),e.hideColumns(t.value)}},restorePersistentStateColumnSorting(e){if(!this.hot)return;const t={};e.loadValue("columnSorting",t),t.value&&t.value.initialConfig.length>0&&Bu.Z.hooks.run(this.hot,"afterColumnSort")},hasPersistentStateColumnSorting(){if(!this.hot)return!1;const e=this.hot?.getPlugin("persistentState");if(!e?.isEnabled())return!1;const t={};return e.loadValue("columnSorting",t),(t.value&&t.value.initialConfig.length>0)??!1},validatePersistentState(e){if(0===e.length)return;const t=e.reduce(((e,t)=>`${e}${t.data}`),""),i=localStorage.getItem(`${this.tableId}_checkSum`);if(t===i)return;const a=this.hot?.getPlugin("persistentState");a?.isEnabled()&&(a.resetValue("manualColumnMove"),a.resetValue("hiddenColumns"),a.resetValue("columnSorting"),a.resetValue(xN),localStorage.removeItem(`${this.tableId}__persistentStateKeys`),localStorage.setItem(`${this.tableId}_checkSum`,t))},afterChangeHookEmitOnChangeEvent(e,t){if(null===e||0===e.length)return;if(t===sL.populateFromTableDataChange)return;if(null===this.hot)return;const i=lL(e,this.hot);this.$emit("onChange",i,t)},createTableSettings(e,t){const{hiddenRows:i}=this.tableSettingsThatDependOnTableData(e),{colHeaders:a,columns:n,hiddenColumns:r}=this.tableSettingsThatDependOnColumns(t);return{colHeaders:a,licenseKey:B,columns:n,autoColumnSize:!1,hiddenRows:i,hiddenColumns:r,columnSorting:!0,fixedColumnsLeft:this.fixedColumnsLeft,manualColumnMove:!0,manualColumnResize:!0,trimRows:!0,stretchH:"last",persistentState:!0,selectionMode:"single",viewportRowRenderingOffset:50,beforeChange:(e,t)=>
1{const i=[az.beforeChange,Xz.beforeChange.propagateChangesToMergedCellsFactory(this.hot),qB.beforeChange.showHideRowsFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterChange:(e,t)=>{const i=[Xz.afterChange.filterChangesToMergedCellsFactory(this.hot),this.afterChangeHookEmitOnChangeEvent];i.forEach((i=>{i(e,t)}))},afterColumnResize:(e,t,i)=>{if(!this.hot)return;const a=[aL.afterColumnResize.setMinPlaceholderColumnWidthFactory(this.hot),pz.afterColumnResize.disableColumnResizeFactory(this.hot)];a.forEach((a=>{a(e,t,i)})),this.hot.render()},beforeColumnMove:(e,t,i,a)=>{if(!this.hot)return!0;const n=[cz.beforeColumnMove.preventMoveToSamePosition,cz.beforeColumnMove.preventMoveOfFixedColumnsFactory(this.hot,this.fixedColumnsLeft),cz.beforeColumnMove.preventMoveIntoFixedColumnsFactory(this.fixedColumnsLeft),Xz.beforeColumnMove.moveAllColumnsOfSubtableFactory(this.hot),Xz.beforeColumnMove.preventMoveBetweenSubtableColumnsFactory(this.hot),aL.beforeColumnMove.preventMoveOfPlaceholderColumnFactory(this.hot)],r=n.every((n=>n(e,t,i,a)));return r},afterGetColHeader:(e,t)=>{if(!this.hot)return;const i=[_N.afterGetColHeader.addCheckboxClassToColumnHeadersFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterOnCellMouseDown:(e,t,i)=>{const a=[_N.afterOnCellMouseDown.selectClickHandlerFactory(this.selectAllVisible),wN.afterOnCellMouseDown.triggerOnClickFactory(this.hot),gN.afterOnCellMouseDown.triggerOnClickFactory(this.hot)];a.forEach((a=>{a(e,t,i)}))},beforeOnCellMouseDown:(e,t)=>{const i=[_N.beforeOnCellMouseDown.multiSelectClickHandlerFactory(this.hot)];i.forEach((i=>{i(e,t)}))},beforeKeyDown:e=>{const t=[qB.beforeKeyDown.handleKeyClickFactory(this.hot),pN.beforeKeyDown.handleKeyClickFactory(this.hot),wN.beforeKeyDown.handleKeyClickFactory(this.hot),gN.beforeKeyDown.handleKeyClickFactory(this.hot),sz.beforeKeyDown.handleKeyClickFactory(this.hot)];t.forEach((t=>{t(e)}))},afterRenderer:(e,t,i,a,n,r)=>{if(!this.hot)return;const s=[PN.afterRenderer.applyColspanFactory(this.hot),oL.afterRenderer.addSyncStatusBackgroundFactory(this.hot)];s.forEach((s=>{s(e,t,i,a,n,r)}))}}},tableSettingsThatDependOnTableData(e){return{hiddenRows:Fz.hiddenRows(e)}},tableSettingsThatDependOnColumns(e){const t=Fz.columns(e),i=[DN(t),AN(t,this.allRowsSelected)];return{colHeaders:FN.colHeaders.colHeadersHooksFactory(i),columns:t,hiddenColumns:tz.hiddenColumns(t)}},filterWatchHandler(){this.hot&&this.tableColumns.length&&(this.filterActive?ZR(this.hot,this.filterString,this.filtersByColumnKey,this.filtersByDate,this.tableData,this.tableColumns):this.filtersByDate||qR(this.hot),Bu.Z.hooks.run(this.hot,"afterFilter",[]),this.hot.render(),this.$nextTick((()=>{this.updateVisibleRowsIds()})))},onFiltersByColumnKey(e,t){this.setFilterByColumnKey(e,t)},onFiltersByDate(e){this.filtersByDate=e||null},setFilterByColumnKey(e,t){t?b["default"].set(this.filtersByColumnKey,e,t):b["default"]["delete"](this.filtersByColumnKey,e)},clearAllFilters(){this.$emit("update:filterString",""),this.filtersByColumnKey={},this.filtersByDate=null,this.$refs.contextMenuInjector.$refs.contextMenu.resetFilterDates()},applyInitialSortConfig(){if(!this.hot)throw new Error("Can't apply initial sort config, hot is not initialized");const e=TN(this.columns,this.hot);this.applySortConfig(e)},getCurrentSortConfig(){if(!this.hot)throw new Error("Can't get current sort config, hot is not initialized");return this.getEnabledSortPlugin()?.getSortConfig()},applySortConfig(e){if(e){if(!this.hot)throw new Error("Can't apply sort config, hot is not initialized");this.getEnabledSortPlugin()?.sort(e)}},allRowsSelected(){if(!this.hot)return!1;const e=this.hot.propToCol("select"),t=this.hot.getDataAtCol(e);return t.every((e=>!0===e))},getEnabledSortPlugin(){if(!this.hot)return null;const e=this.hot.getPlugin("columnSorting");if(e?.isEnabled())return e;const t=this.hot.getPlugin("multiColumnSorting");return t?.isEnabled()?t:null},selectAllVisible(e){if(!this.hot)return;const t=this.hot.countRows();this.hot.batch((()=>{for(let i=0;i<t;i+=1)this.hot?.setDataAtRowProp(i,"select",e)}))},invertSelection(){if(!this.hot)return;const e=this.hot.countRows(),t=this.hot.propToCol("select"),i=this.hot.getDataAtCol(t);this.hot.batch((()=>{for(let t=0;t<e;t+=1)this.hot?.setDataAtRowProp(t,"select",!i[t])}))}}}),cL=dL,uL=(0,ew.Z)(cL,NR,zR,!1,null,null,null),pL=uL.exports,hL=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableWrapper",[t("TableLoading",{attrs:{columns:e.tableColumns}})],1)},mL=[],fL=(0,b.defineComponent)({name:"TableActivitiesLoading",components:{TableWrapper:dN,TableLoading:x_},props:{columns:{type:Array,required:!0}},computed:{tableColumns(){const e=Fz.columns(this.columns),t=tz.hiddenColumns(e),i=this.filterHiddenColumns(e,t);return i}},methods:{filterHiddenColumns(e,t){return void 0===t||"boolean"===typeof t?e:e.filter(((e,i)=>!t.columns?.includes(i)))}}}),gL=fL,yL=(0,ew.Z)(gL,hL,mL,!1,null,null,null),vL=yL.exports,bL=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("NoContent",{attrs:{createActivityDisabled:!e.featureCreateActivityEnabled},on:{create:function(t){return e.$emit("createActivity")}}})},wL=[],CL=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MaxWidthContainer",{staticClass:"no-content",attrs:{size:"xl"}},[t("img",{staticClass:"no-content__icon",attrs:{src:e.imageSrc,alt:"no-content"}}),t("h1",{staticClass:"mt-6 mb-4"},[t("span",[e._v(" "+e._s(e.$t("Es wurden noch keine Maßnahmen angelegt. Erstelle neue Maßnahmen!"))+" ")])]),t("div",{staticClass:"mt-4"},[t("Button",{attrs:{"leading-icon":"",icon:"plus-circle",disabled:e.createActivityDisabled},on:{click:function(t){return e.$emit("create")}}},[e._v(" "+e._s(e.$t("Maßnahme hinzufügen"))+" ")])],1)])},FL=[];const AL=i(98969);var kL=(0,b.defineComponent)({name:"NoContent",components:{Button:gw,MaxWidthContainer:Tw},props:{createActivityDisabled:{type:Boolean,default:!1}},data:()=>({imageSrc:AL("./no-content-activities.svg")})}),SL=kL,EL=(0,ew.Z)(SL,CL,FL,!1,null,"3d3e8ab5",null),IL=EL.exports,_L=(0,b.defineComponent)({name:"NoContentContainer",components:{NoContent:IL},computed:{featureActivitiesEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_ACTIVITIES)},featureActivitiesReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_ACTIVITIES)},featureCreateActivityEnabled(){return this.featureActivitiesEnabled&&!this.featureActivitiesReadOnly}}}),DL=_L,ML=(0,ew.Z)(DL,bL,wL,!1,null,"0bc5129c",null),PL=ML.exports,TL=(0,b.defineComponent)({name:"TableActivitiesContainer",props:{filterString:{type:String,default:""},columns:{type:Array,required:!0},tableId:{type:String,default:"table-activities"}},data(){return{debouncedRuleCheck:()=>{},activitiesLoaded:!1}},components:{TableFooterContainer:RR,TableActivities:pL,TableActivitiesLoading:vL,NoContentContainer:PL},created(){this.loadData(),this.debouncedRuleCheck=Xl()(this.triggerRuleCheckRecheck,2e3)},computed:{...(0,C.Se)("auth",["currentProcessOrderIds","currentCompanyIds"]),companyScopedTableId(){return[this.tableId,...[...this.currentCompanyIds].sort()].join("-")},activities(){return Object.values(this.$store.state.activities.data)}
1,pesticideIdsInUse(){return this.$store.getters["activities/pesticideIdsInUse"]},units(){return this.$store.state.units.data},tableData(){return this.$store.getters["activities/tableDataActivities"]},columnsForHandsontable(){const{userColumnSettings:e}=this.$store.state.activities,t=new hR(this.columns),i=t.getColumnsForHandsontable(e);return this.featureActivitiesReadonly?this.withReadOnly(i):i},fixedColumnsLeft(){const e=this.columnsForHandsontable.findIndex((e=>!0===e.fixedColumnsLeftUntilHere));return-1===e?0:e+1},loading(){return this.$store.getters["activities/loading"]||this.$store.getters["activities/ruleCheck/rules/loading"]||this.$store.getters["activities/ruleCheck/activityRulesViolations/loading"]||this.$store.getters["activityTypes/loading"]||this.$store.getters["customers/loading"]||this.$store.getters["equipments/loading"]||this.$store.getters["fields/loading"]||this.$store.getters["productCategories/loading"]||this.$store.getters["pests/loading"]||this.$store.getters["storagePlaces/loading"]||this.$store.getters["units/loading"]||this.$store.getters["users/loading"]},productService(){const e=this.$store.state;return new La(e.products.mineralFertilizers.data,e.products.companyFertilizers.data,e.products.secondaryFertilizers.data,e.products.herbizides.data,e.products.crops.data,e.products.miscellaneous.data,e.products.harvests.data,e.products.seeds.data,e.products.otherProductsAndFertilizers.data,e.products.waads.data)},activityProductService(){return new Aa(this.units,this.productService,$a)},equipmentService(){return new Wa(this.$store.state.equipments.data)},activityEquipmentService(){return new Za(this.equipmentService)},fieldService(){return new Ya(this.$store.state.fields.data,this.$store.getters["products/findProductById"])},companyService(){return new qa(this.$store.state.auth.companiesById)},activityService(){return new Ka(this.$store.state.activities.data,this.fieldService,this.activityEquipmentService,this.activityProductService,this.companyService)},featureActivitiesReadonly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_ACTIVITIES)}},watch:{currentProcessOrderIds(){this.loadData()},currentCompanyIds(){this.loadData()},activities(){this.activitiesLoaded?this.debouncedRuleCheck():this.activitiesLoaded=!0}},methods:{withReadOnly(e){return e.map((e=>e.data.includes("expand")?e:e.subtableColumns?{...e,readOnly:!0,subtableColumns:e.subtableColumns.map((e=>({...e,readOnly:!0})))}:{...e,readOnly:!0}))},onUpdateExpandedTableData(e){const t=e.filter((e=>e.product?.productId??!1)).map((e=>e.product?.productId)).filter((e=>this.pesticideIdsInUse.includes(e??"")));this.$store.dispatch("pesticideIndications/loadByIds",t)},onChange(e,t){e.forEach((e=>{const[,t,,i,{id:a}]=e,n=["expand","select"];n.includes(t)||this.debouncedRuleCheck(),t.startsWith("product")?this.onChangeActivityProduct(e):t.startsWith("equipment")?this.onChangeActivityEquipment(e):"fieldDropdownItem"!==t?"bbchDropdownItem"!==t?n.includes(t)?this.$store.commit("activities/addOrUpdateTableDataMetadataByKeyAndValue",{activityId:a,key:t,value:i}):"activityTypeDropdownItem"!==t?this.$store.dispatch("activities/updateEntryByKeyAndValueAndSync",{guid:a,key:t,value:i}):this.$store.dispatch("activities/updateActivityTypeAndSync",{activityId:a,activityTypeId:i.id}):this.$store.dispatch("activities/updateEntryByKeyAndValueAndSync",{guid:a,key:"bbchCode",value:uo(i)}):this.onChangeFieldDropdownItem(e)}))},onChangeActivityProduct(e){const{id:t}=e[4],i=this.$store.state.activities.data[t].products,a=this.activityService.getCompanyOfActivity(t).id,n=this.activityProductService.updateActivityProductsFromChange(i,e,a);this.$store.dispatch("activities/updateEntryByKeyAndValueAndSync",{guid:t,key:"products",value:n})},onChangeActivityEquipment(e){const{id:t}=e[4],i=this.$store.state.activities.data[t].equipment,a=this.activityService.getCompanyOfActivity(t).id,n=this.activityEquipmentService.updateActivityEquipmentsFromChange(i,e,a);this.$store.dispatch("activities/updateEntryByKeyAndValueAndSync",{guid:t,key:"equipment",value:n})},onChangeFieldDropdownItem(e){const{id:t}=e[3],{id:i}=e[4],a=this.$store.state.fields.data[t];this.$store.commit("activities/updateEntryByKeyAndValue",{guid:i,key:"processedArea",value:a.fieldSize}),this.$store.dispatch("activities/updateEntryByKeyAndValueAndSync",{guid:i,key:"fieldId",value:t})}
1,loadData(){this.$store.dispatch("activities/subscribe",{forceRefresh:!0}),this.$store.dispatch("activities/ruleCheck/rules/subscribe"),this.$store.dispatch("activities/ruleCheck/activityRuleViolations/subscribe"),this.$store.dispatch("equipments/subscribe"),this.$store.dispatch("fields/subscribe"),this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("customers/subscribe"),this.$store.dispatch("products/subscribe"),this.$store.dispatch("productCategories/subscribe"),this.$store.dispatch("pests/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.$store.dispatch("units/subscribe"),this.$store.dispatch("users/subscribe")},onUpdateHot(e){this.$store.commit("activities/setHot",e),this.$emit("update:hot",e)},triggerRuleCheckRecheck(){this.$store.dispatch("activities/ruleCheck/activityRuleViolations/recheck")}}}),xL=TL,BL=(0,ew.Z)(xL,vR,bR,!1,null,null,null),OL=BL.exports,$L=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.TheContentbar,{scopedSlots:e._u([e.leftSectionVisible?{key:"left",fn:function({contentbarLarge:a}){return[i.editMode?e._e():t(i.Button,{attrs:{icon:"plus-circle","leading-icon":"","component-namespace-name":"ButtonAddActivity","tooltip-options":{boundary:"viewport"},disabled:!i.featureCreateActivityEnabled,iconOnly:!1},on:{click:i.onCreateButtonClick}},[e._v(" "+e._s(e.$t("Maßnahme hinzufügen"))+" ")]),i.editMode?e._e():t(i.Button,{attrs:{icon:["fas","cloud-arrow-up"],"leading-icon":"",color:"lightest","icon-only":!a},on:{click:function(e){return i.router.push({name:"activities/import/choose-method"})}}},[e._v(" "+e._s(e.$t("Maßnahmen importieren"))+" ")]),i.editMode?t(i.ButtonDropdown,{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",text:e.$t("Auswahl aufheben")??"Auswahl aufheben",buttons:i.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:i.onDeselectAll}}):e._e(),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:i.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"pencil-alt","leading-icon":"","component-namespace-name":"ButtonEditActivities",title:e.$t("Bearbeiten")??"Bearbeiten","icon-only":!a,"tooltip-options":{boundary:"viewport"}},on:{click:i.onEditSelected}}),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:i.editMode,expression:"editMode"}],staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteActivities",title:e.$t("Löschen")??"Löschen","icon-only":!a,"tooltip-options":{boundary:"viewport"},disabled:!i.featureDeleteActivityEnabled},on:{click:i.onDeleteSelected}}),i.editMode?t(i.Button,{attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportActivities",disabled:!i.featureActivitiesExportEnabled,title:e.$t("Auswahl exportieren")??"Auswahl exportieren","icon-only":!a,"tooltip-options":{boundary:"viewport"}},on:{click:i.onExportSelected}}):e._e(),i.editMode?t(i.Button,{attrs:{color:"lightest",icon:"copy","leading-icon":"","component-namespace-name":"ButtonDuplicateActivity",title:i.duplicateActivityTitle,"icon-only":!a,"tooltip-options":{boundary:"viewport"},disabled:!i.featureDuplicateActivityEnabled},on:{click:i.onDuplicateSelected}}):e._e(),i.editMode&&i.featureMoveActivitiesEnabled?t(i.Button,{attrs:{color:"lightest",icon:"share-square","leading-icon":"","component-namespace-name":"ButtonMoveActivity",title:i.moveActivityTitle,"icon-only":!a,"tooltip-options":{boundary:"viewport"},disabled:!i.featureMoveActivitiesEnabled},on:{click:i.onMoveSelected}}):e._e()]}}:null,{key:"right",fn:function({contentbarLarge:a}){return[t(i.SearchBar,{directives:[{name:"show",rawName:"v-show",value:!i.editMode,expression:"!editMode"}],attrs:{type:a?"large":"",searchFilter:i.filterString},on:{"update:searchFilter":t=>e.$emit("update:filterString",t)}}),t(i.ProcessOrderSwitch,{directives:[{name:"show",rawName:"v-show",value:!i.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!a}}),t(i.CompanySwitch,{directives:[{name:"show",rawName:"v-show",value:!i.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!a}}),t(i.DropdownPageOptions,{directives:[{name:"show",rawName:"v-show",value:!i.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{"restore-label":e.$t("Maßnahmen wiederherstellen")??"Maßnahmen wiederherstellen",hideRestore:!0,exportDisabled:!i.featureActivitiesExportEnabled},on:{restore:i.restoreActivities,settings:i.onShowSettings,export:i.onExportData}})]}}],null,!0)})},RL=[],NL=i(84085),zL=function(){var e=this,t=e._self._c;return t("div",{staticClass:"contentbar border-top border-bottom border-medium bg-lightest",attrs:{id:"the-contentbar"}},[t("div",{staticClass:"contentbar__left"},[e._t("left",null,{contentbarLarge:e.large})],2),e._t("middle",null,{contentbarLarge:e.large}),t("div",{staticClass:"contentbar__right"},[e._t("right",null,{contentbarLarge:e.large})],2)],2)},LL=[],VL={name:"TheContentbar",mixins:[OI],computed:{large(){return this.resizeObserverSize.width>=1400}}},UL=VL,jL=(0,ew.Z)(UL,zL,LL,!1,null,"11f6ea80",null),HL=jL.exports,GL=function(){var e=this,t=e._self._c;return t("BDropdown",{attrs:{variant:"lightest","menu-class":"shadow mt-1",right:"","no-caret":"","data-namespace":`${e.$options.name}.${e.componentNamespace}`}},[t("template",{slot:"button-content"},[e._v(" "+e._s(e.$t("Optionen"))+" "),t("FontAwesomeIcon",{attrs:{icon:"chevron-circle-down"}})],1),e.hideSettings?e._e():t("BDropdownItemButton",{staticClass:"dropdown-page-options__item text-black",attrs:{"button-class":"dropdown-page-options__button","data-namespace":`ButtonSettings.${e.$options.name}.${e.componentNamespace}`},on:{click:function(t){return e.$emit("settings")}}},[t("FontAwesomeIcon",{staticClass:"dropdown-page-options__button-icon",attrs:{icon:"cog"}}),e._v(" "+e._s(e.settingsLabel)+" ")],1),e.hideRestore?e._e():t("BDropdownItemButton",{staticClass:"dropdown-page-options__item text-black",attrs:{"button-class":"dropdown-page-options__button",disabled:e.restoreReadOnly,"data-namespace":`ButtonRestore.${e.$options.name}.${e.componentNamespace}`},on:{click:function(t){return e.$emit("restore")}}},[t("FontAwesomeIcon",{staticClass:"dropdown-page-options__button-icon",attrs:{icon:"history"}}),e._v(" "+e._s(e.restoreLabel)+" ")],1),e.hideExport?e._e():t("BDropdownItemButton",{staticClass:"dropdown-page-options__item text-black",attrs:{"button-class":"dropdown-page-options__button",disabled:e.exportDisabled,"data-namespace":`ButtonExport.${e.$options.name}.${e.componentNamespace}`},on:{click:function(t){return e.$emit("export")}}},[t("FontAwesomeIcon",{staticClass:"dropdown-page-options__button-icon",attrs:{icon:"cloud-download"}}),e._v(" "+e._s(e.exportLabel)+" ")],1),e._l(e.additionalOptions,(function(i){return t("BDropdownItemButton",{key:i.key,staticClass:"dropdown-page-options__item text-black",attrs:{"button-class":"dropdown-page-options__button",disabled:i.disabled,"data-namespace":`${i.key}.${e.$options.name}.${e.componentNamespace}`},on:{click:i.onClick}},[t("FontAwesomeIcon",{staticClass:"dropdown-page-options__button-icon",attrs:{icon:i.icon}}),e._v(" "+e._s(i.label)+" ")],1)})),e._t("additional-options")],2)},WL=[];ow.vI.add(uw.yh$,uw.qO$,uw.b7W,uw.KN3);var ZL={name:"DropdownPageOptions",mixins:[pw],props:{restoreLabel:{type:String,default:()=>b["default"].i18n.translate("Wiederherstellen")},restoreReadOnly:{type:Boolean,default:!1},hideRestore:{type:Boolean,default:!1},settingsLabel:{type:String,default:()=>b["default"].i18n.translate("Einstellungen")},hideSettings:{type:Boolean,default:!1},exportLabel:{type:String,default:()=>b["default"].i18n.translate("Exportieren")},exportDisabled:{type:Boolean,default:!1},hideExport:{type:Boolean,default:!1},additionalOptions:{type:Array,default:null}}},KL=ZL,qL=(0,ew.Z)(KL,GL,WL,!1,null,"92e9c87e",null),YL=qL.exports,JL=function(){var e=this,t=e._self._c;return e.availableProcessOrderNames.length>0?t("div",{staticClass:"process-order-switch"},[t("span",{directives:[{name:"show",rawName:"v-show",value:!e.slim&&null!=e.currentProcessOrderName,expression:"!slim && currentProcessOrderName != null"}],staticClass:"process-order-switch__label"},[e._v(" "+e._s(e.$t("Erntejahr:"))+" ")]),e.previousProcessOrderAvailable?t("FontAwesomeIcon",{attrs:{icon:"arrow-alt-circle-left"},on:{click:e.previousProcessOrder}}):null!=e.currentProcessOrderName?t("FontAwesomeIcon",{class:{"process-order-switch__add-icon--read-only":e.processOrdersReadOnly},attrs:{icon:"plus-circle"},on:{click:function(t){return e.createProcessOrder("previous")}}}
1):e._e(),t("BFormSelect",{ref:"select",staticClass:"process-order-switch__current",attrs:{value:e.currentProcessOrderName,options:e.processOrderOptions},on:{change:e.select}}),e.nextProcessOrderAvailable?t("FontAwesomeIcon",{attrs:{icon:"arrow-alt-circle-right"},on:{click:e.nextProcessOrder}}):null!=e.currentProcessOrderName?t("FontAwesomeIcon",{class:{"process-order-switch__add-icon--read-only":e.processOrdersReadOnly},attrs:{icon:"plus-circle"},on:{click:function(t){return e.createProcessOrder("next")}}}):e._e(),e.modalVisible?t("ModalCreateProcessOrder",{attrs:{direction:e.modalDirection},model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}}):e._e()],1):e._e()},XL=[],QL=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"md","body-class":"modal-edit-status",static:"",visible:e.visible,title:e.$t("Erntejahr {newYear} hinzufügen",{newYear:e.newYear})},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([e.processOrdersReadOnly?{key:"default",fn:function(){return[t("div",[t("p",[e._v(" "+e._s(e.$t("Du hast keine Berechtigung ein neues Erntejahr hinzuzufügen."))+" ")])])]},proxy:!0}:{key:"default",fn:function(){return[e.success?t("div",[t("p",[e._v(" "+e._s(e.$t("Das Erntejahr {newYear} wurde hinzugefügt.",{newYear:e.newYear}))+" ")]),e.copyFields?t("p",[e._v(" "+e._s(e.$t("Die Felder wurden aus {sourceYear} übernommen.",{sourceYear:e.sourceYear}))+" ")]):e._e()]):e.error?t("p",{staticClass:"modal-edit-status__error"},[e._v(" "+e._s(e.errorUserMessage)+" ")]):t("div",[t("p",[e._v(" "+e._s(e.$t("Willst du ein neues Erntejahr {newYear} hinzufügen?",{newYear:e.newYear}))+" ")]),"next"===e.direction?t("p",[e._v(" "+e._s(e.$t("Die Felder aus dem vorangehenden Erntejahr {sourceYear} werden übernommen.",{sourceYear:e.sourceYear}))+" ")]):t("div",[t("FormCheckbox",{attrs:{switch:""},model:{value:e.copyFields,callback:function(t){e.copyFields=t},expression:"copyFields"}},[e.copyFields?t("span",[e._v(" "+e._s(e.$t("Die Felder aus dem nachfolgenden Erntejahr {sourceYear} übernehmen.",{sourceYear:e.sourceYear}))+" ")]):t("span",[e._v(" "+e._s(e.$t("Es werden keine Felder in {newYear} erstellt.",{newYear:e.newYear}))+" ")])])],1)])]},proxy:!0},{key:"buttons",fn:function(){return[t("Button",{attrs:{variant:"primary",fetching:e.fetching,disabled:e.processOrdersReadOnly},on:{click:e.create}},[e.success||e.error?t("span",[e._v(" "+e._s(e.$t("Schließen"))+" ")]):t("span",[e._v(" "+e._s(e.$t("OK"))+" ")])]),e.success||e.error?e._e():t("Button",{attrs:{variant:"white",disabled:e.fetching},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}],null,!0)})},eV=[];ow.vI.add(uw.IJ7);var tV={name:"ModalCreateProcessOrder",components:{Button:gw,FormCheckbox:Gw,ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},direction:{type:String,default:"next",validator:e=>["next","previous"].includes(e)},sourceProcessOrderName:{type:String,default:null},switchToNewProcessOrder:{type:Boolean,default:!0}},data(){return{currentProcessOrderName:null,copyFields:!0,fetching:!1,success:!1,error:!1,errorUserMessage:null,resolves:[]}},computed:{sourceYear(){return null!=this.sourceProcessOrderName?this.sourceProcessOrderName:this.currentProcessOrderName},previous(){return Number(this.sourceYear)-1},next(){return Number(this.sourceYear)+1},newYear(){return"previous"===this.direction?this.previous:this.next},processOrdersReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_PROCESS_ORDER)}},mounted(){this.currentProcessOrderName=this.$store.state.auth.currentProcessOrderName},methods:{async create(){if(this.success||this.error)return void this.hide();this.fetching=!0,await new Promise((e=>setTimeout(e,100)));const e=await this.$store.dispatch("auth/createProcessOrder",{direction:this.direction,copyFields:this.copyFields,sourceProcessOrderName:this.sourceYear});if("success"!==e.status)return this.fetching=!1,this.error=!0,void(this.errorUserMessage=e.errorUserMessage.join("\n"));await this.$store.dispatch("auth/refreshUserCompanies"),this.switchToNewProcessOrder&&"success"===e.status&&await this.$store.dispatch("auth/setCurrentProcessOrderName",e.data[0].name),this.fetching=!1,this.success=!0},async show(){return new Promise((e=>{this.resolves=[...this.resolves,e],this.$refs.modalWrapper.show()}))}
1,hide(){this.$refs.modalWrapper.hide(),this.resolves.forEach((e=>e(this.success&&!this.error))),this.resolves=[]}}},iV=tV,aV=(0,ew.Z)(iV,QL,eV,!1,null,"5fd44bdc",null),nV=aV.exports;ow.vI.add(uw.KtF,uw.nP8,uw.JYN);var rV={name:"ProcessOrderSwitch",components:{ModalCreateProcessOrder:nV},props:{slim:{type:Boolean,default:!1}},data(){return{modalVisible:!1,modalDirection:null}},computed:{currentProcessOrderName(){return this.$store.state.auth.currentProcessOrderName},availableProcessOrderNames(){return this.$store.getters["auth/availableProcessOrderNames"]},processOrdersReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_PROCESS_ORDER)},processOrderOptions(){const e=this.availableProcessOrderNames.map((e=>({value:e,text:e}))).sort(((e,t)=>t.value-e.value));return null!=this.currentProcessOrderName?e:[{value:null,text:this.$t("Erntejahr wählen..."),disabled:!0},...e]},title(){return null==this.currentProcessOrderName?this.$t("Erntejahr wählen..."):this.currentProcessOrderName},previousProcessOrderAvailable(){return null!=this.currentProcessOrderName&&this.availableProcessOrderNames.indexOf(this.currentProcessOrderName)>0},nextProcessOrderAvailable(){return null!=this.currentProcessOrderName&&this.availableProcessOrderNames.indexOf(this.currentProcessOrderName)+1<this.availableProcessOrderNames.length}},methods:{previousProcessOrder(){this.$store.dispatch("auth/setCurrentProcessOrderName",String(this.currentProcessOrderName-1))},nextProcessOrder(){this.$store.dispatch("auth/setCurrentProcessOrderName",String(Number(this.currentProcessOrderName)+1))},select(e){this.$store.dispatch("auth/setCurrentProcessOrderName",e),this.$refs.select.blur()},createProcessOrder(e){this.processOrdersReadOnly||(this.modalDirection=e,this.modalVisible=!0)}}},sV=rV,oV=(0,ew.Z)(sV,JL,XL,!1,null,"35a5a343",null),lV=oV.exports,dV=function(){var e=this,t=e._self._c;return t("BDropdown",{staticClass:"button-dropdown",class:[`button-dropdown--${e.variant}`,{"button-dropdown--has-next-sibling":e.hasNextSibling}],attrs:{split:"","menu-class":"shadow",text:e.text,variant:e.variant,disabled:e.disabled,boundary:e.boundary},on:{click:e.onClick}},e._l(e.buttons,(function(i){return t("BDropdownItemButton",{key:i.text,attrs:{disabled:i.disabled},on:{click:t=>e.onClickButton(i,t)}},[e._v(" "+e._s(i.text)+" ")])})),1)},cV=[],uV={name:"ButtonDropdown",mixins:[pw],props:{text:{type:String,required:!0},buttons:{type:Array,required:!0},outline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},boundary:{type:String,default:"scrollParent",validator:e=>["scrollParent","window","viewport"].includes(e)}},data(){return{hasNextSibling:!1}},computed:{variant(){return this.outline?"outline-primary":"primary"}},mounted(){null!=this.$el.nextElementSibling&&(this.hasNextSibling=!0)},methods:{onClick(e){this.$root.$emit("button--click",this.componentNamespace),this.$emit("click",e)},onClickButton(e,t){let i=this.componentNamespace;"string"===typeof e.componentNamespaceName&&e.componentNamespaceName.length>0&&(i=`${e.componentNamespaceName}.${i}`),this.$root.$emit("button--click",i),"function"===typeof e.handler&&e.handler(t)}}},pV=uV,hV=(0,ew.Z)(pV,dV,cV,!1,null,"2e8c9d29",null),mV=hV.exports,fV=(0,b.defineComponent)({__name:"TheContentbarContainer",props:{filterString:{default:""},leftSectionVisible:{type:Boolean,default:!0}},emits:["onDeselectAll","onInvertSelection","onSelectAll","onCreateButtonClick","update:filterString","onExportSelected","onShowSettings","onExportData","onMoveButtonClick","onDuplicateButtonClick","onEditButtonClick"],setup(e,{emit:t}){const i=e,a=Vb(),n=(0,NL.tv)(),r=Gb.translate,s=(0,b.ref)(i.filterString),o=(0,b.computed)((()=>a.getters["activities/selectedActivities"])),l=(0,b.computed)((()=>a.getters["activities/selectedActivityIds"])),d=(0,b.computed)((()=>a.getters["activities/loading"]||a.getters["activityTypes/loading"]||a.getters["customers/loading"]||a.getters["fields/loading"]||a.getters["products/loading"]||a.getters["storagePlaces/loading"]||a.getters["units/loading"])),c=(0,b.computed)((()=>l.value.length>0)),u=(0,b.computed)((()=>!d.value&&c.value)),p=(0,b.computed)((()=>1===l.value.length?r("Gewählten Eintrag wirklich löschen?")??"Gewählten Eintrag wirklich löschen?":r("Gewählte Einträge wirklich löschen?")??"Gewählte Einträge wirklich löschen?")),h=(0,b.computed)((()=>1===l.value.length?r("Maßnahme duplizieren")??"Maßnahme duplizieren":r("Maßnahmen duplizieren")??"Maßnahmen duplizieren")),m=(0,b.computed)((()=>1===l.value.length?r("Maßnahme verschieben")??"Maßnahme verschieben":r("Maßnahmen verschieben")??"Maßnahmen verschieben")),f=(0,b.computed)((()=>a.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MOVE_ACTIVITIES))),g=(0,b.computed)((()=>a.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_ACTIVITIES))),y=(0,b.computed)((()=>a.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_ACTIVITIES))),v=(0,b.computed)((()=>a.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_ACTIVITIES_EXPORT))),w=(0,b.computed)((()=>g.value&&!y.value)),C=(0,b.computed)((()=>g.value&&!y.value)),F=(0,b.computed)((()=>g.value&&!y.value)),A=(0,b.ref)([{text:r("Auswahl aufheben"),handler:()=>t("onDeselectAll")},{text:r("Auswahl umkehren"),handler:()=>t("onInvertSelection")}
1,{text:r("Alle auswählen"),handler:()=>t("onSelectAll")}]);function k(){t("onCreateButtonClick")}function S(){t("onDeselectAll")}async function E(){const e=await b["default"].prototype.$confirm({message:p.value,okTitle:r("Löschen")??"Löschen",okVariant:"danger"});e&&(a.dispatch("activities/delete",o.value),S())}function I(){t("onExportSelected",l.value)}function _(){n.push({name:"activities/restore"})}function D(){t("onShowSettings")}function M(){t("onExportData")}function P(){t("onDuplicateButtonClick",l.value)}function T(){t("onMoveButtonClick")}function x(){t("onEditButtonClick",l.value)}return(0,b.watch)(s,(()=>t("update:filterString",s.value))),{__sfc:!0,props:i,store:a,router:n,t:r,filterString:s,selectedActivities:o,selectedActivityIds:l,loading:d,rowIsSelected:c,editMode:u,deleteActivityMessage:p,duplicateActivityTitle:h,moveActivityTitle:m,featureMoveActivitiesEnabled:f,featureActivitiesEnabled:g,featureActivitiesReadOnly:y,featureActivitiesExportEnabled:v,featureCreateActivityEnabled:w,featureDeleteActivityEnabled:C,featureDuplicateActivityEnabled:F,buttonUpdateSelection:A,emit:t,onCreateButtonClick:k,onDeselectAll:S,onDeleteSelected:E,onExportSelected:I,restoreActivities:_,onShowSettings:D,onExportData:M,onDuplicateSelected:P,onMoveSelected:T,onEditSelected:x,TheContentbar:HL,CompanySwitch:qw,DropdownPageOptions:YL,ProcessOrderSwitch:lV,SearchBar:YE,Button:gw,ButtonDropdown:mV}}}),gV=fV,yV=(0,ew.Z)(gV,$L,RL,!1,null,"552bab6e",null),vV=yV.exports,bV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{id:"move-activity-modal-wrapper",size:"md",title:e.title},on:{cancel:e.resetModal},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:e.pageCount,current:e.showPaginationCurrentStep}}),0===e.currentStep?t("FirstStepContainer",{on:{"update:copyInsteadOfMove":t=>e.copyInsteadOfMove=t}}):e._e(),1===e.currentStep?t("ConflictionStepContainer"):e._e(),2===e.currentStep?t("ThirdStepContainer",{attrs:{copyInsteadOfMove:e.copyInsteadOfMove}}):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[0===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:!e.moveEnabled},on:{click:e.next}},[t("span",[e._v(e._s(e.copyInsteadOfMove?e.$t("Jetzt kopieren"):e.$t("Jetzt verschieben")))])]):e._e(),1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:!e.moveEnabled},on:{click:e.nextConflictOrMoveActivity}},[t("span",[e._v(" "+e._s(e.counterReachedLastMoveActivity||e.keepOption?e.copyInsteadOfMove?e.$t("Jetzt kopieren"):e.$t("Jetzt verschieben"):e.$t("Nächster Konflikt")))])]):e._e(),2!==e.currentStep?t("BButton",{attrs:{variant:"white"},on:{click:e.reset}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])]):e._e(),2===e.currentStep?t("BButton",{attrs:{variant:"primary"},on:{click:e.reset}},[t("span",[e._v(e._s(e.$t("Ok")))])]):e._e()]},proxy:!0}])})},wV=[],CV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e.currentMoveActivityParameter?t("ConflictionStep",{attrs:{activity:e.activity,activityTypes:e.activityTypes,fields:e.fields,fieldDropdownItems:e.fieldDropdownItems,keepOption:e.keepOption,customers:e.customers,crops:e.crops,selectedField:e.selectedField,selectedMode:e.selectedMode},on:{"update:keepOption":e.updateKeepOption,"update:moveActivityMode":e.updateMode,"update:fieldId":e.updateFieldId}}):e._e()],1)},FV=[],AV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("h2",[e._v(e._s(e.$t("Konflikt"))+"!")]),t("p",[e._v(" "+e._s(e.$t("Das Feld der folgenden Maßnahme konnte im Ziel nicht gefunden werden."))+" ")]),t("div",{staticClass:"confliction-container"},[e.date?t("h3",[e._v(e._s(e.$t("Datum")))]):e._e(),e.date?t("span",[e._v(e._s(e.date))]):e._e(),e.activityType?t("h3",[e._v(e._s(e.$t("Tätigkeit")))]):e._e(),e.activityType?t("span",[e._v(e._s(e.activityType.displayName))]):e._e(),e.fieldDisplayName?t("h3",[e._v(e._s(e.$t("Feld")))]):e._e(),e.fieldDisplayName?t("span",[e._v(e._s(e.fieldDisplayName))]):e._e(),e.field?.fieldSize?t("h3",[e._v(e._s(e.$t("Feldgröße")))]):e._e(
1),e.field?.fieldSize?t("span",[e._v(e._s(e.field.fieldSize))]):e._e()]),t("FormFieldSet",{attrs:{headline:e.$t("Wähle eine Option um fortzufahren")}},[t("FormFieldRadioGroup",{attrs:{checked:e.selectedMode,variant:"no-label"},on:{change:e.updateMoveActivityMode}},[t("div",{staticClass:"options"},[t("FormRadio",{attrs:{value:e.copyField}},[e._v(e._s(e.$t("Erstelle eine Kopie des Feldes im Ziel")))]),t("FormCheckbox",{staticClass:"checkbox",attrs:{checked:e.keepOption,slim:!0},on:{input:e.updateKeepOption}},[e._v(e._s(e.$t("Behalte diese Option bei den folgenden Konflikten bei")))])],1),t("div",{staticClass:"options"},[t("FormRadio",{attrs:{value:e.replaceField,disabled:e.dropdownIsEmpty}},[e._v(e._s(e.$t("Ersetze das Feld im Ziel")))]),t("FormFieldDropdown",{staticClass:"pl-4",attrs:{label:e.$t("Feld")||"",placeholder:e.dropdownIsEmpty?e.$t("Keine Felder vorhanden"):e.$t("Tippen um zu suchen"),value:e.fieldDropdownValue,items:e.fieldDropdownItems,slimMargin:!0,disableDelete:"",disabled:e.dropdownIsEmpty,variantVariation:"small-modal"},on:{update:e.updateFieldId}})],1)])],1)],1)},kV=[],SV=(0,b.defineComponent)({name:"ConflictionStep",components:{FormFieldDropdown:lk,FormFieldSet:_k,FormFieldRadioGroup:_T,FormCheckbox:Gw,FormRadio:kT},props:{activity:{type:[Object,null],required:!0},fieldDropdownItems:{type:Array,required:!0},selectedField:{type:[Object,null],default:null},selectedMode:{type:[String,null],default:null},keepOption:{type:Boolean,required:!0},fields:{type:Object,required:!0},activityTypes:{type:Object,required:!0},crops:{type:Object,required:!0},customers:{type:Object,required:!0}},data(){return{defaultSelectedDropdownValue:{id:"",name:""},copyField:Ct.CopyField,replaceField:Ct.ReplaceField}},computed:{activityType(){return this.activity?this.activityTypes[this.activity.activityTypeId]:null},fieldDropdownValue(){return this.selectedField||this.defaultSelectedDropdownValue},field(){return this.activity?.fieldId?this.fields[this.activity.fieldId]:null},fieldDisplayName(){return this.field?ho(this.field,this.customers,this.crops):null},date(){return this.activity?.timeStart?new Date(ca(this.activity.timeStart)).toLocaleDateString("de-AT"):null},dropdownIsEmpty(){return 0===this.fieldDropdownItems[0].items.length}},methods:{updateFieldId(e){this.$emit("update:fieldId",e.id),this.$emit("update:keepOption",!1),this.$emit("update:moveActivityMode",Ct.ReplaceField)},updateMoveActivityMode(e){this.$emit("update:moveActivityMode",e)},updateKeepOption(e){this.$emit("update:keepOption",e),this.$emit("update:moveActivityMode",Ct.CopyField),this.$emit("update:fieldId",null)}}}),EV=SV,IV=(0,ew.Z)(EV,AV,kV,!1,null,"70f56077",null),_V=IV.exports,DV=(0,b.defineComponent)({name:"ConflictionStepContainer",components:{ConflictionStep:_V},data(){return{destinationFields:[]}},async created(){if(this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("fields/subscribe"),this.selectedProcessOrderId){const{data:e}=await Vo([this.selectedProcessOrderId],void 0,{resolve:["fieldGroup"],itemsPerPage:5e3});"success"===e.status&&(this.destinationFields=e.data)}},computed:{...(0,C.Se)({activities:"activities/data",fields:"fields/data",activityTypes:"activityTypes/data",customers:"customers/data",crops:"products/crops/data"}),...(0,C.rn)("activities/moveActivity",["counterCurrentMoveActivityConflict","moveActivityParametersWithResult","selectedProcessOrderId","keepOption"]),fieldDropdownItems(){return[{name:this.$t("Felder"),id:"fields",items:this.destinationFields.map((e=>({id:e.id,name:ho(e,this.customers,this.crops)}))),sort:!0}]},moveActivityParametersWithConflict(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithConflict"]},moveActivityParametersWithoutMode(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithoutMode"]},currentMoveActivityParameter(){return this.moveActivityParametersWithConflict?this.moveActivityParametersWithConflict[this.counterCurrentMoveActivityConflict]:null},selectedField(){return this.currentMoveActivityParameter&&this.fieldDropdownItems[0].items.find((e=>e.id===this.currentMoveActivityParameter?.destinationFieldId))||null},selectedMode(){return this.currentMoveActivityParameter?.mode||null},activity(){return this.currentMoveActivityParameter?this.activities[this.currentMoveActivityParameter.sourceActivityId]:null}},methods:{updateFieldId(e){this.$store.commit("activities/moveActivity/setDestinationFieldIdOnMoveActivityParametersWithResult",{id:this.currentMoveActivityParameter?.sourceActivityId,destinationFieldId:e})},updateMode(e,t){this.$store.commit("activities/moveActivity/setModeOnMoveActivityParametersWithResult",{id:t||this.currentMoveActivityParameter?.sourceActivityId,mode:e})},updateKeepOption(e){this.$store.commit("activities/moveActivity/setKeepOption",e),e&&this.moveActivityParametersWithoutMode?.forEach((e=>{this.updateMode(Ct.CopyField,e.sourceActivityId)}))}}}),MV=DV,PV=(0,ew.Z)(MV,CV,FV,!1,null,null,null),TV=PV.exports,xV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FirstStep",{attrs:{companyDropdownItems:e.companyDropdownItems,processOrderDropdownItems:e.processOrdersDropdownItems,selectedProcessOrder:e.selectedProcessOrder,selectedCompany:e.selectedCompany},on:{"update:companyId":e.updateCompanyId,"update:processOrderId":e.updateProcessOrderId,"update:copyInsteadOfMove":t=>e.$emit("update:copyInsteadOfMove",t)}})},BV=[],OV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"first-step-content-wrapper"},[t("h2",[e._v(e._s(e.$t("Ziel auswählen")))]),t("p",[e._v(" "+e._s(e.$t("Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Maßnahmen verschoben werden sollen."))+" ")]),t("FormFieldDropdown",{staticClass:"company-dropdown",attrs:{label:"Farm",value:e.companyDropdownValue,items:e.companyDropdownItems,disableDelete:"",variantVariation:"small-modal","data-testid":"company-dropdown"},on:{update:e.updateCompanyId}}),t("FormFieldDropdown",{staticClass:"process-order-dropdown",attrs:{label:e.$t("Erntejahr")||"",value:e.processOrderDropdownValue,items:e.processOrderDropdownItems,disableDelete:"",boundary:"modal-step-content",disabled:0===e.processOrderDropdownItems.length,variantVariation:"small-modal","data-testid":"process-order-dropdown"},on:{update:e.updateProcessOrderId}}),t("FormCheckbox",{staticClass:"mt-3 mb-3",model:{value:e.copyInsteadOfMove,callback:function(t){e.copyInsteadOfMove=t},expression:"copyInsteadOfMove"}}
1,[e._v(" "+e._s(e.$t("Maßnahmen kopieren anstatt zu verschieben"))+" ")])],1)},$V=[],RV=(0,b.defineComponent)({name:"FirstStep",components:{FormFieldDropdown:lk,FormCheckbox:Gw},props:{companyDropdownItems:{type:Array,required:!0},processOrderDropdownItems:{type:Array,required:!0},selectedProcessOrder:{type:Object},selectedCompany:{type:Object}},data(){return{defaultSelectedDropdownValue:{id:"",name:""},copyInsteadOfMove:!1}},computed:{companyDropdownValue(){return this.selectedCompany||this.defaultSelectedDropdownValue},processOrderDropdownValue(){return this.selectedProcessOrder||this.defaultSelectedDropdownValue}},methods:{updateCompanyId(e){this.$emit("update:companyId",e.id)},updateProcessOrderId(e){this.$emit("update:processOrderId",e.id)}},watch:{copyInsteadOfMove(e){this.$emit("update:copyInsteadOfMove",e)}}}),NV=RV,zV=(0,ew.Z)(NV,OV,$V,!1,null,null,null),LV=zV.exports,VV=(0,b.defineComponent)({name:"FirstStepContainer",components:{FirstStep:LV},watch:{selectedCompanyId:{handler(){this.selectedCompanyId||this.$store.commit("activities/moveActivity/setSelectedCompanyId",this.currentCompanyIds[0])},immediate:!0}},computed:{...(0,C.Se)({currentProcessOrderIds:"auth/currentProcessOrderIds",currentCompanyIds:"auth/currentCompanyIds"}),...(0,C.rn)("activities/moveActivity",["selectedCompanyId","selectedProcessOrderId"]),companiesWithMoveActivitiesEnabled(){const e=this.$store.getters["auth/userCompaniesWithFeatureEnabled"](Zl.FEATURE_MOVE_ACTIVITIES);return e.map((e=>e.company))},selectedCompany(){return this.companiesWithMoveActivitiesEnabled.find((e=>e.id===this.selectedCompanyId))||null},companyDropdownItems(){const e=this.companiesWithMoveActivitiesEnabled.map((e=>({id:e.id,name:e.name})));return[{items:e,sort:!0}]},processOrdersDropdownItems(){if(this.selectedCompany){const e=this.selectedCompany.processOrders.filter((e=>!this.currentProcessOrderIds.includes(e.id))).map((e=>({id:e.id,name:e.name}))).sort(((e,t)=>{const i=Number(e.name),a=Number(t.name);return i&&a?a-i:0}));return[{items:e}]}return[]},selectedProcessOrder(){return this.selectedCompany?.processOrders.find((e=>e.id===this.selectedProcessOrderId))||null}},methods:{updateCompanyId(e){this.$store.commit("activities/moveActivity/setSelectedCompanyId",e)},updateProcessOrderId(e){this.$store.commit("activities/moveActivity/setSelectedProcessOrderId",e)}}}),UV=VV,jV=(0,ew.Z)(UV,xV,BV,!1,null,null,null),HV=jV.exports,GV=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e.successfulMovedActivitiesWithDisplayName&&!e.failedMovedActivitiesWithDisplayName?t("ActivityStatusIndicator",{attrs:{title:e.successTitle,activities:e.successfulMovedActivitiesWithDisplayName,activityTypes:e.activityTypes}}):e.failedMovedActivitiesWithDisplayName?t("div",[t("ActivityStatusIndicator",{attrs:{title:e.errorTitle,activities:e.failedMovedActivitiesWithDisplayName,activityTypes:e.activityTypes}}),t("span",{staticClass:"section-information"},[t("FontAwesomeIcon",{staticClass:"fa-solid fa-square-exclamation",attrs:{icon:"square-exclamation"}}),e._v(" "+e._s(e.$t("Deshalb wurde keine Aktivität verschoben nach {cropYear} auf {companyName}",{cropYear:e.cropYear,companyName:e.companyName}))+" ")],1)],1):e._e()],1)},WV=[],ZV=(0,b.defineComponent)({name:"ThirdStepContainer",components:{ActivityStatusIndicator:J$},props:{copyInsteadOfMove:{type:Boolean,default:!1}},computed:{...(0,C.Se)({activityTypes:"activityTypes/data",fields:"fields/data",customers:"customers/data",crops:"products/crops/data",processOrdersById:"auth/processOrdersById"}),...(0,C.rn)("activities/moveActivity",["selectedProcessOrderId","selectedCompanyId","moveActivityParametersWithResult"]),...(0,C.rn)("activities",{activities:e=>e.data}),...(0,C.rn)("auth",["companiesById"]),moveActivityParametersWithConflict(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithConflict"]},moveActivityParametersWithSuccess(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithSuccess"]},successfulMovedActivitiesWithDisplayName(){if(this.moveActivityParametersWithSuccess&&this.moveActivityParametersWithSuccess.length>0){const e=this.moveActivityParametersWithSuccess.map((e=>this.activities[e.sourceActivityId]));return this.getActivitiesWithDisplayNames(e)}return null},failedMovedActivitiesWithDisplayName(){if(this.moveActivityParametersWithConflict&&this.moveActivityParametersWithConflict.length>0){const e=this.moveActivityParametersWithConflict.map((e=>this.activities[e.sourceActivityId]));return this.getActivitiesWithDisplayNames(e)}return null},cropYear(){return this.processOrdersById[this.selectedProcessOrderId]?.name??""},companyName(){return this.companiesById[this.selectedCompanyId]?.name??""},successTitle(){return 1===this.successfulMovedActivitiesWithDisplayName?.length?this.$t("Maßnahme erfolgreich {mode} nach {cropYear} auf {companyName}",{mode:this.copyInsteadOfMove?"kopiert":"verschoben",cropYear:this.cropYear,companyName:this.companyName})||"Maßnahme erfolgreich "+(this.copyInsteadOfMove?"kopiert":"verschoben"):this.$t("Maßnahmen erfolgreich {mode} nach {cropYear} auf {companyName}",{mode:this.copyInsteadOfMove?"kopiert":"verschoben",cropYear:this.cropYear,companyName:this.companyName})||"Maßnahmen erfolgreich "+(this.copyInsteadOfMove?"kopiert":"verschoben")},errorTitle(){return 1===this.failedMovedActivitiesWithDisplayName?.length?this.$t("Maßnahme konnte nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}",{mode:this.copyInsteadOfMove?"kopiert":"verschoben",cropYear:this.cropYear,companyName:this.companyName})||"Maßnahme nicht erfolgreich "+(this.copyInsteadOfMove?"kopiert":"verschoben"):this.$t("Maßnahmen konnten nicht erfolgreich {mode} werden nach {cropYear} auf {companyName}",{mode:this.copyInsteadOfMove?"kopiert":"verschoben",cropYear:this.cropYear,companyName:this.companyName})||"Maßnahmen nicht erfolgreich "+(this.copyInsteadOfMove?"kopiert":"verschoben")}},methods:{updateCompanyId(e){this.$store.commit("activities/moveActivity/setSelectedCompanyId",e)},updateProcessOrderId(e){this.$store.commit("activities/moveActivity/setSelectedProcessOrderId",e)},getActivitiesWithDisplayNames(e){return Object.values(yo(e.reduce(((e,t)=>({...e,[t.id]:t})),{}),(()=>{}),!1,{},{},this.fields,this.customers,this.crops))}}}),KV=ZV,qV=(0,ew.Z)(KV,GV,WV,!1,null,"708cc5ec",null),YV=qV.exports,JV=(0,b.defineComponent)({name:"ModalMoveActivity",components:{ModalWrapper:OC,Pagination:qk,FirstStepContainer:HV,ThirdStepContainer:YV,BButton:u.T,ConflictionStepContainer:TV},props:{selectedActivityIds:{type:Array,required:!0}},data(){return{currentStep:0,copyInsteadOfMove:!1}},computed:{...(0,C.rn)("activities/moveActivity",["selectedProcessOrderId","trials","counterCurrentMoveActivityConflict","moveActivityParametersWithResult","keepOption"]),title(){return this.copyInsteadOfMove?this.selectedActivityIds.length>1?this.$t("Maßnahmen kopieren"):this.$t("Maßnahme kopieren"):this.selectedActivityIds.length>1?this.$t("Maßnahmen verschieben"):this.$t("Maßnahme verschieben")},moveActivityParametersWithoutMode(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithoutMode"]},moveActivityParametersWithConflict(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithConflict"]},moveActivityParametersWithSuccess(){return this.$store.getters["activities/moveActivity/moveActivityParametersWithSuccess"]},pageCount(){return this.trials>0?3:2},moveEnabled(){switch(this.currentStep){case 0:return null!=this.selectedProcessOrderId;case 1:return this.currentMoveActivityParameters?.mode===Ct.CopyField||!(this.currentMoveActivityParameters?.mode!==Ct.ReplaceField||!this.currentMoveActivityParameters?.destinationFieldId);default:return!1}},currentMoveActivityParameters(){return this.moveActivityParametersWithConflict?this.moveActivityParametersWithConflict[this.counterCurrentMoveActivityConflict]:null},counterReachedLastMoveActivity(){return!(!this.moveActivityParametersWithConflict||this.counterCurrentMoveActivityConflict!==Object.keys(this.moveActivityParametersWithConflict).length-1)},conflictsResolved(){return this.counterReachedLastMoveActivity&&0===this.moveActivityParametersWithoutMode?.length||this.keepOption},showPaginationCurrentStep(){switch(this.currentStep){case 1:return 1;case 2:return this.trials>0?2:1;default:return this.currentStep}}},methods:{show(){this.$refs.modalWrapper?.show()},reset(){this.copyInsteadOfMove||this.removeSuccessfullyMovedActivitiesFromStore(),this.$refs.modalWrapper?.hide()},resetModal(){this.currentStep=0,this.$store.commit("activities/moveActivity/reset")},async next(){await this.moveActivity(),this.trials>0?this.currentStep+=1:this.currentStep=2},nextConflict(){this.$store.commit("activities/moveActivity/increaseCounterCurrentMoveActivityConflict")},async nextConflictOrMoveActivity(){this.conflictsResolved?await this.next():this.nextConflict()},async moveActivity(){await this.$store.dispatch("activities/moveActivity/toProcessOrder",{activityIds:this.selectedActivityIds,copy:this.copyInsteadOfMove})},removeSuccessfullyMovedActivitiesFromStore(){this.moveActivityParametersWithSuccess?.forEach((e=>{this.$store.commit("activities/removeActivity",e.sourceActivityId)}))}}}),XV=JV,QV=(0,ew.Z)(XV,bV,wV,!1,null,null,null),eU=QV.exports,tU=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalRuleCheckViolations",{attrs:{visible:e.visible,violations:e.violations,featureDism
1issViolationEnabled:e.featureDismissViolationEnabled},on:{cancel:e.cancel,dismissViolations:e.dismissViolations}})},iU=[],aU=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{visible:e.visible,title:e.$t("Achtung")},on:{cancel:function(t){return e.$emit("cancel")}},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:e.pages,current:e.currentPage}}),t("div",{staticClass:"section-header"},[t("strong",[e._v(e._s(e.currentViolation?.shortMessage))])]),e.currentViolation&&!e.isViolationNotChecked(e.currentViolation)?t("ModalContentViolation",{attrs:{violation:e.currentViolation}}):e.currentViolation?t("ModalContentViolationNotChecked",{attrs:{violation:e.currentViolation}}):e._e(),e.featureDismissViolationEnabled?t("FormCheckbox",{model:{value:e.dismissViolations[e.currentPage],callback:function(t){e.$set(e.dismissViolations,e.currentPage,t)},expression:"dismissViolations[currentPage]"}},[e._v(e._s(e.$t("Dieses Problem nicht mehr anzeigen")))]):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{attrs:{variant:"primary"},on:{click:e.onPrimaryClick}},[e._v(" "+e._s(e.primaryButtonLabel)+" ")]),e.hasPreviousViolation?t("BButton",{attrs:{variant:"white"},on:{click:e.onPreviousClick}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]):e._e()]},proxy:!0}])})},nU=[],rU=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("span",{domProps:{innerHTML:e._s(e.violation.longMessageHtml)}})},sU=[],oU=(0,b.defineComponent)({__name:"ModalContentViolation",props:{violation:null},setup(e){return{__sfc:!0}}}),lU=oU,dU=(0,ew.Z)(lU,rU,sU,!1,null,null,null),cU=dU.exports,uU=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ul",e._l(e.violation.links,(function(i){return t("li",{key:i.label},[t("a",{attrs:{href:i.href}},[e._v(e._s(i.label))])])})),0)},pU=[],hU=(0,b.defineComponent)({__name:"ModalContentViolationNotChecked",props:{violation:null},setup(e){return{__sfc:!0}}}),mU=hU,fU=(0,ew.Z)(mU,uU,pU,!1,null,null,null),gU=fU.exports,yU=(0,b.defineComponent)({name:"ModalRuleCheckViolations",props:{violations:{type:Array,required:!0},visible:{type:Boolean,default:!1},featureDismissViolationEnabled:{type:Boolean,default:!1}},data:()=>({currentPage:0,dismissViolations:[]}),components:{ModalWrapper:OC,Pagination:qk,BButton:u.T,ModalContentViolation:cU,ModalContentViolationNotChecked:gU,FormCheckbox:Gw},computed:{pages(){return this.violations.length},primaryButtonLabel(){return this.hasNextViolation?this.$t("Weiter")||"Weiter":this.$t("Ok")||"Ok"},hasNextViolation(){return this.currentPage<this.pages-1},hasPreviousViolation(){return this.currentPage>0},currentViolation(){return this.violations[this.currentPage]},violationsToDismiss(){return this.violations.filter(((e,t)=>this.dismissViolations[t]))}},watch:{visible(e){e&&(this.goToFirstViolation(),this.initDismissViolations())},violations:{handler(){this.initDismissViolations()},immediate:!0}},methods:{cancel(){this.$emit("cancel")},onPrimaryClick(){this.hasNextViolation?this.showNextViolation():(this.dismissViolationsIfSomeToDismiss(),this.cancel())},showNextViolation(){this.currentPage+=1},onPreviousClick(){this.hasPreviousViolation&&(this.currentPage-=1)},goToFirstViolation(){this.currentPage=0},isViolationNotChecked(e){return so(e)},initDismissViolations(){this.dismissViolations=this.violations.map((()=>!1))},dismissViolationsIfSomeToDismiss(){this.violationsToDismiss.length>0&&this.$emit("dismissViolations",this.violationsToDismiss)}}}),vU=yU,bU=(0,ew.Z)(vU,aU,nU,!1,null,"0678dd90",null),wU=bU.exports,CU=(0,b.defineComponent)({name:"ModalRuleCheckViolationsContainer",components:{ModalRuleCheckViolations:wU}
1,computed:{showRuleViolationModalForActivity(){return this.$store.state.activities.ruleCheck.showRuleViolationModalForActivity},visible(){return!!this.showRuleViolationModalForActivity},violations(){return this.showRuleViolationModalForActivity?this.$store.getters["activities/ruleCheck/violations"](this.showRuleViolationModalForActivity):[]},featureDismissViolationEnabled(){return!this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_RULE_CHECK)}},methods:{cancel(){this.$store.commit("activities/ruleCheck/hideRuleViolationsModal")},dismissViolations(e){this.$store.dispatch("activities/ruleCheck/dismissViolations",e)}}}),FU=CU,AU=(0,ew.Z)(FU,tU,iU,!1,null,"f03c8f7c",null),kU=AU.exports;ow.vI.add(lF.kZ_);var SU=(0,b.defineComponent)({name:"PageActivities",components:{TableActivitiesContainer:OL,TheContentbarContainer:vV,ThePageSkeleton:$w,ModalPageSettingsContainer:yR,ModalTableExport:_$,ModalCreateActivity:Gx,ModalDuplicateActivity:rR,ModalMoveActivity:eU,ModalRuleCheckViolations:kU,ModalEditActivity:tB,FeatureNotAvailable:Ew},mixins:[D$("table")],data(){return{filterString:"",hot:null}},computed:{...(0,C.Se)("activities",["loading","selectedActivityIds"]),...(0,C.Se)({activities:"activities/data"}),exportDisabled(){return!this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EXPORT_FIELD)},tableRef(){return this.$refs.table?this.$refs.table.$refs.table:null},tableData(){const e=this.$store.getters["activities/tableDataActivities"];return e},activitiesColumns(){return F$},columns(){if(!this.hot||this.hot.isDestroyed)return null;const{columns:e}=this.hot.getSettings();return e||null},visibleRowsIds(){return this.$refs.table&&this.$refs.table.$refs.table?this.$refs.table.$refs.table.visibleRowsIds:null},allRowsVisible(){return this.tableRef?this.tableRef.allRowsVisible:null},groupedTableDataIds(){return this.tableRef?this.tableRef.groupedTableDataIds:null},dropdownItemsWithSubtableColumnData(){return[{id:qx.PER_ROW_ID,name:this.$t("Eine Zeile pro Maßnahme"),subtableColumnData:void 0},{id:qx.PER_SUBTABLE,name:this.$t("Eine Zeile pro Produkt"),subtableColumnData:"product"},{id:qx.PER_SUBTABLE,name:this.$t("Eine Zeile pro Maschine"),subtableColumnData:"equipment"}]},featureEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_ACTIVITIES)},featureVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_ACTIVITIES)},featureReadonly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_ACTIVITIES)}},methods:{updateHot(e){this.hot=e},onCreateButtonClick(){this.$refs.modalCreateActivity.show()},restoreActivities(){this.$router.push({name:"activities/restore"})},async onShowSettings(){this.$refs.modalPageSettings.show()},async onExportSelected(e){const{exportFiltered:t,okay:i}=await this.$refs.modalTableExport.show();if(!i)return;let a=[];if(t){const t=e.filter((e=>this.visibleRowsIds?.has(e)));a=t}else a=e;this.$refs.modalTableExport.onExportSelected(a)},async onExportData(){const{exportFiltered:e,okay:t}=await this.$refs.modalTableExport.show();if(!t)return;let i=[];i=e?Array.from(this.visibleRowsIds):Array.from(this.groupedTableDataIds),this.$refs.modalTableExport.onExportSelected(i)},async onDuplicateButtonClick(e){const t=await this.$store.dispatch("activities/duplicate",e);this.$refs.modalDuplicateActivity?.show(t)},onEditButtonClick(e){this.$store.dispatch("activities/createEditActivity/setupEditActivityStore",e),this.$refs.modalEditActivity.show()},onMoveButtonClick(){this.$refs.modalMoveActivity.show()},onSelectAll(){this.$refs.table.$refs.table.selectAllVisible(!0)},onDeselectAll(){this.$refs.table.$refs.table.selectAllVisible(!1)},onInvertSelection(){this.$refs.table.$refs.table.invertSelection()}}}),EU=SU,IU=(0,ew.Z)(EU,sF,oF,!1,null,"3c7d7e61",null),_U=IU.exports,DU=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{"scroll-y":2!==i.currentStep},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t(i.TheContentbar,{attrs:{"data-cy":"page-activities-import-content-bar"},scopedSlots:e._u([{key:"left",fn:function(){return[t(i.ButtonDropdown,{directives:[{name:"show",rawName:"v-show",value:2===i.currentStep,expression:"currentStep === 2"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:i.$t("Auswahl aufheben")??"",buttons:i.buttonUpdateSelection},on:{click:function(e){return i.view.tableElement.selectAllVisible(!1)}}}),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:2===i.currentStep,expression:"currentStep === 2"}],attrs:{icon:["far","arrows-rotate"],"leading-icon":"",color:"lightest",title:i.$t("Das manuelle Mapping für Werte dieser Datenquelle wird zurückgesetzt in den Originalzustand.")??"","tooltip-options":{boundary:"viewport"}},on:{click:function(e){return i.resetMapping()}}},[e._v(" "+e._s(i.$t("Mapping zurücksetzen"))+" ")])]},proxy:!0},{key:"middle",fn:function(){return[t(i.Steps,{attrs:{steps:i.steps,current:i.currentStep,"data-cy":"page-activities-import-steps"}})]},proxy:!0},{key:"right",fn:function(){return[t(i.Button,{attrs:{color:"lightest","data-cy":"page-activities-back-button"},on:{click:function(e){return i.goBack()}}},[e._v(" "+e._s(0===i.currentStep?i.$t("Abbrechen"):i.$t("Zurück"))+" ")]),t(i.Button,{attrs:{icon:2!==i.currentStep?["far","arrow-right"]:[],disabled:!i.state.importNextEnabled||!i.isImportButtonEnabled,"data-cy":"page-activities-continue-button",fetching:i.pollingInProgress},on:{click:function(e){2!==i.currentStep?i.goNext():i.startImport()}}},[e._v(" "+e._s(2!==i.currentStep?i.$t("Weiter"):i.$t("Importieren"))+" ")])]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[t("RouterView",{ref:"view"})]},proxy:!0}])})},MU=[];const PU=Gb.translate;function TU(e){const t=e.map((e=>({activityTypeId:e.activityTypeId??"",completed:!1,inspectionConducted:!1,id:e.id,isCopy:!1,processOrderId:e.processOrderId??"",tstamp:da(Date.now()),creationDate:da(Date.now()),drivingTime:e.drivingTime,fieldId:e.fieldId,pauseTime:e.pauseTime,processedArea:e.processedArea,setupTime:e.setupTime,workingTime:e.workingTime,processingState:null,timeFinish:e.timeFinish,timeStart:e.timeStart,userId:e.userId,trackId:null,userComment:`${e.userComment??""} (${PU("importiert")} @ ${(new Date).toLocaleDateString()})`,workingWidth:e.workingWidth,equipment:e.equipment.map((e=>BU(e))),products:e.products.map((e=>xU(e))),files:[]})));return t}function xU(e){const t={id:e.id,productId:e.productId??"",tstamp:da(Date.now()),amount:e.amount,deleted:null,pesticideIndicationId:null,pestId:null,unitId:e.unitId,storagePlaceId:null};return t}function BU(e){const t={id:ma(),equipmentId:e.equipmentId??"",tstamp:da(Date.now()),deleted:null};return t}var OU=function(){var e=this,t=e._self._c;return t("div",{staticClass:"steps"},e._l(e.steps,(function(i,a){return t("div",{key:`step-${a}`,staticClass:"steps__step",class:{"steps__step--active":e.current>=a}},[t("div",{staticClass:"steps__ellipse",class:{"steps__ellipse--active":e.current>=a}},[e._v(" "+e._s(i.number)+" ")]),t("span",{staticClass:"steps__step-label",class:{"steps__step-label--active":e.current>=a}},[e._v(" "+e._s(i.label)+" ")])])})),0)},$U=[],RU={name:"Steps",props:{current:{type:Number,required:!0},steps:{type:Array,required:!0}}},NU=RU,zU=(0,ew.Z)(NU,OU,$U,!1,null,"38608ff0",null),LU=zU.exports;function VU(){let e;function t(t,i="danger"){e&&e.proxy.$bvToast.toast(t,{title:"Warning",variant:i})}return(0,b.onBeforeMount)((()=>{e=(0,b.getCurrentInstance)()})),{toast:t}}const UU=(0,b.ref)(!1),jU=(0,b.ref)(0),HU=(0,b.ref)(),GU=(0,b.ref)(null);function WU(){const e=3e3,{activityImportApi:t}=b["default"].prototype.$api;function i(){UU.value=!0,jU.value=0,GU.value=null,setTimeout((()=>n()),3e3)}function a(){UU.value=!1}async function n(){if(UU.value)try{const t=await s();HU.value=t.data.data?.status??"Error",jU.value=t.data.data?.progressPercent??1,"Pending"===t.data.data?.status?setTimeout((()=>n()),e):"Error"===t.data.data?.status&&(GU.value=t.data.data?.errorUserMessage??"An error occured",jU.value=0,UU.value=!1,a())}catch(t){console.error(t)}}function r(){const e={activityImportResetRequest:{source:"CnhDownload"}};return t.activityImportReset(e)}function s(){const e={source:"CnhDownload"};return t.activityImportStatus(e)}return{startPollingImportStatus:i,stopPollingImportStatus:a,resetImport:r,cnhImportStatus:s,importProgress:jU,pollingInProgress:UU,importStatus:HU,importErrorMessage:GU}}const ZU=(0,b.ref)(),KU=(0,b.ref)([]),qU=(0,b.ref)([]),YU=(0,b.ref)(!1),JU=(0,b.ref)(""),XU=(0,b.ref)("");function QU(){const{cnhApi:e}=b["default"].prototype.$api,t=(0,NL.tv)();function i(){return e.interfacesCnhConnectionStatus()}function a(t){const i={interfacesCnhLoginRequest:{authorizationCode:t,redirectUrl:`${origin}${M}oauth/cnh`}};return e.interfacesCnhLogin(i)}function n(){return e.interfacesCnhLogout()}async function r(){return e.interfacesCnhOverview()}async function s(){if(ZU.value){const t={companyId:ZU.value},i=await e.interfacesCnhTasks(t);KU.value=i.data.data??[]}}async function o(t){if(ZU.value){const i={interfacesCnhDownloadTasksRequest:{taskIds:t,companyId:ZU.value}};return e.interfacesCnhDownloadTasks(i)}return Promise.reject()}function l(e){switch(e.response?.data.errorCode){case"externalApiAuthorization":t.push({name:"activities/import/choose-method"});break;default:t.push({name:"activities/import/choose-method"}),console.error(e)}}return{cnhCompanyTasks:KU,cnhImportDataLoading:YU,cnhCompanyId:ZU,cnhCompanyTasksFiltered:qU,cnhEmail:JU,cnhUserName:XU,getCnhConnectionStatus:i,cnhLogin:a,cnhLogout:n,getCnhCompanyOverview:r,getCnhCompanyTasks:s,postCnhDownloadTasks:o,cnhErrorResponseHandler:l}}const ej=(0,b.reactive)({importMethodPath:null,importNextEnabled:!0,selectedUploadFile:"",cnhModalVisible:!1,isFetching:!1}),tj="load-data/cnh";function ij(){const e=(0,NL.yj)(),t=(0,NL.tv)(),{getCnhConnectionStatus:i,postCnhDownloadTasks:a,cnhCompanyTasksFiltered:n,cnhUserName:r,cnhEmail:s}=QU(),{startPollingImportStatus:o,resetImport:l,cnhImportStatus:d}=WU();(0,b.onMounted)((()=>{c.value>0&&!ej.importMethodPath&&"activities/import/choose-method"!==e.name&&t.push({name:"activities/import/choose-method"})}));const c=(0,b.computed)((()=>e.meta?.step??0));function u(){0===c.value?t.push({name:"activities"}):1===c.value?t.push({name:"activities/import/choose-method"}):2===c.value?t.push({path:ej.importMethodPath??tj}):t.push({name:"activities/import/choose-method"})}async function p(){if(ej.importMethodPath)if(0===c.value&&"load-data/cnh"===ej.importMethodPath){const{data:e}=await i();e.data?.loggedIn?(s.value=e.data?.email??"",r.value=e.data?.userName??"",t.push({path:ej.importMethodPath})):ej.cnhModalVisible=!0}else if(1===c.value&&"load-data/cnh"===ej.importMethodPath){const e=await l();h(e.data)}else 1===c.value&&"load-data/upload"===ej.importMethodPath?t.push({name:"activities/import/import-table"}):t.push({path:ej.importMethodPath});else t.push({name:"activities/import/choose-method"})}function h(e){"Canceling"===e.data?.status?setTimeout((async()=>{const e=await d();h(e.data)}),2e3):n.value.length>0&&(a(n.value.map((e=>e.taskId))),o())}return{state:ej,currentStep:c,goBack:u,goNext:p}}var aj=(0,b.defineComponent)({__name:"PageActivitiesImport",setup(e){ow.vI.add(lw.T80);const{activityImportApi:t}=b["default"].prototype.$api,i=Gb.translate,{state:a,currentStep:n,goBack:r,goNext:s}=ij(),{pollingInProgress:o,resetImport:l}=WU(),d=(0,NL.tv)(),{toast:c}=VU(),u=[{number:1,label:i("Datenquelle")},{number:2,label:i("Daten laden")},{number:3,label:i("Vorschau")}],p=[{text:i("Auswahl aufheben"),handler:()=>h.value.tableElement.selectAllVisible(!1)},{text:i("Auswahl umkehren"),handler:()=>h.value.tableElement.invertSelection()}
1,{text:i("Alle auswählen"),handler:()=>h.value.tableElement.selectAllVisible(!0)}],h=(0,b.ref)(),m=(0,b.computed)((()=>{const e=Lb.getters["activities/importActivities/selectedImportActivityIds"];return 2!==n.value||e.length>0&&y(e)}));async function f(){const e=await b["default"].prototype.$confirm({okTitle:i("Zurücksetzen")??"Zurücksetzen",okVariant:"danger"});if(!e)return;const a=Lb.state.auth.currentCompanies?.[0]?.id;await t.activityImportResetMappings({activityImportResetMappingsRequest:{companyId:a}}),Lb.dispatch("activities/importActivities/subscribe",{forceRefresh:!0})}function g(){Object.values(Lb.state.activities.importActivities.data).forEach((e=>{Lb.commit("activities/importActivities/removeImportActivity",e.id)})),l()}function y(e){return e.every((e=>Lb.getters["activities/importActivities/isImportActivityValid"](e)))}async function v(){const{importActivities:e}=Lb.state.activities,t=Lb.getters["activities/importActivities/tableDataImportActivities"],a=Object.values(e.data).filter((e=>t.find((t=>
1t.id===e.id))?.select));if(!y(a.map((e=>e.id))))throw new Error("There are invalid import activities selected.");const n=TU(a);if(n.length>0){await n.forEach((e=>Lb.dispatch("activities/insertNewEntry",{entry:e}))),await Lb.dispatch("activities/syncAll");const{errors:e}=Lb.state.activities;g(),await d.push({name:"activities"}),n.forEach((t=>{const a=e.find((e=>e.guid===t.id));a?c(i("Aktivität konnte nicht importiert werden. Fehler: ")+a.errorUserMessage,"warning"):Lb.commit("activities/addOrUpdateTableDataMetadataByKeyAndValue",{activityId:t.id,key:"select",value:!0})}))}}return{__sfc:!0,activityImportApi:t,$t:i,state:a,currentStep:n,goBack:r,goNext:s,pollingInProgress:o,resetImport:l,router:d,toast:c,steps:u,buttonUpdateSelection:p,view:h,isImportButtonEnabled:m,resetMapping:f,removeImportActivitiesAndReset:g,selectedImportActivitiesValid:y,startImport:v,TheContentbar:HL,ThePageSkeleton:$w,Steps:LU,Button:gw,ButtonDropdown:mV}}}),nj=aj,rj=(0,ew.Z)(nj,DU,MU,!1,null,null,null),sj=rj.exports,oj=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"mr-1",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("BButton",{staticClass:"text-dark mr-1 px-4",attrs:{variant:"lightest"},on:{click:e.back}},[e._v(" "+e._s(e.$t("Schließen"))+" ")]),t("BButton",{staticClass:"mr-1 px-4",attrs:{variant:"primary",fetching:e.restoring},on:{click:e.restore}},[e._v(" "+e._s(e.$t("Wiederherstellen"))+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableActivitiesRestoreContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}})]},proxy:!0}])})},lj=[],dj=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e._v("NOT IMPLEMENTED")])},cj=[],uj=i(94633),pj=i.n(uj),hj=pj(),mj=(0,ew.Z)(hj,dj,cj,!1,null,null,null),fj=mj.exports,gj={name:"PageActivitiesRestore",components:{TheContentbar:HL,ThePageSkeleton:$w,SearchBar:YE,TableActivitiesRestoreContainer:fj},data(){return{filterString:"",selectedRows:[],visibleRows:[],restoring:!1}},methods:{back(){this.$router.push({name:"activities"})},async restore(){this.restoring=!0;const e=await this.$refs.table.restore();this.restoring=!1,e&&this.back()}}},yj=gj,vj=(0,ew.Z)(yj,oj,lj,!1,null,null,null),bj=vj.exports,wj=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"import-choose-method"},[t(i.MaxWidthContainer,{attrs:{size:"xl"}},[t("div",{staticClass:"import-intro"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(i.$t("Wie möchtest du importieren?")))]),t("p",[e._v(e._s(i.$t("Bitte wähle eine Option und klicke auf Weiter.")))])]),t("div",[t(i.FormFieldRadioGroup,{attrs:{variant:"no-label","inner-container-class":"d-flex",checked:i.state.importMethodPath,stacked:!1},on:{input:e=>i.setImportMethodSource(e)}},[t("div",[t(i.FormRadio,{attrs:{variant:"card",value:"load-data/cnh","data-cy":"activities-import-method-radio-cnh"},scopedSlots:e._u([{key:"image",fn:function(){return[t("img",{attrs:{alt:"CNS logo",src:i.imgLogoCns,width:"78"}})]},proxy:!0},{key:"default",fn:function(){return[e._v(" "+e._s(i.$t("CNH CONNECT Plattform"))+" ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(i.$t("Maßnahmen aus AFS Connect, S-Fleet und PLMConnect importieren"))+" ")]},proxy:!0}])}),t(i.ButtonLink,{staticClass:"more-link",attrs:{href:"https://www.farmdok.com/2023/12/11/automatisch-aufzeichnen-mit-s-fleet-afs-connect-und-plm-connect-von-cnh-industrial",target:"_blank"}},[e._v(" "+e._s(i.$t("Mehr erfahren"))+"... ")])],1),t("div",[t(i.FormRadio,{attrs:{variant:"card",value:"load-data/upload","data-cy":"activities-import-method-radio-upload"},scopedSlots:e._u([{key:"image",fn:function(){return[t("FontAwesomeIcon",{staticClass:"text-black",attrs:{icon:"cloud-upload",size:"3x"}})]},proxy:!0},{key:"default",fn:function(){return[t("span",{staticClass:"d-block mt-4"},[e._v(" "+e._s(i.$t("Datei hochladen"))+" ")])]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(i.$t("Maßnahmen mit ISOXML Taskdata importieren"))+" ")]},proxy:!0}])}),t(i.ButtonLink,{staticClass:"more-link",attrs:{href:"https://www.farmdok.com/2023/11/16/automatisch-aufzeichnen-mit-ihrem-isobus-display",target:"_blank"}},[e._v(" "+e._s(i.$t("Mehr erfahren"))+"... ")])],1)]),t(i.Button,{staticClass:"float-right mr-3",attrs:{icon:["far","arrow-right"],"data-cy":"activities-import-method-continue-button"},on:{click:function(e){return i.goNext()}}},[e._v(" "+e._s(i.$t("Weiter"))+" ")])],1)]),i.state.cnhModalVisible?t(i.LoginCnh,{attrs:{visible:i.state.cnhModalVisible},on:{change:e=>i.state.cnhModalVisible=e}}
1):e._e()],1)},Cj=[],Fj=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ModalWrapper,{ref:"modal",staticClass:"modal-cnh-login",attrs:{size:"xl",visible:e.visible,hideCustomHeader:!0,noOkButton:!0},on:{change:t=>e.$emit("change",t)}},[t(i.ExternalAuthenticationLayout,{staticClass:"layout-cnh-login",attrs:{title:i.$t("Verbindung zu CNH Industrial"),cardHeader:i.$t("Ihre Organisation auf MyPLM® Connect, AFS Connect oder S-FLEET")},scopedSlots:e._u([{key:"body",fn:function(){return[t("div",{staticStyle:{"margin-bottom":"3rem"}},[e._v(" "+e._s(i.$t("Mit Farmdok können Sie die Dokumentation der durchgeführten Feldarbeiten direkt von der CNH-Plattform laden und automatisch Maßnahmen in Farmdok erstellen. Alles, was du dazu brauchst, ist ein Account bei New Holland MyPLM® Connect, Case AFS Connect oder STEYR S-FLEET und ein geeingetes ISOBUS Display auf deinem Traktor."))+" ")]),t("BButton",{attrs:{variant:"primary"},on:{click:i.login}},[e._v(e._s(i.$t("Login mit CNH Platformen")))])]},proxy:!0},{key:"right",fn:function(){return[t(i.CnhImage)]},proxy:!0}])})],1)},Aj=[],kj=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"auth-layout-container"},[t("div",{staticClass:"content-left"},[t("h2",{staticClass:"title"},[e._v(e._s(e.title))]),t("div",{staticClass:"auth-layout-header"},[e._v(e._s(e.cardHeader))]),t("div",{staticClass:"auth-layout-body"},[e._t("body")],2)]),e._t("right")],2)},Sj=[],Ej=(0,b.defineComponent)({__name:"ExternalAuthenticationLayout",props:{title:null,cardHeader:null},setup(e){return{__sfc:!0}}}),Ij=Ej,_j=(0,ew.Z)(Ij,kj,Sj,!1,null,"424375fe",null),Dj=_j.exports,Mj=function(){var e=this;e._self._c;return e._m(0)},Pj=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"images-wrapper"},[t("div",{staticClass:"logos"},[t("img",{attrs:{src:i(2341),alt:"traktor",width:"135",height:"39"}}),t("img",{attrs:{src:i(95532),alt:"traktor",width:"135",height:"39"}}),t("img",{attrs:{src:i(66184),alt:"traktor",width:"135",height:"39"}})]),t("img",{attrs:{src:i(28206),alt:"traktor",width:"554",height:"195"}})])}],Tj={},xj=(0,ew.Z)(Tj,Mj,Pj,!1,null,"67ad733f",null),Bj=xj.exports,Oj=(0,b.defineComponent)({__name:"LoginCnh",props:{visible:{type:Boolean,default:!0}},setup(e){const t=Gb.translate;function i(){const e=Math.floor(1e5+9e5*Math.random());localStorage.setItem(re,e.toString());const t={client_id:"n9PzW2YVx2ru9n8UCQ4LPq3PVJUYnqDk",response_type:"code",redirect_uri:`${origin}${M}oauth/cnh`,scope:"offline_access",connection:"PROD-ADFS-CONN",state:e,audience:"https://ag.api.cnhind.com"};window.open(`https://identity.cnhind.com/authorize?client_id=${t.client_id}&response_type=${t.response_type}&redirect_uri=${t.redirect_uri}&scope=${t.scope}&connection=${t.connection}&state=${t.state}&audience=${t.audience}`)}return{__sfc:!0,$t:t,login:i,ExternalAuthenticationLayout:Dj,CnhImage:Bj,ModalWrapper:OC}}}),$j=Oj,Rj=(0,ew.Z)($j,Fj,Aj,!1,null,"870575f0",null),Nj=Rj.exports,zj=i(81547),Lj=(0,b.defineComponent)({__name:"ImportChooseMethod",setup(e){const t=Gb.translate,{state:i,goNext:a}=ij();function n(e){i.importMethodPath=e,"load-data/cnh"===e&&Lb.commit("activities/importActivities/updateActivityImportMapDataRequestParameters",{source:"CnhDownload"}),"load-data/upload"===e&&Lb.commit("activities/importActivities/updateActivityImportMapDataRequestParameters",{source:"UserUpload"}),i.selectedUploadFile=""}return(0,b.onMounted)((()=>{i.importNextEnabled=!0})),{__sfc:!0,$t:t,state:i,goNext:a,setImportMethodSource:n,LoginCnh:Nj,MaxWidthContainer:Tw,Button:gw,ButtonLink:Fw,FormFieldRadioGroup:_T,FormRadio:kT,imgLogoCns:zj}}}),Vj=Lj,Uj=(0,ew.Z)(Vj,wj,Cj,!1,null,"49d634da",null),jj=Uj.exports,Hj=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"cnh-load-data"},[t("div",[t(i.ImportLoadDataCnhFilterForm),i.pollingInProgress?t("div",{staticClass:"progress-wrapper"},[t("span",[t("i",[e._v(e._s(i.$t("Daten werden importiert...")))])]),t(i.BProgress,{staticClass:"progress",attrs:{value:i.importProgress,max:100,"show-progress":"",animated:""}}
1)],1):e._e(),i.importErrorMessage?t("div",{staticClass:"error-message-wrapper"},[t("span",[e._v(e._s(i.$t(i.importErrorMessage)))])]):e._e(),t(i.Button,{staticClass:"float-right",attrs:{icon:["far","arrow-right"],"data-cy":"activities-import-method-continue-button",fetching:i.pollingInProgress},on:{click:function(e){return i.goNext()}}},[e._v(" "+e._s(i.$t("Weiter"))+" ")])],1)])},Gj=[],Wj=i(45752),Zj=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"import-cnh-wrapper"},[t("h3",{staticClass:"page-header"},[e._v(e._s(i.$t("Daten laden")))]),t("div",{staticClass:"text-align-center"},[e._v(" "+e._s(i.$t("Du bist derzeit bei CNH-Industrial als {userEmail} eingeloggt. Wenn du mehr als ein Unternehmen, eine Landwirtschaft oder einen Betrieb hast, wähle bitte aus.",{userEmail:i.cnhEmail}))+" ")]),t("div",{staticClass:"button-links"},[t(i.ButtonLink,{staticClass:"button-link",attrs:{icon:["far","arrow-right"]},on:{click:i.openCnhBrandPortal}},[e._v(e._s(i.$t("Plattform öffnen")))]),t(i.ButtonLink,{staticClass:"button-link",attrs:{icon:["far","xmark"]},on:{click:i.disconnectCnh}},[e._v(e._s(i.$t("Verbindung trennen")))])],1),i.loading?t("div",[t(i.Loading)],1):t("div",{staticClass:"filter-form"},[t(i.FormFieldDropdown,{staticClass:"filter-field",attrs:{label:"Grower",value:i.growerValue,items:i.growerDropdownItems,"items-loading":i.loading,disabled:i.cnhImportDataLoading,disableDelete:!0},on:{update:e=>i.setGrowerValue(e)}}),t(i.FormFieldDropdown,{staticClass:"filter-field",attrs:{label:"Farm",value:i.farmValue,items:i.farmDropdownItems,"items-loading":i.loading,disabled:i.cnhImportDataLoading,disableDelete:!0},on:{update:e=>i.setFarmValue(e)}}),t(i.FormFieldDropdown,{staticClass:"filter-field",attrs:{label:"Field",value:i.fieldValue,items:i.fieldDropdownItems,"items-loading":i.loading,disabled:i.cnhImportDataLoading,disableDelete:!0},on:{update:e=>i.setFieldValue(e)}}),t(i.FormFieldDatepicker,{staticClass:"filter-field",attrs:{label:"Start date from",selectedDate:i.fromDate,disabled:i.cnhImportDataLoading},on:{setSelectedDate:e=>i.fromDate=e}}),t(i.FormFieldDatepicker,{staticClass:"filter-field",attrs:{label:"Start date until",selectedDate:i.toDate,disabled:i.cnhImportDataLoading},on:{setSelectedDate:e=>i.toDate=e}}),t("div",{staticClass:"text-align-left"},[e._v(" "+e._s(i.$t("Anzahl der Tasks auf der CNH-Plattform:"))+" "),t("b",[e._v(e._s(i.cnhCompanyTasksFiltered.length))])])],1)])},Kj=[],qj=(0,b.defineComponent)({__name:"ImportLoadDataCnhFilterForm",setup(e){const t=Gb.translate,i=(0,NL.tv)(),{cnhCompanyTasks:a,cnhLogout:n,getCnhCompanyOverview:r,getCnhCompanyTasks:s,cnhErrorResponseHandler:o,cnhImportDataLoading:l,cnhCompanyId:d,cnhCompanyTasksFiltered:c,cnhEmail:u}=QU(),p=new Date,h=new Date;h.setMonth(p.getMonth()-1);const m=(0,b.ref)(null),f=(0,b.ref)(),g=(0,b.ref)(),y=(0,b.ref)(),v=(0,b.ref)({id:"0",name:""}),w=(0,b.ref)({id:"0",name:""}),C=(0,b.ref)({id:"0",name:""}),F=(0,b.ref)(!0),A=(0,b.ref)(h),k=(0,b.ref)(p),S=(0,b.computed)((()=>D(m.value,"growers"))),E=(0,b.computed)((()=>{const e=D(f.value,"farms");return P(e[0].items,t("Alle Farmen")??"All farms"),e})),I=(0,b.computed)((()=>{const e=[];let i=[];return g.value?i=D(g.value,"fields"):(f.value?.farms.forEach((t=>{e.push(...t.fields)})),i=M(e)),P(i[0].items,t("Alle Felder")??"All fields"),i}));function _(){const e=[];y.value?e.push(y.value.id):g.value?e.push(...g.value.fields.map((e=>e.id))):f.value?.farms.forEach((t=>{e.push(...t.fields.map((e=>e.id)))}));const t=a.value.filter((t=>e.includes(t.fieldId)&&new Date(1e3*t.startTime)>=A.value&&new Date(1e3*t.endTime)<=k.value));c.value=t}function D(e,t){if(!e)return[];const i=[{id:"0",items:e[t].map((e=>({id:e.id,name:e.name}))),sort:!1}];return i}function M(e){if(!e)return[];const t=[{id:"all",items:e.map((e=>({id:e.id,name:e.name}))),sort:!1}];return t}function P(e,t){return e.unshift({id:"all",name:t})}function T(){window.open(se,"_blank","noopener noreferrer")}function x(e){f.value=m.value?.growers.find((t=>t.id===e.id)),v.value=e,$()}function B(e){g.value=f.value?.farms.find((t=>t.id===e.id)),w.value=e,y.value=null,[C.value]=I.value[0].items}function O(e){if("all"===e.id)return void(y.value=null);const t=f.value?.farms.find((t=>t.fields.find((t=>t.id===e.id))));t&&(y.value=t.fields.find((t=>t.id===e.id))),C.value=e}function $(){[w.value]=E.value[0].items,[C.value]=I.value[0].items,g.value=null,y.value=null}async function R(){try{const e=await r();if(200===e.status){m.value=e.data.data?.company??null;const t=m.value?.id;d.value=t,await s(),F.value=!1,m.value&&(f.value=m.value?.growers[0],[v.value]=S.value[0].items,$())}}catch(e){o(e)}}async function N(){try{const e=await n();200===e.status&&i.push({name:"activities/import/choose-method"})}catch(e){o(e)}}return(0,b.watch)([f,g,y,A,k],(()=>{_()})),(0,b.onMounted)((()=>{setTimeout(R,500)})),{__sfc:!0,$t:t,router:i,cnhCompanyTasks:a,cnhLogout:n,getCnhCompanyOverview:r,getCnhCompanyTasks:s,cnhErrorResponseHandler:o,cnhImportDataLoading:l,cnhCompanyId:d,cnhCompanyTasksFiltered:c,cnhEmail:u,today:p,todayMinusOneMonth:h,companyTree:m,currentGrowerObject:f,currentFarmObject:g,currentFieldObject:y,growerValue:v,farmValue:w,fieldValue:C,loading:F,fromDate:A,toDate:k,growerDropdownItems:S,farmDropdownItems:E,fieldDropdownItems:I,filterTasks:_,dropdownItems:D,dropdownItemsFromArray:M,addAllItem:P,openCnhBrandPortal:T,setGrowerValue:x,setFarmValue:B,setFieldValue:O,setDefaultValues:$,loadCnhData:R,disconnectCnh:N,Loading:z$,ButtonLink:Fw,FormFieldDatepicker:g_,FormFieldDropdown:lk}}}),Yj=qj,Jj=(0,ew.Z)(Yj,Zj,Kj,!1,null,"379fd02a",null),Xj=Jj.exports,Qj=(0,b.defineComponent)({__name:"ImportLoadDataCnh",setup(e){const t=Gb.translate,i=(0,NL.yj)(),a=(0,NL.tv)(),{goNext:n}=ij(),{cnhLogin:r,cnhErrorResponseHandler:s}
1=QU(),{pollingInProgress:o,importProgress:l,stopPollingImportStatus:d,cnhImportStatus:c,resetImport:u,startPollingImportStatus:p,importStatus:h,importErrorMessage:m}=WU();function f(){return localStorage.getItem(re)===i.query.state}async function g(){try{const e=await c();"Pending"===e.data.data?.status?p():u()}catch(e){console.error(e)}}return(0,b.watch)(h,(e=>{"Ready"!==e&&"PartialError"!==e||setTimeout((()=>a.push({name:"activities/import/import-table"})),1e3)})),(0,b.onMounted)((async()=>{const e=i.query.code,{state:t}=i.query;if(e&&t)if(f())try{const t=await r(e);200===t.status&&localStorage.removeItem(re)}catch(n){s(n)}else console.error("state is not correct"),a.push({name:"activities-import"});g()})),(0,b.onUnmounted)((()=>{d()})),{__sfc:!0,$t:t,route:i,router:a,goNext:n,cnhLogin:r,cnhErrorResponseHandler:s,pollingInProgress:o,importProgress:l,stopPollingImportStatus:d,cnhImportStatus:c,resetImport:u,startPollingImportStatus:p,importStatus:h,importErrorMessage:m,isCorrectState:f,checkImportStatus:g,BProgress:Wj.D,Button:gw,ImportLoadDataCnhFilterForm:Xj}}}),eH=Qj,tH=(0,ew.Z)(eH,Hj,Gj,!1,null,"4ad29d7a",null),iH=tH.exports,aH=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.MaxWidthContainer,{attrs:{size:"xl"}},[t("div",{staticClass:"import-intro",attrs:{"data-cy":"activities-upload-intro"}},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(i.$t("Datei hochladen")))]),t("p",[e._v(" "+e._s(i.$t("Anleitung: Woher bekomme ich eine ISOXML Datei mit meinen Maßnahmen?"))+" "),t(i.ButtonLink,{on:{click:function(e){i.infoModalVisible=!0}}},[e._v(" "+e._s(i.$t("Klicke hier für mehr Infos ..."))+" ")])],1)]),t(i.FileUploadTile,{attrs:{successfulFiles:i.successfulFiles,failedFiles:i.failedFiles,required:!0,accept:["application/xml","text/xml",".isoxml","application/zip"],hint:i.$t("Es können Dateien im Format ISOXML Taskdata importiert werden."),actionLabel:i.$t("Weiter"),validators:[i.filenameContainsTaskdata],preselect:!0},on:{"update:fileSelection":i.upload,"click:fileSelection":i.setUploadFile,"reset:fileSelection":i.reset,action:i.goNext}}),t(i.ErrorUserMessage,{staticClass:"mt-3",attrs:{"error-user-message":i.userErrorMessage}})],1)},nH=[],rH=function(){var e=this,t=e._self._c;return null!=e.errorUserMessageInternal||null!=e.errorsFromResponseData?t("div",{staticClass:"error-user-message text-danger"},[e._l(e.errorUserMessageInternal,(function(i,a){return t("div",{key:`errorUserMessage-errorUserMessageInternal-${i}-${a}`,staticClass:"error-user-message__error-line",class:{centerText:e.centerText}},[e._v(" "+e._s(i)+" ")])})),null!=e.outerErrorUserMessage?t("div",{staticClass:"mb-2"},e._l(e.outerErrorUserMessage,(function(i,a){return t("div",{key:`errorUserMessage-singleOuterErrorUserMessage-${i}-${a}`},[e._v(" "+e._s(i)+" ")])})),0):e._e(),e._l(e.errorsFromResponseData,(function(i,a){return t("div",{key:`errorUserMessage-errorsFromResponseData-${i.errorUserMessage[0]}-${a}`,staticClass:"mb-1"},[e._l(i.errorUserMessage,(function(i,a){return t("div",{key:`errorUserMessage-singleErrorUserMessage-${i}-${a}`,staticClass:"font-weight-bold"},[e._v(" "+e._s(i)+" ")])})),e._l(i.errorAttributeUserMessages,(function(i,a){return t("div",{key:`errorUserMessage-errorAttributeUserMessage-${i}-${a}`},[e._v(" "+e._s(i)+" ")])}))],2)}))],2):e._e()},sH=[],oH={name:"ErrorUserMessage",props:{errorUserMessage:{type:[String,Array],validator(e){return null==e||"string"===typeof e||!!Array.isArray(e)&&e.every((e=>"string"===typeof e))}},responseData:{type:Object,default:null},veeValidateErrors:{type:Object,default:null},showFirstOnly:{type:Boolean,default:!1},centerText:{type:Boolean,default:!1}},computed:{messagesVeeValidate(){return null==this.veeValidateErrors?[]:Object.values(this.veeValidateErrors).reduce(((e,t)=>[...e,...t]),[])},errorUserMessageInternal(){let e=this.messagesVeeValidate;return"string"===typeof this.errorUserMessage&&this.errorUserMessage.length>0?e=[...e,this.errorUserMessage]:Array.isArray(this.errorUserMessage)&&(e=[...e,...this.errorUserMessage.filter((e=>"string"===typeof e&&e.length>
10))]),0===e.length?null:this.showFirstOnly?e.slice(0,1):e},errorsFromResponseData(){return null==this.responseData?null:"error"===this.responseData.status?[{errorUserMessage:this.responseData.errorUserMessage,errorAttributeUserMessages:this.convertErrorAttributeUserMessagesToArray(this.responseData.errorAttributeUserMessages)}]:"partialSuccess"===this.responseData.status?Object.values(this.responseData.errors).map((e=>({errorUserMessage:e.errorUserMessage,errorAttributeUserMessages:this.convertErrorAttributeUserMessagesToArray(e.errorAttributeUserMessages)}))):null},outerErrorUserMessage(){return null==this.responseData||"partialSuccess"!==this.responseData.status?null:this.responseData.errorUserMessage}},methods:{convertErrorAttributeUserMessagesToArray(e){return null==e?[]:Object.keys(e).reduce(((t,i)=>[...t,`"${i}": ${e[i].join(", ")}`]),[])}}},lH=oH,dH=(0,ew.Z)(lH,rH,sH,!1,null,"29a23b69",null),cH=dH.exports,uH=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"w-100"},[t("form",{staticClass:"import-form",class:{"is-dragover":i.isDragover},attrs:{method:"post",action:"",enctype:"multipart/form-data"},on:{drag:function(e){e.preventDefault()},dragstart:function(e){e.preventDefault()},dragend:function(e){e.preventDefault(),i.isDragover=!1},dragover:function(e){e.preventDefault(),i.isDragover=!0},dragenter:function(e){e.preventDefault(),i.isDragover=!0},dragleave:function(e){e.preventDefault(),i.isDragover=!1},drop:function(e){return e.preventDefault(),i.onFileDrop.apply(null,arguments)}}},[t("label",{staticClass:"position-absolute"},[t("input",{ref:"fileInput",staticClass:"import-file-input",attrs:{type:"file",name:"file[]",accept:e.accept.join(", "),multiple:"","data-cy":"activities-upload-input-file"},on:{change:i.updateSelection}}),t("input",{ref:"directoryInput",staticClass:"import-file-input",attrs:{type:"file",name:"file[]",multiple:"","data-cy":"activities-upload-input-file",directory:"",webkitdirectory:"",mozdirectory:""},on:{change:i.updateSelection}})]),i.selectedFiles.length?[t("ul",{staticClass:"selected-files-list",attrs:{"data-cy":"activities-upload-files-list"}},[e._l(i.unsupportedFiles,(function(i,a){return t("li",{key:`${i.name}-${a}`,staticClass:"d-flex justify-content-between file-item"},[t("span",{staticClass:"font-weight-bold"},[e._v(" "+e._s(i.name)+" ")]),t("FontAwesomeIcon",{staticClass:"h1 text-danger",attrs:{icon:["far","circle-exclamation"]}})],1)})),e._l(i.selectedFiles,(function(a,n){return t("li",{key:n,staticClass:"d-flex justify-content-between file-item",class:{"is-selected":i.clickedFiles.includes(a)},on:{click:()=>i.updateClickedFiles(a)}},[t("span",{staticClass:"font-weight-bold"},[e._v(" "+e._s(a.name)+" ")]),e.progress||i.successfulFileNames.includes(a.name)?e._e():t("FontAwesomeIcon",{staticClass:"h1 text-primary",attrs:{icon:["far","circle-dashed"]}}),e.progress&&!i.successfulFileNames.includes(a.name)?t("BSpinner",{attrs:{type:"border",variant:"primary",small:""}}):e._e(),i.successfulFileNames.includes(a.name)?t("FontAwesomeIcon",{staticClass:"h1 text-primary",attrs:{icon:["far","check-circle"]}}):e._e(),e.failedFiles.includes(a)?t("FontAwesomeIcon",{staticClass:"h1 text-danger",attrs:{icon:["far","circle-exclamation"]}}):e._e()],1)}))],2),t("div",{staticClass:"action-buttons-container"},[t("span",{staticClass:"cursor-pointer",on:{click:function(e){i.fileInput?.click()}}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"cloud-upload"}}),e._v(" "+e._s(i.$t("Weitere Dateien durch Ablegen hinzufügen"))+" ")],1),t("div",[e.progress?e._e():t(i.Button,{attrs:{outline:"",disabled:!!e.progress,"data-cy":"activities-upload-files-reset"},on:{click:i.resetSelection}},[e._v(" "+e._s(i.$t("Alle Dateien entfernen"))+" ")]),e.progress?t(i.Button,{attrs:{outline:"","data-cy":"activities-upload-files-reset"},on:{click:i.abortPressed}},[e._v(" "+e._s(i.$t("Abort"))+" ")]):e._e(),t(i.Button,{attrs:{disabled:!!e.progress||i.selectedFiles===e.successfulFiles||i.buttonDisabled,fetching:!!e.progress},on:{click:i.actionPressed}},[e._v(" "+e._s(e.actionLabel)+" ")])],1)]),e.progress?t("BProgress",{attrs:{max:100*i.selectedFiles.length,value:e.progress??0,variant:"primary",height:".8em",showProgress:""}}
1):e._e()]:t("div",{staticClass:"empty-box",attrs:{"data-cy":"activities-upload-call-to-action"}},[t("FontAwesomeIcon",{staticClass:"mb-3",attrs:{icon:"cloud-upload",size:"3x"}}),t("span",{staticClass:"label-text-one"},[e._v(e._s(i.$t("ZIEHE DIE DATEI HIER HER")))]),t("span",[e._v(" "+e._s(i.labelUploadInfoParts[0])+" "),t(i.ButtonLink,{on:{click:()=>i.fileInput?.click()}},[e._v(" "+e._s(i.labelUploadInfoParts[1])+" ")]),e._v(" "+e._s(i.labelUploadInfoParts[2])+" "),t(i.ButtonLink,{on:{click:()=>i.directoryInput?.click()}},[e._v(" "+e._s(i.labelUploadInfoParts[3])+" ")]),e._v(" "+e._s(i.labelUploadInfoParts[4])+" ")],1),t("span",{staticClass:"mt-3 text-small"},[e._v(e._s(e.hint))])],1)],2),e._l(i.errorMessages,(function(e){return t(i.ErrorUserMessage,{key:e,staticClass:"mt-3",attrs:{errorUserMessage:e}})})),e.failedFiles.length?t(i.ErrorUserMessage,{staticClass:"mt-3",attrs:{errorUserMessage:`${i.$t("Es konnten nicht alle Dateien hochgeladen werden")}!`}}):e._e()],2)},pH=[];function hH(e,t,i,a){if(a){const n=i.map((e=>e[a])).filter(hH);return n.indexOf(e[a])===t}return i.indexOf(e)===t}var mH=(0,b.defineComponent)({__name:"FileUploadTile",props:{successfulFiles:{default:()=>[]},failedFiles:{default:()=>[]},hint:{default:""},required:{type:Boolean,default:!1},accept:{default:()=>[]},actionLabel:{default:"Submit"},progress:null,validators:{default:()=>[]},preselect:{type:Boolean,default:!1}},emits:["click:fileSelection","update:fileSelection","reset:fileSelection","action","abort"],setup(e,{emit:t}){const i=e;ow.vI.add(lw.UAA,lw.YyG);const a=(0,b.ref)(!1),n=(0,b.ref)([_,...i.validators]),r=Gb.translate,s=r("oder klicke Datei auswählen oder Ordner auswählen, um eine Datei hinzuzufügen.",["#####"]),o=s?.split("#####")??[],l=(0,b.ref)([]),d=(0,b.ref)([]),c=(0,b.ref)([]),u=(0,b.ref)(),p=(0,b.ref)(),h=(0,b.ref)(!1),m=(0,b.ref)([]),f=(0,b.computed)((()=>i.successfulFiles.map((e=>e.name))));function g(e){const t=Array.from(e.target.files??[]);k(t)}function y(e){c.value=c.value.includes(e)?c.value.filter((t=>t!==e)):[...c.value,e],t("click:fileSelection",e)}function v(){a.value=!0,t("action",l.value)}function w(){a.value=!1,t("abort")}function C(){t("reset:fileSelection",l.value),l.value=[],m.value=[]}function F(e){const t=I(e);return i.accept.includes(t)}async function A(e){if(!e.dataTransfer)return;h.value=!1;const t=Array.from(e.dataTransfer.items).map((e=>e.webkitGetAsEntry())).filter(ka).map(S),i=(await Promise.all(t)).flat();k(i)}function k(e){m.value=n.value.map((t=>t(e))).filter((e=>e.length));const i=e.filter(F),a=e.filter((e=>!F(e)));l.value=[...l.value,...i],d.value=a,t("update:fileSelection",e)}async function S(e){return e.isFile?new Promise((t=>{e.file((e=>{t([e])}))})):E(e)}async function E(e){return new Promise((t=>{e.createReader().readEntries((e=>{const i=e.map(S);Promise.all(i).then((e=>e.flat())).then(t)}))}))}function I(e){if(e.type.length)return e.type;const t=e.name.split(".").pop()?.toLowerCase()??"";switch(t){case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"zip":return"application/zip";case"xml":return"application/xml";case".csv":return"text/csv";case"isoxml":return".isoxml";default:return t}}function _(e){const t=e.every(F);if(t)return"";const i=e.filter((e=>!F(e))).map(I).filter(hH).join(", ");return`${i} ${r("Dateien werden für den Maßnahmenimport nicht unterstützt.")}`??0}return(0,b.watch)((()=>i.successfulFiles),(e=>{const t=0===l.value.length;i.preselect&&t&&(l.value=[...e])})),{__sfc:!0,props:i,buttonDisabled:a,validators:n,emit:t,$t:r,labelUploadInfo:s,labelUploadInfoParts:o,selectedFiles:l,unsupportedFiles:d,clickedFiles:c,fileInput:u,directoryInput:p,isDragover:h,errorMessages:m,successfulFileNames:f,updateSelection:g,updateClickedFiles:y,actionPressed:v,abortPressed:w,resetSelection:C,isFileFormatAllowed:F,onFileDrop:A,emitSelection:k,scan:S,scanDirectory:E,inferFormat:I,fileFormatValidator:_,ErrorUserMessage:cH,Button:gw,ButtonLink:Fw}}}),fH=mH,gH=(0,ew.Z)(fH,uH,pH,!1,null,"6093608b",null),yH=gH.exports;function vH(){const e=Gb.translate,t=e("Es ist ein unbekannter Fehler aufgetreten.");function i(e){const i=ue(e,{errorUserMessage:[t]});return"success"===i.status?null:i.errorCode?n(i.errorCode):i.errorUserMessage}function a(e){return Object.values(e).reduce(((e,t)=>t.errorUserMessage?Array.isArray(t.errorUserMessage)?[...e,...t.errorUserMessage]:[...e,t.errorUserMessage]:e),[])}function n(t){return"invalidLoginRequestInvalidEmail"===t?e("Die E-Mail-Adresse ist ungültig."):"invalidLoginRequestInvalidCredentials"===t?[e("Benutzername oder Passwort ungültig."),e('Bitte achte darauf, die gleiche E-Mail-Adresse wie in der FARMDOK App am Smartphone oder Tablet zu verwenden. Du findest die E-Mail-Adresse in der FARMDOK App im Menüpunkt "Mehr".')]:""}return{getUserErrorMessageFromResponse:i,getUserErrorMessageFromPartialSuccess:a}}var bH=(0,b.defineComponent)({__name:"ImportLoadDataUpload",setup(e){const t=Gb.translate,{state:i,goNext:a}=ij(),{getUserErrorMessageFromResponse:n,getUserErrorMessageFromPartialSuccess:r}=vH(),{activityImportApi:s}=b["default"].prototype.$api,o=(0,b.ref)([]),l=(0,b.ref)([]),d=(0,b.ref)([]),c=(0,b.ref)(""),u=(0,b.ref)(!1),p=(0,b.computed)((()=>!!Object.values(o.value).length));async function h(){i.isFetching=!0;const e=await g();"success"!==e.status&&"partialSuccess"!==e.status?c.value=n(e):"partialSuccess"===e.status&&(c.value=r(e.errors)),o.value=e.data.objects??[],l.value=o.value.map((e=>({name:e.name}))),w(),i.isFetching=!1}async function m(e){i.isFetching=!0,c.value="";const t=await y(e);"success"!==t.status&&"partialSuccess"!==t.status?c.value=n(t):"partialSuccess"===t.status&&(c.value=r(t.errors)),o.value=t.data.objects,l.value=o.value.map((e=>({name:e.name}))),w(),F(),i.isFetching=!1}async function f(){i.isFetching=!0,c.value="";const e=await v();"success"!==e.status?c.value=n(e):(o.value=[],l.value=[],i.selectedUploadFile=""),F(),i.isFetching=!1}async function g(){try{const{data:e}=await s.activityImportStatus({source:"UserUpload"});return ue(e)}catch(e){return ue(e)}}async function y(e){try{const{data:t}=await s.activityImportUpload({files:e});return ue(t)}catch(t){return d.value.push(...e),ue(t)}}async function v(){try{const{data:e}=await s.activityImportReset({activityImportResetRequest:{source:"UserUpload"}});return ue(e)}catch(e){return ue(e)}}function w(){!i.selectedUploadFile&&p.value&&([i.selectedUploadFile]=Object.keys(o.value))}function C(e){const t=l.value.indexOf(e),a=o.value[t];i.selectedUploadFile=a.id,Lb.commit("activities/importActivities/updateActivityImportMapDataRequestParameters",{objectIds:a.id})}function F(){i.selectedUploadFile||(i.importNextEnabled=!1);const e=o.value.find((e=>e.id===i.selectedUploadFile));i.importNextEnabled=!e?.errorUserMessages?.length&&!e?.warningUserMessages?.length}function A(e){const i=e.some((e=>!e.name.toLowerCase().includes("taskdata")));return i?t('Einzelne, vollständige TASKDATA-Dateien müssen die Bezeichnung "TASKDATA" beinhalten. Zusammengehörige Dateien können nur gezipped hochgeladen werden.')??"":""}return(0,b.onBeforeMount)((async()=>{await h(),F()})),{__sfc:!0,$t:t,state:i,goNext:a,getUserErrorMessageFromResponse:n,getUserErrorMessageFromPartialSuccess:r,activityImportApi:s,uploadedFiles:o,successfulFiles:l,failedFiles:d,userErrorMessage:c,infoModalVisible:u,uploadedFilesHasEntries:p,fetchUploadFilesStatus:h,upload:m,reset:f,getUploadFilesStatus:g,postUpload:y,postReset:v,setSelectedFile:w,setUploadFile:C,updateImportNextEnabled:F,filenameContainsTaskdata:A,ErrorUserMessage:cH,FileUploadTile:yH,MaxWidthContainer:Tw,ButtonLink:Fw}}}),wH=bH,CH=(0,ew.Z)(wH,aH,nH,!1,null,"9220b860",null),FH=CH.exports,AH=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return!i.loading&&i.tableData.length>0?t(i.TableActivities,{ref:"tableElement",attrs:{columns:i.tableColumns,tableData:i.tableData,fixedColumnsLeft:i.fixedColumnsLeft},on:{onChange:i.onChange},scopedSlots:e._u([{key:"footer",fn:function({hot:e,visibleRows:a,totalRows:n}){return[t(i.TableFooterContainer,{attrs:{hot:e,visibleRows:a,totalRows:n}})]}}],null,!1,2572168264)}):i.loading?t(i.TableActivitiesLoading,{attrs:{columns:i.tableColumns}}
1):e._e()},kH=[],SH=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableFooter",{attrs:{totalRows:e.totalRows,visibleRows:e.visibleRows,selectedRows:e.selectedRows}})},EH=[],IH=(0,b.defineComponent)({name:"TableFooterContainer",components:{TableFooter:hD},props:{hot:{type:Object},visibleRows:{type:Number},totalRows:{type:Number}},computed:{selectedRows(){const e=new Set,t=this.hot?.getSourceData().filter((t=>{const{id:i}=t;return!e.has(i)&&(e.add(i),!0)})),i=t?.filter((e=>!0===e.select));return i?.length??0}}}),_H=IH,DH=(0,ew.Z)(_H,SH,EH,!1,null,"36f3290e",null),MH=DH.exports;function PH(e,t,i){const a=e.reduce(((e,i)=>{const a=t.findEquipmentById(i);return a&&e.push({id:i,name:a.name}),e}),[]),n={id:gr.NO_MATCH,name:"value from data source (from import)",items:i?[{id:gr.NO_MATCH,name:i}]:[],sort:!1},r={name:"Matching equipments",id:"equipmenrts-match",items:a,sort:!1};return i?[n,r]:[r]}const TH=(e,t,i)=>{const a=i.getDataAtRowProp(e,"expand");return a&&null!==t&&"HOT_DISPLAY_BUTTON_RENDERER"!==t&&t.id?1:2},xH={data:"equipment",header:{title:()=>b["default"].i18n.translate("Maschinen & Geräte")??""},requiredFeatures:()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EQUIPMENT)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_EQUIPMENT),type:"subtable",subtableColumns:[{data:"equipment.dropdownItem",type:"farmdok.subtablePrimaryColumn",width:200,colspan:(e,t,i,a)=>TH(e,i,a),collapsedSubtable:{getRendererValue({values:e}){const t=e.map((e=>e.name??"")).filter((e=>""!==e));return t.join(", ")},onClick({event:e,visualRow:t,instance:i}){e.preventDefault(),i.setDataAtRowProp(t,"expand",!0)}},button:{label:()=>`+ ${b["default"].i18n.translate("Maschine hinzufügen")}`||"+ Maschine hinzufügen",color:"primary",onClick({visualRow:e,instance:t}){const i=t.getDataAtRowProp(e,"id");Lb.dispatch("activities/importActivities/addImportActivityEquipment",i)}},showWarning:e=>e?.id===gr.NO_MATCH,dropdown:{async getItems(e,t){const i=new Wa(Lb.state.equipments.data),a=t.getDataAtRowProp(e,"id"),n=Lb.getters["activities/importActivities/getById"](a),r=n.equipment[0]?.equipmentIdMatch?.additionalMatches??[],s=n.equipment[0]?.equipmentIdMatch?.originalValue??"",o=n?PH(r,i,s):[],l=t.getDataAtRowProp(e,"activityTypeDropdownItem")?.id;if(!l)return o||[];const d=Lb.state.activityTypes.data[l],c=t.getDataAtRowProp(e,"processOrderId");if(!c)return o||[];const u=Lb.getters["auth/findCompanyByProcessOrderId"](c);if(!u)return o||[];const p=Lb.state.equipments.used,h=i.getCompatibleEquipmentsToDropdownItems([d],[u],p);return o?[...o,...h]:h}},columnSorting:$O,warningIcon:{tooltipLabel:b["default"].i18n.translate("Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.")}},{data:"equipment.id",type:"text",hidden:!0},{data:"equipmentTrashIcon",type:"farmdok.trashIcon",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:45,disableColumnResize:!0,renderEmpty(e,t){const i=t.getDataAtRowProp(e,"equipment.id");return!i},renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"equipment.dropdownItem");return 2===TH(e,i,t)},onClick(e,t){if(!this.readOnly){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e,"equipment.id");Lb.dispatch("activities/importActivities/removeImportActivityEquipment",{importActivityId:i,importActivityEquipmentId:a})}}}]};var BH=xH;function OH(e,t){const i=e.reduce(((e,t)=>{const i=Lb.getters["products/findProductById"](t);return i&&e.push({id:t,name:i.name}),e}),[]),a={id:gr.NO_MATCH,name:"value from data source (from import)",items:t?[{id:gr.NO_MATCH,name:t}]:[],sort:!1},n={name:"Matching products",id:"products-match",items:i,sort:!1};return t?[a,n]:[n]}const $H=(e,t)=>{const i=t.getDataAtRowProp(e,"expand");return!i},RH=(e,t,i)=>{const a=jH.subtableColumns.filter((e=>!e.hidden)).length,n=!zH.requiredFeatures||zH.requiredFeatures(),r=i.getDataAtRowProp(e,"expand");if(!r)return n?a:a-1;if(null===t||"HOT_DISPLAY_BUTTON_RENDERER"===t||!t.id)return n?2:1;const[s]=t.id.split("_"),o=Lb.getters["products/findProductById"](s),l=Lb.state.productCategories.data;return Ki(o,l)?1:n?2:1},NH={data:"product.productStorageDropdownItem",type:"farmdok.subtablePrimaryColumn",renderer:"farmdok.optional",width:200,colspan:(e,t,i,a)=>RH(e,i,a),renderLoading:(e,t,i)=>{if(t&&""!==t.id)return!1;const a=i.getDataAtRowProp(e,"product.isLoading");return a},collapsedSubtable:{getRendererValue({values:e}){const t=e.map((e=>e?.name??"")),i=t.join(", ");return i},onClick({event:e,visualRow:t,instance:i}){e.preventDefault(),i.setDataAtRowProp(t,"expand",!0)}},button:{label:()=>`+ ${b["default"].i18n.translate("Produkt hinzufügen")}`||"+ Produkt hinzufügen",color:"primary",onClick({visualRow:e,instance:t}){const i=t.getDataAtRowProp(e,"id");Lb.dispatch("activities/importActivities/addImportActivityProduct",i)}},showWarning:e=>e?.id===gr.NO_MATCH,dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"id"),a=Lb.getters["activities/importActivities/getById"](i),n=a.products[0]?.productIdMat
1ch?.additionalMatches??[],r=a.products[0]?.productIdMatch?.originalValue??"",s=a?OH(n,r):[],o=t.getDataAtRowProp(e,"activityTypeDropdownItem")?.id;if(!o)return s||[];const l=Lb.state.activityTypes.data[o],d=t.getDataAtRowProp(e,"processOrderId");if(!d)return s||[];const c=Lb.getters["auth/findCompanyByProcessOrderId"](d);if(!c)return s||[];const u=Lb.getters["auth/currentProcessOrders"],p=Object.values(Lb.state.productVisibilities.data),h=Object.values(Lb.state.productCategories.data),m=Lb.state.activities.createEditActivity.activities.map((e=>e?.timeStart)).filter(ka),f=t.getDataAtRowProp(e,"fieldDropdownItem")?.id;if(!f)return s||[];const g=Lb.state.fields.data[f]??null,y=Object.values(Lb.state.storagePlaces.data),v=Lb.getters["products/compatibleProductsToDropdownItems"](l,[c],u,p,h,[g],y,m);return s?[...s,...v]:v}},columnSorting:$O,warningIcon:{tooltipLabel:b["default"].i18n.translate("Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.")}},zH={data:"product.pesticideIndicationDropdownItem",type:"farmdok.dropdown",renderer:"farmdok.optional",width:200,requiredFeatures:()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_PESTS)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_PESTS),renderEmpty:$H,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return RH(e,i,t)>1},dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");if(!i)return[];const[a]=i.id.split("_"),n=t.getDataAtRowProp(e,"fieldDropdownItem"),r=t.getDataAtRowProp(e,"timeStart"),s=n.id;if(!a||!s)return[];const o=Lb.getters["pesticideIndications/dropdownItemsForProductAndField"](a,s,[r]);return o??[]}}},LH={data:"product.amountUnitRelative",type:"farmdok.amountUnit",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:120,renderEmpty:$H,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return RH(e,i,t)>2},getUnitName(e){const t=Lb.state.units.data[e];return t?.name??null},getNDecimals:ZO},VH={data:"product.amountUnitTotal",type:"farmdok.amountUnit",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:120,renderEmpty:$H,renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return RH(e,i,t)>3},getUnitName(e){const t=Lb.state.units.data[e];return t?.name??null},getNDecimals:ZO},UH={data:"productsTrashIcon",type:"farmdok.trashIcon",renderer:"farmdok.optional",noHeaderContextMenu:!0,width:45,disableColumnResize:!0,renderEmpty(e,t){const i=t.getDataAtRowProp(e,"product.id");return!i},renderNone:(e,t)=>{const i=t.getDataAtRowProp(e,"product.productStorageDropdownItem");return RH(e,i,t)>3},onClick(e,t){if(!this.readOnly){const i=t.getDataAtRowProp(e,"id"),a=t.getDataAtRowProp(e,"product.id");Lb.dispatch("activities/importActivities/removeImportActivityProduct",{importActivityId:i,importActivityProductId:a})}}},jH={data:"product",header:{title:()=>b["default"].i18n.translate("Produkte")??""},type:"subtable",subtableColumns:[NH,zH,LH,VH,{data:"product.id",type:"text",hidden:!0},UH]};var HH=jH;function GH(e){return e?.id===gr.NO_MATCH||!e}const WH=(e,t)=>!SB(e,t),ZH={...i$,showWarning:GH,dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"id"),a=Lb.getters["activities/importActivities/getById"](i),{currentCompanies:n}=Lb.state.auth,r=Lb.getters["activityTypes/dropdownItems"](n),s=qH(a.activityTypeIdMatch.additionalMatches,a.activityTypeIdMatch.originalValue);return s.concat(r)}},warningIcon:{tooltipLabel:b["default"].i18n.translate("Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.")}},KH={...a$,showWarning:GH,dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"id"),a=Lb.getters["activities/importActivities/getById"](i),n=t.getDataAtRowProp(e,"processOrderId");if(!n)return[];const r=YH(a.fieldIdMatch.additionalMatches,a.fieldIdMatch.originalValue);return r.concat(Lb.getters["fields/dropdownItems"](n))}},columnSorting:VB,warningIcon:{tooltipLabel:b["default"].i18n.translate("Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden.")}};function qH(e,t){const i=e.map((e=>({id:e,name:Lb.getters["activityTypes/activityTypeDisplayName"](e)??e}))),a={name:"Matching activity types",id:"activityTypes-match",items:i,sort:!1},n={name:"value from data source (from import)",id:"activityType-originalValue",items:t?[{id:t,name:t}]:[],sort:!1};return[n,a]}function YH(e,t){const i=e.map((e=>({id:e,name:Lb.getters["fields/fieldDisplayName"](e)??e}))),a={name:"Matching fields",id:"fields-match",items:i,sort:!1},n={name:"value from data source (from import)",id:"fields-originalValue",items:t?[{id:t,name:t}]:[],sort:!1};return[n,a]}const JH={data:"importStatus",type:"farmdok.ruleCheckStatus",renderer:"farmdok.optional",noHeaderContextMenu:!0,hiddenInPageSettings:!0,width:45,renderEmpty:WH,disableColumnResize:!0},XH=[JO,tO,XO,JB,JH,e$,t$,ZH,KH,n$,HH,BH,r$,f$,g$,y$,v$,b$,w$,QB];var QH=XH,eG=(0,b.defineComponent)({__name:"TableActivitiesImportContainer",setup(e,{expose:t}){const{activityImportApi:i}=b["default"].prototype.$api,a=(0,b.ref)(),n=(0,b.computed)((()=>Lb.getters["activities/importActivities/tableDataImportActivities"])),r=(0,b.computed)((()=>Lb.getters["activities/importActivities/loading"]||Lb.getters["activityTypes/loading"]||Lb.getters["customers/loading"]||Lb.getters["equipments/loading"]||Lb.getters["fields/loading"]||Lb.getters["productCategories/loading"]||Lb.getters["pests/loading"]||Lb.getters["storagePlaces/loading"]||Lb.getters["units/loading"]||Lb.getters["users/loading"]||Lb.getters["products/loading"])),s=(0,b.computed)((()=>{const{userColumnSettings:e}=Lb.state.activities.importActivities,t=new hR(QH);return t.getColumnsForHandsontable(e)})),o=(0,b.computed)((()=>{const e=s.value.findIndex((e=>!0===e.fixedColumnsLeftUntilHere));return-1===e?0:e+1}
1)),l=(0,b.computed)((()=>Lb.state.units.data)),d=(0,b.computed)((()=>new La(Lb.state.products.mineralFertilizers.data,Lb.state.products.companyFertilizers.data,Lb.state.products.secondaryFertilizers.data,Lb.state.products.herbizides.data,Lb.state.products.crops.data,Lb.state.products.miscellaneous.data,Lb.state.products.harvests.data,Lb.state.products.seeds.data,Lb.state.products.otherProductsAndFertilizers.data))),c=(0,b.computed)((()=>new Aa(l.value,d.value,$a))),u=(0,b.computed)((()=>new Wa(Lb.state.equipments.data))),p=(0,b.computed)((()=>new Za(u.value))),h=(0,b.computed)((()=>new qa(Lb.state.auth.companiesById)));function m(){Lb.dispatch("activities/importActivities/subscribe",{forceRefresh:!0}),Lb.dispatch("equipments/subscribe"),Lb.dispatch("fields/subscribe"),Lb.dispatch("activityTypes/subscribe"),Lb.dispatch("customers/subscribe"),Lb.dispatch("products/subscribe"),Lb.dispatch("productCategories/subscribe"),Lb.dispatch("pests/subscribe"),Lb.dispatch("storagePlaces/subscribe"),Lb.dispatch("units/subscribe"),Lb.dispatch("users/subscribe"),Lb.dispatch("activities/subscribe")}function f(){Lb.commit("activities/importActivities/resetTableData"),Lb.commit("activities/importActivities/resetTableDataMetadata")}function g(e,t){e.forEach((e=>{const[,t,,i,{id:a}]=e,n=["expand","select"];t.startsWith("product")?v(e):t.startsWith("equipment")?w(e):"fieldDropdownItem"!==t?n.includes(t)?Lb.commit("activities/importActivities/addOrUpdateTableDataMetadataByKeyAndValue",{importActivityId:a,key:t,value:i}):"activityTypeDropdownItem"!==t?F(a,t,i):y(e):C(e)}))}function y(e){const{id:t}=e[3],{id:i}=e[4],a=Lb.getters["activities/importActivities/getById"](i),n=a.processOrderId?h.value.getCompanyByProcessOrder(a.processOrderId).id:"",{originalValue:r}=a.activityTypeIdMatch;if(r&&!a.activityTypeId){Object.values(Lb.state.activities.importActivities.data).forEach((e=>{e.activityTypeIdMatch.originalValue===r&&Lb.dispatch("activities/importActivities/updateActivityType",{importActivityId:e.id,importActivityTypeId:t})}));const e=[{externalKey:a.activityTypeIdMatch.originalKey||"",mappedProperty:yt.ActivityTypeId,farmdokId:t}];A(n,e)}Lb.dispatch("activities/importActivities/updateActivityType",{importActivityId:i,importActivityTypeId:t})}function v(e){const{id:t}=e[4],i=Lb.getters["activities/importActivities/getById"](t),a=e[2]?.name,n=i.processOrderId?h.value.getCompanyByProcessOrder(i.processOrderId).id:"";if(a&&a===i.products[0]?.productIdMatch?.originalValue){Object.values(Lb.state.activities.importActivities.data).forEach((t=>{t.products.forEach((r=>{if(a===r.productIdMatch?.originalValue&&t.activityTypeId===i.activityTypeId&&t.fieldId===i.fieldId){const i=[...e];i[4].activityProductId=r.id;const a=c.value.updateActivityProductsFromChange(t.products,i,n);F(t.id,"products",a)}}))}));const t=[{externalKey:i.products[0]?.productIdMatch?.originalKey||"",mappedProperty:yt.ProductId,farmdokId:e[3].id}];A(n,t)}else{const a=c.value.updateActivityProductsFromChange(i.products,e,n);F(t,"products",a)}}function w(e){const{id:t}=e[4],i=Lb.getters["activities/importActivities/getById"](t),a=i.processOrderId?h.value.getCompanyByProcessOrder(i.processOrderId).id:"",n=e[2]?.name;if(n&&n===i.equipment[0]?.equipmentIdMatch?.originalValue){Object.values(Lb.state.activities.importActivities.data).forEach((t=>{t.equipment.forEach((i=>{if(n===i.equipmentIdMatch.originalValue){const n=[...e];n[4].activityEquipmentId=i.id;const r=p.value.updateActivityEquipmentsFromChange(t.equipment,n,a);F(t.id,"equipment",r)}}))}));const t=[{externalKey:i.equipment[0]?.equipmentIdMatch?.originalKey||"",mappedProperty:yt.EquipmentId,farmdokId:e[3].id}];A(a,t)}else{const n=p.value.updateActivityEquipmentsFromChange(i.equipment,e,a);F(t,"equipment",n)}}function C(e){const{id:t}=e[3],{id:i}=e[4],a=Lb.state.fields.data[t],n=Lb.getters["activities/importActivities/getById"](i),r=n.processOrderId?h.value.getCompanyByProcessOrder(n.processOrderId).id:"",{originalValue:s}=n.fieldIdMatch;if(s&&!n.fieldId){Object.values(Lb.state.activities.importActivities.data).forEach((e=>{e.fieldIdMatch.originalValue===s&&(F(e.id,"fieldId",t),F(e.id,"processedArea",a.fieldSize))}));const e=[{externalKey:n.fieldIdMatch.originalKey||"",mappedProperty:yt.FieldId,farmdokId:t}];A(r,e)}F(i,"processedArea",a.fieldSize),F(i,"fieldId",t)}function F(e,t,i){Lb.commit("activities/importActivities/updateEntryByKeyAndValue",{guid:e,key:t,value:i})}function A(e,t){i.activityImportStoreMappings({activityImportStoreMappingsRequest:{companyId:e,mappings:t}})}return(0,b.onBeforeMount)((()=>{m()}
1)),(0,b.onUnmounted)((()=>{f()})),t({tableElement:a}),{__sfc:!0,activityImportApi:i,tableElement:a,tableData:n,loading:r,tableColumns:s,fixedColumnsLeft:o,units:l,productService:d,activityProductService:c,equipmentService:u,activityEquipmentService:p,companyService:h,loadData:m,resetStoreTableData:f,onChange:g,onChangeActivityTypeDropdownItem:y,onChangeActivityProduct:v,onChangeActivityEquipment:w,onChangeFieldDropdownItem:C,updateImportActivityEntryByKeyAndValue:F,postActivityImportStoreMappings:A,TableActivitiesLoading:vL,TableFooterContainer:MH,TableActivities:pL}}}),tG=eG,iG=(0,ew.Z)(tG,AH,kH,!1,null,null,null),aG=iG.exports;const nG=()=>b["default"].i18n.translate("Maßnahmen importieren"),rG=()=>b["default"].i18n.translate("Importieren von Maßnahmen aus externen Quellen"),sG={to:{name:"activities"},label:()=>b["default"].i18n.translate("Zurück zu Maßnahmen")};var oG=[{path:`${M}activities`,name:"activities",component:_U,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Maßnahmen")}},{path:`${M}activities/restore`,name:"activities/restore",component:bj,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Maßnahmen wiederherstellen"),subheader:()=>b["default"].i18n.translate("Maßnahmen wiederherstellen, die in den letzten 90 Tagen gelöscht wurden"),back:{to:{name:"activities"},label:()=>b["default"].i18n.translate("Zurück zur Maßnahmen-Startseite")}}},{path:`${M}activities/import`,name:"activities/import",component:sj,meta:{requiresAuth:!0},children:[{path:"choose-method",name:"activities/import/choose-method",component:jj,meta:{label:nG,subheader:rG,back:sG,requiresAuth:!0,step:0}},{path:"load-data/cnh",name:"activities/import/load-data/cnh",component:iH,props:!0,meta:{label:nG,subheader:rG,back:sG,requiresAuth:!0,step:1}},{path:"load-data/upload",name:"activities/import/load-data/upload",component:FH,props:!0,meta:{label:nG,subheader:rG,back:sG,requiresAuth:!0,step:1}},{path:"import-table",name:"activities/import/import-table",component:aG,props:!0,meta:{label:nG,subheader:rG,back:sG,requiresAuth:!0,step:2}}]}],lG=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-additional-data",attrs:{"scroll-y":"","content-flex":""},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"middle",fn:function(){return[t("Steps",{attrs:{steps:e.steps,current:e.currentStep}})]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"page-additional-data__content"},[0===e.currentStep?t("StepUpdateNames",{attrs:{fetching:e.fetching,"user-error-message":e.userErrorMessage,firstname:e.$store.state.auth.user.firstname,lastname:e.$store.state.auth.user.lastname,companyName:e.currentCompany.name},on:{input:function(t){e.userErrorMessage=null},submit:function(t){e.userErrorMessage=null},save:e.saveNames}}):e._e(),1===e.currentStep?t("StepUpdateAddress",{attrs:{fetching:e.fetching,"user-error-message":e.userErrorMessage,address:e.currentCompany.address,postcode:e.currentCompany.postcode,city:e.currentCompany.city},on:{input:function(t){e.userErrorMessage=null},submit:function(t){e.userErrorMessage=null},save:e.saveAddress}}):e._e(),t("p",[t("ButtonLink",{attrs:{to:e.skipTarget.to,href:e.skipTarget.href},on:{click:e.onSkip}},[e._v(" "+e._s(e.$t("Überspringen"))+" ")])],1)],1)]},proxy:!0}])})},dG=[],cG={data(){return{userErrorMessage:null,defaultUserErrorMessage:this.$t("Es ist ein unbekannter Fehler aufgetreten.")}},methods:{setUserErrorMessageFromResponse(e){const t=ue(e,{errorUserMessage:[this.defaultUserErrorMessage]});"success"!==t.status?(this.userErrorMessage=this.translateErrorCode(t.errorCode),null==this.userErrorMessage&&(this.userErrorMessage=t.errorUserMessage)):this.userErrorMessage=null},translateErrorCode(e){return"invalidLoginRequestInvalidEmail"===e?this.$t("Die E-Mail-Adresse ist ungültig."):"invalidLoginRequestInvalidCredentials"===e?[this.$t("Benutzername oder Passwort ungültig."),this.$t('Bitte achte darauf, die gleiche E-Mail-Adresse wie in der FARMDOK App am Smartphone oder Tablet zu verwenden. Du findest die E-Mail-Adresse in der FARMDOK App im Menüpunkt "Mehr".')]:null}}},uG=function(){var e=this,t=e._self._c;
1return t("div",{staticClass:"step-update-address w-100"},[t("h1",{staticClass:"step-update-address__headline"},[e._v(" "+e._s(e.$t("Adresse"))+" ")]),t("BForm",{staticClass:"w-100 mb-4",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("FormFieldInput",{staticClass:"w-100",attrs:{name:"addressInternal",type:"text",autocomplete:"address-line1",variant:"vertical-lg",label:e.$t("Straße, Hausnummer, Tür"),placeholder:e.$t("Straße, Hausnummer, Tür"),disabled:e.fetching},on:{input:function(t){return e.$emit("input")}},model:{value:e.addressInternal,callback:function(t){e.addressInternal=t},expression:"addressInternal"}}),t("FormFieldInput",{staticClass:"w-100",attrs:{name:"postcodeInternal",type:"text",autocomplete:"postal-code",variant:"vertical-lg",label:e.$t("Postleitzahl"),placeholder:e.$t("Postleitzahl"),disabled:e.fetching},on:{input:function(t){return e.$emit("input")}},model:{value:e.postcodeInternal,callback:function(t){e.postcodeInternal=t},expression:"postcodeInternal"}}),t("FormFieldInput",{staticClass:"w-100",attrs:{name:"city",type:"text",autocomplete:"address-level2",variant:"vertical-lg",label:e.$t("Ort"),placeholder:e.$t("Ort"),disabled:e.fetching},on:{input:function(t){return e.$emit("input")}},model:{value:e.cityInternal,callback:function(t){e.cityInternal=t},expression:"cityInternal"}}),t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}):t("span",[e._v(e._s(e.$t("Speichern")))])],1)],1)],1)},pG=[],hG={methods:{firstError(e){let t=null;return Object.keys(e).some((i=>{if(null!=this.$refs.validationObserver&&null!=this.$refs.validationObserver.fields[i]&&this.$refs.validationObserver.fields[i].dirty)return!1;const a=e[i];return!(a.length<1)&&([t]=a,!0)})),t}}};ow.vI.add(uw.IJ7);var mG={name:"StepUpdateAddress",components:{ErrorUserMessage:cH,FormFieldInput:fk,Button:gw},mixins:[hG],props:{fetching:{type:Boolean,default:!1},userErrorMessage:{type:String,default:null},address:{type:String,default:null},postcode:{type:String,default:null},city:{type:String,default:null}},data(){return{addressInternal:this.address,postcodeInternal:this.postcode,cityInternal:this.city}},methods:{submit(){this.$emit("submit"),this.$emit("save",{address:this.addressInternal,postcode:this.postcodeInternal,city:this.cityInternal})}}},fG=mG,gG=(0,ew.Z)(fG,uG,pG,!1,null,"1a805616",null),yG=gG.exports,vG=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step-update-names w-100"},[t("h1",{staticClass:"step-update-names__headline"},[e._v(" "+e._s(e.$t("Betrieb"))+" ")]),t("ValidationObserver",{ref:"validationObserver",attrs:{slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{staticClass:"w-100 mb-4",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("FormFieldInput",{staticClass:"w-100 mt-0",attrs:{name:"firstname",type:"text",autocomplete:"given-name",variant:"vertical-lg",label:e.$t("Vorname"),placeholder:e.$t("Vorname"),disabled:e.fetching},on:{input:function(t){return e.$emit("input")}},model:{value:e.firstnameInternal,callback:function(t){e.firstnameInternal=t},expression:"firstnameInternal"}}),t("FormFieldInput",{staticClass:"w-100",attrs:{name:"lastname",type:"text",autocomplete:"family-name",variant:"vertical-lg",label:e.$t("Nachname"),placeholder:e.$t("Nachname"),disabled:e.fetching},on:{input:function(t){return e.$emit("input")}},model:{value:e.lastnameInternal,callback:function(t){e.lastnameInternal=t},expression:"lastnameInternal"}}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("Betriebsbezeichnung")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{staticClass:"w-100",attrs:{name:"companyName",type:"text",variant:"vertical-lg",required:"",label:e.$t("Betriebsbezeichnung"),placeholder:e.$t("Betriebsbezeichnung"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){return e.$emit("input")}},model:{value:e.companyNameComputed,callback:function(t){e.companyNameComputed=t},expression:"companyNameComputed"}})]}}],null,!0)}),e.firstError(i)?t("p",{staticClass:"text-danger"},[e._v(e._s(e.firstError(i))+" ")]):t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}
1):t("span",[e._v(e._s(e.$t("Speichern")))])],1)],1)]}}])})],1)},bG=[];ow.vI.add(uw.IJ7);var wG={name:"StepUpdateNames",components:{ErrorUserMessage:cH,FormFieldInput:fk,Button:gw},mixins:[hG],props:{fetching:{type:Boolean,default:!1},userErrorMessage:{type:String,default:null},firstname:{type:String,default:null},lastname:{type:String,default:null},companyName:{type:String,default:null}},data(){return{firstnameInternal:this.firstname,lastnameInternal:this.lastname,companyNameInternal:this.companyName,companyNameChanged:!1}},computed:{companyNameComputed:{get(){if(this.companyNameChanged)return this.companyNameInternal;const e=[];return"string"===typeof this.firstnameInternal&&e.push(this.firstnameInternal.trim()),"string"===typeof this.lastnameInternal&&e.push(this.lastnameInternal.trim()),e.join(" ").trim()},set(e){this.companyNameInternal=e,this.companyNameChanged=!0}}},methods:{submit(){this.$emit("submit"),this.$refs.validationObserver.reset(),this.$refs.validationObserver.handleSubmit((()=>{this.$emit("save",{firstname:this.firstnameInternal,lastname:this.lastnameInternal,companyName:this.companyNameComputed})}))}}},CG=wG,FG=(0,ew.Z)(CG,vG,bG,!1,null,"3b00b032",null),AG=FG.exports;const{isMobileBrowser:kG}=Bu.Z.helper,SG=`${T}${M}fields`;var EG={name:"PageAdditionalData",components:{StepUpdateAddress:yG,StepUpdateNames:AG,Steps:LU,TheContentbar:HL,ThePageSkeleton:$w,ButtonLink:Fw},mixins:[cG],data(){return{steps:[{number:1,label:this.$t("Betrieb")},{number:2,label:this.$t("Adresse")}],fetching:!1,defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},computed:{currentStep(){return"company"===this.$route.params.step?0:"address"===this.$route.params.step?1:null},currentCompany(){return this.$store.state.auth.currentCompanies[0]},skipTarget(){if("company"===this.$route.params.step){const e={name:"register-additional-data",params:{step:"address"}},t=null;return{to:e,href:t}}if(kG()){const e=null,t=SG;return{to:e,href:t}}const e={name:"home"},t=null;return{to:e,href:t}}},methods:{async saveNames({firstname:e,lastname:t,companyName:i}){if(!this.fetching){this.fetching=!0;try{await Promise.all([new Promise((e=>setTimeout(e,200))),this.saveUser({firstname:e,lastname:t}),this.saveCompany({firstname:e,lastname:t,name:i})]),await this.$router.push({name:"register-additional-data",params:{step:"address"}})}catch(a){this.setUserErrorMessageFromResponse(a)}this.fetching=!1}},async saveUser({firstname:e,lastname:t}){const i=await this.$store.dispatch("auth/updateAndSyncUser",{firstname:e,lastname:t});if("success"!==i.status)throw i},async saveCompany(e){const t=await this.$store.dispatch("auth/updateAndSyncCurrentCompany",{id:this.currentCompany.id,data:e});if("success"!==t.status)throw t},async saveAddress(e){if(!this.fetching){this.fetching=!0;try{await Promise.all([new Promise((e=>setTimeout(e,200))),this.saveCompany(e)]),localStorage.removeItem(Gl),kG()?window.location.href=SG:await this.$router.push({name:"home"})}catch(t){this.setUserErrorMessageFromResponse(t)}this.fetching=!1}},onSkip(){"address"===this.$route.params.step&&localStorage.removeItem(Gl)}}},IG=EG,_G=(0,ew.Z)(IG,lG,dG,!1,null,"10fcf557",null),DG=_G.exports,MG=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-check-mail",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("TopContentContainer",[t("FontAwesomeIcon",{staticClass:"m-4",attrs:{size:"3x",icon:["fal","paper-plane"]}}),t("WelcomeTitle",{staticClass:"m-0",attrs:{white:"",centered:""}},[e._v(" "+e._s(e.$t("Aktiviere deinen sicheren Zugang!"))+" ")])],1),e.fetching?t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}}):e._e(),e.fetching?e._e():t("MaxWidthContainer",{staticClass:"mt-auto pb-0",attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{centered:""}},[e._v(" "+e._s(e.$t("Bitte überprüfe deine E-Mails"))+" ")])],1),e.fetching?e._e():t("MaxWidthContainer",{staticClass:"mb-auto pt-0"},[t("p",{staticClass:"mb-2"},[e._v(" "+e._s(e.messageEmailParts[0])+" "),t("strong",[e._v(e._s(e.$store.state.auth.user.email))]),e._v(" "+e._s(e.messageEmailParts[1])+" ")]),t("p",{staticClass:"mb-4"},[e._v(" "+e._s(e.$t("Klicke auf den Link in der E-Mail um deinen Account zu aktivieren."))+" ")]),t("p",{staticClass:"mb-4"},[e._v(" "+e._s(e.$t("Du hast keine E-Mail bekommen? Überprüfe bitte den Spam-Ordner."))+" "+e._s(e.messageResendParts[0])+" "),t("ButtonLink",{on:{click:e.onResend}},[e._v(e._s(e.messageResendParts[1]))]),e._v(" "+e._s(e.messageResendParts[2])+" ")],1),t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}})],1)],1)],1)},PG=[],TG=function(){var e=this,t=e._self._c;return t("div",{staticClass:"top-content-container"},[null!=this.$slots.default?t("MaxWidthContainer",{attrs:{size:"lg"}},[e._t("default")],2):e._e()],1)},xG=[],BG={name:"TopContentContainer",components:{MaxWidthContainer:Tw}},OG=BG,$G=(0,ew.Z)(OG,TG,xG,!1,null,"1d72670b",null),RG=$G.exports,NG=function(){var e=this,t=e._self._c;return t("div",{staticClass:"welcome-content-container",class:{"welcome-content-container--padding-top":e.paddingTop}},[e._t("default"),null!=e.$slots["cta-container"]?t("div",{staticClass:"welcome-content-container__cta-container",class:{"welcome-content-container__cta-container--trans
1parent":e.ctaContainerTransparent}},[e._t("cta-container")],2):e._e()],2)},zG=[],LG={name:"WelcomeContentContainer",props:{paddingTop:{type:Boolean,default:!1},ctaContainerTransparent:{type:Boolean,default:!1}}},VG=LG,UG=(0,ew.Z)(VG,NG,zG,!1,null,"138dd238",null),jG=UG.exports,HG=function(){var e=this,t=e._self._c;return t("h2",{staticClass:"welcome-title",class:{"welcome-title--white":e.white,"welcome-title--centered":e.centered}},[e._t("default")],2)},GG=[],WG={name:"WelcomeTitle",props:{white:{type:Boolean,default:!1},centered:{type:Boolean,default:!1}}},ZG=WG,KG=(0,ew.Z)(ZG,HG,GG,!1,null,"ee437208",null),qG=KG.exports,YG={data(){return{authRegistrationProcessActive:!1,localStorageCheck:null}},created(){this.localStorageCheck=setInterval((()=>{this.authRegistrationProcessActive=null!=localStorage.getItem(Gl)&&!0===JSON.parse(localStorage.getItem(Gl))}),100)},beforeDestroy(){clearInterval(this.localStorageCheck)}};ow.vI.add(a_.XCy,yF.AX7);var JG={name:"PageCheckMail",components:{ErrorUserMessage:cH,ThePageSkeleton:$w,WelcomeContentContainer:jG,MaxWidthContainer:Tw,TopContentContainer:RG,WelcomeTitle:qG,ButtonLink:Fw},mixins:[cG,YG],data(){return{fetching:!1,messageEmail:this.$t("Wir haben dir eine E-Mail an {email} gesendet.",{email:"#####"}),messageResend:this.$t("Sollte die E-Mail nicht auffindbar sein, {linkStart}klicke hier, um sie nochmal zu senden.{linkEnd}",{linkStart:"#####",linkEnd:"#####"}),defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},computed:{messageEmailParts(){return this.messageEmail.split("#####")},messageResendParts(){return this.messageResend.split("#####")}},mounted(){localStorage.setItem(Hl,g()().format("YYYY-MM-DD"))},methods:{async onResend(){this.fetching=!0,this.userErrorMessage=null,await Promise.all([new Promise((e=>setTimeout(e,300))),this.resend()]),this.fetching=!1},async resend(){try{const{data:e}=await l().get("/admin/rest/user/resend_email_confirmation_email");
1"success"!==e.status&&this.setUserErrorMessageFromResponse(e)}catch(e){let t=null;null!=e&&null!=e.response&&(t=e.response.data),this.setUserErrorMessageFromResponse(t)}}}},XG=JG,QG=(0,ew.Z)(XG,MG,PG,!1,null,"562e08f7",null),eW=QG.exports,tW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-login",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("TopContentContainer",{staticClass:"page-login__top-content-container"},[t("WelcomeTitle",{staticClass:"m-0",attrs:{white:"",centered:""}},[t("span",{staticClass:"position-relative"},[e._v(" "+e._s(e.$t("Login"))+" "),t("DebugInstanceBadge")],1)])],1),t("MaxWidthContainer",{staticClass:"mt-auto"},[t("LogoAuthPages")],1),t("MaxWidthContainer",{staticClass:"mb-auto"},[e._e(),e._e(),t("ValidationObserver",{ref:"validationObserver",attrs:{slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{staticClass:"w-100",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("ValidationProvider",{attrs:{rules:"required|email",slim:"",name:e.$t("E-Mail-Adresse")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a,failed:n}){return[t("FormFieldInput",{ref:"email",staticClass:"w-100 mt-0",attrs:{name:"email",type:"email",autocomplete:"email",variant:"vertical-lg",label:e.$t("E-Mail-Adresse"),placeholder:e.$t("E-Mail-Adresse"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}})]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("Passwort")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{staticClass:"w-100",attrs:{name:"password",type:"password",autocomplete:"current-password",variant:"vertical-lg",label:e.$t("Passwort"),placeholder:e.$t("Passwort"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})]}}],null,!0)}),null!=e.firstError(i)?t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.firstError(i)||e.userErrorMessage)+"  ")]):t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}):t("span",[e._v(e._s(e.$t("Einloggen")))])],1)],1)]}}])}),t("p",{staticClass:"mt-4 mb-0"},[e._v(" "+e._s(e.$t("Du hast noch kein Konto?"))+" "),t("ButtonLink",{attrs:{to:{name:"welcome"}}},[e._v(e._s(e.$t("Hier gehts zur Registrierung.")))])],1),t("ButtonLink",{staticClass:"mt-1 py-3",attrs:{to:{name:"password-lost",params:{email:e.email}}}},[e._v(" "+e._s(e.$t("Passwort vergessen?"))+" ")])],1)],1)],1)},iW=[],aW=function(){var e=this,t=e._self._c;return t("DebugComponentWrapper",[t("BBadge",{staticClass:"debug-instance-badge",attrs:{pill:"",title:"Hide this by pressing 'ctrl + alt + b'",variant:e.variant}},[e._v(" "+e._s(e.instance.toUpperCase())+" ")])],1)},nW=[],rW=i(26034),sW={name:"DebugInstanceBadge",components:{DebugComponentWrapper:dC,BBadge:rW.k},data(){return{instance:window.location.hostname.split(".")[0]}},computed:{variant(){let e="dark";return"local"===this.instance?e="secondary":"test"===this.instance?e="danger":"develop"===this.instance&&(e="warning"),e}}},oW=sW,lW=(0,ew.Z)(oW,aW,nW,!1,null,"26284be6",null),dW=lW.exports;ow.vI.add(uw.IJ7);var cW={name:"PageLogin",components:{ErrorUserMessage:cH,DebugInstanceBadge:dW,MaxWidthContainer:Tw,TopContentContainer:RG,WelcomeContentContainer:jG,WelcomeTitle:qG,ThePageSkeleton:$w,FormFieldInput:fk,LogoAuthPages:iw,Button:gw,ButtonLink:Fw},mixins:[hG,cG],data(){return{fetching:!1,email:null,password:null,defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},mounted(){null!=this.$refs.email&&this.$refs.email.$el.querySelector("input").focus()},async created(){const{oneTimeToken:e}=this.$route.query;e&&(await this.$store.dispatch("auth/loginWithOneTimeToken",{oneTimeToken:e}),await this.$router.replace({oneTimeToken:null}))},methods:{submit(){this.userErrorMessage=null,this.$refs.validationObserver.reset(),this.$refs.validationObserver.handleSubmit(this.login)},async login(){if(this.fetching)return;let e;this.fetching=!0,await Promise.all([new Promise((e=>setTimeout(e,200))),new Promise((async t=>{e=await this.$store.dispatch("auth/login",{email:this.email,password:this.password}),t()}))]),"success"!==e.status&&this.setUserErrorMessageFromResponse(e),this.fetching=!1}}},uW=cW,pW=(0,ew.Z)(uW,tW,iW,!1,null,"71938827",null),hW=pW.exports,mW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-no-company",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("TopContentContainer",[t("WelcomeTitle",{staticClass:"m-0",attrs:{white:"",centered:""}},[e._v(" "+e._s(e.$t("Betrieb erstellen"))+" ")])],1),e.success?t("MaxWidthContainer",{staticClass:"my-auto"},[t("p",[e._v(e._s(e.$t("Dein Betrieb wurde erfolgreich erstellt.")))]),t("ButtonLink",{staticClass:"mt-1 py-3",attrs:{to:{name:"register-additional-data"}}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1):t("MaxWidthContainer",{staticClass:"my-auto"},[t("p",[e._v(" "+e._s(e.$t("Du hast derzeit keine Berechtigung auf einen Betrieb zuzugreifen."))+" ")]),t("p",{staticClass:"mb-6"},[e._v(" "+e._s(e.$t("Ein Betriebsleiter kann dir Zugriff gewähren, oder du erstellst dir hier deinen eigenen Betrieb."))+" ")]),t("FormFieldDropdown",{staticClass:"w-100 mt-0",attrs:{name:"country",variant:"vertical-lg",required:"",label:e.$t("Land"),placeholder:e.countriesLoading?e.$t("Lade..."):e.$t("Wählen..."),disabled:e.fetching,state:!(null==e.country.id&&!e.dirty)&&null,items:e.countries,"items-loading":e.countriesLoading},model:{value:e.country,callback:function(t){e.country=t},expression:"country"}}),null!=e.country.id||e.dirty?t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}):t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.$t("{field} ist ein Pflichtfeld.",{field:e.$t("Land")}))+"  ")]),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching},on:{click:e.submit}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}
1):t("span",[e._v(e._s(e.$t("Betrieb erstellen")))])],1)],1)],1)],1)},fW=[],gW={data(){return{country:{id:null,name:null},userCountry:null}},computed:{...(0,C.Se)({countriesLoading:"regions/fetching"}),countries(){return[{name:"countries",id:"countries",items:Object.values(this.$store.state.regions.data)}]}},async created(){await Promise.all([this.$store.dispatch("regions/subscribe"),this.getUserCountry()]),this.countries[0].items.some((e=>e.code===this.userCountry&&(this.country=e,!0)))},methods:{async getUserCountry(){try{const e=await l().get("/admin/rest/region/userCountryCode");"success"===e.data.status&&(this.userCountry=e.data.data.toLowerCase())}catch(e){console.error("PageRegister: Unable to fetch user country code.",e.response.data)}}}},yW={name:"PageNoCompany",components:{ErrorUserMessage:cH,FormFieldDropdown:lk,MaxWidthContainer:Tw,TopContentContainer:RG,WelcomeTitle:qG,WelcomeContentContainer:jG,ThePageSkeleton:$w,Button:gw,ButtonLink:Fw},mixins:[cG,gW],data(){return{fetching:!1,dirty:!0,success:!1}},methods:{async submit(){if(this.userErrorMessage=null,this.dirty=!1,null!=this.country.id){this.fetching=!0;try{const{data:e}=await l().post("/admin/rest/user/create_company_for_no_company_user",{version:"2.0",data:{regionId:this.country.id}});null==e||"success"!==e.status?this.setUserErrorMessageFromResponse(e):(await this.$store.dispatch("auth/refreshUserCompanies"),this.success=!0)}catch(e){console.error(e),this.setUserErrorMessageFromResponse(e)}finally{this.fetching=!1}}}}},vW=yW,bW=(0,ew.Z)(vW,mW,fW,!1,null,"58a7b038",null),wW=bW.exports,CW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-password-lost",attrs:{"scroll-y":"","content-flex":""}},[t("div",{staticClass:"page-password-lost__content"},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}}):e.passwordReset?t("div",[t("FontAwesomeIcon",{staticClass:"mb-6 text-primary",attrs:{size:"7x",icon:["fal","paper-plane"]}}),t("h1",{staticClass:"page-check-mail__headline mb-4"},[e._v(" "+e._s(e.$t("Bitte überprüfe deine E-Mails!"))+" ")]),t("p",{staticClass:"mb-2"},[e._v(" "+e._s(e.messageEmailParts[0])+" "),t("strong",[e._v(e._s(e.email))]),e._v(" "+e._s(e.messageEmailParts[1])+" ")]),t("p",{staticClass:"mb-4"},[e._v(" "+e._s(e.$t("Klicke auf den Link in der E-Mail um dein Passwort zurückzusetzen."))+" ")]),t("p",{staticClass:"mb-4"},[e._v(" "+e._s(e.$t("Du hast keine E-Mail bekommen? Überprüfe bitte den Spam-Ordner."))+" "+e._s(e.messageResendParts[0])+" "),t("ButtonLink",{on:{click:e.reset}},[e._v(e._s(e.messageResendParts[1]))]),e._v(" "+e._s(e.messageResendParts[2])+" ")],1),e.userErrorMessage?t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.userErrorMessage)+" ")]):e._e(),t("p",[t("ButtonLink",{attrs:{to:{name:"login"}}},[e._v(e._s(e.$t("Zurück zum Login.")))])],1)],1):t("div",[t("LogoAuthPages"),t("h1",{staticClass:"page-password-lost__headline"},[e._v(" "+e._s(e.$t("Passwort zurücksetzen"))+" ")]),t("p",{staticClass:"page-password-lost__subline"},[e._v(" "+e._s(e.$t("Wir senden dir ein E-Mail zu, mit Hilfe dessen du ein neues Passwort setzen kannst."))+" "),t("ButtonLink",{attrs:{to:{name:"login"}}},[e._v(e._s(e.$t("Zurück zum Login.")))])],1),t("ValidationObserver",{ref:"validationObserver",attrs:{slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{staticClass:"w-100",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("ValidationProvider",{attrs:{rules:"required|email",slim:"",name:e.$t("E-Mail-Adresse")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a,failed:n}){return[t("FormFieldInput",{ref:"email",staticClass:"w-100 mt-0",attrs:{name:"email",type:"email",autocomplete:"email",variant:"vertical-lg",label:e.$t("E-Mail-Adresse"),placeholder:e.$t("E-Mail-Adresse"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.emailInternal,callback:function(t){e.emailInternal=t},expression:"emailInternal"}})]}}],null,!0)}),e.firstError(i)?t("p",{staticClass:"text-danger"},[e._v(e._s(e.firstError(i))+" ")]):t("ErrorUserMessage",{attrs:{"show-first-only":"","error-user-message":e.userErrorMessage}}),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}
1):t("span",[e._v(e._s(e.$t("Passwort zurücksetzen")))])],1)],1)]}}])})],1)],1)])},FW=[];ow.vI.add(uw.IJ7,a_.XCy,yF.AX7);var AW={name:"PagePasswordLost",components:{ErrorUserMessage:cH,ThePageSkeleton:$w,LogoAuthPages:iw,FormFieldInput:fk,Button:gw,ButtonLink:Fw},mixins:[hG,cG],props:{email:{type:String,default:null}},data(){return{emailInternal:this.email,fetching:!1,passwordReset:!1,messageEmail:this.$t("Wir haben dir eine E-Mail an {email} gesendet.",{email:"#####"}),messageResend:this.$t("Sollte die E-Mail nicht auffindbar sein, {linkStart}klicke hier, um sie nochmal zu senden.{linkEnd}",{linkStart:"#####",linkEnd:"#####"}),defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},computed:{messageEmailParts(){return this.messageEmail.split("#####")},messageResendParts(){return this.messageResend.split("#####")}},mounted(){null!=this.$refs.email&&this.$refs.email.$el.querySelector("input").focus()},methods:{submit(){this.userErrorMessage=null,this.$refs.validationObserver.reset(),this.$refs.validationObserver.handleSubmit(this.reset)},async reset(){if(this.fetching)return;let e;this.fetching=!0,await Promise.all([new Promise((e=>setTimeout(e,200))),new Promise((async t=>{try{const{data:t}=await l().post("/admin/rest/user/password_lost",{version:"2.0",data:{email:this.emailInternal}});e=t}catch(i){null!=i&&null!=i.response&&(e=i.response.data)}t()}))]),null!=e&&"success"===e.status?this.passwordReset=!0:this.setUserErrorMessageFromResponse(e),this.fetching=!1}}},kW=AW,SW=(0,ew.Z)(kW,CW,FW,!1,null,"fd2009fc",null),EW=SW.exports,IW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-password-reset",attrs:{"scroll-y":"","content-flex":""}},[t("div",{staticClass:"page-password-reset__content"},[t("LogoAuthPages"),t("h1",{staticClass:"page-password-reset__headline"},[e._v(" "+e._s(e.$t("Setze dein neues Passwort"))+" ")]),e.invalid?e._e():t("p",{staticClass:"page-password-reset__subline"},[e.passwordReset?t("span",[e._v(e._s(e.$t("Dein Passwort wurde erfolgreich gespeichert."))+" ")]):t("span",[e._v(e._s(e.$t("Hier kannst du dein neues Passwort eingeben."))+" ")]),t("ButtonLink",{attrs:{to:{name:"login"}}},[e._v(e._s(e.$t("Zurück zum Login.")))])],1),e.invalid||e.passwordReset?e._e():t("ValidationObserver",{ref:"validationObserver",attrs:{slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{staticClass:"w-100",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("ValidationProvider",{attrs:{rules:"required|min:8",slim:"",name:e.$t("Passwort")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{ref:"password",staticClass:"w-100",attrs:{name:"password",type:"password",autocomplete:"new-password",variant:"vertical-lg",label:e.$t("Passwort"),placeholder:e.$t("Passwort"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})]}}],null,!0)}),t("p",{staticClass:"text-danger"},[e._v(e._s(e.firstError(i)||e.userErrorMessage)+" ")]),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}):t("span",[e._v(e._s(e.$t("Passwort speichern")))])],1)],1)]}}],null,!1,1020453913)}),e.invalid?t("div",[t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),t("ButtonLink",{attrs:{to:{name:"login"}}},[e._v(e._s(e.$t("Zurück zum Login.")))])],1):e._e()],1)])},_W=[];ow.vI.add(uw.IJ7,a_.XCy,yF.AX7);var DW={name:"PagePasswordReset",components:{ErrorUserMessage:cH,ThePageSkeleton:$w,LogoAuthPages:iw,FormFieldInput:fk,Button:gw,ButtonLink:Fw},mixins:[hG,cG],data(){return{fetching:!1,password:null,passwordReset:!1,invalid:!1,defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},async created(){await this.$store.dispatch("auth/logout");try{const{data:e}=await l().post("/admin/rest/user/verify_password_reset_token",{version:"2.0",data:{passwordToken:this.$route.params.token}});"success"!==e.status&&(this.invalid=!0,this.setUserErrorMessageFromResponse(e))}catch(e){this.invalid=!0,null==e||null==e.response?this.setUserErrorMessageFromResponse(null):this.setUserErrorMessageFromResponse(e.response.data)}},mounted(){null!=this.$refs.password&&this.$refs.password.$el.querySelector("input").focus()},methods:{submit(){this.userErrorMessage=null,this.$refs.validationObserver.reset(),this.$refs.validationObserver.handleSubmit(this.reset)},async reset(){if(this.fetching)return;let e;this.fetching=!0,await Promise.all([new Promise((e=>setTimeout(e,200))),new Promise((async t=>{try{const{data:t}=await l().post("/admin/rest/user/password_reset",{version:"2.0",data:{passwordToken:this.$route.params.token,password:this.password}});e=t}catch(i){null!=i&&null!=i.response&&(e=i.response.data)}t()}))]),null!=e&&"success"===e.status?this.passwordReset=!0:this.setUserErrorMessageFromResponse(e),this.fetching=!1}}},MW=DW,PW=(0,ew.Z)(MW,IW,_W,!1,null,"248e3474",null),TW=PW.exports,xW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-register",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("button",{staticClass:"page-register__button-back",on:{click:e.onButtonBack}},[t("FontAwesomeIcon",{staticClass:"page-register__button-back-icon",attrs:{icon:"angle-left"}})],1),t("TopContentContainer",{staticClass:"page-register__top-content-container"},[t("WelcomeTitle",{staticClass:"m-0",attrs:{white:"",centered:""}},[e._v(" "+e._s(e.$t("Wähle dein Land und melde dich an."))+" ")])],1),t("MaxWidthContainer",{staticClass:"my-auto"},[t("ValidationObserver",{ref:"validationObserver",staticClass:"w-100",scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{staticClass:"w-100",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submit.apply(null,arguments)}}},[t("ValidationProvider",{attrs:{rules:"FormFieldDropdownRequired",name:e.$t("Land")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a,failed:n}){return[t("FormFieldDropdown",{staticClass:"w-100 mt-0",attrs:{name:"country",variant:"vertical-lg",required:"",label:e.$t("Land"),placeholder:e.countriesLoading?e.$t("Lade..."):e.$t("Wählen..."),disabled:e.fetching,state:!(i.length>0&&!a)&&null,items:e.countries,"items-loading":e.countriesLoading},model:{value:e.country,callback:function(t){e.country=t},expression:"country"}})]}}],null,!0)}),e._e(),e._e(),t("ValidationProvider",{attrs:{rules:"required|email",slim:"",name:e.$t("E-Mail-Adresse")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a,failed:n}){return[t("FormFieldInput",{ref:"email",staticClass:"w-100",attrs:{name:"email",type:"email",autocomplete:"email",variant:"vertical-lg",label:e.$t("E-Mail-Adresse"),placeholder:e.$t("E-Mail-Adresse"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}})]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:"required|min:8",slim:"",name:e.$t("Passwort")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{staticClass:"w-100",attrs:{name:"password",type:"password",autocomplete:"new-password",variant:"vertical-lg",label:e.$t("Passwort"),placeholder:e.$t("Passwort"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.userErrorMessage=null}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})]}}],null,!0)}
1),e.$store.state.regions.errors.length>0?t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.$t("Die Liste der verfügbaren Länder konnte nicht geladen werden. Bitte überprüfe deine Internetverbindung und lade die Seite neu."))+" ")]):e.firstError(i)?t("p",{staticClass:"text-danger"},[e._v(e._s(e.firstError(i))+" ")]):t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),t("Button",{staticClass:"my-0",attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}):t("span",[e._v(e._s(e.$t("Jetzt starten!")))])],1)],1)]}}])}),t("p",{staticClass:"page-register__bottom-link mt-3 mb-0"},[e._v(" "+e._s(e.agbMessagePartOne)+" "),t("ButtonLink",{attrs:{href:"https://www.farmdok.com/agb/",target:"_blank"}},[e._v(e._s(e.$t("Allgemeinen Geschäftsbedingungen (AGB)")))]),e._v(" "+e._s(e.agbMessagePartTwo)+" ")],1),t("p",{staticClass:"mt-4 mb-0"},[e._v(" "+e._s(e.$t("Du hast bereits ein Konto?"))+" "),t("ButtonLink",{attrs:{to:{name:"login"}}},[e._v(e._s(e.$t("Klicke hier um dich einzuloggen.")))])],1)],1)],1)],1)},BW=[],OW=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-welcome",class:{"page-welcome--with-background-image":null!=e.backgroundImages},style:e.styleBackgroundImages,attrs:{"scroll-y":""}},["welcome"!==e.step?t("button",{staticClass:"page-welcome__button-back",on:{click:e.previousStep}},[t("FontAwesomeIcon",{staticClass:"page-welcome__button-back-icon",attrs:{icon:"angle-left"}})],1):e._e(),t(e.stepComponent,{tag:"Component",staticClass:"page-welcome__content",attrs:{type:e.type,farmingSystem:e.farmingSystem,activityTypes:e.activityTypes,crops:e.crops,goals:e.goals,size:e.size},on:{background:t=>e.backgroundImages=t,change:e.change,next:e.nextStep}})],1)},$W=[],RW=function(){var e=this,t=e._self._c;return t("WelcomeContentContainer",{staticClass:"step-farmer-crops",attrs:{"padding-top":""},scopedSlots:e._u([{key:"default",fn:function(){return[t("MaxWidthContainer",{attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{white:""}},[e._v(" "+e._s(e.$t("Welche Kulturen baust du an?"))+" ")])],1),t("MaxWidthContainer",{staticClass:"mt-auto",attrs:{grid:""}},[t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("agriculture")},on:{click:()=>e.onClick("agriculture")}},[e._v(" "+e._s(e.$t("Ackerkulturen"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("greening")},on:{click:()=>e.onClick("greening")}},[e._v(" "+e._s(e.$t("Grünland und Feldfutterbau"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("vegetables")},on:{click:()=>e.onClick("vegetables")}},[e._v(" "+e._s(e.$t("Gemüse"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("herbs")},on:{click:()=>e.onClick("herbs")}},[e._v(" "+e._s(e.$t("Heil- und Gewürzpflanzen"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("wine")},on:{click:()=>e.onClick("wine")}},[e._v(" "+e._s(e.$t("Wein"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("fruit_and_hops")},on:{click:()=>e.onClick("fruit_and_hops")}},[e._v(" "+e._s(e.$t("Obst und Hopfen"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("christmas_trees")},on:{click:()=>e.onClick("christmas_trees")}},[e._v(" "+e._s(e.$t("Christbaumkulturen"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.cropsComputed.includes("others")},on:{click:()=>e.onClick("others")}},[e._v(" "+e._s(e.$t("Andere"))+" ")])],1)]},proxy:!0},{key:"cta-container",fn:function(){return[t("MaxWidthContainer",[t("Button",{staticClass:"my-0",attrs:{variant:"primary",size:"lg",block:"",disabled:e.cropsComputed.length<1},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.titleNext)+" ")])],1)]},proxy:!0}])})},NW=[],zW=i.p+"img/FARMDOK_Onboarding_Soy_Landscape.4ce83cec.jpg",LW=i.p+"img/FARMDOK_Onboarding_Soy_Portrait.b19512d7.jpg",VW=function(){var e=this,t=e._self._c;return t("Button",{staticClass:"button-onboarding",class:{"button-onboarding--active":e.active},attrs:{variant:"white",size:"lg",block:"",pressed:!1},on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)},UW=[],jW={name:"ButtonOnboarding",components:{Button:gw},props:{active:{type:Boolean,default:!1}}},HW=jW,GW=(0,ew.Z)(HW,VW,UW,!1,null,"63bd6460",null),WW=GW.exports,ZW={name:"StepFarmerCrops",components:{ButtonOnboarding:WW,MaxWidthContainer:Tw,WelcomeContentContainer:jG,WelcomeTitle:qG,Button:gw},props:{crops:{type:[Array,String,null],default:null}},computed:{cropsComputed(){return Array.isArray(this.crops)?this.crops:[]},titleNext(){return this.cropsComputed.length<1?this.$t("Wähle zumindest 1"):this.$t("Weiter")}},mounted(){this.$emit("background",{image:LW,imageLandscape:zW})},methods:{onClick(e){this.cropsComputed.includes(e)?this.$emit("change",{key:"crops",value:this.cropsComputed.filter((t=>t!==e))}):this.$emit("change",{key:"crops",value:[...this.cropsComputed,e]})}}},KW=ZW,qW=(0,ew.Z)(KW,RW,NW,!1,null,"b8d8fddc",null),YW=qW.exports,JW=function(){var e=this,t=e._self._c;return t("WelcomeContentContainer",{staticClass:"step-farmer-goals",attrs:{"padding-top":""},scopedSlots:e._u([{key:"default",fn:function(){return[t("MaxWidthContainer",{attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{white:""}}
1,[e._v(" "+e._s(e.$t("Was sind deine Ziele?"))+" ")])],1),t("MaxWidthContainer",{staticClass:"mt-auto",attrs:{grid:""}},[t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("paperless")},on:{click:()=>e.onClick("paperless")}},[e._v(" "+e._s(e.$t("Papierlos arbeiten"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("better_organisation")},on:{click:()=>e.onClick("better_organisation")}},[e._v(" "+e._s(e.$t("Organisation verbessern"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("legal_requirements")},on:{click:()=>e.onClick("legal_requirements")}},[e._v(" "+e._s(e.$t("Aufzeichnungspflichten erfüllen"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("reduce_costs")},on:{click:()=>e.onClick("reduce_costs")}},[e._v(" "+e._s(e.$t("Kosten senken"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("maximize_output")},on:{click:()=>e.onClick("maximize_output")}},[e._v(" "+e._s(e.$t("Ertrag maximieren"))+" ")]),t("ButtonOnboarding",{attrs:{active:e.goalsComputed.includes("others")},on:{click:()=>e.onClick("others")}},[e._v(" "+e._s(e.$t("Andere"))+" ")])],1)]},proxy:!0},{key:"cta-container",fn:function(){return[t("MaxWidthContainer",[t("Button",{staticClass:"my-0",attrs:{variant:"primary",size:"lg",block:"",disabled:e.goalsComputed.length<2},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.titleNext)+" ")])],1)]},proxy:!0}])})},XW=[],QW=i.p+"img/FARMDOK_Onboarding_Crop_Landscape.63adc2bb.jpg",eZ=i.p+"img/FARMDOK_Onboarding_Crop_Portrait.c7fe6132.jpg",tZ={name:"StepFarmerGoals",components:{ButtonOnboarding:WW,MaxWidthContainer:Tw,WelcomeContentContainer:jG,WelcomeTitle:qG,Button:gw},props:{goals:{type:[Array,String,null],default:null}},computed:{goalsComputed(){return Array.isArray(this.goals)?this.goals:[]},titleNext(){return this.goalsComputed.length<2?this.$t("Wähle zumindest 2"):this.$t("Weiter")}},mounted(){this.$emit("background",{image:eZ,imageLandscape:QW})},methods:{onClick(e){this.goalsComputed.includes(e)?this.$emit("change",{key:"goals",value:this.goalsComputed.filter((t=>t!==e))}):this.$emit("change",{key:"goals",value:[...this.goalsComputed,e]})}}},iZ=tZ,aZ=(0,ew.Z)(iZ,JW,XW,!1,null,"ee7a4274",null),nZ=aZ.exports,rZ=function(){var e=this,t=e._self._c;return t("WelcomeContentContainer",{staticClass:"step-farmer-size",attrs:{"padding-top":""},scopedSlots:e._u([{key:"default",fn:function(){return[t("MaxWidthContainer",{staticClass:"mt-auto",attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{white:""}},[e._v(" "+e._s(e.$t("Wie viele Hektar werden bewirtschaftet?"))+" ")])],1),t("MaxWidthContainer",[t("FormInputNumberOnboarding",{model:{value:e.hectaresComputed,callback:function(t){e.hectaresComputed=t},expression:"hectaresComputed"}})],1),t("MaxWidthContainer",{staticClass:"mt-auto",attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{white:""}},[e._v(" "+e._s(e.$t("Wie viele Mitarbeiter gibt es?"))+" ")])],1),t("MaxWidthContainer",[t("FormInputNumberOnboarding",{model:{value:e.employeesComputed,callback:function(t){e.employeesComputed=t},expression:"employeesComputed"}})],1)]},proxy:!0},{key:"cta-container",fn:function(){return[t("MaxWidthContainer",[t("Button",{staticClass:"my-0",attrs:{variant:"primary",size:"lg",block:"",disabled:e.hectaresComputed<1},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1)]},proxy:!0}])})},sZ=[],oZ=i.p+"img/FARMDOK_Onboarding_Soil_Sampling_Landscape.a67eac4a.jpg",lZ=i.p+"img/FARMDOK_Onboarding_Soil_Sampling_Portrait.cd05f767.jpg",dZ=function(){var e=this,t=e._self._c;return t("BFormInput",{staticClass:"form-input-number-onboarding",attrs:{type:"number",inputmode:"decimal",pattern:"[0-9]*",min:"1",placeholder:"0",size:"lg",block:"",formatter:e.formatter},model:{value:e.valueComputed,callback:function(t){e.valueComputed=t},expression:"valueComputed"}})},cZ=[],uZ={name:"FormInputNumberOnboarding",model:{prop:"value",event:"update"},props:{value:{type:String,default:null},formatter:{type:Function,default:void 0}},computed:{valueComputed:{get(){return"string"!==typeof this.value?null:this.value},set(e){this.$emit("update",e)}}}},pZ=uZ,hZ=(0,ew.Z)(pZ,dZ,cZ,!1,null,"d19a7aae",null),mZ=hZ.exports,fZ={name:"StepFarmerSize",components:{FormInputNumberOnboarding:mZ,MaxWidthContainer:Tw,WelcomeContentContainer:jG,WelcomeTitle:qG,Button:gw},props:{size:{type:[Object,String,null],default:null}}
1,mounted(){this.$emit("background",{image:lZ,imageLandscape:oZ})},computed:{sizeComputed(){let e=null,t=null;return null!=this.size&&"string"===typeof this.size.employees&&({employees:e}=this.size),null!=this.size&&"string"===typeof this.size.hectares&&({hectares:t}=this.size),{employees:e,hectares:t}},hectaresComputed:{get(){return this.sizeComputed.hectares},set(e){this.$emit("change",{key:"size",value:{...this.size,hectares:e}})}},employeesComputed:{get(){return this.sizeComputed.employees},set(e){this.$emit("change",{key:"size",value:{...this.size,employees:e}})}}}},gZ=fZ,yZ=(0,ew.Z)(gZ,rZ,sZ,!1,null,"7fabf038",null),vZ=yZ.exports,bZ=function(){var e=this,t=e._self._c;return t("WelcomeContentContainer",{staticClass:"step-farmer-work",attrs:{"padding-top":""},scopedSlots:e._u([{key:"default",fn:function(){return[t("MaxWidthContainer",{attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{white:""}},[e._v(" "+e._s(e.$t("Wie bewirtschaftest du?"))+" ")])],1),t("MaxWidthContainer",{staticClass:"mt-auto"},[t("ButtonOnboarding",{attrs:{active:"organic"===e.farmingSystem},on:{click:function(t){return e.$emit("change",{key:"farmingSystem",value:"organic"})}}},[e._v(" "+e._s(e.$t("Biologisch"))+" ")]),t("ButtonOnboarding",{attrs:{active:"conventional"===e.farmingSystem},on:{click:function(t){return e.$emit("change",{key:"farmingSystem",value:"conventional"})}}},[e._v(" "+e._s(e.$t("Konventionell"))+" ")])],1)]},proxy:!0},{key:"cta-container",fn:function(){return[t("MaxWidthContainer",[t("Button",{staticClass:"my-0",attrs:{variant:"primary",size:"lg",block:"",disabled:null==e.farmingSystem},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1)]},proxy:!0}])})},wZ=[],CZ=i.p+"img/FARMDOK_Onboarding_Field_Portrait.01c9521a.jpg",FZ=i.p+"img/FARMDOK_Onboarding_Tractor_Field_Landscape.89723559.jpg",AZ={name:"StepFarmerWork",components:{ButtonOnboarding:WW,MaxWidthContainer:Tw,WelcomeContentContainer:jG,WelcomeTitle:qG,Button:gw},props:{farmingSystem:{type:String,default:null}},mounted(){this.$emit("background",{image:CZ,imageLandscape:FZ})}},kZ=AZ,SZ=(0,ew.Z)(kZ,bZ,wZ,!1,null,"8bfa548c",null),EZ=SZ.exports,IZ=function(){var e=this,t=e._self._c;return t("WelcomeContentContainer",{staticClass:"step-welcome",attrs:{"cta-container-transparent":""},scopedSlots:e._u([{key:"default",fn:function(){return[t("TopContentContainer"),t("MaxWidthContainer",{staticClass:"step-welcome__logo-container mt-auto",attrs:{size:"lg"}},[t("LogoAuthPages"),t("WelcomeTitle",{attrs:{centered:""}},[e._v(" "+e._s(e.$t("Verwirkliche deinen Erfolg am Feld!"))+" ")]),t("p",[e._v(e._s(e.$t("Von der Aussaat bis zur Ernte, alles über deine Felder an einem Ort.")))])],1),t("MaxWidthContainer",{staticClass:"mb-auto"},[t("Button",{staticClass:"m-0",attrs:{variant:"primary",size:"lg",block:""},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.$t("Jetzt starten"))+" ")]),t("ButtonLink",{staticClass:"mt-1 py-3",attrs:{to:{name:"login"}}},[e._v(" "+e._s(e.$t("Ich habe bereits einen Account"))+" ")])],1)]},proxy:!0}])})},_Z=[],DZ={name:"StepWelcome",components:{WelcomeContentContainer:jG,WelcomeTitle:qG,TopContentContainer:RG,MaxWidthContainer:Tw,LogoAuthPages:iw,Button:gw,ButtonLink:Fw},mounted(){this.$emit("background",null)}},MZ=DZ,PZ=(0,ew.Z)(MZ,IZ,_Z,!1,null,"5827eb12",null),TZ=PZ.exports;ow.vI.add(uw.EyR);const xZ="FARMDOK_ONBOARDING_INFO",BZ={welcome:{component:TZ,next:{name:"welcome",params:{type:"farmer",step:"work"}}},"farmer/work":{component:EZ,next:{name:"welcome",params:{type:"farmer",step:"crops"}},previous:{name:"welcome",params:{type:"type"}}},"farmer/crops":{component:YW,next:{name:"welcome",params:{type:"farmer",step:"goals"}},previous:{name:"welcome",params:{type:"farmer",step:"work"}}},"farmer/goals":{component:nZ,next:{name:"welcome",params:{type:"farmer",step:"size"}},previous:{name:"welcome",params:{type:"farmer",step:"crops"}}},"farmer/size":{component:vZ,next:{name:"register"},previous:{name:"welcome",params:{type:"farmer",step:"goals"}}}};var OZ={name:"PageWelcome",components:{ThePageSkeleton:$w,LogoAuthPages:iw,MaxWidthContainer:Tw},data(){return{backgroundImages:null,type:"farmer",farmingSystem:null,activityTypes:null,crops:null,goals:null,
1size:null}},computed:{step(){const{type:e,step:t}=this.$route.params;return null==e?"welcome":"type"===e&&null==t?"type":[e,t].join("/")},stepComponent(){return null==BZ[this.step]?TZ:BZ[this.step].component},styleBackgroundImages(){return null==this.backgroundImages?null:{"--image":`url('${this.backgroundImages.image}')`,"--image-landscape":`url('${this.backgroundImages.imageLandscape}')`}}},created(){if(null!=localStorage.getItem(xZ))try{this.initFromLocalStorage()}catch(e){console.error(e),localStorage.removeItem(xZ)}null==BZ[this.step]&&this.$router.push({name:"welcome"})},methods:{initFromLocalStorage(){if(null==localStorage.getItem(xZ))return;const e=JSON.parse(localStorage.getItem(xZ));Object.keys(e).forEach((t=>{this[t]=e[t]}))},change({key:e,value:t}){this[e]=t,"type"===e&&(this.farmingSystem=null,this.activityTypes=null,this.crops=null,this.goals=null,this.size=null),localStorage.setItem(xZ,JSON.stringify({type:this.type,farmingSystem:this.farmingSystem,activityTypes:this.activityTypes,crops:this.crops,goals:this.goals,size:this.size}))},nextStep(){if(null==BZ[this.step])return;let{next:e}=BZ[this.step];"function"===typeof e&&(e=e(this.type)),this.$router.push(e)},previousStep(){null!=BZ[this.step]&&this.$router.push(BZ[this.step].previous)}}},$Z=OZ,RZ=(0,ew.Z)($Z,OW,$W,!1,null,"54a73b92",null),NZ=RZ.exports;ow.vI.add(uw.IJ7,uw.EyR);var zZ={name:"PageRegister",components:{ErrorUserMessage:cH,WelcomeTitle:qG,ThePageSkeleton:$w,FormFieldDropdown:lk,FormFieldInput:fk,WelcomeContentContainer:jG,MaxWidthContainer:Tw,TopContentContainer:RG,Button:gw,ButtonLink:Fw},mixins:[hG,cG,gW],data(){return{fetching:!1,email:null,password:null,agbMessage:this.$t("Durch erstellen eines FARMDOK Accounts stimmst du den {agb} von FARMDOK zu.",{agb:"#####"}),defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},computed:{agbMessagePartOne(){return this.agbMessage.split("#####")[0]},agbMessagePartTwo(){return this.agbMessage.split("#####")[1]}},mounted(){null!=this.$refs.email&&this.$refs.email.$el.querySelector("input").focus()},methods:{onButtonBack(){this.$router.go(-1)},submit(){this.userErrorMessage=null,this.$refs.validationObserver.reset(),this.$refs.validationObserver.handleSubmit(this.register)},async register(){if(this.fetching)return;this.fetching=!0;let e,t=null;if(null!=localStorage.getItem(xZ))try{t=JSON.parse(localStorage.getItem(xZ)),null!=t.size&&null!=t.size.hectares&&(t.size.hectares=Number(t.size.hectares)),null!=t.size&&null!=t.size.employees&&(t.size.employees=Number(t.size.employees)),null!=t.size&&null!=t.size.customers&&(t.size.customers=Number(t.size.customers))}catch(i){console.error(i)}await Promise.all([new Promise((e=>setTimeout(e,200))),new Promise((async i=>{e=await this.$store.dispatch("auth/register",{regionId:this.country.id,email:this.email,password:this.password,onboarding:t}),i()}))]),null!=e&&"success"===e.status?(this.$root.$emit("register--success",t),localStorage.removeItem(xZ),await this.$router.push({name:"register-support"})):this.setUserErrorMessageFromResponse(e),this.fetching=!1}}},LZ=zZ,VZ=(0,ew.Z)(LZ,xW,BW,!1,null,"735a9f3a",null),UZ=VZ.exports,jZ=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-register-complete",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("TopContentContainer",[e.fetching||e.userErrorMessage?e._e():t("WelcomeTitle",{staticClass:"m-0",attrs:{white:"",centered:""}},[e._v(" "+e._s(e.$t("Geschafft!"))+" ")])],1),e.fetching?t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}}):e._e(),e.fetching?e._e():t("MaxWidthContainer",{staticClass:"mt-auto pb-0",attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{centered:""}},[e._v(" "+e._s(e.$t("Deine E-Mail ist bestätigt."))+" ")])],1),e.fetching?e._e():t("MaxWidthContainer",{staticClass:"mb-auto pt-0"},[null!=e.userErrorMessage?t("ErrorUserMessage",{staticClass:"mb-4",attrs:{"error-user-message":e.userErrorMessage}}):e._e(),null!=e.userEmail?t("p",{staticClass:"mb-2"},[e._v(" "+e._s(e.messageEmailParts[0])+" "),t("strong",[e._v(e._s(e.userEmail))]),e._v(" "+e._s(e.messageEmailParts[1])+" ")]):e._e(
1),e.$store.state.auth.loggedIn&&null==e.userErrorMessage?t("Button",{attrs:{variant:"primary",size:"lg",block:""},on:{click:e.onContinueClick}},[e._v(" "+e._s(e.$t("Weiter"))+" ")]):t("Button",{attrs:{variant:"primary",size:"lg",block:""},on:{click:e.onBackClick}},[e._v(" "+e._s(e.$t("Zurück zum Login"))+" ")])],1)],1)],1)},HZ=[];const{isMobileBrowser:GZ}=Bu.Z.helper;ow.vI.add(yF.AX7);const WZ=`${T}${M}fields`,ZZ=`${T}${M}register/additional-data/company`;var KZ={name:"PageRegisterComplete",components:{ErrorUserMessage:cH,ThePageSkeleton:$w,WelcomeContentContainer:jG,MaxWidthContainer:Tw,TopContentContainer:RG,WelcomeTitle:qG,Button:gw},mixins:[cG],data(){return{fetching:!0,userEmail:null,messageEmail:this.$t("Danke, dass Du Dich bei Farmdok registriert hast! Deine E-Mail {email} ist jetzt bestätigt. Klicke auf Weiter und danach helfen wir Dir beim Einstieg.",{email:"#####"}),defaultUserErrorMessage:this.$t("Unbekannter Fehler. Bitte überprüfe deine Internetverbindung.")}},computed:{messageEmailParts(){return this.messageEmail.split("#####")}},async created(){try{const{data:e}=await l().post("/admin/rest/user/confirm_email",{version:"2.0",data:{emailConfirmToken:this.$route.params.token}});"success"!==e.status?this.setUserErrorMessageFromResponse(e):(null!=this.$store.state.auth.user.id&&e.data.user.id!==this.$store.state.auth.user.id&&this.$store.dispatch("auth/logout"),this.userEmail=e.data.user.email,this.$root.$emit("register--email-confirmed",e.data.user.email),e.data.missingPassword&&await this.$router.push({name:"password-reset",params:{token:this.$route.params.token}}))}catch(e){null!=e&&null!=e.response?this.setUserErrorMessageFromResponse(e.response.data):this.setUserErrorMessageFromResponse(null)}this.fetching=!1},methods:{onContinueClick(){GZ()?window.location.href=ZZ:this.$router.push({name:"register-additional-data",params:{step:"company"}})},onBackClick(){if(this.userErrorMessage)return GZ()?void(window.location.href=WZ):void this.$router.push({name:"login"});this.onContinueClick()}}},qZ=KZ,YZ=(0,ew.Z)(qZ,jZ,HZ,!1,null,"1ca16268",null),JZ=YZ.exports,XZ=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{staticClass:"page-register",attrs:{"scroll-y":""}},[t("WelcomeContentContainer",[t("TopContentContainer",[e.fetching?t("FontAwesomeIcon",{staticClass:"text-medium mb-4",attrs:{size:"3x",spin:"",icon:["fal","spinner-third"]}}):e._e(),e.fetching?t("span",[e._v(e._s(e.$t("Dein Profil wird für dich angepasst!")))]):t("span",[e._v(e._s(e.$t("Fast am Ziel!")))])],1),t("MaxWidthContainer",{staticClass:"mt-auto pb-0",attrs:{size:"lg"}},[t("WelcomeTitle",{attrs:{centered:""}},[e._v(" "+e._s(e.$t("Lass uns zusammen arbeiten!"))+" ")]),t("p",[e._v(e._s(e.$t("Wir fühlen uns dazu verpflichtet dir maßgeschneiderte Unterstützung zu bieten!")))])],1),t("MaxWidthContainer",{staticClass:"mb-auto",attrs:{left:""}},[t("FormFieldInput",{ref:"phone",staticClass:"w-100",attrs:{name:"phone",type:"tel",variant:"vertical-lg",label:e.$t("Telefonnummer"),placeholder:e.$t("Telefonnummer")},model:{value:e.tel,callback:function(t){e.tel=t},expression:"tel"}}),t("FormCheckbox",{staticClass:"text-left",attrs:{size:"lg",checked:!0,disabled:!0}},[e._v(" "+e._s(e.$t("Ich verstehe, Services & Support erfolgen per E-Mail."))+" ")]),t("FormCheckbox",{staticClass:"text-left",attrs:{size:"lg"},model:{value:e.newsletter,callback:function(t){e.newsletter=t},expression:"newsletter"}},[e._v(" "+e._s(e.$t("Ja, ich will den FARMDOK Newsletter bekommen!"))+" ")]),t("Button",{attrs:{type:"submit",variant:"primary",size:"lg",block:"",disabled:e.fetching},on:{click:e.next}},[e.fetching?t("FontAwesomeIcon",{staticClass:"text-white",attrs:{icon:"circle-notch",spin:""}}):t("span",[e._v(e._s(e.$t("Weiter")))])],1)],1)],1)],1)},QZ=[];ow.vI.add(uw.IJ7,a_.AX7);var eK={name:"PageRegisterSupport",components:{FormCheckbox:Gw,ThePageSkeleton:$w,FormFieldInput:fk,WelcomeContentContainer:jG,MaxWidthContainer:Tw,TopContentContainer:RG,WelcomeTitle:qG,Button:gw},data(){return{fetching:!0,tel:null,newsletter:!1}},computed:{currentCompany(){return this.$store.state.auth.currentCompanies[0]}},async mounted(){await new Promise((e=>setTimeout(e,1500))),this.fetching=!1},methods:{next(){this.$store.dispatch("auth/updateAndSyncUser",{newsletter:this.newsletter}),this.$store.dispatch("auth/updateAndSyncCurrentCompany",{id:this.currentCompany.id,data:{tel:this.tel}}),this.$router.push({name:"register-check-email"})}}},tK=eK,iK=(0,ew.Z)(tK,XZ,QZ,!1,null,"759382e6",null),aK=iK.exports;const nK=["company","address"];var rK=[{path:`${M}oauth/cnh`,redirect:`${M}activities/import/load-data/cnh`},{path:`${M}welcome/:type?/:step?`,name:"welcome",component:NZ,meta:{isFullscreen:!0},beforeEnter:async(e,t,i)=>(await Lb.dispatch("auth/subscribe"),Lb.state.auth.loggedIn?i({name:"home"}):i())},{path:`${M}login`,name:"login",component:hW,meta:{isFullscreen:!0},beforeEnter:async(e,t,i)=>{if(await Lb.dispatch("auth/subscribe"),Lb.state.auth.loggedIn){let t={name:"home"};if("string"===typeof e.query.redirect&&e.query.redirect.length>0){const i=Vl.resolve(e.query.redirect);if(null==i||null==i.resolved||"404"===i.resolved.name)return Lb.commit("redirectToAgriDat"),void(window.location=`${P}${e.query.redirect}`);t=i.resolved}i(t)}else i()}},{path:`${M}register`,name:"register",component:UZ,meta:{isFullscreen:!0},beforeEnter:async(e,t,i)=>Lb.state.auth.loggedIn?i({name:"home"}):i()},{path:`${M}register/support`,name:"register-support",component:aK,meta:{isFullscreen:!0}},{path:`${M}register/check-mail`,name:"register-check-email",component:eW,meta:{isFullscreen:!0,requiresAuth:!0},beforeEnter:async(e,t,i)=>Lb.state.auth.user.emailIsConfirmed?i({name:"home"}):i()},{path:`${M}register/complete/:token`,name:"register-complete",component:JZ,meta:{isFullscreen:!0}},{path:`${M}register/additional-data/:step?`,name:"register-additional-data",component:DG,meta:{isFullscreen:!0,requiresAuth:!0},beforeEnter:async(e,t,i)=>nK.includes(e.params.step)?null!=localStorage.getItem(Gl)&&!0!==JSON.parse(localStorage.getItem(Gl))?i({name:"home"}
1):i():i({name:"register-additional-data",params:{step:"company"}})},{path:`${M}password-lost`,name:"password-lost",component:EW,props:!0,meta:{isFullscreen:!0}},{path:`${M}password-reset/:token`,name:"password-reset",component:TW,meta:{isFullscreen:!0}},{path:`${M}no-company`,name:"no-company",component:wW,meta:{isFullscreen:!0,requiresAuth:!0}}],sK=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("router-view")},oK=[],lK=(0,b.defineComponent)({__name:"DaturaView",setup(e){return{__sfc:!0}}}),dK=lK,cK=(0,ew.Z)(dK,sK,oK,!1,null,"6c75be4e",null),uK=cK.exports,pK=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{pageFeatureTitle:i.router.currentRoute.meta?.label,pageFeatureEnabled:i.pageFeatureEnabled,pageFeatureVisible:i.pageFeatureVisible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t(i.TheContentbar,{scopedSlots:e._u([{key:"middle",fn:function(){return[t(i.Steps,{attrs:{current:i.currentStep,steps:i.stepsList}})]},proxy:!0},{key:"right",fn:function(){return[0===i.currentStep?t(i.Button,{attrs:{title:e.$t("Abbrechen"),"component-namespace-name":"ButtonCancel",variant:"lightest","tooltip-options":{boundary:"viewport"}},on:{click:()=>i.router.push({name:"drone"})}}):e._e(),1===i.currentStep?t(i.ButtonWithArrow,{attrs:{variant:"lightest",type:"left","component-namespace-name":"ButtonBack","tooltip-options":{boundary:"viewport"}},on:{click:()=>i.currentStep-=1}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]):e._e(),i.currentStep<2?t(i.ButtonWithArrow,{attrs:{componentNamespaceName:"ButtonNext",type:"right",disabled:!i.valid,"tooltip-options":{boundary:"viewport"}},on:{click:i.forward}},[e._v(" "+e._s(e.$t("Weiter"))+" ")]):e._e(),2===i.currentStep?t(i.Button,{attrs:{title:e.$t("Schließen"),"component-namespace-name":"ButtonClose","tooltip-options":{boundary:"viewport"}},on:{click:()=>i.router.push({name:"drone"})}}):e._e()]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[t("BContainer",[t("BRow",{staticClass:"my-6"},[t("BCol",{attrs:{cols:"2"}}),t("BCol",{attrs:{cols:"8"}},[t(i.StepAssessmentName,{directives:[{name:"show",rawName:"v-show",value:0===i.currentStep,expression:"currentStep === 0"}],attrs:{value:i.assessmentName},on:{"update:value":e=>i.assessmentName=e,"navigate:forward":i.forward}}),t(i.StepUpload,{directives:[{name:"show",rawName:"v-show",value:1===i.currentStep,expression:"currentStep === 1"}],attrs:{assessmentName:i.assessmentName},on:{"upload:complete":i.onUploadComplete}}),2===i.currentStep?t(i.StepAnalyse,{on:{"show:history":()=>i.router.push({name:"history"})}}):e._e()],1),t("BCol",{attrs:{cols:"2"}})],1)],1)]},proxy:!0}])})},hK=[],mK=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",[t(i.SidebarHeadline,{staticClass:"text-center",attrs:{text:`${e.$t("Analyse gestartet")??""}...`}}),t("p",{staticClass:"text-justify"},[e._v(" "+e._s(e.$t("Anleitung: Die KI-unterstützte Auswertung von Drohnenbilder ermöglicht es Stechapfelpflanzen im Soja zu erkennen und geolokalisiert in einer Karte zu kennzeichnen. Woher bekomme ich geeignete Drohnenbilder für diese Auswertung?"))+" "),t("BLink",{staticClass:"underlined",attrs:{href:"#"}},[e._v(e._s(e.$t("Klicke hier für mehr Infos ...")))])],1),t("div",{staticClass:"text-center my-6"},[t(i.Button,{attrs:{color:"primary","component-namespace-name":"ButtonShowHistory","tooltip-options":{boundary:"viewport"},outline:""},on:{click:()=>i.emit("show:history")}},[e._v(" "+e._s(e.$t("Job history öffnen"))+"... ")])],1)],1)},fK=[],gK=(0,b.defineComponent)({__name:"StepAnalyse",emits:["show:history"],setup(e,{emit:t}){return{__sfc:!0,emit:t,SidebarHeadline:iI,Button:gw}}}),yK=gK,vK=(0,ew.Z)(yK,mK,fK,!1,null,"2521860a",null),bK=vK.exports,wK=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",[t(i.SidebarHeadline,{staticClass:"text-center",attrs:{text:e.$t("Neues Assessment starten")??""}}),t("p",{staticClass:"text-justify"},[e._v(" "+e._s(e.$t("Anleitung: Die KI-unterstützte Auswertung von Drohnenbilder ermöglicht es Stechapfelpflanzen im Soja zu erkennen und geolokalisiert in einer Karte zu kennzeichnen. Woher bekomme ich geeignete Drohnenbilder für diese Auswertung?"))+" "),t("BLink",{staticClass:"underlined",attrs:{href:"#"}}
1,[e._v(e._s(e.$t("Klicke hier für mehr Infos ...")))])],1),t(i.FormFieldInput,{staticClass:"my-5",attrs:{value:e.value,label:e.$t("Assessment Name"),placeholder:e.$t("e.g. Datura 2024, flight day yyyy.mm.dd"),required:""},on:{update:e=>i.emit("update:value",e),keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:i.emit("navigate:forward")}}})],1)},CK=[],FK=(0,b.defineComponent)({__name:"StepAssessmentName",props:{value:{default:""}},emits:["update:value","navigate:forward"],setup(e,{emit:t}){return{__sfc:!0,emit:t,SidebarHeadline:iI,FormFieldInput:fk}}}),AK=FK,kK=(0,ew.Z)(AK,wK,CK,!1,null,"753ea3d9",null),SK=kK.exports,EK=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",[t(i.SidebarHeadline,{staticClass:"text-center",attrs:{text:e.$t("Drohnenbilder hochladen")??""}}),t("p",{staticClass:"text-justify"},[e._v(" "+e._s(e.$t("Anleitung: Der Umfang auszuwertender Bilddaten kann sehr groß sein. Es können Einzelbilder, eine .zip-Datei mit Bildern oder ein Order mit Bildern hochgeladen werden. Bei großen Datenmengen oder schlechter Internetverbindung kann das Hochladen mehrere Stunden dauern. Achtung: Die Benennung der Dateien muss eindeutig sein. Duplikate überschreiben das Original."))+" ")]),t(i.FileUploadTile,{attrs:{successfulFiles:i.uploadedFiles,failedFiles:i.failedFiles,required:!0,accept:["image/jpeg","application/zip"],hint:e.$t("Es können Dateien in den Formaten {fileFormats} und {lastFileFormat} importiert werden.",{fileFormats:".jpg, .JPG, .jpeg",lastFileFormat:".zip"}),actionLabel:e.$t("Upload"),progress:i.totalProgress},on:{action:i.upload,abort:()=>i.aboutToAbort=!0}}),i.totalProgress?t("p",{staticClass:"text-primary my-3"},[e._v(" "+e._s(e.$t("Upload in Arbeit ... DIESES FENSTER NICHT SCHLIESSEN!"))+" ")]):e._e(),i.exceededMaximumUploadSize?t(i.ErrorUserMessage,{attrs:{errorUserMessage:e.$t("Die zulässige Größe für ausstehende Uploads wurde überschritten. Limit wird in ca. 1 Woche automatisch zurückgesetzt.")}}):e._e(),t("BModal",{attrs:{cancelTitle:e.$t("Zurück"),okTitle:e.$t("Seite verlassen"),okVariant:"light",cancelVariant:"primary",headerClass:"border-0",centered:"",title:e.$t("Upload verlassen"),autofocusButton:"cancel",visible:i.aboutToLeave,lazy:""},on:{cancel:()=>i.aboutToLeave=!1,ok:function(e){return e.preventDefault(),i.nextRoute.apply(null,arguments)}}},[t("p",{staticClass:"my-4"},[e._v(e._s(e.$t("Achtung! Beim Verlassen der Seite wird das Hochladen abgebrochen!")))])]),t("BModal",{attrs:{cancelTitle:e.$t("Nein"),okTitle:e.$t("Ja"),okVariant:"light",cancelVariant:"primary",headerClass:"border-0",centered:"",title:`${e.$t("Abbrechen")}?`,autofocusButton:"cancel",visible:i.aboutToAbort,lazy:""},on:{cancel:()=>i.aboutToAbort=!1,ok:function(e){return e.preventDefault(),i.abort.apply(null,arguments)}}},[t("p",{staticClass:"my-4"},[e._v(e._s(e.$t("Möchten Sie das Assessment wirklich abbrechen?")))])])],1)},IK=[],_K=i(91410),DK=i(5042),MK=i.n(DK),PK=(0,b.defineComponent)({__name:"StepUpload",props:{assessmentName:{default:""}},emits:["upload:complete"],setup(e,{emit:t}){const i=e,a=Vb(),n=(0,NL.tv)(),r=(0,b.ref)((()=>{})),s=(0,b.ref)(!1);n.beforeEach(((e,t,i)=>"drone/new"===t.name&&y.value?(o.value=!0,r.value=i,!1):i()));const o=(0,b.ref)(!1),l=(0,b.ref)(!1),d=(0,b.computed)((()=>a.getters["auth/currentProcessOrderIds"][0])),c=(0,b.computed)((()=>a.getters["auth/accessToken"]())),u=(0,b.ref)([]),p=(0,b.ref)([]),h=(0,b.ref)([]),m=(0,b.ref)([]),f=(0,b.ref)([]),g=(0,b.ref)({}),y=(0,b.computed)((()=>{const e=Object.values(g.value);if(e.length)return e.reduce(((e,t)=>e+t),0)})),v=10;async function w(e){g.value={0:0},p.value=e;const t=k(i.assessmentName,e);try{const i=await a.dispatch("datura/import",t),n=i.files.map((e=>e.url));f.value=MK()(e,n).map((([e,t])=>[e,t])),f.value.filter(((e,t)=>t<v)).map(((e,t)=>C(t))).forEach(F)}catch(n){A(n)}}function C(e){const[t,i]=f.value[e],a=_K.iP({file:t,endpoint:i,chunkSize:10240,dynamicChunkSize:!0,attempts:200,delayBeforeAttempt:10,headers:{Authorization:`Bearer ${c.value}`},retryCodes:[408,502,503,504,400,0]});return m.value.push(a),a}function F(e,t){const[i]=f.value[t],a=t+v;e.on("progress",(e=>{g.value[t]=e.detail,g.value={...g.value}})),e.on("success",(()=>{if(100===g.value[t]&&(u.value.push(i),a<f.value.length)){const e=C(a);F(e,a)}})),e.on("error",(t=>{if("Server responded with 0. Stopping upload."===t.detail.message)return;const a=JSON.parse(t.detail.response.body);400===t.detail.response.statusCode&&"concurrentModification"===a.errorCode||(400!==t.detail.response.statusCode||"invalidData"!==a.errorCode?(h.value.push(i),g.value={...g.value}):e.resume())}))}function A({response:e}){s.value=400===e.status&&e.data.errorUserMessage?.[0].includes("User has exceeded maximum upload size"),h.value=p.value}function k(e,t){return{id:ma(),name:e,files:t.map((e=>({id:ma(),filename:e.name,filesize:e.size}
1))),processOrderId:d.value}}function S(){m.value.forEach((e=>e.abort())),m.value=[],g.value={},l.value=!1}return(0,b.watch)(y,(e=>{e===100*p.value.length&&0===h.value.length&&(g.value={},t("upload:complete"))})),(0,b.watch)(c,(e=>{m.value.forEach((t=>{t.headers.Authorization=`Bearer ${e}`}))})),{__sfc:!0,store:a,router:n,nextRoute:r,exceededMaximumUploadSize:s,emit:t,props:i,aboutToLeave:o,aboutToAbort:l,processOrderId:d,token:c,uploadedFiles:u,actionableFiles:p,failedFiles:h,uploadsInProgress:m,filesWithUrls:f,percentages:g,totalProgress:y,MAX_CONCURRENT_UPLOADS:v,upload:w,startUpload:C,subscribeToUploadEvents:F,determineError:A,toRequest:k,abort:S,ErrorUserMessage:cH,FileUploadTile:yH,SidebarHeadline:iI}}}),TK=PK,xK=(0,ew.Z)(TK,EK,IK,!1,null,"afe29146",null),BK=xK.exports,OK=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:e.tooltipOptionsWithDefaults,expression:"tooltipOptionsWithDefaults"}],staticClass:"tooltip-wrapper"},[t("BButton",e._g({staticClass:"button-with-arrow",attrs:{variant:e.variant,disabled:e.disabled}},e.$listeners),[t("span",{staticClass:"button-with-arrow__inner",class:{"button-with-arrow__inner--icon-left":"left"===e.type,"button-with-arrow__inner--icon-right":"right"===e.type}},[t("FontAwesomeIcon",{staticClass:"button-with-arrow__icon",class:{"button-with-arrow__icon--left":"left"===e.type,"button-with-arrow__icon--right":"right"===e.type},attrs:{icon:["far",e.icon]}}),e._t("default")],2)])],1)},$K=[];ow.vI.add(lw.eFW,lw.acZ);const RK={delay:500,placement:"bottom"};var NK={name:"ButtonWithArrow",props:{variant:{type:String,default:"primary"},type:{type:String,default:"right"},disabled:{type:Boolean,default:!1},tooltipOptions:{type:Object,default:null}},computed:{icon(){return"right"===this.type?"arrow-right":"left"===this.type?"arrow-left":null},tooltipOptionsWithDefaults(){return this.tooltipOptions?{...RK,...this.tooltipOptions}:null}}},zK=NK,LK=(0,ew.Z)(zK,OK,$K,!1,null,"efacf856",null),VK=LK.exports,UK=(0,b.defineComponent)({__name:"PageNewDroneAssessment",setup(e){const t=b["default"].i18n.translate,i=[{number:1,label:t("Start")},{number:2,label:t("Upload")},{number:3,label:t("Fertigstellen")}],a=(0,b.ref)(0),n=(0,NL.tv)(),r=Vb(),s=(0,b.computed)((()=>r.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_DATURA_CONTROL))),o=(0,b.computed)((()=>r.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_DATURA_CONTROL))),l=(0,b.ref)(""),d=(0,b.ref)(!1),c=(0,b.computed)((()=>{switch(a.value){case 0:return l.value.length>2;case 1:return d.value;default:return!0}}));function u(){c.value&&(a.value+=1)}function p(){d.value=!0,u()}return{__sfc:!0,t:t,stepsList:i,currentStep:a,router:n,store:r,pageFeatureEnabled:s,pageFeatureVisible:o,assessmentName:l,uploadComplete:d,valid:c,forward:u,onUploadComplete:p,StepAnalyse:bK,StepAssessmentName:SK,StepUpload:BK,TheContentbar:HL,ThePageSkeleton:$w,Steps:LU,Button:gw,ButtonWithArrow:VK}}}),jK=UK,HK=(0,ew.Z)(jK,pK,hK,!1,null,"25ad7e8e",null),GK=HK.exports,WK=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{pageFeatureTitle:i.router.currentRoute.meta?.label,pageFeatureEnabled:i.pageFeatureEnabled,pageFeatureVisible:i.pageFeatureVisible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t(i.TheContentbar,{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:a}){return[i.editMode?e._e():[t(i.Button,{attrs:{icon:"plus-circle",iconOnly:!1,"leading-icon":"","component-namespace-name":"ButtonNewAssessment",disabled:i.pageFeatureReadOnly,"tooltip-options":{boundary:"viewport"}},on:{click:function(e){return i.router.push({name:"drone/new"})}}},[e._v(" "+e._s(e.$t("Assessment erstellen"))+" ")]),t(i.Button,{attrs:{icon:"clock-rotate-left",iconOnly:!a,"leading-icon":"","component-namespace-name":"ButtonJobHistory",disabled:i.pageFeatureReadOnly,variant:"lightest","tooltip-options":{boundary:"viewport"}},on:{click:function(e){return i.router.push({name:"history"})}}},[e._v(" "+e._s(e.$t("Verlauf"))+" ")]),t(i.Button,{attrs:{icon:"cloud-arrow-down",iconOnly:!a,"leading-icon":"","component-namespace-name":"ButtonExport",disabled:i.pageFeatureReadOnly,variant:"lightest","tooltip-options":{boundary:"viewport"}},on:{click:()=>i.onShowModalExport(!0)}},[e._v(" "+e._s(e.$t("Exportieren"))+" ")])],i.editMode?[t(i.ButtonDropdown,{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben")??"",buttons:[]}}),t(i.Button,{attrs:{icon:["fas","map-location"],iconOnly:!a,"leading-icon":"","component-namespace-name":"ButtonViewMap",disabled:!1,variant:"lightest","tooltip-options":{boundary:"viewport"}}},[e._v(" "+e._s(e.$t("Karte anzeigen"))+" ")]),t(i.Button,{staticClass:"text-danger",attrs:{color:"lightest",icon:["fas","trash-alt"],"leading-icon":"","component-namespace-name":"ButtonDeleteAssessments",title:e.$t("Löschen"),iconOnly:!a,"tooltip-options":{boundary:"viewport"}}})]:e._e()]}},{key:"right",fn:function({contentbarLarge:e}){return[t(i.SearchBar,{attrs:{type:e?"large":"",searchFilter:i.searchTerm},on:{"update:searchFilter":function(e){i.searchTerm=e},"update:search-filter":function(e){i.searchTerm=e}}}),t(i.ProcessOrderSwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.CompanySwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.DropdownPageOptions,{staticClass:"ml-4",attrs:{exportDisabled:i.pageFeatureReadOnly,hideRestore:!0},on:{settings:i.onShowSettings,export:()=>i.onShowModalExport(!1)}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t(i.TableAssessmentsContainer,{directives:[{name:"show",rawName:"v-show",value:i.pageFeatureEnabled&&i.pageFeatureVisible,expression:"pageFeatureEnabled && pageFeatureVisible"}],ref:"tableContainerRef",attrs:{filterString:i.searchTerm,columns:i.assessmentsColumns},on:{"update:filterString":function(e){i.searchTerm=e},"update:filter-string":function(e){i.searchTerm=e},createAssessment:function(e){return i.router.push({name:"drone/new"})},"update:hot":e=>i.hot=e}}),t(i.ModalPageSettingsContainer,{ref:"modalPageSettings"}),i.showModalExport?t(i.ModalTableExport,{ref:"modalTableExport",attrs:{availableTypes:[{value:"xls",label:e.$t("XLS"),text:e.$t("Als Excel-Datei exportieren")}],filtered:!i.allRowsVisible,hot:i.hot,tableData:i.tableData,columns:i.tableColumns}}
1):e._e()]},proxy:!0}])})},ZK=[],KK=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}})},qK=[];const YK=b["default"].i18n.translate,JK={data:"id",noHeaderContextMenu:!0,header:{title:()=>"ID"},hiddenInPageSettings:!0,hidden:!0,width:200},XK={data:"select",type:"farmdok.checkbox.optional",noHeaderContextMenu:!0,fixedColumnsLeftUntilHere:!0,hiddenInPageSettings:!0,hidden:!1,width:45,disableColumnResize:!0},QK={data:"creationDate",header:{title:()=>YK("Erstellt")},readOnly:!0,type:"date",width:120,hiddenInPageSettings:!1,hidden:!1,columnSorting:FB,initialSortOrder:"desc",className:"bg-transparent"},eq={data:"fieldDropdownItem",type:"farmdok.dropdown",header:{title:()=>YK("FSNr-Schlag")??"",description:()=>b["default"].i18n.translate("Feldstücknummer - Feldname")??""},readOnly:!1,width:300,hiddenInPageSettings:!1,hidden:!1,className:"bg-transparent",columnSorting:VB,dropdown:{async getItems(e,t){const i=t.getDataAtRowProp(e,"processOrderId");return i?Lb.getters["fields/dropdownItems"](i):[]}},renderEmpty:()=>!1,renderer:"farmdok.optional"},tq={data:"assessmentName",type:"text",header:{title:()=>YK("Assessment Name")},readOnly:!0,width:300,hiddenInPageSettings:!1,hidden:!1,className:"bg-transparent"},iq={data:"occurrencesPerHa",header:{title:()=>YK("Häufigkeit"),description:YK("Vorkommen pro Hektar")},type:"numeric",readOnly:!0,width:120,hiddenInPageSettings:!1,hidden:!1,configurableDecimalPlaces:!0,decimalPlaces:1,renderer(e,t,i,a,n,r,s){return t.innerText=Bl()(r??0).format({mantissa:"number"===typeof s.decimalPlaces?s.decimalPlaces:1}),t.classList.add("htRight"),t}},aq={data:"occurrencesTotal",header:{title:()=>YK("Gesamtanzahl"),description:YK("Vorkommen am Feld")},type:"numeric",readOnly:!0,width:120,hiddenInPageSettings:!1,hidden:!1,configurableDecimalPlaces:!0,decimalPlaces:0,renderer(e,t,i,a,n,r,s){return t.innerText=Bl()(r??0).format({mantissa:"number"===typeof s.decimalPlaces?s.decimalPlaces:0}),t.classList.add("htRight"),t}},nq={data:"riskCategory",header:{title:()=>YK("Risikokategorie")},type:"text",required:!0,readOnly:!0,width:130,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){const[s]=(0,ow.qv)({prefix:"fas",iconName:"circle-dot"}).node;return s.setAttribute("style",`color:${rq(r)}`),t.innerHTML=`<div class="d-flex justify-content-between align-items-center">${r??"-"} ${s.outerHTML}</div>`,t}};function rq(e){switch(e){case YK("Low"):return"#3CC961";case YK("Medium"):return"#D7930E";case YK("High"):return"#FF614C";default:throw new Error(`State ${e} is not supported.`)}}const sq={data:"link",header:{title:()=>YK("Link")},type:"text",required:!0,readOnly:!0,width:400,hiddenInPageSettings:!1,hidden:!1,className:"bg-transparent"},oq={data:"customerName",header:{title:()=>YK("Kunde")},type:"text",required:!0,readOnly:!0,width:200,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){return t.innerText=r,t}},lq={data:"customerNumber",header:{title:()=>YK("Kundennummer")},type:"text",required:!0,readOnly:!0,width:200,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){return t.innerText=r,t}},dq={data:"farmNumber",header:{title:()=>YK("Betriebsnummer")},type:"text",required:!0,readOnly:!0,width:200,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){return t.innerText=r,t}},cq={data:"customerEmail",header:{title:()=>YK("Kontakt E-Mail")},type:"text",required:!0,readOnly:!0,width:300,hiddenInPageSettings:!1,hidden:!1,columnSorting:FB,initialSortOrder:"desc",renderer(e,t,i,a,n,r){return t.innerText=r,t}},uq={...QB,width:40},pq=[JK,XK,QK,eq,tq,iq,aq,nq,sq,oq,lq,dq,cq,uq];var hq,mq=pq,fq=(0,b.defineComponent)({name:"ModalPageSettingsContainer",components:{ModalPageSettings:HE},data(){return{columnsForPageSettings:null}},computed:{...(0,C.rn)("datura/assessments",["hot","userColumnSettings"])},methods:{async show(){if(this.hot){const e=new hR(mq).getColumnsForHandsontable(this.userColumnSettings);this.columnsForPageSettings=lR(e,this.hot)}const e=await this.$refs.modalPageSettings.show();if(e){const t=dR(e.columns);this.$store.commit("datura/assessments/setUserColumnSettings",t)}}}}),gq=fq,yq=(0,ew.Z)(gq,KK,qK,!1,null,"18daaa4e",null),vq=yq.exports,bq=function(){var e=this,t=e._self._c;e._self._setupProxy;return!e.loading&&e.tableData.length>0?t("TableAssessments",{ref:"table",attrs:{tableData:e.tableData,columns:e.columnsForHandsontable,fixedColumnsLeft:e.fixedColumnsLeft,filterString:e.filterString},on:{"update:filterString":t=>e.$emit("update:filterString",t),onChange:e.onChange,"update:hot":e.onUpdateHot},scopedSlots:e._u([{key:"footer",fn:function({hot:e,visibleRows:i,totalRows:a}){return[t("TableFooterContainer",{attrs:{hot:e,visibleRows:i,totalRows:a}})]}}],null,!1,3678674152)}):e.loading?t("TableActivitiesLoading",{attrs:{columns:e.columnsForHandsontable}}):t("NoContentContainer",{on:{createActivity:function(t){return e.$emit("createAssessment")}}})},wq=[],Cq=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableWrapper",{scopedSlots:e._u([{key:"footer",fn:function(){return[e._t("footer",null,{hot:e.hot,visibleRows:e.visibleRows,totalRows:e.totalRows})]},proxy:!0}],null,!0)},[t("HotTable",{ref:"table",attrs:{id:e.tableId,settings:e.initialTableSettings,data:e.initialTableData}}),e.hot?t("TableHeaderContextMenuInjector",{ref:"contextMenuInjector",attrs:{tableRef:e.$refs.table,columns:e.tableColumns,filtersByColumnKey:e.filtersByColumnKey},on:{filtersByColumnKey:e.onFiltersByColumnKey,filtersByDate:e.onFiltersByDate}}
1):e._e(),e.hot?t("FilterInfoBarInjector",{attrs:{tableRef:e.$refs.table,filterActive:e.debouncedFilterActive},on:{onReset:e.clearAllFilters}}):e._e()],1)},Fq=[];function Aq(e,t){return e.map((e=>{const[i,a,n,r]=e,s=t.getDataAtRowProp(i,"id");return[i,`${a}`,n,r,{id:s}]}))}(function(e){e["populateFromTableDataChange"]="populateFromTableDataChange"})(hq||(hq={}));var kq=(0,b.defineComponent)({name:"TableAssessments",components:{HotTable:HI.sZ,TableWrapper:dN,TableHeaderContextMenuInjector:aN,FilterInfoBarInjector:QN},props:{tableData:{type:Array,required:!0},columns:{type:Array,required:!0},fixedColumnsLeft:{type:Number,default:0},filterString:{type:String,default:""}},data(){return{initialTableData:[],initialTableSettings:{},hot:null,filtersByColumnKey:{},filtersByDate:null,debouncedFilterActive:!1,tableId:"table-assessments"}},created(){this.initialTableData=Xe()(this.tableData),this.initialTableSettings=Xe()(this.createTableSettings(this.initialTableData,this.columns)),this.unwatchFilterString=this.$watch("filterWatchTrigger",Xl()(this.filterWatchHandler,200)),this.unwatchFilterActive=this.$watch("filterActive",Xl()((e=>{this.debouncedFilterActive=e}),200))},mounted(){this.hot=this.$refs.table.hotInstance,this.hasPersistentStateColumnSorting()||this.applyInitialSortConfig(),this.validatePersistentState(this.tableColumns),this.restorePersistentState()},beforeDestroy(){this.hot=null,this.unwatchFilterString(),this.unwatchFilterActive()},computed:{tableColumns(){if(!this.hot)return[];const{columns:e}=this.hot.getSettings();if(!e)return[];if(!Array.isArray(e))throw new Error("columns must be of type Array");return e},filterActive(){const e=Object.keys(this.filtersByColumnKey).length>0;return""!==this.filterString||e||null!==this.filtersByDate},filterWatchTrigger(){return`${this.filterString}${JSON.stringify(this.filtersByColumnKey)}${this.filterActive}${this.tableData}${JSON.stringify(this.filtersByDate)}`},visibleRowsIds(){const e=new Set(this.hot?.getDataAtProp("id"));return e},visibleRows(){return this.visibleRowsIds.size},totalRows(){return this.tableData.length},allRowsVisible(){return this.visibleRows===this.totalRows},groupedTableDataIds(){const e=new Set;return this.tableData.forEach((t=>{e.add(t.id)})),e},expandedTableData(){return this.tableData.filter((()=>!0))}},watch:{columns:{handler(e){if(!this.hot)return;const{colHeaders:t,columns:i,hiddenColumns:a}=this.tableSettingsThatDependOnColumns(e);this.updateSettings({colHeaders:t,columns:i,hiddenColumns:a}),this.moveColumnsByVisualColumn(i),this.hot.render(),this.validatePersistentState(i),this.updatePersistentState(i)}},tableData:{handler(e,t){this.haveToLoadCompleteTableData(e,t)?this.loadTableData(e):this.detectCellChangesAndUpdateCells(e,t)}},hot:{handler(e){this.$emit("update:hot",e)}}},methods:{haveToLoadCompleteTableData(e,t){return e.length!==t.length},loadTableData(e){if(!this.hot||!this.tableColumns.length)return;const t={...this.tableSettingsThatDependOnTableData(e),data:e};this.updateSettings(t)},detectCellChangesAndUpdateCells(e,t){if(!this.hot||!this.tableColumns.length)return;const i=zN(t,e,this.tableColumns,this.hot);this.updateCells(i)},updateSettings(e){if(!this.hot)return;const t=this.getCurrentSortConfig();this.hot.updateSettings(e),this.applySortConfig(t?.[0])},updateCells(e){0!==e.length&&this.hot?.setDataAtRowProp(e,hq.populateFromTableDataChange)},moveColumnsByVisualColumn(e){if(!this.hot)return;const t=this.getMoveColumns(e);this.hot.getPlugin("manualColumnMove").moveColumns(t,this.fixedColumnsLeft)},getMoveColumns(e){const t=[...e];t.sort(((e,t)=>e.visualColumn-t.visualColumn));const i=t.map((e=>e.physicalColumn)),a=i.slice(this.fixedColumnsLeft);return a},updatePersistentState(e){if(!this.hot)return;const t=this.hot.getPlugin("persistentState");t.isEnabled()&&(this.updatePersistentStateManualColumnMove(e,t),this.updatePersistentStateHiddenColumns(t))},updatePersistentStateManualColumnMove(e,t){const i=e.map(((e,t)=>this.hot?.toPhysicalColumn(t))),a=Array.from(Array(i.length).keys());Ha()(i,a)?t.resetValue("manualColumnMove"):t.saveValue("manualColumnMove",i)},updatePersistentStateHiddenColumns(e){e.saveValue("hiddenColumns",this.hot?.getPlugin("hiddenColumns").getHiddenColumns())},restorePersistentState(){if(!this.hot)return;const e=this.hot?.getPlugin("persistentState");e?.isEnabled()&&(this.restorePersistentStateManualColumnMove(e),this.restorePersistentStateHiddenColumns(e),this.restorePersistentStateColumnSorting(e))},restorePersistentStateManualColumnMove(e){if(!this.hot)return;const t={};e.loadValue("manualColumnMove",t),Array.isArray(t.value)&&Bu.Z.hooks.run(this.hot,"afterColumnMove")},restorePersistentStateHiddenColumns(e){if(!this.hot)return;const t={};if(e.loadValue("hiddenColumns",t),Array.isArray(t.value)){const e=this.hot.getPlugin("hiddenColumns"),i=this.tableColumns;e.showColumns(i.map((e=>e.visualColumn))),e.hideColumns(t.value)}},restorePersistentStateColumnSorting(e){if(!this.hot)return;const t={};e.loadValue("columnSorting",t),t.value&&t.value.initialConfig.length>0&&Bu.Z.hooks.run(this.hot,"afterColumnSort")},hasPersistentStateColumnSorting(){if(!this.hot)return!1;const e=this.hot?.getPlugin("persistentState");if(!e?.isEnabled())return!1;const t={};return e.loadValue("columnSorting",t),(t.value&&t.value.initialConfig.length>0)??!1},validatePersistentState(e){if(0===e.length)return;const t=e.reduce(((e,t)=>`${e}${t.data}`),""),i=localStorage.getItem(`${this.tableId}_checkSum`);if(t===i)return;const a=this.hot?.getPlugin("persistentState");a?.isEnabled()&&(a.resetValue("manualColumnMove"),a.resetValue("hiddenColumns"),a.resetValue("columnSorting"),localStorage.removeItem(`${this.tableId}__persistentStateKeys`),localStorage.setItem(`${this.tableId}_checkSum`,t))},afterChangeHookEmitOnChangeEvent(e,t){if(null===e||0===e.length)return;if(t===hq.populateFromTableDataChange)return;if(null===this.hot)return;const i=Aq(e,this.hot);this.$emit("onChange",i,t)},createTableSettings(e,t){const{hiddenRows:i}=this.tableSettingsThatDependOnTableData(e),{colHeaders:a,columns:n,hiddenColumns:r}=this.tableSettingsThatDependOnColumns(t);return{colHeaders:a,licenseKey:B,columns:n,autoColumnSize:!1,hiddenRows:i,hiddenColumns:r,multiColumnSorting:{initialConfig:[{column:2,sortOrder:"desc"},{column:3,sortOrder:"asc"}]},fixedColumnsLeft:this.fixedColumnsLeft,manualColumnMove:!0,manualColumnResize:!0,trimRows:!0,stretchH:"last",persistentState:!0,selectionMode:"single",beforeChange:(e,t)=>
1{const i=[az.beforeChange,Xz.beforeChange.propagateChangesToMergedCellsFactory(this.hot),qB.beforeChange.showHideRowsFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterChange:(e,t)=>{const i=[Xz.afterChange.filterChangesToMergedCellsFactory(this.hot),this.afterChangeHookEmitOnChangeEvent];i.forEach((i=>{i(e,t)}))},afterColumnResize:(e,t,i)=>{if(!this.hot)return;const a=[aL.afterColumnResize.setMinPlaceholderColumnWidthFactory(this.hot),pz.afterColumnResize.disableColumnResizeFactory(this.hot)];a.forEach((a=>{a(e,t,i)})),this.hot.render()},beforeColumnMove:(e,t,i,a)=>{if(!this.hot)return!0;const n=[cz.beforeColumnMove.preventMoveToSamePosition,cz.beforeColumnMove.preventMoveOfFixedColumnsFactory(this.hot,this.fixedColumnsLeft),cz.beforeColumnMove.preventMoveIntoFixedColumnsFactory(this.fixedColumnsLeft),Xz.beforeColumnMove.moveAllColumnsOfSubtableFactory(this.hot),Xz.beforeColumnMove.preventMoveBetweenSubtableColumnsFactory(this.hot),aL.beforeColumnMove.preventMoveOfPlaceholderColumnFactory(this.hot)],r=n.every((n=>n(e,t,i,a)));return r},afterGetColHeader:(e,t)=>{if(!this.hot)return;const i=[_N.afterGetColHeader.addCheckboxClassToColumnHeadersFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterOnCellMouseDown:(e,t,i)=>{const a=[_N.afterOnCellMouseDown.selectClickHandlerFactory(this.selectAllVisible),wN.afterOnCellMouseDown.triggerOnClickFactory(this.hot),gN.afterOnCellMouseDown.triggerOnClickFactory(this.hot)];a.forEach((a=>{a(e,t,i)}))},beforeOnCellMouseDown:(e,t)=>{const i=[_N.beforeOnCellMouseDown.multiSelectClickHandlerFactory(this.hot)];i.forEach((i=>{i(e,t)}))},beforeKeyDown:e=>{const t=[qB.beforeKeyDown.handleKeyClickFactory(this.hot),pN.beforeKeyDown.handleKeyClickFactory(this.hot),wN.beforeKeyDown.handleKeyClickFactory(this.hot),gN.beforeKeyDown.handleKeyClickFactory(this.hot),sz.beforeKeyDown.handleKeyClickFactory(this.hot)];t.forEach((t=>{t(e)}))},afterRenderer:(e,t,i,a,n,r)=>{if(!this.hot)return;const s=[PN.afterRenderer.applyColspanFactory(this.hot),oL.afterRenderer.addSyncStatusBackgroundFactory(this.hot)];s.forEach((s=>{s(e,t,i,a,n,r)}))}}},tableSettingsThatDependOnTableData(e){return{hiddenRows:Fz.hiddenRows(e)}},tableSettingsThatDependOnColumns(e){const t=Fz.columns(e),i=[DN(t),AN(t,this.allRowsSelected)];return{colHeaders:FN.colHeaders.colHeadersHooksFactory(i),columns:t,hiddenColumns:tz.hiddenColumns(t)}},filterWatchHandler(){this.hot&&this.tableColumns.length&&(this.filterActive?ZR(this.hot,this.filterString,this.filtersByColumnKey,this.filtersByDate,this.tableData,this.tableColumns):this.filtersByDate||qR(this.hot),Bu.Z.hooks.run(this.hot,"afterFilter",[]),this.hot.render())},onFiltersByColumnKey(e,t){this.setFilterByColumnKey(e,t)},onFiltersByDate(e){this.filtersByDate=e||null},setFilterByColumnKey(e,t){t?b["default"].set(this.filtersByColumnKey,e,t):b["default"]["delete"](this.filtersByColumnKey,e)},clearAllFilters(){this.$emit("update:filterString",""),this.filtersByColumnKey={},this.filtersByDate=null,this.$refs.contextMenuInjector.$refs.contextMenu.resetFilterDates()},applyInitialSortConfig(){if(!this.hot)throw new Error("Can't apply initial sort config, hot is not initialized");const e=TN(this.columns,this.hot);this.applySortConfig(e)},getCurrentSortConfig(){if(!this.hot)throw new Error("Can't get current sort config, hot is not initialized");return this.getEnabledSortPlugin()?.getSortConfig()},applySortConfig(e){if(e){if(!this.hot)throw new Error("Can't apply sort config, hot is not initialized");this.getEnabledSortPlugin()?.sort(e)}},allRowsSelected(){if(!this.hot)return!1;const e=this.hot.propToCol("select"),t=this.hot.getDataAtCol(e);return t.every((e=>!0===e))},getEnabledSortPlugin(){if(!this.hot)return null;const e=this.hot.getPlugin("columnSorting");if(e?.isEnabled())return e;const t=this.hot.getPlugin("multiColumnSorting");return t?.isEnabled()?t:null},selectAllVisible(e){if(!this.hot)return;const t=this.hot.countRows();this.hot.batch((()=>{for(let i=0;i<t;i+=1)this.hot?.setDataAtRowProp(i,"select",e)}))},invertSelection(){if(!this.hot)return;const e=this.hot.countRows(),t=this.hot.propToCol("select"),i=this.hot.getDataAtCol(t);this.hot.batch((()=>{for(let t=0;t<e;t+=1)this.hot?.setDataAtRowProp(t,"select",!i[t])}))},selectedRows(){if(!this.hot)return[];const e=this.hot.propToCol("select"),t=this.hot.getDataAtCol(e);return t.map(((e,t)=>e?this.hot?.getDataAtRowProp(t,"id"):null)).filter(ka)}}}),Sq=kq,Eq=(0,ew.Z)(Sq,Cq,Fq,!1,null,null,null),Iq=Eq.exports,_q=(0,b.defineComponent)({name:"TableAssessmentsContainer",props:{filterString:{type:String,default:""},columns:{type:Array,required:!0}},data(){return{debouncedRuleCheck:()=>{},assessmentsLoaded:!1}},components:{TableFooterContainer:MH,TableAssessments:Iq,TableActivitiesLoading:vL,NoContentContainer:PL},created(){this.loadData()},computed:{...(0,C.Se)("auth",["currentProcessOrderIds","currentCompanyIds"]),assessments(){return Object.values(this.$store.state.datura.assessments.data)},tableData(){return this.$store.getters["datura/assessments/tableDataAssessments"]},columnsForHandsontable(){const{userColumnSettings:e}=this.$store.state.datura.assessments,t=new hR(this.columns),i=t.getColumnsForHandsontable(e);return this.featureDaturaReadonly?this.withReadOnly(i):i},fixedColumnsLeft(){const e=this.columnsForHandsontable.findIndex((e=>!0===e.fixedColumnsLeftUntilHere));return-1===e?0:e+1},loading(){return this.$store.getters["datura/assessments/loading"]||this.$store.getters["fields/loading"]||this.$store.getters["customers/loading"]},companyService(){return new qa(this.$store.state.auth.companiesById)},featureDaturaReadonly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_DATURA_CONTROL)}},watch:{currentProcessOrderIds(){this.loadData()},currentCompanyIds(){this.loadData()},assessments(){this.assessmentsLoaded?this.debouncedRuleCheck():this.assessmentsLoaded=!0}},methods:{withReadOnly(e){return e.map((e=>e.data.includes("expand")?e:e.subtableColumns?{...e,readOnly:!0,subtableColumns:e.subtableColumns.map((e=>({...e,readOnly:!0})))}:{...e,readOnly:!0}))},onChange(e,t){e.forEach((e=>{const[,t,,i,{id:a}]=e,n=["expand","select"];n.includes(t)||this.debouncedRuleCheck(),"fieldDropdownItem"!==t?n.includes(t)?this.$store.commit("datura/assessments/addOrUpdateTableDataMetadataByKeyAndValue",{assessmentId:a,key:t,value:i}):this.$store.dispatch("dataura/assessments/updateEntryByKeyAndValueAndSync",{guid:a,key:t,value:i}):this.onChangeFieldDropdownItem(e)}))},onChangeFieldDropdownItem(e){const{id:t}=e[3],{id:i}=e[4],a=this.$store.state.fields.data[t];this.$store.commit("datura/assessments/updateEntryByKeyAndValue",{guid:i,key:"processedArea",value:a.fieldSize}),this.$store.dispatch("datura/assessments/updateEntryByKeyAndValueAndSync",{guid:i,key:"fieldId",value:t})}
1,loadData(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("datura/assessments/subscribe"),this.$store.dispatch("customers/subscribe")},refreshData(){this.$store.dispatch("datura/assessments/refresh"),this.$store.dispatch("fields/refresh"),this.$store.dispatch("customers/refresh")},onUpdateHot(e){this.$store.commit("datura/assessments/setHot",e),this.$emit("update:hot",e)}}}),Dq=_q,Mq=(0,ew.Z)(Dq,bq,wq,!1,null,null,null),Pq=Mq.exports,Tq=(0,b.defineComponent)({__name:"PageDroneAssessment",setup(e){ow.vI.add(lF.zd8);const t=(0,NL.tv)(),i=(0,b.ref)(""),a=(0,b.ref)(),n=(0,b.ref)(!1),r=Vb(),s=(0,b.ref)(null),o=(0,b.ref)(null),l=(0,b.ref)(null),d=(0,b.ref)(!1),c=(0,b.computed)((()=>r.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_DATURA_CONTROL))),u=(0,b.computed)((()=>r.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_DATURA_CONTROL))),p=(0,b.computed)((()=>r.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_DATURA_CONTROL))),h=(0,b.computed)((()=>r.getters["datura/assessments/tableDataAssessments"])),m=(0,b.computed)((()=>{if(!l.value||l.value.isDestroyed)return null;const e=l.value.getSettings().columns;return e})),f=(0,b.computed)((()=>s.value?s.value.$refs.table:null)),g=(0,b.computed)((()=>{if(!l.value)return new Set;const e=new Set(l?.value.getDataAtProp("id"));return e})),y=(0,b.computed)((()=>f.value?f.value.allRowsVisible:null));function v(e){d.value=!0,setTimeout((()=>{e?w():C()}),50)}async function w(){if(!o.value)return;const{exportFiltered:e,okay:t}=await o.value.show();if(!t)return;let i=f.value.selectedRows();0===i.length&&(i=Array.from(f.value.groupedTableDataIds));let a=[];if(e){const e=i.filter((e=>g.value.has(e)));a=e}else a=i;o.value.onExportSelected(a)}async function C(){if(!o.value)return;const{exportFiltered:e,okay:t}=await o.value.show();if(!t)return;let i=[];i=e?Array.from(g.value):Array.from(f.value.groupedTableDataIds),o.value.onExportSelected(i)}function F(){a.value?.show()}return{__sfc:!0,router:t,searchTerm:i,modalPageSettings:a,editMode:n,store:r,tableContainerRef:s,modalTableExport:o,hot:l,showModalExport:d,pageFeatureEnabled:c,pageFeatureVisible:u,pageFeatureReadOnly:p,tableData:h,tableColumns:m,tableRef:f,visibleRowIds:g,allRowsVisible:y,onShowModalExport:v,exportSelected:w,exportData:C,onShowSettings:F,ModalPageSettingsContainer:vq,TableAssessmentsContainer:Pq,TheContentbar:HL,ThePageSkeleton:$w,CompanySwitch:qw,DropdownPageOptions:YL,ModalTableExport:_$,ProcessOrderSwitch:lV,SearchBar:YE,Button:gw,ButtonDropdown:mV,assessmentsColumns:mq}}}),xq=Tq,Bq=(0,ew.Z)(xq,WK,ZK,!1,null,"67fccabc",null),Oq=Bq.exports,$q=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{pageFeatureTitle:i.router.currentRoute.meta?.label,pageFeatureEnabled:i.pageFeatureEnabled,pageFeatureVisible:i.pageFeatureVisible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t(i.TheContentbar,{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:a}){return[t(i.SearchBar,{attrs:{type:a?"large":"",searchFilter:i.searchTerm},on:{"update:searchFilter":function(e){i.searchTerm=e},"update:search-filter":function(e){i.searchTerm=e}}}),t(i.DropdownPageOptions,{staticClass:"ml-4",attrs:{exportDisabled:!0,hideRestore:!0},on:{settings:i.onShowSettings}}),t(i.Button,{staticClass:"ml-4",attrs:{title:e.$t("Schließen"),componentNamespaceName:"ButtonClose",tooltipOptions:{boundary:"viewport"}},on:{click:()=>i.router.push({name:"drone"})}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t(i.TableHistoryContainer,{directives:[{name:"show",rawName:"v-show",value:i.pageFeatureEnabled&&i.pageFeatureVisible,expression:"pageFeatureEnabled && pageFeatureVisible"}],ref:"tableContainerRef",attrs:{filterString:i.searchTerm,columns:i.historyColumns},on:{"update:filterString":function(e){i.searchTerm=e},"update:filter-string":function(e){i.searchTerm=e},"update:hot":e=>i.hot=e}}),t(i.ModalPageSettingsContainer,{ref:"modalPageSettings"})]},proxy:!0}])})},Rq=[],Nq=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}})},zq=[];const Lq=b["default"].i18n.translate,Vq={data:"id",header:{title:()=>"ID"},hiddenInPageSettings:!0,hidden:!0,width:200},Uq={data:"select",type:"farmdok.checkbox.optional",noHeaderContextMenu:!0,fixedColumnsLeftUntilHere:!0,hiddenInPageSettings:!0,hidden:!1,width:45,disableColumnResize:!0},jq={data:"created",header:{title:()=>Lq("Erstellt")}
1,readOnly:!0,type:"date",width:120,hiddenInPageSettings:!1,hidden:!1,columnSorting:FB,initialSortOrder:"desc",className:"bg-transparent"},Hq={data:"importJobName",type:"text",header:{title:()=>Lq("Assessment Name")},readOnly:!0,width:300,hiddenInPageSettings:!1,hidden:!1,className:"bg-transparent"},Gq={data:"imageCount",header:{title:()=>Lq("Anzahl Bilder"),description:Lq("Anzahl der hochgeladenen Bilder")},type:"numeric",readOnly:!0,width:100,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){return t.innerText=Bl()(r??0).format({mantissa:0}),t.classList.add("htRight"),t}},Wq={data:"progress",header:{title:()=>Lq("Fortschritt"),description:Lq("Bereits analysierte Bilder")},readOnly:!0,type:"numeric",width:100,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){return t.innerText=Bl()(r).format({mantissa:0,postfix:" %"}),t.classList.add("htRight"),t}},Zq={data:"stateDisplayValue",header:{title:()=>Lq("Status")},type:"text",required:!0,readOnly:!0,width:200,hiddenInPageSettings:!1,hidden:!1,renderer(e,t,i,a,n,r){const[s]=(0,ow.qv)({prefix:"fas",iconName:Kq(r)}).node;return s.setAttribute("style",`color:${qq(r)}`),t.innerHTML=`<div class="d-flex justify-content-between">${r??"-"} ${s.outerHTML}</div>`,t}};function Kq(e){switch(e){case Lq("UploadPending"):return"clock";case Lq("Calculating"):return"circle-dot";case Lq("Finished"):return"circle-check";case Lq("UploadExpired"):return"circle-xmark";case Lq("Failed"):return"circle-dot";default:throw new Error(`State ${e} is not supported.`)}}function qq(e){switch(e){case Lq("UploadPending"):return"#13353C";case Lq("Calculating"):return"#3CC961";case Lq("Finished"):case Lq("UploadExpired"):return"#828282";case Lq("Failed"):return"#FF614C";default:throw new Error(`State ${e} is not supported.`)}}const Yq={data:"completed",header:{title:()=>Lq("Abgeschlossen")},readOnly:!0,type:"date",width:200,hiddenInPageSettings:!1,hidden:!1,columnSorting:FB,initialSortOrder:"desc",renderer(e,t,i,a,n,r){return t.innerText=r?g().unix(r).format("L LT"):"-",t}},Jq={...QB,width:40},Xq=[Vq,Uq,jq,Hq,Gq,Wq,Zq,Yq,Jq];var Qq,eY=Xq,tY=(0,b.defineComponent)({name:"ModalPageSettingsContainer",components:{ModalPageSettings:HE},data(){return{columnsForPageSettings:null}},computed:{...(0,C.rn)("datura/history",["hot","userColumnSettings"])},methods:{async show(){if(this.hot){const e=new hR(eY).getColumnsForHandsontable(this.userColumnSettings);this.columnsForPageSettings=lR(e,this.hot)}const e=await this.$refs.modalPageSettings.show();if(e){const t=dR(e.columns);this.$store.commit("datura/history/setUserColumnSettings",t)}}}}),iY=tY,aY=(0,ew.Z)(iY,Nq,zq,!1,null,"7df71c30",null),nY=aY.exports,rY=function(){var e=this,t=e._self._c;e._self._setupProxy;return!e.loading&&e.tableData.length>0?t("TableHistory",{ref:"table",attrs:{tableData:e.tableData,columns:e.columnsForHandsontable,fixedColumnsLeft:e.fixedColumnsLeft,filterString:e.filterString},on:{"update:filterString":t=>e.$emit("update:filterString",t),onChange:e.onChange,"update:hot":e.onUpdateHot},scopedSlots:e._u([{key:"footer",fn:function({hot:e,visibleRows:i,totalRows:a}){return[t("TableFooterContainer",{attrs:{hot:e,visibleRows:i,totalRows:a}})]}}],null,!1,3678674152)}):e.loading?t("TableActivitiesLoading",{attrs:{columns:e.columnsForHandsontable}}):t("NoContentContainer")},sY=[],oY=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("TableWrapper",{scopedSlots:e._u([{key:"footer",fn:function(){return[e._t("footer",null,{hot:e.hot,visibleRows:e.visibleRows,totalRows:e.totalRows})]},proxy:!0}],null,!0)},[t("HotTable",{ref:"table",attrs:{id:e.tableId,settings:e.initialTableSettings,data:e.initialTableData}}),e.hot?t("TableHeaderContextMenuInjector",{ref:"contextMenuInjector",attrs:{tableRef:e.$refs.table,columns:e.tableColumns,filtersByColumnKey:e.filtersByColumnKey},on:{filtersByColumnKey:e.onFiltersByColumnKey,filtersByDate:e.onFiltersByDate}}):e._e(),e.hot?t("FilterInfoBarInjector",{attrs:{tableRef:e.$refs.table,filterActive:e.debouncedFilterActive},on:{onReset:e.clearAllFilters}}):e._e()],1)},lY=[];(function(e){e["populateFromTableDataChange"]="populateFromTableDataChange"})(Qq||(Qq={}));var dY=(0,b.defineComponent)({name:"TableHistory",components:{HotTable:HI.sZ,TableWrapper:dN,TableHeaderContextMenuInjector:aN,FilterInfoBarInjector:QN},props:{tableData:{type:Array,required:!0},columns:{type:Array,required:!0},fixedColumnsLeft:{type:Number,default:0},filterString:{type:String,default:""}},data(){return{initialTableData:[],initialTableSettings:{},hot:null,filtersByColumnKey:{},filtersByDate:null,debouncedFilterActive:!1,tableId:"table-history"}},created(){this.initialTableData=Xe()(this.tableData),this.initialTableSettings=Xe()(this.createTableSettings(this.initialTableData,this.columns)),this.unwatchFilterString=this.$watch("filterWatchTrigger",Xl()(this.filterWatchHandler,200)),this.unwatchFilterActive=this.$watch("filterActive",Xl()((e=>{this.debouncedFilterActive=e}),200))},mounted(){this.hot=this.$refs.table.hotInstance,this.hasPersistentStateColumnSorting()||this.applyInitialSortConfig(),this.validatePersistentState(this.tableColumns),this.restorePersistentState()},beforeDestroy(){this.hot=null,this.unwatchFilterString(),this.unwatchFilterActive()},computed:{tableColumns(){if(!this.hot)return[];const{columns:e}=this.hot.getSettings();if(!e)return[];if(!Array.isArray(e))throw new Error("columns must be of type Array");return e},filterActive(){const e=Object.keys(this.filtersByColumnKey).length>0;return""!==this.filterString||e||null!==this.filtersByDate},filterWatchTrigger(){return`${this.filterString}${JSON.stringify(this.filtersByColumnKey)}${this.filterActive}${this.tableData}${JSON.stringify(this.filtersByDate)}`},visibleRowsIds(){const e=new Set(this.hot?.getDataAtProp("id"));return e},visibleRows(){return this.visibleRowsIds.size},totalRows(){return this.tableData.length},allRowsVisible(){return this.visibleRows===this.totalRows},groupedTableDataIds(){const e=new Set;return this.tableData.forEach((t=>{e.add(t.id)})),e}},watch:{columns:{handler(e){if(!this.hot)return;const{colHeaders:t,columns:i,hiddenColumns:a}=this.tableSettingsThatDependOnColumns(e);this.updateSettings({colHeaders:t,columns:i,hiddenColumns:a}),this.moveColumnsByVisualColumn(i),this.hot.render(),this.validatePersistentState(i),this.updatePersistentState(i)}},tableData:{handler(e,t){this.haveToLoadCompleteTableData(e,t)?this.loadTableData(e):this.detectCellChangesAndUpdateCells(e,t)}},hot:{handler(e){this.$emit("update:hot",e)}}},methods:{haveToLoadCompleteTableData(e,t){return e.length!==t.length},loadTableData(e){if(!this.hot||!this.tableColumns.length)return;const t={...this.tableSettingsThatDependOnTableData(e),data:e};this.updateSettings(t)},detectCellChangesAndUpdateCells(e,t){if(!this.hot||!this.tableColumns.length)return;const i=zN(t,e,this.tableColumns,this.hot);this.updateCells(i)},updateSettings(e){if(!this.hot)return;const t=this.getCurrentSortConfig();this.hot.updateSettings(e),this.applySortConfig(t?.[0])},updateCells(e){0!==e.length&&this.hot?.setDataAtRowProp(e,Qq.populateFromTableDataChange)},moveColumnsByVisualColumn(e){if(!this.hot)return;const t=this.getMoveColumns(e);this.hot.getPlugin("manualColumnMove").moveColumns(t,this.fixedColumnsLeft)},getMoveColumns(e){const t=[...e];t.sort(((e,t)=>e.visualColumn-t.visualColumn));const i=t.map((e=>e.physicalColumn)),a=i.slice(this.fixedColumnsLeft);return a},updatePersistentState(e){if(!this.hot)return;const t=this.hot.getPlugin("persistentState");t.isEnabled()&&(this.updatePersistentStateManualColumnMove(e,t),this.updatePersistentStateHiddenColumns(t))},updatePersistentStateManualColumnMove(e,t){const i=e.map(((e,t)=>this.hot?.toPhysicalColumn(t))),a=Array.from(Array(i.length).keys());Ha()(i,a)?t.resetValue("manualColumnMove"):t.saveValue("manualColumnMove",i)},updatePersistentStateHiddenColumns(e){e.saveValue("hiddenColumns",this.hot?.getPlugin("hiddenColumns").getHiddenColumns())},restorePersistentState(){if(!this.hot)return;const e=this.hot?.getPlugin("persistentState");e?.isEnabled()&&(this.restorePersistentStateManualColumnMove(e),this.restorePersistentStateHiddenColumns(e),this.restorePersistentStateColumnSorting(e))},restorePersistentStateManualColumnMove(e){if(!this.hot)return;const t={};e.loadValue("manualColumnMove",t),Array.isArray(t.value)&&Bu.Z.hooks.run(this.hot,"afterColumnMove")},restorePersistentStateHiddenColumns(e){if(!this.hot)return;const t={};if(e.loadValue("hiddenColumns",t),Array.isArray(t.value)){const e=this.hot.getPlugin("hiddenColumns"),i=this.tableColumns;e.showColumns(i.map((e=>e.visualColumn))),e.hideColumns(t.value)}},restorePersistentStateColumnSorting(e){if(!this.hot)return;const t={};e.loadValue("columnSorting",t),t.value&&t.value.initialConfig.length>0&&Bu.Z.hooks.run(this.hot,"afterColumnSort")},hasPersistentStateColumnSorting(){if(!this.hot)return!1;const e=this.hot?.getPlugin("persistentState");if(!e?.isEnabled())return!1;const t={};return e.loadValue("columnSorting",t),(t.value&&t.value.initialConfig.length>0)??!1},validatePersistentState(e){if(0===e.length)return;const t=e.reduce(((e,t)=>`${e}${t.data}`),""),i=localStorage.getItem(`${this.tableId}_checkSum`);if(t===i)return;const a=this.hot?.getPlugin("persistentState");a?.isEnabled()&&(a.resetValue("manualColumnMove"),a.resetValue("hiddenColumns"),a.resetValue("columnSorting"),localStorage.removeItem(`${this.tableId}__persistentStateKeys`),localStorage.setItem(`${this.tableId}_checkSum`,t))},afterChangeHookEmitOnChangeEvent(e,t){if(null===e||0===e.length)return;if(t===Qq.populateFromTableDataChange)return;if(null===this.hot)return;const i=Aq(e,this.hot);this.$emit("onChange",i,t)},createTableSettings(e,t){const{hiddenRows:i}=this.tableSettingsThatDependOnTableData(e),{colHeaders:a,columns:n,hiddenColumns:r}=this.tableSettingsThatDependOnColumns(t);return{colHeaders:a,licenseKey:B,columns:n,autoColumnSize:!1,hiddenRows:i,hiddenColumns:r,multiColumnSorting:{initialConfig:[{column:2,sortOrder:"desc"},{column:3,sortOrder:"asc"}]},fixedColumnsLeft:this.fixedColumnsLeft,manualColumnMove:!0,manualColumnResize:!0,trimRows:!0,stretchH:"last",persistentState:!0,selectionMode:"single",beforeChange:(e,t)=>
1{const i=[az.beforeChange,Xz.beforeChange.propagateChangesToMergedCellsFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterChange:(e,t)=>{const i=[Xz.afterChange.filterChangesToMergedCellsFactory(this.hot),this.afterChangeHookEmitOnChangeEvent];i.forEach((i=>{i(e,t)}))},afterColumnResize:(e,t,i)=>{if(!this.hot)return;const a=[aL.afterColumnResize.setMinPlaceholderColumnWidthFactory(this.hot),pz.afterColumnResize.disableColumnResizeFactory(this.hot)];a.forEach((a=>{a(e,t,i)})),this.hot.render()},beforeColumnMove:(e,t,i,a)=>{if(!this.hot)return!0;const n=[cz.beforeColumnMove.preventMoveToSamePosition,cz.beforeColumnMove.preventMoveOfFixedColumnsFactory(this.hot,this.fixedColumnsLeft),cz.beforeColumnMove.preventMoveIntoFixedColumnsFactory(this.fixedColumnsLeft),Xz.beforeColumnMove.moveAllColumnsOfSubtableFactory(this.hot),Xz.beforeColumnMove.preventMoveBetweenSubtableColumnsFactory(this.hot),aL.beforeColumnMove.preventMoveOfPlaceholderColumnFactory(this.hot)],r=n.every((n=>n(e,t,i,a)));return r},afterGetColHeader:(e,t)=>{if(!this.hot)return;const i=[_N.afterGetColHeader.addCheckboxClassToColumnHeadersFactory(this.hot)];i.forEach((i=>{i(e,t)}))},afterOnCellMouseDown:(e,t,i)=>{const a=[_N.afterOnCellMouseDown.selectClickHandlerFactory(this.selectAllVisible),wN.afterOnCellMouseDown.triggerOnClickFactory(this.hot),gN.afterOnCellMouseDown.triggerOnClickFactory(this.hot)];a.forEach((a=>{a(e,t,i)}))},beforeOnCellMouseDown:(e,t)=>{const i=[_N.beforeOnCellMouseDown.multiSelectClickHandlerFactory(this.hot)];i.forEach((i=>{i(e,t)}))},beforeKeyDown:e=>{const t=[qB.beforeKeyDown.handleKeyClickFactory(this.hot),pN.beforeKeyDown.handleKeyClickFactory(this.hot),wN.beforeKeyDown.handleKeyClickFactory(this.hot),gN.beforeKeyDown.handleKeyClickFactory(this.hot),sz.beforeKeyDown.handleKeyClickFactory(this.hot)];t.forEach((t=>{t(e)}))},afterRenderer:(e,t,i,a,n,r)=>{if(!this.hot)return;const s=[PN.afterRenderer.applyColspanFactory(this.hot),oL.afterRenderer.addSyncStatusBackgroundFactory(this.hot)];s.forEach((s=>{s(e,t,i,a,n,r)}))}}},tableSettingsThatDependOnTableData(e){return{hiddenRows:Fz.hiddenRows(e)}},tableSettingsThatDependOnColumns(e){const t=Fz.columns(e),i=[DN(t),AN(t,this.allRowsSelected)];return{colHeaders:FN.colHeaders.colHeadersHooksFactory(i),columns:t,hiddenColumns:tz.hiddenColumns(t)}},filterWatchHandler(){this.hot&&this.tableColumns.length&&(this.filterActive?ZR(this.hot,this.filterString,this.filtersByColumnKey,this.filtersByDate,this.tableData,this.tableColumns):this.filtersByDate||qR(this.hot),Bu.Z.hooks.run(this.hot,"afterFilter",[]),this.hot.render())},onFiltersByColumnKey(e,t){this.setFilterByColumnKey(e,t)},onFiltersByDate(e){this.filtersByDate=e||null},setFilterByColumnKey(e,t){t?b["default"].set(this.filtersByColumnKey,e,t):b["default"]["delete"](this.filtersByColumnKey,e)},clearAllFilters(){this.$emit("update:filterString",""),this.filtersByColumnKey={},this.filtersByDate=null,this.$refs.contextMenuInjector.$refs.contextMenu.resetFilterDates()},applyInitialSortConfig(){if(!this.hot)throw new Error("Can't apply initial sort config, hot is not initialized");const e=TN(this.columns,this.hot);this.applySortConfig(e)},getCurrentSortConfig(){if(!this.hot)throw new Error("Can't get current sort config, hot is not initialized");return this.getEnabledSortPlugin()?.getSortConfig()},applySortConfig(e){if(e){if(!this.hot)throw new Error("Can't apply sort config, hot is not initialized");this.getEnabledSortPlugin()?.sort(e)}},allRowsSelected(){if(!this.hot)return!1;const e=this.hot.propToCol("select"),t=this.hot.getDataAtCol(e);return t.every((e=>!0===e))},getEnabledSortPlugin(){if(!this.hot)return null;const e=this.hot.getPlugin("columnSorting");if(e?.isEnabled())return e;const t=this.hot.getPlugin("multiColumnSorting");return t?.isEnabled()?t:null},selectAllVisible(e){if(!this.hot)return;const t=this.hot.countRows();this.hot.batch((()=>{for(let i=0;i<t;i+=1)this.hot?.setDataAtRowProp(i,"select",e)}))},invertSelection(){if(!this.hot)return;const e=this.hot.countRows(),t=this.hot.propToCol("select"),i=this.hot.getDataAtCol(t);this.hot.batch((()=>{for(let t=0;t<e;t+=1)this.hot?.setDataAtRowProp(t,"select",!i[t])}))},selectedRows(){if(!this.hot)return[];const e=this.hot.propToCol("select"),t=this.hot.getDataAtCol(e);return t.map(((e,t)=>e?this.hot?.getDataAtRowProp(t,"id"):null)).filter(ka)}}}),cY=dY,uY=(0,ew.Z)(cY,oY,lY,!1,null,null,null),pY=uY.exports,hY=(0,b.defineComponent)({name:"TableHistoryContainer",props:{filterString:{type:String,default:""},columns:{type:Array,required:!0}},data(){return{debouncedRuleCheck:()=>{},historyLoaded:!1}},components:{TableHistory:pY,TableFooterContainer:MH,TableActivitiesLoading:vL,NoContentContainer:PL},created(){this.loadData()},computed:{...(0,C.Se)("auth",["currentProcessOrderIds","currentCompanyIds"]),histories(){return Object.values(this.$store.state.datura.history.data)},tableData(){return this.$store.getters["datura/history/tableDataHistory"]},columnsForHandsontable(){const{userColumnSettings:e}=this.$store.state.datura.history,t=new hR(this.columns),i=t.getColumnsForHandsontable(e);return this.featureDaturaReadonly?this.withReadOnly(i):i},fixedColumnsLeft(){const e=this.columnsForHandsontable.findIndex((e=>!0===e.fixedColumnsLeftUntilHere));return-1===e?0:e+1},loading(){return this.$store.getters["datura/history/loading"]||this.$store.getters["fields/loading"]||this.$store.getters["customers/loading"]},featureDaturaReadonly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_DATURA_CONTROL)}},watch:{currentProcessOrderIds(){this.loadData()},currentCompanyIds(){this.loadData()},histories(){this.historyLoaded?this.debouncedRuleCheck():this.historyLoaded=!0}},methods:{withReadOnly(e){return e.map((e=>e.data.includes("expand")?e:e.subtableColumns?{...e,readOnly:!0,subtableColumns:e.subtableColumns.map((e=>({...e,readOnly:!0})))}:{...e,readOnly:!0}))},onChange(e,t){e.forEach((e=>{const[,t,,i,{id:a}]=e,n=["expand","select"];n.includes(t)||this.debouncedRuleCheck(),"fieldDropdownItem"!==t?n.includes(t)&&this.$store.commit("datura/history/addOrUpdateTableDataMetadataByKeyAndValue",{historyId:a,key:t,value:i}):this.onChangeFieldDropdownItem(e)}))},onChangeFieldDropdownItem(e){const{id:t}=e[3],{id:i}=e[4],a=this.$store.state.fields.data[t];this.$store.commit("datura/history/updateEntryByKeyAndValue",{guid:i,key:"processedArea",value:a.fieldSize}),this.$store.dispatch("datura/history/updateEntryByKeyAndValueAndSync",{guid:i,key:"fieldId",value:t})}
1,loadData(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("datura/history/subscribe"),this.$store.dispatch("customers/subscribe")},refreshData(){this.$store.dispatch("datura/history/refresh"),this.$store.dispatch("fields/refresh"),this.$store.dispatch("customers/refresh")},onUpdateHot(e){this.$store.commit("datura/history/setHot",e),this.$emit("update:hot",e)}}}),mY=hY,fY=(0,ew.Z)(mY,rY,sY,!1,null,null,null),gY=fY.exports,yY=(0,b.defineComponent)({__name:"PageHistory",setup(e){const t=(0,NL.tv)(),i=Vb(),a=(0,b.ref)(""),n=(0,b.ref)(null),r=(0,b.ref)(null),s=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_DATURA_CONTROL))),o=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_DATURA_CONTROL)));function l(){r.value?.show()}return{__sfc:!0,router:t,store:i,searchTerm:a,hot:n,modalPageSettings:r,pageFeatureEnabled:s,pageFeatureVisible:o,onShowSettings:l,ModalPageSettingsContainer:nY,TableHistoryContainer:gY,historyColumns:eY,TheContentbar:HL,ThePageSkeleton:$w,DropdownPageOptions:YL,SearchBar:YE,Button:gw}}}),vY=yY,bY=(0,ew.Z)(vY,$q,Rq,!1,null,"4614c86e",null),wY=bY.exports,CY=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{scopedSlots:e._u([{key:"content",fn:function(){return[t("div",{staticClass:"map-page-container"},[t("div",{staticClass:"header-container"},[t("RouterLink",{staticClass:"header__logo",attrs:{to:i.baseUrl}},[t(i.IconTextLogoOriginal,{attrs:{width:"150"}})],1)],1),i.geoJson||i.errorMessage.length?i.errorMessage.length?t(i.ErrorUserMessage,{attrs:{errorUserMessage:i.errorMessage}}):t(i.GeoJsonMap,{attrs:{data:i.geoJson},on:{onDownloadClick:i.downloadFile}}):t("div",{staticClass:"loading-global-wrapper"},[t(i.LoadingGlobal)],1),t("a",{ref:"downloadLink",attrs:{href:`${i.baseUrl}/file/${i.route.params.fileId}`,download:"assessment.json",hidden:""}},[e._v("download")])],1)]},proxy:!0}])})},FY=[],AY=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"filemap__map-wrapper",attrs:{id:"filemap__map-wrapper"}},[t("DownloadFileMapControl",{on:{onClick:function(t){return e.$emit("onDownloadClick")}}}),e.map?t("CenterMapControl",{attrs:{actionType:e.centerControlActionType},on:{onClick:e.centerMap}}):e._e(),e.riskCategory?t("RiskPill",{attrs:{riskCategory:e.riskCategory},on:{onClick:function(t){e.modalVisible=!0}}}):e._e(),e.riskCategory&&e.riskInfoText?t("InfoModal",{attrs:{text:e.riskInfoText??"",visible:e.modalVisible,riskCategory:e.riskCategory},on:{"update:visible":function(t){e.modalVisible=t}}}):e._e(),t("div",{ref:"map-container",staticClass:"filemap__map-container"})],1)},kY=[],SY=function(){var e=this,t=e._self._c;return t("div",{staticClass:"center-control",on:{click:function(t){return e.$emit("onClick")}}},["mapData"===e.actionType?t("FontAwesomeIcon",{staticClass:"control-icon",attrs:{icon:"map-marked-alt"}}):"currentLocation"===e.actionType?t("FontAwesomeIcon",{staticClass:"control-icon",attrs:{icon:"location-arrow"}}):e._e()],1)},EY=[];ow.vI.add(uw.$40,uw.tLL);var IY={name:"CenterMapControl",props:{actionType:{type:String,default:"mapData"}}},_Y=IY,DY=(0,ew.Z)(_Y,SY,EY,!1,null,null,null),MY=DY.exports,PY=function(){var e=this,t=e._self._c;return t("div",{staticClass:"download-control",on:{click:function(t){return e.$emit("onClick")}}},[t("FontAwesomeIcon",{attrs:{icon:"cloud-download"}}),t("span",[e._v(e._s(e.$t("Datei herunterladen")))])],1)},TY=[],xY={name:"DownloadFileMapControl"},BY=xY,OY=(0,ew.Z)(BY,PY,TY,!1,null,"7030cdd0",null),$Y=OY.exports,RY=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("BModal",{attrs:{okTitle:"OK","cancel-title":null,okVariant:"light",headerClass:["border-0"],titleClass:["info-modal-title",i.titleColorClass],centered:"",title:"low"===i.props.riskCategory?"Info":`${e.$t("Achtung")}!`,visible:e.visible,size:"sm"},on:{ok:function(e){return e.preventDefault(),i.toggle.apply(null,arguments)},change:t=>e.$emit("update:visible",t)},scopedSlots:e._u([{key:"modal-footer",fn:function(){return[t(i.Button,{staticClass:"ok-button",attrs:{variant:"outline-primary"},on:{click:i.toggle}},[e._v("OK")])]},proxy:!0}])},[t("p",{staticClass:"my-4"},[e._v(e._s(e.text))])])},NY=[],zY=(0,b.defineComponent)({__name:"InfoModal",props:{text:null,riskCategory:null,visible:{type:Boolean}},emits:["update:visible"],setup(e,{emit:t}){const i=e,a=(0,b.computed)((()=>{switch(i.riskCategory){case"high":return"modal-title-danger";case"medium":return"modal-title-warning";case"low":return"modal-title-primary";default:return"modal-title-primary"}}));function n(){t("update:visible",!i.visible)}return{__sfc:!0,emit:t,props:i,titleColorClass:a,toggle:n,Button:gw}}}),LY=zY,VY=(0,ew.Z)(LY,RY,NY,!1,null,null,null),UY=VY.exports,jY=({google:e,map:t})=>{const i=new e.maps.Marker({map:t,icon:{path:e.maps.SymbolPath.CIRCLE,fillColor:"#3CC961",fillOpacity:1,scale:6,strokeWeight:2,strokeColor:"white"},zIndex:3}),a=new e.maps.Circle({map:t,fillColor:"#3CC961",fillOpacity:.3,strokeWeight:0,radius:40});return a.bindTo("center",i,"position"),{innerCircle:i,outerCircle:a}},HY=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"pill",style:{backgroundColor:i.backgroundColor},on:{click:()=>i.emit("onClick")}},[t("FontAwesomeIcon",{attrs:{icon:i.riskIcon}}),t("div",{staticClass:"pill-text"},[e._v(" "+e._s(i.t("Risiko"))+": "),t("strong",[e._v(e._s(i.riskCategoryText))]),e._v(". "+e._s(i.t("Mehr Infos..."))+" ")])],1)},GY=[],WY=(0,b.defineComponent)({__name:"RiskPill",props:{riskCategory:null},emits:["onClick"],setup(e,{emit:t}){const i=e;ow.vI.add(uw.QmK,uw.xHz);const a=Gb.translate,n=(0,b.computed)((()=>"high"===i.riskCategory?a("High"):"medium"===i.riskCategory?a("Medium"):a("Low"))),r=(0,b.computed)((()=>"high"===i.riskCategory?uw.QmK:uw.xHz)),s=(0,b.computed)((()=>{switch(i.riskCategory){case"high":return O.DANGER;case"medium":return O.WARNING;
1case"low":return O.PRIMARY;default:return O.PRIMARY}}));return{__sfc:!0,t:a,props:i,emit:t,riskCategoryText:n,riskIcon:r,backgroundColor:s}}}),ZY=WY,KY=(0,ew.Z)(ZY,HY,GY,!1,null,"10d63984",null),qY=KY.exports;const YY={lat:47.561838,lng:14.633302};var JY=(0,b.defineComponent)({name:"GeoJsonMap",components:{DownloadFileMapControl:$Y,CenterMapControl:MY,RiskPill:qY,InfoModal:UY},props:{controls:{type:Array,default:()=>["searchField","mapType","zoom"]},data:{type:Object,default:()=>{}}},inject:{googleMapsSettings:{default:()=>X}},data(){return{map:null,google:null,currentLocation:null,mapDataBounds:null,centerControlActionType:"currentLocation",riskCategory:null,riskInfoText:null,occurrencesPerHa:null,modalVisible:!1}},async mounted(){await this.mapInit(),await this.loadGeojson(this.data)},methods:{async mapInit(){this.google=await cE();const e={center:YY,zoom:16,tilt:0,mapTypeId:this.google.maps.MapTypeId.HYBRID,disableDefaultUI:!0,mapTypeControl:!1,zoomControl:!0,zoomControlOptions:{position:this.google.maps.ControlPosition.RIGHT_BOTTOM},fullscreenControl:!1,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]};this.map=new this.google.maps.Map(this.$refs["map-container"],e),this.displayCurrentLocation(),this.map?.addListener("center_changed",(()=>{this.centerControlActionType="currentLocation"}))},async loadGeojson(e){if(!e)return;const t=e.properties;t&&("risk-category"in t&&(this.riskCategory=t["risk-category"]),"display-risk-info"in t&&(this.riskInfoText=t["display-risk-info"]),"occurrences-per-ha"in t&&(this.occurrencesPerHa=t["occurrences-per-ha"])),await(this.map?.data.addGeoJson(e)),this.map?.data.setStyle((e=>{const t=e.getProperty("fill"),i=e.getProperty("fill-opacity"),a=e.getProperty("stroke"),n=e.getProperty("stroke-width"),r=e.getProperty("stroke-opacity");return{fillColor:"string"===typeof t?t:void 0,fillOpacity:"number"===typeof i?i:void 0,strokeColor:"string"===typeof a?a:void 0,strokeWeight:"number"===typeof n?n:void 0,strokeOpacity:"number"===typeof r?r:void 0}})),this.computeDataMapBounds(),this.mapFitBoundsToData(),await this.$nextTick()},mapFitBoundsToData(){this.mapDataBounds&&this.map?.fitBounds(this.mapDataBounds)},computeDataMapBounds(){const e=new this.google.maps.LatLngBounds;this.map?.data.forEach((t=>{t.getGeometry()?.forEachLatLng((t=>{e.extend(t)}))})),this.mapDataBounds=e},async displayCurrentLocation(){try{if(!navigator.geolocation)throw new Error("Geolocation not available");const e=jY({google:this.google,map:this.map});await this.watchCurrentLocation({onSuccess:({coords:{latitude:t,longitude:i,accuracy:a}})=>{e.innerCircle.setPosition({lat:t,lng:i}),e.outerCircle.setRadius(a),this.currentLocation={lat:t,lng:i}},onError:e=>{throw new Error(`Error: ${e.code}: ${this.getPositionErrorMessage(e.code)}`)}})}catch(e){console.error(`Could not retrieve current location: ${e.message}`)}},async watchCurrentLocation({onSuccess:e,onError:t}){await navigator.geolocation.watchPosition(e,t,{enableHighAccuracy:!0})},async focusCurrentLocation(){try{if(!navigator.geolocation)throw new Error("Geolocation not available");if(!this.currentLocation)throw new Error("Could not retrieve current location.");this.map?.panTo(this.currentLocation)}catch(e){console.error(`Could not focus current location: ${e.message}`)}},getPositionErrorMessage(e){switch(e){case 1:return"Permission denied.";case 2:return"Position unavailable.";case 3:return"Timeout reached.";default:return"unknown error"}},centerMap(){switch(this.centerControlActionType){case"mapData":return this.mapFitBoundsToData(),void(this.centerControlActionType="currentLocation");case"currentLocation":return this.focusCurrentLocation(),void(this.centerControlActionType="mapData");default:this.mapFitBoundsToData(),this.centerControlActionType="currentLocation"}}},watch:{riskCategory(e){"high"===e&&(this.modalVisible=!0)}}}),XY=JY,QY=(0,ew.Z)(XY,AY,kY,!1,null,"39b827c0",null),eJ=QY.exports,tJ=function(){var e=this,t=e._self._c;return t("svg",{staticStyle:{"clip-rule":"evenodd","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"1.41420996"},attrs:{"xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape",width:e.width,viewBox:"0 0 1240.1576 354.33071",version:"1.1","xml:space":"preserve",id:"svg2","inkscape:version":"0.91 r13725","sodipodi:docname":"FARMDOK Logo Bild-Text- Farbe RGB - horizontal - small padding.svg"}},[t("metadata",{attrs:{id:"metadata27"}},[t("rdf:RDF",[t("cc:Work",{attrs:{"rdf:about":""}},[t("dc:format",[e._v("image/svg+xml")]),t("dc:type",{attrs:{"rdf:resource":"http://purl.org/dc/dcmitype/StillImage"}}),t("dc:title")],1)],1)],1),t("defs",{attrs:{id:"defs25"}}),t("sodipodi:namedview",{attrs:{pagecolor:"#ffffff",bordercolor:"#666666",borderopacity:"1",objecttolerance:"10",gridtolerance:"10",guidetolerance:"10","inkscape:pageopacity":"0","inkscape:pageshadow":"2","inkscape:window-width":"1600","inkscape:window-height":"838",id:"namedview23",showgrid:"false",units:"cm",borderlayer:"true","inkscape:zoom":"0.26499303","inkscape:cx":"941.83692","inkscape:cy":"-96.417728","inkscape:window-x":"-8","inkscape:window-y":"-8","inkscape:window-maximized":"1","inkscape:current-layer":"svg2"}}),t("rect",{staticStyle:{fill:"none"},attrs:{id:"FARMDOK-Logo-Bild.2f.Text.--Farbe-RGB-.--horizontal",x:"0.82999998",y:"-162.6693",width:"1431.39",height:"516.66699"}}),t("g",{attrs:{id:"g4155",transform:"translate(-96.228956,81.605923)"}},[t("g",{attrs:{transform:"translate(0,-162.66929)",id:"Schriftzug-Braun"}},[t("g",{attrs:{id:"g6"}},[t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path8",d:"m 450.467,316.655 20.538,0 0,-47.566 58.942,0 0,-18.692 -58.942,0 0,-31.878 
166.456,0 0,-18.692 -86.994,0 0,116.828 z"}})]),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path10",d:"m 528.166,316.655 21.039,0 12.022,-28.206 55.269,0 11.855,28.206 21.707,0 -51.428,-117.662 -19.035,0 -51.429,117.662 z m 40.575,-46.398 20.037,-46.731 20.204,46.731 -40.241,0 z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path12",d:"m 662.088,316.655 20.538,0 0,-40.723 25.715,0 28.719,40.723 24.212,0 -31.559,-44.228 c 16.364,-4.673 27.885,-16.189 27.885,-35.382 l 0,-0.334 c 0,-10.181 -3.506,-18.859 -9.684,-25.201 -7.514,-7.344 -19.036,-11.683 -33.729,-11.683 l -52.097,0 0,116.828 z m 20.538,-58.915 0,-39.221 29.889,0 c 15.195,0 24.211,6.843 24.211,19.36 l 0,0.334 c 0,11.85 -9.35,19.527 -24.044,19.527 l -30.056,0 z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path14",d:"m 776.008,316.655 20.204,0 0,-83.449 36.568,54.743 0.668,0 36.901,-55.076 0,83.782 20.538,0 0,-116.828 -21.874,0 -35.565,55.243 -35.566,-55.243 -21.874,0 0,116.828 z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path16",d:"m 911.197,316.655 43.581,0 c 36.734,0 62.115,-25.535 62.115,-58.414 l 0,-0.334 c 0,-32.879 -25.381,-58.08 -62.115,-58.08 l -43.581,0 0,116.828 z m 20.538,-18.693 0,-79.443 23.043,0 c 24.545,0 40.575,16.857 40.575,39.722 l 0,0.334 c 0,22.865 -16.03,39.387 -40.575,39.387 l -23.043,0 z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path18",d:"m 1090.42,318.24 c 35.899,0 61.279,-27.538 61.279,-60.416 l 0,-0.334 c 0,-32.879 -25.046,-60.083 -60.945,-60.083 -35.9,0 -61.28,27.538 -61.28,60.417 l 0,0.333 c 0,32.879 25.046,60.083 60.946,60.083 z m 0.334,-18.859 c -23.21,0 -39.741,-18.859 -39.741,-41.557 l 0,-0.334 c 0,-22.698 16.197,-41.224 39.407,-41.224 23.209,0 39.74,18.86 39.74,41.558 l 0,0.333 c 0,22.698 -16.197,41.224 -39.406,41.224 z"}}),t("path",{staticStyle:{fill:"#2a0900","fill-rule":"nonzero"},attrs:{"inkscape:connector-curvature":"0",id:"path20",d:"m 1164.13,316.655 20.538,0 0,-33.88 18.2,-18.693 39.907,52.573 24.879,0 -50.76,-66.592 48.59,-50.236 -25.214,0 -55.602,58.748 0,-58.748 -20.538,0 0,116.828 z"}})]),t("path",{staticStyle:{fill:"#3cc961"},attrs:{"inkscape:connector-curvature":"0",d:"m 167.579,177.11871 c -6.682,-5.512 -11.583,-12.102 -12.962,-21.411 -1.009,-6.807 0.116,-13.499 2.439,-19.846 4.138,-11.31 8.706,-22.46 13.207,-33.976 0.459,3.539 0.809,6.752 1.304,9.94 1.115,7.183 4.045,13.71 8.216,19.526 7.119,9.929 8.196,20.469 4.463,31.627 l 0,7.685 -2.858,0 13.364,0 c 2.383,-3.199 4.999,-6.216 7.997,-8.964 5.934,-5.432 13.17,-7.066 20.864,-7.257 10.686,-0.266 20.534,-3.084 29.413,-9.109 0.109,-0.074 0.974,-0.903 1.496,-0.989 -7.041,10.647 -14.365,21.99 -21.485,32.143 -4.52,6.443 -10.395,11.591 -18.043,14.223 -9.411,3.237 -18.495,1.366 -27.442,-1.995 -1.019,-0.382 -2.002,-0.864 -3.193,-1.385 l -16.78,0 0,-10.212 z M 296.746,3.9977055 l 54.167,0 0,183.3330045 -95.834,0 0,-16.667 79.167,0 0,-150.000004 -37.5,0 0,-16.6660005 z m -18.42,90.8400005 c -7.041,10.647004 -14.366,21.989004 -21.486,32.143004 -4.52,6.443 -10.395,11.591 -18.043,14.223 -9.41,3.237 -18.494,1.366 -27.442,-1.995 -1.024,-0.384 -2.012,-0.869 -3.212,-1.394 5.306,-9.349 10.542,-18.411 18.41,-25.622 5.933,-5.432 13.169,-7.066 20.864,-7.257 10.685,-0.266 20.533,-3.084 29.412,-9.109004 0.109,-0.074 0.974,-0.903 1.497,-0.989 z M 200.17,133.82871 c -10.972,-6.88 -19.817,-14.585 -21.75,-27.628 -1.008,-6.807004 0.117,-13.499004 2.439,-19.846004 4.138,-11.311 8.706,-22.46 13.207,-33.976 0.459,3.539 0.81,6.751 1.304,9.94 1.116,7.183 4.045,13.71 8.216,19.526 7.326,10.217 8.254,21.083004 4.125,32.603004 -2.282,6.373 -4.904,12.633 -7.541,19.381 z M 303.235,46.004706 c -6.84,10.342 -13.519,20.8 -20.61,30.966 -2.387,3.426 -5.592,6.414 -8.84,9.093 -8.836,7.283 -19.007,8.252 -29.731,5.385 -3.378,-0.899 -6.654,-2.193 -10.248,-3.393 5.814,-10.165 11.315,-20.013 20.351,-27.257 4.984,-3.993 10.845,-5.514 17.028,-5.678 11.456,-0.299 22.217,-2.72 32.05,-9.116 z m -77.261,37.807 c -6.101,-3.641 -11.091,-7.485 -15.129,-12.474 -8.255,-10.214 -8.516,-21.722 -4.61,-33.445 3.305,-9.928 7.522,-19.549 11.322,-29.3150005 0.721,-1.852 1.365,-3.736 2.435,-5.635 0.161,
11.814 0.305,3.628 0.482,5.439 0.897,9.3550005 4.769,17.5360005 9.906,25.2290005 4.436,6.64 6.648,13.848 5.236,21.862 -0.556,3.143 -1.183,6.325 -2.254,9.318 -2.255,6.3 -4.826,12.48 -7.388,19.021 z m -25.061,-63.148 -16.667,0 0,33.334 -16.667,0 0,-50.0000005 33.334,0 0,16.6660005 z m 84.049,-45.833 c -0.516,14.891 0.417,29.2779995 -3.006,43.382 -2.921,12.04 -10.335,20.207 -21.677,24.845 -4.047,1.655 -8.273,2.871 -12.382,4.275 -8.311,-18.596 -7.551,-33.696 5.494,-46.39200046 7.549,-7.34800004 16.134,-13.63999954 24.277,-20.37599954 2.215,-1.835 4.52,-3.56 7.294,-5.734 z",id:"Icon"}})])],1)},iJ=[],aJ={name:"IconTextLogoOriginal",props:{width:{type:[Number,String],default:9448.82},height:{type:[Number,String],default:3410.59}}},nJ=aJ,rJ=(0,ew.Z)(nJ,tJ,iJ,!1,null,null,null),sJ=rJ.exports,oJ=function(){var e=this,t=e._self._c;return t("div",{staticClass:"loading-global"},[t("div",{staticClass:"loading-global__logo"},[t("svg",{staticClass:"loading-global__logo-svg",attrs:{xmlns:"http://www.w3.org/2000/svg","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"1.414","clip-rule":"evenodd",viewBox:"0 0 9450 3413"}},[t("path",{attrs:{d:"M2968.94 1319.474h574.259v123.391h-438.685v210.427h389.085v123.391h-389.085v313.987H2968.94Zm852.395-5.508h125.653l339.485 776.704h-143.289l-78.258-186.189H3700.09l-79.36 186.189h-138.88Zm193.991 470.429-133.369-308.478-132.267 308.478Zm350.554-464.921h343.894c96.996 0 173.049 28.645 222.649 77.12 40.782 41.865 63.929 99.153 63.929 166.358v2.203c0 126.697-76.053 202.714-184.071 233.562l208.32 291.953h-159.822l-189.583-268.817h-169.742v268.817H4365.88Zm333.974 382.293c96.996 0 158.72-50.679 158.72-128.9v-2.203c0-82.628-59.52-127.799-159.822-127.799h-197.298v258.902Zm418.026-382.293h144.392l234.773 364.666 234.774-364.666h144.391v771.196h-135.573v-553.058l-243.592 363.564h-4.409l-241.386-361.36v550.854h-133.37Zm892.41 0h287.68c242.489 0 410.027 166.358 410.027 383.395v2.203c0 217.037-167.538 385.598-410.027 385.598h-287.68Zm287.68 647.805c162.027 0 267.84-109.069 267.84-260.004v-2.203c0-150.934-105.813-262.207-267.84-262.207h-152.107v524.414Zm493.108-262.754v-2.203c0-217.037 167.538-398.819 404.516-398.819s402.312 179.579 402.312 396.615v2.204c0 217.036-167.538 398.818-404.516 398.818s-402.312-179.578-402.312-396.615Zm664.641 0v-2.203c0-149.833-109.12-274.326-262.329-274.326s-260.125 122.29-260.125 272.122v2.204c0 149.832 109.12 274.325 262.329 274.325s260.125-122.289 260.125-272.122Zm224.191-385.051h135.574v387.801l367.04-387.801h166.436l-320.747 331.614 335.076 439.582h-164.231l-263.432-347.038-120.142 123.391v223.647H7679.91ZM1101.56 2243.38c-44.11-36.381-76.461-79.885-85.566-141.334-6.658-44.935.769-89.108 16.097-131.008 27.319-74.662 57.47-148.262 87.182-224.282 3.031 23.364 5.345 44.57 8.609 65.616 7.365 47.416 26.701 90.502 54.236 128.897 46.994 65.538 54.104 135.119 29.461 208.773v50.731h69.348c15.733-21.118 33.002-41.032 52.795-59.172 39.166-35.863 86.932-46.648 137.726-47.908 70.538-1.754 135.545-20.354 194.157-60.126.718-.491 6.429-5.962 9.878-6.53-46.479 70.282-94.83 145.155-141.83 212.178-29.834 42.53-68.618 76.513-119.102 93.89-62.121 21.366-122.086 9.016-181.151-13.17-6.722-2.52-13.211-5.702-21.073-9.143H1101.56Zm852.646-1142.8h357.562v1210.21h-632.609v-110.019h522.59v-990.17h-247.543Zm-121.594 599.65c-46.479 70.282-94.831 145.155-141.831 212.178-29.834 42.531-68.618 76.513-119.101 93.89-62.121 21.366-122.086 9.016-181.151-13.169-6.759-2.535-13.281-5.737-21.2-9.199 35.025-61.72 69.585-121.536 121.521-169.136 39.167-35.862 86.932-46.648 137.726-47.907 70.538-1.754 135.546-20.355 194.158-60.127.718-.491 6.428-5.962 9.878-6.53Zm-515.92 257.381c-72.423-45.41-130.813-96.277-143.57-182.372-6.657-44.935.769-89.108 16.098-131.008 27.319-74.662 57.469-148.262 87.182-224.282 3.03 23.364 5.344 44.57 8.609 65.617 7.364 47.416 26.7 90.501 54.235 128.896 48.362 67.446 54.484 139.173 27.231 215.215-15.064 42.071-32.374 83.396-49.785 127.934Zm680.346-579.737c-45.146 68.27-89.236 137.303-136.049 204.413-15.756 22.617-36.908 42.338-58.349 60.022-58.329 48.077-125.471 54.477-196.259 35.548-22.301-5.936-43.926-14.472-67.652-22.398 38.381-67.102 74.697-132.106 134.342-179.926 32.899-26.355 71.588-36.396 112.403-37.479 75.626-1.974 146.66-17.955 211.564-60.18Zm-510.004 249.569c-40.278-24.035-73.218-49.408-99.869-82.343-54.498-67.421-56.218-143.39-30.436-220.775 21.819-65.535 49.657-129.046 74.74-193.507 4.758-12.23 9.009-24.665 16.074-37.202 1.06 11.979 2.012 23.954 3.181 35.909 5.919 61.749 31.483 115.757 65.39 166.538 29.286 43.827 43.887 91.414 34.568 144.311-3.671 20.75-7.81 41.756-14.883 61.508-14.887 41.59-31.856 82.385-48.765 125.561Zm-165.436-416.844h-110.019v220.038H1101.56V1100.58h220.038Zm554.821-302.552c-3.406 98.296 2.751 193.267-19.844 286.372-19.28 79.478-68.223 133.388-143.091 164.006-26.716 10.926-54.613 18.951-81.738 28.215-54.859-122.753-49.843-222.431 36.272-306.238 49.829-48.504 106.496-90.038 160.253-134.501 14.619-12.113 29.838-23.504 48.148-37.854Z"}}
1)])]),t("div",{staticClass:"loading-global__spinner"},[t("FontAwesomeIcon",{staticClass:"loading-global__spinner-icon",attrs:{icon:["fad","spinner-third"],size:"2x",spin:""}})],1)])},lJ=[];ow.vI.add(yF.AX7);var dJ={name:"LoadingGlobal"},cJ=dJ,uJ=(0,ew.Z)(cJ,oJ,lJ,!1,null,"662c369c",null),pJ=uJ.exports,hJ=(0,b.defineComponent)({__name:"PageViewer",setup(e){const t=(0,NL.yj)(),i=(0,NL.tv)(),a=(0,b.ref)(),n=(0,b.ref)(),r=origin;(0,b.onMounted)((()=>{t.params.fileId?l().get(`/file/${t.params.fileId}`).then((({data:e})=>{a.value=e})).catch((e=>{e.message.includes("404")?i.replace({name:"404"}):s.value=e.message})):i.replace({name:"404"})}));const s=(0,b.ref)("");function o(){n.value?.click()}return{__sfc:!0,route:t,router:i,geoJson:a,downloadLink:n,baseUrl:r,errorMessage:s,downloadFile:o,GeoJsonMap:eJ,ThePageSkeleton:$w,IconTextLogoOriginal:sJ,ErrorUserMessage:cH,LoadingGlobal:pJ}}}),mJ=hJ,fJ=(0,ew.Z)(mJ,CY,FY,!1,null,"3c9aeb78",null),gJ=fJ.exports;const yJ=b["default"].i18n.translate,vJ={to:{name:"drone"},label:()=>`${yJ("Zurück zu")} ${yJ("Datura-Kontrollzentrum")}`};var bJ=[{path:`${M}datura`,name:"datura",component:uK,redirect:{name:"drone"},meta:{label:()=>yJ("Datura-Kontrollzentrum"),featureControl:Hr.FEATURE_DATURA_CONTROL},children:[{path:"drone",name:"drone",component:Oq,meta:{requiresAuth:!0,label:()=>yJ("Datura-Kontrollzentrum"),labelTab:()=>yJ("Drohnenassessments"),featureControl:Hr.FEATURE_DATURA_CONTROL}},{path:"drone/new",name:"drone/new",component:GK,meta:{requiresAuth:!0,label:()=>yJ("Assessment erstellen"),featureControl:Hr.FEATURE_DATURA_CONTROL,subheader:()=>yJ("Drohnenbilder hochladen, um ein neues Assessment zu starten"),back:vJ}},{path:"drone/viewer/:fileId",name:"drone/viewer",component:gJ,meta:{requiresAuth:!1,isFullscreen:!0}},{path:"history",name:"history",component:wY,meta:{requiresAuth:!0,label:()=>yJ("Verlauf"),subheader:()=>yJ("Den Status des aktuellen Auftrags und den Auftragsverlauf anzeigen"),featureControl:Hr.FEATURE_DATURA_CONTROL,back:vJ}}]}],wJ=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[t("div",{staticClass:"mobile-hide"},[null!=e.contracting&&null!=e.contracting.imagePartnerLogo?t("ImgPartnerLogo",{attrs:{src:e.contracting.imagePartnerLogo,width:100,height:55}}):e._e()],1)]},proxy:!0},{key:"middle",fn:function(){return[t("div",{staticClass:"mobile-hide"},[t("Steps",{attrs:{current:e.current,steps:e.steps}})],1)]},proxy:!0},{key:"right",fn:function(){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:0===e.current&&!e.fetchingError&&!e.isSpecialContract,expression:"current === 0 && !fetchingError && !isSpecialContract"}],staticClass:"mr-1",attrs:{searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ButtonWithArrow",{staticClass:"mr-1 mobile-hide",attrs:{variant:"lightest",type:"left"},on:{click:e.back}},[e._v(" "+e._s(e.labelBack)+" ")]),t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.bottomleft.viewport",value:{container:"#the-contentbar",trigger:!1},expression:"{ container: '#the-contentbar', trigger: false }",modifiers:{bottomleft:!0,viewport:!0}}],staticClass:"d-inline-block mr-1",attrs:{id:"page--contracting__button-next-tooltip",tabindex:"0",title:e.nextButtonTooltip},on:{mouseenter:function(t){return e.$root.$emit("bv::show::tooltip","page--contracting__button-next-tooltip")},mouseleave:function(t){return e.$root.$emit("bv::hide::tooltip","page--contracting__button-next-tooltip")}}},[t("ButtonWithArrow",{staticClass:"mr-1",attrs:{variant:"primary",type:"right",disabled:!e.nextButtonEnabled},on:{click:e.next}},[e._v(" "+e._s(e.labelNext)+" "),1===e.current&&e.fetchingCompanyData?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1)],1)]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[0===e.current&&e.fetchingError?t("FetchingError",{attrs:{"user-message":e.fetchingErrorUserMessage},on:{reload:e.loadFields}},[e.fetchingErrorNoFieldsFound?t("b-button",{staticClass:"mb-4",attrs:{variant:"primary"},on:{click:function(t){return t.preventDefault(),e.navigateToFieldsInContractCropYear.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("Verwalte hier deine Flächen"))+" ")]):e._e(
1),e.fetchingErrorNoProcessOrderFound&&e.canCreateContractProcessOrder?t("b-button",{staticClass:"mb-4",attrs:{variant:"primary"},on:{click:function(t){return t.preventDefault(),e.createNewProcessOrder.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("Erstelle ein neues Erntejahr"))+" ")]):e._e(),t("p",[e.fetchingErrorNoProcessOrderFound&&!e.canCreateContractProcessOrder?t("b-link",{on:{click:function(t){return t.preventDefault(),e.navigateToFieldsInLatestCropYear.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("Lege alle Erntejahre bis inklusive {cropYear} an und überprüfe deine Felder.",{cropYear:e.contractProcessOrderName}))+" ")]):e._e()],1)],1):e._e(),0!==e.current||e.fetchingError||!e.fieldsLoaded||e.isSpecialContract?e._e():t("TableSendFieldsContainer",{attrs:{id:"hot-contracting-fields","contract-id":e.contractId,company:e.company,fields:e.fields,"already-sent-fields":e.alreadySentFields,"filter-string":e.filterString,"visible-rows":e.visibleRows,"selected-rows":e.selectedRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:selectedTableData":function(t){e.selectedFields=t}}}),e.isSpecialContract?t("PlantProtectionContractForm",{ref:"specialContractRef"}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:1===e.current,expression:"current === 1"}],staticClass:"contracting__info"},[t("h3",{staticClass:"h4 mb-4"},[e._v(e._s(e.$t("Vertragsnehmer")))]),t("ValidationObserver",{ref:"formContractingValidationObserver",scopedSlots:e._u([{key:"default",fn:function({handleSubmit:i,errors:a}){return[t("BForm",{ref:"formContracting",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),i(e.submitForm)}}},[t("div",{staticClass:"contracting__info-grid mb-4"},[t("ValidationProvider",{attrs:{rules:"required",name:e.$t("Betriebsnummer"),vid:"companyBdmId",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{staticClass:"contracting__info-grid-item contracting__info-grid-item--left",attrs:{label:e.$t("Betriebsnummer"),"label-for":"company-nr","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"company-nr",disabled:e.fetchingCompanyData,state:!(i.length>0)&&null},model:{value:e.company.companyBdmId,callback:function(t){e.$set(e.company,"companyBdmId",t)},expression:"company.companyBdmId"}})],1)]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:e.partnerNumberValidationRule,name:e.$t("Partner-Nummer"),vid:"foreignId",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{staticClass:"contracting__info-grid-item contracting__info-grid-item--left",attrs:{label:e.$t("Partner-Nummer"),"label-for":"company-foreign-id","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"company-foreign-id",disabled:e.fetchingCompanyData,state:!(i.length>0)&&null},model:{value:e.company.foreignId,callback:function(t){e.$set(e.company,"foreignId",t)},expression:"company.foreignId"}})],1)]}}],null,!0)}),e.sendByFieldSharing?t("ValidationProvider",{attrs:{rules:"required",name:e.$t("Betriebsname"),vid:"companyName",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{staticClass:"contracting__info-grid-item contracting__info-grid-item--left",attrs:{label:e.$t("Betriebsname"),"label-for":"company-name","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"company-name",disabled:e.fetchingCompanyData,state:!(i.length>0)&&null},model:{value:e.company.companyName,callback:function(t){e.$set(e.company,"companyName",t)},expression:"company.companyName"}})],1)]}}],null,!0)}):e._e(),e.sendByFieldSharing?t("ValidationProvider",{attrs:{rules:"required",name:e.$t("Verwendungszweck"),vid:"senderReference",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{staticClass:"contracting__info-grid-item contracting__info-grid-item--left",attrs:{label:e.$t("Verwendungszweck"),"label-for":"sender-reference","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"sender-reference",disabled:"",state:!(i.length>0)&&null},model:{value:e.contracting.name,callback:function(t){e.$set(e.contracting,"name",t)},expression:"contracting.name"}}
1)],1)]}}],null,!0)}):e._e()],1)])]}}])}),e.hints?t("div",{staticClass:"contracting__hints",domProps:{innerHTML:e._s(e.hints)}}):e._e()],1),t("ModalTermsContainer",{ref:"modalTerms",attrs:{gtc:e.gtc,"checkbox-text":e.checkboxText,fieldIds:e.fieldIds,companyData:e.company,title:e.getGtcModalTitle,contractAdditionalData:e.contractAdditionalData,showDownloadLink:e.isSpecialContract}}),t("ModalCreateProcessOrder",{ref:"modalCreateProcessOrder",attrs:{direction:"next","switch-to-new-process-order":!1,"source-process-order-name":String(Number(e.contractProcessOrderName)-1)}})]},proxy:!0}])})},CJ=[],FJ=function(){var e=this,t=e._self._c;return t("BFormInput",e._g({directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:e.tooltipOptions,expression:"tooltipOptions"}],staticClass:"form-control--text-input",attrs:{placeholder:e.internalPlaceholder,id:e.id,type:e.type,required:e.internalRequired,disabled:e.internalDisabled,state:e.state,trim:""},model:{value:e.internalValue,callback:function(t){e.internalValue=t},expression:"internalValue"}},e.$listeners))},AJ=[],kJ={props:{type:{type:String,default:"text"},id:{type:String,default:null},placeholder:{type:String,default:""},required:{type:Boolean,default:!1},variant:{type:String,default:null},disabled:{type:Boolean,default:!1},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},errorMessage:{type:String,default:null}},computed:{internalValue:{get(){return this.various?"":this.value},set(e){this.$emit("input",e)}},internalRequired(){return!this.various&&this.required},internalPlaceholder(){return this.various?this.$t("(verschiedene)"):this.placeholder?this.placeholder:this.required?this.$t("Pflichtfeld"):this.$t("keine Angabe")},internalDisabled(){return this.disabled},tooltipOptions(){if(!this.errorMessage)return{disabled:!0};const e='<svg data-v-ec31963e="" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="exclamation-square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-exclamation-square fa-w-14"><path data-v-ec31963e="" fill="currentColor" d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zm-207.691 96h63.382c6.884 0 12.357 5.78 11.982 12.654l-7.418 136c-.347 6.364-5.609 11.346-11.982 11.346h-48.546c-6.373 0-11.635-4.982-11.982-11.346l-7.418-136c-.375-6.874 5.098-12.654 11.982-12.654zM224 398c-25.405 0-46-20.595-46-46s20.595-46 46-46 46 20.595 46 46-20.595 46-46 46z" class=""></path></svg>';return{html:!0,title:()=>`${this.errorMessage} ${e}`,customClass:"handsontable-error-tooltip",placement:"rightbottom"}}}},SJ={name:"BaseInput",mixins:[kJ],props:{type:{type:String,default:"text"},value:{type:String}}},EJ=SJ,IJ=(0,ew.Z)(EJ,FJ,AJ,!1,null,null,null),_J=IJ.exports,DJ=function(){var e=this,t=e._self._c;return t("img",{staticClass:"img-partner-logo",attrs:{src:e.src,width:e.width,height:e.height,alt:"Partner logo"}})},MJ=[],PJ={name:"ImgPartnerLogo",props:{src:{type:String,required:!0},width:{type:Number,default:100},height:{type:Number,default:55}}},TJ=PJ,xJ=(0,ew.Z)(TJ,DJ,MJ,!1,null,"716f7b9a",null),BJ=xJ.exports,OJ=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"p-4 root"},[t("h5",{staticClass:"mb-4"},[e._v(e._s(e.$t("Betriebsdaten")))]),t("div",{staticClass:"mb-6 data-grid"},[t("div",{staticClass:"grid-label"},[e._v(e._s(e.$t("Betriebsnummer")))]),t("div",{staticClass:"pt-1 data-notice"},[e._v(" "+e._s(e.$t("Anonym - es werden keine Daten übermittelt, durch die du identifiziert werden könntest "))+" ")]),t("div")]),e._m(0),e._l(i.rows,(function(a){return t("div",{key:a.key,staticClass:"data-grid"},[t("div",{staticClass:"grid-label"},[e._v(e._s(a.label))]),e._l(i.years,(function(n){return t("div",{key:`${a.key}-${n}`,staticClass:"input-wrapper"},[t("label",{staticClass:"year-label d-md-none"},[e._v(e._s(n))]),t(i.Dropdown,{ref:e=>i.setDropdownRef(e,`${n}-${a.key}`),refInFor:!0,attrs:{"ref-key":`${n}-${a.key}`,items:i.dropdownItems(i.getSelected(n,a.key)),variant:"form-field",state:(!i.submitted||null!==i.getSelected(n,a.key))&&null,required:!0,preventMobileKeyboard:!0},on:{select:e=>i.updateSelected(n,a.key,e.value)}}),i.submitted&&null===i.selected[n][a.key]?t("div",{staticClass:"invalid-feedback"}
1,[e._v(" "+e._s(e.$t("Bitte auswählen"))+" ")]):e._e()],1)}))],2)}))],2)},$J=[function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"data-grid header"},[t("div",{staticClass:"grid-label"}),t("div",[e._v("2023")]),t("div",[e._v("2024")])])}],RJ=(0,b.defineComponent)({__name:"PlantProtectionContractForm",setup(e,{expose:t}){const i=(0,b.ref)({}),a=["2023","2024"],n=[{label:"Bewirtschaftungsform Bio",key:"organicFarming"},{label:"Herbizidverzicht Wein Obst Hopfen",key:"noHerbicideWineFruitHops"},{label:"Insektizidverzicht Wein Obst Hopfen",key:"noInsecticideWineFruitHops"}],r=(0,b.ref)({2023:{organicFarming:null,noHerbicideWineFruitHops:null,noInsecticideWineFruitHops:null},2024:{organicFarming:null,noHerbicideWineFruitHops:null,noInsecticideWineFruitHops:null}}),s=(0,b.ref)(!1),o=()=>Object.values(r.value["2023"]).every((e=>null!==e))&&Object.values(r.value["2024"]).every((e=>null!==e)),l=()=>{if(s.value=!0,!o())return c(),null;const e=["organicFarming","noHerbicideWineFruitHops","noInsecticideWineFruitHops"],t={processOrderData:{2023:{},2024:{}}};return a.forEach((i=>{e.forEach((e=>{t.processOrderData[i][e]=r.value[i][e]}))})),t};function d(e,t){e&&(i.value[t]=e)}function c(){(0,b.nextTick)((()=>{a.some((e=>n.some((t=>{if(null===r.value[e][t.key]){const a=`${e}-${t.key}`,n=i.value[a]?.$el;return n?.scrollIntoView&&n.scrollIntoView({behavior:"smooth",block:"center"}),!0}return!1}))))}))}const u=[{id:null,name:"auswählen",value:null},{id:!0,name:"Ja",value:!0},{id:!1,name:"Nein",value:!1}];function p(e){return{data:[{name:"",items:u}],loading:!1,selected:u.find((t=>t.value===e))||{id:null,name:"",value:null}}}function h(e,t){return r.value[e][t]}function m(e,t,i){r.value[e][t]=i;const a="2023"===e?"2024":"2023";null===r.value[a][t]&&(r.value[a][t]=i)}return t({handleSubmit:l}),{__sfc:!0,dropdownRefs:i,years:a,rows:n,selected:r,submitted:s,isValid:o,handleSubmit:l,setDropdownRef:d,scrollToFirstInvalid:c,dropdownOptions:u,dropdownItems:p,getSelected:h,updateSelected:m,Dropdown:nk}}}),NJ=RJ,zJ=(0,ew.Z)(NJ,OJ,$J,!1,null,"83d7537a",null),LJ=zJ.exports,VJ=function(){var e=this,t=e._self._c;return t("ModalTerms",{ref:"modal",attrs:{gtc:e.gtc,"checkbox-text":e.checkboxText,"is-creating":e.isCreating,title:e.title,showDownloadLink:e.showDownloadLink},on:{accept:e.accept,downloadExcel:e.downloadExcel}})},UJ=[],jJ=i(80129),HJ=i.n(jJ),GJ=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modal",staticClass:"modal-terms",attrs:{size:"lg","bottom-bg-gray":"",title:e.title},scopedSlots:e._u([{key:"bottom-content",fn:function(){return[t("FormCheckbox",{staticClass:"modal-terms__terms-checkbox",attrs:{name:"terms",size:"sm",disabled:null==e.gtc||0===e.gtc.length||e.isCreating},model:{value:e.terms,callback:function(t){e.terms=t},expression:"terms"}},[e._v(" "+e._s(e.checkboxText)+" ")]),e.showDownloadLink?t("div",{staticClass:"download-link"},[t("span",[e._v("Folgende Daten werden übermittelt: "),t("a",{attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.$emit("downloadExcel")}}},[e._v(" Verwendung_von_Pflanzenschutzmittel_2023-2024.xlsx (Herunterladen)")])])]):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",staticStyle:{"min-width":"120px"},attrs:{variant:"primary",disabled:!e.terms||e.isCreating},on:{click:function(t){return e.$emit("accept")}}},[e.isCreating?e._e():t("span",[e._v(e._s(e.$t("Absenden")))]),e.isCreating?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1),t("BButton",{staticClass:"text-black",attrs:{variant:"link",disabled:e.isCreating},on:{click:e.hide}},[e._v(" "+e._s(e.$t("Abbrechen"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"modal-terms__terms-content mt-3 mb-3",domProps:{innerHTML:e._s(e.gtcText)}})])},WJ=[];ow.vI.add(uw.IJ7);var ZJ={name:"ModalTerms",components:{FormCheckbox:Gw,ModalWrapper:OC},props:{gtc:{type:String,default:null},checkboxText:{type:String,default(){return this.$t("Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung zu genannten Zwecken ausdrücklich zu.")}},title:{type:String,required:!0},isCreating:{type:Boolean,default:!1},showDownloadLink:{type:Boolean,default:!1}},data(){return{terms:!1}},computed:{gtcText(){if("string"!==typeof this.gtc||0===this.gtc.length)return`<p class="text-danger">${this.$t("Die AGB konnten nicht geladen werden.")}</p>`;const e=document.createElement("div");e.innerHTML=this.gtc;const t=Array.from(e.querySelectorAll("a"));return t.forEach((e=>{e.target="_blank"}
1)),e.innerHTML}},methods:{show(){this.terms=!1,this.$refs.modal.show()},hide(){this.$refs.modal.hide()}}},KJ=ZJ,qJ=(0,ew.Z)(KJ,GJ,WJ,!1,null,"6683ea5c",null),YJ=qJ.exports,JJ={name:"ModalTermsContainer",components:{ModalTerms:YJ},props:{gtc:{type:String,default:null},checkboxText:{type:String,default:null},fieldIds:{type:Array,required:!0},companyData:{type:Object,required:!0},title:{type:String,default(){return this.$t("Vereinbarungen zur Flächenmeldung")}},contractAdditionalData:{type:Object,default:()=>({})},showDownloadLink:{type:Boolean,default:!1}},computed:{isCreating(){return null!=this.$store.state.digitalContracting.creating}},methods:{downloadExcel(){const e=this.$store.state.auth.currentCompanies?.[0]?.id,t=this.$store.state.digitalContracting.contracting,i={2023:this.contractAdditionalData.processOrderData["2023"].noHerbicideWineFruitHops,2024:this.contractAdditionalData.processOrderData["2024"].noHerbicideWineFruitHops},a={2023:this.contractAdditionalData.processOrderData["2023"].noInsecticideWineFruitHops,2024:this.contractAdditionalData.processOrderData["2024"].noInsecticideWineFruitHops},n={2023:this.contractAdditionalData.processOrderData["2023"].organicFarming,2024:this.contractAdditionalData.processOrderData["2024"].organicFarming},r={companyId:e,contractId:t.guid,organicFarming:n,noHerbicideWineFruitHops:i,noInsecticideWineFruitHops:a},s=HJ().stringify(r,{encode:!1,arrayFormat:"brackets"}),o=`${origin}/rest/reports/psm-stats/xlsx?${s}`;l().get(o,{responseType:"blob"}).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),i=document.createElement("a");i.href=t,i.setAttribute("download","Verwendung_von_Pflanzenschutzmittel_2023-2024_fd.xlsx"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(t)}))},show(){null!=this.$refs.modal&&this.$refs.modal.show()},hide(){null!=this.$refs.modal&&this.$refs.modal.hide()},async accept(){try{await this.$store.dispatch("digitalContracting/accept",{fieldIds:this.fieldIds,companyData:this.companyData,newsletter:0,contractAdditionalData:this.contractAdditionalData})}catch(e){console.error("Unable to accept contract.",e)}finally{this.$refs.modal.hide()}}}},XJ=JJ,QJ=(0,ew.Z)(XJ,VJ,UJ,!1,null,"ddef05d2",null),eX=QJ.exports,tX=function(){var e=this,t=e._self._c;return t("div",{staticClass:"h-100"},[t("TableBase",{ref:"table",attrs:{id:"hot-contracting-import-fields-yields-field-mapping","disable-read-only-bg":"","filter-string":e.filterString,"table-settings":e.tableSettings,"selected-rows":e.selectedRows,"table-data":e.tableData,loading:e.loading,cells:e.tableHookCells},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:cell":e.updateCell,"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Gesamtfläche {totalArea} ha",{totalArea:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])})],1)},iX=[],aX={data(){return{loading:!1,source:null,tableData:{},tableErrors:[]}},beforeDestroy(){null!=this.source&&this.source.cancel()},methods:{async loadTableData(e){this.loading=!0,this.tableErrors=[],this.source=l().CancelToken.source();try{const{data:t}=await l().get(e,{cancelToken:this.source.token});this.tableData=t.reduce(((e,t)=>({...e,[t.id]:{...t,storeStatus:V}})),{}),this.loading=!1}catch(t){this.tableErrors=[{type:q}]}}}},nX=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...eA,lockedVisibility:!0,readOnly:!0},{...EF,readOnly:!0},{..._F,readOnly:!0},{...DF},{...iA,readOnly:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],rX={name:"TableSendFieldsContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD,aX,oI],props:{filterString:{type:String,default:""},contractId:{type:Number,required:!0},company:{type:Object,required:!0},fields:{type:Array,required:!0},alreadySentFields:{type:Array,required:!0}},data(){const e=nX.map((e=>e.key===DF.key?{...e,getRendererValue:({value:e})=>null!=this.cropsById[e]&&"string"===typeof this.cropsById[e].name?this.cropsById[e].name:"",getItems:async()=>[{name:"Crops",id:"crops",items:this.crops,sort:!1}]}:e));return{columnDefinition:e,loading:!0,crops:[]}},computed:{cropsById(){return this.crops.reduce(((e,t)=>({...e,[t.id]:t})),{})},alreadySentFieldsById(){return this.alreadySentFields.reduce(((e,t)=>({...e,[t.fieldId]:t})),{})},selectedTableData(){return 0===this.selectedRows.length||this.selectedRows.some((e=>null==this.tableData[e]||null==this.tableData[e][DF.key]))?null:this.selectedRows.map((e=>this.tableData[e]))}},watch:{selectedTableData(e){this.$emit("update:selectedTableData",e)}},async mounted(){await this.loadCrops(),this.tableData=this.fields.reduce(((e,t)=>({...e,[t.id]:t})),{}),this.loading=!1},methods:{async loadCrops(){const{data:e}=await l().get(`/admin/digitalContracting/getAllowedCrops/${this.contractId}`);this.crops=e},async tableMounted(){if(gD.methods.tableMounted.call(this),await new Promise((e=>
1setTimeout(e,30))),0===this.selectedRows.length){const e=this.fields.filter((e=>this.alreadySentFields.length>0?null!==e[DF.key]&&null!=this.alreadySentFieldsById[e.id]:null!==e[DF.key])).map((e=>e.id));this.$emit("update:selectedRows",e)}},updateCell({columnKey:e,guid:t,value:i}){let a="text";if(this.tableSettings.columns.some((t=>t.key===e&&(a=t.type,!0))),"numeric"===a&&Number.isNaN(Number(i))&&(i=null),e===DF.key&&null!==i){const e={type:"update",id:t,columns:{cropId:i}};l().post("/admin/fields/submit?dataRequest",[e])}this.tableData[t][e]=i},tableHookCells(e,t,i){if(this.tableSettings.columns[t].key!==DF.key)return i;const a=this.$refs.table.physicalRowToGuid(e);return null==this.tableData[a]?i:this.selectedRows.includes(a)?{...i,required:!0}:{...i,required:!1}}}},sX=rX,oX=(0,ew.Z)(sX,tX,iX,!1,null,null,null),lX=oX.exports,dX={name:"PageContracting",components:{ModalTermsContainer:eX,ModalCreateProcessOrder:nV,TableSendFieldsContainer:lX,TheContentbar:HL,ThePageSkeleton:$w,SearchBar:YE,Steps:LU,ButtonWithArrow:VK,FetchingError:VI,BaseInput:_J,ImgPartnerLogo:BJ,PlantProtectionContractForm:LJ},props:{modeResend:{type:Boolean,default:!1}},data(){return{baseUrl:M,filterString:"",visibleRows:[],selectedRows:[],current:0,fetchingCompanyData:!1,company:{nr:"",name:"",address:"",postcode:"",city:"",country:"",foreignId:"",user:{title:null,firstname:"",lastname:"",email:""}},contractAdditionalData:{},fields:[],checkboxText:null,fieldsLoaded:!1,fetchingError:!1,fetchingErrorUserMessage:"",fetchingErrorNoFieldsFound:!1,fetchingErrorNoProcessOrderFound:!1,alreadySentFields:[],selectedFields:null}},computed:{isSpecialContract(){return"\\AgriDat\\App\\Components\\DigitalContracting\\ContractSenderEuPsmStats"===this.$store.state.digitalContracting.contracting?.sender?.class},getGtcModalTitle(){return this.isSpecialContract?"Teilnahme an der Statistik zur Verwendung von Pflanzenschutzmitteln in der Landwirtschaft":this.$t("Vereinbarungen zur Flächenmeldung")},steps(){return this.isSpecialContract?[{number:"1",label:this.$t("Betriebsdaten")}]:[{number:"1",label:this.$t("Flächen")},{number:"2",label:this.$t("Daten")}]},labelBack(){return 0===this.current?this.$t("Abbrechen"):this.$t("Zurück")},labelNext(){return 0!==this.current||this.isSpecialContract?this.fetchingCompanyData?"":this.$t("Absenden"):this.$t("Weiter")},nextButtonEnabled(){return 0===this.current?null!==this.selectedFields||this.isSpecialContract:1===this.current&&!this.fetchingCompanyData},contractId(){return this.$store.state.digitalContracting.contracting?.id||null},contracting(){return this.$store.state.digitalContracting.contracting},contractProcessOrderName(){return this.$store.state.digitalContracting.contracting?.processOrderName||null},gtc(){return this.$store.state.digitalContracting.contracting?.gtc||null},partner(){return this.$store.state.digitalContracting.contracting?.partner||null},backendError(){const e=this.$store.state.digitalContracting.errors;return null==e||0===e.length?null:this.$store.state.digitalContracting.errors[0]},backendAttributeErrors(){return null!=this.backendError&&"attributeValueError"===this.backendError.status?this.backendError.attributeErrorMessages:null},backendGeneralError(){return null!=this.backendError&&"error"===this.backendError.status?this.backendError.userMessage:null},hints(){let e="";return"AGRANA"===this.partner&&(e+=this.$t('Partner-Nummer – Siehe Zugangsdaten auf <a href="https://ris.agrana.com" target="_blank">https://ris.agrana.com</a>')),"Saatbau"===this.partner&&(e+=this.$t("Die Partnernummer ist deine Identifikationsnummer bei SAATBAU LINZ eGen."),e+="<br/> <br/>",e+=this.$t("Durch die Freigabe der ausgewählten Felder erhält Dein Vertragspartner SAATBAU LINZ eGen lesenden Zugriff auf die Felder sowie die darauf gebuchten Maßnahmen und das Schlagblatt.")),e},nextButtonTooltip(){return 0!==this.current||null!==this.selectedFields||this.isSpecialContract?"":this.$t("Wähle mindesten ein Feld mit dem Kontrollkästchen in der ersten Spalte. Alle ausgewählten Felder müssen eine Kultur haben.")},fieldIds(){return Array.isArray(this.selectedFields)?this.selectedFields.map((e=>e.id)):[]},contractProcessOrderExists(){return this.$store.getters["auth/availableProcessOrderNames"].includes(this.contractProcessOrderName)},canCreateContractProcessOrder(){const e=String(Number(this.contractProcessOrderName)-1);return this.$store.getters["auth/availableProcessOrderNames"].includes(e)}
1,sendByFieldSharing(){return"\\AgriDat\\App\\Components\\DigitalContracting\\ContractSenderFieldSharing"===this.$store.state.digitalContracting.contracting?.sender?.class},partnerNumberValidationRule(){if(!this.partner)return"required";const e=this.partner.toLowerCase();return e.includes("saatbau")||e.includes("mauthner")?"":"required"}},watch:{backendError(e){null!=e&&this.$refs.modalTerms.hide()},backendAttributeErrors(e){null!=e&&this.$refs.formContractingValidationObserver.setErrors(e)},contracting(e){null==e&&this.finish()}},async created(){const e=async()=>{if(await this.$store.dispatch("digitalContracting/subscribe"),this.modeResend){const e=Number.parseInt(this.$route.params.contractCompanyId,10),t=this.$store.getters["digitalContracting/getByContractCompanyId"](e);return this.$store.commit("digitalContracting/setContracting",t),t}const{contractGuid:e}=this.$route.params,t=this.$store.getters["digitalContracting/getByGuid"](e);return this.$store.commit("digitalContracting/setContracting",t),t},t=()=>{this.modeResend?this.$router.push({name:"digital-contracting/my-contracts"}):this.$router.push({name:"digital-contracting/open-calls"})},i=await e();i?(this.storeUnsubscribe=this.$store.subscribe((async({type:i})=>{if("afterResetData"===i){const i=await e();i||t()}})),this.isSpecialContract?(this.current=0,this.fieldsLoaded=!0,await this.loadCompanyData()):await Promise.all([this.loadCompanyData(),this.loadFields()])):t()},beforeDestroy(){this.$store.commit("digitalContracting/setContracting",null)},methods:{submitSpecialContract(){const e=this.$refs.specialContractRef.handleSubmit();this.contractAdditionalData=e,this.contractAdditionalData&&(this.checkboxText="Ich habe die Information gelesen und gebe meine Zustimmung.",this.$refs.modalTerms.show())},async loadCompanyData(){this.fetchingCompanyData=!0;let e={};if(!0===this.modeResend){const{contractCompanyId:t}=this.$route.params,i=await l().get(`/admin/digitalContracting/getContractCompanyData/${t}`);({data:e}=i),this.alreadySentFields=null!=e.contractFields?e.contractFields:[]}else{const t=await l().get(`/admin/digitalContracting/getCompanyDataForContract/${this.contractId}`);({data:e}=t),e.country=e.region.name}this.company.companyBdmId=String(null==e.companyBdmId?"":e.companyBdmId),this.company.foreignId=String(null!=e.foreignId?e.foreignId:""),this.company.companyName=e.companyName,this.company.address=e.address,this.company.postcode=String(e.postcode),this.company.city=e.city,this.company.country=e.country,this.company.user.title=e.title,this.company.user.firstname=e.firstname,this.company.user.lastname=e.lastname,this.company.user.email=e.email,this.fetchingCompanyData=!1},async loadFields(){this.fetchingError=!1,this.fetchingErrorNoFieldsFound=!1,this.fetchingErrorNoProcessOrderFound=!1;try{const{data:e}=await l().get(`/admin/digitalContracting/getFields/${this.contractId}`);this.fields=e,this.fieldsLoaded=!0}catch(e){if(this.fetchingError=!0,this.fetchingErrorUserMessage=this.$t("\n          Die Daten konnten nicht geladen werden. Bitte überprüfe die Internetverbindung.\n          Falls der Fehler weiterhin auftritt wende dich an [email protected]\n        "),null==e.response||null==e.response.data)return;"noFieldsFound"===e.response.data.type&&(this.fetchingErrorNoFieldsFound=!0,this.fetchingErrorUserMessage=this.$t("\n            Auf deinem Betrieb gibt es derzeit keine Felder, die die notwendigen Voraussetzungen für diese Flächenübermittlung erfüllen.\n          ")),"noProcessOrderFound"===e.response.data.type&&(this.fetchingErrorNoProcessOrderFound=!0),"string"===typeof e.response.data.userMessage&&(this.fetchingErrorUserMessage=e.response.data.userMessage.replace("{process_order_name}",this.contractProcessOrderName))}},back(){this.current>0?this.current=0:!0===this.modeResend?this.$router.push({name:"digital-contracting/my-contracts"}):this.$router.push({name:"digital-contracting/open-calls"})},next(){0===this.current?this.isSpecialContract?this.submitSpecialContract():this.current=1:this.$refs.formContractingValidationObserver.handleSubmit(this.submitForm)},finish(){this.$store.dispatch("digitalContracting/reset"),this.$store.dispatch("digitalContracting/subscribe"),this.$refs.modalTerms.hide(),this.$router.push({name:"digital-contracting/my-contracts"})}
1,submitForm(){this.checkboxText=null,null!=this.partner&&""!==this.partner&&(this.checkboxText=this.$t("Ich habe die Vereinbarungen gelesen und stimme der Datenübertragung von FARMDOK zu {partner} zu genannten Zwecken ausdrücklich zu.",{partner:this.partner})),this.$refs.modalTerms.show()},firstError(e){let t=null;return Object.values(e).some((e=>!(e.length<1)&&([t]=e,!0))),t},async createNewProcessOrder(){const e=await this.$refs.modalCreateProcessOrder.show();if(!e)return;const t=this.contractProcessOrderName;await this.$router.push({name:"fields"}),await this.$store.dispatch("auth/setCurrentProcessOrderName",t)},async navigateToFieldsInContractCropYear(){const e=this.contractProcessOrderName;await this.$router.push({name:"fields"}),await this.$store.dispatch("auth/setCurrentProcessOrderName",e)},async navigateToFieldsInLatestCropYear(){const e=this.$store.getters["auth/availableProcessOrderNames"],t=e[e.length-1];await this.$router.push({name:"fields"}),await this.$store.dispatch("auth/setCurrentProcessOrderName",t)}}},cX=dX,uX=(0,ew.Z)(cX,wJ,CJ,!1,null,"47bcd8ad",null),pX=uX.exports,hX=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[null!=e.contract.imagePartnerLogo?t("ImgPartnerLogo",{attrs:{src:e.contract.imagePartnerLogo,width:100,height:55}}):e._e()]},proxy:!0},{key:"middle",fn:function(){return[t("Steps",{attrs:{current:e.currentStepKey,steps:e.steps}})]},proxy:!0},{key:"right",fn:function(){return[t("SearchBar",{staticClass:"mr-1",attrs:{searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ButtonWithArrow",{staticClass:"mr-1",attrs:{variant:"lightest",type:"left"},on:{click:e.onBack}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]),t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.bottomleft.viewport",value:{container:"#the-contentbar",trigger:!1},expression:"{ container: '#the-contentbar', trigger: false }",modifiers:{bottomleft:!0,viewport:!0}}],staticClass:"d-inline-block mr-1",attrs:{id:"page-import-contract__button-next-tooltip",tabindex:"0",title:e.nextButtonTooltip},on:{mouseenter:function(t){return e.$root.$emit("bv::show::tooltip","page-import-contract__button-next-tooltip")},mouseleave:function(t){return e.$root.$emit("bv::hide::tooltip","page-import-contract__button-next-tooltip")}}},[e.nextButtonEnabled?t("ButtonWithArrow",{staticClass:"page-import-contract__button-next mr-1",attrs:{variant:"primary",disabled:e.creatingMeasures},on:{click:function(t){return e.onNext()}}},[e._v(" "+e._s(0===e.currentStepKey?e.$t("Maßnahmen buchen"):e.$t("Maßnahmen speichern"))+" "),e.creatingMeasures?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1):t("ButtonWithArrow",{staticClass:"page-import-contract__button-next",staticStyle:{"pointer-events":"none"},attrs:{variant:"primary",disabled:""},on:{click:function(t){return e.onNext()}}},[e._v(" "+e._s(0===e.currentStepKey?e.$t("Maßnahmen buchen"):e.$t("Maßnahmen speichern"))+" ")])],1)]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[e.fetchingError?t("FetchingError",{attrs:{"user-message":e.errorUserMessage},on:{reload:e.reload}}):e._e(),!e.fetchingError&&e.fetchingYields&&null===e.totalYields&&null===e.fieldYields?t("Loading"):e._e(),e.fetchingError||e.fetchingYields||null!==e.totalYields||null!==e.fieldYields?e._e():t("div",{staticClass:"page-import-contract__no_content"},[t("p",{domProps:{innerHTML:e._s(e.$t("Noch keine Erntedaten für <strong>{name}</strong> verfügbar.",e.contract))}})]),e.fetchingError||null==e.totalYields||0!==e.currentStepKey?e._e():t("TableImportTotalYieldsContainer",{attrs:{id:"import-total-yields-container","total-yields":e.totalYields,"filter-string":e.filterString,"visible-rows":e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}}),e.fetchingError||null==e.fieldYields||0!==e.currentStepKey?e._e():t("TableImportFieldYieldsContainer",{attrs:{id:"import-field-yields-container","fields-yields":e.fieldYields,"filter-string":e.filterString,"visible-rows":e.visibleRows,"selected-rows":e.selectedRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:selectedTableData":function(t){e.fieldsMappingData=t}}}),e.fetchingError||null==e.totalYields||1!==e.currentStepKey?e._e():t("TableImportTotalYieldsFieldMappingContainer",{attrs:{id:"import-total-yields-field-mapping-container",contract:e.contract,"total-yields":e.totalYields,"filter-string":e.filterString,"visible-rows":e.visibleRows,"selected-rows":e.selectedRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:selectedTableData":function(t){e.importMeasuresData=t}}}
1),!e.fetchingError&&null!=e.fieldYields&&e.fieldsMappingData&&1===e.currentStepKey?t("TableImportFieldsYieldsFieldMappingContainer",{attrs:{id:"import-field-yields-field-mapping-container",contract:e.contract,"fields-mapping-data":e.fieldsMappingData,"filter-string":e.filterString,"visible-rows":e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"update:selectedTableData":function(t){e.importMeasuresData=t}}}):e._e()]},proxy:!0}])})},mX=[],fX=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:"hot-contracting-import-fields-yields","disable-read-only-bg":"","filter-string":e.filterString,"selected-rows":e.selectedRows,"table-settings":e.tableSettings,"table-data":e.tableData,loading:e.loading},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length,"selected-rows":e.selectedRows.length}})]},proxy:!0}])})},gX=[];const yX={key:"flaeche",header:{title:()=>b["default"].i18n.translate("Erntefläche gesamt (ha)"),description:()=>b["default"].i18n.translate("ha")},type:"numeric",className:"border-right",width:270,readOnly:!0},vX={key:"staerkegehalt",header:{title:()=>b["default"].i18n.translate("Stärkegehalt gesamt (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",className:"border-right",width:200,readOnly:!0},bX={key:"userComment",header:{title:()=>b["default"].i18n.translate("Bemerkung")},type:"text",className:"border-right"},wX={key:"creationDate",header:{title:()=>b["default"].i18n.translate("Datum")},type:"date",className:"border-right",width:150},CX={key:"amount",header:{title:()=>b["default"].i18n.translate("Menge (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",className:"border-right",width:130},FX={key:"reineruebe",header:{title:()=>b["default"].i18n.translate("Reine Rübe (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",readOnly:!0,className:"border-right",width:130},AX={key:"reinekartoffel",header:{title:()=>b["default"].i18n.translate("Menge (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",readOnly:!0,className:"border-right",width:130},kX={key:"zuckergehalt",header:{title:()=>b["default"].i18n.translate("Zuckergehalt (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",readOnly:!0,className:"border-right",width:150},SX={key:"staerkegehalt",header:{title:()=>b["default"].i18n.translate("Stärkegehalt (t)"),description:()=>b["default"].i18n.translate("t")},type:"numeric",readOnly:!0,className:"border-right",width:150},EX={key:"feldnameCombined",header:{title:()=>b["default"].i18n.translate("AGRANA FSNr - Feldname")},className:"border-right",type:"text",readOnly:!0,width:300},IX={key:"fieldId",header:{title:()=>b["default"].i18n.translate("FSNr - Schlag")},className:"border-right text-bold",type:"dropdown",required:!0,width:300},_X={key:"processedArea",header:{title:()=>b["default"].i18n.translate("Hektar"),description:()=>b["default"].i18n.translate("ha")},className:"border-right",type:"numeric",required:!0,width:130},DX="feldstuecknr",MX=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...eA,lockedVisibility:!0,key:DX,readOnly:!0,width:120,className:"border-right"},{...EF,lockedVisibility:!0,key:"feldname",readOnly:!0,width:250},{..._X,lockedVisibility:!0,key:"feldgroesse",required:!1,readOnly:!0,width:130,className:"border-right"},{...CX,readOnly:!0}],PX=[...MX,FX,kX,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],TX=[...MX,AX,SX,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var xX={name:"TableImportFieldYieldsContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD],props:{filterString:{type:String,default:""},fieldsYields:{type:Array,required:!0}},data(){return{columnDefinition:this.fieldsYields.some((e=>"R"===e.kulturart))?PX:TX,loading:!0}},computed:{tableData(){return this.fieldsYields.reduce(((e,t,i)=>{const a=String(i+1);return{...e,[a]:{...t,id:a}}}),{})},selectedTableData(){return 0===this.selectedRows.length?null:this.selectedRows.map((e=>this.tableData[e]))}},watch:{selectedTableData(e){this.$emit("update:selectedTableData",e)}},mounted(){this.loading=!1}},BX=xX,OX=(0,ew.Z)(BX,fX,gX,!1,null,null,null),$X=OX.exports,RX=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:"hot-contracting-import-fields-yields-field-mapping","disable-read-only-bg":"","filter-string":e.filterString,"table-settings":e.tableSettings,"table-data":e.tableData,loading:e.loading},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:cell":e.updateCell,"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length}})]},proxy:!0}])})},NX=[];const zX="materialId",LX="feldname",VX="feldstuecknr",UX=[{...wX,required:!0,lockedVisibility:!0},EX,{...IX,required:!0},_X,{...DF,key:zX,required:!0,className:"border-right",lockedVisibility:!0,width:220},{...CX,required:!0,className:"border-right"},{...bX,lockedVisibility:!0}];var jX=UX,HX={name:"TableImportFieldsYieldsFieldMappingContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD,oI],props:{filterString:{type:String,default:""},fieldsMappingData:{type:Array,required:!0},contract:{type:Object,required:!0}},data(){return{columnDefinition:jX,loading:!0,crops:[],fields:[],tableData:{}}},computed:{cropsById(){return this.crops.reduce(((e,t)=>({...e,[t.id]:t})),{})},fieldsById(){return this.fields.reduce(((e,t)=>({...e,[t.id]:t})),{})},selectedTableData(){const e=Object.values(this.tableData);return e.some((e=>null==e[zX]||null==e[wX.key]||null==e[IX.key]||null==e[CX.key]))?null:e}},watch:{selectedTableData(e){this.$emit("update:selectedTableData",e)}},created(){this.columnSettingsMiddleware.push(this.columnDropdownData)},async mounted(){await Promise.all([this.loadFields(),this.loadCrops()]),this.tableData=this.fieldsMappingData.reduce(((e,t,i)=>{const a=String(i+1);let n=null;
1Object.keys(this.cropsById).includes(String(t[DF.key]))&&(n=t[DF.key]);let r=null;return null!==t[IX.key]&&(r=this.fieldsById[t[IX.key]].fieldSize),{...e,[a]:{...t,id:a,[wX.key]:null,[EX.key]:`${t[VX]} - ${t[LX]}`,[zX]:n,[_X.key]:r}}}),{}),this.loading=!1},methods:{async loadCrops(){const{data:e}=await l().get(`/admin/digitalContracting/getAllowedCrops/${this.contract.id}`);this.crops=e},async loadFields(){const{data:e}=await l().get(`/admin/digitalContracting/getFields/${this.contract.id}?ignoreFieldLimitations=true`);this.fields=e},updateCell({columnKey:e,guid:t,value:i}){let a="text";this.tableSettings.columns.some((t=>t.key===e&&(a=t.type,!0))),"numeric"===a&&Number.isNaN(Number(i))&&(i=null),e===IX.key&&(this.tableData[t][_X.key]=this.fieldsById[i].fieldSize),this.tableData[t][e]=i},columnDropdownData(e){return e.map((e=>e.key===zX?{...e,getRendererValue:({value:e})=>null!=this.cropsById[e]&&"string"===typeof this.cropsById[e].name?this.cropsById[e].name:"",getItems:async()=>[{name:"Crops",id:"crops",items:this.crops,sort:!1}]}:e.key===IX.key?{...e,getRendererValue:({value:e})=>null!=this.fieldsById[e]&&"string"===typeof this.fieldsById[e].combinedName?this.fieldsById[e].combinedName:"",getItems:async()=>[{name:"Fields",id:"fields",items:this.fields.map((e=>({id:e.id,name:e.combinedName}))),sort:!1}]}:e))}}},GX=HX,WX=(0,ew.Z)(GX,RX,NX,!1,null,null,null),ZX=WX.exports,KX=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:"hot-contracting-import-total-yields","disable-read-only-bg":"","filter-string":e.filterString,"table-settings":e.tableSettings,"table-data":e.tableData,loading:e.loading},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length}})]},proxy:!0}])})},qX=[];const YX=[{...yX,lockedVisibility:!0},{...CX,key:"reinekartoffel",header:{title:()=>b["default"].i18n.translate("Erntemenge gesamt (t)"),description:()=>b["default"].i18n.translate("t")},width:200,readOnly:!0,lockedVisibility:!0},{...vX,lockedVisibility:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var JX=YX,XX={name:"TableImportTotalYieldsContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD],props:{filterString:{type:String,default:""},totalYields:{type:Object,required:!0}},data(){return{columnDefinition:JX,loading:!0}},computed:{tableData(){return{1:{...this.totalYields}}}},mounted(){this.loading=!1}},QX=XX,eQ=(0,ew.Z)(QX,KX,qX,!1,null,null,null),tQ=eQ.exports,iQ=function(){var e=this,t=e._self._c;return t("div",{staticClass:"h-100"},[t("TableBase",{ref:"table",attrs:{id:"hot-contracting-import-total-yields-field-mapping","disable-read-only-bg":"","filter-string":e.filterString,"table-settings":e.tableSettings,"selected-rows":e.selectedRows,"table-data":e.tableDataComputed,loading:e.loading,cells:e.tableHookCells},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:cell":e.updateCell,"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length,"selected-rows":e.selectedRows.length}},[t("span",{staticClass:"mx-2"},[e._v(e._s(e.$t("Gewählte Fläche: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted})))]),t("span",{staticClass:"mx-2"},[e._v(e._s(e.$t("Gesamtfläche aus Erntedaten: {totalSize} ha",{totalSize:e.totalYieldsFormatted.flaeche})))]),t("span",{staticClass:"mx-2"},[e._v(e._s(e.$t("Erntemenge gesamt: {totalPotatoes} t",{totalPotatoes:e.totalYieldsFormatted.reinekartoffel})))]),t("span",{staticClass:"mx-2"},[e._v(e._s(e.$t("Stärkegehalt gesamt: {totalStarch} t",{totalStarch:e.totalYieldsFormatted.staerkegehalt})))])])]},proxy:!0}])})],1)},aQ=[];const nQ="materialId",rQ="fieldSize",sQ="fieldId",oQ=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...wX,lockedVisibility:!0}
1,{...EF,key:"combinedName",title:()=>b["default"].i18n.translate("FSNr - Schlag"),readOnly:!0,lockedVisibility:!0},{..._X,key:rQ,className:"border-right",required:!1,lockedVisibility:!0},{...DF,key:nQ,className:"border-right",lockedVisibility:!0,width:220},{...CX,header:{title:()=>b["default"].i18n.translate("Reine Kartoffel (t)"),description:()=>b["default"].i18n.translate("t")},width:200,lockedVisibility:!0},{...bX,lockedVisibility:!0}];var lQ=oQ;const dQ="manualUserComment",cQ="manualAmount";var uQ={name:"TableImportTotalYieldsFieldMappingContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD,aX,oI],props:{filterString:{type:String,default:""},totalYields:{type:Object,required:!0},contract:{type:Object,required:!0}},data(){return{columnDefinition:lQ,loading:!0,selectedRows:[],crops:[]}},computed:{totalYieldsFormatted(){return{flaeche:Bl()(this.totalYields.flaeche).format(),reinekartoffel:Bl()(this.totalYields.reinekartoffel).format(),staerkegehalt:Bl()(this.totalYields.staerkegehalt).format()}},fieldsWithManualPotatoAmounts(){return Object.values(this.tableData).filter((e=>e[cQ]&&this.selectedRows.includes(e.id)))},sumOfManualPotatoAmounts(){return this.fieldsWithManualPotatoAmounts.reduce(((e,t)=>e+t[CX.key]),0)},sumOfFieldSizesForFieldsWithManualPotatoAmounts(){return this.fieldsWithManualPotatoAmounts.reduce(((e,t)=>e+t[rQ]),0)},tableDataComputed(){return Object.values(this.tableData).reduce(((e,t)=>{if(!this.selectedRows.includes(t.id))return{...e,[t.id]:t};let i=null,a=null;t[cQ]?i=t[CX.key]:null!=t[rQ]&&""!==t[rQ]&&(i=(this.totalYields.reinekartoffel-this.sumOfManualPotatoAmounts)/(this.sizeTotal-this.sumOfFieldSizesForFieldsWithManualPotatoAmounts)*t[rQ]),null!==i&&(a=Math.round(this.totalYields.staerkegehalt/this.totalYields.reinekartoffel*i*100)/100,i=Math.round(100*i)/100);let n=t[bX.key];return t[dQ]||null==i||(n=this.$t("Reinekartoffel: {amountPotato} Stärkegehalt: {amountStarch}",{amountPotato:Bl()(i).format(),amountStarch:Bl()(a).format()})),{...e,[t.id]:{...t,[_X.key]:t[rQ],[CX.key]:i,[bX.key]:n}}}),{})},cropsById(){return this.crops.reduce(((e,t)=>({...e,[t.id]:t})),{})},selectedTableData(){return 0===this.selectedRows.length||this.sumOfManualPotatoAmounts>this.totalYields.reinekartoffel||this.selectedRows.some((e=>{const t=this.tableData[e];return null==t[nQ]||null==t[wX.key]||null==t[rQ]||t[rQ]<=0||null==t[CX.key]||t[CX.key]<0}))?null:this.selectedRows.map((e=>this.tableData[e]))}},watch:{selectedTableData(e){this.$emit("update:selectedTableData",e)}},created(){this.columnSettingsMiddleware.push(this.columnDropdownData)},async mounted(){await Promise.all([this.loadTableData(`/admin/digitalContracting/getFields/${this.contract.id}?ignoreFieldLimitations=true`),this.loadCrops()]),this.tableData=Object.values(this.tableData).reduce(((e,t,i)=>{const a=String(i+1);let n=null;return Object.keys(this.cropsById).includes(String(t[DF.key]))&&(n=t[DF.key]),{...e,[a]:{...t,id:a,[sQ]:t.id,[nQ]:n,[wX.key]:null,[CX.key]:null,[bX.key]:null,[dQ]:!1,[cQ]:!1}}}),{}),this.loading=!1,this.$nextTick((()=>{this.$refs.table.setData(!0)}))},methods:{async loadCrops(){const{data:e}=await l().get(`/admin/digitalContracting/getAllowedCrops/${this.contract.id}`);this.crops=e},updateCell({columnKey:e,guid:t,value:i}){let a="text";this.tableSettings.columns.some((t=>t.key===e&&(a=t.type,!0))),"numeric"===a&&Number.isNaN(Number(i))&&(i=null);const n={...this.tableData};e===bX.key?n[t][dQ]=null!=i:e===CX.key&&(n[t][cQ]=null!=i&&""!==i),n[t][e]=i,this.tableData=n},tableHookCells(e,t,i){const a=this.$refs.table.physicalRowToGuid(e);return null==this.tableData[a]||this.tableSettings.columns[t].key!==nQ&&this.tableSettings.columns[t].key!==wX.key&&this.tableSettings.columns[t].key!==rQ&&this.tableSettings.columns[t].key!==CX.key||!this.selectedRows.includes(a)?i:{...i,required:!0}},columnDropdownData(e){return e.map((e=>e.key!==nQ?e:{...e,getRendererValue:({value:e})=>null!=this.cropsById[e]&&"string"===typeof this.cropsById[e].name?this.cropsById[e].name:"",getItems:async()=>[{name:"Crops",id:"crops",items:this.crops,sort:!1}]}))}}},pQ=uQ,hQ=(0,ew.Z)(pQ,iQ,aQ,!1,null,null,null),mQ=hQ.exports;ow.vI.add(uw.IJ7);var fQ={name:"PageImportContract",components:{Loading:z$,TableImportFieldYieldsContainer:$X,TableImportTotalYieldsContainer:tQ,TableImportTotalYieldsFieldMappingContainer:mQ,TableImportFieldsYieldsFieldMappingContainer:ZX,Steps:LU,ThePageSkeleton:$w,FetchingError:VI,SearchBar:YE,TheContentbar:HL,ImgPartnerL
1ogo:BJ,ButtonWithArrow:VK},data(){return{currentStepKey:0,steps:[{number:"1",label:this.$t("Erntedaten")},{number:"2",label:this.$t("Maßnahmen")}],fetchingYields:!1,fetchingError:!1,defaultErrorUserMessage:this.$t("Unbekannter Fehler"),errorUserMessage:this.defaultErrorUserMessage,filterString:"",visibleRows:[],fieldYields:null,totalYields:null,selectedRows:[],importMeasuresData:null,fieldsMappingData:null,creatingMeasures:!1}},computed:{contract(){let e={};return Object.values(this.$store.state.digitalContracting.data).some((t=>Number(t.contractCompanyId)===Number(this.$route.params.contractCompanyId)&&(e=t,!0))),e},contractCompanyId(){return this.$route.params.contractCompanyId},nextButtonEnabled(){return null!=this.totalYields?0===this.currentStepKey||null!=this.importMeasuresData:null!=this.fieldYields&&(0===this.currentStepKey&&null!=this.fieldsMappingData||null!=this.importMeasuresData)},nextButtonTooltip(){if(0===this.currentStepKey){if(null!=this.fieldYields&&this.fieldYields.length>0)return this.$t("Willst du Ernte-Maßnahmen in FARMDOK erstellen? Aktiviere die Kontrollkästchen in der ersten Spalte, dann klicke hier um zum nächsten Schritt zu gehen.");if(null!=this.totalYields)return this.$t("Die Gesamt-Erntemengen wurden von {partner} geladen. Klicke hier, um im nächsten Schritt Maßnahmen auf deinen Feldern zu erstellen.",this.contract)}if(1===this.currentStepKey){if(null!=this.fieldYields&&this.fieldYields.length>0)return this.$t("Vervollständige die Ernte-Maßnahmen und klicke dann hier, um sie in FARMDOK zu buchen.");if(null!=this.totalYields)return this.$t("Wähle die Felder, auf denen du Ernte-Maßnahmen erstellen möchtest, vervollständige die Informationen und klicke dann hier, um zu speichern.")}return""}},mounted(){this.loadData()},methods:{onBack(){this.currentStepKey>0?this.currentStepKey-=1:this.$router.push({name:"digital-contracting/my-contracts"})},onNext(){if(0===this.currentStepKey)return this.currentStepKey+=1,this.$root.$emit("bv::disable::tooltip","page-import-contract__button-next-tooltip"),this.$root.$emit("bv::hide::tooltip","page-import-contract__button-next-tooltip"),void setTimeout((()=>{this.$root.$emit("bv::enable::tooltip","page-import-contract__button-next-tooltip"),this.$root.$emit("bv::show::tooltip","page-import-contract__button-next-tooltip")}),2e3);this.createActivities()},reload(){1===this.currentStepKey&&window.location.reload(),this.loadData()},async loadData(){this.fetchingYields=!0,this.fetchingError=!1,this.errorUserMessage=this.defaultErrorUserMessage;try{await this.$store.dispatch("digitalContracting/subscribe");const{data:e}=await l().get(`/admin/digitalContracting/agrana/getFieldsYield/${this.contractCompanyId}`);null!=e.fields?this.fieldYields=e.fields.length>0?e.fields:null:this.totalYields=e.total,this.fetchingYields=!1,setTimeout((()=>this.$root.$emit("bv::show::tooltip","page-import-contract__button-next-tooltip")),2e3)}catch(e){null!=e.response&&null!=e.response.data&&"string"===typeof e.response.data.userMessage&&(this.errorUserMessage=e.response.data.userMessage),console.error("unable to load data contract data",e),this.fetchingError=!0,this.fetchingYields=!1}},async createActivities(){this.creatingMeasures=!0;const e={version:"2.0",data:this.importMeasuresData.map((e=>({fieldId:Number(e[sQ]),processedArea:Number(e[_X.key]),cropId:Number(e[nQ]),amount:null!==e[CX.key]?Number(e[CX.key]):0,creationDate:Number(e[wX.key]),userComment:e[bX.key]})))};try{await l().post("/admin/digitalContracting/agrana/createHarvestingMeasures",e),await this.$store.dispatch("auth/setCurrentProcessOrderName",this.contract.processOrderName),await this.$router.push({name:"activities"})}catch(t){this.creatingMeasures=!1,this.fetchingError=!0,null!=t.response&&null!=t.response.data&&"string"===typeof t.response.data.userMessage&&(this.errorUserMessage=t.response.data.userMessage)}}}},gQ=fQ,yQ=(0,ew.Z)(gQ,hX,mX,!1,null,"3de48fd0",null),vQ=yQ.exports,bQ=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"ml-4",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!i}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"my-contracts__card-container"},[e._l(e.contractsComputed,(function(i){return t("CardContract",{key:`card-contract-${i.id}`,attrs:{contract:i,pageFeaturePermissions:e.currentCompaniesHaveFeature},on:{view:function(t){return e.viewContract(i)},send:function(t){return e.sendContract(i)},import:function(t){return e.importContract(i)}}})})),e._l(e.unsignedContracts,(function(i){return t("CardContract",{key:`card-contract-unsigned-${i.id}`,attrs:{contract:i},on:{import:function(t){return e.importUnsignedContract(i)}}})})),0===e.contractsComputed.length&&null==e.$store.state.digitalContracting.creating?t("p",{staticClass:"my-contracts__no-content"},[e._v(" "+e._s(e.noContractMessage)+" "),t("br"),t("BButton",{attrs:{variant:"link"},on:{click:function(t){return e.$router.push({name:"digital-contracting/open-calls"})}}}
1,[e._v(e._s(e.$t("Zu den offenen Verträgen")))])],1):e._e()],2),t("ModalImportHarvestDataFromUnsignedContractContainer",{ref:"modal",attrs:{partner:e.selectedPartner}})]},proxy:!0}])})},wQ=[],CQ=function(){var e=this,t=e._self._c;return e.isAgranaGhostCard?e._e():t("Card",{attrs:{isGhost:e.contract.isGhost,fetching:e.contract.fetching,imageTitleUrl:e.imageTitleUrl,imageCompanyLogoUrl:e.imagePartnerLogoUrl,headline:e.headline,subTitle:e.subTitle,description:e.description,primaryButtonLabel:e.primaryButtonOptions.label,primaryButtonDisabled:e.primaryButtonOptions.disabled,secondaryButtonLabel:e.secondaryButtonOptions.label,secondaryButtonDisabled:e.secondaryButtonOptions.disabled},on:{onPrimaryClick:e.primaryButtonOptions.action,onSecondaryClick:e.secondaryButtonOptions.action}})},FQ=[],AQ=function(){var e=this,t=e._self._c;return t("BCard",{staticClass:"card",class:{"card--ghost":e.isGhost},attrs:{tag:"article","no-body":""}},[e.fetching?t("div",{staticClass:"bg-lightest",staticStyle:{height:"100px"}}):e.imageTitleUrl&&!e.isGhost?t("BCardImg",{staticClass:"image bg-primary",attrs:{src:e.imageTitleUrl,alt:"Card title image"}}):e.isGhost?e._e():t("div",{class:e.saatbauImage?"bg-saatbau image-placeholder":"bg-primary image-placeholder"}),e.imageCompanyLogoUrl&&!e.saatbauImage?t("ImgCompanyLogo",{staticClass:"title-logo",class:{"title-logo--ghost":e.isGhost},attrs:{src:e.imageCompanyLogoUrl}}):e._e(),e.saatbauImage?t("img",{staticClass:"saatbau-company-logo",attrs:{src:e.imageCompanyLogoUrl,alt:"Company logo"}}):e._e(),e.saatbauImage?t("img",{staticClass:"saatbau-image",attrs:{src:e.saatbauImage,alt:"Image of Saatbau type"}}
1):e._e(),t("BCardBody",{staticClass:"body",class:{"body--ghost":e.isGhost}},[t("Status",{attrs:{status:e.status}}),t("div",{staticClass:"body-text",class:{"flex-grow-1":!e.isGhost}},[t("div",{staticClass:"title-wrapper",class:{"title-wrapper--ghost":e.isGhost}},[t("div",{staticClass:"title-content"},[t("h2",{staticClass:"title"},[e._v(e._s(e.headline))]),e.subTitle&&!e.isGhost?t("h6",{staticClass:"sub-title text-gray"},[e._v(" "+e._s(e.subTitle)+" ")]):e._e()])]),t("p",{staticClass:"description",class:{description:e.isGhost}},[e._v(" "+e._s(e.description)+" ")])]),t("div",{staticClass:"btn-area"},[e.primaryButtonLabel?t("BButton",{staticClass:"card-btn",attrs:{variant:e.saatbauImage?"saatbau":"primary",disabled:e.primaryButtonDisabled},on:{click:function(t){return e.$emit("onPrimaryClick")}}},[e._v(" "+e._s(e.primaryButtonLabel)+" ")]):e._e(),e.secondaryButtonLabel?t("BButton",{staticClass:"card-btn",attrs:{variant:"inline-black",disabled:e.secondaryButtonDisabled},on:{click:function(t){return e.$emit("onSecondaryClick")}}},[e._v(" "+e._s(e.secondaryButtonLabel)+" ")]):e._e()],1)],1)],1)},kQ=[],SQ=function(){var e=this,t=e._self._c;return t("div",{staticClass:"img-company-logo__container"},[t("img",{staticClass:"img-company-logo",attrs:{src:e.src,alt:"Company logo"}})])},EQ=[],IQ={name:"ImgCompanyLogo",props:{src:{type:String,required:!0}}},_Q=IQ,DQ=(0,ew.Z)(_Q,SQ,EQ,!1,null,"af9b93ea",null),MQ=DQ.exports,PQ=function(){var e=this,t=e._self._c;return t("div",{staticClass:"status"},[e.status.type?t("div",{class:`status-dot status-dot--${e.status.type}`}):e._e(),e.status.label?t("span",{staticClass:"status-label"},[e._v(e._s(e.status.label))]):e._e()])},TQ=[],xQ={name:"Status",props:{status:{type:Object,required:!0}}},BQ=xQ,OQ=(0,ew.Z)(BQ,PQ,TQ,!1,null,"a24d7e70",null),$Q=OQ.exports,RQ={name:"Card",components:{ImgCompanyLogo:MQ,Status:$Q},props:{isGhost:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},imageTitleUrl:{type:String,default:""},imageCompanyLogoUrl:{type:String,default:""},headline:{type:String,default:null},subTitle:{type:String,default:null},description:{type:String,default:null},primaryButtonLabel:{type:String,default:null},primaryButtonDisabled:{type:Boolean,default:!1},secondaryButtonLabel:{type:String,default:null},secondaryButtonDisabled:{type:Boolean,default:!1},status:{type:Object,default(){return{label:null,type:null}}},saatbauImage:{type:String,default:null}}},NQ=RQ,zQ=(0,ew.Z)(NQ,AQ,kQ,!1,null,"4f21d1ef",null),LQ=zQ.exports,VQ={name:"CardContract",components:{Card:LQ},props:{contract:{type:Object,required:!0},managed:{type:Boolean,default:!1},pageFeaturePermissions:{type:Object,required:!1}},computed:{isContractSenderEuPsmStats(){return"\\AgriDat\\App\\Components\\DigitalContracting\\ContractSenderEuPsmStats"===this.contract.sender?.class},imageTitleUrl(){return WS(this.contract.imageTitle)?this.contract.imageTitle:ZS(this.contract.imageTitle,"contracting")},imagePartnerLogoUrl(){return WS(this.contract.imagePartnerLogo)?this.contract.imagePartnerLogo:ZS(this.contract.imagePartnerLogo,"contracting")},headline(){return this.contract.isGhost?this.$t("Erntedatenimport von {partner}",this.contract):this.contract.name},subTitle(){if(null==this.contract.periodStart||null==this.contract.periodEnd)return"";const e=g().unix(this.contract.periodStart).format("L"),t=g().unix(this.contract.periodEnd).format("L");return this.$t("Zeitraum von {periodStart} bis {periodEnd}",{periodStart:e,periodEnd:t})},isExpired(){return 1e3*this.contract.periodEnd<new Date},description(){const e={number:this.contract.contractFieldCount,area:Nl(this.contract.contractFieldSizeSum).format(),partner:this.contract.partner,processOrderName:this.contract.processOrderName};return this.contract.isGhost?this.$t("Erntedaten für Flächen laden, die nicht über FARMDOK an {partner} gemeldet wurden.",e):null==this.contract.contractCompanyId||"number"!==typeof this.contract.contractFieldCount?this.contract.description:this.contract.contractFieldCount<1?this.$t("Erntedaten für {processOrderName} von {partner} importieren.",e):1===this.contract.contractFieldCount?this.$t("1 Fläche ({area} ha) an {partner} gesendet.",e):this.$t("{number} Flächen ({area} ha) an {partner} gesendet.",e)},primaryButtonOptions(){const e=this.pageFeaturePermissions?.readonly&&this.$route.name.includes("open-calls");return null==this.contract.contractCompanyId||this.managed?this.managed?{label:this.$t("Zum Vertrag"),disabled:e,action:()=>this.$emit("view")}:this.isExpired||this.managed||null!=this.contract.contractCompanyId?{label:null,disabled:e,action:()=>null}
1:{label:this.isContractSenderEuPsmStats?this.$t("Teilnehmen"):this.$t("Flächen senden"),disabled:e,action:()=>this.$emit("send")}:{label:this.isContractSenderEuPsmStats?this.$t("Ansehen"):this.$t("Flächen ansehen"),disabled:e,action:()=>this.$emit("view")}},secondaryButtonOptions(){return this.isExpired&&!this.managed?{label:this.$t("Erntedaten laden"),disabled:this.pageFeaturePermissions?.readonly??!1,action:()=>this.$emit("import")}:this.isExpired||this.managed||null!==this.contract.contractCompanyId||!this.isContractSenderEuPsmStats?this.isExpired||this.managed||null==this.contract.contractCompanyId?{label:null,disabled:this.pageFeaturePermissions?.readonly??!1,action:()=>null}:{label:this.$t("Erneut senden"),disabled:this.pageFeaturePermissions?.readonly??!1,action:()=>this.$emit("send")}:{label:this.$t("Mehr Infos"),disabled:this.pageFeaturePermissions?.readonly??!1,action:()=>window.open("https://www.lko.at/pflanzenschutz+2400++1298016","_blank")}},isAgranaGhostCard(){return"AGRANA"===this.contract.partner&&this.contract.isGhost}}},UQ=VQ,jQ=(0,ew.Z)(UQ,CQ,FQ,!1,null,null,null),HQ=jQ.exports,GQ=function(){var e=this,t=e._self._c;return t("ModalImportHarvestDataFromUnsignedContract",{ref:"modal",attrs:{"fetching-company-data":e.fetchingCompanyData,"is-creating":e.isCreating,"error-creating":e.errorCreating,"process-order-name":e.processOrderName,"process-order-names":e.processOrderNames,"contract-id":e.contractId,"contract-options":e.contractOptions,"company-bdm-id":e.company.companyBdmId,"foreign-id":e.company.foreignId},on:{"change:processOrderName":t=>e.processOrderName=t,"change:contractId":t=>e.contractId=t,"change:companyBdmId":t=>e.company.companyBdmId=t,"change:foreignId":t=>e.company.foreignId=t,accept:e.createCompanyContract}})},WQ=[],ZQ=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modal",staticClass:"modal-import-harvest-data-from-unsigned-contract",attrs:{title:e.$t("Vertrag wählen")},scopedSlots:e._u([{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",staticStyle:{"min-width":"120px"},attrs:{variant:"primary",disabled:e.fetchingCompanyData||e.isCreating},on:{click:e.submitForm}},[e.isCreating?e._e():t("span",[e._v(e._s(e.$t("Absenden")))]),e.isCreating?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1),t("BButton",{staticClass:"text-black",attrs:{variant:"link",disabled:e.isCreating},on:{click:e.hide}},[e._v(" "+e._s(e.$t("Abbrechen"))+" ")])]},proxy:!0}])},[t("div",{staticClass:"m-3"},[t("ValidationObserver",{ref:"validationObserver",scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BForm",{ref:"form",attrs:{novalidate:""},on:{submit:function(t){return t.preventDefault(),e.submitForm.apply(null,arguments)}}},[t("div",{staticClass:"mb-4"},[t("BFormGroup",{attrs:{label:e.$t("Erntejahr"),"label-for":"process-order-name","label-cols":"5"}},[t("BFormSelect",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"process-order-name",options:e.processOrderNames,disabled:e.fetchingCompanyData||e.isCreating},model:{value:e.processOrderNameComputed,callback:function(t){e.processOrderNameComputed=t},expression:"processOrderNameComputed"}})],1),t("BFormGroup",{attrs:{label:e.$t("Vertrag"),"label-for":"contract","label-cols":"5"}},[t("BFormSelect",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"contract",options:e.contractOptions,disabled:e.fetchingCompanyData||e.isCreating},model:{value:e.contractIdComputed,callback:function(t){e.contractIdComputed=t},expression:"contractIdComputed"}})],1),t("ValidationProvider",{attrs:{rules:"required",name:e.$t("Betriebsnummer"),vid:"companyBdmId",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{attrs:{label:e.$t("Betriebsnummer"),"label-for":"company-nr","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"company-nr",disabled:e.fetchingCompanyData||e.isCreating,state:!(i.length>0)&&null},model:{value:e.companyBdmIdComputed,callback:function(t){e.companyBdmIdComputed=t},expression:"companyBdmIdComputed"}})],1)]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:"required",name:e.$t("Partner-Nummer"),vid:"foreignId",slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("BFormGroup",{attrs:{label:e.$t("Partner-Nummer"),"label-for":"company-foreign-id","label-cols":"5",state:!(i.length>0)&&null}},[t("BaseInput",{staticClass:"form-control--text-input-form-group-align",attrs:{id:"c
1ompany-foreign-id",disabled:e.fetchingCompanyData||e.isCreating,state:!(i.length>0)&&null},model:{value:e.foreignIdComputed,callback:function(t){e.foreignIdComputed=t},expression:"foreignIdComputed"}})],1)]}}],null,!0)})],1),t("p",{staticClass:"text-danger"},[e._v(e._s(e.errorCreating||e.firstError(i))+" ")])])]}}])})],1)])},KQ=[];ow.vI.add(uw.IJ7);var qQ={name:"ModalImportHarvestDataFromUnsignedContract",components:{BaseInput:_J,ModalWrapper:OC},props:{fetchingCompanyData:{type:Boolean,default:!1},isCreating:{type:Boolean,default:!1},errorCreating:{type:String,default:null},processOrderName:{type:String,default:null},processOrderNames:{type:Array,required:!0},contractId:{type:Number,default:null},contractOptions:{type:Array,required:!0},companyBdmId:{type:String,required:!0},foreignId:{type:String,required:!0}},computed:{processOrderNameComputed:{get(){return this.processOrderName},set(e){this.$emit("change:processOrderName",e)}},contractIdComputed:{get(){return this.contractId},set(e){this.$emit("change:contractId",e)}},companyBdmIdComputed:{get(){return this.companyBdmId},set(e){this.$emit("change:companyBdmId",e)}},foreignIdComputed:{get(){return this.foreignId},set(e){this.$emit("change:foreignId",e)}}},methods:{show(){this.$refs.modal.show()},hide(){this.$refs.modal.hide()},submitForm(){this.$refs.validationObserver.handleSubmit(this.accept)},accept(){this.$emit("accept")},firstError(e){let t=null;return Object.values(e).some((e=>!(e.length<1)&&([t]=e,!0))),t}}},YQ=qQ,JQ=(0,ew.Z)(YQ,ZQ,KQ,!1,null,"04e19862",null),XQ=JQ.exports,QQ={name:"ModalImportHarvestDataFromUnsignedContractContainer",components:{ModalImportHarvestDataFromUnsignedContract:XQ},props:{partner:{type:String,required:!0}},data(){return{processOrderName:null,contractId:null,fetchingCompanyData:!1,company:{companyBdmId:"",foreignId:"",companyName:"",address:"",postcode:"",city:"",country:"",user:{title:null,firstname:"",lastname:"",email:""}},isCreating:!1,errorCreating:null}},computed:{...(0,C.Se)({contractsUnsignedExpired:"digitalContracting/unsignedExpired",contractsById:"digitalContracting/data"}),usableContracts(){return this.contractsUnsignedExpired.filter((e=>e.partner===this.partner))},processOrderNames(){const e=new Set;return this.usableContracts.forEach((t=>e.add(t.processOrderName))),[...e].sort(((e,t)=>t-e))},contractsBySelectedProcessOrderName(){return this.usableContracts.filter((e=>e.processOrderName===this.processOrderName))},contractOptions(){return this.contractsBySelectedProcessOrderName.map((e=>({value:e.id,text:e.name})))}},watch:{processOrderName(){null!=this.contractsBySelectedProcessOrderName[0]&&(this.contractId=this.contractsBySelectedProcessOrderName[0].id)},contractId(){""!==this.company.companyBdmId&&""!==this.company.foreignId||this.reloadCompanyData()}},methods:{show(){this.processOrderNames.length>0?[this.processOrderName]=this.processOrderNames:this.processOrderName=null,this.errorCreating=null,this.$refs.modal.show()},hide(){this.$refs.modal.hide()},async reloadCompanyData(){this.fetchingCompanyData=!0;const{data:e}=await l().get(`/admin/digitalContracting/getCompanyDataForContract/${this.contractId}`);e.country=e.region.name,""===this.company.companyBdmId&&(this.company.companyBdmId=String(null==e.companyBdmId?"":e.companyBdmId)),""===this.company.foreignId&&(this.company.foreignId=String(null==e.foreignId?"":e.foreignId)),this.company.companyName=e.companyName,this.company.address=e.address,this.company.postcode=String(e.postcode),this.company.city=e.city,this.company.country=e.country,this.company.user.title=e.title,this.company.user.firstname=e.firstname,this.company.user.lastname=e.lastname,this.company.user.email=e.email,this.fetchingCompanyData=!1},async createCompanyContract(){this.isCreating=!0,this.errorCreating=null;try{const{data:e}=await l().post(`/admin/digitalContracting/agrana/contractCompany/${this.contractId}`,{companyBdmId:this.companyBdmId,...this.company,...this.company.user});this.$store.commit("digitalContracting/accept",{contract:this.contractsById[this.contractId],contractCompanyId:e.contractCompanyId}),this.$refs.modal.hide(),this.$router.push({name:"digital-contracting/import-contract",params:{contractCompanyId:e.contractCompanyId}}),this.isCreating=!1}catch(e){let t=this.$t("Unerwarteter Fehler.");
1null!=e&&null!=e.response&&null!=e.response.data&&("attributeValueError"===e.response.data.status&&([[t]]=Object.values(e.response.data.attributeErrorMessages)),"error"===e.response.data.status&&"string"===typeof e.response.data.errorUserMessage&&(t=e.response.data.errorUserMessage)),this.errorCreating=t,this.isCreating=!1}}}},e0=QQ,t0=(0,ew.Z)(e0,GQ,WQ,!1,null,"6e750c08",null),i0=t0.exports,a0={data(){return{filterString:""}},methods:{filterContracts(e){return"string"!==typeof this.filterString||0===this.filterString.length?e:e.filter((e=>{if("string"===typeof e.name&&e.name.toLowerCase().includes(this.filterString.toLowerCase()))return!0;if("string"===typeof e.description&&e.description.toLowerCase().includes(this.filterString.toLowerCase()))return!0;const t=g().unix(e.periodStart).format("L");if(t.includes(this.filterString.toLowerCase()))return!0;const i=g().unix(e.periodEnd).format("L");return!!i.includes(this.filterString.toLowerCase())}))}}},n0={name:"PageMyContracts",components:{ModalImportHarvestDataFromUnsignedContractContainer:i0,CardContract:HQ,TheContentbar:HL,ThePageSkeleton:$w,CompanySwitch:qw,SearchBar:YE},mixins:[a0],props:{noCompanySwitch:{type:Boolean,default:!1}},data(){return{selectedPartner:"",storeUnsubscribe:null}},computed:{...(0,C.Se)({contracts:"digitalContracting/data",contractsUnsignedExpired:"digitalContracting/unsignedExpired"}),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_DIGITAL_CONTRACTING)},contractsComputed(){if(this.$store.state.digitalContracting.fetching)return[{fetching:!0,id:"fetching_1"},{fetching:!0,id:"fetching_2"},{fetching:!0,id:"fetching_3"}];const e=Object.values(this.contracts).filter((e=>null!=e.contractCompanyId));return this.filterContracts(e)},unsignedContracts(){const e={};return this.contractsUnsignedExpired.forEach((t=>{null==e[t.partner]&&(e[t.partner]={...t,isGhost:!0})})),Object.values(e)},noContractMessage(){return 0===this.filterString.length?this.$t("Du hast noch keine Kontrakte angenommen."):this.$t("Keine Kontrakte vorhanden.")}},created(){this.$store.dispatch("digitalContracting/subscribe"),this.storeUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.$store.dispatch("digitalContracting/subscribe")}))},beforeDestroy(){this.storeUnsubscribe()},methods:{sendContract(e){this.$store.commit("digitalContracting/setContracting",e),this.$router.push({name:"digital-contracting/contracting-resend",params:e})},viewContract(e){this.$router.push({name:"digital-contracting/view-contract",params:e})},importContract(e){this.$router.push({name:"digital-contracting/import-contract",params:e})},importUnsignedContract(e){this.selectedPartner=e.partner,this.$nextTick(this.$refs.modal.show)}}},r0=n0,s0=(0,ew.Z)(r0,bQ,wQ,!1,null,"44b1bd7e",null),o0=s0.exports,l0=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"ml-4",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!i}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"open-calls__card-container"},[0===e.contractsComputed.length?t("p",[e._v(" "+e._s(e.$t("Keine Kontrakte vorhanden."))+" "),t("br"),t("BButton",{attrs:{variant:"link"},on:{click:function(t){return e.$router.push({name:"digital-contracting/my-contracts"})}}},[e._v(e._s(e.$t("Zu meinen Verträgen")))])],1):e._e(),e._l(e.contractsComputed,(function(i,a){return t("CardContract",{key:`card-${a}`,attrs:{contract:i,pageFeaturePermissions:e.currentCompaniesHaveFeature},on:{send:function(t){return e.sendContract(i)}}})}))],2)]},proxy:!0}])})},d0=[],c0={name:"PageOpenCalls",components:{TheContentbar:HL,ThePageSkeleton:$w,CompanySwitch:qw,SearchBar:YE,
1CardContract:HQ},mixins:[a0],props:{noCompanySwitch:{type:Boolean,default:!1}},data(){return{storeUnsubscribe:null}},computed:{...(0,C.Se)({contracts:"digitalContracting/data"}),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_DIGITAL_CONTRACTING)},contractsComputed(){if(this.$store.state.digitalContracting.fetching)return[{fetching:!0},{fetching:!0},{fetching:!0}];const e=new Date/1e3,t=Object.values(this.contracts).filter((t=>null==t.contractCompanyId&&(null==t.periodEnd||t.periodEnd>e)&&(null==t.periodStart||t.periodStart<e)));return this.filterContracts(t)}},created(){this.$store.dispatch("digitalContracting/subscribe"),this.storeUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.$store.dispatch("digitalContracting/subscribe")}))},beforeDestroy(){this.storeUnsubscribe()},methods:{sendContract(e){this.$router.push(`contracting/${e.guid}`)}}},u0=c0,p0=(0,ew.Z)(u0,l0,d0,!1,null,"68b6c1a2",null),h0=p0.exports,m0=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[null!=e.contract.imagePartnerLogo?t("ImgPartnerLogo",{attrs:{src:e.contract.imagePartnerLogo,width:100,height:55}}):e._e()]},proxy:!0},{key:"right",fn:function(){return[t("SearchBar",{staticClass:"mr-1",attrs:{searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ButtonWithArrow",{staticClass:"mr-1",attrs:{variant:"lightest",type:"left"},on:{click:function(t){return e.$router.push({name:"digital-contracting/my-contracts"})}}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]),e.isExpired?e._e():t("BButton",{staticClass:"view-contract__btn-resend",attrs:{variant:"primary",disabled:e.currentCompaniesHaveFeature.readonly},on:{click:e.resend}},[e._v(" "+e._s(e.$t("Erneut senden"))+" ")])]},proxy:!0}])})]},proxy:!0},{key:"content",fn:function(){return[e.fetchingError?t("FetchingError",{on:{reload:e.loadData}}):e._e(),e.fetchingError||e.noContent?e._e():t("TableViewContractContainer",{attrs:{"table-data":e.tableData,"filter-string":e.filterString,"visible-rows":e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}}),e.noContent?t("div",{staticClass:"view-contract__no_content"},[e.isContractSenderEuPsmStats?t("div",[t("p",[e._v(e._s(e.$t("Die folgenden Daten wurden erfolgreich versendet.")))]),t("a",{attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.downloadExcel.apply(null,arguments)}}},[e._v("Verwendung_von_Pflanzenschutzmittel_2023-2024_fd.xlsx")])]):t("div",[t("p",[e._v(" "+e._s(e.$t("Die Flächen wurden nicht über FARMDOK an {partner} gemeldet.",e.contract))+" ")]),e.isExpired?t("p",[e._v(" "+e._s(e.$t("Du kannst aber Erntedaten importieren, sobald sie bei {partner} verfügbar sind.",e.contract))+" ")]):e._e(),e.isExpired?t("BButton",{attrs:{variant:"outline-primary",to:{name:"digital-contracting/import-contract",params:e.contract}}},[e._v(" "+e._s(e.$t("Erntedaten laden"))+" ")]):e._e()],1)]):e._e()]},proxy:!0}])})},f0=[],g0=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:"hot-contracting-view-contract","disable-read-only-bg":"","filter-string":e.filterString,"table-settings":e.tableSettings,"table-data":e.tableData,loading:e.loading,disableReadOnlyBg:""},on:{tableMounted:e.tableMounted,"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:filterString":t=>e.$emit("update:filterString",t)},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":Object.keys(e.tableData).length}},[e._v(" "+e._s(e.$t("Gesamtfläche {totalArea} ha",{totalArea:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])})},y0=[],v0=[{...eA,key:"fieldGroupMfa",lockedVisibility:!0,readOnly:!0},{...EF,key:"fieldName",readOnly:!0},{..._F,readOnly:!0},{...iA,readOnly:!0},{...QF,readOnly:!0}],b0={name:"TableViewContractContainer",components:{TableFooter:hD,TableBase:oD},mixins:[gD,oI],props:{filterString:{type:String,default:""},tableData:{type:Object,required:!0}},data(){return{columnDefinition:v0,loading:!0}},mounted(){this.loading=!1}},w0=b0,C0=(0,ew.Z)(w0,g0,y0,!1,null,null,null),F0=C0.exports,A0={name:"PageViewContract",components:{TableViewContractContainer:F0,ThePageSkeleton:$w,FetchingError:VI,SearchBar:YE,ButtonWithArrow:VK,TheContentbar:HL,ImgPartnerL
1ogo:BJ},data(){return{fetchingError:!1,noContent:!1,tableData:{},filterString:"",visibleRows:[],contractResponse:{}}},computed:{contract(){let e={};return Object.values(this.$store.state.digitalContracting.data).some((t=>Number(t.contractCompanyId)===Number(this.$route.params.contractCompanyId)&&(e=t,!0))),e},isContractSenderEuPsmStats(){return"\\AgriDat\\App\\Components\\DigitalContracting\\ContractSenderEuPsmStats"===this.contract.sender?.class},contractCompanyId(){return this.$route.params.contractCompanyId},currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_DIGITAL_CONTRACTING)},isExpired(){return 1e3*this.contract.periodEnd<new Date}},async mounted(){await this.loadData()},methods:{async loadData(){this.fetchingError=!1;try{const{data:e}=await l().get(`/admin/digitalContracting/getContractCompanyData/${this.contractCompanyId}`);this.contractResponse=e,null!=e&&Array.isArray(e.contractFields)&&0!==e.contractFields.length?this.tableData=e.contractFields.reduce(((e,t)=>({...e,[t.id]:t})),{}):this.noContent=!0}catch(e){console.error("unable to load data contract data",e),this.fetchingError=!0}},resend(){this.$store.commit("digitalContracting/setContracting",this.contract),this.$router.push({name:"digital-contracting/contracting-resend",params:this.contract})},downloadExcel(){const e=this.$store.state.auth.currentCompanies?.[0]?.id,t={2023:this.contractResponse.contractAdditionalData.processOrderData["2023"].noHerbicideWineFruitHops,2024:this.contractResponse.contractAdditionalData.processOrderData["2024"].noHerbicideWineFruitHops},i={2023:this.contractResponse.contractAdditionalData.processOrderData["2023"].noInsecticideWineFruitHops,2024:this.contractResponse.contractAdditionalData.processOrderData["2024"].noInsecticideWineFruitHops},a={2023:this.contractResponse.contractAdditionalData.processOrderData["2023"].organicFarming,2024:this.contractResponse.contractAdditionalData.processOrderData["2024"].organicFarming},n={companyId:e,contractId:this.contract.guid,organicFarming:a,noHerbicideWineFruitHops:t,noInsecticideWineFruitHops:i},r=HJ().stringify(n,{encode:!1,arrayFormat:"brackets"}),s=`${origin}/rest/reports/psm-stats/xlsx?${r}`;l().get(s,{responseType:"blob"}).then((e=>{const t=window.URL.createObjectURL(new Blob([e.data])),i=document.createElement("a");i.href=t,i.setAttribute("download","Verwendung_von_Pflanzenschutzmittel_2023-2024_fd.xlsx"),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(t)}))}}},k0=A0,S0=(0,ew.Z)(k0,m0,f0,!1,null,"7711e0c8",null),E0=S0.exports,I0=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"content",fn:function(){return[t("div",{staticClass:"map-page-container"},[t("div",{staticClass:"header-container"},[t("RouterLink",{staticClass:"header__logo",attrs:{to:e.baseUrl}},[t("IconTextLogoOriginal",{attrs:{width:"150"}})],1)],1),e.loading||e.error?e._e():t("GeoJsonMap",{attrs:{data:e.geoJson},on:{onDownloadClick:e.downloadFile}}),e.loading?t("div",{staticClass:"loading-global-wrapper"},[t("LoadingGlobal")],1):e.error?t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}):e._e()],1)]},proxy:!0}])})},_0=[],D0={name:"PageContractFileMap",components:{ThePageSkeleton:$w,LoadingGlobal:pJ,ErrorUserMessage:cH,GeoJsonMap:eJ,IconTextLogoOriginal:sJ},data(){return{loading:!0,error:!1,userErrorMessage:null,contractFile:null,baseUrl:M,geoJson:null,supportedFileFormats:["geojson","json"]}},computed:{fileId(){return this.$route.params.fileId},fileTitle(){return this.geoJson?this.geoJson.name:""}},async mounted(){await this.loadData(),this.loading=!1},methods:{async loadData(){try{const{data:e}=await l().get(`/admin/rest/contractFile/download/${this.$route.params.fileId}`),t=e.fileName.split(".").pop();this.supportedFileFormats.includes(t)||(this.contractFile=e,await this.downloadFile(e),this.$router.push({name:"home"})),this.contractFile=e,this.geoJson=JSON.parse(atob(e.fileBody))}catch(e){this.error=!0,console.error(e),this.userErrorMessage="An error occured",this.loading=!1}},async downloadFile(){const e=await KS(`data:text/plain;base64,${this.contractFile.fileBody}`,this.contractFile.fileName,this.contractFile.fileMimeType),{default:t}=await i.e(563).then(i.t.bind(i,75563,23));t(e,this.contractFile.fileName)}}},M0=D0,P0=(0,ew.Z)(M0,I0,_0,!1,null,"5eb3e03e",null),T0=P0.exports,x0=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[e.editMode?t("ButtonDropdown",{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.selectedRows=[]}}}
1):e._e(),e.editMode?t("div",{attrs:{id:"ButtonDeleteContractedFieldsWrapper"}},[t("Button",{staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteContractedFields",title:e.$t("Löschen"),"icon-only":!i,disabled:!e.$refs.table.selectedFieldsRemovable},on:{click:()=>e.$refs.table.removeSelectedEntries()}}),e.$refs.table.selectedFieldsRemovable?e._e():t("BTooltip",{attrs:{target:"ButtonDeleteContractedFieldsWrapper"}},[e._v(" "+e._s()+" "+e._s(e.$t("Deine Auswahl enthält Felder mit abgeschlossener Kontrahierung. Ändere den Partner-Status, um die Einträge zu löschen."))+" "+e._s()+" ")])],1):e._e(),t("Button",{attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportManagedContractFields",title:e.editMode?e.$t("Auswahl exportieren"):e.$t("Exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.exportData}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{"restore-label":e.$t("Felder wiederherstellen")},on:{export:e.exportData,settings:e.showSettings,restore:function(t){return e.$router.push({name:"digital-contracting/managed-contracts/fields/restore"})}}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldsContainer",{ref:"table",attrs:{contractId:e.contractId,filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows,"remove-row-confirm-message":e.removeRowConfirmMessage},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),t("ModalTableExport",{ref:"modalTableExport",attrs:{title:e.selectedRows.length>0?e.$t("Selektierte Felder exportieren"):null,filtered:0===e.selectedRows.length&&null!=e.$refs.table&&!e.$refs.table.allVisible,availableTypes:[{value:"xls",label:e.$t("XLS"),text:e.$t("Als Excel-Datei exportieren")},{value:"shape",label:e.$t("Shapefile"),text:e.$t("Im Shape-Format exportieren")}]}})]},proxy:!0}])})},B0=[],O0=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:e.id,"disable-read-only-bg":"","filter-string":e.filterString,"selected-rows":e.selectedRows,"visible-rows":e.visibleRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData,"remove:row":t=>e.removeEntries([t])},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0},{key:"no-content",fn:function(){return[t("NoContent",{attrs:{type:"fields"},on:{copyLinkToClipboard:e.copyLinkToClipboard}})]},proxy:!0},{key:"no-search-results",fn:function(){return[t("NoContent",{attrs:{type:"search"},on:{clearAllFilters:e.clearAllFilters}})]},proxy:!0}])})},$0=[],R0=function(){var e=this,t=e._self._c;return t("MaxWidthContainer",{staticClass:"no-content",attrs:{size:"xl"}},[t("img",{staticClass:"no-content__icon",attrs:{src:e.imageSrc,alt:"no-content"}}),t("h1",{staticClass:"mt-6 mb-4"},["partners"===e.type?t("span",[e._v(" "+e._s()+" "+e._s(e.$t("Es hat noch kein Partner Felder bereitgestellt. Lade deine Partner ein, Felder in Farmdok zu kontrahieren."))+" "+e._s()+" ")]):e._e(
1),"fields"===e.type?t("span",[e._v(" "+e._s(e.$t("Es wurden noch keine Felder übermittelt. Lade deine Partner ein, Felder in Farmdok freizugeben."))+" ")]):e._e(),"files"===e.type?t("span",[e._v(" "+e._s(e.$t("Es wurden noch keine Dateien hochgeladen!"))+" ")]):e._e(),"search"===e.type?t("span",[e._v(" "+e._s(e.$t("Keine Ergebnisse gefunden. Ändere den Suchbegriff."))+" ")]):e._e()]),"partners"===e.type||"fields"===e.type?t("p",[t("span",[e._v(" "+e._s()+" "+e._s(e.$t("Sende deinem Partner einen Link, der ihn direkt zum Vertrag führt. Er kann dort mit wenigen Klicks Felder freigeben."))+" "+e._s()+" ")])]):e._e(),"files"===e.type?t("p",[t("span",[e._v(" "+e._s(e.$t("Importiere Dateien in den Formaten Shape und GeoJSON."))+" ")]),t("br"),t("span",[e._v(" "+e._s()+" "+e._s(e.$t("Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden. Max. 10 MB pro Datei."))+" "+e._s()+" ")])]):e._e(),t("div",{staticClass:"mt-4"},["partners"===e.type||"fields"===e.type?t("ButtonLink",{on:{click:function(t){return e.$emit("copyLinkToClipboard")}}},[e._v(" "+e._s(e.$t("Link in die Zwischenablage kopieren"))+" ")]):e._e(),"search"===e.type?t("ButtonLink",{on:{click:function(t){return e.$emit("clearAllFilters")}}},[e._v(" "+e._s(e.$t("Suche zurücksetzen"))+" ")]):e._e(),"files"===e.type?t("Button",{attrs:{"leading-icon":"",icon:"cloud-upload"},on:{click:function(t){return e.$emit("uploadFiles")}}},[e._v(" "+e._s(e.$t("Datei hochladen"))+" ")]):e._e()],1),null!=e.errorResponseData?t("div",[t("ErrorUserMessage",{attrs:{"response-data":e.errorResponseData}}),t("div",{staticClass:"mt-2"},[t("ButtonLink",{on:{click:function(t){return e.$emit("refresh")}}},[e._v(" "+e._s(e.$t("Neu laden"))+" ")])],1)],1):e._e()])},N0=[];const z0=i(89467);var L0={name:"NoContent",components:{Button:gw,ButtonLink:Fw,MaxWidthContainer:Tw,ErrorUserMessage:cH},props:{type:{type:String,required:!0,validator:e=>["partners","fields","files","search","loading"].includes(e)},fetching:{type:Boolean,default:!1},errorResponseData:{type:Object,default:null}},computed:{imageSrc(){return z0(`./no-content-${this.type}.svg`)}}},V0=L0,U0=(0,ew.Z)(V0,R0,N0,!1,null,"6ba6b5fa",null),j0=U0.exports;function H0(e,t,i,a,n,r,s,...o){const l="function"===typeof s.getRendererValue?s.getRendererValue({value:r,row:i}):r;wF(t,l);let d=t.querySelector("span.hot-floating-cell-icon");null==d&&(d=document.createElement("span"),d.className="hot-floating-cell-icon"),Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,r,s,...o]),t.classList.add("hot-cell-with-floating-cell-icon"),d.onmousedown=e=>{e.stopPropagation()},d.onclick=()=>{"function"===typeof s.onClick&&s.onClick({target:d,visualRow:i})};let c=null;"function"===typeof s.getStatus&&(c=s.getStatus(i)),d.className="hot-floating-cell-icon",d.innerHTML="";const[u]=(0,ow.qv)({prefix:"fas",iconName:"dot-circle"}).node;d.append(u),d.classList.add(`hot-floating-cell-icon__partner-status--${c}`),t.append(d)}function G0(e){e.currentTarget&&e.currentTarget instanceof HTMLElement&&null!=e.currentTarget.querySelector("button")&&e.currentTarget.querySelector("button").click()}function W0(e,t,i,a,n,r,s){let o=t.querySelector(".hot-btn-partner-status");null===o&&(o=document.createElement("button")),o.innerHTML="",o.className="",o.classList.add("hot-btn-partner-status");let l=r;l=r,o.innerText=s.getDisplayValue(r),o.classList.add(`hot-btn-partner-status--${l}`),t.addEventListener("dblclick",G0),o.onclick=()=>{"function"===typeof s.onClick&&s.onClick({target:o,visualRow:i})},o.onmousedown=e=>{e.stopPropagation()},t.append(o)}ow.vI.add(uw._1v),Bu.Z.cellTypes.registerCellType("farmName",{renderer:H0}),Bu.Z.cellTypes.registerCellType("partnerStatus",{renderer:W0});const Z0={key:"partnerNumber",header:{title:()=>b["default"].i18n.translate("Partner-Nummer"),description:()=>b["default"].i18n.translate("Partner-Nummer, Kunden-Nummer, CRM Id")},type:"text",width:170,readOnly:!0},K0={key:"farmNumber",header:{title:()=>b["default"].i18n.translate("Betriebsnummer"),description:()=>b["default"].i18n.translate("Betriebsnummer des Sender-Betriebs")},type:"text",width:120,readOnly:!0},q0={key:"farmName",header:{title:()=>b["default"].i18n.translate("Betriebsname"),description:()=>b["default"].i18n.translate("Name des Sender-Betriebs")},type:"text",required:!1,className:"text-bold",width:350,readOnly:!0},Y0={...q0,type:"farmName",readOnly:!1,getStatus(e){if("function"!==typeof this.visualRowToGuid||!this.tableData)return null;const t=this.visualRowToGuid(e),i=this.tableData[t];return i?i.status:null},onClick(e){this.$emit("click:status",e)}},J0={key:"companyId",header:{title:()=>b["default"].i18n.translate("Betriebsname"),description:()=>b["default"].i18n.translate("Name des Sender-Betriebs")},type:"dropdown",required:!0,placeholder:b["default"].i18n.translate("Betrieb wählen"),width:350},X0={key:"fieldCount",header:{title:()=>b["default"].i18n.translate("Anzahl Felder"),description:()=>b["default"].i18n.translate("Gesamtanzahl der bereitgestellten Felder")},type:"numeric",required:!1,width:70,readOnly:!0},Q0={key:"fieldSize",header:{title:()=>b["default"].i18n.translate("Gesamtfläche"),description:()=>b["default"].i18n.translate("Gesamtfläche in ha")},type:"numeric",required:!1,width:100,readOnly:!0},e1={key:"crops",header:{title:()=>b["default"].i18n.translate("Kultur")},type:"text",required:!1,width:270,readOnly:!0,data(e){return e?e.crops.join(", "):""}},t1={key:"fieldCropName",header:{title:()=>b["default"].i18n.translate("Kultur")},type:"text",width:170,readOnly:!0},i1={key:"varieties",header:{title:()=>b["default"].i18n.translate("Sorte")},type:"text",required:!1,width:270,readOnly:!0,data(e){return null==e?"":e.varieties.join(", ")}},a1={key:"fieldVarietyName",header:{title:()=>b["default"].i18n.translate("Sorte")},type:"text",width:170,readOnly:!0},n1={key:"lastUpdate",header:{title:()=>b["default"].i18n.translate("Zuletzt aktualisiert")},type:"date",required:!1,width:120,readOnly:!0},r1={key:"status",header:{title:()=>b["default"].i18n.translate("Status"),description:()=>b["default"].i18n.translate("Partner-Status")}
1,type:"partnerStatus",onClick(e){this.$emit("click:status",e)},required:!1,width:120,readOnly:!0},s1={key:"contactEmail",header:{title:()=>b["default"].i18n.translate("Kontakt E-Mail"),description:()=>b["default"].i18n.translate("E-mail des Users, der freigegeben hat")},type:"text",requred:!1,width:170,readOnly:!0},o1={key:"fieldGroupNumber",header:{title:()=>b["default"].i18n.translate("FSNr"),description:()=>b["default"].i18n.translate("Feldstück-Nummer")},type:"text",width:70,readOnly:!0},l1={key:"fieldNumber",header:{title:()=>b["default"].i18n.translate("Feld Nr"),description:()=>b["default"].i18n.translate("Feld-Nummer")},type:"text",width:70,readOnly:!0},d1={key:"fieldName",header:{title:()=>b["default"].i18n.translate("Name")},type:"text",placeholder:b["default"].i18n.translate("<Bezeichnung>"),width:270,readOnly:!0},c1={key:"fileName",header:{title:()=>b["default"].i18n.translate("Dateiname")},type:"text",width:270,readOnly:!0},u1={key:"fileLink",header:{title:()=>b["default"].i18n.translate("Link"),description:()=>b["default"].i18n.translate("Link zur Datei")},type:"text",width:270,readOnly:!1},p1={key:"uploadDate",header:{title:()=>b["default"].i18n.translate("Hochgeladen"),description:()=>b["default"].i18n.translate("Datum an dem die Datei hochgeladen wurde")},type:"date",width:120,readOnly:!0};var h1=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...Z0,sortOrder:"asc"},K0,q0,o1,l1,d1,{...Q0,header:{title:()=>b["default"].i18n.translate("Größe"),description:()=>b["default"].i18n.translate("ha")}},{...e1,width:170},{...i1,width:170},n1,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],m1={name:"TableFieldsContainer",components:{TableBase:oD,TableFooter:hD,NoContent:j0},mixins:[gD,mD("managedContracts/fields"),fD("managedContracts/fields"),oI],props:{contractId:{type:String,required:!0}},data(){return{columnDefinition:h1}},async created(){await this.$store.dispatch("managedContracts/fields/loadByContractId",{contractId:this.contractId})},computed:{...(0,C.Se)({contractFieldData:"managedContracts/contractFieldData"}),id(){return["hot-fields-managed-contracts",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},tableData(){return this.contractFieldData(this.contractId).reduce(((e,t)=>({...e,[t.guid]:t})),{})},loading(){return this.$store.getters["products/crops/loading"]||this.$store.getters["varieties/loading"]||this.$store.getters["managedContracts/fields/loading"]||this.$store.getters["managedContracts/companies/loading"]},selectedFieldsRemovable(){if(!this.tableData||0===Object.keys(this.tableData).length)return!1;if(this.selectedRows.length>0){const e=["contracted","canceled"],t=this.selectedRows.map((e=>this.tableData[e].status));return!t.some((t=>e.includes(t)))}return!1}},methods:{async loadAdditionalData(){this.$store.dispatch("managedContracts/companies/subscribe"),this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe")},clearAllFilters(){this.$refs.table.clearAllFilters()},async copyLinkToClipboard(){const e=`${P}${M}digital-contracting/contracting/${this.contractId}`;navigator.clipboard&&await navigator.clipboard.writeText(e)}}},f1=m1,g1=(0,ew.Z)(f1,O0,$0,!1,null,null,null),y1=g1.exports,v1={name:"PageManagedContractFields",components:{ThePageSkeleton:$w,TheContentbar:HL,TableFieldsContainer:y1,ButtonDropdown:mV,SearchBar:YE,DropdownPageOptions:YL,ModalPageSettings:HE,ModalTableExport:_$,Button:gw},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null}},computed:{...(0,C.Se)({contractCompanyData:"managedContracts/contractCompanyData"}),editMode(){return this.selectedRows.length>0},currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_MANAGED_CONTRACTS)},contractId(){return this.$route.params.contractId}},methods:{async exportData(){const{type:e,exportFiltered:t,okay:a}=await this.$refs.modalTableExport.show();if(!a)return;let n=[];if(n=this.editMode?this.selectedRows:t?this.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),"xls"===e)return void this.$refs.table.$refs.table.export(n);const r=await l().post("/admin/rest/contractField/export",{version:"2.0",data:{type:e,fieldIds:n}}),s=await KS(`data:text/plain;base64,${r.data.fileBody}`,r.data.fileName,r.data.fileMimeType),{default:o}=await i.e(563).then(i.t.bind(i,75563,23));o(s,r.data.fileName)},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},removeRowConfirmMessage(e){return 1===e.length?this.$t("Du entfernst ein Feld, das von deinem Vertragspartner bereitgestellt wurde. Gewählten Eintrag wirklich löschen?"):this.$t("Du entfernst Felder, die von deinem Vertragspartner bereitgestellt wurden. Gewählte Einträge wirklich löschen?")}}},b1=v1,w1=(0,ew.Z)(b1,x0,B0,!1,null,null,null),C1=w1.exports,F1=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[e.editMode?t("ButtonDropdown",{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.selectedRows=[]}}}
1):e._e()]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"mr-1",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("Button",{attrs:{color:"lightest","component-namespace-name":"ButtonClose"},on:{click:e.back}},[e._v(" "+e._s(e.$t("Schließen"))+" ")]),t("Button",{attrs:{color:"primary","component-namespace-name":"ButtonRestore",fetching:e.restoring},on:{click:e.restore}},[e._v(" "+e._s(e.$t("Wiederherstellen"))+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldsRestoreContainer",{ref:"table",attrs:{contractId:e.contractId,filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}})]},proxy:!0}])})},A1=[],k1=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{"disable-read-only-bg":"","read-only":"",id:e.id,"filter-string":e.filterString,"selected-rows":e.selectedRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData}})},S1=[],E1={data(){return{loading:!0,source:null,tableData:{},tableErrors:[]}},beforeDestroy(){null!=this.source&&this.source.cancel()},methods:{async loadTableData(e){this.loading=!0,this.tableErrors=[],this.source=l().CancelToken.source();try{const{data:t}=await l().get(e,{cancelToken:this.source.token});this.tableData=t.data.reduce(((e,t)=>({...e,[t.id]:{...t,storeStatus:V}})),{}),this.loading=!1}catch(t){this.tableErrors=[{type:q}]}}}},I1=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...pF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,sortOrder:"desc"},{...Z0,key:"contractCompany.foreignId"},{...K0,key:"contractCompany.companyBdmId"},{...q0,key:"contractCompany.companyName"},{...o1,key:"fieldGroupMfa"},l1,d1,Q0,t1,a1,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];const _1=e=>null!=e?btoa(JSON.stringify(e)):"";var D1={name:"TableFieldsRestoreContainer",components:{TableBase:oD},props:{filterString:{type:String,default:""},selectedRows:{type:Array,default:null},contractId:{type:String,required:!0}},mixins:[E1,gD],data(){return{columnDefinition:I1}},computed:{id(){return["hot-fields-restore",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")}},mounted(){this.loadData()},methods:{loadData(){const e=g()().startOf("day").subtract({days:90}),t=["AND",["contractCompany.contractId","=",this.contractId],["deleted",">=",Math.round(e/1e3)]],i=["contractCompany"];this.loadTableData(`/admin/rest/contractField?showDeleted=1&disablePagination=1&filter=${_1(t)}&resolve=${_1(i)}`)},async restore(){const e=[...this.selectedRows];try{await Promise.all([...new Array(Math.ceil(e.length/50)).keys()].map((t=>{const i=50*t,a=50*(t+1),n=["id","IN",e.slice(i,a)];return l().put(`/admin/rest/contractField/undelete/?filter=${_1(n)}`)}))),await this.$store.dispatch("managedContracts/fields/reset"),await this.$store.dispatch("managedContracts/fields/subscribe")}catch(t){return console.error(t),this.addErrorsAfterRestore(e),!1}return!0},addErrorsAfterRestore(e){this.tableErrors=[...this.tableErrors,...e.map((e=>({type:J,guid:e,key:null,errorUserMessage:this.$t("Das Feld konnte nicht wieder hergestellt werden.")})))]}}},M1=D1,P1=(0,ew.Z)(M1,k1,S1,!1,null,null,null),T1=P1.exports,x1={name:"PageManagedContractFieldsRestore",components:{TheContentbar:HL,ThePageSkeleton:$w,TableFieldsRestoreContainer:T1,ButtonDropdown:mV,SearchBar:YE,Button:gw},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],restoring:!1}},computed:{contractId(){return this.$route.params.contractId}
1,currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_MANAGED_CONTRACTS)},editMode(){return this.selectedRows.length>0}},methods:{back(){this.$router.push({name:"digital-contracting/managed-contracts/fields"})},async restore(){this.restoring=!0;const e=await this.$refs.table.restore();this.restoring=!1,e&&this.back()}}},B1=x1,O1=(0,ew.Z)(B1,F1,A1,!1,null,null,null),$1=O1.exports,R1=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[e.editMode?t("ButtonDropdown",{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.selectedRows=[]}}}):e._e(),e.editMode?t("Button",{staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteContractedFiles",title:e.$t("Löschen"),"icon-only":!i},on:{click:()=>e.$refs.table.removeSelectedEntries()}}):e._e(),t("Button",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{color:"primary",icon:"cloud-upload","leading-icon":"","component-namespace-name":"ButtonImportFields",title:e.$t("Datei hochladen"),"tooltip-options":{boundary:"viewport"}},on:{click:e.uploadFiles}}),t("Button",{attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportManagedContracFiles",title:e.editMode?e.$t("Auswahl exportieren"):e.$t("Exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.exportData}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{hideRestore:!0},on:{export:e.exportData,settings:e.showSettings}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFilesContainer",{ref:"table",attrs:{contractId:e.contractId,filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},uploadFiles:e.uploadFiles}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),t("ModalTableExport",{ref:"modalTableExport",attrs:{title:e.selectedRows.length>0?e.$t("Auswahl exportieren"):null,filtered:0===e.selectedRows.length&&null!=e.$refs.table&&!e.$refs.table.allVisible,availableTypes:[{value:"xls",label:e.$t("XLS"),text:e.$t("Als Excel-Datei exportieren")}]}})]},proxy:!0}])})},N1=[],z1=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",class:[{"table-files-container--is-dragover":e.isDragover}],attrs:{id:e.id,"disable-read-only-bg":"","filter-string":e.filterString,"selected-rows":e.selectedRows,"visible-rows":e.visibleRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors,"data-dragover-label":e.$t("Leg deine Datei hier ab")},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData,"update:cell":e.updateEntryByKeyAndValue,"remove:row":t=>e.removeEntries([t]),"update:isDragover":t=>e.isDragover=t,drop:e.onFileDrop},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}})]},proxy:!0},{key:"no-content",fn:function(){return[t("NoContent",{attrs:{type:"files"},on:{uploadFiles:function(t){return e.$emit("uploadFiles")}}})]},proxy:!0},e.isDragover?null:{key:"no-search-results",fn:function(){return[t("NoContent",{attrs:{type:"search"},on:{clearAllFilters:e.clearAllFilters}})]},proxy:!0}],null,!0)})},L1=[],V1=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...Z0,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},K0,J0,c1,u1,s1,p1,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];function U1(e){return{data(){return{columnSettingsMiddleware:[]}},created(){this.columnSettingsMiddleware.push(this.columnDropdownContractCompaniesColumnSettings)},computed:{...(0,C.Se)({companies:"managedContracts/companies/data",companiesByContractId:"managedContracts/companiesByContractId"})},methods:{async columnDropdownContractCompaniesGetItems(){return[{items:this.companiesByContractId(this.contractId).map((e=>({id:e.id,name:e.companyName}))),sort:!0}]},columnDropdownContractCompaniesGetRendererValue({value:e}){return e?this.companies[e].companyName:""},columnDropdownContractCompaniesColumnSettings(t){return t.map((t=>t.key!==e?t:{...t,getRendererValue:(...e)=>this.columnDropdownContractCompaniesGetRendererValue(...e),getItems:()=>this.columnDropdownContractCompaniesGetItems()}))}}}}var j1={name:"TableFilesContainer",components:{TableBase:oD,TableFooter:hD,NoContent:j0},mixins:[gD,mD("managedContracts/files",{forceRefresh:!0}),fD("managedContracts/files"),U1("companyId")],props:{contractId:{type:String,required:!0}},data(){return{columnDefinition:V1,contractIdState:this.contractId,isDragover:!1}},computed:{...(0,C.Se)({contractFileData:"managedContracts/contractFileData"}),id(){return["hot-files",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},tableData(){return this.contractFileData(this.contractId).reduce(((e,t)=>({...e,[t.guid]:t})),{})},loading(){return this.$store.getters["managedContracts/files/loading"]||this.$store.getters["managedContracts/companies/loading"]},contractIdComputed(){return 1}},methods:{loadAdditionalData(){this.$store.dispatch("managedContracts/companies/subscribe")},clearAllFilters(){this.$refs.table.clearAllFilters()},async onFileDrop(e){this.isDragover=!1;const{files:t}=e.dataTransfer;t.length<1||await this.$router.push({name:"digital-contracting/managed-contracts/files/upload",params:{initialFiles:t}})}}},H1=j1,G1=(0,ew.Z)(H1,z1,L1,!1,null,"d949b470",null),W1=G1.exports,Z1={name:"PageManagedContractFiles",components:{ThePageSkeleton:$w,TheContentbar:HL,TableFilesContainer:W1,Button:gw,SearchBar:YE,DropdownPageOptions:YL,ModalPageSettings:HE,ButtonDropdown:mV,ModalTableExport:_$},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null}},computed:{editMode(){return this.selectedRows.length>0}
1,currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_MANAGED_CONTRACTS)},contractId(){return this.$route.params.contractId}},methods:{uploadFiles(){this.$router.push({name:"digital-contracting/managed-contracts/files/upload",params:{contractId:this.$route.params.contractId}})},async exportData(){const{exportFiltered:e,okay:t}=await this.$refs.modalTableExport.show();if(!t)return;let i=[];i=this.editMode?this.selectedRows:e?this.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),this.$refs.table.$refs.table.export(i)},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)}}},K1=Z1,q1=(0,ew.Z)(K1,R1,N1,!1,null,null,null),Y1=q1.exports,J1=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("Button",{attrs:{color:"lightest"},on:{click:e.onBack}},[e._v(" "+e._s(e.$t("Abbrechen"))+" ")]),t("Button",{attrs:{icon:["far","arrow-right"],disabled:!e.uploadEnabled,fetching:e.fetching},on:{click:e.onUpload}},[e._v(" "+e._s(e.$t("Upload"))+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("FilesUpload",{ref:"filesUpload",attrs:{initialFiles:e.initialFiles},on:{uploadSuccess:e.onUploadSuccess,uploadEnabledChanged:e.uploadEnabledChanged}})]},proxy:!0}])})},X1=[],Q1=function(){var e=this,t=e._self._c;return t("div",{staticClass:"file-upload"},[t("MaxWidthContainer",{attrs:{size:"xl"}},[t("FilesUploadIntroDescription",{attrs:{headline:e.$t("Dateien hochladen"),paragraph:e.$t("Importiere Dateien in den Formaten Shape und GeoJSON. Für jede Datei wird ein Link generiert. GeoJSON-Links können im Webbrowser geöffnet werden.")}}),t("FilesUploadForm",{ref:"filesUploadForm",attrs:{supportedFileFormats:e.supportedFileFormats,maxFileSize:e.maxFileSize,initialFiles:e.initialFiles},on:{uploadEnabledChanged:e.uploadEnabledChanged,uploadSuccess:e.onUploadSuccess}})],1)],1)},e2=[],t2=function(){var e=this,t=e._self._c;return t("div",{staticClass:"intro-description"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(e.headline))]),t("p",[e._v(" "+e._s(e.paragraph)+" ")])])},i2=[],a2={name:"FilesUploadIntroDescription",props:{headline:{type:String,default:function(){return this.$t("Datei Hochladen")}},paragraph:{type:String,default:""}}},n2=a2,r2=(0,ew.Z)(n2,t2,i2,!1,null,null,null),s2=r2.exports,o2=function(){var e=this,t=e._self._c;return t("form",{staticClass:"form",class:{"form--is-dragover":e.isDragover},attrs:{method:"post",action:"",enctype:"multipart/form-data"},on:{drag:function(e){e.preventDefault()},dragstart:function(e){e.preventDefault()},dragend:function(t){t.preventDefault(),e.isDragover=!1},dragover:function(t){t.preventDefault(),e.isDragover=!0},dragenter:function(t){t.preventDefault(),e.isDragover=!0},dragleave:function(t){t.preventDefault(),e.isDragover=!1},drop:function(t){return t.preventDefault(),e.onFileDrop.apply(null,arguments)},submit:function(t){return t.preventDefault(),e.onSubmit.apply(null,arguments)}}},[t("label",{staticClass:"position-absolute"},[t("input",{ref:"input",staticClass:"input",attrs:{type:"file",accept:e.supportedFileFormatFileEndings.map((e=>`.${e}`)).join(","),name:"file[]",multiple:""},on:{change:e.onFileChange}})]),0===e.fileGroups.length?t("EmptyState",{attrs:{supportedFileFormats:e.supportedFileFormats,maxFileSize:e.maxFileSize},on:{onEmptyFormClick:e.onEmptyFormClick}}):t("div",{staticClass:"form-files-content"},[t("FilesList",{attrs:{fileGroups:e.fileGroups}}),t("FilesListButtons",{attrs:{uploadDisabled:!e.uploadEnabled,fetching:e.fetching},on:{onAddAdditionalFiles:e.onAddAdditionalFiles,onReset:e.onReset,onUpload:e.onSubmit}}),t("ErrorUserMessage",{staticClass:"mx-3",attrs:{errorUserMessage:e.submitErrorUserMessages}})],1)],1)},l2=[],d2=i(55733),c2=i.n(d2),u2=function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-empty-content",on:{click:e.onEmptyFormClick}},[t("FontAwesomeIcon",{staticClass:"mb-3",attrs:{icon:"cloud-upload",size:"3x"}}),t("span",{staticClass:"label-text-one"},[e._v(e._s(e.$t("ZIEHE DIE DATEI HIER HER")))]),t("span",[e._v(" "+e._s(e.labelUploadInfoParts[0])+" "),t("BLink",[e._v(" "+e._s(e.labelUploadInfoParts[1])+" ")]),e._v(" "+e._s(e.labelUploadInfoParts[2])+" ")],1),t("span",{staticClass:"mt-3 text-small"},[e._v(" "+e._s(e.fileFormatDescription)+" "+e._s(e.$t("Max. Dateigröße: {maxFileSize} MB",{maxFileSize:e.maxFileSize})))])],1)},p2=[],h2={name:"EmptyState",props:{supportedFileFormats:{type:Array,default(){return[]},required:!0},maxFileSize:{type:Number,default:0}},data(){return{labelUploadInfo:this.$t("oder klicke {linkStart}Datei auswählen{linkEnd}, um eine Datei hinzuzufügen.",{linkStart:"#####",linkEnd:"#####"})}},computed:{labelUploadInfoParts(){return this.labelUploadInfo.split("#####")},supportedFileFormatDisplayNames(){return this.$props.supportedFileFormats.map((e=>e.displayName))},fileFormatDescription(){return 1===this.supportedFileFormatDisplayNames.length?this.$t("Es können Dateien im Format {fileFormat} importiert werden.",{fileFormat:this.supportedFileFormatDisplayNames[0]}
1):this.$t("Es können Dateien in den Formaten {fileFormats} und {lastFileFormat} importiert werden.",{fileFormats:this.supportedFileFormatDisplayNames.slice(0,-1).join(", "),lastFileFormat:this.supportedFileFormatDisplayNames[this.supportedFileFormatDisplayNames.length-1]})}},methods:{onEmptyFormClick(){this.$emit("onEmptyFormClick")}}},m2=h2,f2=(0,ew.Z)(m2,u2,p2,!1,null,"185aa93a",null),g2=f2.exports,y2=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"file-groups-list"},e._l(e.fileGroups,(function(i){return t("li",{key:i.key,staticClass:"file-group"},[i.subFiles&&i.subFiles.length>0?t("div",{staticClass:"file-group-title"},[e._v(" "+e._s(i.file.name)+" ")]):t("div",{staticClass:"item"},[t("div",{staticClass:"item-label"},[e._v(e._s(i.file.name))]),0===i.errors.length?t("FontAwesomeIcon",{staticClass:"item-icon item-icon--success",attrs:{icon:["far","check-circle"],"data-cy":"success-icon"}}):e._e()],1),t("ul",{staticClass:"file-subgroup"},[e._l(i.subFiles,(function(a){return t("li",{key:`${i.key}_${a.name}`,staticClass:"item"},[t("div",{staticClass:"item-label"},[e._v(" "+e._s(a.name)+" ")]),0===i.errors.length?t("FontAwesomeIcon",{staticClass:"item-icon item-icon--success",attrs:{icon:["far","check-circle"],"data-cy":"success-icon"}}):e._e()],1)})),e._l(i.errors,(function(a){return t("li",{key:`${i.key}_${a.key}`,staticClass:"text-danger item"},[t("div",{staticClass:"item-label"},[e._v(" "+e._s(a.message)+" ")]),t("FontAwesomeIcon",{staticClass:"text-danger item-icon",attrs:{icon:["far","exclamation-circle"],"data-cy":"error-icon"}})],1)}))],2)])})),0)},v2=[],b2={name:"FilesList",props:{fileGroups:{type:Array,required:!0}}},w2=b2,C2=(0,ew.Z)(w2,y2,v2,!1,null,"61eb08c6",null),F2=C2.exports,A2=function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-button-container"},[t("span",{staticClass:"cursor-pointer",on:{click:e.onAddAdditionalFiles}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"cloud-upload"}}),e._v(" "+e._s(e.$t("Weitere Dateien durch Ablegen hinzufügen"))+" ")],1),t("div",[t("Button",{attrs:{outline:"",disabled:e.fetching},on:{click:e.onReset}},[e._v(" "+e._s(e.$t("Alle Dateien entfernen"))+" ")]),e.uploadVisible?t("Button",{attrs:{fetching:e.fetching,disabled:e.uploadDisabled},on:{click:e.onUpload}},[e._v(" "+e._s(e.$t("Upload"))+" ")]):e._e()],1)])},k2=[],S2={name:"FilesListButtons",components:{Button:gw},props:{uploadDisabled:{type:Boolean,default:!1},uploadVisible:{type:Boolean,default:!0},fetching:{type:Boolean,default:!1}},methods:{onAddAdditionalFiles(){this.$emit("onAddAdditionalFiles")},onReset(){this.$emit("onReset")},onUpload(){this.$emit("onUpload")}}},E2=S2,I2=(0,ew.Z)(E2,A2,k2,!1,null,"43f86ff0",null),_2=I2.exports,D2={name:"FilesUploadForm",components:{EmptyState:g2,FilesList:F2,FilesListButtons:_2,ErrorUserMessage:cH},props:{supportedFileFormats:{type:Array,default(){return[]},required:!0},maxFileSize:{type:Number,default:0},initialFiles:{type:FileList}},data(){return{isDragover:!1,fileGroups:[],fetching:!1,submitErrorUserMessages:null}},created(){this.initialFiles&&this.addFilesToFileGroups(this.initialFiles)},computed:{uploadEnabled(){const e=this.fileGroups.length>0&&this.fileGroups.some((e=>e.file)),t=this.fileGroups.some((e=>e.errors.length>0));return e&&!t&&null===this.submitErrorUserMessages},supportedFileFormatFileEndings(){return this.$props.supportedFileFormats.map((e=>e.fileEnding))}},methods:{onEmptyFormClick(){this.$refs.input.click()},onFileDrop(e){this.isDragover=!1,this.addFilesToFileGroups(e.dataTransfer.files)},onFileChange(e){this.addFilesToFileGroups(e.target.files)},async addFilesToFileGroups(e){const t=Array.from(e),i=await Promise.all(t.map((async e=>{if("application/zip"===e.type){const t=await c2().loadAsync(e),i=Object.values(t.files).map((e=>({name:e.name})));return{key:e.name,file:e,subFiles:i,errors:this.validateFile(e,i)}}return{key:e.name,file:e,subFiles:[],errors:this.validateFile(e)}})));this.fileGroups.push(...i)},validateFile(e,t){const i=[],a=this.validateFileSize(e);a&&i.push(a);const n=this.validateFileExtension(e);if(n&&i.push(n),"application/zip"===e.type){const a=this.validateShapeFile(e,t);a&&i.push(a)}return i},validateFileSize(e){const t=this.maxFileSize*2**20,i=e.size>t;return i?{key:"fileSizeError",message:this.$t("Die Datei ist zu groß. (max. {maxFileSize} MB)",{maxFileSize:this.$props.maxFileSize})}:null},validateFileExtension(e){const t=e.name.split(".").pop();return this.$props.supportedFileFormats.map((e=>e.fileEnding)).includes(t)?null:{key:"fileFormatError",message:this.$t("Dieses Dateiformat wird nicht unterstützt.")}},validateShapeFile(e,t){const i=t.map((e=>e.name)),a=i.map((e=>e.split(".").pop())),n=["shp","shx","dbf"],r=n.every((e=>a.includes(e)));return r?null:{key:"shapeFileError",message:this.$t("Keine Shape-Datei im Zip gefunden.")}},getFileKey(e){return`${e.name}_${e.lastModified}`},onAddAdditionalFiles(){this.$refs.input.click()},onReset(){this.fileGroups=[],this.$refs.input.value=null,this.submitErrorUserMessages=null},async onSubmit(){const e=new FormData;let t;e.append("contractId",this.$route.params.contractId),this.fileGroups.forEach((t=>{e.append("file[]",t.file)}));try{this.fetching=!0;const{data:i}=await l().post("/admin/rest/contractFile/upload",e);t=ue(i)}catch(i){t=ue(i)}finally{this.fetching=!1}switch(t.status){case"success":return this.$emit("uploadSuccess"),void(this.submitErrorUserMessages=null);case"partialSuccess":return void(this.submitErrorUserMessages=t.errors.map((e=>e.errorUserMessage[0])));case"error":return void(this.submitErrorUserMessages=t.errorUserMessage);default:this.submitErrorUserMessages=this.$t("Es ist ein unbekannter Fehler aufgetreten.")}}},watch:{uploadEnabled(e){this.$emit("uploadEnabledChanged",e)}}},M2=D2,P2=(0,ew.Z)(M2,o2,l2,!1,null,"a0f5cdc8",null),T2=P2.exports,x2={name:"FilesUpload",components:{MaxWidthContainer:Tw,FilesUploadIntroDescription:s2,FilesUploadForm:T2},props:{initialFiles:FileList},data(){return{supportedFileFormats:[{fileEnding:"zip",displayName:"Shape"},{fileEnding:"geojson",displayName:"GeoJSON"},{fileEnding:"json",displayName:"JSON"}],maxFileSize:10,uploadEnabled:!1}},methods:{uploadEnabledChanged(e){this.$emit("uploadEnabledChanged",e)},onSubmit(){this.$refs.filesUploadForm.onSubmit()},onUploadSuccess(){this.$emit("uploadSuccess")}}}
1,B2=x2,O2=(0,ew.Z)(B2,Q1,e2,!1,null,"374f539a",null),$2=O2.exports,R2={name:"PageManagedContractFilesUpload",components:{ThePageSkeleton:$w,TheContentbar:HL,Button:gw,FilesUpload:$2},props:{initialFiles:FileList},data(){return{uploadEnabled:!1,fetching:!1}},methods:{onBack(){this.$router.push({name:"digital-contracting/managed-contracts/files",params:{contractId:this.$route.params.contractId}})},onUpload(){this.$refs.filesUpload.onSubmit()},onUploadSuccess(){this.$router.push({name:"digital-contracting/managed-contracts/files",params:{contractId:this.$route.params.contractId}})},uploadEnabledChanged(e){this.uploadEnabled=e}}},N2=R2,z2=(0,ew.Z)(N2,J1,X1,!1,null,null,null),L2=z2.exports,V2=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}
1){return[e.editMode?t("ButtonDropdown",{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.selectedRows=[]}}}):e._e(),t("Button",{attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportManagedContractPartners",title:e.editMode?e.$t("Auswahl exportieren"):e.$t("Exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.exportData}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{hideRestore:!0},on:{export:e.exportData,settings:e.showSettings}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TablePartnersContainer",{ref:"table",attrs:{contractId:e.contractId,filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"click:status":e.onClickStatus}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),t("ModalTableExport",{ref:"modalTableExport",attrs:{title:e.selectedRows.length>0?e.$t("Selektierte Felder exportieren"):null,filtered:0===e.selectedRows.length&&null!=e.$refs.table&&!e.$refs.table.allVisible,availableTypes:[{value:"xls",label:e.$t("XLS"),text:e.$t("Als Excel-Datei exportieren")}]}}),null!==e.partnerStatusTarget?t("PopoverPartnerStatus",{attrs:{company:e.partnerStatusCompany,target:e.partnerStatusTarget},on:{close:function(t){e.partnerStatusTarget=null},reloadAdditionalData:e.reloadAdditionalData}}):e._e()]},proxy:!0}])})},U2=[],j2=function(){var e=this,t=e._self._c;return t("BPopover",{ref:"popover",attrs:{show:"",placement:"bottom","custom-class":"popover-partner-status shadow",id:e.id,target:e.target}},[t("h3",{staticClass:"popover-partner-status__title"},[e._v(" "+e._s(e.$t("Partner-Status"))+" ")]),t("div",{staticClass:"popover-partner-status__body"},[e.error?t("p",{staticClass:"popover-partner-status__error"},[e._v(" "+e._s(e.errorUserMessage)+" ")]):e._e(),e.error?e._e():t("FormFieldRadioGroup",{staticClass:"m-0",attrs:{variant:"no-label",stacked:""},on:{change:t=>e.save(t)},model:{value:e.status,callback:function(t){e.status=t},expression:"status"}},[t("FormRadio",{attrs:{variant:"bordered",value:"received",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Erhalten")))]),e._v("   "),t("FontAwesomeIcon",{staticClass:"popover-partner-status__icon popover-partner-status__icon--received",attrs:{icon:"dot-circle"}})]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Dein Partner hat Felder für diesen Vertrag bereitgestellt. Dein Partner kann die Felder jederzeit aktualisieren."))+" ")]},proxy:!0}],null,!1,3790656079)}),t("FormRadio",{attrs:{variant:"bordered",value:"contracted",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Kontrahiert")))]),e._v("   "),t("FontAwesomeIcon",{staticClass:"popover-partner-status__icon popover-partner-status__icon--contracted",attrs:{icon:"dot-circle"}})]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Der Vertragsabschluss ist erfolgt. Dein Partner kann keine Aktualisierungen senden."))+" ")]},proxy:!0}],null,!1,1014028309)}),t("FormRadio",{attrs:{variant:"bordered",value:"canceled",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Storniert")))]),e._v("   "),t("FontAwesomeIcon",{staticClass:"popover-partner-status__icon popover-partner-status__icon--canceled",attrs:{icon:"dot-circle"}})]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Der Vertrag wurde storniert. Die bereitgestellten Felder werden nicht mehr berücksichtigt."))+" ")]},proxy:!0}],null,!1,974832688)})],1)],1)])},H2=[];ow.vI.add(uw._1v);const{bind:G2,unbind:W2}=v().directive;let Z2=0;var K2={name:"PopoverPartnerStatus",components:{FormFieldRadioGroup:_T,FormRadio:kT},props:{target:{type:HTMLElement,required:!0},company:{type:Object,required:!0},activeAndHasHarvestingMeasure:{type:Boolean,default:!1}},data(){return Z2+=1,{id:`popover-partner-status--nr-${Z2}`,status:this.company.status,popover:null,error:!1,fetching:!1}},async mounted(){await this.$nextTick(),this.popover=document.querySelector(`#${this.id}`),this.popover&&G2(this.popover,{value:this.onClickOutside}),document.addEventListener("keydown",this.onKeyDown)},beforeDestroy(){this.popover&&W2(this.popover),document.removeEventListener("keydown",this.onKeyDown)},methods:{onKeyDown(e){"Escape"===e.key&&this.$emit("close")},onClickOutside(){this.$emit("close")},async save(e){this.error?this.$emit("close"):(this.fetching=!0,await this.$store.dispatch("managedContracts/companies/updateAndSyncEntry",{status:e,companyId:this.company.id}),this.$emit("reloadAdditionalData"),this.$emit("close"),this.fetching=!1)}}},q2=K2,Y2=(0,ew.Z)(q2,j2,H2,!1,null,"86d01cb8",null),J2=Y2.exports,X2=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{id:e.id,"disable-read-only-bg":"","filter-string":e.filterString,"
1selected-rows":e.selectedRows,"visible-rows":e.visibleRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData,"click:status":e.onClickStatus},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0},{key:"no-content",fn:function(){return[t("NoContent",{attrs:{type:"partners"},on:{copyLinkToClipboard:e.copyLinkToClipboard}})]},proxy:!0},{key:"no-search-results",fn:function(){return[t("NoContent",{attrs:{type:"search"},on:{clearAllFilters:e.clearAllFilters}})]},proxy:!0}])})},Q2=[],e8=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...Z0,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},K0,Y0,X0,Q0,e1,i1,n1,r1,s1,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],t8={name:"TablePartnersContainer",components:{TableBase:oD,TableFooter:hD,NoContent:j0},mixins:[gD,mD("managedContracts/companies"),oI],props:{contractId:{type:String,required:!0}},data(){return{columnDefinition:e8}},computed:{...(0,C.Se)({contractCompanyData:"managedContracts/contractCompanyData"}),id(){return["hot-partners",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},tableData(){return this.contractCompanyData(this.contractId).reduce(((e,t)=>({...e,[t.guid]:t})),{})},loading(){return this.$store.getters["products/crops/loading"]||this.$store.getters["varieties/loading"]||this.$store.getters["managedContracts/fields/loading"]||this.$store.getters["managedContracts/companies/loading"]}},methods:{export(){this.$refs.table.export()},loadAdditionalData(){this.$store.dispatch("managedContracts/fields/loadByContractId",{contractId:this.contractId}),this.$store.dispatch("managedContracts/fields/subscribe"),this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe")},clearAllFilters(){this.$refs.table.clearAllFilters()},onClickStatus({target:e,visualRow:t}){this.$emit("click:status",{target:e,guid:this.$refs.table.visualRowToGuid(t)})},async copyLinkToClipboard(){const e=`${P}${M}digital-contracting/contracting/${this.contractId}`;navigator.clipboard&&await navigator.clipboard.writeText(e)}}},i8=t8,a8=(0,ew.Z)(i8,X2,Q2,!1,null,null,null),n8=a8.exports,r8={name:"PageManagedContractPartners",components:{ThePageSkeleton:$w,TheContentbar:HL,DropdownPageOptions:YL,TablePartnersContainer:n8,SearchBar:YE,ButtonDropdown:mV,Button:gw,ModalPageSettings:HE,ModalTableExport:_$,PopoverPartnerStatus:J2},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null,partnerStatusTarget:null,partnerStatusCompany:null}},computed:{...(0,C.Se)({companies:"managedContracts/companies/data"}),editMode(){return this.selectedRows.length>0},currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_MANAGED_CONTRACTS)},contractId(){return this.$route.params.contractId}},methods:{async exportData(){const{exportFiltered:e,okay:t}=await this.$refs.modalTableExport.show();if(!t)return;let i=[];i=this.editMode?this.selectedRows:e?this.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),this.$refs.table.$refs.table.export(i)},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},async onClickStatus(e){null==e&&(this.partnerStatusTarget=null,this.partnerStatusCompany=null);const{target:t,guid:i}=e;this.partnerStatusTarget=null,this.partnerStatusCompany=null,this.partner
1StatusTarget!==t&&this.companies[i]&&(await this.$nextTick(),this.partnerStatusTarget=t,this.partnerStatusCompany=this.companies[i])},reloadAdditionalData(){this.$refs.table.loadAdditionalData()}}},s8=r8,o8=(0,ew.Z)(s8,V2,U2,!1,null,null,null),l8=o8.exports,d8=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"ml-4",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!i}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"managed-contracts__card-container"},[0===e.contractsComputed.length?t("p",[e._v(" "+e._s(e.$t("Keine Kontrakte vorhanden."))+" ")]):e._e(),e._l(e.contractsComputed,(function(i,a){return t("CardContract",{key:`card-${a}`,attrs:{contract:i,managed:""},on:{view:function(t){return e.viewContract(i)}}})}))],2)]},proxy:!0}])})},c8=[],u8={name:"PageManagedContracts",components:{ThePageSkeleton:$w,TheContentbar:HL,CompanySwitch:qw,SearchBar:YE,
1CardContract:HQ},mixins:[a0],data(){return{storeUnsubscribe:null}},computed:{...(0,C.Se)({contracts:"managedContracts/contracts/data"}),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_MANAGED_CONTRACTS)},contractsComputed(){if(this.fetching)return[{fetching:!0},{fetching:!0},{fetching:!0}];const e=Object.values(this.contracts);return this.filterContracts(e)}},created(){this.$store.dispatch("managedContracts/contracts/loadAll"),this.$store.dispatch("managedContracts/contracts/subscribe"),this.storeUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.$store.dispatch("managedContracts/contracts/subscribe")}))},beforeDestroy(){this.storeUnsubscribe()},methods:{viewContract(e){this.$router.push(`managed-contracts/${e.id}`)}}},p8=u8,h8=(0,ew.Z)(p8,d8,c8,!1,null,"ddf08472",null),m8=h8.exports;const f8=()=>{const e=["digital-contracting/my-contracts","digital-contracting/open-calls"];return Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MANAGED_CONTRACTS)&&e.push("digital-contracting/managed-contracts"),e},g8=["digital-contracting/managed-contracts/partners","digital-contracting/managed-contracts/fields","digital-contracting/managed-contracts/files"],y8=async(e,t,i)=>{const{contractId:a}=e.params;await Lb.dispatch("managedContracts/contracts/subscribe"),Object.values(Lb.state.managedContracts.contracts.data).some((e=>e.id===a))?i():i({name:"digital-contracting/managed-contracts"})},v8=e=>{let t=b["default"].i18n.translate("Vertragsproduktion");const{contractId:i}=e.params;return Object.values(Lb.state.managedContracts.contracts.data).some((e=>e.id===i&&(t=e.name,!0))),t},b8={requiresAuth:!0,tabs:g8,label:v8,noMultiCompany:!0,featureControl:Hr.FEATURE_MANAGED_CONTRACTS,back:{to:{name:"digital-contracting/managed-contracts"},label:()=>
1b["default"].i18n.translate("Zurück zur Vertrags-Übersicht")}};var w8=[{path:`${M}digital-contracting/managed-contracts`,name:"digital-contracting/managed-contracts",component:m8,meta:{requiresAuth:!0,tabs:f8,label:()=>b["default"].i18n.translate("Vertragsproduktion"),labelTab:()=>b["default"].i18n.translate("Verwaltete Verträge"),noMultiCompany:!0,featureControl:Hr.FEATURE_MANAGED_CONTRACTS}},{path:`${M}digital-contracting/managed-contracts/:contractId`,redirect:`${M}digital-contracting/managed-contracts/:contractId/partners`},{path:`${M}digital-contracting/managed-contracts/:contractId/partners`,name:"digital-contracting/managed-contracts/partners",component:l8,beforeEnter:y8,meta:{...b8,labelTab:()=>b["default"].i18n.translate("Partner")}},{path:`${M}digital-contracting/managed-contracts/:contractId/fields`,name:"digital-contracting/managed-contracts/fields",component:C1,beforeEnter:y8,meta:{...b8,labelTab:()=>b["default"].i18n.translate("Felder")}},{path:`${M}digital-contracting/managed-contracts/:contractId/files/upload`,name:"digital-contracting/managed-contracts/files/upload",component:L2,props:!0,meta:{...b8,label:()=>b["default"].i18n.translate("Datei-Import"),subheader:()=>b["default"].i18n.translate("Dateien hochladen und mit einem Link mit anderen teilen"),labelTab:()=>b["default"].i18n.translate("Dateien"),back:{to:{name:"digital-contracting/managed-contracts/files"},label:()=>b["default"].i18n.translate("Zurück zur Dateien-Übersicht")}}},{path:`${M}digital-contracting/managed-contracts/:contractId/fields/restore`,name:"digital-contracting/managed-contracts/fields/restore",component:$1,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder wiederherstellen"),subheader:()=>b["default"].i18n.translate("Felder wiederherstellen, die in den letzten 90 Tagen gelöscht wurden"),back:{to:{name:"digital-contracting/managed-contracts/fields"},label:()=>b["default"].i18n.translate("Zurück zur Vertragsansicht")},featureControl:Hr.FEATURE_MANAGED_CONTRACTS}},{path:`${M}digital-contracting/managed-contracts/:contractId/files`,name:"digital-contracting/managed-contracts/files",component:Y1,beforeEnter:y8,meta:{...b8,labelTab:()=>b["default"].i18n.translate("Dateien")}}];const C8=()=>{const e=["digital-contracting/my-contracts","digital-contracting/open-calls"];return Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MANAGED_CONTRACTS)&&e.push("digital-contracting/managed-contracts"),e},F8=async(e,t,i)=>{const a=Number(e.params.contractCompanyId);await Lb.dispatch("digitalContracting/subscribe"),Object.values(Lb.state.digitalContracting.data).some((e=>e.contractCompanyId===a))?i():i({name:"digital-contracting/my-contracts"})},A8=e=>{const t=Number(e.params.contractCompanyId);let i=null;return Object.values(Lb.state.digitalContracting.data).some((e=>
1e.contractCompanyId===t&&(i=e,!0))),null!=i&&1e3*i.periodEnd<new Date?["digital-contracting/view-contract","digital-contracting/import-contract"]:null},k8=e=>{let t=b["default"].i18n.translate("Flächenübermittlung");const i=Number(e.params.contractCompanyId);return Object.values(Lb.state.digitalContracting.data).some((e=>e.contractCompanyId===i&&(t=e.name,!0))),t};var S8=[...w8,{path:`${M}digital-contracting`,name:"digital-contracting",redirect:{name:"digital-contracting/my-contracts"},meta:{requiresAuth:!0,tabs:C8,label:()=>b["default"].i18n.translate("Vertragsproduktion"),noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/my-contracts`,name:"digital-contracting/my-contracts",component:o0,meta:{requiresAuth:!0,tabs:C8,label:()=>b["default"].i18n.translate("Vertragsproduktion"),labelTab:()=>b["default"].i18n.translate("Meine Verträge"),noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/view-contract/:contractCompanyId`,name:"digital-contracting/view-contract",component:E0,beforeEnter:F8,meta:{requiresAuth:!0,tabs:A8,label:k8,labelTab:()=>b["default"].i18n.translate("Gesendet"),noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/import-contract/:contractCompanyId`,name:"digital-contracting/import-contract",component:vQ,beforeEnter:F8,meta:{requiresAuth:!0,tabs:A8,label:k8,labelTab:()=>b["default"].i18n.translate("Empfangen"),noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/open-calls`,name:"digital-contracting/open-calls",component:h0,meta:{requiresAuth:!0,tabs:C8,label:()=>b["default"].i18n.translate("Vertragsproduktion"),labelTab:()=>b["default"].i18n.translate("Offene Verträge"),noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/contracting/:contractGuid`,name:"digital-contracting/contracting",component:pX,meta:{requiresAuth:!0,label(){let e=b["default"].i18n.translate("Flächen senden");return null!=Lb.state.digitalContracting.contracting&&(e=Lb.state.digitalContracting.contracting.name),e},noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/contracting-resend/:contractCompanyId`,name:"digital-contracting/contracting-resend",component:pX,props:{modeResend:!0},meta:{requiresAuth:!0,label(){let e=b["default"].i18n.translate("Erneut senden");return null!=Lb.state.digitalContracting.contracting&&(e=`${e} - ${Lb.state.digitalContracting.contracting.name}`),e},noMultiCompany:!0,featureControl:Hr.FEATURE_DIGITAL_CONTRACTING}},{path:`${M}digital-contracting/contractFiles/:fileId`,name:"digital-contracting/contractFiles",component:T0,meta:{isFullscreen:!0}}],E8=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[e.editMode?e._e():t("Button",{staticClass:"mr-3",attrs:{icon:"plus-circle","leading-icon":"","component-namespace-name":"ButtonAddFieldGroup",disabled:e.fieldsReadOnly},on:{click:e.create}},[e._v(" "+e._s(e.$t("Feldstück hinzufügen"))+" ")]),e.showArchived&&!e.editMode?t("Button",{attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonToggleFieldGroupsArchive",icon:["far","eye-slash"],title:e.showArchived?e.$t("Archivierte ausblenden"):e.$t("Archivierte einblenden"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.toggleArchive}}):e._e(),e.editMode?t("ButtonDropdown",{attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.selectedRows=[]}}}):e._e(),e.editMode?t("Button",{staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteFieldGroups",disabled:e.fieldsReadOnly,title:e.$t("Löschen"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:()=>e.$refs.table.removeSelectedEntries()}}
1):e._e(),e.showArchived&&e.editMode?t("Button",{attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonFieldGroupsEditArchived",disabled:e.fieldsReadOnly,icon:["far","archive"],title:e.$t("Archiv editieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){e.modalEditFieldGroupArchivedVisible=!0}}}):e._e(),e.editMode?t("Button",{attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportFieldGroups",disabled:e.exportDisabled,title:e.$t("Auswahl exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:function(t){return e.$refs.table.$refs.table.export(e.selectedRows)}}}):e._e()]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("CompanySwitch",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!i}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{"restore-label":e.$t("Feldstücke wiederherstellen"),"restore-read-only":e.fieldsReadOnly,"export-disabled":e.exportDisabled},on:{restore:function(t){return e.$router.push({name:"field-groups/restore"})},settings:e.showSettings,export:e.exportData},scopedSlots:e._u([{key:"additional-options",fn:function(){return[t("BDropdownItemButton",{staticClass:"text-black",attrs:{"button-class":"dropdown-page-options__button"},on:{click:e.toggleArchive}},[t("FontAwesomeIcon",{staticClass:"dropdown-page-options__button-icon",attrs:{icon:e.showArchived?["far","eye-slash"]:["far","eye"]}}),e._v(" "+e._s(e.showArchived?e.$t("Archivierte ausblenden"):e.$t("Archivierte einblenden"))+" ")],1)]},proxy:!0}],null,!0)})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldGroupsContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows,"show-archived":e.showArchived,"remove-row-confirm-message":e.removeRowConfirmMessage},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"click:archived":e.onClickArchived}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),t("ModalTableExport",{ref:"modalTableExport",attrs:{availableTypes:null,filtered:null!=e.$refs.table&&!e.$refs.table.allVisible}}),e.modalEditFieldGroupArchivedVisible?t("ModalEditFieldGroupArchived",{attrs:{"field-group-ids":e.selectedRows},on:{success:function(t){e.selectedRows=[]}},model:{value:e.modalEditFieldGroupArchivedVisible,callback:function(t){e.modalEditFieldGroupArchivedVisible=t},expression:"modalEditFieldGroupArchivedVisible"}}):e._e(),null!=e.fieldGroupArchivedTarget?t("PopoverFieldGroupArchived",{attrs:{"field-group":e.fieldGroupArchivedFieldGroup,target:e.fieldGroupArchivedTarget},on:{close:function(t){e.fieldGroupArchivedTarget=null}}}):e._e()]},proxy:!0}])})},I8=[],_8=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"md","body-class":"modal-edit-field-group-archived",visible:e.visible,title:e.$t("Archiviert")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[e.success?t("div",[e.archived?t("p",[e._v(" "+e._s(e.$t("Die gewählten Feldstücke wurden erfolgreich archiviert."))+" ")]):t("p",[e._v(" "+e._s(e.$t("Die gewählten Feldstücke wurden wieder aktiviert."))+" ")])]):e.error?t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}):t("div",[t("FormFieldRadioGroup",{staticClass:"m-0",attrs:{variant:"no-label",stacked:""},model:{value:e.archived,callback:function(t){e.archived=t},expression:"archived"}},[t("FormRadio",{staticClass:"text-primary",attrs:{variant:"bordered",value:0,disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Aktiv")))])]},proxy:!0}])}),t("FormRadio",{attrs:{variant:"bordered",value:1,disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Archiviert")))])]},proxy:!0}])})],1)],1)]},proxy:!0},{key:"buttons",fn:function(){return[t("Button",{attrs:{"component-namespace-name":"ButtonOk",title:e.okBtnLabel,disabled:e.okDisabled,fetching:e.fetching},on:{click:e.save}}),e.success||e.error?e._e():t("Button",{attrs:{variant:"white","component-namespace-name":"ButtonOk",disabled:e.fetching,title:e.$t("Abbrechen")},on:{click:e.hide}})]},proxy:!0}])})},D8=[],M8={name:"ModalEditFieldGroupArchived",components:{ErrorUserMessage:cH,FormFieldRadioGroup:_T,FormRadio:kT,ModalWrapper:OC,Button:gw},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldGroupIds:{type:Array,required:!0}},data(){return{archived:null,fetching:!1,success:!1,error:!1,userErrorMessage:null}},computed:{...(0,C.Se)({fieldGroups:"fieldGroups/data",fieldGroupErrors:"fieldGroups/errors"}),okDisabled(){return!this.success&&!this.error&&null==this.archived},okBtnLabel(){return this.success||this.error?this.$t("Schließen"):null==this.archived?this.$t("Speichern"):this.archived?this.$t("Archivieren"):this.$t("Aktivieren")}},methods:{async save(){this.success||this.error?this.hide():null!=this.archived&&(this.fetching=!0,await new Promise((e=>setTimeout(e,100))),await Promise.all(this.fieldGroupIds.map((async e=>{const t={...this.fieldGroups[e],archived:Number(this.archived)};await this.$store.dispatch("fieldGroups/updateAndSyncEntry",{entry:t})}))),this.fetching=!1,this.fieldGroupErrors.some((({guid:e,errorUserMessage:t})=>!!this.fieldGroupIds.includes(e)&&(this.userErrorMessage=t,!0)))?this.error=!0:this.success=!0)},hide(){this.success&&this.$emit("success"),this.$refs.modalWrapper.hide()}}},P8=M8,T8=(0,ew.Z)(P8,_8,D8,!1,null,"2c032d97",null),x8=T8.exports,B8=function(){var e=this,t=e._self._c;return t("BPopover",{ref:"popover",attrs:{show:"",placement:"bottom","custom-class":"popover-field-group-archived shadow",target:e.target}},[t("h3",{staticClass:"popover-field-group-archived__title"},[e._v(" "+e._s(e.$t("Archiviert"))+" ")]),t("div",{staticClass:"popover-field-group-archived__body"},[t("FormFieldRadioGroup",{staticClass:"m-0",attrs:{variant:"no-label",stacked:""},on:{change:t=>e.save(t)},model:{value:e.archived,callback:function(t){e.archived=t},expression:"archived"}},[t("FormRadio",{staticClass:"text-primary",attrs:{variant:"bordered",value:0,disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Aktiv")))])]},proxy:!0}])}),t("FormRadio",{attrs:{variant:"bordered",value:1,disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(e.$t("Archiviert")))])]},proxy:!0}])})],1)],1)])},O8=[];const{bind:$8,unbind:R8}=v().directive;var N8={name:"PopoverFieldGroupArchived",components:{FormFieldRadioGroup:_T,FormRadio:kT},props:{target:{type:HTMLElement,required:!0},fieldGroup:{type:Object,required:!0}},data(){return{archived:this.fieldGroup.archived,popover:null,fetching:!1}},async mounted(){await this.$nextTick(),this.popover=this.$refs.popover.$el,null!=this.popover&&$8(this.popover,{value:this.onClickOutside}),document.addEventListener("keydown",this.onKeyDown)},beforeDestroy(){null!=this.popover&&R8(this.popover),document.removeEventListener("keydown",this.onKeyDown)},methods:{onKeyDown(e){"Escape"===e.key&&this.$emit("close")},onClickOutside(){this.$emit("close")},async save(e){if(this.error)return void this.$emit("close");this.fetching=!0,await new Promise((e=>setTimeout(e,100)));const t={...this.fieldGroup,archived:Number(e)};await this.$store.dispatch("fieldGroups/updateAndSyncEntry",{entry:t}),this.fetching=!1,this.$emit("close")}}},z8=N8,L8=(0,ew.Z)(z8,B8,O8,!1,null,"7072b5dc",null),V8=L8.exports,U8=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{"context-menu":"","context-menu-hide-edit":"","hover-buttons":"","hover-buttons-no-main-button":"",id:e.id,cells:e.columnDropdownCompaniesCells,"filter-string":e.filterString,"
1selected-rows":e.selectedRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors,"read-only":e.fieldsReadOnly},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:cell":e.updateEntryByKeyAndValue,"create:newRow":e.insertAndSyncNewEntry,"remove:row":t=>e.removeEntries([t]),reload:e.loadData,edit:t=>e.$emit("edit",t),"click:archived":t=>e.$emit("click:archived",t),afterScrollVertically:function(t){return e.$emit("click:archived")},afterScrollHorizontally:function(t){return e.$emit("click:archived")}},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])})},j8=[];function H8(e){null!=e.currentTarget&&e.currentTarget instanceof HTMLElement&&null!=e.currentTarget.querySelector("button")&&e.currentTarget.querySelector("button").click()}function G8(e,t,i,a,n,r,s,...o){[...t.childNodes].forEach((e=>{e instanceof HTMLElement&&e.matches("button.hot-btn-field-group-archived")||t.removeChild(e)}));const l=s.getStatusReadOnly(i);let d=t.querySelector(".hot-btn-field-group-archived");null==d&&(d=document.createElement("button")),d.innerHTML="",d.className="",d.innerText=s.getDisplayValue(r),d.className="hot-btn-field-group-archived",r?d.classList.add("hot-btn-field-group-archived--archived"):d.classList.add("hot-btn-field-group-archived--active"),t.removeEventListener("dblclick",H8),t.addEventListener("dblclick",H8),d.onclick=()=>{l||"function"===typeof s.onClick&&s.onClick({target:d,visualRow:i})},d.onmousedown=e=>{e.stopPropagation()},t.append(d),l&&(d.disabled=!0,d.classList.add("hot-btn-field-group-archived--read-only")),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o])}Bu.Z.cellTypes.registerCellType("fieldGroupArchived",{renderer:G8});const W8={...uF,key:fu},Z8={key:gu,header:{title:()=>b["default"].i18n.translate("FSNr"),description:()=>b["default"].i18n.translate("Feldstück-Nummer")},type:"text",width:70},K8={key:yu,header:{title:()=>b["default"].i18n.translate("Kunde")},type:"dropdown",width:170},q8={key:vu,header:{title:()=>b["default"].i18n.translate("Bezeichnung"),description:()=>b["default"].i18n.translate("Feldstück")},type:"text",className:"border-right text-bold",width:270},Y8={key:bu,header:{title:()=>b["default"].i18n.translate("Größe"),description:()=>b["default"].i18n.translate("ha")},type:"numeric",width:100},J8={key:wu,header:{title:()=>b["default"].i18n.translate("Archiviert")},type:"fieldGroupArchived",onClick({target:e,visualRow:t}){const i=this.visualRowToGuid(t);this.$emit(`click:${wu}`,{target:e,id:i})},getStatusReadOnly(){return this.$parent.processOrdersReadOnly||this.$parent.fieldsReadOnly},width:130},X8={key:Cu,header:{title:()=>b["default"].i18n.translate("Beschreibung")},type:"text",width:350};var Q8=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...W8,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...Z8,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...K8,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...K8,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},q8,Y8,J8,X8,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],e6={name:"TableFieldGroupsContainer",components:{TableFooter:hD,TableBase:oD},props:{showArchived:{type:Boolean,required:!0}},mixins:[gD,mD("fieldGroups"),fD("fieldGroups"),rI(W8.key),sI({[K8.key]:"customer"}),oI],computed:{loading(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)?this.$store.getters["fieldGroups/loading"]||this.$store.getters["customers/loading"]:this.$store.getters["fieldGroups/loading"]},id(){return["hot-field-groups",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},tableData(){return this.showArchived?this.$store.state.fieldGroups.data:Object.values(this.$store.state.fieldGroups.data).reduce(((e,t)=>t.archived?e:{...e,[t.id]:t}),{})},fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)}},created(){this.updateColumnDefinition()},watch:{showArchived(){this.updateColumnDefinition()}},methods:{updateColumnDefinition(){this.showArchived?this.columnDefinition=Q8:this.columnDefinition=Q8.filter((e=>e.key!==wu))},loadAdditionalData(){this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.dispatch("customers/subscribe")},export(){this.$refs.table.export()}}},t6=e6,i6=(0,ew.Z)(t6,U8,j8,!1,null,"2f633d2b",null),a6=i6.exports;ow.vI.add(uw.UJf,uw.KtF,uw.KN3,uw.I7k,lw.N2j,lw.Mdf,lw.Aq);var n6={name:"PageFieldGroups",components:{PopoverFieldGroupArchived:V8,ModalEditFieldGroupArchived:x8,ModalTableExport:_$,DropdownPageOptions:YL,TableFieldGroupsContainer:a6,TheContentbar:HL,ThePageSkeleton:$w,CompanySwitch:qw,SearchBar:YE,ModalPageSettings:HE,Button:gw,ButtonDropdown:mV},mixins:[D$("table")],data(){return this.$store.commit("fieldGroups/setAddArchived",!1),{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null,showArchived:!1,modalEditFieldGroupArchivedVisible:!1,fieldGroupArchivedTarget:null,fieldGroupArchivedFieldGroup:null}},computed:{...(0,C.Se)({fieldGroups:"fieldGroups/data"}),editMode(){return this.selectedRows.length>0},fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)},exportDisabled(){return!this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EXPORT_FIELD)}},methods:{removeRowConfirmMessage(e){const t=[];if(1===e.length){const[{name:i}]=e;"string"===typeof i&&i.length>0?t.push(this.$t("Willst du wirklich {name} löschen?",{name:i})):t.push(this.$t("Willst du wirklich das gewählte Feldstück löschen?"))}else t.push(this.$t("Willst du wirklich {count} Feldstücke löschen?",{count:e.length}));return t.push(this.$t("Du löschst damit auch alle zugehörigen Felder in allen Erntejahren.")),t.join(" ")},create(){this.$refs.table.$refs.table.insert({visualRow:0})},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},async exportData(){let e=!0,t=!0;if(this.$refs.table.allVisible||({exportFiltered:e,okay:t}=await this.$refs.modalTableExport.show()),!t)return;let i=[];i=e?this.$refs.table.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),this.$refs.table.$refs.table.export(i)},toggleArchive(){this.showArchived=!this.showArchived,this.showArchived&&this.$store.dispatch("fieldGroups/addArchived"),this.$refs.table.loadData()},async onClickArchived(e){if(null==e)return this.fieldGroupArchivedTarget=null,void(this.fieldGroupArchivedFieldGroup=null);const{target:t,id:i}=e;if(this.fieldGroupArchivedTarget===t)return this.fieldGroupArchivedTarget=null,void(this.fieldGroupArchivedFieldGroup=null);this.fieldGroupArchivedTarget=null,this.fieldGroupArchivedFieldGroup=null,null!=this.fieldGroups[i]&&(await this.$nextTick(),this.fieldGroupArchivedTarget=t,this.fieldGroupArchivedFieldGroup=this.fieldGroups[i])},onResize(){this.fieldGroupArchivedTarget=null,this.fieldGroupArchivedFieldGroup=null}}},r6=n6,s6=(0,ew.Z)(r6,E8,I8,!1,null,"3e3c3fb4",null),o6=s6.exports,l6=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":!e.fieldsReadOnly},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"mr-1",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("BButton",{staticClass:"text-dark mr-1 px-4",attrs:{variant:"lightest"},on:{click:e.back}},[e._v(" "+e._s(e.$t("Schließen"))+" ")]),t("BButton",{staticClass:"mr-1 px-4",attrs:{variant:"primary",fetching:e.restoring,disabled:e.fieldsReadOnly},on:{click:e.restore}},[e._v(" "+e._s(e.$t("Wiederherstellen"))+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldsRestoreContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}})]},proxy:!0}])})},d6=[],c6=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{"disable-read-only-bg":"","read-only":"",id:e.id,"filter-string":e.filterString,"
1selected-rows":e.selectedRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":e.tableData.length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])})},u6=[],p6=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...W8,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...Z8,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,sortOrder:"asc"},{...K8,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...K8,hiddenPerDefault:!0,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...q8,readOnly:!0},{...Y8,readOnly:!0},{...X8,readOnly:!0}];const h6=e=>null!=e?btoa(JSON.stringify(e)):"";var m6={name:"TableFieldGroupsRestoreContainer",components:{TableFooter:hD,TableBase:oD},props:{filterString:{type:String,default:""},selectedRows:{type:Array,default:null}},mixins:[gD,E1,rI(W8.key),sI({[K8.key]:"customer"}),oI],data(){return{columnDefinition:p6}},computed:{id(){return["hot-field-groups-restore",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")}},mounted(){this.loadData()},methods:{loadData(){this.$store.commit("fieldGroups/setAddArchived",!0);const e=g()().startOf("day").subtract({days:90}),t=[...hu({state:this.$store.state.fieldGroups,rootState:this.$store.state}),["deleted",">=",Math.round(e/1e3)]];this.loadTableData(`/admin/rest/fieldGroup?showDeleted=1&disablePagination=1&filter=${h6(t)}`)},async restore(){const e=[...this.selectedRows];try{await Promise.all([...new Array(Math.ceil(e.length/50)).keys()].map((t=>{const i=50*t,a=50*(t+1),n=["id","IN",e.slice(i,a)];return l().put(`/admin/rest/fieldGroup/undelete/?filter=${h6(n)}`)}))),await this.$store.dispatch("fieldGroups/reset"),await this.$store.dispatch("fieldGroups/subscribe"),await this.$store.dispatch("fieldGroups/recentlyRestoredSetByGuids",e)}catch(t){return console.error(t),this.addErrorsAfterRestore(e),!1}return!0},addErrorsAfterRestore(e){this.tableErrors=[...this.tableErrors,...e.map((e=>({type:J,guid:e,key:null,errorUserMessage:this.$t("Feldstück konnte nicht wieder hergestellt werden.")})))]}}},f6=m6,g6=(0,ew.Z)(f6,c6,u6,!1,null,"00034ed8",null),y6=g6.exports,v6={name:"PageFieldGroupsRestore",components:{TheContentbar:HL,ThePageSkeleton:$w,SearchBar:YE,TableFieldsRestoreContainer:y6},data(){return{filterString:"",selectedRows:[],visibleRows:[],restoring:!1}},computed:{fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)}},methods:{back(){this.$router.push({name:"field-groups"})},async restore(){this.restoring=!0;const e=await this.$refs.table.restore();this.restoring=!1,e&&this.back()}}},b6=v6,w6=(0,ew.Z)(b6,l6,d6,!1,null,"debfc29c",null),C6=w6.exports;const F6=()=>{const e=["field-groups","fields"];return Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CROP_ROTATION)&&e.push("crop-rotation"),Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_SOIL_SAMPLES)&&e.push("soil-samples"),e};var A6=[{path:`${M}field-groups`,name:"field-groups",component:o6,meta:{requiresAuth:!0,tabs:F6,label:()=>b["default"].i18n.translate("Feldstücke"),featureControl:Hr.FEATURE_FIELDS},async beforeEnter(e,t,i){null!=t&&"string"===typeof t.name&&0!==t.name.indexOf("field-groups")&&await Lb.dispatch("fieldGroups/reset"),i()}},{path:`${M}field-groups/restore`,name:"field-groups/restore",component:C6,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Feldstücke wiederherstellen"),subheader:()=>b["default"].i18n.translate("Feldstücke wiederherstellen, die in den letzten 90 Tagen gelöscht wurden"),back:{to:{name:"field-groups"},label:()=>b["default"].i18n.translate("Zurück zur Feldstücke-Startseite")},featureControl:Hr.FEATURE_FIELDS}}],k6=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{"page-feature-title":i.router.currentRoute.meta?.label,"page-feature-enabled":i.currentCompaniesHaveFeature.enabled,"page-feature-visible":i.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t(i.TheContentbar,{scopedSlots:e._u([{key:"left",fn:function(){return[t(i.ButtonDropdown,{directives:[{name:"show",rawName:"v-show",value:i.selectedActivityIds.length>0,expression:"selectedActivityIds.length > 0"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:i.$t("Auswahl aufheben")??"",buttons:i.buttonUpdateSelection},on:{click:()=>i.sidebarActivities.$refs.tableContainer.$refs.table.selectAllVisible(!1)}})]},proxy:!0},{key:"right",fn:function({contentbarLarge:e}){return[t(i.ProcessOrderSwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.CompanySwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.DropdownPageOptions,{directives:[{name:"show",rawName:"v-show",value:0===i.selectedActivityIds.length,expression:"selectedActivityIds.length === 0"}],staticClass:"ml-4",attrs:{hideRestore:!0,hideExport:!0},on:{settings:i.onShowSettings}})]}}])})]},proxy:!0},{key:"sidebar",fn:function(){return[t(i.SidebarActivities,{ref:"sidebarActivities"})]},proxy:!0},{key:"content",fn:function(){return[t(i.ModalPageSettingsContainer,{ref:"modalPageSettings"}),i.loading?t("div",{staticClass:"w-100 h-100 d-flex"},[t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1):[i.mapFeatureEnabled?t(i.ActivitiesMapContainer,{attrs:{fields:i.fields,varieties:i.varieties,crops:i.crops,activities:i.activities,activityTypes:i.activityTypes}}):t("div",{staticClass:"feature-not-enabled"},[t(i.FeatureNotAvailable,{attrs:{featureName:i.$t("Karte")??"",featureVisible:i.mapFeatureVisible,addLinkToShop:!0}})],1)]]},proxy:!0}])})},S6=[],E6=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"sidebar-activities bg-white border-dark"}
1,[t("div",{staticClass:"sidebar-activities__content-area"},[t(i.SidebarHeadline,{attrs:{text:e.headline||""}}),i.props.description?t("p",{staticClass:"sidebar-activities__description"},[e._v(e._s(i.props.description))]):e._e(),t(i.SearchBar,{attrs:{type:"aside",searchFilter:i.filterString},on:{"update:searchFilter":function(e){i.filterString=e},"update:search-filter":function(e){i.filterString=e}}}),t(i.ActivityTypeFilters,{attrs:{activeFilters:i.activeFilters,activityTypes:i.sortedActivityTypes},on:{"update:filter":i.onBadgeFilter}}),t(i.TableActivitiesContainer,{ref:"tableContainer",attrs:{tableId:"table-activities-map",columns:i.columns,filterString:i.filterString,id:"activities-table-container"},on:{"update:filterString":function(e){i.filterString=e},"update:filter-string":function(e){i.filterString=e}}})],1)])},I6=[],_6=i(58254),D6=i.n(_6),M6=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.SidebarFilterBadgesContainer,{attrs:{allFilters:i.props.activityTypes,activeFilters:e.activeFilters,emptyFilterLabel:e.$t("Keine Tätigkeit")},on:{"update:filter":t=>e.$emit("update:filter",t)}})},P6=[],T6=(0,b.defineComponent)({__name:"ActivityTypeFilters",props:{activityTypes:null,activeFilters:null},setup(e){const t=e;return{__sfc:!0,props:t,SidebarFilterBadgesContainer:GD}}}),x6=T6,B6=(0,ew.Z)(x6,M6,P6,!1,null,null,null),O6=B6.exports;const $6={...zO,readOnly:!0};var R6=$6;const N6={...qO,readOnly:!0};var z6=N6;const L6=[{...JO,readOnly:!0},{...XO,readOnly:!1},{...e$,readOnly:!0},{...t$,readOnly:!0},{...i$,readOnly:!0},{...a$,readOnly:!0},{...n$,readOnly:!0},z6,R6,{...SO,readOnly:!0},{...r$,readOnly:!0},{...f$,readOnly:!0},{...g$,readOnly:!0},{...y$,readOnly:!0},{...v$,readOnly:!0},{...b$,readOnly:!0},{...w$,readOnly:!0},{...QB,readOnly:!0}];var V6=L6,U6=(0,b.defineComponent)({__name:"SidebarActivities",props:{headline:null,description:null},setup(e){const t=e,i=Vb(),a="activityTypeDropdownItem",n=(0,b.ref)(""),r=(0,b.ref)(),s=(0,b.computed)((()=>l(i.state.activities.data))),o=(0,b.computed)((()=>r.value?.$refs.table?.filtersByColumnKey[a]?.selectedValues||[]));function l(e){const t=Object.values(e),a=new Set(t.map((e=>e.activityTypeId))),n=Th()(t,(e=>e.activityTypeId));return D6()([...a],(e=>n[e].length)).reverse().map((e=>i.state.activityTypes.data[e]?.displayName)).filter(ka)}function d(e){e?.selectedValues.length?r.value?.$refs.table.setFilterByColumnKey("activityTypeDropdownItem",e):r.value?.$refs.table?.clearAllFilters()}async function c(e){const t=e.map((e=>e.id)),a=e.map((e=>e.trackId)).filter(hH).filter(ka);await Promise.all([i.dispatch("activities/gpsTrack/refreshByIds",t),i.dispatch("activities/gpsLog/refreshByIds",t),i.dispatch("tracks/refreshByIds",a)])}return(0,b.watch)((()=>i.getters["activities/selectedActivities"]),(e=>c(e)),{deep:!0}),{__sfc:!0,store:i,targetColumn:a,props:t,filterString:n,tableContainer:r,sortedActivityTypes:s,activeFilters:o,sortAvailableTypes:l,onBadgeFilter:d,loadGpsDataForSelectedActivities:c,ActivityTypeFilters:O6,TableActivitiesContainer:OL,columns:V6,SearchBar:YE,SidebarHeadline:iI}}}),j6=U6,H6=(0,ew.Z)(j6,E6,I6,!1,null,"4fe102ec",null),G6=H6.exports,W6=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.FieldsMap,{attrs:{defaultFields:e.fields,varieties:e.varieties,crops:e.crops,activities:e.activities,activityTypes:e.activityTypes,showMenu:!0,showFieldMarkers:!1}})},Z6=[],K6=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{ref:"map-map",staticClass:"map"},[t("div",{ref:"map-container-container",staticClass:"map__map-container"},[t("div",{ref:"map-container",staticClass:"map__map-container"}),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showCaptureRegion,expression:"showCaptureRegion"}],ref:"capture-region",style:{position:"absolute",top:e.captureRegion.top+"px",left:e.captureRegion.left+"px",width:e.captureRegion.width+"px",height:e.captureRegion.height+"px",border:"4px dotted grey",pointerEvents:"none"}}),e.createReportActive?[t("ReportLegend",{attrs:{varieties:e.usedVarieties,crops:e.usedCrops,useCrops:e.fieldColor===e.FieldColor.CROP,initialLeft:e.captureRegion.left+5,initialTop:e.captureRegion.top+5}}),e._l(e.allFields,(function(i){return t("FieldNameLabel",{key:i.id,attrs:{map:e.map,"field-name":i.name,position:e.markersByFieldId[i.id].getPosition()}})}))]:e._e(),e.alwaysShowFieldNameTooltip&&!e.createReportActive?[e._l(e.defaultFields,(function(i){return[i!==e.hoveredField&&i!==e.tooltipField?t("MapFieldTooltip",{key:i.id,attrs:{field:i,map:e.map,marker:e.markersByFieldId[i.id],showFieldSize:!1,
1companies:e.companies,customers:e.customers,drawOnMarker:!0,colorTheme:e.createReportActive?"light":"dark"}}):e._e()]})),e._l(e.activeFields,(function(i){return[i!==e.hoveredField&&i!==e.tooltipField?t("MapFieldTooltip",{key:i.id,attrs:{field:i,map:e.map,marker:e.markersByFieldId[i.id],showFieldSize:!1,companies:e.companies,customers:e.customers,drawOnMarker:!0,colorTheme:e.createReportActive?"light":"dark"}}):e._e()]}))]:e._e(),e._l(e.geoObjects,(function(i){return[i.objectType===e.GeoObjectType.IsolationZone&&e.showIsolationZones&&e.mapObjectPolygonsById[i.id]?t("SimpleMapLabel",{key:i.id,attrs:{map:e.map,position:e.mapObjectPolygonsById[i.id]?.getPath().getAt(0),label:i.properties.name,objectType:i.objectType}}):e._e(),i.objectType===e.GeoObjectType.MultiplierGroup&&e.showMultiplierGroups&&e.mapObjectPolygonsById[i.id]?t("SimpleMapLabel",{key:i.id,attrs:{map:e.map,position:e.mapObjectPolygonsById[i.id].getPath().getAt(0),label:i.properties.name,objectType:i.objectType}}):e._e()]}))],2),null!=e.splitFieldPolyline?t("MapInfoBox",{staticClass:"map_info-box"},[t("h4",[e._v(e._s(e.$t("Originalgröße")))]),t("p",{staticClass:"text-small"},[e._v(e._s(e.splitFieldSizes.original))]),t("h4",[e._v(e._s(e.$t("Feld 1")))]),t("p",{staticClass:"text-small"},[e._v(e._s(e.splitFieldSizes.fieldA))]),t("h4",[e._v(e._s(e.$t("Feld 2")))]),t("p",{staticClass:"text-small mb-0"},[e._v(e._s(e.splitFieldSizes.fieldB))])]):e._e(),e.createFieldsActive&&null==e.splitFieldPolyline?t("MapInfoBox",{staticClass:"map_info-box"},[t("h4",[e._v(e._s(e.$t("Größe (in ha)")))]),t("p",{staticClass:"text-small"},[e._v(e._s(e.newFieldsSize.toFixed(4)))])]):e._e(),t("div",{staticClass:"map__address-search-wrapper"},[e.controls.includes("searchField")?t("FormFieldInput",{staticClass:"map__address-search",attrs:{variant:"no-label",state:!e.parcelSearchEmpyResult&&null,placeholder:e.searchByParcelNumberActive?e.$t("Parzellennummer suchen"):e.$t("Adresse suchen"),clearIcon:!0},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.mapAddressSearch.apply(null,arguments)}},model:{value:e.mapAddressSearchTerm,callback:function(t){e.mapAddressSearchTerm=t},expression:"mapAddressSearchTerm"}}):e._e(),e.isCadastreLayerActive?t("BButton",{staticClass:"map-address-search-toggle",attrs:{variant:"link",size:"sm"},on:{click:e.searchLinkButtonPressed}},[e._v(e._s(e.searchByParcelNumberActive?"Search by address":"Search by parcel number")+" ")]):e._e()],1),e.insertEnabled?t("SimpleTooltip",{directives:[{name:"show",rawName:"v-show",value:!e.hideCreateTooltip&&!e.fetchingNewFieldContour,expression:"!hideCreateTooltip && !fetchingNewFieldContour"}],attrs:{text:e.$t("Feldmitte markieren"),x:e.createTooltipX,y:e.createTooltipY}}):e._e(),e.fetchingNewFieldContour?t("div",{staticClass:"map__loader"},[t("FontAwesomeIcon",{staticClass:"map__loader-svg",style:{top:e.mapLoaderPosition.y,left:e.mapLoaderPosition.x},attrs:{icon:"circle-notch",spin:""}})],1):e._e(),e._l(e.editableFields,(function(i){return t("MapActions",{key:`map-actions--${i.id}`,attrs:{position:e.mapActionsPixelPosition(i),"show-save":!e.hideAllMapActions,"show-polygon":!e.hideAllMapActions&&null==e.polygonsByFieldId[i.id],"show-remove-polygon":!e.hideAllMapActions&&null!=e.polygonsByFieldId[i.id],"show-discard":!e.hideAllMapActions&&!e.hideMapActionsDiscard&&!e.editFieldsActive},on:{"action:save":function(t){return e.onPolygonSave(i)},"action:polygon":()=>e.onMapActionAddPolygon(i.id),"action:removePolygon":()=>e.$emit("action:removePolygon",i.id),"action:discard":()=>e.$emit("action:discard",i.id)}})})),null!=e.splitFieldDrawingModeMapActionsPosition&&null==e.splitFieldPolyline?t("MapActions",{attrs:{position:e.splitFieldDrawingModeMapActionsPosition,"show-save":"","show-polygon":!1,"title-save":e.$t("Trennlinie fertigstellen")},on:{"action:save":e.finishSplitDrawing,"action:discard":()=>e.updateSplitMode(!0)}}):e._e(),null!=e.splitFieldPolyline?t("MapActions",{attrs:{position:e.mapActionsSplitLinePosition(e.splitFieldPolyline),"show-save":e.splitFieldLineValid,"show-polygon":!1,"title-save":e.$t("Aufteilen"),"icon-save":["far","cut"]},on:{"action:save":()=>e.$emit("action:split"),"action:discard":()=>e.updateSplitMode(!0)}}
1):e._e(),null!=e.currentMeasurePolyline?t("MapActions",{attrs:{position:e.mapActionsSplitLinePosition(e.currentMeasurePolyline),showSave:!0,showPolygon:!1,titleSave:e.$t("Fertigstellen"),titleDiscard:e.$t("Löschen")},on:{"action:save":e.checkMeasurePolyline,"action:discard":e.deleteMeasurePolyline}}):e._e(),e.drawnPolylineActionsVisible&&null!=e.currentMapObjectPolygon?t("MapActions",{attrs:{position:e.mapActionsSplitLinePosition(e.currentMapObjectPolygon),showSave:!0,showPolygon:!1,titleSave:e.$t("Fertigstellen"),titleDiscard:e.$t("Löschen")},on:{"action:save":e.finishDrawnPolyline,"action:discard":e.deleteDrawnPolyline}}):e._e(),e._l(e.editableFields,(function(i){return t("MapFieldTooltip",{key:`fields-map__map-field-tooltip--${i.id}`,ref:`fields-map__map-field-tooltip--${i.id}`,refInFor:!0,attrs:{editable:"",field:i,map:e.map,marker:e.markersByFieldId[i.id],polygon:e.polygonsByFieldId[i.id],crops:e.crops,varieties:e.varieties,companies:e.companies,customers:e.customers},on:{"change:fieldName":t=>e.$emit("change:fieldName",{fieldId:i.id,name:t}),keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(()=>e.$emit("action:save",i.id)).apply(null,arguments)}}})})),e.showFieldTooltip?t("MapFieldTooltip",{key:e.fieldTooltipField.id,attrs:{field:e.fieldTooltipField,map:e.map,marker:e.markersByFieldId[e.fieldTooltipField.id],polygon:e.polygonsByFieldId[e.fieldTooltipField.id],crops:e.crops,varieties:e.varieties,companies:e.companies,customers:e.customers,activityType:e.findLastActivityTypeOfField(e.fieldTooltipField),colorTheme:e.createReportActive?"light":"dark",showDetailsLink:!0},nativeOn:{mouseover:function(t){return e.onTooltipMouseover.apply(null,arguments)},mouseleave:function(t){return e.onTooltipMouseout.apply(null,arguments)},focusout:function(t){return e.onTooltipMouseout.apply(null,arguments)},focusin:function(t){return e.onTooltipMouseover.apply(null,arguments)}}}):e._e(),e._l(e.distancePolylines,(function(i){return t("MapDistanceLabel",{key:i.get("timestamp"),attrs:{map:e.map,polyline:i}})})),e.fieldColor===e.FieldColor.VARIETY?[e._l(Object.values(e.polygonsByFieldId),(function(i){return e._l(e.filteredFields(i),(function(a){return t("HatchFieldOverlay",{key:a.id+i.get("fieldId")+1,attrs:{map:e.map,path:e.polygonsByFieldId[a.id].getPaths(),primaryColor:e.varieties[a.varietyId]?.mapPrimaryColor??void 0,secondaryColor:e.varieties[a.varietyId]?.mapSecondaryColor??void 0,hatch:e.varieties[a.varietyId]?.mapHatchStyle??void 0}})}))}))]:e._e(),e._l(e.visibleTracks,(function(i){return[t("GoogleMapsCircle",{key:`C1${i.id}`,attrs:{map:e.map,center:e.firstPointIn(i),radius:e.drawing.tracks.start_circle.radius,fillColor:e.drawing.tracks.start_circle.fill.color,fillOpacity:e.drawing.tracks.start_circle.fill.opacity,strokeWeight:e.drawing.tracks.start_circle.outline.width,strokeColor:e.drawing.tracks.start_circle.outline.color,strokeOpacity:e.drawing.tracks.start_circle.outline.opacity,visible:!0,zIndex:1e3}}),e._l(i.coordinates,(function(a,n){return[t("GoogleMapsLine",{key:`L${i.id}.${n}-tracks`,attrs:{map:e.map,path:e.toGoogleMapsPath(a),strokeColor:e.drawing.tracks.stroke.color,strokeOpacity:e.drawing.tracks.stroke.opacity,strokeWeight:e.drawing.tracks.stroke.width,visible:!0,zIndex:998}})]})),t("GoogleMapsCircle",{key:`C2${i.id}-tracks`,attrs:{map:e.map,center:e.lastPointIn(i),radius:e.drawing.tracks.end_circle.radius,fillColor:e.drawing.tracks.end_circle.fill.color,fillOpacity:e.drawing.tracks.end_circle.fill.opacity,strokeWeight:e.drawing.tracks.end_circle.outline.width,strokeColor:e.drawing.tracks.end_circle.outline.color,strokeOpacity:e.drawing.tracks.end_circle.outline.opacity,visible:!0,zIndex:1e3}})]})),e._l(e.visibleActivities,(function(i){return[e._l(i.coordinates,(function(a,n){return[t("GoogleMapsLine",{key:`L${i.id}.${n}`,attrs:{map:e.map,path:e.toGoogleMapsPath(a),strokeColor:e.drawing.activities.stroke.color,strokeOpacity:e.drawing.activities.stroke.opacity,strokeWeight:e.drawing.activities.stroke.width,visible:!0,zIndex:999}})]}))]})),e.showTimestamps?[e._l(e.visibleTimestamps,(function(i){return[e._l(i.features,(function(a,n){return[t("GoogleMapsLabel",{key:`LA${i.id}.${n}-timestamps`,attrs:{map:e.map,position:e.toGoogleMapsPoint(a.geometry.coordinates),skewed:!0,label:e.formatTime(e.toDate(a.properties.time)),fillColor:e.inferP
1illFillColor(n,i.features),textColor:e.inferPillTextColor(n,i.features),textOutlineColor:e.inferPillTextOutline(n,i.features),fontWeight:"bold",zIndex:1e3,visible:!0}}),t("GoogleMapsCircle",{key:`C${i.id}.${n}-timestamps`,attrs:{map:e.map,center:e.toGoogleMapsPoint(a.geometry.coordinates),radius:e.drawing.timestamps.circle.radius,fillColor:e.drawing.timestamps.circle.fill.color,fillOpacity:e.drawing.timestamps.circle.fill.opacity,strokeWeight:e.drawing.timestamps.circle.outline.width,strokeColor:e.drawing.timestamps.circle.outline.color,strokeOpacity:e.drawing.timestamps.circle.outline.opacity,visible:!0,zIndex:1e3}})]}))]}))]:e._e(),e.showMenu?t("div",{staticClass:"map-menu-container"},[t("MapMenu",{attrs:{featureFieldsNDVIMeanEnabled:e.featureFieldsNDVIMeanEnabled,featureLandCadastresEnabled:e.featureLandCadastresEnabled,featureGISObjectsEnabled:e.featureGISObjectsEnabled},on:{onFieldColorChanged:e.onFieldColorChanged,onActiveLayersChanged:e.onActiveLayersChanged,alwaysShowFieldName:e.alwaysShowFieldNameChanged,showTimestamps:t=>e.showTimestamps=t,onMenuItemClicked:e.onMenuItemClicked}}),e.createFieldsActive||e.createMapObjectActive?e._e():t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"measureDistances",icon:["fal","ruler-horizontal"],active:e.measureDistancesActive,tooltip:e.$t("Messen von Strecken")},on:{"button:pressed":t=>e.measureDistancesActive=!t}}),e.showIsolationZones?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"subLayerModal",icon:["fa-regular","layer-group"],active:e.showSubLayerActive,tooltip:e.$t("Unterebenen")},on:{"button:pressed":()=>e.mapObjectsSubTypeModalVisible=!0}}):e._e()],1):e._e(),t("div",{staticClass:"map-utility-button-container"},[e.createFieldsActive||e.createMapObjectActive?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"drawPolyline",icon:["far","slash-forward"],active:e.drawPolylineMapObjectsActive,tooltip:e.$t("Zeichnen einer Polyline"),disabled:null!=e.currentMapObjectPolygon},on:{"button:pressed":()=>{e.drawMapObjectsActive=!1,e.drawPolylineMapObjectsActive=!e.drawPolylineMapObjectsActive}}}):e._e(),e.createFieldsActive||e.createMapObjectActive?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"drawPolygon",icon:["far","draw-polygon"],active:e.drawPolygonActive||e.drawMapObjectsActive,tooltip:e.$t("Zeichnen eines Polygons"),disabled:e.createMapObjectActive&&null!=e.currentMapObjectPolygon},on:{"button:pressed":e.drawPolygonUtilityButtonClicked}}):e._e(),e.createFieldsActive?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"mergePolygons",icon:["fasl","object-group"],active:e.mergePolygonsActive,disabled:e.newFields.length<2,tooltip:e.newFields.length<2?e.$t("Um Polygone kombinieren zu können, m
1üssen Sie mindestens 2 Polygone ausgewählt haben."):e.$t("Zusammenführen von Polygonen")},on:{"button:pressed":function(t){e.mergePolygonsModalVisible=!0}}}):e._e(),e.createFieldsActive?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"splitPolygons",icon:["fas","crop"],active:e.splitFieldEnabled,disabled:!e.createFieldsSplitEnabled,tooltip:e.createFieldsSplitEnabled?e.$t("Aufteilen eines Polygons"):e.$t("Felder teilen ist nur für Einzelpolygone möglich")},on:{"button:pressed":e.splitPolygonPressed}}):e._e(),e.createFieldsActive||e.createMapObjectActive?t("MapUtilityButton",{staticClass:"utility-button",attrs:{id:"measureDistances",icon:["fal","ruler-horizontal"],active:e.measureDistancesActive,tooltip:e.$t("Messen von Strecken")},on:{"button:pressed":t=>e.measureDistancesActive=!t}}):e._e()],1),e.drawPolygonActive?t("MapOverlayButton",{staticClass:"map-overlay-button",attrs:{text:e.$t("Zeichnen beenden"),icon:["far","xmark"],type:"default"},on:{click:function(t){e.drawPolygonActive=!1}}}):e._e(),e.splitFieldEnabled?t("MapOverlayButton",{staticClass:"map-overlay-button",attrs:{text:e.$t("Aufteilen beenden"),icon:["far","xmark"],type:"default"},on:{click:function(t){return e.splitPolygonPressed(!0)}}}):e._e(),e.measureDistancesActive?t("MapOverlayButton",{staticClass:"map-overlay-button",attrs:{text:e.$t("Messen beenden"),icon:["far","xmark"],type:"default"},on:{click:function(t){e.measureDistancesActive=!1}}}):e._e(),e.showSaveAndCancelOverlayButtons?t("div",{staticClass:"create-fields-overlay-buttons"},[t("MapOverlayButton",{directives:[{name:"show",rawName:"v-show",value:Object.values(e.newFields).length>0&&e.createFieldsActive&&e.invalidNewFields.length<=0||e.createMapObjectActive||e.editMapObjectActive||e.editFieldsActive&&e.invalidEditFields.length<=0,expression:"\n        (Object.values(newFields).length > 0 && createFieldsActive && invalidNewFields.length <= 0) ||\n        createMapObjectActive ||\n        editMapObjectActive ||\n        (editFieldsActive && invalidEditFields.length <= 0)\n      "}],attrs:{text:e.$t("Speichern"),icon:["fal","circle-check"],iconSize:"lg",type:"success"},on:{click:e.saveOverlayButtonClicked}}),t("MapOverlayButton",{attrs:{text:e.$t("Abbrechen"),icon:["far","xmark"],type:"default"},on:{click:e.cancelOverlayButtonClicked}})],1):e._e(),e.checkDistanceActive?[e._l(e.bufferFields,(function(i){return t("GoogleMapsLine",{key:JSON.stringify(i.getArray()),attrs:{map:e.map,path:i,geodesic:!0,visible:!0,strokeColor:e.drawing.distance.stroke.color,strokeOpacity:e.drawing.distance.stroke.opacity,strokeWeight:e.drawing.distance.stroke.width,strokeStyle:e.drawing.distance.stroke.style}})})),e._l(e.fieldsToWarn,(function(i){return t("GoogleMapsLine",{key:JSON.stringify(i.getArray()),attrs:{path:i,map:e.map,geodesic:!0,visible:!0,strokeColor:e.drawing.fields.stroke.color,strokeOpacity:e.drawing.fields.stroke.opacity,strokeWeight:e.drawing.fields.stroke.width,strokeStyle:e.drawing.fields.stroke.style}})}))]:e._e(),t("ModalConfirm",{attrs:{visible:e.mergePolygonsModalVisible},on:{combine:function(t){return e.$emit("combine:polygons")},change:t=>e.mergePolygonsModalVisible=t}}),t("ModalMapObjectsSubType",{attrs:{visible:e.mapObjectsSubTypeModalVisible,title:e.$t("Anzeige der Unterebenen von Isolationszonen")??"",hideableSubLayers:e.mapObjectsSubTypes},on:{change:t=>e.mapObjectsSubTypeModalVisible=t,ok:e.onMapObjectSubTypesVisibilityChanged}})],2)},q6=[],Y6=i(51256),J6=i(61120),X6=i.n(J6),Q6=i(84730),e3=i(98897),t3=i.n(e3),i3=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div")},a3=[],n3=(0,b.defineComponent)({__name:"GoogleMapsCircle",props:{map:null,center:null,fillColor:{default:"#FFFFFF"},fillOpacity:{default:1},strokeColor:{default:"#555555"},strokeOpacity:{default:1},strokeWeight:{default:2},radius:{default:10},visible:{type:Boolean,default:!0},zIndex:{default:10}},setup(e){const t=e,i=(0,b.reactive)(new google.maps.Circle({map:t.map,center:t.center,fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,radius:t.radius,visible:t.visible,zIndex:t.zIndex}));return(0,b.onUnmounted)((()=>{i.setMap(null)})),{__sfc:!0,props:t,circle:i}}}),r3=n3,s3=(0,ew.Z)(r3,i3,a3,!1,null,"f5fc439c",null),o3=s3.exports,l3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{ref:"pill",class:{"text-outline":e.outline},attrs:{id:"pill"}},[e._v(e._s(i.props.label))])},d3=[],c3=(0,b.defineComponent)({__name:"GoogleMapsLabel",props:{map:null,position:null,skewed:{type:Boolean,default:!0},label:null,fillColor:{default:"#FFFFF"},textColor:{default:"#000000"},outline:{type:Boolean,default:!0},outlineColor:{default:"#808080"},fontWeight:{default:500},visible:{type:Boolean,default:!0},zIndex:null},setup(e){const t=e;(0,b.useCssVars)(((e,t)=>({d7e802e2:e.textColor,e13dd80e:e.fillColor,"9d7c3d12":t.fontSize,"6ee2be6e":e.fontWeight,"3c7eb548":e.outlineColor})));class i extends google.maps.OverlayView{constructor(e){super(),(0,tt.Z)(this,"options",void 0),this.options=e,this.setMap(e.map)}onAdd(){const e=this.options.div();e&&this.getPanes()?.markerLayer.appendChild(e)}onRemove(){const e=this.options.div();this.getPanes()?.markerLayer.removeChild(e)}draw(){const e=this.options.div(),t=this.getProjection().fromLatLngToDivPixel(this.options.position);let i=t?.x||0,a=t?.y||0;this.options.skewed||(i-=e.offsetWidth/2,a-=e.offsetHeight/2),e.style.left=`${i}px`,e.style.top=`${a}px`}}const a=(0,b.ref)(`${s()}pt`),n=(0,b.ref)(),r=(0,b.reactive)(new i({map:t.map,position:t.position,skewed:t.skewed,label:t.label,div:()=>n.value}));function s(){const e=(t.map.getZoom()||11)-10;return e>0?e:1}return t.map.addListener("zoom_changed",(()=>{a.value=`${s()}pt`})),(0,b.onUnmounted)((()=>{r.setMap(null)})),{__sfc:!0,Label:i,props:t,fontSize:a,pill:n,label:r,estimateFontSize:s}}}),u3=c3,p3=(0,ew.Z)(u3,l3,d3,!1,null,"5b56e60b",null),h3=p3.exports,m3=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div")},f3=[],g3=(0,b.defineComponent)({__name:"GoogleMapsLine",props:{map:null,path:null,strokeColor:{default:"#555555"},strokeOpacity:{default:1},strokeWeight:{default:2},strokeStyle:{default:"solid"},geodesic:{type:Boolean,default:!0},visible:{type:Boolean,default:!0},zIndex:{default:10}},setup(e){const t=e,i={path:"M 0,-1 0,1",strokeOpacity:t.strokeOpacity,scale:t.strokeWeight},a=(0,b.reactive)(new google.maps.Polyline({path:t.path,strokeColor:t.strokeColor,strokeOpacity:"dashed"===t.strokeStyle?0:t.strokeOpacity,strokeWeight:t.strokeWeight,map:t.map,geodesic:t.geodesic,visible:t.visible,zIndex:t.zIndex,icons:"solid"===t.strokeStyle?[]:[{icon:i,offset:"0",repeat:"20px"}]}
1));return(0,b.onUnmounted)((()=>{a.setMap(null)})),{__sfc:!0,props:t,dashSymbol:i,line:a}}}),y3=g3,v3=(0,ew.Z)(y3,m3,f3,!1,null,null,null),b3=v3.exports,w3=i(2318),C3=i(48098);const F3={POLYGON_FIELD:"polygon-field",POLYGON_MAPOBJECT:"polygon-mapobject",LINESTRING_MAPOBJECT:"linestring-mapobject",LINESTRING_SPLIT:"linestring-split",LINESTRING_MEASURE:"linestring-measure"},A3="#FF614C";function k3(e,t,i){const a=new C3.H({lib:e,map:t,coordinatePrecision:9}),n=()=>i.getMapObjectColor(),r=[new w3.IN({modeName:F3.POLYGON_FIELD,styles:{fillColor:X.POLYGON_ACTIVE_FILL_COLOR,fillOpacity:.15,outlineColor:X.POLYGON_ACTIVE_STROKE_COLOR,outlineWidth:3}}),new w3.IN({modeName:F3.POLYGON_MAPOBJECT,styles:{fillColor:n,fillOpacity:0,outlineColor:n,outlineWidth:7}}),new w3.G3({modeName:F3.LINESTRING_MAPOBJECT,styles:{lineStringColor:n,lineStringWidth:7}}),new w3.G3({modeName:F3.LINESTRING_SPLIT,styles:{lineStringColor:A3,lineStringWidth:3}}),new w3.G3({modeName:F3.LINESTRING_MEASURE,styles:{lineStringColor:X.MEASURE_DISTANCE_LINE_COLOR,lineStringWidth:3}})];return new w3.DB({adapter:a,modes:r})}function S3(e){if(2!==e.length)throw new Error("Points can consist of numerical values pairs only [longitude, latitude]");return new google.maps.LatLng({lng:e[0],lat:e[1]})}function E3(e){return new google.maps.MVCArray(e.map(S3))}var I3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"field-name-label",style:i.positionStyle},[e._v(e._s(i.props.fieldName))])},_3=[];function D3(){const e=(0,b.ref)(window.devicePixelRatio<=1?Math.round(100*window.devicePixelRatio):100);function t(){e.value=window.devicePixelRatio<=1?Math.round(100*window.devicePixelRatio):100}return(0,b.onMounted)((()=>{window.addEventListener("resize",t)})),(0,b.onUnmounted)((()=>{window.removeEventListener("resize",t)})),{browserZoom:e}}var M3,P3=(0,b.defineComponent)({__name:"FieldNameLabel",props:{map:null,fieldName:null,position:null},setup(e){const t=e;let i=new google.maps.OverlayView;const a=(0,b.ref)(),{browserZoom:n}=D3();function r(){const e=i.getProjection().fromLatLngToContainerPixel(t.position);return e?{top:`${e.y}px`,left:`${e.x}px`}:{top:0,left:0}}function s(){const e=t.map.getZoom(),i=n.value<=81;return e>=15?i?"14px":"12px":i?"10px":"9px"}function o(){return{...r(),fontSize:s()}}return(0,b.onMounted)((()=>{i=new google.maps.OverlayView,i.onAdd=()=>null,i.draw=()=>{a.value=o()},i.onRemove=()=>null,i.setMap(t.map)})),(0,b.onBeforeUnmount)((()=>{i.setMap(null)})),{__sfc:!0,overlayView:i,props:t,positionStyle:a,browserZoom:n,calculatePositionStyle:r,getFontSize:s,getStyle:o}}}),T3=P3,x3=(0,ew.Z)(T3,I3,_3,!1,null,null,null),B3=x3.exports,O3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{ref:"legend",staticClass:"legend-container",style:{top:`${i.props.initialTop}px`,left:`${i.props.initialLeft}px`},on:{mousedown:i.startAction,mousemove:i.updateCursor,mouseleave:i.resetCursor}},[t(i.FontAwesomeIcon,{staticStyle:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"},attrs:{icon:["fa","dash"]}}),t(i.FontAwesomeIcon,{staticStyle:{position:"absolute",top:"50%",right:"6",transform:"translateY(-50%)"},attrs:{icon:["fa","pipe"]}}),t("div",{staticClass:"legend-title"},[e._v(e._s(""===i.reportState.legendTitle?e.$t("Legende"):i.reportState.legendTitle))]),t("div",{staticClass:"legend-wrapper"},[e.useCrops?e._l(i.props.crops,(function(i){return t("div",{key:i.id,staticClass:"legend-item"},[t("div",{staticClass:"variety-hatch-wrapper"},[t("div",{class:{"bg-hatch-solid":!0},style:{"--hatch-primary":i.mapPolygonColor}}),t("div",{staticClass:"legend-label"},[e._v(e._s(i.nameUbb))])])])})):e._l(i.props.varieties,(function(a){return t("div",{key:a.id,staticClass:"legend-item"},[t("div",{staticClass:"variety-hatch-wrapper"},[a.mapHatchStyle===i.HatchStyle.Solid?t("div",{class:{"bg-hatch-solid":a.mapHatchStyle===i.HatchStyle.Solid},style:{"--hatch-primary":a.mapPrimaryColor,"--hatch-secondary":a.mapSecondaryColor}}):e._e(),a.mapHatchStyle===i.HatchStyle.Grid?t(i.MapHatchGrid,{attrs:{variety:a}}):e._e(),a.mapHatchStyle===i.HatchStyle.ForwardDiagonal?t(i.MapHatchForwardDiagonal,{attrs:{variety:a}}
1):e._e(),a.mapHatchStyle===i.HatchStyle.BackwardDiagonal?t(i.MapHatchBackwardDiagonal,{attrs:{variety:a}}):e._e(),a.mapHatchStyle===i.HatchStyle.Horizontal?t(i.MapHatchHorizontal,{attrs:{variety:a}}):e._e(),a.mapHatchStyle===i.HatchStyle.Vertical?t(i.MapHatchVertical,{attrs:{variety:a}}):e._e(),a.mapHatchStyle===i.HatchStyle.CheckerBoard?t(i.MapHatchCheckerboard,{attrs:{variety:a}}):e._e(),t("div",{staticClass:"legend-label"},[e._v(e._s(a.name))])],1)])}))],2)],1)},$3=[];(function(e){e["LANDSCAPE"]="landscape",e["PORTRAIT"]="portrait"})(M3||(M3={}));var R3=M3;const N3=(0,b.reactive)({legendTitle:"",orientation:R3.LANDSCAPE});var z3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.BackwardDiagonal?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`backwardDiagonal_${e.variety.id}`,width:"3.5",height:"3.5",patternTransform:"rotate(45 0 0)",patternUnits:"userSpaceOnUse"}},[t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":4.5},attrs:{x1:"0",y1:"0",x2:"0",y2:"3.5"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor}}),t("rect",{attrs:{width:"100%",height:"100%",fill:`url(#backwardDiagonal_${e.variety.id})`}})]):e._e()},L3=[],V3=(0,b.defineComponent)({__name:"MapHatchBackwardDiagonal",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),U3=V3,j3=(0,ew.Z)(U3,z3,L3,!1,null,"071c8029",null),H3=j3.exports,G3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.CheckerBoard?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`checkerBoard_${e.variety.id}`,x:"0",y:"0",width:"8",height:"8",patternUnits:"userSpaceOnUse"}},[t("rect",{style:{fill:e.variety.mapSecondaryColor},attrs:{x:"0",width:"4",height:"4",y:"0"}}),t("rect",{style:{fill:e.variety.mapSecondaryColor},attrs:{x:"4",width:"4",height:"4",y:"4"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor}}),t("rect",{attrs:{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#checkerBoard_${e.variety.id})`}})]):e._e()},W3=[],Z3=(0,b.defineComponent)({__name:"MapHatchCheckerboard",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),K3=Z3,q3=(0,ew.Z)(K3,G3,W3,!1,null,"74994317",null),Y3=q3.exports,J3=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.ForwardDiagonal?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`forwardDiagonal_${e.variety.id}`,width:"3.5",height:"3.5",patternTransform:"rotate(-45 0 0)",patternUnits:"userSpaceOnUse"}},[t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":4.5},attrs:{x1:"0",y1:"0",x2:"0",y2:"3.5"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor,"fill-opacity":"1"}}),t("rect",{attrs:{width:"100%",height:"100%",fill:`url(#forwardDiagonal_${e.variety.id})`}})]):e._e()},X3=[],Q3=(0,b.defineComponent)({__name:"MapHatchForwardDiagonal",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),e5=Q3,t5=(0,ew.Z)(e5,J3,X3,!1,null,"097052aa",null),i5=t5.exports,a5=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.Grid?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`grid_${e.variety.id}`,width:"4",height:"4",patternUnits:"userSpaceOnUse"}},[t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":2},attrs:{x1:"0",y1:"0",x2:"4",y2:"0"}}),t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":2},attrs:{x1:"0",y1:"0",x2:"0",y2:"4"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor}}),t("rect",{attrs:{width:"100%",height:"100%",fill:`url(#grid_${e.variety.id})`}})]):e._e()},n5=[],r5=(0,b.defineComponent)({__name:"MapHatchGrid",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),s5=r5,o5=(0,ew.Z)(s5,a5,n5,!1,null,"659dad1a",null),l5=o5.exports,d5=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.Horizontal?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`horizontal_${e.variety.id}`,width:"3",height:"3.5",patternTransform:"rotate(90 0 0)",patternUnits:"userSpaceOnUse"}},[t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":3.5},attrs:{x1:"0",y1:"0",x2:"0",y2:"3.5"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor}}),t("rect",{attrs:{width:"100%",height:"100%",fill:`url(#horizontal_${e.variety.id})`}}
1)]):e._e()},c5=[],u5=(0,b.defineComponent)({__name:"MapHatchHorizontal",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),p5=u5,h5=(0,ew.Z)(p5,d5,c5,!1,null,"02969bcd",null),m5=h5.exports,f5=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return e.variety.mapHatchStyle===i.HatchStyle.Vertical?t("svg",{staticClass:"hatch-svg-container",style:`border: 1px solid ${e.variety.mapPrimaryColor}`},[t("pattern",{attrs:{id:`vertical_${e.variety.id}`,width:"3.5",height:"3.5",patternTransform:"rotate(0 0 0)",patternUnits:"userSpaceOnUse"}},[t("line",{style:{stroke:e.variety.mapSecondaryColor,"stroke-width":3.5},attrs:{x1:"0",y1:"0",x2:"0",y2:"3.5"}})]),t("rect",{attrs:{width:"100%",height:"100%",fill:e.variety.mapPrimaryColor}}),t("rect",{attrs:{width:"100%",height:"100%",fill:`url(#vertical_${e.variety.id})`}})]):e._e()},g5=[],y5=(0,b.defineComponent)({__name:"MapHatchVertical",props:{variety:null},setup(e){return{__sfc:!0,HatchStyle:wt}}}),v5=y5,b5=(0,ew.Z)(v5,f5,g5,!1,null,"e2c75d3a",null),w5=b5.exports,C5=(0,b.defineComponent)({__name:"ReportLegend",props:{varieties:null,crops:null,useCrops:{type:Boolean},initialTop:null,initialLeft:null},setup(e){const t=e;ow.vI.add(uw.sZC),ow.vI.add(uw.V7J);const i=(0,b.ref)(null);let a=!1,n=!1,r="",o=0,l=0,d=0,c=0,u=0,p=0;const h=20,m=e=>{r?(n=!0,d=i.value.offsetWidth,c=i.value.offsetHeight,u=e.clientX,p=e.clientY):(a=!0,o=e.clientX-i.value.offsetLeft,l=e.clientY-i.value.offsetTop)},f=e=>{const t=i.value.getBoundingClientRect(),a=Math.abs(e.clientX-t.right)<=h,n=Math.abs(e.clientY-t.bottom)<=h;n?(r="bottom",i.value.style.cursor="ns-resize"):a?(r="right",i.value.style.cursor="ew-resize"):(r="",i.value.style.cursor="move")},g=()=>{a||n||(i.value.style.cursor="default")},y=e=>{if(a){const t=e.clientX-o,a=e.clientY-l;i.value.style.left=`${t}px`,i.value.style.top=`${a}px`}else if(n){const t=e.clientX-u,a=e.clientY-p;"bottom"===r?i.value.style.height=`${c+a}px`:"right"===r&&(i.value.style.width=`${d+t}px`),w()}},v=()=>{a=!1,n=!1,r=""},w=()=>{const e=i.value.querySelector(".legend-wrapper"),t=e.scrollWidth;i.value.style.width=`${t}px`};return(0,b.onMounted)((()=>{document.addEventListener("mousemove",y),document.addEventListener("mouseup",v)})),(0,b.onUnmounted)((()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v)})),{__sfc:!0,props:t,legend:i,isDragging:a,isResizing:n,resizeDirection:r,offsetX:o,offsetY:l,initialWidth:d,initialHeight:c,initialMouseX:u,initialMouseY:p,BORDER_THRESHOLD:h,startAction:m,updateCursor:f,resetCursor:g,handleMouseMove:y,stopActions:v,updateContainerSize:w,FontAwesomeIcon:s.GN,HatchStyle:wt,reportState:N3,MapHatchBackwardDiagonal:H3,MapHatchCheckerboard:Y3,MapHatchForwardDiagonal:i5,MapHatchGrid:l5,MapHatchHorizontal:m5,MapHatchVertical:w5}}}),F5=C5,A5=(0,ew.Z)(F5,O3,$3,!1,null,"e4831388",null),k5=A5.exports,S5=function(){var e=this,t=e._self._c;return t("div",{staticClass:"map__map-actions map-actions",style:{left:e.position.x+"px",top:e.position.y+"px"}},[e.showSave?t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",value:{title:e.titleSave},expression:"{ title: titleSave }",modifiers:{hover:!0,bottom:!0}}],staticClass:"map-actions__button bg-white text-primary",on:{click:function(t){return e.$emit("action:save")}}},[t("FontAwesomeIcon",{staticClass:"fill-primary",attrs:{icon:e.iconSave}})],1):e._e(),e.showPolygon?t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",value:{title:e.$t("Feldkontur zeichnen")},expression:"{ title: $t('Feldkontur zeichnen') }",modifiers:{hover:!0,bottom:!0}}],staticClass:"map-actions__button bg-white",on:{click:function(t){return e.$emit("action:polygon")}}},[t("FontAwesomeIcon",{staticClass:"text-secondary",attrs:{icon:"draw-polygon"}})],1):e._e(),e.showRemovePolygon?t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",value:{title:e.$t("Feldkontur löschen")},expression:"{ title: $t('Feldkontur löschen') }",modifiers:{hover:!0,bottom:!0}}],staticClass:"map-actions__button bg-white position-relative",on:{click:function(t){return e.$emit("action:removePolygon")}}},[t("FontAwesomeIcon",{staticClass:"map-actions__icon--draw-polygon position-absolute",attrs:{icon:"draw-polygon"}}),t("FontAwesomeIcon",{staticClass:"position-absolute text-white",attrs:{icon:"slash",size:"3x"}}),t("FontAwesomeIcon",{staticClass:"position-absolute text-black",attrs:{icon:"slash"}}
1)],1):e._e(),e.showDiscard?t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",value:{title:e.titleDiscard},expression:"{ title: titleDiscard }",modifiers:{hover:!0,bottom:!0}}],staticClass:"map-actions__button bg-white",on:{click:function(t){return e.$emit("action:discard")}}},[t("FontAwesomeIcon",{staticClass:"text-danger",attrs:{icon:"times"}})],1):e._e()])},E5=[];ow.vI.add(uw.LEp,uw.ubJ,uw.NBC,uw.u6k);var I5={props:{position:{type:Object,default(){return{x:0,y:0}}},showSave:{type:Boolean,default:!0},showPolygon:{type:Boolean,default:!0},showRemovePolygon:{type:Boolean,default:!1},showDiscard:{type:Boolean,default:!0},titleSave:{type:String,default(){return this.$t("Speichern")}},titleDiscard:{type:String,default(){return this.$t("Verwerfen")}},iconSave:{type:[String,Array],default:"check"}}},_5=I5,D5=(0,ew.Z)(_5,S5,E5,!1,null,"560b98cc",null),M5=D5.exports,P5=function(){var e=this,t=e._self._c;return t("span",{staticClass:"simple-tooltip bg-black text-white",style:e.style},[e._v(" "+e._s(e.text)+" ")])},T5=[],x5={name:"SimpleTooltip",props:{text:{type:String,default:""},position:{type:String,default:"right"},x:{type:Number,default:0},y:{type:Number,default:0}},computed:{style(){const e={top:`${this.y}px`,left:`${this.x}px`};switch(this.position){case"right":default:e.transform="translate(23px, -50%)"}return e}}},B5=x5,O5=(0,ew.Z)(B5,P5,T5,!1,null,"9693b000",null),$5=O5.exports,R5=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e._l(e.polyline.getPath().getArray(),(function(i,a){return[a>0?t("div",{key:a,staticClass:"label",style:e.positions[a]},[e._v(" "+e._s(`${e.getDistances[a-1].toFixed(1)} m`)+" ")]):e._e()]}))],2)},N5=[],z5=(0,b.defineComponent)({name:"MapDistanceLabel",props:{polyline:{type:Object,required:!0},map:{type:Object,required:!0}},data(){return{google:null,overlayViews:[],positions:[]}},async created(){const e=await cE();this.google=e,this.polyline.getPath().getArray().forEach(((e,t)=>{const i=new this.google.maps.OverlayView;i&&(i.onAdd=()=>null,i.draw=()=>{if(i){const{x:a,y:n}=i.getProjection().fromLatLngToContainerPixel(e),r={top:`${n}px`,left:`${a+10}px`};this.positions[t]?this.$set(this.positions,t,r):this.positions.push(r)}},i.onRemove=()=>null,i.setMap(this.map))}))},methods:{},computed:{getDistances(){const e=this.polyline.getPath().getArray(),t=[],i=e.reduce(((i,a,n)=>{if(0===n)return 0;const r=google.maps.geometry.spherical.computeDistanceBetween(a,e[n-1]);return t.push(r),i+r}),0);return t.push(i),t}}}),L5=z5,V5=(0,ew.Z)(L5,R5,N5,!1,null,"63119892",null),U5=V5.exports,j5=function(){var e=this,t=e._self._c;return t("div",{staticClass:"map-info-box"},[e._t("default")],2)},H5=[],G5={name:"MapInfoBox"},W5=G5,Z5=(0,ew.Z)(W5,j5,H5,!1,null,"2dadbf61",null),K5=Z5.exports,q5=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",[t("div",{staticClass:"geo-object-label",class:{isolationZone:e.objectType===i.GeoObjectType.IsolationZone,multiplierGroup:e.objectType===i.GeoObjectType.MultiplierGroup},style:i.labelPosition},[e._v(" "+e._s(e.label)+" ")])])},Y5=[],J5=(0,b.defineComponent)({__name:"SimpleMapLabel",props:{position:null,label:null,map:null,objectType:null},setup(e){const t=e,i=(0,b.ref)({top:"0px",left:"0px"});return(0,b.onMounted)((async()=>{const e=await cE(),a=new e.maps.OverlayView;a.setMap(t.map),a.onRemove=()=>null,a.onAdd=()=>null,a.draw=()=>{if(a){const e=a.getProjection().fromLatLngToContainerPixel(t.position),n=e?.x??0,r=e?.y??0,s={top:r-20+"px",left:`${n+10}px`};i.value=s}}})),{__sfc:!0,props:t,labelPosition:i,GeoObjectType:vt}}}),X5=J5,Q5=(0,ew.Z)(X5,q5,Y5,!1,null,"eb257282",null),e4=Q5.exports;const t4=(e,t,i,a,n,r,s,o)=>{const l=(o-r)*(i-e)-(s-n)*(a-t);let d,c;const u={x:null,y:null,onLine1:!1,onLine2:!1};if(0===l)return!1;d=t-r,c=e-n;const p=(s-n)*d-(o-r)*c,h=(i-e)*d-(a-t)*c;return d=p/l,c=h/l,u.x=e+d*(i-e),u.y=t+d*(a-t),d>0&&d<1&&(u.onLine1=!0),c>0&&c<1&&(u.onLine2=!0),!(!u.onLine1||!u.onLine2)&&{x:u.x,y:u.y}},i4=e=>{if(null==e||!Array.isArray(e.coordinates)||!Array.isArray(e.coordinates[0]))return console.error("shapeHelpers.js getLatLonFromGeoJson: invali
1d geoJson",e),{lon:null,lat:null};const[t,i]=e.coordinates[0].reduce((([e,t],[i,a])=>[e+i,t+a]),[0,0]);return{lon:t/e.coordinates[0].length,lat:i/e.coordinates[0].length}};function a4(e,t,i,a=((e,t)=>JSON.stringify(e)===JSON.stringify(t))){const n=i.findIndex((t=>a(e,t)));return n===t||-1===n}var n4,r4,s4;function o4(e){const t=new google.maps.LatLngBounds,i=e.getGeometry();return i?(i.forEachLatLng((e=>t.extend(e))),t.getCenter()):new google.maps.LatLng(0,0)}(function(e){e["CROP"]="crop",e["VARIETY"]="variety",e["ACTIVITY"]="activity",e["NDVI"]="ndvi",e["MBI"]="mbi",e["DEFAULT"]="default"})(n4||(n4={})),function(e){e["FIELD_UTILIZATION"]="field-utilization",e["LAND_CADASTRES"]="land-cadastres",e["ISOLATION_ZONES"]="isolation-zones",e["MULTIPLIER_GROUPS"]="multiplier-groups"}(r4||(r4={})),function(e){e["ISOLATION_ZONES"]="isolation-zones",e["MULTIPLIER_GROUPS"]="multiplier-groups",e["CREATE_REPORT"]="create-report"}(s4||(s4={}));var l4=o4;function d4(e,t,i){const a=t.filter((t=>t.fieldId===e));if(a.length>0){const e=a.reduce(((e,t)=>e.timeFinish>t.timeFinish?e:t)),t=i[e.activityTypeId]??null;return t}return null}function c4(e,t){return t.contains({lng:e.lon,lat:e.lat})||!1}function u4(e){const t=e.getPath().getArray().map((e=>[e.lng(),e.lat()]));return e instanceof google.maps.Polygon?(t[t.length-1][0]===t[0][0]&&t[t.length-1][1]===t[0][1]||t.push([...t[0]]),{coordinates:[[...t]],type:"Polygon"}):{coordinates:[...t],type:"LineString"}}var p4=i(82037),h4=i(1449),m4=i(32700);function f4(e){if(0===e.length)return!1;let t;try{t=(0,h4.yu)(e)}catch(r){return!1}if(!t)return!1;if(!e.every((e=>e.every((([e,t])=>e>=-180&&e<=180&&t>=-90&&t<=90)))))return!1;const i=(0,m4.Z)(t);if(i.features.length>0)return!1;const a=e[0],n=e.slice(1).every((e=>e.every((e=>(0,p4.Z)(e,(0,h4.yu)([a]))))));return n}var g4=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div")},y4=[],v4=(0,b.defineComponent)({__name:"HatchFieldOverlay",props:{map:null,path:null,primaryColor:null,secondaryColor:null,hatch:null},setup(e){const t=e,i=(0,b.ref)(),a=(0,b.ref)(),n=(0,b.ref)(),r=(0,b.ref)(),s=(0,b.ref)();function o(e){switch(e){case wt.ForwardDiagonal:return 45;case wt.BackwardDiagonal:return 135;case wt.Horizontal:return 0;case wt.Vertical:return 90;case wt.CheckerBoard:return-45;case wt.Grid:return 0;default:return 0}}function l(){return t.hatch===wt.Grid?"4":"3.5"}function d(e){const i=`lineFill_${Math.random().toString(36).substr(2,9)}`,a="http://www.w3.org/2000/svg",n=document.createElementNS(a,"pattern");n.setAttributeNS(null,"id",i),n.setAttributeNS(null,"patternUnits","userSpaceOnUse"),n.setAttributeNS(null,"patternTransform",`rotate(${o(e)})`),n.setAttributeNS(null,"height",l()),n.setAttributeNS(null,"width",l());const r=`rectFill_${Math.random().toString(36).substr(2,9)}`;if(e===wt.Horizontal||e===wt.Vertical||e===wt.ForwardDiagonal||e===wt.BackwardDiagonal){const e=document.createElementNS(a,"rect");e.setAttributeNS(null,"id",r),e.setAttributeNS(null,"fill",t.primaryColor??"#000"),e.setAttributeNS(null,"fill-opacity","1"),e.setAttributeNS(null,"stroke",t.secondaryColor??"grey"),e.setAttributeNS(null,"stroke-width","2"),e.setAttributeNS(null,"stroke-dasharray","3.5,3.5"),e.setAttributeNS(null,"height","3.5"),e.setAttributeNS(null,"width","3.5"),n.appendChild(e)}if(e===wt.Grid){const e=document.createElementNS(a,"rect");e.setAttributeNS(null,"id",r),e.setAttributeNS(null,"fill",t.primaryColor??"#000"),e.setAttributeNS(null,"height","7"),e.setAttributeNS(null,"width","7"),n.appendChild(e);const i=document.createElementNS(a,"line");i.setAttributeNS(null,"x1","0"),i.setAttributeNS(null,"y1","3.5"),i.setAttributeNS(null,"x2","7"),i.setAttributeNS(null,"y2","3.5"),i.setAttributeNS(null,"stroke",t.secondaryColor??"grey"),i.setAttributeNS(null,"stroke-width","1"),n.appendChild(i);const s=document.createElementNS(a,"line");s.setAttributeNS(null,"x1","3.5"),s.setAttributeNS(null,"y1","0"),s.setAttributeNS(null,"x2","3.5"),s.setAttributeNS(null,"y2","7"),s.setAttributeNS(null,"stroke",t.secondaryColor??"grey"),s.setAttributeNS(null,"stroke-width","1"),n.appendChild(s)}if(e===wt.CheckerBoard)return c();if(e===wt.Solid){const e=document.createElementNS(a,"rect");e.setAttributeNS(null,"id",r),e.setAttributeNS(null,"fill",t.primaryColor??"#000"),e.setAttributeNS(null,"height","7"),e.setAttributeNS(null,"width","7"),n.appendChild(e)}return n}function c(){const e=`lineFill_${Math.random().toString(36).substr(2,9)}`,i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"pattern");a.setAttributeNS(null,"id",e),a.setAttributeNS(null,"patternUnits","userSpaceOnUse"),a.setAttributeNS(null,"height","6"),a.setAttributeNS(null,"width","6");const n=document.createElementNS(i,"rect");n.setAttributeNS(null,"fill",t.secondaryColor??"#000"),n.setAttributeNS(null,"height","3"),n.setAttributeNS(null,"width","3"),n.setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y","0"),a.appendChild(n);const r=document.createElementNS(i,"rect");r.setAttributeNS(null,"fill",t.primaryColor??"#000"),r.setAttributeNS(null,"height","3"),r.setAttributeNS(null,"width","3"),r.setAttributeNS(null,"x","3"),r.setAttributeNS(null,"y","0"),a.appendChild(r);const s=document.createElementNS(i,"rect");s.setAttributeNS(null,"fill",t.secondaryColor??"#000"),s.setAttributeNS(null,"height","3"),s.setAttributeNS(null,"width","3"),s.setAttributeNS(null,"x","3"),s.setAttributeNS(null,"y","3"),a.appendChild(s);const o=document.createElementNS(i,"rect");return o.setAttributeNS(null,"fill",t.primaryColor??"#000"),o.setAttributeNS(null,"height","3"),o.setAttributeNS(null,"width","3"),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","3"),a.appendChild(o),a}function u(){i.value=new google.maps.LatLngBounds,s.value=h(t.path),s.value.forEach((e=>{e.forEach((e=>{i.value?.extend(e)}))})),r.value=new google.maps.OverlayView,r.value.setMap(t.map),r.value.onRemove=()=>{const e=r.value?.getPanes();e?.overlayLayer.removeChild(n.value),n.value?.parentNode?.removeChild(n.value),n.value=null,r.value=null},r.value.onAdd=()=>
1{if(!t.hatch)return;const e=document.createElement("div");e.style.borderStyle="none",e.style.borderWidth="0px",e.style.position="absolute";const i="http://www.w3.org/2000/svg",s=document.createElementNS(i,"svg");s.setAttributeNS(null,"preserveAspectRatio","xMidYMid meet");const o=document.createElementNS(i,"defs"),l=d(t.hatch);o.appendChild(l),s.appendChild(o);const c=document.createElementNS(i,"path");c.setAttributeNS(null,"fill",`url(#${l.id})`),a.value=c,s.appendChild(c),e.appendChild(s),e.classList.add("polygon"),n.value=e;const u=r.value?.getPanes();u?.overlayLayer.appendChild(n.value)},r.value.draw=()=>{const e=r.value?.getProjection();if(i.value&&n.value){if(i.value){const t=e?.fromLatLngToDivPixel(i.value.getSouthWest()),a=e?.fromLatLngToDivPixel(i.value.getNorthEast()),r=n.value;r.style.left=`${t.x}px`,r.style.top=`${a.y}px`,r.style.width=a.x-t.x+"px",r.style.height=t.y-a.y+"px"}a.value?.setAttributeNS(null,"d",p())}}}function p(){const e=r.value?.getProjection();if(!i.value)return"";const t=e?.fromLatLngToDivPixel(i.value?.getSouthWest
1()),a=e?.fromLatLngToDivPixel(i.value?.getNorthEast());let n="";for(let i=0;i<s.value.length;i+=1){let r="";for(let n=0;n<s.value[i].length;n+=1){const o=e?.fromLatLngToDivPixel(s.value[i][n]);o&&t&&a&&(r+=0===n?`${o.x-t.x}, ${o.y-a.y}`:` ${o.x-t.x}, ${o.y-a.y}`)}n+=`M${r}z `}return n}function h(e){const t=[];return e.forEach((e=>{const i=[];e.forEach((e=>{i.push(e)})),t.push(i)})),t}return(0,b.onMounted)((()=>{u()})),(0,b.onUnmounted)((()=>{r.value?.setMap(null)})),{__sfc:!0,props:t,bounds:i,overlayPath:a,overlayDiv:n,overlayView:r,polygonPath:s,getPatternRotation:o,getPatternSize:l,getPattern:d,getCheckerboardPattern:c,init:u,mapPointstoSVGPath:p,convertMVCArrayToPath:h}}}),b4=v4,w4=(0,ew.Z)(b4,g4,y4,!1,null,"1df25f58",null),C4=w4.exports,F4=function(){var e=this,t=e._self._c;e._self._setupProxy;return null!=e.map?t("MapItemTooltip",{staticClass:"map-field-tooltip",attrs:{map:e.map,marker:e.marker,polygon:e.polygon,drawOnCenter:e.drawOnCenter,drawOnMarker:e.drawOnMarker,colorTheme:e.colorTheme}},[t("div",{staticClass:"map-field-tooltip__content"},[!e.editable&&e.showCompanyName?t("p",{staticClass:"m-0 p-0"},[e._v(" "+e._s(e.companyName)+" ")]):e._e(),!e.editable&&e.customerName?t("p",{staticClass:"m-0 p-0"},[e._v(" "+e._s(e.customerName)+" ")]):e._e(),t("div",{staticClass:"map-field-tooltip__name"},[null!=e.fieldGroup?t("span",{staticClass:"map-field-tooltip__field-group"}
1,[e._v(" "+e._s(e.fieldGroup)+" - ")]):e._e(),e.editable?t("BFormInput",{ref:"map-field-tooltip__name-input",staticClass:"map-field-tooltip__name-input m-0 p-0",attrs:{value:e.field.name,placeholder:e.placeholder},on:{update:t=>e.$emit("change:fieldName",t),keydown:t=>e.$emit("keydown",t)}}):"string"===typeof e.field.name&&e.field.name.length>0?t("span",[e._v(" "+e._s(e.field.name)+" ")]):"string"===typeof e.field.placeholderName?t("span",[e._v(" "+e._s(e.field.placeholderName)+" ")]):e._e()],1),null!=e.fieldSizeFormatted?t("p",{staticClass:"m-0 p-0"},[e._v(" "+e._s(e.$t("{size} ha",{size:e.fieldSizeFormatted}))+" ")]):e._e(),null!=e.cropName?t("p",{staticClass:"m-0 p-0"},[e._v(e._s(e.cropName)+" "+e._s(e.varietyName?`(${e.varietyName})`:""))]):e._e(),null!=e.activityType?t("p",{staticClass:"m-0 p-0"},[e._v(" "+e._s(e.activityType.displayName)+" ")]):e._e(),e.showDetailsLink?t("BLink",{attrs:{target:"_blank",href:`${e.baseUrl}fields/record/${e.field.id}`}},[e._v(" "+e._s(e.$t("Details anzeigen"))+" ")]):e._e()],1)]):e._e()},A4=[],k4=(0,b.defineComponent)({name:"MapFieldTooltip",components:{MapItemTooltip:fE},data(){return{baseUrl:M}},props:{field:{type:Object,required:!0},editable:{type:Boolean,default:!1},map:{type:Object,default:null},marker:{type:Object,default:null},polygon:{type:Object,default:null},crops:{type:Object,default:null},showFieldSize:{type:Boolean,default:!0},companies:{type:Array,default(){return[]}},customers:{type:Object,default(){return{}}},drawOnCenter:{type:Boolean,default:!1},activityType:{type:Object,default:null},drawOnMarker:{type:Boolean,default:!1},colorTheme:{type:String,default:"dark",validator:e=>["dark","light"].includes(e)},showDetailsLink:{type:Boolean,default:!1},varieties:{type:Object,default:null}},computed:{fieldGroup(){const e=Ru(this.field,"fieldGroup.mfa");return"string"!==typeof e||0===e.length?null:e},placeholder(){return"string"===typeof this.field.placeholderName?this.field.placeholderName:this.$t("Feld")??"Feld"},fieldSizeFormatted(){return!Number.isNaN(Number(this.field.fieldSize))&&this.field.fieldSize>0&&this.showFieldSize?Bl()(this.field.fieldSize).format():null},cropName(){return null==this.crops||null==this.field.cropId||null==this.crops[this.field.cropId]?null:this.crops[this.field.cropId].name},varietyName(){return null==this.varieties||null==this.field.varietyId||null==this.varieties[this.field.varietyId]?null:this.varieties[this.field.varietyId].name},showCompanyName(){return this.companies.length>1},companyName(){if(this.showCompanyName){const e=this.companies.find((e=>e.processOrders.some((e=>e.id===this.field.processOrderId))));if(null!=e)return e.abbreviation}return null},customerName(){return this.field["fieldGroup.customerId"]?this.customers[this.field["fieldGroup.customerId"]]?.name??null:null}}}),S4=k4,E4=(0,ew.Z)(S4,F4,A4,!1,null,"4e2269cc",null),I4=E4.exports,_4=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"menu-wrapper"},[i.isExpanded?e._e():t("div",{staticClass:"menu-button",attrs:{"data-cy":"map-menu-button"},on:{click:i.toggleMenu,keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:i.toggleMenu.apply(null,arguments)}}},[t("FontAwesomeIcon",{staticClass:"icon",attrs:{icon:["far","bars"]},on:{click:i.toggleMenu}}),t("div",[e._v(e._s(e.$t("Menü")))])],1),i.isExpanded?t("div",{staticClass:"menu",attrs:{"data-cy":"map-menu"}},[t("div",{staticClass:"menu-heading"},[t("FontAwesomeIcon",{staticClass:"icon close-button",attrs:{icon:["far","xmark"]},on:{click:i.toggleMenu}}),t("span",[e._v(e._s(e.$t("Menü")))])],1),t("div",{staticClass:"menu-body"},[e.hideLayers?e._e():t("section",{attrs:{"data-cy":"menu-on-click-section"}},e._l(i.menuSettings.menuItems,(function(a){return t("div",{key:a.title,staticClass:"menu-item",on:{click:function(e){return i.menuItemClicked(a)},keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:i.menuItemClicked(a)}}},[t("FontAwesomeIcon",{staticClass:"icon",attrs:{icon:["fal","plus-circle"]}}),t("span",[e._v(e._s(a.title))])],1)})),0),t("section",{attrs:{"data-cy":"menu-field-color-section"}},[t("div",{staticClass:"heading"},[e._v(e._s(e.$t("Felder einfärben")))]),t(i.FormFieldRadioGroup,{attrs:{stacked:"",variant:"no-label"},on:{change:e=>i.emit("onFieldColorChanged",e)},model:{value:i.menuSettings.activeFieldColor,callback:function(t){e.$set(i.menuSettings,"activeFieldColor",t)},expression:"menuSettings.activeFieldColor"}},e._l(i.menuSettings.colorFieldItems,(function(a){return t(i.FormRadio,{key:a.title,attrs:{value:a.value,"data-cy":"menu-radio-button"},scopedSlots:e._u([{key:"default",fn:function(){return[t("span",[e._v(e._s(a.title))])]},proxy:!0}],null,!0)})})),1)],1),e.hideLayers?e._e():t("section",{attrs:{"data-cy":"menu-layer-section"}},[t("div",{staticClass:"heading"},[e._v(e._s(e.$t("Ebenen")))]),t("div",{staticClass:"layer-container"},[t("div",e._l(i.menuSettings.layerItems,(function(a){return t(i.FormCheckbox,{key:a.title,attrs:{size:"md","data-cy":"menu-layer-item"},on:{change:()=>i.emit("onActiveLayersChanged",i.menuSettings.layerItems)},model:{value:a.selected,callback:function(t){e.$set(a,"selected",t)},expression:"layerItem.selected"}},[e._v(" "+e._s(a.title)+" ")])})),1)])]),t("section",{attrs:{"data-cy":"menu-appearance-section"}},[t("div",{staticClass:"heading"},[e._v(e._s(e.$t("Darstellung")))]),t(i.FormCheckbox,{staticClass:"appearance-checkbox",attrs:{size:"md","data-cy":"always-show-field-name-checkbox"},on:{change:e=>i.emit("alwaysShowFieldName",e)}
1,model:{value:i.menuSettings.alwaysShowFieldName,callback:function(t){e.$set(i.menuSettings,"alwaysShowFieldName",t)},expression:"menuSettings.alwaysShowFieldName"}},[e._v(" "+e._s(e.$t("Feldname immer anzeigen"))+" ")]),t(i.FormCheckbox,{staticClass:"appearance-checkbox",attrs:{size:"md","data-cy":"show-timestamps"},on:{change:e=>i.emit("showTimestamps",e)},model:{value:i.menuSettings.showTimestamps,callback:function(t){e.$set(i.menuSettings,"showTimestamps",t)},expression:"menuSettings.showTimestamps"}},[e._v(" "+e._s(e.$t("Zeitstempel"))+" ")])],1)])]):e._e()])},D4=[],M4=(0,b.defineComponent)({__name:"MapMenu",props:{featureFieldsNDVIMeanEnabled:{type:Boolean,default:!1},featureLandCadastresEnabled:{type:Boolean,default:!1},featureGISObjectsEnabled:{type:Boolean,default:!1},hideLayers:{type:Boolean,default:!1}},emits:["onActiveLayersChanged","onFieldColorChanged","onMenuItemClicked","alwaysShowFieldName","showTimestamps"],setup(e,{emit:t}){const i=e;ow.vI.add(uw.OqA,lw.g82,lw.xiG);const a=Gb.translate,n=(0,b.ref)(!1),r=(0,b.ref)({activeFieldColor:n4.CROP,menuItems:[],layerItems:[{title:a("Feldnutzung")||"",selected:!1,type:r4.FIELD_UTILIZATION}],colorFieldItems:[{title:a("Standard"),value:n4.DEFAULT},{title:a("nach Kultur"),value:n4.CROP},{title:a("nach Sorte"),value:n4.VARIETY},{title:a("nach letzter Tätigkeit"),value:n4.ACTIVITY}],alwaysShowFieldName:!1,showTimestamps:!1});function s(){n.value=!n.value}function o(e){n.value=!1,t("onMenuItemClicked",e.id)}function l(e){localStorage.mapMenuSettings=JSON.stringify(e)}function d(){r.value.layerItems.push({title:a("Grundstückskataster")||"",selected:!1,type:r4.LAND_CADASTRES})}function c(){r.value.layerItems.push({title:a("Isolationszonen")||"",selected:!1,type:r4.ISOLATION_ZONES}),r.value.layerItems.push({title:a("Vermehrungsgemeinschaften")||"",selected:!1,type:r4.MULTIPLIER_GROUPS})}return(0,b.watch)(r,(e=>{l(e)}),{deep:!0}),(0,b.onMounted)((()=>{if(i.featureFieldsNDVIMeanEnabled&&(r.value.colorFieldItems.push({title:a("nach NDVI"),value:n4.NDVI}),r.value.colorFieldItems.push({title:a("nach MBI"),value:n4.MBI})),localStorage.mapMenuSettings){const e=JSON.parse(localStorage.mapMenuSettings);r.value.alwaysShowFieldName=e.alwaysShowFieldName||!1,r.value.activeFieldColor=e.activeFieldColor||n4.CROP,e.layerItems&&(r.value.layerItems=e.layerItems);const t=r.value.layerItems.findIndex((e=>e.type===r4.LAND_CADASTRES));i.featureLandCadastresEnabled&&t<0?d():!i.featureLandCadastresEnabled&&t>0&&r.value.layerItems.splice(t,1);const a=r.value.layerItems.findIndex((e=>e.type===r4.ISOLATION_ZONES));if(i.featureGISObjectsEnabled&&a<0)c();else if(!i.featureGISObjectsEnabled&&a>0){r.value.layerItems.splice(a,1);const e=r.value.layerItems.findIndex((e=>e.type===r4.MULTIPLIER_GROUPS));r.value.layerItems.splice(e,1)}}else i.featureLandCadastresEnabled&&d(),i.featureGISObjectsEnabled&&c();t("onFieldColorChanged",r.value.activeFieldColor),t("onActiveLayersChanged",r.value.layerItems),t("alwaysShowFieldName",r.value.alwaysShowFieldName),t("showTimestamps",r.value.showTimestamps),i.featureGISObjectsEnabled&&(r.value.menuItems.push({id:s4.CREATE_REPORT,title:a("Report")||""}),r.value.menuItems.push({id:s4.ISOLATION_ZONES,title:a("Isolationszonen")||""}),r.value.menuItems.push({id:s4.MULTIPLIER_GROUPS,title:a("Vermehrungsgemeinschaft")||""}))})),{__sfc:!0,t:a,props:i,isExpanded:n,menuSettings:r,emit:t,toggleMenu:s,menuItemClicked:o,saveSettingsInLocalStorage:l,addLandCadastreCheckbox:d,addGisLayerCheckboxes:c,FormCheckbox:Gw,FormFieldRadioGroup:_T,FormRadio:kT}}}),P4=M4,T4=(0,ew.Z)(P4,_4,D4,!1,null,"9d0149e0",null),x4=T4.exports,B4=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"overlay-button",class:{default:"default"===e.type,success:"success"===e.type},on:{click:function(t){return e.$emit("click")}}},[t("FontAwesomeIcon",{staticClass:"icon",attrs:{icon:e.icon,size:e.iconSize}}),t("div",[e._v(e._s(e.text))])],1)},O4=[],$4=(0,b.defineComponent)({name:"MapOverlayButton",props:{text:{type:String,required:!0},icon:{type:Array,default:()=>[]},type:{type:String,default:"default"},iconSize:{type:String,default:"1x"}}}),R4=$4,N4=(0,ew.Z)(R4,B4,O4,!1,null,"a3df9c06",null),z4=N4.exports,L4=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("div",{staticClass:"util-button",class:{active:e.active,custom:e.disabled},attrs:{id:`util-button-${e.id}`},on:{click:e.toggle}},[t("FontAwesomeIcon",{staticClass:"icon",class:{light:e.disabled},attrs:{icon:e.icon}})],1),t("BTooltip",{attrs:{target:`util-button-${e.id}`}},[e._v(e._s(e.tooltip))])],1)},V4=[];ow.vI.add(uw.ubJ);var U4=(0,b.defineComponent)({name:"MapUtilityButton",props:{id:{type:String,required:!0},icon:{type:Array,default:()=>[]},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""}}
1,methods:{toggle(){this.disabled||this.$emit("button:pressed",this.active)}}}),j4=U4,H4=(0,ew.Z)(j4,L4,V4,!1,null,"725c59b2",null),G4=H4.exports,W4=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{attrs:{visible:e.visible,title:e.$t("Felder kombinieren")},on:{ok:function(t){return e.$emit("combine")},change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("div",[t("span",[e._v(e._s(e.$t("Alle ausgewählten Polygone werden zu einem vereint. Willst du fortsetzen?")))])])]},proxy:!0}])})},Z4=[],K4=(0,b.defineComponent)({name:"ModalConfirm",components:{ModalWrapper:OC},props:{visible:{type:Boolean,default:!1}}}),q4=K4,Y4=(0,ew.Z)(q4,W4,Z4,!1,null,"6ac32c07",null),J4=Y4.exports,X4=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ModalWrapper,{attrs:{visible:e.visible,title:e.title,"ok-title":"OK","cancel-title":e.$t("Abbrechen")},on:{ok:function(t){return e.$emit("ok",i.subLayerState)},change:t=>e.$emit("change",t)}},[t("p",[e._v(e._s(e.$t("Aktiviere den Schalter, um Unterebenen in der Karte anzuzeigen.")))]),t(i.Button,{attrs:{variant:"link"},on:{click:i.toggleVisibility}},[e._v(" "+e._s(i.isAtLeastOneLayerHidden?e.$t("Alle anzeigen"):e.$t("Alle ausblenden"))+" ")]),e._l(i.subLayerState,(function(a,n){return t(i.FormCheckbox,{key:a.name,attrs:{switch:!0,checked:!a.hidden},on:{change:e=>i.toggleSubLayerVisibility(n,e)}},[e._v(" "+e._s(a.name)+" ")])}))],2)},Q4=[],e7=(0,b.defineComponent)({__name:"ModalMapObjectsSubType",props:{visible:{type:Boolean},title:null,hideableSubLayers:null},setup(e){const t=e,i=(0,b.ref)([]);(0,b.watch)((()=>t.hideableSubLayers),(e=>{i.value=e.map((e=>({...e})))}),{immediate:!0});const a=(0,b.computed)((()=>i.value.some((e=>e.hidden))));function n(e,t){i.value[e].hidden=!t}function r(){const e=[...i.value];a.value?e.forEach((e=>{e.hidden=!1})):e.forEach((e=>{e.hidden=!0})),i.value=e}return{__sfc:!0,props:t,subLayerState:i,isAtLeastOneLayerHidden:a,toggleSubLayerVisibility:n,toggleVisibility:r,ModalWrapper:OC,Button:gw,FormCheckbox:Gw}}}),t7=e7,i7=(0,ew.Z)(t7,X4,Q4,!1,null,null,null),a7=i7.exports;const n7=i(7773),r7=i(24052),s7=i(37475),o7=210,l7=297,d7={path:"M 0,-1 0,1",strokeOpacity:1,strokeWeight:3,scale:5};ow.vI.add(uw.IJ7,uw.LEp,uw.r8p,lw.DCV,lw.ubJ,a_.mTH,uw.g82,uw.tU8,uw._nR,a_.fV7,lw.D2o,lw.Krp);const c7=16,u7=20,p7=13,h7="systemZoomChange",m7={default:[{featureType:"poi",stylers:[{visibility:"off"}]}],report:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{color:"#000000"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#FFFFFF"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{color:"#000000"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#FFFFFF"}]}]},f7=/^-?\d+(\.\d+)?,\s*-?\d+(\.\d+)?$/;var g7=(0,b.defineComponent)({name:"FieldsMap",components:{GoogleMapsLabel:h3,GoogleMapsCircle:o3,GoogleMapsLine:b3,MapInfoBox:K5,MapFieldTooltip:I4,FormFieldInput:fk,SimpleTooltip:$5,MapActions:M5,MapMenu:x4,MapUtilityButton:G4,MapOverlayButton:z4,ModalConfirm:J4,MapDistanceLabel:U5,BButton:u.T,SimpleMapLabel:e4,HatchFieldOverlay:C4,ReportLegend:k5,FieldNameLabel:B3,ModalMapObjectsSubType:a7},props:{companies:{type:Array,default(){return[]}},customers:{type:Object,default(){return{}}},disabledFields:{type:Object,default(){return{}}},activeFields:{type:Object,default(){return{}}},editableFields:{type:Object,default(){return{}}},defaultFields:{type:Object,default(){return{}}},initialCenterIncludeDisabled:{type:Boolean,default:!1},insertEnabled:{type:Boolean,default:!1},buttonOk:{type:Boolean,default:!1},buttonAdd:{type:Boolean,default:!1},crops:{type:Object,default:null},varieties:{type:Object,default:null},activities:{type:Object,default:null},activityTypes:{type:Object,default:null},hideAllMapActions:{type:Boolean,default:!1},hideMapActionsDiscard:{type:Boolean,default:!1},splitFieldEnabled:{type:Boolean,default:!1},splitFieldLineValid:{type:Boolean,default:void 0},controls:{type:Array,default:()=>["searchField","mapType","zoom"]},hoverEffectsEnabled:{type:Boolean,default:!1},showMenu:{type:Boolean,default:!1},featureFieldsNDVIMeanEnabled:{type:Boolean,default:!1},featureLandCadastresEnabled:{type:Boolean,default:!1},featureGISObjectsEnabled:{type:Boolean,default:!1},landCadastres:{type:Object,default:()=>{}},fieldUtilization:{type:Object,default:()=>{}},newFieldsSize:{type:Number,default:0},newFields:{type:Array,default:()=>[]},invalidNewFields:{type:Array,default:()=>[]},invalidEditFields:{type:Array,default:()=>[]},createFieldsActive:{type:Boolean,default:!1},editFieldsActive:{type:Boolean,default:!1},createMapObjectActive:{type:Boolean,default:!1},editMapObjectActive:{type:Boolean,default:!1},createReportActive:{type:Boolean,default:!1},geoObjects:{type:Object,default:()=>{}},currentMapObjectType:{type:String,default:vt.IsolationZone},showFieldMarkers:{type:Boolean,default:!0},captureRegionOrientation:{type:String,default:R3.LANDSCAPE},selectionSource:{type:String,default:"MAP"},bufferFields:{type:Array,default:()=>[]},checkDistanceActive:{type:Boolean,default:!1},fieldsToWarn:{type:Array,default:()=>[]}},data:e=>{const t=document.createElement("button");t.classList.add("map__control-button");
1const[i]=(0,ow.qv)({prefix:"fas",iconName:"check"}).node;t.append(i),t.addEventListener("click",(()=>{e.$emit("ok")}));const a=document.createElement("button");a.classList.add("map__control-button");const[n]=(0,ow.qv)({prefix:"fas",iconName:"plus"}).node;return a.append(n),a.addEventListener("click",(()=>{e.$emit("add")})),{GeoObjectType:vt,FieldColor:n4,GOOGLE_MAPS_SETTINGS:X,google:null,map:null,overlay:null,mapAddressSearchTerm:"",buttonOkElement:t,buttonAddElement:a,polygonsByFieldId:{},markersByFieldId:{},hoveredField:null,tooltipField:null,isHoveringTooltip:!1,hideCreateTooltip:!1,createTooltipX:0,createTooltipY:0,fetchingNewFieldContour:!1,mapLoaderPosition:null,splitFieldDrawingModeMapActionsPosition:null,splitFieldPolyline:null,splitFieldNewFieldA:null,splitFieldNewFieldB:null,splitPolygonActive:!1,drawPolygonActive:!1,drawing:le,mergePolygonsModalVisible:!1,mergePolygonsActive:!1,mapObjectsSubTypeModalVisible:!1,showSubLayerActive:!1,measureDistancesActive:!1,currentMeasurePolyline:null,distancePolylines:[],fieldColor:e.showMenu?n4.CROP:n4.DEFAULT,alwaysShowFieldNameTooltip:!1,layers:[],cadastreDataLayer:null,fieldUtilizationDataLayer:null,cadastrePolygonFeatures:[],cadastreLabels:[],searchByParcelNumberActive:!1,parcelSearchPoints:[],searchResultMarkersById:{},searchResultLayer:null,parcelSearchEmpyResult:!1,drawMapObjectsActive:!1,drawPolylineMapObjectsActive:!1,mapObjectPolygonsById:{},currentMapObjectPolygon:null,drawnPolylineActionsVisible:!1,showIsolationZones:!1,showMultiplierGroups:!1,terraDraw:null,terraDrawReady:!1,terraDrawMode:"static",terraDrawDesiredMode:"static",terraDrawSplitCommittedCount:0,aspectRatio:{portrait:{width:o7,height:l7},landscape:{width:l7,height:o7}},captureRegion:{top:0,left:0,width:0,height:0},showCaptureRegion:!1,showTimestamps:!1,pointsInFocus:[],fieldsLoaded:!1,minZoomLoadCadastres:c7,maxZoomLoadCadastres:u7}},computed:{mapObjectsSubTypes(){return this.$store.getters["geoObjects/getIsolationZoneSubTypes"]},fieldTooltipField(){return this.hoveredField??this.tooltipField},showFieldTooltip(){return null!=this.tooltipField&&null==this.editableFields[this.tooltipField.id]||null!=this.hoveredField&&null==this.editableFields[this.hoveredField.id]||this.isHoveringTooltip},getLayerStrokeColor(){return this.createReportActive?"black":this.parcelSearchPoints.length>0?"grey":"white"},usedVarieties(){const e=this.getCaptureAreaBounds(),t=Object.values(this.allFields).filter((t=>c4(t,e)&&null!=t.varietyId)),i=new Set(t.map((e=>e.varietyId)));return Array.from(i,(e=>this.varieties[e]))},usedCrops(){const e=this.getCaptureAreaBounds(),t=Object.values(this.allFields).filter((t=>c4(t,e)&&null!=t.cropId)),i=new Set(t.map((e=>e.cropId)));return Array.from(i,(e=>this.crops[e]))},allFields(){return{...this.disabledFields,...this.defaultFields,...this.editableFields,...this.activeFields}},isParcelSearchActive(){return this.parcelSearchPoints.length>0},isCadastreLayerActive(){return this.isLayerActive(this.layers.find((e=>e.type===r4.LAND_CADASTRES)))},isFieldUtilizationLayerActive(){return this.isLayerActive(this.layers.find((e=>e.type===r4.FIELD_UTILIZATION)))},cadastreLayerFeatures(){const e=[];return this.cadastreDataLayer?.forEach((t=>{e.push(t)})),e},visibleCadastreLayerFeatures(){const e=[];return this.cadastreDataLayer?.forEach((t=>{this.map?.getBounds()?.contains(l4(t))&&e.push(t)})),e},showSaveAndCancelOverlayButtons(){return(this.createFieldsActive||this.editFieldsActive||this.createMapObjectActive||this.editMapObjectActive)&&!this.drawPolygonActive&&!this.splitFieldEnabled&&!this.measureDistancesActive},createFieldsSplitEnabled(){return 1===Object.values(this.activeFields).length&&1===this.newFields.length&&0===Object.values(this.editableFields).length},splitFieldSizes(){const e={original:0,fieldA:0,fieldB:0};if(1===Object.values(this.activeFields).length&&null!=this.polygonsByFieldId[Object.values(this.activeFields)[0].id]){const t=this.polygonsByFieldId[Object.values(this.activeFields)[0].id];e.original=Math.floor((0,Y6.Z)(u4(t)))/1e4}return null==this.splitFieldNewFieldA?e.fieldA=this.$t("Ungültige Trennl
1inie")??"Ungültige Trennlinie":e.fieldA=Math.floor((0,Y6.Z)(u4(this.splitFieldNewFieldA)))/1e4,null==this.splitFieldNewFieldB?e.fieldB=this.$t("Ungültige Trennlinie")??"Ungültige Trennlinie":e.fieldB=Math.floor((0,Y6.Z)(u4(this.splitFieldNewFieldB)))/1e4,Object.keys(e).forEach((t=>{"number"===typeof e[t]&&0!==e[t]&&(e[t]=`${this.$t("{size} ha",{size:Bl()(e[t]).format({mantissa:4})})}`)})),e},visibleActivities(){return this.$store.getters["activities/selectedActivityIds"].map((e=>this.$store.getters["activities/gpsTrack/findById"](e))).filter(ka).filter(this.hasCoordinates)},visibleTracks(){return this.$store.getters["activities/selectedActivities"].map((e=>e.trackId)).filter(ka).filter(a4).map((e=>this.$store.getters["tracks/findById"](e))).filter(ka).filter(this.hasCoordinates)},visibleTimestamps(){return this.$store.getters["activities/selectedActivityIds"].map((e=>this.$store.getters["activities/gpsLog/findById"](e))).filter(ka)},isTerraDrawActive(){return"static"!==this.terraDrawDesiredMode}},async mounted(){const e=await cE();this.google=e;const t={tilt:0,mapTypeId:e.maps.MapTypeId.HYBRID,disableDefaultUI:!0,mapTypeControl:this.controls.includes("mapType"),mapTypeControlOptions:{style:e.maps.MapTypeControlStyle.DROPDOWN_MENU,position:e.maps.ControlPosition.TOP_RIGHT,mapTypeIds:[e.maps.MapTypeId.SATELLITE,e.maps.MapTypeId.ROADMAP,e.maps.MapTypeId.HYBRID]},zoomControl:this.controls.includes("zoom"),zoomControlOptions:{position:e.maps.ControlPosition.RIGHT_CENTER},fullscreenControl:!1,styles:this.createReportActive?m7.report:m7.default,isFractionalZoomEnabled:!0};this.$refs["map-container"]&&(this.map=new e.maps.Map(this.$refs["map-container"],t),this.map?.controls[e.maps.ControlPosition.RIGHT_BOTTOM].push(this.buttonOkElement),this.map?.controls[e.maps.ControlPosition.RIGHT_BOTTOM].push(this.buttonAddElement),this.overlay=new e.maps.OverlayView,null!==this.overlay&&(this.overlay.draw=()=>{}),this.overlay?.setMap(this.map),await this.initialize(),this.initTerraDraw())},watch:{captureRegionOrientation(e){this.displayCaptureRegion(!0,e)},createReportActive(e){this.showOrHideMarkers(),this.loadCadastres(),this.loadFieldUtilization(),this.drawLayer(this.cadastreDataLayer,this.landCadastres),this.drawLayer(this.fieldUtilizationDataLayer,this.fieldUtilization),this.drawCadastreLabels(),e?(this.drawLayer(this.cadastreDataLayer,this.landCadastres),this.displayCaptureRegion(!0,this.captureRegionOrientation),this.removeLabels(),this.map?.setMapTypeId(google.maps.MapTypeId.ROADMAP),window.addEventListener("resize",this.handleWindowResize,!0),this.map?.setOptions({styles:m7.report})):(this.drawLayer(this.cadastreDataLayer,this.landCadastres),this.drawCadastreLabels(),this.showCaptureRegion=!1,this.map?.setMapTypeId(google.maps.MapTypeId.SATELLITE),window.removeEventListener("resize",this.handleWindowResize,!0),this.map?.setOptions({styles:m7.default})),this.setDrawings()},editFieldsActive(){this.setDrawings(!1,!0)},invalidEditFields(){this.setDrawings()},showIsolationZones(){this.drawMapObjects()},showMultiplierGroups(){this.drawMapObjects()},createMapObjectActive(e){e?this.drawMapObjectsActive=!0:(this.currentMapObjectPolygon?.setMap(null),this.currentMapObjectPolygon?.setOptions({editable:!1}),this.currentMapObjectPolygon=null,this.drawMapObjectsActive=!1,this.drawPolylineMapObjectsActive=!1,this.drawnPolylineActionsVisible=!1)},editMapObjectActive(e){e||(this.currentMapObjectPolygon?.setMap(null),this.currentMapObjectPolygon?.setOptions({editable:!1}),this.currentMapObjectPolygon=null,this.drawMapObjectsActive=!1,this.drawPolylineMapObjectsActive=!1,this.drawnPolylineActionsVisible=!1)},geoObjects(){this.drawMapObjects()},mapAddressSearchTerm(e){this.parcelSearchEmpyResult=!1,""===e&&this.resetParcelSearchResult()},fieldUtilization(){this.drawLayer(this.fieldUtilizationDataLayer,this.fieldUtilization)},landCadastres(){this.drawLayer(this.cadastreDataLayer,this.landCadastres),this.drawCadastreLabels()},buttonOk(){this.updateButtons()},buttonAdd(){this.updateButtons()},insertEnabled(e){e?this.map?.setOptions({draggableCursor:"crosshair"}):this.map?.setOptions({draggableCursor:"default"})},createFieldsActive(e){e&&this.onActiveLayersChanged(this.layers)},splitFieldEnabled(e,t){this.updateSplitMode(e!==t)},drawPolygonActive(){this.updateDrawingMode()},drawMapObjectsActive(){this.updateMapObjectsDrawingMode(!0)},drawPolylineMapObjectsActive(){this.drawMapObjectsActive||this.updateMapObjectsDrawingMode(!1)},measureDistancesActive(){this.updateMeasureDistancesMode()},activeFields(e,t){this.setDrawings(!1,!this.insertEnabled);const i=Object.values(e),a=Object.values(t),n=Object.values(this.defaultFields),r=Object.values(this.allFields);if(this.createFieldsActive)return;const s=!this.fieldsLoaded&&n.length;
1s&&(this.fieldsLoaded=!0,this.onActiveOrDefaultFieldsUpdate(this.defaultFields));const o="TABLE"===this.selectionSource&&a.length===r.length&&1===i.length,l=i.length>a.length&&"TABLE"===this.selectionSource;(o||l)&&(this.pointsInFocus=[],this.onActiveOrDefaultFieldsUpdate(e))},defaultFields(){this.setDrawings()},disabledFields(e,t){this.setDrawings(),this.editableFields||(Object.values(e).length>0?this.centerOnFields(Object.values(e)):Ha()(Object.keys(e).sort(),Object.keys(t).sort())||this.createFieldsActive||this.centerOnFields(Object.values(e)))},editableFields(){this.setDrawings(),setTimeout(this.setFocusOnFieldName,300)},hoveredField(e,t){if(this.hoverEffectsEnabled&&(t&&this.setDrawings(),e)){const t=this.polygonsByFieldId[e.id];new Set(Object.keys(this.activeFields)).has(e.id)&&t.setOptions({fillColor:this.getColorForPolygon(e,X.POLYGON_ACTIVE_HOVER_COLOR),strokeColor:this.getColorForPolygon(e,X.POLYGON_ACTIVE_HOVER_COLOR),fillOpacity:.6,strokeOpacity:1,strokeWeight:this.fieldColor===n4.DEFAULT?4:0}),new Set(Object.keys(this.defaultFields)).has(e.id)&&t.setOptions({fillOpacity:.4,strokeWeight:5,strokeOpacity:this.fieldColor===n4.DEFAULT?.8:1})}},activities(){this.fieldColor===n4.ACTIVITY&&this.setDrawings()},activityTypes(){this.fieldColor===n4.ACTIVITY&&this.setDrawings()},visibleActivities(){this.recenterOnActivitySelection()},visibleTracks(){this.recenterOnActivitySelection()},pointsInFocus(e){if(e.length){const t=new google.maps.LatLngBounds;e.forEach((e=>t.extend(e))),this.map?.fitBounds(t,60)}},checkDistanceActive(e){const t=this.layers.find((e=>e.type===r4.FIELD_UTILIZATION));t?t.selected=e:this.layers.push({title:this.$t("Feldnutzung")??"",selected:e,type:r4.FIELD_UTILIZATION}),this.minZoomLoadCadastres=e?14:c7,this.onActiveLayersChanged(this.layers)}},methods:{onMapObjectSubTypesVisibilityChanged(e){this.$store.dispatch("geoObjects/setHiddenSubLayers",e),this.showSubLayerActive=e.some((e=>e.hidden))},toGoogleMapsPath:E3,toGoogleMapsPoint:S3,resetHoverTooltip(){setTimeout((()=>{this.isHoveringTooltip||(this.tooltipField=null)}),100)},onTooltipMouseover(){this.isHoveringTooltip=!0},onTooltipMouseout(){this.isHoveringTooltip=!1,this.tooltipField=null},canDrawLayer(){const e=this.map?.getZoom()??-1;return e>=this.minZoomLoadCadastres&&e<=this.maxZoomLoadCadastres||this.createReportActive&&e>=p7&&e<=this.maxZoomLoadCadastres},showOrHideMarkers(){const e=this.createFieldsActive||this.editFieldsActive;this.createReportActive||this.alwaysShowFieldNameTooltip&&!e?Object.values(this.markersByFieldId).forEach((e=>e.setMap(null))):Object.values(this.markersByFieldId).forEach((e=>e.setMap(this.map)))},handleWindowResize(){this.displayCaptureRegion(!0,this.captureRegionOrientation)},displayCaptureRegion(e,t){if(e&&t){this.showCaptureRegion=!0;const{width:e,height:i}=t===R3.LANDSCAPE?this.aspectRatio.landscape:this.aspectRatio.portrait,a=100,n=100,r=this.$refs["map-container"].clientWidth-a,s=this.$refs["map-container"].clientHeight-n,o=r/s;let l,d;o>e/i?(l=s*(e/i),d=s):(l=r,d=r*(i/e));const c=(s-d)/2+n/2,u=(r-l)/2+a/2;this.captureRegion={top:c,left:u,width:l,height:d}}else this.showCaptureRegion=!1},async printMap(e){await new Promise((e=>setTimeout(e,10)));const t=this.$refs["map-container-container"],i=window.devicePixelRatio<2?2*window.devicePixelRatio:window.devicePixelRatio||1;try{const a=await X6()(t,{useCORS:!0,scale:i}),n=this.$refs["capture-region"],r=n.clientWidth,s=n.clientHeight,o=await a.toDataURL("image/png",1),l=(t.clientWidth-r)/2,d=(t.clientHeight-s)/2,c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const t=document.createElement("canvas"),a=t.getContext("2d");t.width=r*i,t.height=s*i,a&&(a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(c,l*i,d*i,r*i,s*i,0,0,r*i,s*i),a.lineWidth=2,a.strokeStyle="black",a.strokeRect(0,0,r*i,s*i));const n=t.toDataURL("image/png",1),o=new Q6.ZP({orientation:e.orientation}),u=o.internal.pageSize.width,p=o.internal.pageSize.height;o.addImage(n,"PNG",5,5,u-10,p-10),o.save(`report_${(new Date).getTime()}.pdf`)},c.src=o}catch(a){return console.error(a),Promise.reject()}return Promise.resolve()},filteredFields(e){return Object.values(this.allFields).filter((t=>e.get("fieldId")===t.id))},saveOverlayButtonClicked(){this.createFieldsActive?this.$emit("save:newFields"):this.editFieldsActive?this.$emit("save:editFields"):(this.createMapObjectActive||this.editMapObjectActive)&&this.$emit("save:mapObject")},cancelOverlayButtonClicked(){this.createFieldsActive?this.$emit("update:createFieldsActive",!1):this.editFieldsActive?this.$emit("update:editFieldsActive",!1):this.createMapObjectActive?this.$emit("update:createMapObjectActive",!1):this.editMapObjectActive&&this.$emit("update:editMapObjectActive",!1)},drawPolygonUtilityButtonClicked(e){this.createFieldsActive?this.drawPolygonActive=!e:this.createMapObjectActive&&(this.drawMapObjectsActive=!e,this.drawPolylineMapObjectsActive=!1)},onMenuItemClicked(e){this.createMapObjectActive||this.editMapObjectActive||this.createReportActive||this.$emit("menuItem:clicked",e)},searchLinkButtonPressed(){this.searchByParcelNumberActive=!this.searchByParcelNumberActive,this.resetParcelSearchResult()},resetParcelSearchResult(){this.parcelSearchPoints=[],this.drawSearchResultMarkers(),this.drawLayer(this.cadastreDataLayer,this.landCadastres)},isLayerActive(e){return!!e&&e.selected},onPolygonSave(e){f4(e.fieldContour.geoJson.coordinates)&&this.$emit("action:save",e.id)},deleteMeasurePolyline(){if(this.currentMeasurePolyline){this.currentMeasurePolyline.setMap(null);const e=this.distancePolylines.indexOf(this.currentMeasurePolyline);this.distancePolylines.splice(e,1),this.currentMeasurePolyline=null}},checkMeasurePolyline(){this.currentMeasurePolyline?.setOptions({editable:!1,strokeOpacity:0,icons:[{icon:d7,offset:"0px",repeat:"20px"}]}),this.currentMeasurePolyline=null},finishDrawnPolyline(){this.currentMapObjectPolygon?.setOptions({editable:!1}),this.drawnPolylineActionsVisible=!1},deleteDrawnPolyline(){this.currentMapObjectPolygon?.setMap(null),this.currentMapObjectPolygon=null,this.drawnPolylineActionsVisible=!1,this.$emit("update:mapObjectPolyline",null)},splitPolygonPressed(e){this.$emit("update:splitFieldEnabled",!e)},initialize(){this.google.maps.event.addListener(this.map,"mouseout",(()=>{this.hideCreateTooltip=!0})),this.google.maps.event.addListener(this.map,"mousemove",(e=>{this.hideCreateTooltip=!1,this.createTooltipX=e.pixel.x,this.createTooltipY
1=e.pixel.y})),this.setDrawings(!0),this.drawMapObjects(),this.google.maps.event.addListener(this.map,"dragend",(async()=>{if(this.isCadastreLayerActive){const e=this.map?.getCenter();this.map?.setCenter(e)}await this.loadCadastres(),await this.loadFieldUtilization(),this.drawCadastreLabels()})),this.google.maps.event.addListener(this.map,"dragstart",(()=>{this.removeLabels()})),this.google.maps.event.addListener(this.map,"zoom_changed",(async()=>{this.removeLabels();const e=this.google.maps.event.addListener(this.map,"bounds_changed",(async()=>{this.canDrawLayer()?(this.loadCadastres(),this.loadFieldUtilization(),setTimeout(this.drawCadastreLabels,350)):(this.showLandCadastreLayer(!1),this.showFieldUtilizationLayer(!1),this.removeLabels()),this.google.maps.event.removeListener(e)}));this.map?.get(h7)&&this.map?.set(h7,!1)})),this.google.maps.event.addListener(this.map,"click",(e=>{this.insertEnabled&&!this.isTerraDrawActive&&null!=e&&null!=e.latLng&&this.insertFieldOrAddPolygon({latLng:e.latLng})})),this.insertEnabled&&this.map?.setOptions({draggableCursor:"crosshair"}),this.updateButtons(),this.updateSplitMode(),this.cadastreDataLayer=new google.maps.Data,this.fieldUtilizationDataLayer=new google.maps.Data},updateButtons(){this.buttonOk?this.buttonOkElement.style.display="block":this.buttonOkElement.style.display="none",this.buttonAdd?this.buttonAddElement.style.display="block":this.buttonAddElement.style.display="none"},addOrRemovePolygonForField(e){const t=e.id,i=new this.google.maps.LatLngBounds;if(null!=this.polygonsByFieldId[t]&&null==e.fieldContour)return this.polygonsByFieldId[t].setMap(null),delete this.polygonsByFieldId[t],null;if(null!=this.polygonsByFieldId[t])return{polygon:this.polygonsByFieldId[t],bounds:i};if("Polygon"!==e.fieldContour?.geoJson?.type)return null;const a=[];e.fieldContour.geoJson.coordinates.forEach((e=>{const t=[];e.forEach((e=>{const a={lat:e[1],lng:e[0]};t.push(a),i.extend(a)})),a.push(t)}));const n=new this.google.maps.Polygon({paths:a,strokeColor:X.POLYGON_DISABLED_STROKE_COLOR,strokeOpacity:1,strokeWeight:3,fillColor:X.POLYGON_DISABLED_FILL_COLOR,fillOpacity:.5,clickable:!0});return n.setMap(this.map),n.set("fieldId",t),this.polygonsByFieldId[t]=n,this.google.maps.event.addListener(n,"mousemove",(()=>{this.hideCreateTooltip=!0,null!=this.disabledFields[t]?this.hoveredField=this.disabledFields[t]:null!=this.activeFields[t]?this.hoveredField=this.activeFields[t]:null!=this.defaultFields[t]&&(this.hoveredField=this.defaultFields[t]),this.tooltipField=this.hoveredField})),this.google.maps.event.addListener(n,"mouseout",(()=>{null!=this.hoveredField&&this.hoveredField.id===t&&(this.hoveredField=null),this.resetHoverTooltip()})),this.google.maps.event.addListener(n,"click",(()=>{this.$emit("click:polygon",t)})),this.google.maps.event.addListener(n.getPath(),"set_at",(()=>{this.onPolygonChanged({polygon:n,fieldId:t})})),this.google.maps.event.addListener(n.getPath(),"insert_at",(()=>{this.onPolygonChanged({polygon:n,fieldId:t})})),this.google.maps.event.addListener(n,"rightclick",(e=>{null==e.vertex||n.getPath().getLength()<4||(n.getPath().removeAt(e.vertex),this.onPolygonChanged({polygon:n,fieldId:t}))})),{polygon:n,bounds:i}},onPolygonChanged({polygon:e,fieldId:t}){const i={geoJson:u4(e)};this.$emit("change:polygon",{fieldContour:i,fieldId:t})},addMarkerForField(e,t){if(!this.showFieldMarkers)return null;const i=e.id,a=new this.google.maps.LatLngBounds;if(null!=this.markersByFieldId[i])return this.markersByFieldId[i].getIcon()!==t&&this.markersByFieldId[i].setIcon(t),{marker:this.markersByFieldId[i],bounds:a};if(null==e.lat||null==e.lon)return null;const n=new this.google.maps.Marker({position:{lat:e.lat,lng:e.lon},map:this.map,icon:t});return this.markersByFieldId[i]=n,a.extend(n.getPosition()),this.google.maps.event.addListener(n,"mouseover",(()=>{this.hideCreateTooltip=!0,null!=this.disabledFields[i]?this.hoveredField=this.disabledFields[i]:null!=this.activeFields[i]?this.hoveredField=this.activeFields[i]:null!=this.defaultFields[i]&&(this.hoveredField=this.defaultFields[i]),this.tooltipField=this.hoveredField})),this.google.maps.event.addListener(n,"mouseout",(()=>{null!=this.hoveredField&&this.hoveredField.id===i&&(this.hoveredField=null),this.resetHoverTooltip()})),this.google.maps.event.addListener(n,"click",(()=>{this.$emit("click:marker",i)})),this.google.maps.event.addListener(n,"dragend",(()=>{this.$emit("change:marker",{fieldId:i,lat:n.position.lat(),lon:n.position.lng()})})),{marker:n,bounds:a}},drawSearchResultMarkers(){Object.values(this.searchResultMarkersById).forEac
1h((e=>{e.setMap(null)})),this.searchResultMarkersById={},this.parcelSearchPoints.forEach((e=>{const t=new this.google.maps.Marker({position:{lat:e.lat,lng:e.lon},map:this.map,icon:s7});this.google.maps.event.addListener(t,"click",(()=>{const e=new this.google.maps.LatLngBounds;e.extend(t.getPosition()),this.mapFitBounds({bounds:e,usePan:!0})})),this.searchResultMarkersById[e.id]=t})),this.drawSearchResultLayer()},drawMapObjects(){this.google&&(Object.values(this.mapObjectPolygonsById).forEach((e=>{e.setMap(null)})),this.mapObjectPolygonsById={},this.geoObjects&&Object.values(this.geoObjects).forEach((e=>{if((e.objectType!==vt.IsolationZone||this.showIsolationZones)&&(e.objectType!==vt.MultiplierGroup||this.showMultiplierGroups)){if("Polygon"===e.geometry.type){const t=[],i=e.geometry.coordinates;i?.forEach((e=>{const i=[];e.forEach((e=>{const t={lat:e[1],lng:e[0]};i.push(t)})),t.push(i)}));const a=new this.google.maps.Polygon({paths:t,strokeColor:e.objectType===vt.IsolationZone?X.POLYLINE_ISOLATION_ZONE_COLOR:X.POLYLINE_MULTIPLIER_GROUP_COLOR,strokeOpacity:1,strokeWeight:7,fillOpacity:0,clickable:!0});a.setMap(this.map),a.getPath().addListener("set_at",(()=>this.updateMapObjectPolygon(a))),a.getPath().addListener("insert_at",(()=>this.updateMapObjectPolygon(a))),this.google.maps.event.addListener(a,"click",(()=>{this.currentMapObjectPolygon||this.createMapObjectActive||(this.currentMapObjectPolygon=a,a.setOptions({editable:!0}),this.$emit("click:mapObject",e.id))})),this.google.maps.event.addListener(a,"rightclick",(e=>{null==e.vertex||(a.getPath().getLength()??0)<4||(this.currentMapObjectPolygon?.getPath().removeAt(e.vertex),this.updateMapObjectPolygon(a))})),this.mapObjectPolygonsById[e.id]=a}if(e.geometry.type===bt.LineString){const t=e.geometry.coordinates,i=[];t.forEach((e=>{const t={lat:e[1],lng:e[0]};i.push(t)}));const a=new this.google.maps.Polyline({path:i,strokeColor:e.objectType===vt.IsolationZone?X.POLYLINE_ISOLATION_ZONE_COLOR:X.POLYLINE_MULTIPLIER_GROUP_COLOR,strokeOpacity:1,strokeWeight:7,clickable:!0});a.setMap(this.map),a.getPath().addListener("set_at",(()=>this.updateMapObjectPolygon(a))),a.getPath().addListener("insert_at",(()=>this.updateMapObjectPolygon(a))),this.google.maps.event.addListener(a,"click",(()=>{this.currentMapObjectPolygon||this.createMapObjectActive||(this.currentMapObjectPolygon=a,a.setOptions({editable:!0}),this.$emit("click:mapObject",e.id))})),this.google.maps.event.addListener(a,"rightclick",(e=>{null==e.vertex||(a.getPath().getLength()??0)<3||(this.currentMapObjectPolygon?.getPath().removeAt(e.vertex),this.updateMapObjectPolygon(a))})),this.mapObjectPolygonsById[e.id]=a}}})))},async setDrawings(e=!1,t=!1){if(!this.google)return;t&&(Object.values(this.polygonsByFieldId).forEach((e=>e.setMap(null))),this.polygonsByFieldId={});let i=!1;const a=new this.google.maps.LatLngBounds,n=[];Object.values(this.defaultFields).forEach((e=>{if(n.push(e.id),Object.values(this.activeFields).length>0)null!=this.markersByFieldId[e.id]&&(this.markersByFieldId[e.id].setMap(null),delete this.markersByFieldId[e.id]);else{const t=this.addMarkerForField(e,r7);null!=t&&(i=!0,a.union(t.bounds),t.marker.setOptions({draggable:!1}))}const t=this.addOrRemovePolygonForField(e);if(null==t)return;const r=this.varieties[e.varietyId]?.mapHatchStyle;t.polygon.setOptions({strokeColor:this.getColorForPolygon(e,X.POLYGON_DEFAULT_STROKE_COLOR),fillColor:this.getColorForPolygon(e,X.POLYGON_DEFAULT_FILL_COLOR),fillOpacity:this.fieldColor===n4.VARIETY&&r?0:.6,strokeWeight:this.createReportActive?1:3,strokeOpacity:1,editable:!1,zIndex:1}),this.initialCenterIncludeDisabled&&(i=!0,a.union(t.bounds))})),Object.values(this.disabledFields).forEach((e=>{n.push(e.id),null!=this.markersByFieldId[e.id]&&(this.markersByFieldId[e.id].setMap(null),delete this.markersByFieldId[e.id]);const t=this.addOrRemovePolygonForField(e);null!=t&&(t.polygon.setOptions({strokeColor:X.POLYGON_DISABLED_STROKE_COLOR,strokeWeight:this.createReportActive?1:3,fillColor:X.POLYGON_DISABLED_FILL_COLOR,fillOpacity:this.fieldColor===n4.VARIETY?0:.5,editable:!1,zIndex:2}),this.initialCenterIncludeDisabled&&(i=!0,a.union(t.bounds)))}
1)),Object.values(this.activeFields).forEach((e=>{const t=this.invalidNewFields.some((t=>t.id===e.id))||this.invalidEditFields.some((t=>t.id===e.id));n.push(e.id);const r=this.addMarkerForField(e,n7);null!=r&&(i=!0,a.union(r.bounds),r.marker.setOptions({draggable:!1}));const s=this.addOrRemovePolygonForField(e);null!=s&&(i=!0,a.union(s.bounds),s.polygon.setOptions({strokeColor:t?X.POLYGON_INVALID_COLOR:this.getColorForPolygon(e,X.POLYGON_ACTIVE_STROKE_COLOR),strokeWeight:this.createReportActive?1:3,fillColor:t?X.POLYGON_INVALID_COLOR:this.getColorForPolygon(e,X.POLYGON_ACTIVE_FILL_COLOR),fillOpacity:t?.5:this.getOpacityForPolygon(e,.6),editable:!1,zIndex:3}))})),Object.values(this.editableFields).forEach((e=>{const t=this.invalidNewFields.some((t=>t.id===e.id))||this.invalidEditFields.some((t=>t.id===e.id));n.push(e.id);const r=this.addOrRemovePolygonForField(e);null!=r&&(i=!0,a.union(r.bounds),r.polygon.setOptions({strokeColor:t?X.POLYGON_INVALID_COLOR:X.POLYGON_ACTIVE_STROKE_COLOR,strokeWeight:this.createReportActive?1:3,fillColor:t?X.POLYGON_INVALID_COLOR:X.POLYGON_ACTIVE_FILL_COLOR,fillOpacity:.5,editable:!0,zIndex:100}));const s=this.addMarkerForField(e,n7);null!=s&&(i=!0,a.union(s.bounds),s.marker.setOptions({draggable:!0}))})),Object.keys(this.polygonsByFieldId).forEach((e=>{n.includes(e)||(this.polygonsByFieldId[e].setMap(null),delete this.polygonsByFieldId[e])})),Object.keys(this.markersByFieldId).forEach((e=>{n.includes(e)||(this.markersByFieldId[e].setMap(null),delete this.markersByFieldId[e])})),this.showOrHideMarkers(),e&&(await this.$nextTick(),i?(this.map?.set(h7,!0),this.mapFitBounds({bounds:a})):this.centerMapByCompanies())},mapFitBounds({bounds:e,maxZoom:t=16,usePan:i=!1}){this.google.maps.event.addListenerOnce(this.map,"bounds_changed",(()=>{this.map?.setOptions({maxZoom:null})})),this.map?.setOptions({maxZoom:t}),i?(this.map?.set(h7,!0),this.map?.setZoom(t),this.map?.panToBounds(e,500)):(this.map?.set(h7,!0),this.map?.fitBounds(e))},async centerMapByCompanies(){let e=!1;const t=new this.google.maps.LatLngBounds;return this.companies.forEach((i=>{null!=i.location&&(t.extend({lat:i.location.lat,lng:i.location.lon}),e=!0)})),e?(this.map?.set(h7,!0),this.map?.fitBounds(t),void this.map?.setZoom(16)):(await Promise.all(this.companies.map((i=>new Promise((a=>{if(null==i.region)return void a();const n=new this.google.maps.Geocoder;n.geocode({address:i.region.name},((i,n)=>{n===this.google.maps.GeocoderStatus.OK&&i[0]?(e=!0,t.union(i[0].geometry.viewport),a()):a()}))}))))),e?(this.map?.set(h7,!0),void this.map?.fitBounds(t)):(this.map?.setCenter({lat:47.59548672381274,lng:13.628580142116551}),this.map?.set(h7,!0),void this.map?.setZoom(7)))},async mapAddressSearch(){if(this.searchByParcelNumberActive){const{mapApi:t}=this.$api;try{const e=await t.mapLayerLandCadastreSearch({query:this.mapAddressSearchTerm});if(200===e.status){if(this.parcelSearchPoints=e.data.data??[],0===this.parcelSearchPoints.length)return void(this.parcelSearchEmpyResult=!0);this.parcelSearchEmpyResult=!1;const t=new this.google.maps.LatLngBounds;this.parcelSearchPoints.forEach((({lat:e,lon:i})=>{t.extend({lat:e,lng:i})})),this.mapFitBounds({bounds:t}),this.drawSearchResultMarkers(),this.drawLayer(this.cadastreDataLayer,this.landCadastres)}}catch(e){console.error("parcel search error",e)}}else{const e=f7.test(this.mapAddressSearchTerm);if(e){const[e,t]=this.mapAddressSearchTerm.split(",").map(Number);this.parcelSearchPoints=[{id:"1",lat:e,lon:t}];const i=new this.google.maps.LatLng(e,t);this.map?.setCenter(i),this.map?.setZoom(16)}else{const e=new this.google.maps.Geocoder;e.geocode({address:this.mapAddressSearchTerm},((e,t)=>{t===this.google.maps.GeocoderStatus.OK&&e[0]&&(this.map?.setCenter(e[0].geometry.location),this.map?.fitBounds(e[0].geometry.viewport),this.mapAddressSearchTerm=e[0].formatted_address)}))}this.drawSearchResultMarkers(),this.map?.set(h7,!0)}},mapMouseOut(){this.hideCreateTooltip=!0},mapMouseMove(e){null==e.target.closest(".gmnoprint")?(this.hideCreateTooltip=!1,this.createTooltipX=e.offsetX,this.createTooltipY
1=e.offsetY):this.hideCreateTooltip=!0},async insertFieldOrAddPolygon({latLng:e,fieldId:t}){if(this.fetchingNewFieldContour||null==e)return;this.mapLoaderPosition=this.overlay?.getProjection().fromLatLngToContainerPixel(e),this.fetchingNewFieldContour=!0;const i=e.lat(),a=e.lng(),n={lat:i,lon:a};try{const{data:e}=await l().post("/admin/sen4/fieldContourByPoint",{lat:i,lon:a});n.fieldContour={geoJson:e.contour}}catch(r){console.error("FieldsMap: Unable to load field contour from Sen4 API",r),n.fieldContour=this.createDummyContourFromLatLng(i,a)}null==t?this.$emit("insert",n):this.$emit("addPolygon",{...n,id:t}),this.fetchingNewFieldContour=!1},createDummyContourFromLatLng(e,t){return{geoJson:{coordinates:[[[t-.001,e-5e-4],[t+.001,e-5e-4],[t+.001,e+5e-4],[t-.001,e+5e-4],[t-.001,e-5e-4]]],type:"Polygon"}}},mapActionsPixelPosition(e){if(null==e.lat||null==e.lon)return{x:0,y:0};const t=new this.google.maps.LatLng(e.lat,e.lon);return this.overlay?.getProjection().fromLatLngToContainerPixel(t)},mapActionsSplitLinePosition(e){const t=e.getPath().getLength();if(t<2)return{x:0,y:0};const i=e.getPath().getAt(t-1);return this.overlay?.getProjection().fromLatLngToContainerPixel(i)},centerOnFields(e){e.filter(ka).flatMap((e=>e.fieldContour?.geoJson?.coordinates)).filter(ka).map(this.toGoogleMapsPath).flatMap((e=>e.getArray())).forEach((e=>this.pointsInFocus.push(e)))},setFocusOnFieldName(){if(!this.insertEnabled)return;const e=Object.values(this.editableFields).filter((e=>"string"!==typeof e.name||0===e.name.length));if(0===e.length)return;const[t]=e;if(!Array.isArray(this.$refs[`fields-map__map-field-tooltip--${t.id}`])||null==this.$refs[`fields-map__map-field-tooltip--${t.id}`][0])return;const i=this.map?.getBounds(),a=this.markersByFieldId[t.id],n=a.getPosition();null!=n&&i?.contains({lat:n.lat(),lng:n.lng()})&&this.$refs[`fields-map__map-field-tooltip--${t.id}`][0].$refs["map-field-tooltip__name-input"].focus()},onMapActionAddPolygon(e){null!=this.markersByFieldId[e]&&this.insertFieldOrAddPolygon({latLng:this.markersByFieldId[e].getPosition(),fieldId:e})},initTerraDraw(){const{map:e}=this;if(null==e||null!=this.terraDraw)return;if(null==e.getProjection())return void this.google.maps.event.addListenerOnce(e,"projection_changed",(()=>this.initTerraDraw()));const t=k3(this.google.maps,e,{getMapObjectColor:()=>this.mapObjectStrokeColor()});this.terraDraw=(0,b.markRaw)(t),t.on("ready",(()=>{this.terraDrawReady=!0,this.terraDrawMode!==this.terraDrawDesiredMode&&(t.setMode(this.terraDrawDesiredMode),this.terraDrawMode=this.terraDrawDesiredMode)})),t.on("finish",this.onTerraDrawFinish),t.on("change",this.onTerraDrawChange),t.start()},setTerraDrawMode(e){this.terraDrawDesiredMode=e,null!=this.terraDraw&&this.terraDrawReady&&(this.terraDraw.setMode(e),this.terraDrawMode=e)},clearTerraDraw(){null!=this.terraDraw&&this.terraDrawReady&&this.terraDraw.clear()},exitTerraDrawMode(e){this.terraDrawDesiredMode===e&&(this.clearTerraDraw(),this.setTerraDrawMode("static"))},mapObjectStrokeColor(){return this.currentMapObjectType===vt.IsolationZone?X.POLYLINE_ISOLATION_ZONE_COLOR:X.POLYLINE_MULTIPLIER_GROUP_COLOR},onTerraDrawFinish(e,t){if("draw"!==t.action)return;const i=this.terraDraw?.getSnapshotFeature(e);if(null!=i)switch(i.properties.mode){case F3.POLYGON_FIELD:this.completeFieldPolygon(i),this.drawPolygonActive=!1;break;case F3.POLYGON_MAPOBJECT:this.completeMapObjectPolygon(i),this.drawMapObjectsActive=!1;break;case F3.LINESTRING_MAPOBJECT:this.completeMapObjectPolyline(i),this.drawPolylineMapObjectsActive=!1;break;case F3.LINESTRING_MEASURE:this.completeMeasurePolyline(i),this.measureDistancesActive=!1;break;case F3.LINESTRING_SPLIT:this.finalizeSplitLine(i,!1);break;default:break}},onTerraDrawChange(){if(this.terraDrawDesiredMode!==F3.LINESTRING_SPLIT||null!=this.splitFieldPolyline||null==this.terraDraw)return;const e=this.terraDraw.getSnapshot().find((e=>e.properties.mode===F3.LINESTRING_SPLIT&&"LineString"===e.geometry.type));if(null==e||"LineString"!==e.geometry.type)return;const t=e.geometry.coordinates.length-1;if(t===this.terraDrawSplitCommittedCount)return;if(this.terraDrawSplitCommittedCount=t,t<2||null==this.overlay)return void(this.splitFieldDrawingModeMapActionsPosition=null);const i=S3(e.geometry.coordinates[t-1]);this.splitFieldDrawingModeMapActionsPosition=this.overlay.getProjection()?.fromLatLngToContainerPixel(i)??null},completeFieldPolygon(e){if("Polygon"!==e.geometry.type)return;const t=new this.google.maps.Polygon({paths:E3(e.geometry.coordinates[0]),geodesic:!0,strokeOpacity:1,strokeColor:X.POLYGON_ACTIVE_STROKE_COLOR,strokeWeight:3,zIndex:4,editable:!0});this.$emit("polygon:complete",t)},completeMapObjectPolygon(e){if("Polygon"!==e.geometry.type)return;const t=e.geometry.coordinates[0].slice(0,-1),i=new this.google.maps.Polygon({paths:E3(t),geodesic:!0,strokeOpacity:1,strokeColor:this.mapObjectStrokeColor(),strokeWeight:7,fillOpacity:0,zIndex:5,editable:!0});i.setMap(this.map),this.currentMapObjectPolygon=i,i.getPath().addListener("set_at",(()=>this.updateMapObjectPolygon(i))),i.getPath().addListener("insert_at",(()=>this.updateMapObjectPolygon(i))),this.google.maps.event.addListener(i,"rightclick",(e=>{null==e.vertex||(i.getPath().getLength()??0)<4||(this.currentMapObjectPolygon?.getPath().removeAt(e.vertex),this.updateMapObjectPolygon(i))})),this.updateMapObjectPolygon(i)},completeMapObjectPolyline(e){if("LineString"!==e.geometry.type)return;const t=new this.google.maps.Polyline({path:E3(e.geometry.coordinates),geodesic:!0,strokeOpacity:1,strokeColor:this.mapObjectStrokeColor(),strokeWeight:7,zIndex:5,editable:!0});t.setMap(this.map),this.currentMapObjectPolygon=t,this.drawnPolylineActionsVisible=!0,this.google.maps.event.addListener(t,"click",(()=>{this.currentMapObjectPolygon=t,t.setOptions({editable:!0}),this.drawnPolylineActionsVisible=!0})),t.getPath().addListener("set_at",(()=>this.updateMapObjectPolygon(t))),t.getPath().addListener("insert_at",(()=>this.updateMapObjectPolygon(t))),this.google.maps.event.addListener(t,"rightclick",(e=>{null==e.vertex||(t.getPath().getLength()??0)<4||(this.currentMapObjectPolygon?.getPath().removeAt(e.vertex),this.updateMapObjectPolygon(t))})),this.updateMapObjectPolygon(t)},completeMeasurePolyline(e){if("LineString"!==e.geometry.type)return;const t=new this.google.maps.Polyline({path:E3(e.geometry.coordinates),geodesic:!0,strokeOpacity:1,strokeColor:X.MEASURE_DISTANCE_LINE_COLOR,strokeWeight:3,zIndex:4});t.setMap(this.map),this.currentMeasurePolyline&&this.currentMeasurePolyline.setOptions({editable:!1}),this.distancePolylines.push(t),this.currentMeasurePolyline=t,t.set("timestamp",(new Date).valueOf()),t.addListener("click",(()=>{t.setOptions({editable:!0,strokeOpacity:1,icons:[]}),this.currentMeasurePolyline=t})),t.getPath().addListener("set_at",(()=>this.updatePolyline(t))),t.getPath().addListener("insert_at",(()=>this.updatePolyline(t))),t.setOptions({editable:!0,strokeOpacity:0,icons:[{icon:d7,offset:"0px",repeat:"20px"}]})},finalizeSplitLine(e,t){if("LineString"!==e.geometry.type)return;const i=t?e.geometry.coordinates.slice(0,-1):e.geometry.coordinates;if(i.length<2)return;const a=new this.google.maps.Polyline({path:E3(i),geodesic:!0,strokeOpacity:1,strokeColor:A3,strokeWeight:3,zIndex:4,editable:!0});a.setMap(this.map),a.getPath().addListener("set_at",this.calculateSplitFieldSizes),a.getPath().addListener("insert_at",this.calculateSplitFieldSizes),this.splitFieldPolyline=a,this.calculateSplitFieldSizes(),this.$nextTick((()=>this.exitTerraDrawMode(F3.LINESTRING_SPLIT)))},finishSplitDrawing(){const e=this.terraDraw?.getSnapshot().find((e=>e.properties.mode===F3.LINESTRING_SPLIT&&"LineString"===e.geometry.type));null!=e&&this.finalizeSplitLine(e,!0)},updateSplitMode(e=!0){e&&(null!=this.splitFieldPolyline&&(this.splitFieldPolyline.setMap(null),this.splitFieldPolyline=null),this.terraDrawSplitCommittedCount=0,this.splitFieldDrawingModeMapActionsPosition=null,this.splitFieldNewFieldA=null,this.splitFieldNewFieldB=null,this.$emit("update:splitFieldLineValid",void 0),this.clearTerraDraw()),this.splitFieldEnabled&&1===Object.values(this.activeFields).length&&null==this.splitFieldPolyline?this.setTerraDrawMode(F3.LINESTRING_SPLIT):this.exitTerraDrawMode(F3.LINESTRING_SPLIT)},updateMapObjectsDrawingMode(e=!0){this.drawMapObjectsActive&&e?this.setTerraDrawMode(F3.POLYGON_MAPOBJECT):this.drawPolylineMapObjectsActive&&!e?this.setTerraDrawMode(F3.LINESTRING_MAPOBJECT):this.exitTerraDrawMode(e?F3.POLYGON_MAPOBJECT:F3.LINESTRING_MAPOBJECT)},updateMapObjectPolygon(e){const t=u4(e);this.$emit("update:mapObjectPolyline",t)},updateDrawingMode(){this.drawPolygonActive?this.setTerraDrawMode(F3.POLYGON_FIELD):this.exitTerraDrawMode(F3.POLYGON_FIELD)},updateMeasureDistancesMode(){this.measureDistancesActive?this.setTerraDrawMode(F3.LINESTRING_MEASURE):this.exitTerraDrawMode(F3.LINESTRING_MEASURE)},calculateSplitFieldSizes(){let e=null;const t=[],i=[],a=[],n=[],r=[],s=[];let o=[];if(this.splitFieldNewFieldA=null,this.splitFieldNewFieldB=null,null==this.splitFieldPolyline||1!==Object.values(this.activeFields).length||null==this.polygonsByFieldId[Object.values(this.activeFields)[0].id])return void this.$emit("update:splitFieldLineValid",void 0);const l=this.polygonsByFieldId[Object.values(this.activeFields)[0].id];let d,c;
1if(e=t,l.getPath().forEach((t=>{if(null==d)return d=t,void e.push(t);let o;this.splitFieldPolyline?.getPath().forEach((l=>{if(null==o)return void(o=l);const c=t4(d.lat(),d.lng(),t.lat(),t.lng(),o.lat(),o.lng(),l.lat(),l.lng());c&&(n.push(new this.google.maps.LatLng({lat:c.x,lng:c.y})),1===n.length?(e=i,r.push(o),r.push(l)):2===n.length&&(e=a,s.push(o),s.push(l))),o=l})),d=t,e.push(t)})),2===n.length){if(r[0]===s[0]&&r[1]===s[1])o=n;else{let e,t=!1;this.splitFieldPolyline.getPath().forEach((i=>{if(null==e||t)e=i;else{if(r[0]===e&&r[1]===i){if(o.push(n[0]),o.length>1)return void(t=!0)}else if(s[0]===e&&s[1]===i&&(o.push(n[1]),o.length>1))return void(t=!0);o.length>0&&(o.push(i),e=i)}}))}c=o[0]===n[0]?t.concat(o,a):t.concat(t3()(o),a),this.splitFieldNewFieldA=new this.google.maps.Polygon({paths:c}),c=o[0]===n[1]?o.concat(i):t3()(o).concat(i),this.splitFieldNewFieldB=new this.google.maps.Polygon({paths:c}),this.$emit("update:splitFieldLineValid",!0),this.$emit("update:newFieldPolygons",{geoJsonA:u4(this.splitFieldNewFieldA),geoJsonB:u4(this.splitFieldNewFieldB)})}else this.$emit("update:splitFieldLineValid",!1)},async onFieldColorChanged(e){this.fieldColor=e,this.fieldColor===n4.ACTIVITY&&this.$emit("loadActivities"),this.fieldColor===n4.NDVI&&this.$emit("loadNdvi"),this.fieldColor===n4.MBI&&this.$emit("loadMbi"),this.setDrawings()},onActiveLayersChanged(e){this.layers=e;const t=e.find((e=>e.type===r4.LAND_CADASTRES)),i=e.find((e=>e.type===r4.FIELD_UTILIZATION)),a=e.find((e=>e.type===r4.ISOLATION_ZONES)),n=e.find((e=>e.type===r4.MULTIPLIER_GROUPS));if(this.showIsolationZones=a?.selected??!1,this.showMultiplierGroups=n?.selected??!1,this.isCadastreLayerActive||(this.searchByParcelNumberActive=!1),t?.selected&&i?.selected&&this.canDrawLayer()&&this.createFieldsActive)return this.loadFieldUtilization(),this.showFieldUtilizationLayer(!0),void this.showLandCadastreLayer(!1);t?.selected&&this.canDrawLayer()?(this.loadCadastres(),this.showLandCadastreLayer(!0)):this.showLandCadastreLayer(!1),i?.selected&&this.canDrawLayer()?(this.loadFieldUtilization(),this.showFieldUtilizationLayer(!0)):this.showFieldUtilizationLayer(!1)},alwaysShowFieldNameChanged(e){this.alwaysShowFieldNameTooltip=e,this.showOrHideMarkers()},onActiveOrDefaultFieldsUpdate(e){this.updateSplitMode(),this.centerOnFields(Object.values(e))},getColorForPolygon(e,t){if(this.fieldColor===n4.CROP&&e.cropId&&this.crops[e.cropId]){const i=this.crops[e.cropId].mapPolygonColor;return i||t}if(this.fieldColor===n4.VARIETY&&e.varietyId&&this.varieties[e.varietyId]){const i=this.varieties[e.varietyId].mapPrimaryColor;return i||t}if(this.fieldColor===n4.ACTIVITY){const t=d4(e.id,Object.values(this.activities),this.activityTypes);if(t)return`#${t.appColor}`}return this.fieldColor===n4.NDVI&&e.ndviProps?e.ndviProps.fill:this.fieldColor===n4.MBI&&e.mbiProps?e.mbiProps.fill:t},getOpacityForPolygon(e,t){return this.fieldColor===n4.CROP&&e.cropId&&this.crops[e.cropId]||this.fieldColor===n4.VARIETY&&e.varietyId&&this.varieties[e.varietyId]||this.fieldColor===n4.ACTIVITY&&d4(e.id,Object.values(this.activities),this.activityTypes)||this.fieldColor===n4.NDVI&&e.ndviProps||this.fieldColor===n4.MBI&&e.mbiProps?1:t},findLastActivityTypeOfField(e){return this.fieldColor===n4.ACTIVITY?d4(e.id,Object.values(this.activities),this.activityTypes):null},showLandCadastreLayer(e){e?(this.cadastreDataLayer?.setMap(this.map),this.drawCadastreLabels()):(this.cadastreDataLayer?.setMap(null),this.removeLabels())},showFieldUtilizationLayer(e){e?this.fieldUtilizationDataLayer?.setMap(this.map):this.fieldUtilizationDataLayer?.setMap(null)},loadCadastres(){this.isCadastreLayerActive&&(this.canDrawLayer()?(this.$emit("update:bounds",this.map?.getBounds()),this.cadastreDataLayer?.setMap(this.map)):this.cadastreDataLayer?.setMap(null))},loadFieldUtilization(){this.isFieldUtilizationLayerActive&&(this.canDrawLayer()?(this.$emit("update:fieldUtilization",this.map?.getBounds()),this.fieldUtilizationDataLayer?.setMap(this.map)):this.fieldUtilizationDataLayer?.setMap(null))},drawSearchResultLayer(){this.searchResultLayer&&this.searchResultLayer.setMap(null),this.searchResultLayer=new this.google.maps.Data,this.parcelSearchPoints.forEac
1h((e=>{const t=this.cadastrePolygonFeatures.find((t=>t.getId()===e.id));t&&this.searchResultLayer?.add(t)})),this.searchResultLayer?.addListener("click",(e=>{const t=this.searchResultLayer?.getFeatureById(e.feature.getId());t&&this.$emit("click:layerPolygon",{feature:e.feature,latLng:e.latLng,data:this.landCadastres})})),this.searchResultLayer?.setStyle({strokeWeight:5,strokeColor:X.POLYGON_ACTIVE_HOVER_COLOR,fillOpacity:0,zIndex:10}),this.searchResultLayer?.setMap(this.map)},drawLayer(e,t){let i=!1;e.forEach((t=>{e.remove(t)})),Object.values(t).length>0&&(Object.values(t).forEach((t=>{const a=!!Object.prototype.hasOwnProperty.call(t,"parcelNumber");a&&!i&&(this.cadastrePolygonFeatures=[],i=!0);const n=[];if(t.geometry){const{coordinates:i}=t.geometry;if(i){i.forEach((e=>{const t=[];e.forEach((e=>{const i={lat:e[1],lng:e[0]};t.push(i)})),n.push(t)}));const r=new this.google.maps.Data.Polygon(n),s=new google.maps.Data.Feature({geometry:r,id:t.id,properties:a?{parcelNumber:t.parcelNumber}:{}});e.add(s),a&&this.cadastrePolygonFeatures.push(s)}}})),e.addListener("click",(i=>{const a=e.getFeatureById(i.feature.getId());a&&this.$emit("click:layerPolygon",{feature:i.feature,latLng:i.latLng,data:t})})),e.addListener("mouseover",(t=>{e.overrideStyle(t.feature,{strokeWeight:5,strokeColor:X.POLYGON_ACTIVE_HOVER_COLOR})})),e.addListener("mouseout",(t=>{e.overrideStyle(t.feature,{fillOpacity:0,strokeWeight:this.createReportActive?.3:1,strokeColor:this.getLayerStrokeColor})})),e.setStyle({fillOpacity:0,strokeWeight:this.createReportActive?.3:1,strokeColor:this.getLayerStrokeColor}),this.drawSearchResultLayer())},updatePolyline(e){const t=this.distancePolylines.findIndex((t=>t===e));e.set("timestamp",(new Date).valueOf()),this.distancePolylines[t]=e},drawCadastreLabel(e,t){const i=l4(e),a=document.createElement("div");if(a.className="polygon-label",a.innerHTML=String(e.getProperty("parcelNumber")??""),t.getProjection()){{const e=t.getProjection().fromLatLngToContainerPixel(i);a.style.top=`${e?.y}px`,a.style.left=`${e?.x}px`}this.map?.getDiv().appendChild(a),this.cadastreLabels.push(a)}}
1,removeLabels(){this.cadastreLabels.forEach((e=>{e.remove()})),this.cadastreLabels=[]},drawCadastreLabels(){if(!this.isCadastreLayerActive||this.createReportActive)return void this.removeLabels();if(this.removeLabels(),this.map?.getZoom()<this.minZoomLoadCadastres)return;const e=new this.google.maps.OverlayView;e.draw=()=>{},e.setMap(this.map),this.cadastreDataLayer?.forEach((t=>{this.map?.getBounds()?.contains(l4(t))&&this.drawCadastreLabel(t,e)})),e.setMap(null)},firstPointIn(e){const t=e.coordinates.flat(1)[0];return this.toGoogleMapsPoint(t)},lastPointIn(e){const t=e.coordinates.flat(1).slice(-1)[0];return this.toGoogleMapsPoint(t)},recenterOnActivitySelection(){let e=this.visibleActivities.map((e=>e.coordinates)).flat(2).map(this.toGoogleMapsPoint);e.length||(e=this.visibleTracks.map((e=>e.coordinates)).flat(2).map(this.toGoogleMapsPoint)),e.forEach((e=>this.pointsInFocus.push(e)))},hasCoordinates(e){return e.coordinates.flat(1).length>0},toDate(e){return new Date(1e3*e)},formatTime(e){const t=e.toTimeString().split(" ")[0];return t.substring(0,5)},inferPillFillColor(e,t){switch(e){case 0:return this.drawing.tracks.start_circle.fill.color;case t.length-1:return this.drawing.tracks.end_circle.fill.color;default:return""}},inferPillTextColor(e,t){switch(e){case 0:case t.length-1:return this.drawing.timestamps.text.outline;default:return this.drawing.timestamps.text.fill}},inferPillTextOutline(e,t){switch(e){case 0:case t.length-1:return"";default:return this.drawing.timestamps.text.outline}},toLiteral(e){return{lng:e.lon,lat:e.lat}},isVisibleInViewPort(e){return this.map?.getBounds()?.contains(this.toLiteral(e))||!1},getCaptureAreaBounds(){const e=this.$refs["map-container"],t=this.$refs["capture-region"],i=e?.getBoundingClientRect(),a=t?.getBoundingClientRect();if(i&&a){const e={x:a.left-i.left,y:a.bottom-i.top},t={x:a.right-i.left,y:a.top-i.top},n=this.overlay?.getProjection().fromContainerPixelToLatLng(new google.maps.Point(e.x,e.y)),r=this.overlay?.getProjection().fromContainerPixelToLatLng(new google.maps.Point(t.x,t.y));return new google.maps.LatLngBounds(n,r)}throw new Error("Could not get bounds for capture area")}}}),y7=g7,v7=(0,ew.Z)(y7,K6,q6,!1,null,"c60c0d8a",null),b7=v7.exports,w7=(0,b.defineComponent)({__name:"ActivitiesMapContainer",props:{fields:null,varieties:null,crops:null,activities:null,activityTypes:null},setup(e){return{__sfc:!0,FieldsMap:b7}}}),C7=w7,F7=(0,ew.Z)(C7,W6,Z6,!1,null,"2a7c000a",null),A7=F7.exports,k7=(0,b.defineComponent)({__name:"PageActivitiesMap",setup(e){const t=(0,NL.tv)(),i=Gb.translate,a=(0,b.ref)(),n=(0,b.ref)(),r=[{text:i("Auswahl aufheben"),handler:()=>a.value.$refs.tableContainer.$refs.table.selectAllVisible(!1)},{text:i("Auswahl umkehren"),handler:()=>a.value.$refs.tableContainer.$refs.table.invertSelection()},{text:i("Alle auswählen"),handler:()=>a.value.$refs.tableContainer.$refs.table.selectAllVisible(!0)}];(0,b.onMounted)((()=>{Lb.dispatch("activities/subscribe"),Lb.dispatch("activityTypes/subscribe"),Lb.dispatch("fields/subscribe"),Lb.dispatch("varieties/subscribe"),Lb.dispatch("products/crops/subscribe")}));const s=(0,b.computed)((()=>Lb.getters.currentCompaniesHaveFeature(Hr.FEATURE_ACTIVITIES))),o=(0,b.computed)((()=>Lb.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MAP)&&Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP))),l=(0,b.computed)((()=>Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP))),d=(0,b.computed)((()=>Lb.getters["activities/loading"]||Lb.getters["fields/loading"]))||Lb.getters["varieties/loading"]||Lb.getters["products/crops/loading"]||Lb.getters["activityTypes/loading"],c=(0,b.computed)((()=>Lb.state.fields.data)),u=(0,b.computed)((()=>Lb.state.varieties.data)),p=(0,b.computed)((()=>Lb.state.products.crops.data)),h=(0,b.computed)((()=>Lb.state.activities.data)),m=(0,b.computed)((()=>Lb.state.activityTypes.data)),f=(0,b.computed)((()=>Lb.getters["activities/selectedActivityIds"]));function g(){n.value?.show()}return{__sfc:!0,router:t,$t:i,sidebarActivities:a,modalPageSettings:n,buttonUpdateSelection:r,currentCompaniesHaveFeature:s,mapFeatureEnabled:o,mapFeatureVisible:l,loading:d,fields:c,varieties:u,crops:p,activities:h,activityTypes:m,selectedActivityIds:f,onShowSettings:g,TheContentbar:HL,ThePageSkeleton:$w,SidebarActivities:G6,CompanySwitch:qw,DropdownPageOptions:YL,FeatureNotAvailable:Ew,ProcessOrderSwitch:lV,ButtonDropdown:mV,ModalPageSettingsContainer:yR,ActivitiesMapContainer:A7}}}),S7=k7,E7=(0,ew.Z)(S7,k6,S6,!1,null,"ae311eea",null),I7=E7.exports,_7=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:e}){return[t("ProcessOrderSwitch",{staticClass:"ml-4",attrs:{slim:!e}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!e}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"w-100 h-100 d-flex"},[t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1)]},proxy:!0}])})},D7=[];ow.vI.add(yF.AX7);var M7={name:"PageCropRotation",components:{ThePageSkeleton:$w,TheContentbar:HL,ProcessOrderSwitch:lV,CompanySwitch:qw},data(){return{}}
1,computed:{currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_CROP_ROTATION)}},watch:{soilSamplesEnabled:{handler(){!0===this.currentCompaniesHaveFeature.enabled&&this.$router.replace({name:"crop-rotation--agridat"})},immediate:!0}}},P7=M7,T7=(0,ew.Z)(P7,_7,D7,!1,null,"8563e6f2",null),x7=T7.exports,B7=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[e.editMode?e._e():t("Button",{attrs:{icon:"plus-circle","leading-icon":"","component-namespace-name":"ButtonAddFields",disabled:e.fieldsReadOnly,"tooltip-options":{boundary:"viewport"}},on:{click:e.create}},[e._v(" "+e._s(e.$t("Felder hinzufügen"))+" ")]),t("ButtonDropdown",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection},on:{click:function(t){e.selectedRows=[]}}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"pencil-alt","leading-icon":"","component-namespace-name":"ButtonEditFields",disabled:e.fieldsReadOnly,title:e.$t("Bearbeiten"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.edit}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteFields",disabled:e.fieldsReadOnly,title:e.$t("Löschen"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:()=>e.$refs.table.removeSelectedEntries()}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportFields",disabled:e.exportDisabled,title:e.$t("Auswahl exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.exportSelected}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"paper-plane","leading-icon":"","component-namespace-name":"ButtonSendFieldPositions",disabled:e.exportDisabled,title:e.$t("Positionen senden"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.sendFieldPositions}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{color:"lightest",icon:"cloud-upload","leading-icon":"","component-namespace-name":"ButtonImportFields",disabled:e.fieldsReadOnly,title:e.$t("Felder importieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.importData}}),t("Button",{attrs:{variant:"lightest",icon:"flag-checkered","leading-icon":"","component-namespace-name":"ButtonCompleteCropYear",disabled:e.processOrdersReadOnly||e.fieldsReadOnly||e.someSelectedRowsHaveFieldStatusCalculating,title:e.btnTitleCompleteCropYear,"icon-only":!i,"tooltip-options":{boundary:"viewport"},notification:e.recommendCompleteYear},on:{click:e.completeCropYear}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode&&1===e.selectedRows.length,expression:"editMode && selectedRows.length === 1"}],attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonSplitField",disabled:e.fieldsReadOnly||!e.fieldsAdvancedEnabled,icon:["far","cut"],title:e.$t("Feld aufteilen"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.split}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode&&e.selectedRows.length>1,expression:"editMode && selectedRows.length > 1"}],attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonCombineFields",disabled:e.fieldsReadOnly||!e.fieldsAdvancedEnabled,icon:["far","object-group"],title:e.$t("Felder kombinieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.combine}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"share-square","leading-icon":"","component-namespace-name":"ButtonMoveFields",disabled:e.fieldsReadOnly||!e.fieldsAdvancedEnabled,title:e.$t("Ausgewählte Felder in ein anderes Erntejahr verschieben"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.moveSelected}},[1===e.selectedRows.length?t("span",[e._v(" "+e._s(e.$t("Feld verschieben"))+" ")]):t("span",[e._v(" "+e._s(e.$t("Felder verschieben"))+" ")])]),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonShareFields",disabled:e.fieldsReadOnly,icon:["far","share-alt"],title:e.$t("Felder freigeben"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.share}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ProcessOrderSwitch",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!i}}),t("CompanySwitch",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!i}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{"restore-label":e.$t("Felder wiederherstellen"),"restore-read-only":e.fieldsReadOnly,"export-disabled":e.exp
1ortDisabled,"additional-options":e.additionalPageOptions},on:{restore:e.restoreFields,settings:e.showSettings,export:e.exportData}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldsContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows,"field-ids-with-harvesting-measure":e.fieldIdsWithHarvestingMeasure},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},create:e.create,edit:e.editFromContainer,"click:status":e.onClickStatus,"click:sharedFieldInfo":e.editShare,updateSharedFieldInfo:e.updateAdditionalPageOptions}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),e.modalEditFieldsVisible?t("ModalEditFields",{attrs:{"field-ids":e.fieldIdsForModal,columns:e.columnsForPageSettings},model:{value:e.modalEditFieldsVisible,callback:function(t){e.modalEditFieldsVisible=t},expression:"modalEditFieldsVisible"}}):e._e(),e.modalSplitFieldVisible?t("ModalSplitField",{attrs:{"field-id":e.fieldIdsForModal[0],columns:e.columnsForPageSettings},on:{split:t=>e.updateSelectedForModal(t)},model:{value:e.modalSplitFieldVisible,callback:function(t){e.modalSplitFieldVisible=t},expression:"modalSplitFieldVisible"}}):e._e(),e.modalCombineFieldsVisible?t("ModalCombineFields",{attrs:{"field-ids":e.fieldIdsForModal,columns:e.columnsForPageSettings},on:{"change:field-ids":e.updateSelectedForModal,combined:t=>e.updateSelectedForModal([t])},model:{value:e.modalCombineFieldsVisible,callback:function(t){e.modalCombineFieldsVisible=t},expression:"modalCombineFieldsVisible"}}):e._e(),e.modalInsertFieldsVisible?t("ModalInsertFields",{attrs:{columns:e.columnsForPageSettings},model:{value:e.modalInsertFieldsVisible,callback:function(t){e.modalInsertFieldsVisible=t},expression:"modalInsertFieldsVisible"}}):e._e(),e.modalMoveFieldsVisible?t("ModalMoveFields",{attrs:{"field-ids":e.fieldIdsForModal},on:{success:function(t){e.selectedRows=[]}},model:{value:e.modalMoveFieldsVisible,callback:function(t){e.modalMoveFieldsVisible=t},expression:"modalMoveFieldsVisible"}}):e._e(),null!=e.fieldStatusTarget?t("PopoverFieldStatus",{attrs:{field:e.fieldStatusField,target:e.fieldStatusTarget,"active-and-has-harvesting-measure":e.fieldStatusFieldIsActiveAndHasHarvestingMeasure},on:{close:function(t){e.fieldStatusTarget=null}}}):e._e(),e.modalCompleteCropYearVisible?t("ModalCompleteCropYear",{attrs:{"field-ids-with-harvesting-measure":e.fieldIdsWithHarvestingMeasure},model:{value:e.modalCompleteCropYearVisible,callback:function(t){e.modalCompleteCropYearVisible=t},expression:"modalCompleteCropYearVisible"}}):e._e(),e.modalEditStatusVisible?t("ModalEditStatus",{attrs:{"field-ids":e.selectedRows,"all-active-and-have-harvesting-measures":e.allSelectedRowsHaveHarvestingMeasuresAndAreActive},on:{success:function(t){e.selectedRows=[]}},model:{value:e.modalEditStatusVisible,callback:function(t){e.modalEditStatusVisible=t},expression:"modalEditStatusVisible"}}):e._e(),t("ModalTableExport",{ref:"modalTableExport",attrs:{title:e.selectedRows.length>0?e.$t("Selektierte Felder exportieren"):null,filtered:0===e.selectedRows.length&&null!=e.$refs.table&&!e.$refs.table.allVisible}}),t("ModalShareFields",{attrs:{"field-ids":e.fieldIdsForModal,"shared-field-data":e.modalShareFieldsData},on:{success:function(t){e.updateSharedFields(e.resetSharedFields=!1)},resetSharedFieldData:e.resetModalShareFieldsdata},model:{value:e.modalShareFieldsVisible,callback:function(t){e.modalShareFieldsVisible=t},expression:"modalShareFieldsVisible"}}),t("ModalRemoveSharedFields",{attrs:{"shared-fields-by-field-id":null!=e.modalRemoveShareFieldsData?e.modalRemoveShareFieldsData.sharedFieldsByFieldId:null,"shared-fields-companies-by-id":null!=e.modalRemoveShareFieldsData?e.modalRemoveShareFieldsData.sharedFieldsCompaniesById:null,"shared-fields-by-share-id":null!=e.modalRemoveShareFieldsData?e.modalRemoveShareFieldsData.sharedFieldsByShareId:null},on:{success:function(t){e.updateSharedFields(e.resetSharedFields=!0)}},model:{value:e.modalRemoveShareFieldsVisible,callback:function(t){e.modalRemoveShareFieldsVisible=t},expression:"modalRemoveShareFieldsVisible"}})]},proxy:!0},{key:"satellite",fn:function(){return[t("SatelliteFieldDetail",{directives:[{name:"show",rawName:"v-show",value:e.satellite.visible,expression:"satellite.visible"}],attrs:{loading:e.loading,visible:e.satellite.visible,expanded:e.satellite.expanded,"visible-fields":e.visibleRows.filter((t=>
1null!=e.fields[t])).map((t=>e.fields[t])),"selected-fields":e.fieldsForSatellite,"current-field-id":e.currentFieldIdForSatellite,crops:e.crops,varieties:e.varieties},on:{"update:currentFieldId":function(t){e.currentFieldIdForSatellite=t},"update:current-field-id":function(t){e.currentFieldIdForSatellite=t}}})]},proxy:!0}])})},O7=[],$7=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max","body-class":"modal-combine-fields",visible:e.visible,title:e.$t("Felder zusammenlegen")},on:{change:e.hide},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:3,current:e.currentStep}}),0===e.currentStep?t("div",[t("FormInfoContainer",{attrs:{headline:e.$t("Felder auswählen")}},[e.fieldIds.length>=2?t("p",[e._v(" "+e._s(e.$t("Es wurden {count} Felder ausgewählt. Die Felder werden im nächsten Schritt zu einem vereint.",{count:e.fieldIds.length}))+" "+e._s(e.$t("Klicke in die Karte, um die Auswahl zu verändern."))+" ")]):t("p",[e._v(" "+e._s(e.$t("Es müssen mindestens 2 Felder gewählt sein."))+" "+e._s(e.$t("Klicke in die Karte, um die Auswahl zu verändern."))+" ")])]),e._l(e.activeFields,(function(i){return t("FormFieldSet",{key:i.id,attrs:{headline:i.name}},[t("FormFieldReadOnly",{attrs:{value:e.getFormFieldValue(i,"fieldGroup.mfa"),label:e.$t("Feldstück Nr")}}),null!=e.columnsByKey.fieldNumber&&e.columnsByKey.fieldNumber.visible?t("FormFieldReadOnly",{attrs:{value:e.getFormFieldValue(i,"fieldNumber"),label:e.$t("Schlag Nr")}}):e._e(),t("FormFieldReadOnly",{attrs:{value:e.getFormFieldValue(i,"name"),label:e.$t("Bezeichnung")}}),t("FormFieldReadOnly",{attrs:{value:e._f("numbro")(e.getFormFieldValue(i,"fieldSize")),label:e.$t("Größe (in ha)")}}),t("FormFieldReadOnly",{attrs:{value:e.getCropName(i),label:e.$t("Kultur")}})],1)}))],2):e._e(),1===e.currentStep&&null!=e.newField?t("div",[t("FormInfoContainer",{attrs:{headline:e.$t("Ergebnis anpassen")}},[t("p",[e._v(" "+e._s(e.$t("Die Felder wurden erfolgreich vereint. Du kannst die Eigenschaften des neuen Felds jetzt anpassen."))+" "),e.measuresExist?t("span",[e._v(" "+e._s(e.$t("Sollen bereits gebuchte Maßnahmen für das neue Feld übernommen werden?"))+" ")]):e._e()]),e.measuresExist?t("FormFieldRadioGroup",{attrs:{variant:"no-label",stacked:!1,options:[{text:e.$t("Maßnahmen übernehmen"),value:"copy",disabled:e.fetching},{text:e.$t("Maßnahmen löschen"),value:"delete",disabled:e.fetching}]},model:{value:e.measuresAction,callback:function(t){e.measuresAction=t},expression:"measuresAction"}}):e._e()],1),e.companies.length>1||e.useCustomers?t("FormFieldSet",{attrs:{headline:e.$t("Betrieb")}},[e.companies.length>1?t("FormFieldSelect",{attrs:{required:"",label:e.$t("Betrieb"),options:e.companyOptions,state:!e.missingCompany&&null},on:{update:function(t){e.missingCompany=!1}},model:{value:e.newFieldCompanyId,callback:function(t){e.newFieldCompanyId=t},expression:"newFieldCompanyId"}}):e._e(),e.useCustomers?t("FormFieldDropdown",{attrs:{required:"",label:e.$t("Kunde"),value:e.customerValueForDropdown,items:e.customersToDropdownItems,"items-loading":e.$store.state.customers.fetching},on:{update:t=>e.newField.customerId=t.id}}):e._e()],1):e._e(),t("FormFieldSetEditFields",{attrs:{columns:e.columns,"missing-name":e.missingName,fetching:e.fetching},model:{value:e.newField,callback:function(t){e.newField=t},expression:"newField"}})],1):e._e(),2===e.currentStep?t("div",[t("FormInfoContainer",{attrs:{headline:e.$t("Erledigt")}},[t("p",[e._v(" "+e._s(e.$t("Die Felder wurden erfolgreich zusammengefügt."))+" ")])])],1):e._e()]},proxy:!0},{key:"map-container",fn:function(){return[e.initialized?t("FieldsMap",{ref:"map",staticClass:"modal-combine-fields__map",attrs:{"hide-all-map-actions":"",crops:e.crops,disabledFields:e.disabledFields,activeFields:e.activeFields,editableFields:e.editableFields},on:{"click:polygon":e.onClickField,"click:marker":e.onClickField,"change:polygon":e.changePolygon,"change:marker":e.changeMarker,"change:fieldName":e.changeFieldName}}):t("div")]},proxy:!0},{key:"bottom-content",fn:function(){return[t("ErrorUserMessage",{staticClass:"m-0",attrs:{"error-user-message":e.userErrorMessage,"show-first-only":""}}),t("p",{staticClass:"text-danger m-0"},[e.missingContour?t("span",[e._v(e._s(e.$t("Keines der gewählten Felder besitzt eine Kontur.")))]):e._e(
1),e.unableToCombine?t("span",[e._v(e._s(e.$t("Die Feldkonturen konnten nicht kombiniert werden.")))]):e._e(),e.missingName?t("span",[e._v(e._s(e.$t("Bezeichnung fehlt.")))]):e._e(),e.missingCompany?t("span",[e._v(e._s(e.$t("Betrieb fehlt.")))]):e._e()])]},proxy:!0},{key:"buttons",fn:function(){return[0===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.fieldIds.length<2},on:{click:e.combine}},[t("span",[e._v(e._s(e.$t("Kombinieren")))])]):e._e(),1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:null==e.newField.name||0===e.newField.name.length||e.fetching},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" "),e.fetching?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1)]):e._e(),1===e.currentStep?t("BButton",{attrs:{variant:"white",disabled:e.fetching},on:{click:e.back}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),e.currentStep<2?t("BButton",{attrs:{variant:"white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])]):e._e(),2===e.currentStep?t("BButton",{attrs:{variant:"primary"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Schließen")))])]):e._e()]},proxy:!0},{key:"footer-content-right",fn:function(){return[0===e.currentStep&&e.fieldIds.length<2?t("InfoContainer",[e._v(" "+e._s(e.$t("Klicke in der Karte auf ein Feld um es hinzuzufügen."))+" ")]):e._e()]},proxy:!0}])})},R7=[],N7=i(36952),z7=i(51287),L7=function(){var e=this,t=e._self._c;return t("div",{staticClass:"info-container",class:{"info-container--error":e.error}},[e.error?t("FontAwesomeIcon",{staticClass:"info-container__icon--error mr-1",attrs:{icon:["far","exclamation-triangle"]}}):t("FontAwesomeIcon",{staticClass:"mr-1",attrs:{icon:["far","info-circle"]}}),e._t("default")],2)},V7=[];ow.vI.add(lw.sqG,lw.eHv);var U7={name:"InfoContainer",props:{error:{type:Boolean,default:!1}}},j7=U7,H7=(0,ew.Z)(j7,L7,V7,!1,null,"055c9594",null),G7=H7.exports,W7=function(){var e=this,t=e._self._c;return t("BaseFormField",{attrs:{"slim-margin":"",label:e.label,variant:e.variant}},[t("span",{staticClass:"form-field-read-only__text"},[e._v(" "+e._s(e.value)+" ")])])},Z7=[],K7={name:"FormFieldReadOnly",components:{BaseFormField:BA},props:{value:{type:String,default:null},label:{type:String,required:!0},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg"].includes(e)}}},q7=K7,Y7=(0,ew.Z)(q7,W7,Z7,!1,null,"3d4e5484",null),J7=Y7.exports,X7=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BaseFormField",{attrs:{type:"select",id:e.id,required:e.required,label:e.label,variant:e.variant,state:e.state},scopedSlots:e._u([{key:"default",fn:function({id:i,iconCount:a}){return[t("BFormSelect",{staticClass:"form-field-select__select",class:`form-field-select__select--${e.variant}`,style:e.style(a),attrs:{id:i,options:e.optionsComputed,value:e.valueComputed,disabled:e.disabled,state:e.state},on:{change:e.change,input:e.update}})]}}])})},Q7=[],e9=i(8051),t9=(0,b.defineComponent)({name:"FormFieldSelect",components:{BFormSelect:e9.K,BaseFormField:BA},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label"].includes(e)},state:{type:Boolean,default:null},options:{type:Array,default:()=>[]},value:{type:[String,Number],default:null},disabled:{type:Boolean,default:!1},various:{type:Boolean,default:!1}},computed:{optionsComputed(){return this.various?[{text:this.$t("(verschiedene)")||"verschiedene",value:"various",disabled:!0},...this.options]:this.options},valueComputed(){return this.various?"various":this.value}},methods:{style(e){let t=0;return"vertical-lg"===this.variant&&(t="10px"),e>0?{paddingRight:`calc(${e} * (16px + 1.2rem) + ${t})`}:null},change(e){this.$emit("change",e)},update(e){this.$emit("update",e)}}}
1),i9=t9,a9=(0,ew.Z)(i9,X7,Q7,!1,null,"23223db2",null),n9=a9.exports,r9=function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-info-container"},[t("h3",[e._v(e._s(e.headline))]),e._t("default")],2)},s9=[],o9={name:"FormInfoContainer",props:{headline:{type:String,required:!0}}},l9=o9,d9=(0,ew.Z)(l9,r9,s9,!1,null,"5ebe4870",null),c9=d9.exports,u9=function(){var e=this,t=e._self._c;return t("div",[e.currentCompanies.length>1||e.useCustomers?t("FormFieldSet",{attrs:{headline:e.$t("Betrieb")}},[e.currentCompanies.length>1?t("FormFieldSelect",{attrs:{value:e.getFormFieldValue("processOrder.companyId"),label:e.$t("Betrieb"),options:e.companyOptions,various:e.currentCompanies.length>1&&null==e.changes["processOrder.companyId"]&&!e.mergedFieldsInfo["processOrder.companyId"]},on:{update:t=>e.setFormFieldValue("processOrder.companyId",t)}}):e._e(),e.useCustomers?t("FormFieldDropdown",{attrs:{label:e.$t("Kunde"),value:e.customerValueForDropdown,items:e.customersToDropdownItems,"items-loading":e.$store.state.customers.fetching,various:e.fields.length>1&&null==e.changes["fieldGroup.customerId"]&&!e.mergedFieldsInfo["fieldGroup.customerId"],disabled:e.fetching},on:{update:t=>e.setFormFieldValue("fieldGroup.customerId",t.id)}}):e._e()],1):e._e(),t("FormFieldSet",{staticClass:"form-field-set-edit-fields",attrs:{headline:e.fieldSetHeadline}},[t("FormFieldInput",{attrs:{value:e.getFormFieldValue("fieldGroup.mfa"),label:e.$t("Feldstück Nr"),placeholder:e.$t("Feldstück Nr"),various:e.fields.length>1&&null==e.changes["fieldGroup.mfa"]&&!e.mergedFieldsInfo["fieldGroup.mfa"],disabled:e.fetching},on:{update:t=>e.setFormFieldValue("fieldGroup.mfa",t)}}),null!=e.columnsByKey.fieldNumber&&e.columnsByKey.fieldNumber.visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("fieldNumber"),label:e.$t("Feld Nr"),placeholder:e.$t("Feld Nr"),various:e.fields.length>1&&null==e.changes.fieldNumber&&!e.mergedFieldsInfo.fieldNumber,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("fieldNumber",t)}}):e._e(),t("FormFieldInput",{attrs:{required:"",value:e.getFormFieldValue("name"),label:e.$t("Bezeichnung"),placeholder:e.$t("Pflichtfeld"),state:e.nameInputState,various:e.fields.length>1&&null==e.changes.name&&!e.mergedFieldsInfo.name,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("name",t)}}),t("FormFieldInput",{attrs:{type:"number",placeholder:"0",step:"0.01",value:e.getFormFieldSize,label:e.$t("Größe (in ha)"),various:e.fields.length>1&&null==e.changes.fieldSize&&!e.mergedFieldsInfo.fieldSize,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("fieldSize",t),blur:e.roundFieldSize}}),t("FormFieldDropdown",{ref:"crop",attrs:{label:e.$t("Kultur"),value:e.cropValueForDropdown,items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching,various:e.fields.length>1&&void 0===e.changes.cropId&&!e.mergedFieldsInfo.cropId,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("cropId",t.id),open:function(t){return e.onOpenDropdown({action:"products/crops/subscribe",ref:"crop"})}}}),e.showAdditionalData?e._e():t("BButton",{attrs:{variant:"link"},on:{click:function(t){e.showAdditionalData=!0}}},[t("FontAwesomeIcon",{attrs:{icon:["fal","plus-circle"]}}),e._v(" "+e._s(e.$t("Mehr anzeigen"))+" ")],1),e.showAdditionalData?t("div",{staticClass:"form-field-set-edit-fields__additional-data"},[null!=e.columnsByKey.varietyId&&e.columnsByKey.varietyId.visible?t("FormFieldDropdown",{ref:"variety",attrs:{label:e.$t("Sorte"),value:e.varietyValueForDropdown,items:e.varietiesToDropdownItems,"items-loading":e.$store.state.varieties.fetching,various:e.fields.length>1&&void 0===e.changes.varietyId&&!e.mergedFieldsInfo.varietyId,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("varietyId",t.id),open:function(t){return e.onOpenDropdown({action:"varieties/subscribe",ref:"variety"})}}}):e._e(),null!=e.columnsByKey.preCropId&&e.columnsByKey.preCropId.visible?t("FormFieldDropdown",{ref:"preCrop",attrs:{label:e.$t("Vorfrucht"),value:e.preCropValueForDropdown,items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching,various:e.fields.length>1&&void 0===e.changes.preCropId&&!e.mergedFieldsInfo.preCropId,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("preCropId",t.id),open:function(t){return e.onOpenDropdown({action:"products/crops/subscribe",ref:"preCrop"})}}}
1):e._e(),null!=e.columnsByKey.catchcropVariant&&e.columnsByKey.catchcropVariant.visible?t("FormFieldDropdown",{ref:"catchcrop",attrs:{label:e.$t("Begrünung (Zwischenfrucht)"),value:e.catchcropValueForDropdown,items:e.catchcropDropdownItems,various:e.fields.length>1&&void 0===e.changes.catchcropVariant&&!e.mergedFieldsInfo.catchcropVariant,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("catchcropVariant",t.id),open:function(t){return e.onOpenDropdown({ref:"catchcrop"})}}}):e._e(),null!=e.columnsByKey.kindofuse&&e.columnsByKey.kindofuse.visible?t("FormFieldDropdown",{ref:"kindOfUse",attrs:{label:e.$t("Nutzungsart"),value:e.kindOfUseValueForDropdown,items:e.kindOfUseDropdownItems,various:e.fields.length>1&&void 0===e.changes.kindofuse&&!e.mergedFieldsInfo.kindofuse,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("kindofuse",t.id),open:function(t){return e.onOpenDropdown({ref:"kindOfUse"})}}}):e._e(),null!=e.columnsByKey.comment&&e.columnsByKey.comment.visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("comment"),label:e.$t("Kommentar"),placeholder:e.$t("Kommentar"),various:e.fields.length>1&&null==e.changes.comment&&!e.mergedFieldsInfo.comment,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("comment",t)}}):e._e(),null!=e.columnsByKey.amaCode&&e.columnsByKey.amaCode.visible?t("FormFieldDropdown",{ref:"amaCode",attrs:{label:e.$t("AMA Code"),value:e.amaCodeValueForDropdown,items:e.amaCodeDropdownItems,various:e.fields.length>1&&void 0===e.changes.amaCode&&!e.mergedFieldsInfo.amaCode,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("amaCode",t.id),open:function(t){return e.onOpenDropdown({ref:"amaCode"})}}}):e._e(),null!=e.columnsByKey["additionalData.cadastralCommunity"]&&e.columnsByKey["additionalData.cadastralCommunity"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.cadastralCommunity"),label:e.$t("Gemeinde"),placeholder:e.$t("Gemeinde"),various:e.fields.length>1&&e.additionalDataVarious("additionalData.cadastralCommunity"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.cadastralCommunity",t)}}):e._e(),null!=e.columnsByKey["additionalData.plots"]&&e.columnsByKey["additionalData.plots"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.plots"),label:e.$t("Parzellen Nr."),placeholder:e.$t("Parzellen Nr."),various:e.fields.length>1&&e.additionalDataVarious("additionalData.plots"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.plots",t)}}):e._e(),null!=e.columnsByKey["additionalData.owner"]&&e.columnsByKey["additionalData.owner"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.owner"),label:e.$t("Eigentümer"),placeholder:e.$t("Eigentümer"),various:e.fields.length>1&&e.additionalDataVarious("additionalData.owner"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.owner",t)}}):e._e(),null!=e.columnsByKey["additionalData.rightOfUse"]&&e.columnsByKey["additionalData.rightOfUse"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.rightOfUse"),label:e.$t("Nutzung durch"),placeholder:e.$t("Nutzung durch"),various:e.fields.length>1&&e.additionalDataVarious("additionalData.rightOfUse"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.rightOfUse",t)}}):e._e(),null!=e.columnsByKey.gwArea&&e.columnsByKey.gwArea.visible?t("FormFieldDropdown",{ref:"gwArea",attrs:{label:e.$t("GW-Gebiet"),value:e.gwAreaValueForDropdown,items:e.gwAreaDropdownItems,various:e.fields.length>1&&void 0===e.changes.gwArea&&!e.mergedFieldsInfo.gwArea,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("gwArea",t.id),open:function(t){return e.onOpenDropdown({ref:"gwArea"})}}}):e._e()],1):e._e()],1)],1)},p9=[],h9=i(13692),m9=i.n(h9);function f9(e){const t=D()({},...e),i={},a=m9()(t),n=m9()(i);return e.forEach((e=>{const t=m9()(e);a.forEach((function(){if(this.isLeaf&&!1!==n.get(this.path))return this.node!==t.get(this.path)?(this.update(null),void n.set(this.path,!1)):void n.set(this.path,!0)}))})),{result:t,matchingInfo:i}}var g9={computed:{...(0,C.Se)({varieties:"varieties",varietiesUsed:"varieties/used"}),varietiesToDropdownItems(){if(0===this.$store.state.auth.currentCompanies.length)return[];const e=this.$store.state.auth.currentCompanies.length>1,t=Object.values(this.varieties).filter((t=>!this.varietiesUsed.includes(t.id)&&(!e||null==t.companyId)));return[{name:this.$t("Zuletzt verwendet"),id:"varieties-used",items:this.varietiesUsed.map((e=>({id:e,name:this.varieties[e].name}))),sort:!1},{name:this.$t("Sorten"),id:"varieties",items:t.map((e=>({id:e.id,name:e.name}))),sort:!0}]}}},y9={methods:{fieldSizeDecimals(e){if(Number.isNaN(Number(e)))return"0.00";const t=String(e).split(".");return null==t[1]||0===t[1].length?`${t[0]}.00`:1===t[1].length?`${t[0]}.${t[1]}0`:String(e)}}};ow.vI.add(a_.KtF);var v9={name:"FormFieldSetEditFields",components:{FormFieldDropdown:lk,FormFieldInput:fk,FormFieldSet:_k,FormFieldSelect:n9},mixins:[lI,g9,ED,y9],model:{prop:"changes",event:"update"},props:{fields:{type:Array,default:()=>[]},changes:{type:Object,required:!0},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}},missingName:{type:Boolean,default:!1},uniqueNameViolation:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1}},data(){return{mergedFieldsData:{},mergedFieldsInfo:{},showAdditionalData:!1}},async created(){const e=f9(this.fields);this.mergedFieldsData=e.result,this.mergedFieldsInfo=e.matchingInfo},computed:{...(0,C.Se)({customers:"customers/data"}),nameInputState(){return!this.missingName&&!this.uniqueNameViolation&&null},currentCompanies(){return this.$store.state.auth.currentCompanies},sgdVersion(){return this.$store.getters["auth/currentProcessOrders"].map((e=>e.sgdVersion)).find(ka)??""},companyOptions(){return[{value:null,text:this.$t("Betrieb wählen"),disabled:!0},...this.currentCompanies.map((e=>({value:e.id,text:e.name})))]},columnsByKey(){return null==this.columns?{}:this.columns.reduce(((e,t)=>({...e,[t.key]:t})),{})},fieldSetHeadline(){return"string"===typeof this.changes.name&&this.changes.name.length>0?this.changes.name:this.fields.filter((e=>"string"===typeof e.name&&e.name.length>0)).map((e=>e.name)).join(", ")},getFormFieldSize(){return null!=this.changes.fieldSize?this.changes.fieldSize:this.fieldSizeDecimals(Ru(this.mergedFieldsData,"fieldSize"))},cropValueForDropdown(){return null!=this.changes.cropId&&null!=this.crops[this.changes.cropId]?{id:this.changes.cropId,name:this.crops[this.changes.cropId].name}:Object.prototype.hasOwnProperty.call(this.changes,"cropId")?{id:null,name:""}:this.mergedFieldsInfo.cropId&&null!=this.crops[this.mergedFieldsData.cropId]?{id:this.mergedFieldsData.cropId,name:this.crops[this.mergedFieldsData.cropId].name}:{id:null,name:""}},varietyValueForDropdown(){return null!=this.changes.varietyId&&null!=this.varieties[this.changes.varietyId]?{id:this.changes.varietyId,name:this.varieties[this.changes.varietyId].name}:Object.prototype.hasOwnProperty.call(this.changes,"varietyId")?{id:null,name:""}:this.mergedFieldsInfo.varietyId&&null!=this.varieties[this.mergedFieldsData.varietyId]?{id:this.mergedFieldsData.varietyId,name:this.varieties[this.mergedFieldsData.varietyId].name}:{id:null,name:""}},preCropValueForDropdown(){return null!=this.changes.preCropId&&null!=this.crops[this.changes.preCropId]?{id:this.changes.preCropId,name:this.crops[this.changes.preCropId].name}:Object.prototype.hasOwnProperty.call(this.changes,"preCropId")?{id:null,name:""}:this.mergedFieldsInfo.preCropId&&null!=this.crops[this.mergedFieldsData.preCropId]?{id:this.mergedFieldsData.preCropId,name:this.crops[this.mergedFieldsData.preCropId].name}:{id:null,name:""}},useCustomers(){return null!=this.customers&&Object.keys(this.customers).length>0},customerValueForDropdown(){let e=null;return null!=this.changes["fieldGroup.customerId"]?e=this.changes["fieldGroup.customerId"]:this.mergedFieldsInfo["fieldGroup.customerId"]&&null!=this.mergedFieldsData["fieldGroup.customerId"]?e=this.mergedFieldsData["fieldGroup.customerId"]:this.mergedFieldsInfo["fieldGroup.customerId"]&&(e="own"),null!=this.customers[e]?{id:e,name:this.customers[e].name}:"own"===e?{id:"own",name:this.$t("Eigener Betrieb")}:{id:null,name:""}},customersToDropdownItems(){return[{id:"own-company",items:[{id:"own",name:this.$t("Eigener Betrieb")}],sort:!1},{name:this.$t("Kunden"),id:"customers",items:Object.values(this.customers),sort:!0}]}
1,catchcropValueForDropdown(){return null!=this.changes.catchcropVariant&&null!=this.catchCropVariantsById[this.changes.catchcropVariant]?this.catchCropVariantsById[this.changes.catchcropVariant]:this.mergedFieldsInfo.catchcropVariant&&null!=this.catchCropVariantsById[this.mergedFieldsData.catchcropVariant]?this.catchCropVariantsById[this.mergedFieldsData.catchcropVariant]:{id:null,name:""}},catchcropDropdownItems(){return this.dropdownItemsForFieldsGetItems(FD)},kindOfUseValueForDropdown(){return null!=this.changes.kindofuse&&null!=this.kindOfUseTypesById[this.changes.kindofuse]?this.kindOfUseTypesById[this.changes.kindofuse]:this.mergedFieldsInfo.kindofuse&&null!=this.kindOfUseTypesById[this.mergedFieldsData.kindofuse]?this.kindOfUseTypesById[this.mergedFieldsData.kindofuse]:{id:null,name:""}},kindOfUseDropdownItems(){return this.dropdownItemsForFieldsGetItems(CD)},amaCodeValueForDropdown(){return null!=this.changes.amaCode&&null!=this.amaCodesById[this.changes.amaCode]?this.amaCodesById[this.changes.amaCode]:this.mergedFieldsInfo.amaCode&&null!=this.amaCodesById[this.mergedFieldsData.amaCode]?this.amaCodesById[this.mergedFieldsData.amaCode]:{id:null,name:""}},amaCodeDropdownItems(){return this.dropdownItemsForFieldsGetItems(AD)},gwAreaValueForDropdown(){return null!=this.changes.gwArea&&null!=this.gwAreasById[this.changes.gwArea]?this.gwAreasById[this.changes.gwArea]:this.mergedFieldsInfo.gwArea&&null!=this.gwAreasById[this.mergedFieldsData.gwArea]?this.gwAreasById[this.mergedFieldsData.gwArea]:{id:null,name:""}},gwAreaDropdownItems(){return this.dropdownItemsForFieldsGetItems(kD)}},methods:{getFormFieldValue(e){return null!=this.changes[e]?this.changes[e]:null!=Ru(this.mergedFieldsData,e)?Ru(this.mergedFieldsData,e):null},setFormFieldValue(e,t){this.$emit("update",{...this.changes,[e]:t})},roundFieldSize(){null!=this.changes.fieldSize&&this.$emit("update",{...this.changes,fieldSize:this.fieldSizeDecimals(this.changes.fieldSize)})},onOpenDropdown({action:e,ref:t}){"string"===typeof e&&this.$store.dispatch(e),this.$emit("openDropdown",this.$refs[t].$el)},additionalDataVarious(e){return null==this.changes[e]&&!1===Ru(this.mergedFieldsInfo,e)}}},b9=v9,w9=(0,ew.Z)(b9,u9,p9,!1,null,"c6d94b54",null),C9=w9.exports;ow.vI.add(uw.IJ7);var F9={name:"ModalCombineFields",components:{ErrorUserMessage:cH,FormFieldDropdown:lk,FormFieldSelect:n9,FormFieldSetEditFields:C9,FormFieldRadioGroup:_T,InfoContainer:G7,FormFieldReadOnly:J7,FieldsMap:b7,FormInfoContainer:c9,FormFieldSet:_k,ModalWrapper:OC,Pagination:qk},mixins:[cG],model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIds:{type:Array,required:!0},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}}},data(){return{initialized:!1,currentStep:0,missingContour:!1,unableToCombine:!1,measuresAction:"copy",newField:null,missingName:!1,missingCompany:!1,newFieldCompanyId:null,fetching:!1,source:null}},async created(){await Promise.all([this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("fields/subscribe"),this.$store.dispatch("activities/subscribe")]),this.initialized=!0},computed:{...(0,C.Se)({crops:"products/crops/data",fields:"fields/dataWithoutRemoved",measures:"activities/data"}),disabledFields(){return Object.values(this.fields).filter((e=>1===this.currentStep||!this.fieldIds.includes(e.id))).reduce(((e,t)=>({...e,[t.id]:t})),{})},activeFields(){return 2===this.currentStep?{[this.newField.id]:this.newField}:this.fieldIds.filter((e=>0===this.currentStep&&null!=this.fields[e])).reduce(((e,t)=>({...e,[t]:{...this.fields[t]}})),{})},editableFields(){return 1!==this.currentStep||null==this.newField?{}:{[this.newField.id]:this.newField}},columnsByKey(){return null==this.columns?{}:this.columns.reduce(((e,t)=>({...e,[t.key]:t})),{})},measuresExist(){return 0!==Object.values(this.measures).length&&Object.values(this.measures).some((e=>this.fieldIds.includes(e.fieldId)))},companies(){return this.$store.state.auth.currentCompanies},companyOptions(){return[{value:null,text:this.$t("Betrieb wählen"),disabled:!0},...this.companies.map((e=>({value:e.id,text:e.name})))]},useCustomers(){return null!=this.customers&&(null!=this.columnsByKey[tA.key]&&this.columnsByKey[tA.key].visible&&Object.keys(this.customers).length>0)},customerValueForDropdown(){const e=this.newField["fieldGroup.customerId"];return"own"===e?{id:"own",name:this.$t("Eigener Betrieb")}:null!=this.customers[e]?{id:e,name:this.customers[e].name}:{id:null,name:""}},customersToDropdownItems(){return[{id:"own-company",items:[{id:"own",name:this.$t("Eigener Betrieb")}],sort:!1},{name:this.$t("Kunden"),id:"customers",items:Object.values(this.customers),sort:!0}]}},watch:{fieldIds(){this.missingContour=!1,this.unableToCombine=!1,this.measuresAction="copy",this.missingName=!1,this.userErrorMessage=null}},methods:{onClickField(e){0===this.currentStep&&(this.fieldIds.includes(e)?this.$emit("change:fieldIds",this.fieldIds.filter((t=>t!==e))):this.$emit("change:fieldIds",[...this.fieldIds,e]))},getFormFieldValue(e,t){return Ru(e,t)},getCropName(e){const{cropId:t}=e;return null==this.crops[t]?"":this.crops[t].name},combine(){this.unableToCombine=!1;const e=[];
1if(Object.values(this.activeFields).forEach((t=>{null!=t.fieldContour&&null!=t.fieldContour.geoJson&&"Polygon"===t.fieldContour.geoJson.type&&e.push(t.fieldContour.geoJson)})),0===e.length)return void(this.missingContour=!0);let t=e.reduce(((e,t)=>null==e?{type:"Feature",geometry:t,properties:{}}:(0,z7.Z)(e,t)),null);if(t&&"Polygon"===t.geometry.type||(t=(0,N7.Z)(t)),!t||"Polygon"!==t.geometry.type)return void(this.unableToCombine=!0);const[i,a]=t.geometry.coordinates[0].reduce((([e,t],[i,a])=>[e+i,t+a]),[0,0]),n=Math.floor((0,Y6.Z)(t.geometry))/1e4;this.newField={...this.fields[this.fieldIds[0]],id:ma(),lon:i/t.geometry.coordinates[0].length,lat:a/t.geometry.coordinates[0].length,fieldContour:{geoJson:t.geometry,contourSize:n,tstamp:Math.floor(new Date/1e3)},fieldSize:n},this.currentStep=1},back(){this.currentStep=0,this.newField=null},async save(){if("string"!==typeof this.newField.name||this.newField.name.length<1)return void(this.missingName=!0);if(this.companies.length>1&&null==this.newFieldCompanyId)return void(this.missingCompany=!0);this.missingName=!1,this.missingCompany=!1,this.userErrorMessage=null,this.fetching=!0;const e=ce(this.newField,dd,cd);if(null!=this.newFieldCompanyId){const t=this.$store.getters["auth/processOrderByCompanyIdAndNameAndType"](this.newFieldCompanyId,this.$store.state.auth.currentProcessOrderName);e.processOrderId=t.id}e.id=this.newField.id,e.fieldContour=this.newField.fieldContour;try{this.source=l().CancelToken.source();const{data:t}=await l().post("/admin/rest/field/combine_fields",{data:{fieldIds:this.fieldIds,measuresAction:this.measuresAction,newField:e}},{cancelToken:this.source.token});if(null==t||"success"!==t.status)return this.setUserErrorMessageFromResponse(t),void(this.fetching=!1)}catch(t){return this.setUserErrorMessageFromResponse(t),void(this.fetching=!1)}await this.$store.dispatch("fields/refresh"),this.$emit("combined",this.newField.id),this.fetching=!1,this.currentStep=2},changePolygon({fieldContour:e}){const t=Math.floor((0,Y6.Z)(e.geoJson))/1e4;b["default"].set(this.newField,"fieldSize",t),b["default"].set(this.newField,"fieldContour",{geoJson:e.geoJson,fieldSize:t,tstamp:Math.floor(new Date/1e3)})},changeMarker({lat:e,lon:t}){b["default"].set(this.newField,"lat",e),b["default"].set(this.newField,"lon",t)},changeFieldName({name:e}){b["default"].set(this.newField,"name",e)},hide(){null!=this.source&&this.source.cancel(),this.$emit("change",!1)}}},A9=F9,k9=(0,ew.Z)(A9,$7,R7,!1,null,"2c862ee1",null),S9=k9.exports,E9=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"lg","body-class":"modal-complete-crop-year",visible:e.visible,title:e.$t("Erntejahr abschließen")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[e.success?t("p",[e._v(" "+e._s(e.$t("Die gewählten Kulturen wurden abgeschlossen. Die entsprechenden Felder sind jetzt für {next} aktiv.",{next:e.next}))+" ")]):e.error?t("p",{staticClass:"modal-complete-crop-year__error"},[e._v(" "+e._s(e.errorUserMessage)+" ")]):e.availableCrops.length>0?t("div",[t("p",[e._v(" "+e._s(e.$t("Erntejahr {current} für die gewählten Kulturen abschließen und {next} als das aktive Jahr setzen.",{current:e.current,next:e.next}))+" ")]),t("FormCheckbox",{attrs:{checked:e.all,disabled:e.fetching},on:{change:t=>{e.all=t}}},[e._v(" "+e._s(e.$t("Alle"))+" ")]),t("div",{staticClass:"modal-complete-crop-year__row"},[e.cropsWithMeasures.length>0?t("div",{staticClass:"modal-complete-crop-year__content-box"},[t("h2",{staticClass:"modal-complete-crop-year__content-box-headline"},[e._v(e._s(e.$t("Erntemaßnahmen vorhanden")))]),e._l(e.cropsWithMeasures,(function(i){return t("FormCheckbox",{key:i.id,staticClass:"modal-complete-crop-year__content-box-checkbox",attrs:{slim:"",disabled:e.fetching},model:{value:e.selectedCrops[i.id],callback:function(t){e.$set(e.selectedCrops,i.id,t)},expression:"selectedCrops[crop.id]"}},[e._v(" "+e._s(i.name)+" "),t("br"),i.fieldTotal>1?t("small",[e._v(" ("+e._s(e.$t("{count} von {total} Feldern mit Erntemaßnahme",{count:i.fieldCount,total:i.fieldTotal}))+") ")]):t("small",[e._v(" ("+e._s(e.$t("1 Feld mit Erntemaßnahme"))+") ")])])}))],2):e._e(),e.cropsWithoutMeasures.length>0?t("div",{staticClass:"modal-complete-crop-year__content-box"},[t("h2",{staticClass:"modal-complete-crop-year__content-box-headline"},[e._v(e._s(e.$t("Kulturen ohne Erntemaßnahmen")))]),e._l(e.cropsWithoutMeasures,(function(i){return t("FormCheckbox",{key:i.id,staticClass:"modal-complete-crop-year__content-box-checkbox",attrs:{slim:"",disabled:e.fetching},model:{value:e.selectedCrops[i.id],callback:function(t){e.$set(e.selectedCrops,i.id,t)},expression:"selectedCrops[crop.id]"}},[e._v(" "+e._s(i.name)+" "),t("br"),i.fieldTotal>1?t("small",[e._v(" ("+e._s(e.$t("{count} Felder ohne Erntemaßnahme",{count:i.fieldTotal-i.fieldCount}
1))+") ")]):t("small",[e._v(" ("+e._s(e.$t("1 Feld ohne Erntemaßnahme"))+") ")])])}))],2):e._e()])],1):t("div",[e._v(" "+e._s(e.$t("Keine aktiven Kulturen im aktuellen Erntejahr vorhanden."))+" ")])]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.okDisabled},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.success||e.error||0===e.crops.length?e.$t("Schließen"):e.$t("Ernte abschließen"))+" "),e.fetching?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1)]),e.success||e.error?e._e():t("BButton",{attrs:{variant:"white",disabled:e.fetching},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}])})},I9=[];ow.vI.add(uw.IJ7);var _9={name:"ModalCompleteCropYear",components:{FormCheckbox:Gw,ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIdsWithHarvestingMeasure:{type:Array,required:!0}},data(){return{availableCrops:[],selectedCrops:{},fetching:!1,success:!1,error:!1,errorUserMessage:null}},mounted(){const e={};this.activeFields.forEach((({id:t,cropId:i})=>{const a=this.crops[i]?.name??this.$t("Keine Kultur");null==e[i]&&(e[i]={id:i,name:a,fieldCount:0,fieldTotal:0}),e[i].fieldTotal+=1,this.fieldIdsWithHarvestingMeasure.includes(t)&&(e[i].fieldCount+=1)})),this.availableCrops=Object.values(e),this.initCrops()},computed:{...(0,C.Se)({fields:"fields/data",crops:"products/crops"}),current(){return Number(this.$store.state.auth.currentProcessOrderName)},next(){return this.current+1},activeFields(){return Object.values(this.fields).filter((e=>"active"===e.status))},cropsWithMeasures(){return this.availableCrops.filter((e=>e.fieldCount>0)).sort(((e,t)=>-1===e.id?1:-1===t.id?-1:e.name.localeCompare(t.name)))},cropsWithoutMeasures(){return this.availableCrops.filter((e=>0===e.fieldCount)).sort(((e,t)=>-1===e.id?1:-1===t.id?-1:e.name.localeCompare(t.name)))},all:{get(){return Object.values(this.selectedCrops).every((e=>e))},set(e){Object.keys(this.selectedCrops).forEach((t=>{this.selectedCrops[t]=e}))}},okDisabled(){return!!this.fetching||!this.success&&!this.error&&0!==this.availableCrops.length&&Object.values(this.selectedCrops).every((e=>!e))}},watch:{crops(){this.initCrops()}},methods:{initCrops(){this.availableCrops.forEach((e=>{null==this.selectedCrops[e.id]&&b["default"].set(this.selectedCrops,e.id,!1)}))},async save(){if(this.success||this.error||0===this.availableCrops.length)return void this.$refs.modalWrapper.hide();this.fetching=!0,await new Promise((e=>setTimeout(e,100)));const e=this.activeFields.reduce(((e,t)=>(!0===this.selectedCrops[t.cropId]&&e.push(t.id),e)),[]),t=await this.$store.dispatch("fields/setStatus",{status:"completed",fieldIds:e});if("error"===t.status)return this.fetching=!1,this.error=!0,void(this.errorUserMessage=t.errorUserMessage.join("\n"));await this.$store.dispatch("auth/refreshUserCompanies"),this.fetching=!1,this.success=!0},hide(){this.$refs.modalWrapper.hide()}}},D9=_9,M9=(0,ew.Z)(D9,E9,I9,!1,null,"833feb08",null),P9=M9.exports,T9=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max","body-class":"modal-edit-fields",visible:e.visible,title:e.$t("Felder bearbeiten")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("FormFieldSetEditFields",{attrs:{fields:e.fieldsForFormField,columns:e.columns,"missing-name":e.missingName,uniqueNameViolation:e.uniqueNameViolation},model:{value:e.changes,callback:function(t){e.changes=t},expression:"changes"}})]},proxy:!0},{key:"bottom-content",fn:function(){return[t("p",{staticClass:"text-danger m-0"},[null!=e.missingName?t("span",[e._v(e._s(e.$t("Bezeichnung fehlt.")))]):e._e(),e.uniqueNameViolation?t("span",[e._v(e._s(e.errorMessage))]):e.invalidNewFields.length>0?t("span",[e._v(e._s(e.$t("Ein oder mehrere Felder haben eine ungültige Kontur")))]):t("span",{staticStyle:{display:"inline-block"}})])]},proxy:!0},{key:"map-container",fn:function(){return[e.initialized?t("FieldsMap",{ref:"map",staticClass:"modal-insert-fields__map",attrs:{"hide-map-actions-discard":"",initialCenterIncludeDisabled:!e.activeFieldsHaveGeoData,companies:e.companies,crops:e.crops,varieties:e.varieties,disabledFields:e.disabledFields,activeFields:e.activeFields,editableFields:e.editableFields,insertEnabled:e.insertEnabled,invalidNewFields:e.invalidNewFields},on:{insert:e.addPolygon,addPolygon:e.addPolygon,"change:polygon":e.changePolygon,"change:marker":e.changeMarker,"change:fieldName":e.changeFieldName,"click:polygon":e.onClickPolygon,"click:marker":t=>e.currentFieldIdForGeoDataChange=t,"action:save":function(t){e.currentFieldIdForGeoDataChange=null},"action:removePolygon":e.onRemovePolygon}}
1):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.invalidNewFields.length>0},on:{click:e.save}},[t("span",[e._v(e._s(e.$t("Speichern")))])]),t("BButton",{attrs:{variant:"white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}])})},x9=[],B9={name:"ModalEditFields",components:{FormFieldSetEditFields:C9,FieldsMap:b7,ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIds:{type:Array,required:!0},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}}},data(){return{initialized:!1,changes:{},geoDataChanges:{},currentFieldIdForGeoDataChange:null,missingName:null,uniqueNameViolation:null,invalidNewFields:[],errorMessage:null}},watch:{changes(){this.missingName=null,this.uniqueNameViolation=!1}},async created(){await this.$store.dispatch("fields/subscribe"),this.checkMissingLatLon(),this.initialized=!0},computed:{...(0,C.Se)({crops:"products/crops",varieties:"varieties/data",fields:"fields/dataWithoutRemoved"}),insertEnabled(){return 1===this.fieldIds.length&&!this.activeFieldsHaveGeoData&&0===Object.values(this.editableFields).length&&0===Object.values(this.geoDataChanges).length},disabledFields(){return Object.values(this.fields).filter((e=>!this.fieldIds.includes(e.id))).reduce(((e,t)=>({...e,[t.id]:t})),{})},activeFields(){return this.fieldIds.filter((e=>null!=this.fields[e]&&e!==this.currentFieldIdForGeoDataChange)).reduce(((e,t)=>({...e,[t]:{...this.fields[t],...this.changes,...null!=this.geoDataChanges[t]?this.geoDataChanges[t]:{}}})),{})},editableFields(){const e=this.currentFieldIdForGeoDataChange;return null==e||null==this.fields[e]?{}:{[e]:{...this.fields[e],...this.changes,...null!=this.geoDataChanges[e]?this.geoDataChanges[e]:{}}}},fieldsForFormField(){return this.fieldIds.filter((e=>null!=this.fields[e])).map((e=>this.fields[e]))},companies(){return this.$store.state.auth.currentCompanies},activeFieldsHaveGeoData(){return Object.values(this.activeFields).some((e=>"number"===typeof e.lat&&"number"===typeof e.lon||null!=e.fieldContour&&null!=e.fieldContour.geoJson&&"Polygon"===e.fieldContour.geoJson.type))},requireUniqueFieldName(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELD_NAMES_UNIQUE)}},methods:{onClickPolygon(e){this.fieldIds.includes(e)&&(this.currentFieldIdForGeoDataChange=e)},addPolygon({id:e,lat:t,lon:i,fieldContour:a}){let n=e;if(1===this.fieldIds.length&&([n]=this.fieldIds),null==n)return;const r=Math.floor((0,Y6.Z)(a.geoJson))/1e4,s={lat:t,lon:i,fieldContour:{...a,area:r,id:fa(oe,n)}};1===this.fieldIds.length?b["default"].set(this.changes,"fieldSize",r):s.fieldSize=r,b["default"].set(this.geoDataChanges,n,s),this.currentFieldIdForGeoDataChange=n},changePolygon({fieldContour:e,fieldId:t}){const i=this.fields[t];if(null==i)return;const a=Math.floor((0,Y6.Z)(e.geoJson))/1e4;let n={};null!=i.fieldContour&&(n={...i.fieldContour}),null!=this.geoDataChanges[t]&&null!=this.geoDataChanges[t].fieldContour&&(n={...n,...this.geoDataChanges[t].fieldContour}),n.geoJson=e.geoJson,n.area=a,n.tstamp=Math.floor(new Date/1e3);const r={...null!=this.geoDataChanges[t]?this.geoDataChanges[t]:{},fieldContour:n},s=f4(e.geoJson.coordinates);s?this.invalidNewFields.some((e=>e.id===i.id))&&(this.invalidNewFields=this.invalidNewFields.filter((e=>e.id!==i.id))):this.invalidNewFields.push(i),1===this.fieldIds.length?b["default"].set(this.changes,"fieldSize",a):r.fieldSize=a,b["default"].set(this.geoDataChanges,t,r)},changeMarker({lat:e,lon:t,fieldId:i}){b["default"].set(this.geoDataChanges,i,{...null!=this.geoDataChanges[i]?this.geoDataChanges[i]:{},lat:e,lon:t})},changeFieldName({fieldId:e,name:t}){1!==this.fieldIds.length?b["default"].set(this.geoDataChanges,e,{name:t}):b["default"].set(this.changes,"name",t)},checkMissingLatLon(){Object.values(this.activeFields).forEach((e=>{null!=e.lat&&null!=e.lon||null==e.fieldContour||null==e.fieldContour.geoJson||"Polygon"!==e.fieldContour.geoJson.type||b["default"].set(this.geoDataChanges,e.id,i4(e.fieldContour.geoJson))}))},save(){if("string"!==typeof this.changes.name||0!==this.changes.name.length){if(this.changes.name&&this.requireUniqueFieldName){if(this.fieldIds.length>1)return this.uniqueNameViolation=!0,void(this.errorMessage=this.$t("Felder dürfen nicht die gleichen Namen enthalten."));const e=this.$store.getters["fields/isUniqueFieldName"](this.changes.name);if(e)return this.uniqueNameViolation=!0,void(this.errorMessage=this.$t("Ein Feld mit diesem Namen existiert bereits."))}this.fieldIds.forEach((e=>{if(0===Object.values(this.changes).length&&null==this.geoDataChanges[e])return;const t={...this.changes,...null!=this.geoDataChanges[e]?this.geoDataChanges[e]:{},id:e};"own"===this.changes["fieldGroup.customerId"]&&(t["fieldGroup.customerId"]=null),this.$store.dispatch("fields/updateAndSyncEntry",{entry:t})})),this.hide()}else this.missingName=!0},hide(){this.$refs.modalWrapper.hide()},onRemovePolygon(e){const t={...null!=this.geoDataChanges[e]?this.geoDataChanges[e]:{},fieldContour:null};b["default"].set(this.geoDataChanges,e,t)}}},O9=B9,$9=(0,ew.Z)(O9,T9,x9,!1,null,"2222dbfd",null),R9=$9.exports,N9=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"md","body-class":"modal-edit-status",visible:e.visible,title:e.$t("Erntejahr-Status")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[e.success?t("div",[t("p",[e._v(" "+e._s(e.$t("Der Status der gewählten Felder wurde aktualisiert."))+" ")]),"completed"===e.status?t("p",[e._v(" "+e._s(e.$t("Sie wurden im Erntejahr {current} abgeschlossen und werden in {next} aktiv gestellt.",{current:e.current,next:e.next}
1))+" ")]):e._e(),"active"===e.status?t("p",[e._v(" "+e._s(e.$t("Sie sind nun im Erntejahr {current} aktiv und werden in den vorangehenden Erntejahren auf abgeschlossen gestellt.",{current:e.current}))+" ")]):e._e(),"planned"===e.status?t("div",[t("p",[e._v(" "+e._s(e.$t("Sie wurden für {current} auf geplant gestellt.",{current:e.current}))+" ")]),1===e.numberOfNewActiveFieldsInPrevious?t("p",[e._v(" "+e._s(e.$t("Im Erntejahr {previous} wurde ein Feld auf aktiv gestellt.",{previous:e.previous}))+" ")]):null!=e.numberOfNewActiveFieldsInPrevious?t("p",[e._v(" "+e._s(e.$t("Im Erntejahr {previous} wurden {numberOfNewActiveFieldsInPrevious} Felder auf aktiv gestellt.",{previous:e.previous,numberOfNewActiveFieldsInPrevious:e.numberOfNewActiveFieldsInPrevious}))+" ")]):e._e()]):e._e()]):e.error?t("p",{staticClass:"modal-edit-status__error"},[e._v(" "+e._s(e.errorUserMessage)+" ")]):t("div",[t("FormFieldRadioGroup",{staticClass:"m-0",attrs:{variant:"no-label",stacked:""},model:{value:e.status,callback:function(t){e.status=t},expression:"status"}},[t("FormRadio",{attrs:{variant:"bordered",value:"completed",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return["completed"===e.initialStatus?t("span",[e._v(e._s(e.$t("Abgeschlossen")))]):t("span",[e._v(" "+e._s(e.$t("Abschließen"))+" "),e.allActiveAndHaveHarvestingMeasures?t("span",{staticClass:"text-danger"},[e._v(" ("+e._s(e.$t("empfohlen"))+") ")]):e._e()]),e._v("   "),t("FontAwesomeIcon",{staticClass:"modal-edit-status__icon modal-edit-status__icon--completed",attrs:{icon:"check-circle"}})]},proxy:!0},"completed"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Die Ernte für das Erntejahr {current} ist auf den ausgewählten Feldern bereits abgeschlossen. Sie sind zur Zeit in einem zukünftigen Erntejahr "aktiv".',{current:e.current}))+" ")]},proxy:!0}:e.allActiveAndHaveHarvestingMeasures?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Auf diesen Feldern wurden bereits Erntemaßnahmen für das Erntejahr {current} gebucht. Schließe das Erntejahr für die Felder jetzt ab, sie werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',{current:e.current,next:e.next}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze die ausgewählten Felder auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Die Felder werden automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',{current:e.current,next:e.next}))+" ")]},proxy:!0}],null,!0)}),t("FormRadio",{attrs:{variant:"bordered",value:"active",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(e.$t("Aktiv"))+" "),t("FontAwesomeIcon",{staticClass:"modal-edit-status__icon modal-edit-status__icon--active",attrs:{icon:"dot-circle"}})]},proxy:!0},"active"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Die Felder werden derzeit im angezeigten Erntejahr {current} bewirtschaftet.",{current:e.current}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze die ausgewählten Felder "aktiv", wenn sie ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden sollen. Vorangehende Erntejahre werden auf diesen Feldern abgeschlossen.',{current:e.current}))+" ")]},proxy:!0}],null,!0)}),t("FormRadio",{attrs:{variant:"bordered",value:"planned",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(e.$t("Geplant"))+" "),t("FontAwesomeIcon",{staticClass:"modal-edit-status__icon modal-edit-status__icon--planned",attrs:{icon:"clock"}})]},proxy:!0},"planned"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Das Erntejahr {current} für die ausgewählten Felder befindet sich in Planung.",{current:e.current}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze den Status auf "geplant", wenn das Erntejahr {current} auf den ausgewählten Feldern noch nicht begonnen hat.',{current:e.current}))+" ")]},proxy:!0}],null,!0)})],1)],1)]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.okDisabled},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.okBtnLabel)+" "),e.fetching?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}
1):e._e()],1)]),e.success||e.error?e._e():t("BButton",{attrs:{variant:"white",disabled:e.fetching},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}])})},z9=[];ow.vI.add(uw.IJ7);var L9={name:"ModalEditStatus",components:{FormFieldRadioGroup:_T,FormRadio:kT,ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIds:{type:Array,required:!0},allActiveAndHaveHarvestingMeasures:{type:Boolean,default:!1}},data(){return{status:null,initialStatus:null,fetching:!1,success:!1,error:!1,errorUserMessage:null,numberOfNewActiveFieldsInPrevious:null}},computed:{...(0,C.Se)({fields:"fields/data"}),okDisabled(){return!!this.fetching||!this.success&&!this.error&&(this.status===this.initialStatus||null==this.status)},okBtnLabel(){if(this.success||this.error)return this.$t("Schließen");const e=this.status!==this.initialStatus?this.status:void 0;switch(e){case"completed":return this.$t("Abschließen");case"active":return this.$t("Aktiv setzen");case"planned":return this.$t("Geplant setzen");default:break}return this.$t("Speichern")},previous(){return Number(this.$store.state.auth.currentProcessOrderName)-1},current(){return this.$store.state.auth.currentProcessOrderName},next(){return Number(this.$store.state.auth.currentProcessOrderName)+1}},mounted(){let e=new Set;switch(this.fieldIds.forEach((t=>{e.add(this.fields[t].status)})),e=[...e],1===e.length&&([this.initialStatus]=e),this.initialStatus){case"active":this.status="completed";break;case"planned":this.status="active";break;case"completed":this.status="completed";break;default:this.status=null;break}},methods:{async save(){if(this.success||this.error)return void this.hide();this.fetching=!0,await new Promise((e=>setTimeout(e,100)));const e=await this.$store.dispatch("fields/setStatus",{status:this.status,fieldIds:this.fieldIds});if("error"===e.status)return this.fetching=!1,this.error=!0,void(this.errorUserMessage=e.errorUserMessage.join("\n"));const t=e.data[String(this.previous)];null!=t&&(this.numberOfNewActiveFieldsInPrevious=Object.values(t).filter((e=>"active"===e)).length),await this.$store.dispatch("auth/refreshUserCompanies"),this.fetching=!1,this.success=!0},hide(){this.success&&this.$emit("success"),this.$refs.modalWrapper.hide()}}},V9=L9,U9=(0,ew.Z)(V9,N9,z9,!1,null,"1de12b26",null),j9=U9.exports,H9=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max","body-class":"modal-insert-fields",visible:e.visible,title:e.$t("Felder hinzufügen"),"map-full":!e.showForm},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("div",{staticClass:"modal-insert-fields__body"},[e.companies.length>1||e.useCustomers?t("FormFieldSet",{attrs:{headline:e.$t("Betrieb")}},[e.companies.length>1?t("FormFieldSelect",{attrs:{required:"",label:e.$t("Betrieb"),options:e.companyOptions,state:!e.missingCompany&&null},on:{update:function(t){e.missingCompany=!1}},model:{value:e.companyId,callback:function(t){e.companyId=t},expression:"companyId"}}):e._e(),e.useCustomers?t("FormFieldDropdown",{attrs:{required:"",label:e.$t("Kunde"),value:e.customerValueForDropdown,items:e.customersToDropdownItems,"items-loading":e.$store.state.customers.fetching},on:{update:t=>e.customerId=t.id}}):e._e()],1):e._e(),e._l(e.newFields,(function(i){return t("FormFieldSet",{key:i.id,attrs:{collapsible:"",headline:e.fieldHeadline(i),collapsed:e.currentField!==i.id},on:{update:t=>e.updateFormFieldCollapsed(i,t)}},[t("FormFieldInput",{attrs:{label:e.$t("Feldstück Nr"),placeholder:e.$t("Feldstück Nr")},model:{value:i["fieldGroup.mfa"],callback:function(t){e.$set(i,"fieldGroup.mfa",t)},expression:"field['fieldGroup.mfa']"}}),e.useFieldNumber?t("FormFieldInput",{attrs:{label:e.$t("Feld-Nummer"),placeholder:e.$t("Feld-Nummer")},model:{value:i.fieldNumber,callback:function(t){e.$set(i,"fieldNumber",t)},expression:"field.fieldNumber"}}):e._e(),t("FormFieldInput",{attrs:{required:"",label:e.$t("Bezeichnung"),placeholder:e.$t("Pflichtfeld"),state:e.nameInputState},on:{update:e.resetNameInput},model:{value:i.name,callback:function(t){e.$set(i,"name",t)},expression:"field.name"}}),t("FormFieldInput",{attrs:{type:"number",placeholder:"0",step:"0.01",label:e.$t("Größe (in ha)")},on:{blur:function(t){i.fieldSize=e.fieldSizeDecimals(i.fieldSize)}},model:{value:i.fieldSize,callback:function(t){e.$set(i,"fieldSize",t)},expression:"field.fieldSize"}}),t("FormFieldDropdown",{attrs:{label:e.$t("Kultur"),value:e.cropValueForDropdown(i),items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching},on:{update:e=>i.cropId=e.id}}),null!=i.cropId&&e.showCopyCropToAllFields?t("BButton",{staticClass:"modal-insert-fields__button-copy-crop",attrs:{variant:"outline-primary",size:"sm"},on:{click:function(t){return e.copyCropToAllFields(i)}}},[e._v(" "+e._s(e.$t("Kultur für alle Felder übernehmen"))+" ")]):e._e(
1)],1)}))],2)]},proxy:!0},{key:"bottom-content",fn:function(){return[t("p",{staticClass:"text-danger m-0"},[e.missingCompany?t("span",[e._v(e._s(e.$t("Betrieb fehlt.")))]):e._e(),e.uniqueNameViolation?t("span",[e._v(e._s(e.$t("Ein Feld mit diesem Namen existiert bereits.")))]):null!=e.missingName?t("span",[e._v(e._s(e.$t("Bezeichnung für Feld {number} fehlt.",{number:e.missingName+1})))]):e.invalidNewFields.length>0?t("span",[e._v(e._s(e.$t("Ein oder mehrere Felder haben eine ungültige Kontur")))]):t("span",{staticStyle:{display:"inline-block"}})])]},proxy:!0},{key:"map-container",fn:function(){return[t("FieldsMap",{ref:"map",staticClass:"modal-insert-fields__map",attrs:{"initial-center-include-disabled":"",companies:e.companies,crops:e.crops,varieties:e.varieties,disabledFields:e.fields,activeFields:e.activeFields,editableFields:e.editableFields,insertEnabled:!e.showForm,invalidNewFields:e.invalidNewFields,selectionSource:"MAP"},on:{insert:e.insert,addPolygon:e.addPolygon,"change:polygon":e.changePolygon,"change:marker":e.changeMarker,"change:fieldName":e.changeFieldName,"click:polygon":t=>e.currentField=t,"click:marker":t=>e.currentField=t,"action:save":e.fieldSave,"action:removePolygon":e.onRemovePolygon,"action:discard":e.fieldDiscard}})]},proxy:!0},{key:"buttons",fn:function(){return[e.showForm?e._e():t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.newFields.length<1},on:{click:e.mapOk}},[t("span",[e._v(e._s(e.$t("Weiter")))])]),e.showForm?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.newFields.length<1||e.invali
1dNewFields.length>0},on:{click:e.save}},[t("span",[e._v(e._s(e.$t("Speichern")))])]):e._e(),e.showForm?t("BButton",{staticClass:"mr-3",attrs:{variant:"white"},on:{click:function(t){e.showForm=!1}}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),t("BButton",{attrs:{variant:"white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0},{key:"footer-content-right",fn:function(){return[e.showForm?e._e():t("InfoContainer",[e._v(" "+e._s(e.$t("Klicke in der Karte um ein neues Feld hinzuzufügen."))+" ")])]},proxy:!0}])})},G9=[],W9={name:"ModalInsertFields",components:{FormFieldSelect:n9,FormFieldDropdown:lk,FormFieldInput:fk,FormFieldSet:_k,FieldsMap:b7,ModalWrapper:OC,InfoContainer:G7},mixins:[lI,y9],model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}}},data(){return{showForm:!1,newFields:[],invalidNewFields:[],companyId:null,customerId:"own",currentField:null,missingCompany:!1,missingName:null,uniqueNameViolation:!1,errorMessage:""}},computed:{...(0,C.Se)({crops:"products/crops",cropsUsed:"products/crops/used",fields:"fields/dataWithoutRemoved",customers:"customers/data",varieties:"varieties/data"}),nameInputState(){return null==this.missingName&&!this.uniqueNameViolation&&null},columnsByKey(){return null==this.columns?{}:this.columns.reduce(((e,t)=>({...e,[t.key]:t})),{})},companies(){return this.$store.state.auth.currentCompanies},companyOptions(){return[{value:null,text:this.$t("Betrieb wählen"),disabled:!0},...this.companies.map((e=>({value:e.id,text:e.name})))]},fieldSizeRounded:{get(){return"number"!==typeof this.field.fieldSize?null:Math.round(100*this.field.fieldSize)/100},set(e){this.field.fieldSize=e}},activeFields(){return this.newFields.filter((e=>e.id!==this.currentField)).reduce(((e,t)=>({...e,[t.id]:t})),{})},editableFields(){return this.newFields.filter((e=>e.id===this.currentField)).reduce(((e,t)=>({...e,[t.id]:t})),{})},showCopyCropToAllFields(){if(this.newFields.length<2)return!1;const{cropId:e}=this.newFields[0];return this.newFields.some((t=>t.cropId!==e))},useCustomers(){return null!=this.customers&&(null!=this.columnsByKey[tA.key]&&this.columnsByKey[tA.key].visible&&Object.keys(this.customers).length>0)},useFieldNumber(){return null!=this.columnsByKey.fieldNumber&&this.columnsByKey.fieldNumber.visible},customerValueForDropdown(){return null!=this.customerId&&null!=this.customers[this.customerId]?{id:this.customerId,name:this.customers[this.customerId].name}:"own"===this.customerId?{id:"own",name:this.$t("Eigener Betrieb")}:{id:null,name:""}},customersToDropdownItems(){return[{id:"crops-used",items:[{id:"own",name:this.$t("Eigener Betrieb")}],sort:!1},{name:this.$t("Kunden"),id:"customers",items:Object.values(this.customers),sort:!0}]},requireUniqueFieldName(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELD_NAMES_UNIQUE)}},created(){this.$store.dispatch("products/crops/subscribe")},methods:{save(){if(this.resetDirtyFormValues(),this.companies.length>1&&null==this.companyId)return void(this.missingCompany=!0);const e=Object.values(this.newFields).some(((e,t)=>!("string"===typeof e.name&&e.name.length>0)&&(this.currentField=e.id,this.missingName=t,!0)));if(e)return;if(this.requireUniqueFieldName){const e=Object.values(this.newFields).some(((e,t)=>!!this.$store.getters["fields/isUniqueFieldName"](e.name)&&(this.missingName=t,this.currentField=e.id,this.uniqueNameViolation=!0,!0)));if(e)return}let t=null;null!=this.customerId&&null!=this.customers[this.customerId]&&({customerId:t}=this),Object.values(this.newFields).forEach((e=>{const i={...e,[tA.key]:t};this.companies.length>1&&(i[XF.key]=this.companyId),this.$store.dispatch("fields/insertAndSyncNewEntry",{entry:i})})),this.hide()},hide(){this.$refs.modalWrapper.hide()},selectCrop(e){this.field.cropId=e.id,this.field.crop.name=e.name},insert(e){let t=null,i=null;null!=e.fieldContour&&(i=Math.floor((0,Y6.Z)(e.fieldContour.geoJson))/1e4,t={...e.fieldContour,id:ma(),area:i});const a=ma();this.newFields=[...this.newFields,{...e,"fieldGroup.mfa":null,name:null,fieldSize:i,cropId:null,id:a,fieldContour:t,placeholderName:this.$t("Feld {number}",{number:this.newFields.length+1})}],this.currentField=a},addPolygon(e){let t=null,i=null;
1null!=e.fieldContour&&(i=Math.floor((0,Y6.Z)(e.fieldContour.geoJson))/1e4,t={...e.fieldContour,id:ma(),area:i}),this.newFields=this.newFields.map((a=>a.id!==e.id?a:{...a,fieldSize:i,fieldContour:t}))},changePolygon({fieldContour:e,fieldId:t}){const i=Math.floor((0,Y6.Z)(e.geoJson))/1e4;this.newFields=this.newFields.map((a=>{if(a.id!==t)return a;const n=f4(e.geoJson.coordinates);return n?this.invalidNewFields.some((e=>e.id===a.id))&&(this.invalidNewFields=this.invalidNewFields.filter((e=>e.id!==a.id))):this.invalidNewFields.push(a),{...a,fieldSize:i,fieldContour:{...a.fieldContour,geoJson:e.geoJson,area:i}}}))},changeMarker({lat:e,lon:t,fieldId:i}){this.newFields=this.newFields.map((a=>a.id!==i?a:{...a,lat:e,lon:t}))},changeFieldName({fieldId:e,name:t}){this.newFields=this.newFields.map((i=>i.id!==e?i:{...i,name:t}))},fieldSave(e){this.currentField===e&&(this.currentField=null)},onRemovePolygon(e){this.newFields=this.newFields.map((t=>t.id!==e?t:{...t,fieldContour:null}))},fieldDiscard(e){this.currentField===e&&(this.currentField=null),this.newFields=this.newFields.filter((t=>t.id!==e)).map(((e,t)=>({...e,placeholderName:this.$t("Feld {number}",{number:t+1})})))},fieldHeadline(e){return"string"!==typeof e.name||0===e.name.length?e.placeholderName:e.name},updateFormFieldCollapsed(e,t){t?t&&this.currentField===e.id&&(this.currentField=null):this.currentField=e.id},cropValueForDropdown(e){return null==e.cropId||null==this.crops[e.cropId]?{id:null,name:""}:{id:e.cropId,name:this.crops[e.cropId].name}},copyCropToAllFields(e){this.newFields=this.newFields.map((t=>({...t,cropId:e.cropId})))},mapOk(){this.showForm=!0,this.newFields.length>0&&(this.currentField=this.newFields[0].id),setTimeout((()=>{this.$refs.map.centerOnFields(this.$refs.map.editableFields)}),750)},resetDirtyFormValues(){this.currentField=null,this.missingCompany=!1,this.missingName=null,this.uniqueNameViolation=!1,this.errorMessage=""},resetNameInput(){this.missingName=null,this.uniqueNameViolation=!1,this.errorMessage=""}}},Z9=W9,K9=(0,ew.Z)(Z9,H9,G9,!1,null,"712ec1e3",null),q9=K9.exports,Y9=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max","body-class":"modal-move-fields",visible:e.visible,title:e.copyInsteadOfMove?e.$t("Felder kopieren"):e.$t("Felder verschieben")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([e.success?{key:"default",fn:function(){return[t("p",[e._v(" "+e._s(e.copyInsteadOfMove?e.$t("Die Felder wurden erfolgreich kopiert."):e.$t("Die Felder wurden erfolgreich verschoben."))+" ")])]},proxy:!0}:{key:"default",fn:function(){return[t("FormFieldSet",{staticClass:"modal-move-fields__form-field-set",attrs:{headline:e.$t("Ziel-Erntejahr")}},[e.singleField?t("p",{staticClass:"mt-3"},[e._v(" "+e._s(e.description[0])),t("strong",[e._v(e._s(e.singleFieldNameLong))]),e._v(e._s(e.description[1])+" ")]):t("p",{staticClass:"mt-3"},[e._v(" "+e._s(e.description)+" ")]),e.availableCompanies.length>1?t("FormFieldSelect",{attrs:{required:"",label:e.$t("Ziel-Betrieb"),options:e.companyOptions,disabled:e.fetching},model:{value:e.selectedCompany,callback:function(t){e.selectedCompany=t},expression:"selectedCompany"}}):e._e(),t("FormFieldSelect",{attrs:{required:"",label:e.$t("Ziel-Erntejahr"),options:e.processOrderOptions,disabled:e.fetching,state:!e.missingProcessOrder&&null},model:{value:e.selectedProcessOrder,callback:function(t){e.selectedProcessOrder=t},expression:"selectedProcessOrder"}}),t("FormCheckbox",{staticClass:"mt-3 mb-3",attrs:{disabled:e.fetching},model:{value:e.copyInsteadOfMove,callback:function(t){e.copyInsteadOfMove=t},expression:"copyInsteadOfMove"}},[e._v(" "+e._s(e.$t("Felder kopieren anstatt zu verschieben."))+" ")])],1),e.measuresExist?t("FormFieldSet",{attrs:{headline:e.$t("Maßnahmen")}},[e.copyInsteadOfMove?t("p",{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch kopieren?"))+" ")]):t("p",{staticClass:"mt-3"},[e._v(" "+e._s(e.$t("Es existieren Maßnahmen für die ausgewählten Felder. Möchtest du die Maßnahmen auch verschieben?"))+" ")]),t("FormFieldRadioGroup",{attrs:{variant:"no-label"},model:{value:e.addMeasures,callback:function(t){e.addMeasures=t},expression:"addMeasures"}},[e.copyInsteadOfMove?t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:!0,disabled:e.fetching}},[e._v(" "+e._s(e.$t("Ja, Maßnahmen auch in das Ziel-Erntejahr kopieren."))+" ")]):t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:!0,disabled:e.fetching}},[e._v(" "+e._s(e.$t("Ja, Maßnahmen auch in das Ziel-Erntejahr verschieben."))+" ")]),e.copyInsteadOfMove?t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:!1,disabled:e.fetching}},[e._v(" "+e._s(e.$t("Nein, nur Felder kopieren."))+" ")]):t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:!1,disabled:e.fetching}},[e._v(" "+e._s(e.$t("Nein, Maßnahmen an der Quelle löschen."))+" ")])],1)],1):e._e(
1),t("FormFieldSet",{directives:[{name:"show",rawName:"v-show",value:null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0,expression:"fieldIdsWithDuplicate != null && Object.keys(fieldIdsWithDuplicate).length > 0"}],ref:"duplicateFieldSet",attrs:{headline:e.titleDuplicateFieldSet}},[t("p",{staticClass:"mt-3"},[e._v(" "+e._s(e.descriptionDuplicateFieldSet)+" ")]),t("FormFieldRadioGroup",{attrs:{variant:"no-label"},model:{value:e.duplicateAction,callback:function(t){e.duplicateAction=t},expression:"duplicateAction"}},[e.copyInsteadOfMove?t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:"skip",disabled:e.fetching,state:!(null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0&&null==e.duplicateAction)&&null}},[e._v(" "+e._s(e.$t("Felder nicht kopieren."))+" ")]):t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:"skip",disabled:e.fetching,state:!(null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0&&null==e.duplicateAction)&&null}},[e._v(" "+e._s(e.$t("Felder nicht verschieben."))+" ")]),t("FormRadio",{ref:"duplicateActionUpdate",staticClass:"mt-3 mb-3",attrs:{value:"update",disabled:e.fetching||e.updateActionDisabled,state:!(null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0&&null==e.duplicateAction&&!e.updateActionDisabled&&!e.fetching)&&null}},[e._v(" "+e._s(e.$t("Felder aktualisieren."))+" ")]),t("FormRadio",{staticClass:"mt-3 mb-3",attrs:{value:"duplicate",disabled:e.fetching,state:!(null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0&&null==e.duplicateAction)&&null}},[e._v(" "+e._s(e.$t("Duplikate erstellen."))+" ")])],1),t("ContentBox",[t("p",[e._v(" "+e._s(e.$t("Die folgenden Felder existieren bereits am Ziel."))+" ")]),t("ul",{staticClass:"modal-move-fields__duplicate-list"},e._l(e.fieldsWithDuplicate,(function(i){return t("li",{key:i.id},[e._v(" "+e._s(i.name)+" ")])})),0)])],1),null!=e.duplicateActionUpdateTarget?t("BTooltip",{attrs:{target:e.duplicateActionUpdateTarget,delay:"300"}},[e._v(" "+e._s(e.$t("Es existieren mehrere Felder am Ziel."))+" ")]):e._e()]},proxy:!0},{key:"bottom-content",fn:function(){return[null!=e.userErrorMessage?t("ErrorUserMessage",{staticClass:"m-0",attrs:{"error-user-message":e.userErrorMessage,"show-first-only":""}}):null!=e.fieldIdsWithDuplicate&&Object.keys(e.fieldIdsWithDuplicate).length>0&&null==e.duplicateAction?t("p",{staticClass:"text-danger m-0"},[t("span",[e._v(e._s(e.$t("Bitte wähle wie Duplikate behandelt werden sollen.")))])]):e._e()]},proxy:!0},{key:"map-container",fn:function(){return[e.initialized?t("FieldsMap",{ref:"map",staticClass:"modal-insert-fields__map",attrs:{companies:e.companies,crops:e.crops,disabledFields:e.disabledFields,activeFields:e.activeFields}}):t("div")]},proxy:!0},e.success?{key:"buttons",fn:function(){return[t("BButton",{attrs:{variant:"primary"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Schließen")))])])]},proxy:!0}:{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.fetching},on:{click:e.move}},[t("span",[e._v(e._s(e.copyInsteadOfMove?e.$t("Felder kopieren"):e.$t("Felder verschieben")))])]),t("BButton",{attrs:{variant:"outline_white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}],null,!0)})},J9=[],X9=function(){var e=this,t=e._self._c;return t("div",{staticClass:"content-box"},[e._t("default")],2)},Q9=[],eee={name:"ContentBox"},tee=eee,iee=(0,ew.Z)(tee,X9,Q9,!1,null,"36caf593",null),aee=iee.exports,nee={name:"ModalMoveFields",components:{ErrorUserMessage:cH,FormFieldRadioGroup:_T,FormRadio:kT,FormCheckbox:Gw,ContentBox:aee,FormFieldSelect:n9,FormFieldSet:_k,FieldsMap:b7,ModalWrapper:OC},mixins:[cG],model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIds:{type:Array,required:!0}},data(){return{initialized:!1,disabledFields:{},activeFields:{},fetching:!1,fieldIdsWithDuplicate:null,success:!1,missingProcessOrder:!1,selectedCompany:null,selectedProcessOrder:null,copyInsteadOfMove:!1,addMeasures:!1,duplicateAction:null}},async created(){await Promise.all([this.$store.dispatch("fields/subscribe"),this.$store.dispatch("activities/sub
1scribe")]),this.disabledFields=Object.values(this.fields).filter((e=>!this.fieldIds.includes(e.id))).reduce(((e,t)=>({...e,[t.id]:t})),{}),this.activeFields=this.fieldIds.filter((e=>null!=this.fields[e])).reduce(((e,t)=>({...e,[t]:this.fields[t]})),{}),this.selectedCompany=this.companies[0].id,this.initialized=!0},computed:{...(0,C.Se)({crops:"products/crops",fields:"fields/dataWithoutRemoved",measures:"activities/data"}),companies(){return this.$store.state.auth.currentCompanies},availableCompanies(){return Object.values(this.$store.state.auth.companiesById)},singleField(){return 1===Object.values(this.activeFields).length},singleFieldNameLong(){return this.singleField?rA.data.call(this,this.fields[Object.values(this.activeFields)[0].id]):null},description(){if(this.singleField)return 1===this.availableCompanies.length?this.copyInsteadOfMove?this.$t("Wähle das Ziel-Erntejahr, wohin {field} kopiert werden soll.",{field:"#####"}).split("#####"):this.$t("Wähle das Ziel-Erntejahr, wohin {field} verschoben werden soll.",{field:"#####"}).split("#####"):this.copyInsteadOfMove?this.$t("Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} kopiert werden soll.",{field:"#####"}).split("#####"):this.$t("Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin {field} verschoben werden soll.",{field:"#####"}).split("#####");const e=[this.$t("Es sind {count} Felder ausgewählt.",{count:Object.values(this.activeFields).length})];return 1===this.availableCompanies.length?this.copyInsteadOfMove?e.push(this.$t("Wähle das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.")):e.push(this.$t("Wähle das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.")):this.copyInsteadOfMove?e.push(this.$t("Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder kopiert werden sollen.")):e.push(this.$t("Wähle den Ziel-Betrieb und das Ziel-Erntejahr, wohin die gewählten Felder verschoben werden sollen.")),e.join(" ")},companyOptions(){return[...this.availableCompanies].sort(((e,t)=>{if(null!=e.clusterId&&null==t.clusterId)return 1;if(null==e.clusterId&&null!=t.clusterId)return-1;if(null!=e.clusterId&&null!=t.clusterId){if(e.clusterId<t.clusterId)return-1;if(e.clusterId>t.clusterId)return 1}return e.name<t.name?-1:e.name>t.name?1:0})).map((e=>({value:e.id,text:e.name})))},processOrderOptions(){const e={value:null,text:this.$t("Erntejahr wählen"),disabled:!0};if(null==this.selectedCompany||null==this.$store.state.auth.companiesById[this.selectedCompany]||!Array.isArray(this.$store.state.auth.companiesById[this.selectedCompany].processOrders))return[e];const t=[];return this.fieldIds.forEach((e=>{null==this.fields[e]||null==this.fields[e].processOrder||t.includes(this.fields[e].processOrder.companyId)||t.push(this.fields[e].processOrder.companyId)})),[e,...this.$store.state.auth.companiesById[this.selectedCompany].processOrders.filter((e=>"inwork"===e.type)).map((e=>({value:e.id,text:e.name,disabled:t.includes(e.companyId)&&e.name===this.$store.state.auth.currentProcessOrderName}))).sort(((e,t)=>e.text-t.text))]},measuresExist(){if(0===Object.values(this.measures).length)return!1;let e=new Set;return Object.values(this.measures).forEach((t=>{e.add(t.fieldId)})),e=[...e],this.fieldIds.some((t=>e.includes(t)))},titleDuplicateFieldSet(){return 1===this.availableCompanies.length?this.$t("Duplikate im Ziel-Erntejahr"):this.$t("Duplikate im Ziel-Betrieb/Ziel-Erntejahr")},descriptionDuplicateFieldSet(){return null==this.fieldIdsWithDuplicate?null:1===this.fieldIds.length?this.$t("Das gewählte Feld existiert bereits am Ziel. Wähle wie dieses Feld behandelt werden soll."):1===Object.keys(this.fieldIdsWithDuplicate).length?this.$t("1 von {countTotal} Felder existiert bereits am Ziel. Wähle wie dieses Feld behandelt werden soll.",{countTotal:this.fieldIds.length}):this.$t("{count} von {countTotal} Felder existieren bereits am Ziel. Wähle wie diese Felder behandelt werden sollen.",{count:Object.keys(this.fieldIdsWithDuplicate).length,countTotal:this.fieldIds.length})},fieldsWithDuplicate(){return null==this.fieldIdsWithDuplicate?null:Object.keys(this.fieldIdsWithDuplicate).map((e=>({id:e,name:this.fieldNameLong(e)}))).sort(((e,t)=>fF(e.name,t.name)))},updateActionDisabled(){return null!=this.fieldIdsWithDuplicate&&Object.values(this.fieldIdsWithDuplicate).some((e=>Array.isArray(e)&&e.length>1))},duplicateActionUpdateTarget(){return this.updateActionDisabled?null==this.$refs.duplicateActionUpdate?null:this.$refs.duplicateActionUpdate.$el.querySelector("label"):null}},watch:{async selectedCompany(){this.selectedProcessOrder=null},selectedProcessOrder(){this.userErrorMessage=null,this.fieldIdsWithDuplicate=null,this.duplicateAction=null,this.missingProcessOrder=!1}},methods:{async move(){if(null==this.selectedProcessOrder)return this.missingProcessOrder=!0,void(this.userErrorMessage=this.$t("{field} ist ein Pflichtfeld.",{field:this.$t("Ziel-Erntejahr")}));if(this.userErrorMessage=null,this.fetching=!0,null==this.fieldIdsWithDuplicate&&await this.checkForDuplicates(),null!=this.userErrorMessage||null!=this.fieldIdsWithDuplicate&&Object.keys(this.fieldIdsWithDuplicate).length>0&&null==this.duplicateAction)return this.$nextTick((()=>{this.$refs.duplicateFieldSet.$el.scrollIntoView()})),void(this.fetching=!1);const e=this.fieldIds.filter((e=>"skip"!==this.duplicateAction||(null==this.fieldIdsWithDuplicate||null==this.fieldIdsWithDuplicate[e]))).map((e=>{let t=null;return"update"===this.duplicateAction&&null!=this.fieldIdsWithDuplicate&&Array.isArray(this.fieldIdsWithDuplicate[e])&&1===this.fieldIdsWithDuplicate[e].length&&([t]=this.fieldIdsWithDuplicate[e]),{id:e,targetId:t}}));if(0===e.length)return this.fetching=!1,this.success=!0,void this.$emit("success");try{this.source=l().CancelToken.source();const{data:t}=await l().post("/admin/rest/field/move_into_processorder",{data:{processOrderId:this.selectedProcessOrder,fields:e,copyInsteadOfMove:this.copyInsteadOfMove,addMeasures:this.addMeasures}},{cancelToken:this.source.token});if(null==t||"success"!==t.status)return this.setUserErrorMessageFromResponse(t),void(this.fetching=!1)}catch(t){return this.setUserErrorMessageFromResponse(t),void(this.fetching=!1)}await this.$store.dispatch("fields/refresh"),this.copyInsteadOfMove||this.$store.commit("fields/syncAllRemovesFinish",e),this.fetching=!1,this.success=!0,this.$emit("success")},async checkForDuplicates(){try{this.source=l().CancelToken.source();const{data:e}=await l().post("/admin/rest/field/check_for_duplicates_in_processorder",{data:{processOrderId:this.selectedProcessOrder,fieldIds:this.fieldIds}},{cancelToken:this.source.token});if(null==e||"success"!==e.status)return void this.setUserErrorMessageFromResponse(e);null!=e.data&&Object.keys(e.data).length>0&&(this.fieldIdsWithDuplicate=e.data)}catch(e){this.setUserErrorMessageFromResponse(e)}},hide(){null!=this.source&&this.source.cancel(),this.$refs.modalWrapper.hide()},fieldNameLong(e){return rA.data.call(this,this.fields[e])}}},ree=nee,see=(0,ew.Z)(ree,Y9,J9,!1,null,"15190d9c",null),oee=see.exports,lee=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"md","body-class":"modal-remove-shared-fields",visible:e.visible,title:e.$t("Freigaben entfernen")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("p",[e._v(e._s(e.$t("Hier kannst du alle Freigaben für einen Betrieb im aktuellen Erntejahr entfernen.")))]),e._l(e.sharedFieldsCompaniesById,(function(i){return t("p",{key:i.id,staticClass:"pr-3"},[e._v(" "+e._s(i.name)+" ("+e._s(e.$t("{count} Felder",{count:e.sharedFieldCountByCompanyId[i.id]}))+") "),t("FontAwesomeIcon",{staticClass:"float-right text-danger cursor-pointer",attrs:{icon:"trash-alt"},on:{click:function(t){e.companyIdToRemove=i.id}}}),e.companyIdToRemove===i.id?t("ButtonLink",{staticClass:"d-block mt-2",staticStyle:{"text-align":"left"},on:{click:e.remove}},[e._v(" "+e._s(e.$t("Freigaben jetzt entfernen.",{companyName:i.name}
1))+" ")]):e._e()],1)}))]},proxy:!0},{key:"bottom-content",fn:function(){return[t("ErrorUserMessage",{staticClass:"m-0",attrs:{"response-data":e.responseData}})]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.fetching},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Schließen")))])]),t("BButton",{attrs:{variant:"outline_white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}])})},dee=[];ow.vI.add(uw.I7k);var cee={name:"ModalRemoveSharedFields",components:{ButtonLink:Fw,ErrorUserMessage:cH,ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},sharedFieldsByFieldId:{type:Object,default:null},sharedFieldsCompaniesById:{type:Object,default:null},sharedFieldsByShareId:{type:Object,default:null}},data(){return{fetching:!1,source:null,responseData:null,companyIdToRemove:null}},computed:{sharedFieldCountByCompanyId(){return null==this.sharedFieldsByFieldId?null:Object.values(this.sharedFieldsByShareId).reduce(((e,t)=>{const i={...e};return null==i[t.companyId]&&(i[t.companyId]=0),i[t.companyId]+=1,i}),{})}},watch:{visible(e,t){!0===e&&!1===t&&this.reset()}},created(){this.reset()},methods:{reset(){this.fetching=!1,this.responseData=null,this.companyIdToRemove=null},async remove(){let e;this.responseData=null,this.fetching=!0;try{const{data:t}=await l().post("/admin/rest/sharedField/delete_for_target",{version:"2.0",data:{sourceProcessOrderIds:this.$store.getters["auth/currentProcessOrderIds"],targetCompanyId:this.companyIdToRemove}});e=ue(t)}catch(t){console.error(t),e=ue(t)}this.fetching=!1,null!=e&&"success"===e.status?this.$emit("success",e.data):this.responseData=e},hide(){null!=this.source&&this.source.cancel(),this.$refs.modalWrapper.hide()}}},uee=cee,pee=(0,ew.Z)(uee,lee,dee,!1,null,null,null),hee=pee.exports,mee=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"xl","body-class":"modal-share-fields",visible:e.visible,title:e.$t("Felder freigeben")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("p",[e._v(" "+e._s(e.$t("Du kannst deine Felder anderen Benutzern freigeben. Du musst dafür lediglich die E-Mail des Empfängers angeben."))+" ")]),t("div",{staticClass:"two-cols__wrapper"},[t("div",{staticClass:"two-cols__column"},[t("ValidationObserver",{ref:"validationObserver",attrs:{slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("FormFieldSet",{attrs:{headline:e.$t("Empfänger")}},[t("ValidationProvider",{attrs:{rules:"required|email",slim:"",name:e.$t("E-Mail-Adresse")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{attrs:{name:"receiverEmail",type:"email",autocomplete:"off",required:"",label:e.$t("E-Mail-Adresse"),placeholder:e.$t("E-Mail-Adresse eingeben"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.veeValidateErrors=null}},model:{value:e.receiverEmail,callback:function(t){e.receiverEmail=t},expression:"receiverEmail"}})]}}],null,!0)})],1),t("FormFieldSet",{attrs:{headline:e.$t("Sender")}},[t("FormFieldInput",{attrs:{name:"senderReference",type:"text",autocomplete:"off",label:e.$t("Sender-Referenz"),placeholder:e.$t("Sender-Referenz"),disabled:e.fetching},model:{value:e.senderReference,callback:function(t){e.senderReference=t},expression:"senderReference"}}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("Betriebsnummer")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{attrs:{name:"farmNumber",type:"text",autocomplete:"off",required:"",label:e.$t("Betriebsnummer"),placeholder:e.$t("Betriebsnummer"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.veeValidateErrors=null}},model:{value:e.farmNumber,callback:function(t){e.farmNumber=t},expression:"farmNumber"}})]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("Betriebsname")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{attrs:{name:"farmName",type:"text",autocomplete:"off",required:"",label:e.$t("Betriebsname"),placeholder:e.$t("Betriebsname"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},on:{input:function(t){e.veeValidateErrors=null}},model:{value:e.farmName,callback:function(t){e.farmName=t},expression:"farmName"}})]}}],null,!0)}),t("FormFieldInput",{attrs:{name:"message",type:"text",autocomplete:"off",label:e.$t("Bemerkung"),placeholder:e.$t("Bemerkung"),disabled:e.fetching,state:!(i.length>0&&!e.dirty)&&null},on:{input:function(t){e.veeValidateErrors=null}},model:{value:e.message,callback:function(t){e.message=t},expression:"message"}})],1)]}}])}
1)],1),t("div",{staticClass:"two-cols__column"},[t("FormFieldSetBordered",{attrs:{headline:e.$t("Geteilte Informationen:"),description:e.shareInfoDescription}},[t("FormFieldCheckboxGroup",{staticClass:"mt-0 mb-0",attrs:{variant:"no-label"},model:{value:e.shareOptions,callback:function(t){e.shareOptions=t},expression:"shareOptions"}},[t("FormCheckbox",{attrs:{value:"fields",switch:"",disabled:""}},[e._v(" "+e._s(e.$t("Felder und Geodaten teilen"))+" ")]),t("FormCheckbox",{attrs:{value:"measures",switch:""}},[e._v(" "+e._s(e.$t("Maßnahmen teilen"))+" ")]),t("FormCheckbox",{attrs:{value:"soilSamples",switch:""}},[e._v(" "+e._s(e.$t("Bodenproben teilen"))+" ")]),t("FormCheckbox",{attrs:{value:"fertilizationData",switch:""}},[e._v(" "+e._s(e.$t("Nährstoffbilanz teilen"))+" ")])],1)],1),t("FormFieldSetBordered",{attrs:{headline:e.$t("Ablaufdatum:"),description:e.shareExpirationDescription}},[t("FormFieldRadioGroup",{staticClass:"mt-0 mb-0",attrs:{variant:"no-label"},model:{value:e.shareExpirationRadio,callback:function(t){e.shareExpirationRadio=t},expression:"shareExpirationRadio"}},[t("FormRadio",{attrs:{value:"no-expiration"}},[e._v(e._s(e.$t("Kein Enddatum festlegen")))]),t("FormRadio",{attrs:{value:"share-until"}},[e._v(e._s(e.$t("Freigeben bis:")))])],1),t("BaseFormField",{staticClass:"mt-1 mb-1",attrs:{label:e.$t("Ablaufdatum")}},[t("Datepicker",{staticClass:"pt-1",attrs:{calendarClass:"modal-share-fields__datepicker",maximumView:"day","monday-first":"English"!==e.$store.getters.datepickerTranslation.language,value:e.shareExpiration,disabledDates:e.handleCalendarDate,language:e.$store.getters.datepickerTranslation},on:{selected:e.setExpirationDateFromDatepicker}})],1)],1)],1)])]},proxy:!0},{key:"bottom-content",fn:function(){return[t("ErrorUserMessage",{staticClass:"m-0",attrs:{"response-data":e.responseData,"vee-validate-errors":e.veeValidateErrors}})]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.fetching},on:{click:e.share}},[t("span",[e._v(e._s(e.$t("Freigeben")))])]),e.sharedFieldData?t("BButton",{staticClass:"text-danger",attrs:{variant:"outline_white"},on:{click:e.remove}},[t("span",[e._v(e._s(e.$t("Freigabe entfernen")))])]):e._e(),t("BButton",{attrs:{variant:"outline_white"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])])]},proxy:!0}])})},fee=[],gee=(i(92087),function(){var e=this,t=e._self._c;return t("div",{staticClass:"form-field-set-bordered",class:{"form-field-set-bordered--collapsed":!e.contentVisible,"form-field-set-bordered--no-toggle-link":e.hideLinkOpen}},[e.collapsible?t("span",{staticClass:"form-field-set-bordered__collapsible-icon",on:{click:e.toggleCollapsed}},[t("FontAwesomeIcon",{attrs:{icon:e.contentVisible?["far","angle-up"]:["far","angle-down"]}})],1):e._e(),t("div",{staticClass:"form-field-set-bordered__headline",class:{"form-field-set-bordered__headline--collapsible":e.collapsible},on:{click:e.toggleCollapsed}},[e.$slots["header"]?t("div",{staticClass:"form-field-set-bordered__headline-title"},[e._t("header")],2):t("div",{staticClass:"form-field-set-bordered__headline-title"},[e._v(" "+e._s(e.headline)+" ")]),e.$slots["description"]?t("div",{staticClass:"form-field-set-bordered__headline-description"},[e._t("description")],2):null!=e.description?t("div",{directives:[{name:"show",rawName:"v-show",value:!(e.hideDescriptionOnOpen&&e.contentVisible),expression:"!(hideDescriptionOnOpen && contentVisible)"}],staticClass:"form-field-set-bordered__headline-description"},[e._v(" "+e._s(e.description)+" ")]):e._e()]),t("BCollapse",{staticClass:"form-field-set-bordered__content",class:{"form-field-set-bordered__content--no-toggle-link":e.hideLinkClose},model:{value:e.contentVisible,callback:function(t){e.contentVisible=t},expression:"contentVisible"}},[e._t("default")],2),e.contentVisible&&!e.hideLinkClose||!e.contentVisible&&!e.hideLinkOpen?t("ButtonLink",{staticClass:"text-small",on:{click:e.toggleCollapsed}},[e._v(" "+e._s(e.contentVisible?e.labelLinkClose:e.labelLinkOpen)+" ")]):e._e()],1)}),yee=[];ow.vI.add(lw.onQ,lw.gc2);var vee={name:"FormFieldSetBordered",components:{ButtonLink:Fw,BCollapse:vk.k,FontAwesomeIcon:s.GN},model:{prop:"collapsed",event:"update"},props:{headline:{type:String,default:null},description:{type:String,default:null},hideDescriptionOnOpen:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0},collapsed:{type:Boolean,default:!0},hideLinkOpen:{type:Boolean,default:!1},labelLinkOpen:{type:String,default(){return this.$t("Einstellungen anzeigen")}},hideLinkClose:{type:Boolean,default:!1},labelLinkClose:{type:String,default(){return this.$t("Einstellungen verstecken")}}},data(){return{collapsedInternal:this.collapsed}},watch:{collapsed(){this.collapsedInternal=this.collapsed}},computed:{contentVisible:{get(){return!this.collapsible||!this.collapsedInternal},set(e){this.collapsedInternal=!e,this.$emit("update",this.collapsedInternal)}}},methods:{toggleCollapsed(){this.contentVisible=this.collapsedInternal}}},bee=vee,wee=(0,ew.Z)(bee,gee,yee,!1,null,"33c084f0",null),Cee=wee.exports,Fee={name:"ModalShareFields",components:{BaseFormField:BA,FormRadio:kT,FormFieldRadioGroup:_T,FormFieldInput:fk,ErrorUserMessage:cH,ModalWrapper:OC,FormFieldSet:_k,FormFieldSetBordered:Cee,FormFieldCheckboxGroup:A_,Form
1Checkbox:Gw,Datepicker:iS.Z},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldIds:{type:Array,required:!0},sharedFieldData:{type:Object,required:!1}},data(){return{responseData:null,fetching:!1,source:null,receiverEmail:"",senderReference:"",farmNumber:"",farmName:"",message:"",shareOptions:["fields"],shareExpiration:null,veeValidateErrors:null,handleCalendarDate:{customPredictor:e=>e<new Date}}},computed:{...(0,C.Se)({fields:"fields/dataWithoutRemoved"}),companyForFieldIds(){let e=null;return this.fieldIds.some((t=>{const i=this.fields[t];if(null==i||null==i.processOrderId||null==this.$store.getters["auth/processOrdersById"][i.processOrderId])return!1;const{companyId:a}=this.$store.getters["auth/processOrdersById"][i.processOrderId];return null!=a&&null!=this.$store.state.auth.companiesById[a]&&(e=this.$store.state.auth.companiesById[a],!0)})),e},shareInfoDescription(){const e=[this.$t("Felder"),this.$t("Feldpositionen")];this.shareOptions.includes("measures")&&e.push(this.$t("Maßnahmen")),this.shareOptions.includes("soilSamples")&&e.push(this.$t("Bodenproben")),this.shareOptions.includes("fertilizationData")&&e.push(this.$t("Nährstoffbilanz"));let t=`${e.join(", ")}.`;return t=t.replace(/,([^,]*)$/,` ${this.$t("und")}$1`),t},shareExpirationDescription(){return null==this.shareExpiration?this.$t("Kein Enddatum gesetzt."):this.$t("Freigeben bis {date}.",{date:g()(this.shareExpiration).format("L")})},shareExpirationRadio:{get(){return null==this.shareExpiration?"no-expiration":"share-until"},set(e){if("no-expiration"===e)this.shareExpiration=null;else if(null==this.shareExpiration){const e=new Date;e.setFullYear(e.getFullYear()+1),this.shareExpiration=e}}}},watch:{visible(e,t){!0===e&&!1===t&&this.reset(),!1===e&&!0===t&&this.$emit("resetSharedFieldData")}},created(){this.reset()},methods:{reset(){if(this.sharedFieldData)return this.receiverEmail=this.sharedFieldData.sharingEmail,this.senderReference=this.sharedFieldData.senderReference,this.farmNumber=this.sharedFieldData.farmNumber,this.farmName=this.sharedFieldData.farmName,this.message=this.sharedFieldData.message,this.shareOptions=["fields"],this.sharedFieldData.includeMeasures&&this.shareOptions.push("measures"),this.sharedFieldData.includeSoilSamples&&this.shareOptions.push("soilSamples"),this.sharedFieldData.includeFertilizationData&&this.shareOptions.push("fertilizationData"),void(this.shareExpiration=this.sharedFieldData.expiryDate?new Date(1e3*this.sharedFieldData.expiryDate):null);this.receiverEmail="",this.senderReference="",this.farmNumber=null!=this.companyForFieldIds?this.companyForFieldIds.bdmId:"",this.farmName=null!=this.companyForFieldIds?this.companyForFieldIds.name:"",this.message="",this.shareOptions=["fields"],this.shareExpiration=null},setExpirationDateFromDatepicker(e){this.shareExpiration=e},async share(){if(this.responseData=null,this.$refs.validationObserver.reset(),await this.$refs.validationObserver.handleSubmit(),!this.$refs.validationObserver.flags.valid)return void(this.veeValidateErrors=this.$refs.validationObserver.errors);let e;this.fetching=!0;try{const{data:t}=await l().post("/admin/rest/sharedField/share",{version:"2.0",data:{receiverEmail:this.receiverEmail,fieldIds:this.fieldIds,includeMeasures:this.shareOptions.includes("measures"),includeSoilSamples:this.shareOptions.includes("soilSamples"),includeFertilizationData:this.shareOptions.includes("fertilizationData"),senderReference:this.senderReference,farmNumber:this.farmNumber,farmName:this.farmName,message:this.message,expiryDate:null!=this.shareExpiration?Math.floor(this.shareExpiration/1e3):null}});e=ue(t)}catch(t){console.error(t),e=ue(t)}this.fetching=!1,null!=e&&"success"===e.status?(this.$emit("success",e.data),this.$emit("change",!1)):this.responseData=e},async remove(){if(!this.sharedFieldData.id)return;let e;this.responseData=null,this.fetching=!0;try{const{data:t}=await l()["delete"](`/admin/rest/sharedField/${this.sharedFieldData.id}`);e=ue(t)}catch(t){console.error(t),e=ue(t)}this.fetching=!1,null!=e&&"success"===e.status?(this.$emit("success",e.data),this.$emit("change",!1)):this.responseData=e},hide(){null!=this.source&&this.source.cancel(),this.$refs.modalWrapper.hide()}}},Aee=Fee,kee=(0,ew.Z)(Aee,mee,fee,!1,null,"07d0b245",null),See=kee.exports,Eee=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"max","body-class":"modal-split-field",visible:e.visible,title:e.$t("Feld aufteilen"),"map-full":0===e.currentStep},on:{change:e.hide},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:3,current:e.currentStep}}),1===e.currentStep?t("div",[t("FormInfoContainer",{attrs:{headline:e.$t("Ergebnis anpassen")}},[t("p",[e._v(" "+e._s(e.$t("Das Feld wurde erfolgreich geteilt."))+" "+e._s(e.$t("Du kannst die Eigenschaften der neuen Felder noch anpassen."))+" "),e.measuresExist?t("span",[e._v(" "+e._s(e.$t("Auf welches Feld sollen bereits gebuchte Maßnahmen übernommen werden?"))+" ")]):e._e(
1)]),e.measuresExist?t("FormFieldRadioGroup",{attrs:{variant:"no-label",options:[{text:e.$t("Maßnahmen auf {fieldName} ({fieldSize} ha) übernehmen",{fieldName:e.getNameForField(e.newFieldA),fieldSize:e.getFormattedSizeForField(e.newFieldA)}),value:e.newFieldA.id,disabled:e.fetching},{text:e.$t("Maßnahmen auf {fieldName} ({fieldSize} ha) übernehmen",{fieldName:e.getNameForField(e.newFieldB),fieldSize:e.getFormattedSizeForField(e.newFieldB)}),value:e.newFieldB.id,disabled:e.fetching},{text:e.$t("Maßnahmen auf beide Felder kopieren"),value:"both",disabled:e.fetching},{text:e.$t("Maßnahmen löschen"),value:"delete",disabled:e.fetching}]},model:{value:e.measuresAction,callback:function(t){e.measuresAction=t},expression:"measuresAction"}}):e._e()],1),e._l([e.newFieldA,e.newFieldB],(function(i){return t("FormFieldSet",{key:i.id,attrs:{collapsible:"",headline:e.getNameForField(i),collapsed:e.currentField!==i.id},on:{update:t=>e.updateFormFieldCollapsed(i,t)}},[t("FormFieldInput",{attrs:{label:e.$t("Feldstück Nr"),placeholder:e.$t("Feldstück Nr"),disabled:e.fetching},model:{value:i["fieldGroup.mfa"],callback:function(t){e.$set(i,"fieldGroup.mfa",t)},expression:"field['fieldGroup.mfa']"}}),e.useFieldNumber?t("FormFieldInput",{attrs:{label:e.$t("Feld-Nummer"),placeholder:e.$t("Feld-Nummer"),disabled:e.fetching},model:{value:i.fieldNumber,callback:function(t){e.$set(i,"fieldNumber",t)},expression:"field.fieldNumber"}}):e._e(),t("FormFieldInput",{attrs:{required:"",label:e.$t("Bezeichnung"),placeholder:e.$t("Pflichtfeld"),state:(null==e.missingName||"string"===typeof i.name&&0!==i.name.length)&&null,disabled:e.fetching},on:{update:function(t){e.missingName=null}},model:{value:i.name,callback:function(t){e.$set(i,"name",t)},expression:"field.name"}}),t("FormFieldInput",{attrs:{type:"number",placeholder:"0",step:"0.01",label:e.$t("Größe (in ha)"),disabled:e.fetching},on:{blur:function(t){i.fieldSize=e.fieldSizeDecimals(i.fieldSize)}},model:{value:i.fieldSize,callback:function(t){e.$set(i,"fieldSize",t)},expression:"field.fieldSize"}}),t("FormFieldDropdown",{attrs:{label:e.$t("Kultur"),value:e.cropValueForDropdown(i),items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching,disabled:e.fetching},on:{update:e=>i.cropId=e.id}})],1)}))],2):e._e(),2===e.currentStep?t("div",[t("FormInfoContainer",{attrs:{headline:e.$t("Erledigt")}},[t("p",[e._v(" "+e._s(e.$t("Die Felder wurden erfolgreich erstellt."))+" ")])])],1):e._e()]},proxy:!0},{key:"map-container",fn:function(){return[e.initialized?t("FieldsMap",{ref:"map",staticClass:"modal-split-field__map",attrs:{"hide-all-map-actions":"",crops:e.crops,disabledFields:e.disabledFields,activeFields:e.activeFields,editableFields:e.editableFields,splitFieldEnabled:0===e.currentStep,splitFieldLineValid:e.validSplitLine},on:{"update:splitFieldLineValid":function(t){e.validSplitLine=t},"update:split-field-line-valid":function(t){e.validSplitLine=t},"update:newFieldPolygons":e.updateNewFieldPolygons,"action:split":e.split,"click:polygon":t=>e.currentField=t,"click:marker":t=>e.currentField=t,"change:polygon":e.changePolygon,"change:marker":e.changeMarker,"change:fieldName":e.changeFieldName}}):t("div")]},proxy:!0},{key:"bottom-content",fn:function(){return[e.missingName?t("p",{staticClass:"text-danger m-0"},[t("span",[e._v(e._s(e.$t("Bezeichnung fehlt.")))])]):t("ErrorUserMessage",{staticClass:"m-0",attrs:{"error-user-message":e.userErrorMessage,"show-first-only":""}})]},proxy:!0},{key:"buttons",fn:function(){return[0===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:!e.validSplitLine},on:{click:e.split}},[t("span",[e._v(e._s(e.$t("Aufteilen")))])]):e._e(),1===e.currentStep?t("BButton",{staticClass:"mr-3",attrs:{variant:"primary"},on:{click:e.save}},[t("span",[e._v(" "+e._s(e.$t("Speichern"))+" "),e.fetching?t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}}):e._e()],1)]):e._e(),1===e.currentStep?t("BButton",{attrs:{variant:"white",disabled:e.fetching},on:{click:e.back}},[t("span",[e._v(e._s(e.$t("Zurück")))])]):e._e(),e.currentStep<2?t("BButton",{attrs:{variant:"white"},on:{click:e.hide}}
1,[t("span",[e._v(e._s(e.$t("Abbrechen")))])]):e._e(),2===e.currentStep?t("BButton",{attrs:{variant:"primary"},on:{click:e.hide}},[t("span",[e._v(e._s(e.$t("Schließen")))])]):e._e()]},proxy:!0},{key:"footer-content-right",fn:function(){return[0===e.currentStep&&null==e.validSplitLine?t("InfoContainer",[e._v(" "+e._s(e.$t("Klicke in der Karte um eine Trennlinie zu zeichnen. Klicke zwei mal schnell hintereinander um das Zeichnen zu beenden."))+" ")]):e._e(),0===e.currentStep&&!0===e.validSplitLine?t("InfoContainer",[e._v(" "+e._s(e.$t('Klicke auf "Aufteilen" um zwei neue Felder zu erstellen.'))+" "+e._s(e.$t("Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen."))+" ")]):e._e(),0===e.currentStep&&!1===e.validSplitLine?t("InfoContainer",{attrs:{error:""}},[e._v(" "+e._s(e.$t("Die aktuelle Trennlinie ist ungülitg. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt."))+" "+e._s(e.$t("Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen."))+" ")]):e._e()]},proxy:!0}])})},Iee=[];ow.vI.add(uw.IJ7);var _ee={name:"ModalSplitField",components:{ErrorUserMessage:cH,FormFieldDropdown:lk,FormFieldInput:fk,FormFieldSet:_k,FormFieldRadioGroup:_T,InfoContainer:G7,FieldsMap:b7,FormInfoContainer:c9,ModalWrapper:OC,Pagination:qk},mixins:[cG,y9,lI],model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},fieldId:{type:String,required:!0},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}}},data(){return{initialized:!1,currentStep:0,validSplitLine:void 0,newFieldA:null,newFieldB:null,currentField:null,measuresAction:"both",missingName:null,fetching:!1,source:null}},async created(){await Promise.all([this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("fields/subscribe"),this.$store.dispatch("activities/subscribe")]),this.initialized=!0},computed:{...(0,C.Se)({crops:"products/crops/data",fields:"fields/dataWithoutRemoved",measures:"activities/data"}),disabledFields(){return Object.values(this.fields).filter((e=>this.currentStep>0||e.id!==this.fieldId)).reduce(((e,t)=>({...e,[t.id]:t})),{})},activeFields(){const e={};return 0===this.currentStep&&(e[this.fieldId]=this.fields[this.fieldId]),1===this.currentStep&&this.currentField!==this.newFieldA.id&&(e[this.newFieldA.id]=this.newFieldA),1===this.currentStep&&this.currentField!==this.newFieldB.id&&(e[this.newFieldB.id]=this.newFieldB),2===this.currentStep&&(e[this.newFieldA.id]=this.newFieldA,e[this.newFieldB.id]=this.newFieldB),e},editableFields(){return 1!==this.currentStep?{}:this.currentField===this.newFieldA.id?{[this.newFieldA.id]:this.newFieldA}:this.currentField===this.newFieldB.id?{[this.newFieldB.id]:this.newFieldB}:{}},columnsByKey(){return null==this.columns?{}:this.columns.reduce(((e,t)=>({...e,[t.key]:t})),{})},measuresExist(){return 0!==Object.values(this.measures).length&&Object.values(this.measures).some((e=>e.fieldId===this.fieldId))},companies(){return this.$store.state.auth.currentCompanies},companyOptions(){return[{value:null,text:this.$t("Betrieb wählen"),disabled:!0},...this.companies.map((e=>({value:e.id,text:e.name})))]},useCustomers(){return null!=this.customers&&(null!=this.columnsByKey[tA.key]&&this.columnsByKey[tA.key].visible&&Object.keys(this.customers).length>0)},useFieldNumber(){return null!=this.columnsByKey.fieldNumber&&this.columnsByKey.fieldNumber.visible},customerValueForDropdown(){const e=this.newField["fieldGroup.customerId"];return"own"===e?{id:"own",name:this.$t("Eigener Betrieb")}:null!=this.customers[e]?{id:e,name:this.customers[e].name}:{id:null,name:""}},customersToDropdownItems(){return[{id:"own-company",items:[{id:"own",name:this.$t("Eigener Betrieb")}],sort:!1},{name:this.$t("Kunden"),id:"customers",items:Object.values(this.customers),sort:!0}]}},methods:{getNewFieldForGeoJson(e){const[t,i]=e.coordinates[0].reduce((([e,t],[i,a])=>[e+i,t+a]),[0,0]),a=Math.floor((0,Y6.Z)(e))/1e4;return{...this.fields[this.fieldId],id:ma(),lon:t/e.coordinates[0].length,lat:i/e.coordinates[0].length,fieldContour:{geoJson:e,area:a},fieldSize:a}},updateNewFieldPolygons({geoJsonA:e,geoJsonB:t}){this.newFieldA=this.getNewFieldForGeoJson(e),this.newFieldB=this.getNewFieldForGeoJson(t)},changePolygon({fieldContour:e,fieldId:t}){const i=Math.floor((0,Y6.Z)(e.geoJson))/1e4;t===this.newFieldA.id?this.newFieldA={...this.newFieldA,fieldSize:i,fieldContour:{geoJson:e.geoJson,area:i}}:t===this.newFieldB.id&&(this.newFieldB={...this.newFieldB,fieldSize:i,fieldContour:{geoJson:e.geoJson,area:i}})},changeMarker({lat:e,lon:t,fieldId:i}){i===this.newFieldA.id?this.newFieldA={...this.newFieldA,lat:e,lon:t}:i===this.newFieldB.id&&(this.newFieldB={...this.newFieldB,lat:e,lon:t})},changeFieldName({fieldId:e,name:t}){e===this.newFieldA.id?this.newFieldA={...this.newFieldA,name:t}:e===this.newFieldB.id&&(this.newFieldB={...this.newFieldB,name:t})},getNameForField(e){return"string"===typeof e.name&&e.name.length>0?e.name:e.id===this.newFieldA.id?this.$t("Feld {number}",{number:1}):e.id===this.newFieldB.id?this.$t("Feld {number}",{number:2}):this.$t("Feld")},getFormattedSizeForField(e){let t=Number(e.fieldSize);return Number.isNaN(t)&&(t=0),Bl()(t).format()},getCropName(e){const{cropId:t}=e;return null==this.crops[t]?"":this.crops[t].name},split(){null!=this.newFieldA&&null!=this.newFieldB&&(this.currentStep=1,this.currentField=this.newFieldA.id)},updateFormFieldCollapsed(e,t){t?t&&this.currentField===e.id&&(this.currentField=null):this.currentField=e.id},cropValueForDropdown(e){return null==e.cropId||null==this.crops[e.cropId]?{id:null,name:""}:{id:e.cropId,name:this.crops[e.cropId].name}},back(){this.currentStep=0},async save(){if("string"!==typeof this.newFieldA.name||this.newFieldA.name.length<1||"string"!==typeof this.newFieldB.name||this.newFieldB.name.length<1)return void(this.missingName=!0);this.missingName=!1,this.userErrorMessage=null,this.fetching=!0;const e=ce(this.newFieldA,dd,cd);e.id=this.newFieldA.id,e.fieldContour=this.newFieldA.fieldContour,delete e.fieldContourId;const t=ce(this.newFieldB,dd,cd);t.id=this.newFieldB.id,t.fieldContour=this.newFieldB.fieldContour,delete t.fieldContourId;try{this.source=l().CancelToken.source();const{data:i}=await l().post("/admin/rest/field/split_field",{data:{fieldId:this.fieldId,measuresAction:this.measuresAction,newFields:[e,t]}},{cancelToken:this.source.token});if(null==i||"success"!==i.status)return this.setUserErrorMessageFromResponse(i),void(this.fetching=!1)}catch(i){return this.setUserErrorMessageFromResponse(i),void(this.fetching=!1)}await this.$store.dispatch("fields/refresh"),this.$emit("split",[this.newFieldA.id,this.newFieldB.id]),this.fetching=!1,this.currentStep=2},hide(){null!=this.source&&this.source.cancel(),this.$emit("change",!1)}}},Dee=_ee,Mee=(0,ew.Z)(Dee,Eee,Iee,!1,null,"aaf740e0",null),Pee=Mee.exports,Tee=function(){var e=this,t=e._self._c;return t("BPopover",{ref:"popover",attrs:{show:"",placement:"bottom","custom-class":"popover-field-status shadow",id:e.id,target:e.target}},[t("h3",{staticClass:"popover-field-status__title"},[e._v(" "+e._s(e.$t("Erntejahr-Status"))+" ")]),t("div",{staticClass:"popover-field-status__body"},[e.error?t("p",{staticClass:"popover-field-status__error"}
1,[e._v(" "+e._s(e.errorUserMessage)+" ")]):e._e(),e.error?e._e():t("FormFieldRadioGroup",{staticClass:"m-0",attrs:{variant:"no-label",stacked:""},on:{change:t=>e.save(t)},model:{value:e.status,callback:function(t){e.status=t},expression:"status"}},[t("FormRadio",{attrs:{variant:"bordered",value:"completed",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return["completed"===e.initialStatus?t("span",[e._v(e._s(e.$t("Abgeschlossen")))]):t("span",[e._v(" "+e._s(e.$t("Abschließen"))+" "),e.activeAndHasHarvestingMeasure?t("span",{staticClass:"text-danger"},[e._v(" ("+e._s(e.$t("empfohlen"))+") ")]):e._e()]),e._v("   "),t("FontAwesomeIcon",{staticClass:"popover-field-status__icon popover-field-status__icon--completed",attrs:{icon:"check-circle"}})]},proxy:!0},"completed"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Die Ernte für das Erntejahr {current} ist bereits abgeschlossen. Das Feld ist in einem zukünftigen Erntejahr "aktiv".',{current:e.current}))+" ")]},proxy:!0}:e.activeAndHasHarvestingMeasure?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Auf diesem Feld wurde bereits eine Erntemaßnahme für das Erntejahr {current} gebucht. Schließe das Erntejahr für das Feld jetzt ab, es wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',{current:e.current,next:e.next}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze das Feld auf "abgeschlossen", sobald die Ernte für das Erntejahr {current} beendet wurde. Das Feld wird automatisch im nächsten Erntejahr {next} angelegt und "aktiv" gesetzt.',{current:e.current,next:e.next}))+" ")]},proxy:!0}],null,!0)}),t("FormRadio",{attrs:{variant:"bordered",value:"active",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(e.$t("Aktiv"))+" "),t("FontAwesomeIcon",{staticClass:"popover-field-status__icon popover-field-status__icon--active",attrs:{icon:"dot-circle"}})]},proxy:!0},"active"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Das Feld wird derzeit im angezeigten Erntejahr {current} bewirtschaftet.",{current:e.current}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze das Feld "aktiv", wenn es ab sofort im angezeigten Erntejahr {current} bewirtschaftet werden soll. Vorangehende Erntejahre werden auf diesem Feld abgeschlossen.',{current:e.current}))+" ")]},proxy:!0}],null,!0)}),t("FormRadio",{attrs:{variant:"bordered",value:"planned",disabled:e.fetching},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(e.$t("Geplant"))+" "),t("FontAwesomeIcon",{staticClass:"popover-field-status__icon popover-field-status__icon--planned",attrs:{icon:"clock"}})]},proxy:!0},"planned"===e.initialStatus?{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Das Erntejahr {current} für dieses Feld befindet sich in Planung.",{current:e.current}))+" ")]},proxy:!0}:{key:"text",fn:function(){return[e._v(" "+e._s(e.$t('Setze das Feld auf "geplant", wenn das Erntejahr {current} auf diesem Feld noch nicht begonnen hat.',{current:e.current}))+" ")]},proxy:!0}],null,!0)})],1)],1)])},xee=[];ow.vI.add(uw.f8k,uw.SZw,uw._1v);const{bind:Bee,unbind:Oee}=v().directive;let $ee=0;var Ree={name:"PopoverFieldStatus",components:{FormFieldRadioGroup:_T,FormRadio:kT},props:{target:{type:HTMLElement,required:!0},field:{type:Object,required:!0},activeAndHasHarvestingMeasure:{type:Boolean,default:!1}},data(){return $ee+=1,{id:`popover-field-status--nr-${$ee}`,status:this.field.status,initialStatus:null,popover:null,error:!1,fetching:!1}},computed:{current(){return this.field.processOrder.name},next(){return Number(this.current)+1}},async mounted(){await this.$nextTick(),this.popover=document.querySelector(`#${this.id}`),null!=this.popover&&Bee(this.popover,{value:this.onClickOutside}),document.addEventListener("keydown",this.onKeyDown),this.initialStatus=this.field.status},beforeDestroy(){null!=this.popover&&Oee(this.popover),document.removeEventListener("keydown",this.onKeyDown)},methods:{onKeyDown(e){"Escape"===e.key&&this.$emit("close")},onClickOutside(){this.$emit("close")},async save(e){if(this.error)return void this.$emit("close");this.fetching=!0,await new Promise((e=>setTimeout(e,100)));const t=await this.$store.dispatch("fields/setStatus",{status:e,fieldIds:[this.field.id]});if("error"===t.status)return this.fetching=!1,this.error=!0,void(this.errorUserMessage=t.errorUserMessage.join("\n"));await this.$store.dispatch("auth/refreshUserCompanies"),this.fetching=!1,this.$emit("close")}}},Nee=Ree,zee=(0,ew.Z)(Nee,Tee,xee,!1,null,"3aaf1301",null),Lee=zee.exports,Vee=function(){var e=this,t=e._self._c;return t("TheSatellite",{attrs:{empty:e.empty,expanded:e.expanded,title:e.$t("Schlagblatt")},scopedSlots:e._u([e.expanded?{key:"header-title",fn:function(){return[t("h2",{staticClass:"d-inline-block mr-5"},["string"===typeof e.labelCurrentField&&e.labelCurrentField.length>0?t("span",{staticClass:"font-weight-normal",domProps:{innerHTML:e._s(e.$t("Schlagblatt für {fieldName}",{fieldName:`<strong>${e.labelCurrentField}</strong>`}))}}):t("span",{domProps:{innerHTML:e._s(e.$t("Schlagblatt"))}})])]},proxy:!0}:null,e.expanded?{key:"header-center",fn:function(){return[t("div",{staticClass:"position-relative satellite-field-detail__prev-next-navigation"},[t("ButtonLink",{staticClass:"satellite-field-detail__center-button satellite-field-detail__center-button--left",attrs:{color:"black",disabled:null==e.previousField},on:{click:function(t){return e.$emit("update:currentFieldId",e.previousField.id)}}},[e._v(" "+e._s(e.labelPreviousField)+" ")]),t("div",[t("ButtonBorderedIcon",{attrs:{icon:["far","chevron-left"],disabled:null==e.previousField},on:{click:function(t){return e.$emit("update:currentFieldId",e.previousField.id)}}}),t("ButtonBorderedIcon",{attrs:{icon:["far","chevron-right"],disabled:null==e.nextField},on:{click:function(t){return e.$emit("update:currentFieldId",e.nextField.id)}}}
1)],1),t("ButtonLink",{staticClass:"satellite-field-detail__center-button satellite-field-detail__center-button--right",attrs:{color:"black",disabled:null==e.nextField},on:{click:function(t){return e.$emit("update:currentFieldId",e.nextField.id)}}},[e._v(" "+e._s(e.labelNextField)+" ")])],1)]},proxy:!0}:null,e.expanded?{key:"header-buttons",fn:function(){return[t("div",{staticClass:"satellite-field-detail__page-actions"},[t("ButtonBorderedIcon",{attrs:{title:e.$t("Seite drucken"),icon:["far","print"]},on:{click:e.printPage}})],1)]},proxy:!0}:null,e.expanded?null:{key:"default",fn:function(){return[t("WidgetMap",{attrs:{visible:e.visible,expanded:e.expanded,"visible-fields":e.visibleFields,"selected-fields":e.selectedFields,crops:e.crops,varieties:e.varieties}}),1===e.selectedFields.length?t("WidgetCustomer",{attrs:{expanded:e.expanded,"selected-fields":e.selectedFields,customers:e.customers}}):e._e(),1===e.selectedFields.length?t("WidgetActivities",{attrs:{selectedFields:[e.selectedFields[0]],activityTypes:e.activityTypes,activities:e.activities,activitiesFetching:e.activitiesFetching,units:e.units,findProductStorageDropdownItem:e.findProductStorageDropdownItem}}):e._e(),1===e.selectedFields.length?t("WidgetCropRotation",{attrs:{expanded:e.expanded,"selected-field":e.selectedFields[0]}}):e._e(),1===e.selectedFields.length?t("WidgetNotes",{attrs:{expanded:e.expanded,selectedFields:[e.selectedFields[0]],notes:e.notes,notesFetching:e.notesFetching}}):e._e(),e.selectedFields.length>1?t("WidgetCropRatio",{attrs:{fields:e.selectedFields,"crops-by-id":e.crops,"varieties-by-id":e.varieties}}):e._e(),e.selectedFields.length>1?t("WidgetKPIs",{attrs:{"selected-fields":e.selectedFields,kindOfUseTypes:e.kindOfUseTypes}}):e._e(),e.selectedFields.length>1?t("WidgetReports"):e._e()]},proxy:!0},{key:"expanded-area",fn:function(){return[e.loading?t("div",{staticClass:"w-100 mb-5 bg-lightest",staticStyle:{height:"calc(40 * var(--vh, 1vh))"}}):e._e(),e.loading?t("div",{staticClass:"d-flex w-100",staticStyle:{height:"calc(40 * var(--vh, 1vh))"}},[t("div",{staticClass:"mr-5 flex-grow-1 bg-lightest"}),t("div",{staticClass:"flex-grow-1 bg-lightest"})]):e._e(),t("WidgetMap",{attrs:{visible:e.visible,expanded:e.expanded,"visible-fields":e.fieldsForExpandedMode,"selected-fields":null!=e.currentField?[e.currentField]:[],crops:e.crops,varieties:e.varieties}}),null!=e.currentField?t("WidgetActivities",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],activityTypes:e.activityTypes,activities:e.activities,activitiesFetching:e.activitiesFetching,units:e.units,findProductStorageDropdownItem:e.findProductStorageDropdownItem}}):e._e(),t("div",{staticClass:"satellite-field-detail__column-container"},[t("div",{staticClass:"satellite-field-detail__column"},[null!=e.currentField?t("WidgetCustomer",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],customers:e.customers}}):e._e(),null!=e.currentField?t("WidgetCropRotation",{attrs:{expanded:e.expanded,"selected-field":e.currentField}}):e._e(),null!=e.currentField?t("WidgetNotes",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],notes:e.notes,notesFetching:e.notesFetching}}):e._e()],1),t("div",{staticClass:"satellite-field-detail__column"},[null!=e.currentField?t("WidgetNutrientBalance",{attrs:{selectedFields:[e.currentField]}}):e._e(),null!=e.currentField?t("Widget",{staticClass:"widget-weather-info"},[t("WeatherInfo",{attrs:{variant:"widget",selectedField:e.currentField,navigationDate:e.navigationDate},on:{"update:navigationDate":t=>e.navigationDate=t}})],1):e._e()],1)]),null!=e.currentField?t("WidgetSoilSamples",{attrs:{"selected-field":e.currentField}}):e._e()]},proxy:!0},{key:"empty",fn:function(){return[t("div",{staticClass:"field-detail__message-empty"},[e._v(" "+e._s(e.$t("Keine Einträge vorhanden."))+" ")])]},proxy:!0}],null,!0)})},Uee=[],jee=function(){var e=this,t=e._self._c;return e.empty?t("div",{staticClass:"satellite satellite--empty border-dark",class:{"satellite--expanded":e.expanded}},[t("div",{staticClass:"satellite__grid"},[e._t("empty")],2)]):t("div",{staticClass:"satellite border-dark",class:{"satellite--expanded":e.expanded}},[t("div",{staticClass:"satellite__header"},[t("div",{staticClass:"satellite__header-title"},[e._t("header-title",(function(){return[t("h2",[e._v(e._s(e.title))])]}))],2),t("div",{staticClass:"satellite__header-center"},[e._t("header-center")],2),t("div",{staticClass:"satellite__header-buttons"},[e._t("header-buttons")],2)]),t("div",{staticClass:"satellite__grid"},[null!=e.$slots.default?t("div",{staticClass:"satellite__left"},[e._t("default")],2):e._e(),e.expanded?t("div",{staticClass:"satellite__right"},[e._t("expanded-area")],2):e._e()])])},Hee=[],Gee={name:"TheSatellite",mixins:[pw],props:{empty:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1},title:{type:String,default:null},expandButtonLabel:{type:String,default:null}},computed:{...(0,C.Se)({satellite:"satellite"}),visible(){return this.satellite.visible}},watch:{expanded(e,t){e&&!t?this.onExpanded():!e&&t&&this.onShrunk()},visible(e,t){e&&!t?this.onShown():!e&&t&&this.onHidden()}},mounted(){this.$store.commit("satellite/setAvailability",!0),this.$store.commit("satellite/setExpandability",{expandAvailable:!0,expandButtonLabel:this.expandButtonLabel}),this.onShown(),this.onExpanded()},beforeDestroy(){this.$store.commit("satellite/reset",!1),this.onHidden()},methods:{onShown(){this.satellite.visible&&(this.$root.$emit("the-satellite--shown",this.componentNamespace),this.hiddenEventTriggered=!1)},onExpanded(){this.satellite.visible&&this.expanded&&this.$root.$emit("the-satellite--expanded",this.componentNamespace)},onShrunk(){this.satellite.visible&&!this.expanded&&this.$root.$emit("the-satellite--shrunk",this.componentNamespace)},onHidden(){this.satellite.visible||this.hiddenEventTriggered||(this.$root.$emit("the-satellite--hidden",this.componentNamespace),this.hiddenEventTriggered=!0)}}},Wee=Gee,Zee=(0,ew.Z)(Wee,jee,Hee,!1,null,"1a405715",null),Kee=Zee.exports,qee=function(){var e=this,t=e._self._c;return t("div",{staticClass:"widget"},[e.title||e.subtitle||null!=e.$slots.title?t("header",{staticClass:"widget__header"},[e._t("title",(function(){return[e.title?t("h3",{staticClass:"widget__title",class:{"widget__title--with-subtitle":e.subtitle}}
1,[e._v(" "+e._s(e.title)+" ")]):e._e()]})),e.subtitle?t("p",{staticClass:"widget__subtitle"},[e._v("("+e._s(e.subtitle)+")")]):e._e(),null!=e.$slots["header-right"]?t("div",{staticClass:"widget__header-right"},[e._t("header-right")],2):e._e()],2):e._e(),e._t("default")],2)},Yee=[],Jee={props:{title:{type:String,default:null},subtitle:{type:String,default:null}}},Xee=Jee,Qee=(0,ew.Z)(Xee,qee,Yee,!1,null,"66944e48",null),ete=Qee.exports,tte=function(){var e=this,t=e._self._c;return t("BButton",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom.d500.viewport",modifiers:{hover:!0,bottom:!0,d500:!0,viewport:!0}}],staticClass:"button-bordered-icon",class:{"button-bordered-icon--has-next-sibling":e.hasNextSibling,active:e.active},attrs:{size:"sm",title:e.title},on:{click:e.onClick}},[t("FontAwesomeIcon",{attrs:{icon:e.icon}})],1)},ite=[],ate={name:"ButtonBorderedIcon",mixins:[pw],props:{icon:{type:[String,Array],default:null},title:{type:String,default:""},active:{type:Boolean,default:!1}},data(){return{hasNextSibling:!1}},mounted(){null!=this.$el.nextElementSibling&&(this.hasNextSibling=!0)},methods:{onClick(){this.$root.$emit("button--click",this.componentNamespace),this.$emit("click")}}},nte=ate,rte=(0,ew.Z)(nte,tte,ite,!1,null,"eeb4f8ca",null),ste=rte.exports,ote=function(){var e=this,t=e._self._c;return e.visible?t("div",{staticClass:"weather-info p-3",class:`weather-info--${e.variant}`},[t("div",{staticClass:"weather-info__tabs border-bottom border-medium"},[t("Tabs",{attrs:{tabs:e.chartTypes.slice(0,3),size:"widget"===e.variant?"lg":"md",fill:!0}}),t("BDropdown",{staticClass:"m-0 p-0",attrs:{size:"md",text:e.$t("Mehr"),variant:"outline"}},e._l(e.chartTypes.slice(3),(function(i){return t("BDropdownItem",{key:i.label,on:{click:()=>{e.rotateBy=i.rotateBy,i.onClick()}}},[e._v(e._s(i.label)+" ")])})),1)],1),e.showWeatherInfo?t("div",{staticClass:"weather-info__caption",class:{"weather-info__caption--blurred":!e.enabled}},[t("div",[t("span",[e._v(e._s(e.metricUnit))])]),t("div",["compact"===e.variant?t("div",{staticClass:"weather-info__fieldname"},[e._v(" "+e._s(e.$t("Wetter für:"))+" "+e._s(this.selectedField?.name)+" ")]):e._e(),e.aggregates.length>1?t("WeatherPeriodSwitch",{attrs:{periods:e.aggregates},model:{value:e.selectedAggregate,callback:function(t){e.selectedAggregate=t},expression:"selectedAggregate"}}):e._e()],1)]):e._e(),e.showWeatherInfo?t("div",{staticClass:"weather-info__chart",class:{"weather-info__chart--blurred":!e.enabled}},["Precipitation"===e.selectedChart?t("BarChart",{attrs:{chartData:e.chartData,showMean:"Monthly"===e.selectedAggregate||"Yearly"===e.selectedAggregate,maxY:e.barChartMaxY,axisData:e.axisData,missingDataMessage:e.$t("Keine Wetterdaten für den ausgewählten Zeitraum verfügbar.")},on:{prev:e.previousDate,restore:e.resetDate,next:e.nextDate}}):e._e(),["Temperature2m","HeatUnit","PrecipitationAccumulated","SoilTemperatureSurface","SoilMoistureSurface"].includes(e.selectedChart)?t("LineChart",{attrs:{chartData:e.chartData,minX:e.minX.unix(),maxX:e.maxX.unix(),minY:0,axisData:e.axisData,missingDataMessage:e.$t("Keine Satellitendaten für den ausgewählten Zeitraum verfügbar.")},on:{prev:e.previousDate,restore:e.resetDate,next:e.nextDate}}):e._e()],1):e._e(),e.enabled?e._e():t("FeatureNotAvailable",{staticClass:"mt-3",attrs:{"no-back-link":""}}),t("FormFieldSetBordered",{staticClass:"overflow-hidden",attrs:{headline:`${e.$t("Wetterdiagramm")} ${e.$t("Einstellungen")}`,labelLinkOpen:e.$t("Einstellungen anzeigen"),labelLinkClose:e.$t("Einstellungen verstecken")},scopedSlots:e._u([{key:"description",fn:function(){return[t("span",[e._v(e._s(e.$t("Startdatum"))+": "+e._s(e.format(e.accumulationDate)))]),e.isMainSeeding?t("span",[e._v(" ("+e._s(e.$t("Saatdatum"))+")")]):e._e(),e._v(" , "),t("span",[e._v(e._s(e.$t("Basistemperatur"))+": "+e._s(e.baseTemperature)+"°C ")]),8===e.baseTemperature?t("span",[e._v(" ("+e._s(e.$t("Mais"))+")")]):e._e()]},proxy:!0}],null,!1,3148687157)},[t("FormFieldDatepicker",{staticClass:"mb-2",attrs:{variant:"horizontal",placeholder:e.$t("Wert"),label:e.$t("Startdatum"),description:e.$t("Das Startdatum ist standardmäßig das Aussaatdatum der Maßnahme oder alternativ der Jahresbeginn. Es ist relevant für die Wärmesumme und die Niederschlagssumme.")},model:{value:e.accumulationDate,callback:function(t){e.accumulationDate=t},expression:"accumulationDate"}}),t("FormFieldInput",{staticClass:"mb-2",attrs:{variant:"horizontal",type:"number",placeholder:e.$t("Wert"),label:`${e.$t("Basistemperatur")} °C`,description:e.$t("Basistemperatur ist relevant für die Wärmesumme. Es wird angenommen, dass unter ihr kein Wachstum stattfindet."),required:"",lazy:!1,step:1,min:-10,max:50},model:{value:e.baseTemperature,callback:function(t){e.baseTemperature=t},expression:"baseTemperature"}})],1),e.showUnknownErrorMessage?t("div",{staticClass:"weather-info__message weather-info__message--error"},[t("p",[e._v(e._s(e.$t("Beim Laden der Wetterdaten ist ein Fehler aufgetreten.")))])]):e._e(
1),e.showEmptyWeatherDataMessage?t("div",{staticClass:"weather-info__message weather-info__message--error"},[t("p",[e._v(e._s(e.$t("Leider können für dieses Feld keine Wetterdaten geladen werden.")))])]):e._e(),e.showMissingGeoDataMessage?t("div",{staticClass:"weather-info__message weather-info__message--error"},[t("p",[e._v(e._s(e.$t("Für das ausgewählte Feld fehlen die Geo-Daten.")))])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"loading"},[t("FontAwesomeIcon",{staticClass:"text-primary",attrs:{icon:"circle-notch",spin:""}})],1)],1):e._e()},lte=[],dte=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"tabs",class:[`tabs--size-${e.size}`,{"tabs--fill":e.fill}]},e._l(e.tabs,(function(i,a){return t("div",{key:a,staticClass:"tabs__item"},["route"===i.type?t("RouterLink",{staticClass:"tab",class:e.inactiveClass,attrs:{to:i.route,"data-to":i.route.name,"exact-active-class":e.activeClass}},[e._v(" "+e._s(i.label)+" ")]):"button"===i.type?t("button",{staticClass:"tab",class:{[e.inactiveClass]:!i.active,[e.activeClass]:i.active},on:{click:function(e){return i.onClick(e)}}},[e._v(" "+e._s(i.label)+" ")]):"text"===i.type?t("div",{on:{click:function(e){return i.onClick(e)}}},[t("span",{staticClass:"tab",attrs:{id:`route-placeholder-${i.label}`}},[e._v(e._s(i.label))]),i.tooltip?t("BTooltip",{attrs:{delay:"250",target:`route-placeholder-${i.label}`}},[e._v(" "+e._s(i.tooltip)+" ")]):e._e()],1):e._e()],1)})),0)},cte=[],ute=(0,b.defineComponent)({props:{tabs:{type:Array,required:!0},fill:{type:Boolean,default:!1},size:{type:String,default:"md",validator:e=>["md","lg"].includes(e)}},data(){return{activeClass:"text-black tab--active",inactiveClass:"text-dark"}}}),pte=ute,hte=(0,ew.Z)(pte,dte,cte,!1,null,"64504ef6",null),mte=hte.exports,fte=function(){var e=this,t=e._self._c;return t("div",{staticClass:"barchart"},[0===e.chartData.length?t("p",{staticClass:"barchart__no-data"},[e._v(" "+e._s(e.missingDataMessageComputed)+" ")]):e._e(),t("svg",{staticClass:"barchart__data",attrs:{width:e.width,height:e.height}},[t("g",{style:{transform:`translate(${e.margin.left-7}px, ${e.margin.top}px)`}},e._l(e.lines,(function(i,a){return t("text",{key:`line-description-${a}`,attrs:{x:"0",y:i.description.y+3,"text-anchor":"end","font-size":"12"}},[e._v(" "+e._s(e._f("numbro")(i.description.value,{mantissa:1}))+" ")])})),0),t("g",{style:{transform:`translate(${e.margin.left}px, ${e.margin.top}px)`}},[e._l(e.lines,(function(e,i){return t("path",{key:`line-${i}`,staticClass:"barchart__horizontal-helper",class:{"barchart__horizontal-helper--zero":e.isZero},attrs:{d:e.data}})})),e._l(e.bars,(function(i,a){return t("g",{key:`bar-${a}`,style:{transform:`translate(${i.x}px, 0px)`}},[t("rect",{staticClass:"barchart__bar",attrs:{width:e.barWidth,height:i.height,rx:"1.5",y:i.y}})])})),e._l(e.means,(function(i,a){return t("g",{key:`mean-${a}`,style:{transform:`translate(${i.x}px, 0px)`}},[t("rect",{staticClass:"barchart__bar--mean",attrs:{width:e.barWidth,height:"3px",rx:"1.5",y:i.y}})])}))],2)]),e.tooltip?t("ChartTooltip",{attrs:{"chart-width":e.width,top:e.tooltip.top,left:e.tooltip.left,entries:e.tooltip.entries}}):e._e(),t("svg",{staticClass:"barchart__hover",attrs:{width:e.width,height:e.height}},[t("g",{style:{transform:`translate(${e.margin.left}px, ${e.margin.top}px)`}},e._l(e.tooltipBars,(function(i){return t("g",{key:i.key,style:{transform:`translate(${i.x}px, 0px)`}},[t("rect",{attrs:{width:e.barWidth+e.barSpacing,height:e.chartHeight,"data-index":i.index},on:{mouseover:e.mouseover,mouseout:e.mouseout}})])})),0)]),null!=e.width?t("ChartAxisBottom",e._g({attrs:{"chart-width":e.width,"navigation-width":e.margin.left,data:e.axisDataComputed}},this.$listeners)):e._e()],1)},gte=[],yte=i(98823),vte=i(12767),bte=i(25049),wte=function(){var e=this,t=e._self._c;return t("div",{staticClass:"chart-axis-bottom"},[t("div",{staticClass:"chart-axis-bottom__navigation d-flex align-items-center",style:{width:`${e.navigationWidth}px`}},[t("button",{staticClass:"border-0",on:{click:()=>this.$emit("prev")}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-left"}})],1),t("button",{staticClass:"border-0",on:{click:()=>this.$emit("restore")}},[t("FontAwesomeIcon",{attrs:{icon:"dot-circle"}})],1),t("button",{staticClass:"border-0",on:{click:()=>this.$emit("next")}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}})],1)]),t("div",{staticClass:"chart-axis-bottom__captions"},e._l(e.captions,(function(i,a){return t("span",{directives:[{name:"show",rawName:"v-show",value:i.visible,expression:"caption.visible"}],key:`caption-${a}`,staticClass:"chart-axis-bottom__caption",style:{left:i.style.left?`${i.style.left}px`:null,right:i.style.right?`${i.style.right}px`:null,transform:i.style.transform}},[e._v(" "+e._s(i.text)+" ")])})),0)])},Cte=[];ow.vI.add(uw.A35,uw._1v,uw._tD);var Fte={name:"ChartAxisBottom",props:{chartWidth:{type:Number,required:!0},navigationWidth:{type:Number,default:55},data:{type:Array,required:!0}},computed:{captions(){let e=null,t=0,i=!1,a=this.data.toSorted(((e,t)=>e.left<t.left?1:e.left>t.left?-1:0)).map(((a,n)=>{const r=a.caption,s={left:a.left};let o=s.left-3.5*r.length;a.left<3.5*r.length?(s.left=7,s.transform="translate(0, -50%)",o=s.left):this.navigationWidth+a.left+3.5*r.length>this.chartWidth&&(delete s.left,s.right=7,s.transform="translate(0, -50%)",o=this.chartWidth-this.navigationWidth-s.right-7*r.length);const l=o+7*r.length;return a.hovered?e=n:(o<t&&(i=!0),t=l),{text:r,style:s,highlight:a.highlight,start:o,end:l}}));return a=a.map(((t,n)=>{let r=!0;return i&&!t.highlight&&n!==e&&(r=!1),null!=e&&n!==e&&(t.start>a[e].start&&t.start<a[e].end||t.end>a[e].start&&t.end<a[e].end||t.start<=a[e].start&&t.end>=a[e].end)&&(r=!1),{...t,visible:r}})),a}}},Ate=Fte,kte=(0,ew.Z)(Ate,wte,Cte,!1,null,"774b6927",null),Ste=kte.exports,Ete=function(){var e=this,t=e._self._c;
1return t("div",{staticClass:"chart-tooltip",class:{"chart-tooltip--move-left-90":e.overflowPercent>.3,"chart-tooltip--move-left-80":e.overflowPercent>.2&&e.overflowPercent<=.3,"chart-tooltip--move-left-70":e.overflowPercent>.1&&e.overflowPercent<=.2,"chart-tooltip--move-left-60":e.overflowPercent>0&&e.overflowPercent<=.1},style:{top:`${e.top}px`,left:`${e.left}px`}},[e.showColors?t("div",{staticClass:"chart-tooltip__colors"},e._l(e.colors,(function(e,i){return t("span",{key:`color-${i}`},[t("span",{style:{background:e}})])})),0):e._e(),t("div",{staticClass:"chart-tooltip__descriptions"},e._l(e.descriptions,(function(i,a){return t("span",{key:`description-${a}`},[e._v(" "+e._s(i)+" ")])})),0),t("div",{staticClass:"chart-tooltip__values"},e._l(e.values,(function(i,a){return t("span",{key:`value-${a}`},[e._v(" "+e._s(i)+" ")])})),0)])},Ite=[],_te={name:"ChartTooltip",props:{chartWidth:{type:Number,required:!0},top:{type:Number,required:!0},left:{type:Number,required:!0},entries:{type:Array,required:!0}},computed:{overflowPercent(){let e=30;this.entries.length>1&&(e+=12);let t=0,i=0;this.entries.forEach((e=>{t=Math.max(t,e.description.length),i=Math.max(i,e.value.length)})),t=Math.min(7*t,150),i*=7,e+=t+i;const a=this.left+e/2-this.chartWidth;return a<0?0:a/e},showColors(){return this.entries.length>1},colors(){return this.entries.map((e=>e.color))},descriptions(){return this.entries.map((e=>e.description))},values(){return this.entries.map((e=>e.value))}}},Dte=_te,Mte=(0,ew.Z)(Dte,Ete,Ite,!1,null,"4a56436c",null),Pte=Mte.exports;ow.vI.add(lw.xiG);const Tte={top:50,right:0,bottom:30,left:57},xte=.7;var Bte={name:"BarChart",components:{ChartAxisBottom:Ste,ChartTooltip:Pte},props:{chartData:{type:Array,required:!0},showMean:{type:Boolean,default:!1},maxY:{type:Number,default:null},axisData:{type:Array,default:()=>[]},missingDataMessage:{type:String,default:null}},data(){return{margin:Tte,hoveredIndex:null,width:null,height:null,chartWidth:null,chartHeight:null}},computed:{barWidth(){return null==this.chartWidth||this.chartData.length<1?null:this.chartWidth*xte/this.chartData.length},barSpacing(){if(null==this.chartWidth||this.chartData.length<1)return null;const e=1-xte;return this.chartWidth*e/this.chartData.length},scaleX(){return null==this.chartWidth||this.chartData.length<1?null:(0,vte.Z)().domain([0,this.chartData.length-1]).range([0,this.chartWidth])},maxYComputed(){const e=(0,yte.Z)(this.chartData,(e=>Math.max(e.value,e.mean)));return null!=this.maxY&&this.maxY>e?this.maxY:1.05*e},scaleY(){return null==this.chartHeight||this.chartData.length<1?null:(0,vte.Z)().domain([0,this.maxYComputed]).range([this.chartHeight,0])},tickValues(){if(null==this.chartHeight||this.chartData.length<1)return null;let e=1,t=1;while(this.maxYComputed>e*t)switch(t){case 1:t=2.5;break;case 2.5:t=5;break;case 5:t=7.5;break;case 7.5:t=1,e*=10;break;default:break}const i=[];switch(t){case 1:e/=4;break;case 2.5:e/=2;break;case 5:break;case 7.5:e*=1.5;break;default:break}for(let a=0;e*a<this.maxYComputed;a+=1)i.push(e*a);return i},lines(){return null==this.width||this.chartData.length<1?null:this.tickValues.map((e=>{const t=(0,bte.Z)().x(((e,t)=>this.scaleX(t))).y((()=>this.scaleY(e)));return{data:t(this.chartData),description:{y:this.scaleY(e),value:e},isZero:0===e}}))},bars(){return null==this.width||this.chartData.length<1?null:this.chartData.map(((e,t)=>({x:.5*this.barSpacing+t*(this.barWidth+this.barSpacing),y:this.scaleY(e.value),height:this.chartHeight-this.scaleY(e.value)}))).filter((e=>!e.placeholder))},means(){return!this.showMean||null==this.width||this.chartData.length<1?null:this.chartData.map(((e,t)=>({x:.5*this.barSpacing+t*(this.barWidth+this.barSpacing),y:this.scaleY(e.mean)}))).filter((e=>!e.placeholder))},tooltipBars(){return null==this.width||this.chartData.length<=1?null:this.chartData.map(((e,t)=>({index:t,x:.5*this.barSpacing+t*(this.barWidth+this.barSpacing)}))).filter((e=>!e.placeholder))},axisDataComputed(){const e=e=>(this.width-this.barWidth)/this.axisData.length*e+1.5*this.barSpacing,t=this.axisData.map(((t,i)=>({caption:t.caption,left:e(i),highlight:t.highlight})));return null!=this.hoveredIndex&&t.push({caption:this.chartData[this.hoveredIndex].caption,left:(.5+this.hoveredIndex)*(this.barWidth+this.barSpacing),hovered:!0}),t},tooltip(){if(null==this.hoveredIndex||null==this.chartData[this.hoveredIndex])return null;const e=this.chartData[this.hoveredIndex],t=[{color:"#3797AE",description:this.$t("Aktuell:"),value:Bl()(e.value).format({mantissa:1})}];return this.showMean&&t.push({color:"#FF614C",description:this.$t("Durchschnitt:"),value:Bl()(e.mean).format({mantissa:1})}
1),{top:this.margin.top+this.scaleY(e.value)-15,left:this.margin.left+.5*this.barSpacing+this.hoveredIndex*(this.barWidth+this.barSpacing)+this.barWidth/2,entries:t}},missingDataMessageComputed(){return null!=this.missingDataMessage?this.missingDataMessage:this.$t("Keine Daten verfügbar.")}},mounted(){window.addEventListener("resize",this.recalculateSizes),this.$nextTick(this.recalculateSizes)},beforeDestroy(){window.removeEventListener("resize",this.recalculateSizes)},methods:{mouseover(e){this.hoveredIndex=Number(e.target.dataset.index)},mouseout(){this.hoveredIndex=null},recalculateSizes(){if(!this.$el||!(this.$el.offsetWidth>0))return this.width=null,this.height=null,this.chartWidth=null,void(this.chartHeight=null);this.width!==this.$el.offsetWidth&&(this.width=this.$el.offsetWidth,this.height=Math.min(350,Math.max(250,Math.floor(.4*this.width))),this.chartWidth=this.width-Tte.left-Tte.right,this.chartHeight=this.height-Tte.top-Tte.bottom)}}},Ote=Bte,$te=(0,ew.Z)(Ote,fte,gte,!1,null,"670680e4",null),Rte=$te.exports,Nte=function(){var e=this,t=e._self._c;return t("div",{staticClass:"linechart"},[0===e.chartDataValuesY.length?t("p",{staticClass:"linechart__no-data"},[e._v(" "+e._s(e.missingDataMessageComputed)+" ")]):e._e(),t("svg",{staticClass:"linechart__data",attrs:{width:e.width,height:e.height}},[t("g",{style:{transform:`translate(${e.margin.left-7}px, ${e.margin.top}px)`}},e._l(e.captionsY,(function(i,a){return t("text",{key:`caption-${a}`,attrs:{x:"0",y:i.y+3,"text-anchor":"end","font-size":"12"}},[e._v(" "+e._s(e._f("numbro")(i.value,{mantissa:1}))+" ")])})),0),t("g",{style:{transform:`translate(${e.margin.left-7}px, ${e.margin.top}px)`}},[e._l(e.lines,(function(e,i){return t("path",{key:`line-${i}`,class:{"linechart__horizontal-helper":e.isHorizontalHelper,"linechart__horizontal-helper--zero":e.isZero,linechart__line:!e.isHorizontalHelper,"linechart__line--mean":e.isMean,"linechart__line--forecast":e.isForecast,"linechart__line--mean-overall":e.isMeanOverall,"linechart__line--min-max":e.isMinMax,"linechart__line--mean--transparent":e.greyedOut},attrs:{d:e.data}})})),null!=e.selectedValueXComputed&&null!=e.scaleX?t("line",{staticClass:"linechart__vertical-helper",attrs:{x1:e.scaleX(e.selectedValueXComputed),y1:0,x2:e.scaleX(e.selectedValueXComputed),y2:e.chartHeight}}):e._e(),e._l(e.circles,(function(e,i){return t("circle",{key:`circle-${i}`,staticClass:"linechart__circle",class:{"linechart__circle--mean":e.isMean,"linechart__circle--forecast":e.isForecast,"linechart__circle--mean-overall":e.isMeanOverall,"linechart__circle--min-max":e.isMinMax},attrs:{cx:e.cx,cy:e.cy,r:e.r}})}))],2)]),e.tooltip?t("ChartTooltip",{attrs:{"chart-width":e.width,top:e.tooltip.top,left:e.tooltip.left,entries:e.tooltip.entries}}):e._e(),t("svg",{staticClass:"linechart__hover",attrs:{width:e.width,height:e.height}},[t("g",{style:{transform:`translate(${e.margin.left}px, ${e.margin.top}px)`}},e._l(e.tooltipBars,(function(i,a){return t("g",{key:`tooltipBar-${a}`,style:{transform:`translate(${i.left}px, 0px)`}},[t("rect",{attrs:{width:i.width,height:e.chartHeight,"data-value-x":i.valueX},on:{mouseover:e.mouseover,mouseout:e.mouseout}})])})),0)]),null!=e.width?t("ChartAxisBottom",e._g({attrs:{chartWidth:e.width,navigationWidth:e.margin.left,data:e.axisDataComputed}},this.$listeners)):e._e()],1)},zte=[],Lte=i(65165),Vte=i(37633);const Ute={top:50,right:0,bottom:30,left:57};var jte={name:"LineChart",components:{ChartAxisBottom:Ste,ChartTooltip:Pte},props:{chartData:{type:Array,required:!0},selectedValueX:{type:Number,default:null},minX:{type:Number,default:null},maxX:{type:Number,default:null},minY:{type:Number,default:null},maxY:{type:Number,default:null},axisData:{type:Array,default:()=>[]},missingDataMessage:{type:String,default:null},nDecimals:{type:Number,default:1}},data(){return{margin:Ute,hoveredValueX:null,width:null,height:null,chartWidth:null,chartHeight:null}},computed:{chartDataValuesX(){return this.chartData.flatMap((e=>e.dataPoints)).map((e=>e.x)).filter(hH).sort(((e,t)=>e>t?1:e<t?-1:0))},minXComputed(){return null!=this.minX?Math.min(this.minX,...this.chartDataValuesX):Math.min(...this.chartDataValuesX)},maxXComputed(){return null!=this.maxX?Math.max(this.maxX,...this.chartDataValuesX):Math.max(...this.chartDataValuesX)},scaleX(){return null==this.chartWidth||this.chartData.length<2?null:(0,vte.Z)().domain([this.minXComputed,this.maxXComputed]).range([10,this.chartWidth-10])},chartDataValuesY(){return this.chartData.reduce(((e,t)=>[...e,...t.dataPoints.reduce(((e,t)=>{const i=[];return["y","yMin","yMax"].forEach((e=>{"number"===typeof t[e]&&i.push(t[e])})),[...e,...i]}),[])]),[])},minYComputed(){const e=Math.min(...this.chartDataValuesY);if(null!=this.minY&&this.minY<e)return this.minY;const t=Math.max(...this.chartDataValuesY);return e-.05*(t-e)},maxYComputed(){const e=Math.max(...this.chartDataValuesY);if(null!=this.maxY&&this.maxY>e)return this.maxY;const t=Math.min(...this.chartDataValuesY);return e+.05*(e-t)}
1,scaleY(){return null==this.chartHeight?null:(0,vte.Z)().domain([this.minYComputed,this.maxYComputed]).range([this.chartHeight,0])},tickValues(){if(null==this.chartHeight||this.chartData.length<1)return null;let e=.1,t=1;const i=this.maxYComputed-this.minYComputed;while(i>e*t)switch(t){case 1:t=2.5;break;case 2.5:t=5;break;case 5:t=7.5;break;case 7.5:t=1,e*=10;break;default:break}const a=[];switch(t){case 1:e/=4;break;case 2.5:e/=2;break;case 5:break;case 7.5:e*=1.5;break;default:break}let n=Math.abs(this.minYComputed)/e;for(n=this.minYComputed<0?-1*Math.floor(n):Math.ceil(n);e*n<this.maxYComputed;n+=1)a.push(e*n);return a},captionsY(){return null==this.tickValues||null==this.scaleY?null:this.tickValues.map((e=>({y:this.scaleY(e),value:e})))},lines(){const e=[];if(null==this.tickValues||null==this.scaleY)return e;const t=(0,bte.Z)().x((e=>this.scaleX(e)));return this.tickValues.forEach((i=>{e.push({isHorizontalHelper:!0,isZero:0===i,data:t.y((()=>this.scaleY(i)))([this.minXComputed,this.maxXComputed])})})),this.chartData.forEach((t=>{let i=(0,bte.Z)().defined((e=>!e.placeholder)).x((e=>this.scaleX(e.x))).y((e=>this.scaleY(e.y))).curve(Lte.Z);t.isMinMax&&(i=(0,Vte.Z)().defined((e=>!e.placeholder)).x((e=>this.scaleX(e.x))).y0((e=>this.scaleY(e.yMin))).y1((e=>this.scaleY(e.yMax))).curve(Lte.Z)),e.push({isMean:t.isMean,isMeanOverall:t.isMeanOverall,isMinMax:t.isMinMax,data:i(t.dataPoints),isForecast:t.is
1Forecast,greyedOut:t.greyedOut})})),e},circles(){if(null==this.width||null==this.scaleX||null==this.scaleY)return null;const e=[];return this.chartData.forEach((t=>{t.dataPoints.forEach((i=>{i.placeholder||i.x!==this.selectedValueXComputed||(t.isMinMax?(e.push({isMean:t.isMean,isMinMax:t.isMinMax,isMeanOverall:t.isMeanOverall,cx:this.scaleX(i.x),cy:this.scaleY(i.yMin),r:3.5}),e.push({isMean:t.isMean,isMinMax:t.isMinMax,isMeanOverall:t.isMeanOverall,cx:this.scaleX(i.x),cy:this.scaleY(i.yMax),r:3.5})):e.push({isMean:t.isMean,isMinMax:t.isMinMax,isMeanOverall:t.isMeanOverall,isForecast:t.isForecast,cx:this.scaleX(i.x),cy:this.scaleY(i.y),r:3.5}))}))})),e},tooltipBars(){if(null==this.width)return null;const e=[];let t=this.minXComputed;return this.chartDataValuesX.forEach(((i,a)=>{const n=this.scaleX(t);let r=this.maxXComputed;null!=this.chartDataValuesX[a+1]&&(r=(i+this.chartDataValuesX[a+1])/2);const s=this.scaleX(r)-n;e.push({left:n,width:s,valueX:i}),t=r})),e},selectedValueXComputed(){return null!=this.hoveredValueX?this.hoveredValueX:null!=this.selectedValueX?this.selectedValueX:null},axisDataComputed(){const e=[];if(null==this.scaleX)return e;if(this.axisData.forEach((t=>{e.push({caption:t.caption,left:this.scaleX(t.x),highlight:t.highlight})})),null!=this.selectedValueXComputed){let t=null;this.chartData.some((e=>e.dataPoints.some((e=>e.x===this.selectedValueXComputed&&null!=e.caption&&(({caption:t}=e),!0))))),null!=t&&e.push({caption:t,left:this.scaleX(this.selectedValueXComputed),hovered:!0})}return e},tooltip(){if(null==this.selectedValueXComputed||null==this.scaleX||null==this.scaleY)return null;const e=[],t=[];return this.chartData.forEach((i=>{i.dataPoints.some((a=>a.x===this.selectedValueXComputed&&(i.isMinMax&&(t.push({color:"#D3EAEF",description:this.$t("Maximum:"),value:Bl()(a.yMax).format({mantissa:this.nDecimals}),sort:0}),t.push({color:"#D3EAEF",description:this.$t("Minimum:"),value:Bl()(a.yMin).format({mantissa:this.nDecimals}),sort:2})),i.isMean&&t.push({color:"#218299",description:i.name||this.$t("Aktuell:"),value:Bl()(a.y).format({mantissa:this.nDecimals}),sort:1}),i.isForecast&&t.push({color:"#218299",description:i.name||`${this.$t("Prognose")}:`,value:Bl()(a.y).format({mantissa:this.nDecimals}),sort:1}),i.isMeanOverall&&t.push({color:"#FF614C",description:this.$t("Durchschnitt:"),value:Bl()(a.y).format({mantissa:this.nDecimals}),sort:3}),["y","yMin","yMax"].forEach((t=>{"number"===typeof a[t]&&e.push(a[t])})),!0)))})),{top:this.margin.top+this.scaleY(Math.max(...e))-25,left:this.margin.left+this.scaleX(this.selectedValueXComputed)-7,entries:t.sort(((e,t)=>e.sort>t.sort?1:e.sort<t.sort?-1:Number(e.value)<Number(t.value)?1:-1))}},missingDataMessageComputed(){return null!=this.missingDataMessage?this.missingDataMessage:this.$t("Keine Daten verfügbar.")}},mounted(){window.addEventListener("resize",this.recalculateSizes),this.$nextTick(this.recalculateSizes)},beforeDestroy(){window.removeEventListener("resize",this.recalculateSizes)},methods:{mouseover(e){this.hoveredValueX=Number(e.target.dataset.valueX),this.$emit("mouseover",this.hoveredValueX)},mouseout(){this.hoveredValueX=null},recalculateSizes(){this.width=this.$el.offsetWidth,this.height=Math.min(350,Math.max(250,Math.floor(.4*this.width))),this.chartWidth=this.width-Ute.left-Ute.right,this.chartHeight=this.height-Ute.top-Ute.bottom}}},Hte=jte,Gte=(0,ew.Z)(Hte,Nte,zte,!1,null,"70fb370d",null),Wte=Gte.exports;var Zte={props:{navigationDate:{type:Date,default:()=>new Date}},data(){const e=new Date,t=parseInt(this.$store.state.auth.currentProcessOrderName,10);return t<e.getFullYear()&&e.setFullYear(t),{selectedAggregate:"Monthly",defaultDate:e,cropYear:t}},mounted(){this.resetDate()},emits:["update:navigationDate"],methods:{previousDate(){const e=g()(this.navigationDate).subtract(1,"years").toDate();this.$emit("update:navigationDate",e)},resetDate(){this.$emit("update:navigationDate",this.defaultDate)},nextDate(){const e=g()(this.navigationDate).add(1,"years").toDate();this.$emit("update:navigationDate",e)},axisLabel(e){const t=e.isSame(e.clone().startOf("year"),"day");switch(this.selectedAggregate){case"Daily":case"Monthly":return t?e.format("MMM YYYY"):e.format("MMM");case"Yearly":return e.format("YYYY");default:throw new Error(`Unsupported aggregate period ${this.selectedAggregate}`)}},caption(e){switch(this.selectedAggregate){case"Daily":return e.format("MMM Do");case"Monthly":return e.format("MMM");case"Yearly":return e.format("YYYY");default:throw new Error(`Unsupported aggregate period ${this.selectedAggregate}`)}},isHighlight(e){const t=e.isSame(e.clone().startOf("month"),"day");switch(this.selectedAggregate){case"Daily":case"Monthly":return e.month()%3===0&&t;case"Yearly":return!0;default:throw new Error(`Unsupported aggregate period ${this.selectedAggregate}`)}},toMoment(e){return g()(e,"YYYY-MM-DD")}}},Kte=function(){var e=this,t=e._self._c;
1return t("div",{staticClass:"weather-info__period"},[t("span",{staticClass:"text-dark"},[e._v(e._s(e.$t("Zeitraum:")))]),e._l(e.periods,(function(i,a){return t("button",{key:`period-${a}`,staticClass:"border-0",class:e.value===i.period?"text-secondary":"text-black",on:{click:function(t){return e.$emit("input",i.period)}}},[e._v(" "+e._s(i.label)+" ")])}))],2)},qte=[],Yte={name:"WeatherPeriodSwitch",props:{value:{type:String,default:"Daily"},periods:{type:Array,default:()=>[{period:"Daily",label:(void 0).$t("Tage")},{period:"Monthly",label:(void 0).$t("Monate")}]}},emits:["input"]},Jte=Yte,Xte=(0,ew.Z)(Jte,Kte,qte,!1,null,"82801892",null),Qte=Xte.exports;ow.vI.add(uw.IJ7);var eie={name:"WeatherInfo",mixins:[Zte],components:{FormFieldInput:fk,FormFieldDatepicker:g_,FormFieldSetBordered:Cee,WeatherPeriodSwitch:Qte,FeatureNotAvailable:Ew,BarChart:Rte,LineChart:Wte,Tabs:mte},props:{selectedField:{type:Object,required:!0},variant:{type:String,default:null,validator:e=>["compact","widget"].includes(e)},showWeatherInfo:{type:Boolean,default:!0}},mounted(){this.$store.dispatch("activities/subscribe"),this.$store.dispatch("activityTypes/subscribe")},data(){const e=Xl()((e=>(this.manualBaseTemperature=e,e)),500);return{selectedChart:"Precipitation",showUnknownErrorMessage:!1,showEmptyWeatherDataMessage:!1,showMissingGeoDataMessage:!1,manualAccumulationDate:null,manualBaseTemperature:null,debounceBaseTemp:e,rotateBy:0}},computed:{...(0,C.rn)("precisionFarming/monitoring/weather",{loading:"fetching"}),...(0,C.Se)("activities",["findAllByFieldIds"]),...(0,C.rn)("products/crops",{crops:"data"}),...(0,C.rn)("activityTypes",{activityTypes:"data"}),relevantActivities(){const e=this.$store.state.precisionFarming.monitoring.selectedFields;return this.findAllByFieldIds(e).filter((e=>this.activityTypes[e.activityTypeId]?.roughId===ie.SEED_MAIN)).sort(((e,t)=>e.timeStart>t.timeStart)).map((e=>({...e})))},isMainSeeding(){return void 0!==this.relevantActivities[0]},selectedCrop(){return{...this.crops[this.selectedField?.cropId??""]}},baseTemperature:{set(e){this.debounceBaseTemp(e)},get(){return this.manualBaseTemperature?this.manualBaseTemperature:this.selectedCrop?.temperatureBase??5}},accumulationDate:{set(e){this.manualAccumulationDate=e},get(){return this.manualAccumulationDate?this.manualAccumulationDate:this.isMainSeeding?g().unix(this.relevantActivities[0]?.timeStart).toDate():g()(this.cropYear,"YYYY").toDate()}},visible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_WEATHER_INFO)},enabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_WEATHER_INFO)},aggregates(){const e=[{period:"Daily",label:this.$t("Tage")}];return"Temperature2m"===this.selectedChart&&e.push({period:"Monthly",label:this.$t("Monate")}),"Precipitation"===this.selectedChart&&e.push({period:"Monthly",label:this.$t("Monate")},{period:"Yearly",label:this.$t("Jahre")}),e},minX(){switch(this.selectedAggregate){case"Daily":case"Monthly":return g()(this.navigationDate).startOf("year");case"Yearly":return g()(this.navigationDate).subtract(5,"years").startOf("year");default:throw new Error(`Unsupported aggregate period ${this.selectedAggregate}`)}},maxX(){switch(this.selectedAggregate){case"Daily":case"Monthly":return this.minX.clone().endOf("year");case"Yearly":return g()(this.navigationDate).endOf("year");default:throw new Error(`Unsupported aggregate period ${this.selectedAggregate}`)}},chartData(){const e={isMinMax:!0,dataPoints:[]},t={isMean:!0,dataPoints:[]},i={isMeanOverall:!0,dataPoints:[]},a={isForecast:!0,dataPoints:[]},[n,r,s]=this.inferWeatherVariables(this.selectedChart);switch(this.selectedChart){case"Precipitation":return MK()(this.weatherInfoMean?.data?.time,this.weatherInfoActual?.data?.precipitation,this.weatherInfoMean?.data?.precipitation).map((([e,t,i])=>[this.toMoment(e),t??0,i??0])).map((([e,t,i])=>({value:t,mean:i,caption:this.caption(e),placeholder:0===t})));case"Temperature2m":case"PrecipitationAccumulated":case"HeatUnit":case"SoilMoistureSurface":case"SoilTemperatureSurface":return e.dataPoints=MK()(this.weatherInfoMean?.data?.time,this.weatherInfoActual?.data?.[n],this.weatherInfoActual?.data?.[s]).map((([e,t,i])=>[this.toMoment(e),t??0,i??0])).map((([e,t,i])=>({x:e.unix(),yMin:t,yMax:i,caption:this.caption(e),placeholder:0===t||0===i}))),t.dataPoints=MK()(this.weatherInfoMean?.data?.time,this.weatherInfoActual?.data?.[r]).map((([e,t])=>[this.toMoment(e),t??0])).filter((([e])=>e.isSameOrBefore(g()(),"day"))).map((([e,t])=>({x:e.unix(),y:t,caption:this.caption(e),placeholder:0===t}))),a.dataPoints=MK()(this.weatherInfoMean?.data?.time,this.weatherInfoActual?.data?.[r]).map((([e,t])=>[this.toMoment(e),t??0])).filter((([e])=>e.isAfter(g()(),"day"))).map((([e,t])=>({x:e.unix(),y:t,caption:this.caption(e),placeholder:0===t}))),i.dataPoints=MK()(this.weatherInfoMean?.data?.time,this.weatherInfoMean?.data?.[r]).map((([e,t])=>[this.toMoment(e),t??0])).map((([e,t])=>({x:e.unix(),y:t,caption:this.caption(e),placeholder:0===t}))),[e,i,t,a];default:throw new Error(`Unsupported weather info chart: ${this.selectedChart}`)}},axisData(){const e=this.unitOfAxis(),t=[];for(const i=this.minX.clone();i.isSameOrBefore(this.maxX);i.add(1,e)){const e=this.isHighlight(i);e&&t.push({x:i.unix(),caption:this.axisLabel(i),highlight:e})}return t},barChartMaxY(){return Math.max(...this.weatherInfoMean?.data?.precipitation??[])}
1,requestParamsActual(){const e=g()().add(13,"days");return{aggregate:this.selectedAggregate,startDate:this.minX.format("YYYY-MM-DD"),endDate:this.maxX.isAfter(e)?e.format("YYYY-MM-DD"):this.maxX.format("YYYY-MM-DD"),longitude:this.selectedField.lon,latitude:this.selectedField.lat,statistics:"No",variables:"Temperature2m"===this.selectedChart?["Temperature2mMin",this.selectedChart,"Temperature2mMax"]:[this.selectedChart],tempBaseCrop:this.baseTemperature,dateAccumulate:g()(this.accumulationDate).format("YYYY-MM-DD")}},requestParamsMean(){return{aggregate:this.selectedAggregate,startDate:this.minX.format("YYYY-MM-DD"),endDate:this.maxX.format("YYYY-MM-DD"),longitude:this.selectedField.lon,latitude:this.selectedField.lat,statistics:"MeanY5",variables:[this.selectedChart],tempBaseCrop:this.baseTemperature,dateAccumulate:g()(this.accumulationDate).format("YYYY-MM-DD")}},weatherInfoActual(){const e=Vg(this.requestParamsActual);return this.$store.state.precisionFarming.monitoring.weather.data[e]},weatherInfoMean(){const e=Vg(this.requestParamsMean);return this.$store.state.precisionFarming.monitoring.weather.data[e]},metricUnit(){const[,e]=this.inferWeatherVariables(this.selectedChart);return this.weatherInfoActual?.units?.[e]??""},chartTypes(){const e=[{type:"button",onClick:()=>{this.selectedChart="Precipitation"},label:this.$t("Niederschlag"),active:"Precipitation"===this.selectedChart,rotateBy:0},{type:"button",onClick:()=>{"Yearly"===this.selectedAggregate&&(this.selectedAggregate="Monthly"),this.selectedChart="Temperature2m"},label:this.$t("Temperatur"),active:"Temperature2m"===this.selectedChart,rotateBy:1},{type:"button",onClick:()=>{this.selectedAggregate="Daily",this.selectedChart="PrecipitationAccumulated"},label:this.$t("Kumulierter Niederschlag"),active:"PrecipitationAccumulated"===this.selectedChart,rotateBy:2},{type:"button",onClick:()=>{this.selectedAggregate="Daily",this.selectedChart="HeatUnit"},label:this.$t("Wärmesumme"),active:"HeatUnit"===this.selectedChart,rotateBy:3},{type:"button",onClick:()=>{this.selectedAggregate="Daily",this.selectedChart="SoilTemperatureSurface"},label:this.$t("Bodentemperatur"),active:"SoilTemperatureSurface"===this.selectedChart,rotateBy:4},{type:"button",onClick:()=>{this.selectedAggregate="Daily",this.selectedChart="SoilMoistureSurface"},label:this.$t("Bodenfeuchtigkeit"),active:"SoilMoistureSurface"===this.selectedChart,rotateBy:5}];return this.rotateArrayBy(e,this.rotateBy)}},methods:{format(e){return g()(e).format("DD.MM.YYYY")},rotateArrayBy(e,t){const i=[...e];for(let a=0;a<t;a+=1)i.push(i.shift());return i},unitOfAxis(){switch(this.selectedAggregate){case"Daily":case"Monthly":return"days";case"Yearly":return"years";default:throw new Error(`Unsupported weather aggregate: ${this.selectedAggregate}`)}},inferWeatherVariables(e){const t=e.at(0),i=e.slice(1);return[`${t.toLowerCase()}${i}Min`,`${t.toLowerCase()}${i}`,`${t.toLowerCase()}${i}Max`]}},watch:{requestParamsActual(e){this.$store.dispatch("precisionFarming/monitoring/weather/aggregate",e)},requestParamsMean(e){this.$store.dispatch("precisionFarming/monitoring/weather/aggregate",e)}}},tie=eie,iie=(0,ew.Z)(tie,ote,lte,!1,null,"07aa4e28",null),aie=iie.exports,nie=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Widget",{attrs:{title:e.$t("Maßnahmen"),subtitle:e.subtitle},scopedSlots:e._u([e.expanded?{key:"header-right",fn:function(){return[t("ButtonBorderedIconOptions",{staticClass:"widget-activities__mode-toggle",attrs:{options:e.modes},model:{value:e.mode,callback:function(t){e.mode=t},expression:"mode"}})]},proxy:!0}:null,{key:"default",fn:function(){return[e.expanded?t("Table",{attrs:{fixed:"",grouped:"grouped"===e.mode,fields:e.tableFields,items:"grouped"===e.mode?e.tableItemsGrouped:e.tableItems,busy:e.activitiesFetching},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s(e.$t("Noch keine Maßnahmen vorhanden."))+" ")]},proxy:!0},{key:"cell(products)",fn:function(i){return[t("Table",{staticClass:"m-0",attrs:{fixed:"",headerless:"",borderless:"","reduced-row-spacing":"",fields:e.tableProductsFields,items:i.item.products},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s(e.$t(""))+" ")]},proxy:!0}
1,{key:"cell()",fn:function({value:i}){return[t("span",{attrs:{title:i}},[e._v(e._s(i))])]}}],null,!0)})]}},{key:"cell(userComment)",fn:function(i){return["string"===typeof i.item.userComment&&i.item.userComment.length>0?t("ButtonLink",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.left",value:{title:i.item.userComment},expression:"{ title: data.item.userComment }",modifiers:{hover:!0,left:!0}}],staticClass:"widget-activities__user-comment",attrs:{color:"black"}},[e._v(" "+e._s(i.item.userComment)+" ")]):e._e()]}}],null,!1,2722160852)}):t("Table",{attrs:{fixed:"",headerless:"",fields:e.tableFieldsCondensed,items:e.tableItems,busy:e.activitiesFetching},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s(e.$t("Noch keine Maßnahmen vorhanden."))+" ")]},proxy:!0},{key:"cell(products)",fn:function(i){return[t("Table",{staticClass:"m-0",attrs:{fixed:"",headerless:"",borderless:"","reduced-row-spacing":"",fields:e.tableProductsFieldsCondensed,items:i.item.products},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s("")+" ")]},proxy:!0},{key:"cell()",fn:function({value:i}){return[t("span",{attrs:{title:i}},[e._v(e._s(i))])]}}],null,!0)})]}},{key:"cell()",fn:function({value:i}){return[t("span",{attrs:{title:i}},[e._v(e._s(i))])]}}])})]},proxy:!0}],null,!0)})},rie=[],sie=function(){var e=this,t=e._self._c;return e.grouped?t("div",[t("BTable",{staticClass:"mb-1",class:[{"table--headerless":e.headerless,"table--transparent":e.transparent,"table--reduced-row-spacing":e.reducedRowSpacing},`table--size-${e.size}`],attrs:{fields:e.fields,fixed:e.fixed,busy:e.$store.state.activities.fetching,"show-empty":0===e.items.length,borderless:e.borderless},scopedSlots:e._u([{key:"table-colgroup",fn:function({fields:i}){return e._l(i,(function(e){return t("col",{key:e.key,style:{width:null!=e.width?e.width:"auto",maxWidth:null!=e.maxWidth?e.maxWidth:"none",minWidth:null!=e.minWidth?e.minWidth:"0"}})}))}},{key:"table-busy",fn:function(){return[t("div",{staticClass:"text-center my-2"},[t("FontAwesomeIcon",{attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1)]},proxy:!0},{key:"empty",fn:function(){return[e._t("empty",(function(){return[e._v(" "+e._s(e.$t("Noch keine Einträge vorhanden."))+" ")]}))]},proxy:!0}],null,!0)}),e._l(e.items,(function(i){return t("BTable",{key:i.key,staticClass:"table--grouped mb-1",class:[{"table--headerless":e.headerless,"table--transparent":e.transparent,"table--reduced-row-spacing":e.reducedRowSpacing},`table--size-${e.size}`],attrs:{fields:e.fields,items:i.items,fixed:e.fixed},scopedSlots:e._u([{key:"table-colgroup",fn:function({fields:i}){return e._l(i,(function(e){return t("col",{key:e.key,style:{width:null!=e.width?e.width:"auto",maxWidth:null!=e.maxWidth?e.maxWidth:"none",minWidth:null!=e.minWidth?e.minWidth:"0"}})}))}},{key:`head(${e.fields[0].key})`,fn:function(){return[e._v(" "+e._s(i.label)+" ")]},proxy:!0},{key:"head()",fn:function(i){return[t("span",[e._v(" ")])]}},e._l(e.fieldSlots,(function(t){return{key:`cell(${t.key})`,fn:function(i){return[e._t(`cell(${t.key})`,null,{item:i.item,field:i.field,value:i.value})]}}}
1)),null!=e.$scopedSlots["cell()"]?{key:"cell()",fn:function(t){return[e._t("cell()",null,{item:t.item,field:t.field,value:t.value})]}}:null],null,!0)})}))],2):t("BTable",{class:[{"table--headerless":e.headerless,"table--transparent":e.transparent,"table--reduced-row-spacing":e.reducedRowSpacing},`table--size-${e.size}`],attrs:{"show-empty":"",fields:e.fields,items:e.items,fixed:e.fixed,busy:e.busy,borderless:e.borderless},scopedSlots:e._u([{key:"table-colgroup",fn:function({fields:i}){return e._l(i,(function(e){return t("col",{key:e.key,style:{width:null!=e.width?e.width:"auto",maxWidth:null!=e.maxWidth?e.maxWidth:"none",minWidth:null!=e.minWidth?e.minWidth:"0"}})}))}},e._l(e.headerSlots,(function(t){return{key:`head(${t.key})`,fn:function(i){return[e._t(`head(${t.key})`,null,{label:i.label,column:i.column,field:i.field})]}}})),e._l(e.fieldSlots,(function(t){return{key:`cell(${t.key})`,fn:function(i){return[e._t(`cell(${t.key})`,null,{item:i.item,field:i.field,value:i.value})]}}})),null!=e.$scopedSlots["cell()"]?{key:"cell(
1)",fn:function(t){return[e._t("cell()",null,{item:t.item,field:t.field,value:t.value})]}}:null,{key:"table-busy",fn:function(){return[t("div",{staticClass:"text-center my-2"},[t("FontAwesomeIcon",{attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1)]},proxy:!0},{key:"empty",fn:function(){return[e._t("empty",(function(){return[e._v(" "+e._s(e.$t("Noch keine Einträge vorhanden."))+" ")]}))]},proxy:!0}],null,!0)})},oie=[];ow.vI.add(yF.AX7);var lie={name:"Table",props:{fields:{type:Array,required:!0},items:{type:Array,required:!0},fixed:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},grouped:{type:Boolean,default:!1},borderless:{type:Boolean,default:!1},headerless:{type:Boolean,default:!1},transparent:{type:Boolean,default:!1},reducedRowSpacing:{type:Boolean,default:!1},size:{type:String,default:"sm",validator:e=>["sm","md"].includes(e)}},computed:{headerSlots(){return this.fields.filter((e=>null!=this.$scopedSlots[`head(${e.key})`]))},fieldSlots(){return this.fields.filter((e=>null!=this.$scopedSlots[`cell(${e.key})`]))}}},die=lie,cie=(0,ew.Z)(die,sie,oie,!1,null,"361e1760",null),uie=cie.exports,pie=function(){var e=this,t=e._self._c;return t("div",[e._t("default",(function(){return e._l(e.options,(function(i){return t("ButtonBorderedIcon",{key:i.value,staticClass:"button-bordered-icon-options__option",attrs:{active:i.value===e.value,icon:i.icon,title:i.title},on:{click:function(t){return e.$emit("update",i.value)}}})}))}))],2)},hie=[],mie={name:"ButtonBorderedIconOptions",components:{ButtonBorderedIcon:ste},model:{prop:"value",event:"update"},props:{value:{type:String,default:null},options:{type:Array,required:!0}}},fie=mie,gie=(0,ew.Z)(fie,pie,hie,!1,null,"23e9dd3d",null),yie=gie.exports;ow.vI.add(lw.tU8,lw.B7S);var vie=(0,b.defineComponent)({name:"WidgetActivities",components:{ButtonBorderedIconOptions:yie,ButtonLink:Fw,Widget:ete,Table:uie},props:{expanded:{type:Boolean,default:!1},selectedFields:{type:Array,required:!0},subtitle:{type:String,required:!1},activities:{type:Object,default:()=>({})},activityTypes:{type:Object,default:()=>({})},units:{type:Object,default:()=>({})},activitiesFetching:{type:Boolean,default:!1},findProductStorageDropdownItem:{type:Function,required:!0}},data(){const e="loose",t=[{value:"loose",icon:["far","object-ungroup"],title:this.$t("Chronologisch")},{value:"grouped",icon:["far","object-group"],title:this.$t("Gruppiert")}],i=[{label:this.$t("Ernte"),roughIds:[ie.HARVEST]},{label:this.$t("Pflanzenschutz"),roughIds:[ie.PROTECT]},{label:this.$t("Düngung"),roughIds:[ie.FEMI,ie.FECO_SLURRY,ie.FECO_MANURE,ie.FECO_LOW_LOSS,ie.FECO]},{label:this.$t("Aussaat"),roughIds:[ie.SEED_MAIN,ie.SEED_CATCH_CROP]},{label:this.$t("Andere Tätigkeiten"),roughIds:null}];return{mode:e,modes:t,activityTypeGroups:i}},computed:{tableFields(){return[{key:"date",label:this.$t("Datum"),width:"85px"},{key:"activityTypeName",label:this.$t("Tätigkeit"),width:"15%",minWidth:"150px"},{key:"processedArea",label:this.$t("Bearbeitete Fläche"),width:"10%",tdClass:"text-right"},{key:"products",label:this.$t("Betriebsmittel"),width:"48%",minWidth:"320px",tdClass:"p-0"},{key:"userComment",label:this.$t("Bemerkung"),minWidth:"120px"}]},tableProductsFields(){return[{key:"name",width:"50%",tdClass:"text-truncate"},{key:"amountPerHa",width:"15%",maxWidth:"80px",tdClass:"pr-1 text-right text-nowrap"},{key:"unitNamePerHa",width:"10%",maxWidth:"80px",tdClass:"pl-1"},{key:"amountTotal",width:"15%",maxWidth:"80px",tdClass:"pr-1 text-right text-nowrap"},{key:"unitNameTotal",width:"10%",maxWidth:"80px",tdClass:"pl-1"}]},tableFieldsCondensed(){return[{key:"date",label:this.$t("Datum"),width:"85px",tdClass:"text-truncate"},{key:"activityTypeName",label:this.$t("Tätigkeit"),width:"110px",tdClass:"pr-1 text-truncate"},{key:"products",label:this.$t("Betriebsmittel"),tdClass:"p-0 text-truncate"}]},tableProductsFieldsCondensed(){return[{key:"name",tdClass:"pr-1 text-truncate"},{key:"amount",width:"65px",tdClass:"pr-1 text-right text-truncate"},{key:"unitName",width:"60px",tdClass:"pl-1 text-truncate"}]},tableItems(){return Object.values(this.activities).filter((e=>this.selectedFields.some((t=>e.fieldId===t.id)))).sort(((e,t)=>t.timeStart?e.timeStart?t.timeStart-e.timeStart:1:-1)).map((e=>{const t=this.activityTypes[e.activityTypeId];if(!t)return;const i=t.displayName;if(!i)return;let a=Bl()().format();"number"===typeof e.processedArea&&(a=Bl()(e.processedArea).format());const n=e.products.map((t=>{if(!t.unitId)return null;const i=this.units[t.unitId];if(!i)throw new Error(`Couldn't find unit: ${t.unitId}`);const{amountPerHa:a,unitNamePerHa:n,amountTotal:r,unitNameTotal:s}=this.resolveTotalAndPerHa({amount:t.amount??0,unit:i,area:e.processedArea??0});let o=0;"number"===typeof t.amount&&({amount:o}=t);const l=this.findProductStorageDropdownItem(t.productId,t.storagePlaceId);return l&&l.id?{id:l.id,name:l.name,amount:Bl()(o).format(),unitName:i.name,amountPerHa:Bl()(a).format(),unitNamePerHa:n,amountTotal:Bl()(r).format(),unitNameTotal:s}:null})).filter(ka);return{date:g()(1e3*(e.timeStart??0)).format("L"),activityType:t,activityTypeName:i,processedArea:`${a} ha`,products:n,userComment:e.userComment??""}})).filter(ka)},tableItemsGrouped(){const e=this.tableItems.reduce(((e,t)=>{if(null==t.activityType||null==t.activityType.roughId)return e;const i={...e};return null==i[t.activityType.roughId]&&(i[t.activityType.roughId]=[]),{...i,[t.activityType.roughId]:[...i[t.activityType.roughId],t]}}),{}),t=this.activityTypeGroups.reduce(((e,t)=>t.roughIds?[...e,...t.roughIds]:e),[]);return this.activityTypeGroups.map((i=>{let a=[];return Array.isArray(i.roughIds)?i.roughIds.forEach((t=>{null!=e[t]&&(a=[...a,...e[t]])})):Object.keys(e).forEach((i=>{t.includes(i)||(a=[...a,...e[i]])})),{...i,items:a}})).filter((e=>e.items.length>0))}},methods:{perHaToTotal({amount:e,unit:t,area:i}){let a=0,n="";const r=t.numeratorUnitId?this.units[t.numeratorUnitId]:null;return null!=r&&i>0&&(a=e*i,n=r.name),{amountTotal:a,unitNameTotal:n}},totalToPerHa({amount:e,unit:t,area:i}){let a=0,n="";const r=Object.values(this.units).find((e=>e.numeratorUnitId===t.id&&e.byUnitId===Q.HA));return null!=r&&i>0&&(a=e/i,n=r.name),{amountPerHa:a,unitNamePerHa:n}},resolveTotalAndPerHa({amount:e,unit:t,area:i}){let a=0,n="",r=0,s="";return t.byUnitId===Q.HA?(a=e,n=t.name,({amountTotal:r,unitNameTotal:s}=this.perHaToTotal({amount:e,unit:t,area:i}))):(r=e,s=t.name,({amountPerHa:a,unitNamePerHa:n}=this.totalToPerHa({amount:e,unit:t,area:i}))),{amountPerHa:a,unitNamePerHa:n,amountTotal:r,unitNameTotal:s}}}}),bie=vie,wie=(0,ew.Z)(bie,nie,rie,!1,null,"954ae6a4",null),Cie=wie.exports,Fie=function(){var e=this,t=e._self._c;return e.visible?t("Widget",{staticClass:"widget-crop-ratio",attrs:{title:e.$t("Kulturverhältnis")}},[e.enabled?t("div",{staticClass:"widget-crop-ratio__description"},[0===e.pieChartPaths.length?t("span",[e._v(" "+e._s(e.$t("Keine Kulturdaten vorhanden."))+" ")]):t("span")]):e._e(
1),e.pieChartPaths.length>0?t("div",{staticClass:"widget-crop-ratio__content",class:{"widget-crop-ratio__content--blurred":!e.enabled}},[t("svg",{staticClass:"widget-crop-ratio__pie",attrs:{width:e.width,height:e.height}},[t("g",{attrs:{transform:`translate(${e.width/2},${e.height/2})`}},[e._l(e.pieChartPaths,(function(i){return t("path",{key:i.cropId,class:{"widget-crop-ratio__pie--hovered":i.cropId===e.currentCropId},attrs:{d:i.d,fill:i.fill,stroke:"black","stroke-width":"0px",transform:`translate(${i.translateX}, ${i.translateY})`},on:{mouseover:()=>e.onmouseover(i)}})})),e._l(e.pieChartTexts,(function(i){return t("text",{key:`text--${i.cropId}`,staticClass:"widget-crop-ratio__pie-label",attrs:{transform:i.transform,fill:i.fill}},e._l(i.label,(function(i,a){return t("tspan",{key:i,attrs:{x:"0",dy:a>0?14:0}},[e._v(" "+e._s(i)+" ")])})),0)}))],2)]),null!=e.currentCropInfo?t("div",{staticClass:"widget-crop-ratio__crop-description"},[t("h2",[e._v(e._s(e.currentCropInfo.name))]),t("p",[e._v(" "+e._s(e.$t("{size} ha",{size:e.currentCropInfo.sizeFormatted}))),t("br"),e._v(" "+e._s(e.$t("{value} %",{value:e.currentCropInfo.percentageFormatted}))+" ")]),t("p",e._l(e.currentCropInfo.varieties,(function(i){return t("span",{key:i.varietyId},[e._v(" "+e._s(e.$t("{name}: {sizeFormatted} ha",i))),t("br")])})),0)]):e._e()]):e._e(),e.enabled?e._e():t("FeatureNotAvailable",{attrs:{"no-back-link":""}})],1):e._e()},Aie=[],kie=i(75508),Sie=i(14119),Eie=i(10233),Iie={name:"WidgetCropRatio",components:{Widget:ete,FeatureNotAvailable:Ew},props:{fields:{type:Array,default:()=>[]},cropsById:{type:Object,default:()=>({})},varietiesById:{type:Object,default:()=>({})}},data(){return{width:250,height:250,currentCropId:null}},computed:{enabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_CROP_RATIO)},visible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CROP_RATIO)},cropsData(){const e={};return this.fields.forEach((t=>{let{cropId:i}=t;const{fieldSize:a}=t;if(null==i)i="no-crop";else if(null==this.cropsById[i]||a<=0)return;null==e[i]&&(e[i]={area:0,varieties:{}}),e[i].area+=a;let{varietyId:n}=t;null==n&&(n="none"),null==e[i].varieties[n]&&(e[i].varieties[n]={area:0}),e[i].varieties[n].area+=a})),e},pieChartPaths(){const e=["#98abc5","#8a89a6","#7b6888","#6b486b","#a05d56"],t=(0,Sie.Z)().value((e=>e.value.area)),i=t((0,kie.qh)(this.cropsData).sort(((e,t)=>e.value.area-t.value.area)));return i.map(((t,i)=>{const a=t.data.key;let n=this.width/2-25,r=0,s=0;const o=t.endAngle-t.startAngle;if(a===this.currentCropId){const e=t.startAngle+o/2,i=Math.min(t.endAngle-t.startAngle,.75*Math.PI);r+=12*Math.sin(e)/i,s+=-12*Math.cos(e)/i;const a=(r**2+s**2)**.5;n+=10-a}const l=(0,Eie.Z)().innerRadius(0).outerRadius(n).startAngle(t.startAngle).endAngle(t.endAngle);let d=e[i%5];return"no-crop"===a?d="var(--medium)":null!=this.cropsById[a]&&"string"===typeof this.cropsById[a].mapPolygonColor&&this.cropsById[a].mapPolygonColor.length>0&&(d=this.cropsById[a].mapPolygonColor),{cropId:a,d:l(),fill:d,translateX:r,translateY:s,deltaAngle:o,centroid:l.centroid()}}))},pieChartTexts(){return this.pieChartPaths.filter((({deltaAngle:e})=>e>.3*Math.PI)).map((e=>{let t;"no-crop"===e.cropId?t=this.$t("Keine"):null!=this.cropsById[e.cropId]&&(t=this.cropsById[e.cropId].shortcut,e.deltaAngle>.5*Math.PI&&(t=this.cropsById[e.cropId].name)),t="string"!==typeof t?[]:t.length>12?[`${t.substr(0,8)}-`,`${t.substr(8,4)}...`]:t.length>10?[`${t.substr(0,8)}-`,t.substr(8,4)]:[t];let i="var(--black)";const a=Lm(e.fill);a[2]<50&&(i="var(--white)");const n=e.centroid[0]+e.translateX,r=e.centroid[1]+e.translateY;return{...e,transform:`translate(${n}, ${r})`,label:t,fill:i}}))},areaTotal(){return Object.values(this.cropsData).reduce(((e,t)=>e+t.area),0)},currentCropInfo(){const e=this.cropsById[this.currentCropId],t=this.cropsData[this.currentCropId];if(null==t)return null;let i=1;this.areaTotal>0&&(i=t.area/this.areaTotal);const a=Object.keys(t.varieties).map((e=>{let i=this.$t("Keine Sorte");return null!=this.varietiesById[e]&&({name:i}=this.varietiesById[e]),{varietyId:e,name:i,sizeFormatted:Bl()(t.varieties[e].area).format()}}));return{name:null!=e?e.name:this.$t("Keine Kultur gepflegt"),sizeFormatted:Bl()(t.area).format(),percentageFormatted:Bl()(100*i).format(),varieties:"no-crop"===this.currentCropId?null:a}}},watch:{pieChartPaths(){this.initCurrentCropId()}},mounted(){this.initCurrentCropId()},methods:{onmouseover(e){this.currentCropId=e.cropId}
1,initCurrentCropId(){0!==this.pieChartPaths.length&&(null!=this.currentCropId&&null!=this.cropsData[this.currentCropId]||(this.currentCropId=this.pieChartPaths[this.pieChartPaths.length-1].cropId))}}},_ie=Iie,Die=(0,ew.Z)(_ie,Fie,Aie,!1,null,"517fd30a",null),Mie=Die.exports,Pie=function(){var e=this,t=e._self._c;return e.cropRotationVisible?t("Widget",{scopedSlots:e._u([{key:"title",fn:function(){return[t("h3",{staticClass:"widget-crop-rotation__title"},[e._v(" "+e._s(e.$t("Fruchtfolge"))+" "),e.cropRotationEnabled&&e.reloading?t("FontAwesomeIcon",{staticClass:"widget-crop-rotation__title-icon",attrs:{icon:"circle-notch",spin:""}}):e._e()],1)]},proxy:!0},{key:"default",fn:function(){return[t("Table",{staticClass:"widget-crop-rotation__table",class:{"widget-crop-rotation__table--blurred":!e.cropRotationEnabled},attrs:{fixed:"",headerless:"",fields:e.tableFields,items:e.tableItems,busy:e.fetching},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s(e.$t("Noch keine Fruchtfolge vorhanden."))+" ")]},proxy:!0},{key:"cell(crops)",fn:function(i){return[t("Table",{staticClass:"m-0",attrs:{fixed:"",headerless:"",borderless:"",fields:e.tableCropsFields,items:i.item.crops},scopedSlots:e._u([{key:"empty",fn:function(){return[t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.d500",value:{title:`${i.item.fullFieldName} (${e.$t("Keine Kultur")})`},expression:"{\n                title: `${data.item.fullFieldName} (${$t('Keine Kultur')})`,\n              }",modifiers:{hover:!0,d500:!0}}]},[e._v(" "+e._s(e.$t("Keine Kultur"))+" ")]),t("FieldStatusIcon",{staticClass:"ml-2 float-right",attrs:{status:i.item.status}})]},proxy:!0},{key:"cell(name)",fn:function({item:i,value:a}){return[t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.d500",value:{title:`${i.fullFieldName} (${a})`},expression:"{\n                title: `${item.fullFieldName} (${value})`,\n              }",modifiers:{hover:!0,d500:!0}}]},[e._v(" "+e._s(a)+" ")]),t("FieldStatusIcon",{staticClass:"ml-2 float-right",attrs:{status:i.status}})]}}],null,!0)})]}}],null,!1,3015389500)}),e.cropRotationEnabled?e._e():t("FeatureNotAvailable",{attrs:{"add-link-to-shop":e.canPurchaseLicenses}})]},proxy:!0}],null,!1,89757906)}):e._e()},Tie=[],xie=function(){var e=this,t=e._self._c;return"completed"===e.status?t("FontAwesomeIcon",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:e.$t("Abgeschlossen"),expression:"$t('Abgeschlossen')",modifiers:{hover:!0}}],staticClass:"field-status-icon field-status-icon--completed",attrs:{icon:"check-circle"}}):"active"===e.status?t("FontAwesomeIcon",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:e.$t("Aktiv"),expression:"$t('Aktiv')",modifiers:{hover:!0}}],staticClass:"field-status-icon field-status-icon--active",attrs:{icon:"dot-circle"}}):"planned"===e.status?t("FontAwesomeIcon",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:e.$t("Geplant"),expression:"$t('Geplant')",modifiers:{hover:!0}}],attrs:{icon:"clock"}}):"calculating"===e.status?t("FontAwesomeIcon",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:e.$t("Berechnen ..."),expression:"$t('Berechnen ...')",modifiers:{hover:!0}}],attrs:{icon:["fad","spinner-third"]}}):e._e()},Bie=[];ow.vI.add(uw.f8k,uw._1v,uw.SZw,yF.AX7);var Oie={name:"FieldStatusIcon",props:{status:{type:String,default:null}}},$ie=Oie,Rie=(0,ew.Z)($ie,xie,Bie,!1,null,"aefaf00a",null),Nie=Rie.exports;ow.vI.add(uw.IJ7);var zie={name:"WidgetCropRotation",components:{FeatureNotAvailable:Ew,FieldStatusIcon:Nie,Widget:ete,Table:uie},props:{expanded:{type:Boolean,default:!1},selectedField:{type:Object,required:!0},subtitle:{type:String,default:null},isSharedField:{type:Boolean,default:!1}},data(){return{cropRotation:[],fetching:!1,reloading:!1,source:null}},created(){this.source=l().CancelToken.source(),this.setCropRotation(),this.reload=Xl()((()=>this.setCropRotation(!0)),300)},deactivated(){this.source.cancel()},computed:{cropRotationVisible(){return null!=this.companyId&&this.$store.getters.companyFeatureVisible(this.companyId,Hr.FEATURE_FIELD_DETAIL_CROP_ROTATION)},cropRotationEnabled(){return null!=this.companyId&&this.$store.getters.companyFeatureEnabled(this.companyId,Hr.FEATURE_FIELD_DETAIL_CROP_ROTATION)},canPurchaseLicenses(){return null!=this.companyId&&this.$store.getters.companyFeatureEnabled(this.companyId,Hr.CAN_PURCHASE_LICENSE)},tableFields(){return[{key:"year",width:"85px",tdClass:(e,t,i)=>{const a=[];return i.current&&a.push("widget-crop-rotation__td-current-year"),i.currentField&&a.push("widget-crop-rotation__td-current-field"),a}},{key:"crops",tdClass:(e,t,i)=>{const a=["p-0"];return i.current&&a.push("widget-crop-rotation__td-current-year"),a}}]},tableItems(){return this.cropRotation},tableCropsFields(){const e=[{key:"name",tdClass:(e,t,i)=>{const a=[];return i.noCrop&&a.push("font-italic"),i.currentField&&a.push("widget-crop-rotation__td-current-field"),a}}];
1return this.expanded&&this.showFieldNames&&e.push({key:"fieldSize",width:"40px",tdClass:(e,t,i)=>{const a=["pl-0","pr-0","text-right"];return i.currentField&&a.push("widget-crop-rotation__td-current-field"),a}},{key:"fieldSizeLabel",width:"30px",tdClass:(e,t,i)=>{const a=["pl-1","pr-0"];return i.currentField&&a.push("widget-crop-rotation__td-current-field"),a}}),e},fieldId(){return null==this.selectedField?null:this.selectedField.id},companyId(){return this.$store.state.auth.currentCompanies&&this.$store.state.auth.currentCompanies[0].id?this.$store.state.auth.currentCompanies[0].id:null},selectedFieldFullFieldName(){return null==this.selectedField?null:sA.data(this.selectedField)},showFieldNames(){return this.cropRotation.some((e=>e.fullFieldName!==this.selectedFieldFullFieldName))}},methods:{async setCropRotation(e=!1){if(null==this.fieldId||!this.cropRotationVisible)return this.reloading=!1,void(this.fetching=!1);if(!this.cropRotationEnabled)return this.cropRotation=JSON.parse('[{"year":"2022","fullFieldName":"HAUSACKER","status":"planned","fieldSize":"2,14","current":false,"currentField":false,"crops":[{"name":"Wintergerste","fullFieldName":"HAUSACKER","status":"planned","fieldSize":"2,14","current":false,"currentField":false,"fieldSizeLabel":"ha"}]},{"year":"2021","fullFieldName":"HAUSACKER","status":"active","fieldSize":"2,14","current":true,"currentField":true,"crops":[{"name":"Winterraps","fullFieldName":"HAUSACKER","status":"active","fieldSize":"2,14","current":true,"currentField":true,"fieldSizeLabel":"ha"}]},{"year":"2020","fullFieldName":"HAUSACKER","status":"completed","fieldSize":"2,14","current":false,"currentField":false,"crops":[{"name":"Wintertriticale","fullFieldName":"HAUSACKER","status":"completed","fieldSize":"2,14","current":false,"currentField":false,"fieldSizeLabel":"ha"}]},{"year":"2019","fullFieldName":"HAUSACKER","status":"completed","fieldSize":"2,14","current":false,"currentField":false,"crops":[{"name":"Silomais","fullFieldName":"HAUSACKER","status":"completed","fieldSize":"2,14","current":false,"currentField":false,"fieldSizeLabel":"ha"}]}]'),this.reloading=!1,void(this.fetching=!1);e?this.reloading=!0:(this.cropRotation=[],this.fetching=!0);const t=`?permissionMode=fieldSharing&fieldSharingCompanyId=${this.$store.state.auth.currentCompanies[0].id}`,i=await l()(`/admin/rest/field/crop_rotation_for_field/${this.fieldId}${this.isSharedField?t:""}`,{cancelToken:this.source.token}),a=i.data.data.reduce(((e,t)=>{if(null==t)return e;const i=t.processOrder.name;let a=0;if("number"===typeof t.fieldSize&&({fieldSize:a}=t),null==e[i]&&(e[i]={year:i,fullFieldName:sA.data(t),status:t.status,fieldSize:Bl()(a).format(),current:i===this.$store.state.auth.currentProcessOrderName,currentField:t.id===this.fieldId,crops:[]}),e[i].currentField=e[i].currentField||t.id===this.fieldId,null==t.crop||"string"!==typeof t.crop.name)return e;let{name:n}=t.crop;return null!=t.variety&&"string"===typeof t.variety.name&&(n=`${n} (${t.variety.name})`),e[i].crops.push({name:n,fullFieldName:sA.data(t),status:t.status,fieldSize:Bl()(a).format(),current:i===this.$store.state.auth.currentProcessOrderName,currentField:t.id===this.fieldId,fieldSizeLabel:this.$t("ha")}),e}),{});this.cropRotation=Object.values(a).map((e=>e.crops.length>0?e:{...e,crops:[{name:this.$t("Keine Kultur"),fullFieldName:e.fullFieldName,status:e.status,fieldSize:e.fieldSize,current:e.current,currentField:e.currentField,noCrop:!0,fieldSizeLabel:this.$t("ha")}]})).sort(((e,t)=>t.year-e.year)),this.fetching=!1,this.reloading=!1}},watch:{fieldId(){this.setCropRotation()},selectedField(){this.reloading=!0,this.reload()}}},Lie=zie,Vie=(0,ew.Z)(Lie,Pie,Tie,!1,null,"4a289c96",null),Uie=Vie.exports,jie=function(){var e=this,t=e._self._c;return e.customersVisible&&null!=e.customer?t("Widget",{attrs:{title:e.$t("Kunde"),subtitle:e.subtitle}},[e.customersEnabled?t("Table",{attrs:{fixed:"",headerless:"",fields:e.tableFields,items:e.tableItems,busy:e.fetching},scopedSlots:e._u([e.expanded?null:{key:"cell(value)",fn:function({value:i}){return[t("div",{staticClass:"widget-customer__values-collapsed"},[t("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.left",value:{title:i},expression:"{ title: value }",modifiers:{hover:!0,left:!0}}],attrs:{title:i}},[e._v(" "+e._s(i)+" ")])])]}}],null,!0)}):t("FeatureNotAvailable",{attrs:{"add-link-to-shop":e.canPurchaseLicenses}}
1)],1):e._e()},Hie=[],Gie={name:"WidgetCustomer",components:{FeatureNotAvailable:Ew,Table:uie,Widget:ete},props:{expanded:{type:Boolean,default:!1},selectedFields:{type:Array,required:!0},subtitle:{type:String,default:null},customers:{type:Object,default:()=>({})}},data(){return{fetching:!0,source:null,address:null}},computed:{customersVisible(){return null!=this.customer&&0!==this.companyIds.length&&this.companyIds.some((e=>this.$store.getters.companyFeatureVisible(e,Hr.FEATURE_CUSTOMERS)))},customersEnabled(){return 0!==this.companyIds.length&&this.companyIds.every((e=>this.$store.getters.companyFeatureEnabled(e,Hr.FEATURE_CUSTOMERS)))},canPurchaseLicenses(){return 0!==this.companyIds.length&&this.companyIds.every((e=>this.$store.getters.companyFeatureEnabled(e,Hr.CAN_PURCHASE_LICENSE)))},companyIds(){const e=new Set;return this.selectedFields.forEach((t=>{null!=t&&null!=t.processOrder&&e.add(t.processOrder.companyId)})),[...e]},customer(){const e=new Set;if(this.selectedFields.forEach((t=>{null!=t&&null!=t.fieldGroup&&e.add(t.fieldGroup.customerId)})),1!==e.size)return null;const[t]=[...e];return this.customers[t]},tableFields(){return[{key:"label",width:"140px"},{key:"value"}]},tableItems(){if(null==this.customer)return[];const e=[{label:this.$t("Kundennummer"),value:this.customer.customerNumber},{label:this.$t("Name"),value:this.customer.name}];return null!=this.address&&(null!=this.address.address&&e.push({label:this.$t("Straße"),value:this.address.address}),null!=this.address.postcode&&e.push({label:this.$t("PLZ"),value:this.address.postcode}),null!=this.address.city&&e.push({label:this.$t("Ort"),value:this.address.city})),null!=this.customer.tel&&e.push({label:this.$t("Telefonnummer"),value:this.customer.tel}),null!=this.customer.email&&e.push({label:this.$t("E-Mail-Adresse"),value:this.customer.email}),null!=this.customer.description&&e.push({label:this.$t("Beschreibung"),value:this.customer.description}),e}},watch:{selectedFields:{handler(){null!=this.source&&this.source.cancel(),this.fetching=!0,this.address=null,this.updateCustomer()},immediate:!0}},beforeDestroy(){null!=this.source&&this.source.cancel()},methods:{updateCustomer:Xl()((async function(){if(!this.customersVisible||!this.customersEnabled)return;if(this.fetching=!0,await this.$store.dispatch("customers/subscribe"),null==this.customer||!Array.isArray(this.customer.address)||0===this.customer.address.length)return void(this.fetching=!1);const[e]=this.customer.address.sort(((e,t)=>"billing"===e.type&&"billing"!==t.type?-1:"billing"===t.type&&"billing"!==e.type?1:t.tstamp-e.tstamp));try{this.source=l().CancelToken.source();const{data:t}=await l().get(`/admin/rest/address/${e.addressId}`,{cancelToken:this.source.token});"success"===t.status&&(this.address=t.data)}catch(t){l().isCancel(t)||console.error("WidgetCustomer: unable to fetch address for customer")}this.fetching=!1}),100)}},Wie=Gie,Zie=(0,ew.Z)(Wie,jie,Hie,!1,null,"60001044",null),Kie=Zie.exports,qie=function(){var e=this,t=e._self._c;return t("Widget",{attrs:{title:e.$t("Flächennutzung")}},[t("Table",{attrs:{fixed:"",headerless:"",fields:e.tableFields,items:e.tableItems}})],1)},Yie=[],Jie={name:"WidgetKPIs",components:{Widget:ete,Table:uie},props:{selectedFields:{type:Array,required:!1,default:()=>[]},kindOfUseTypes:{type:Array,default:()=>[]}},computed:{tableFields(){return[{key:"label",tdClass:(e,t,i)=>this.addBlurClass(i)},{key:"size",width:"80px",tdClass:(e,t,i)=>this.addBlurClass(i,["pl-1","pr-0","text-right"])},{key:"labelHa",width:"30px",tdClass:(e,t,i)=>this.addBlurClass(i,["pl-1","pr-0"])},{key:"percentage",width:"50px",tdClass:(e,t,i)=>this.addBlurClass(i,["pl-1","pr-0","text-right"])},{key:"labelPercentage",width:"30px",tdClass:(e,t,i)=>this.addBlurClass(i,["pl-1","pr-0"])}]},tableItems(){return[{label:this.$t("Gesamtfläche"),size:this.fieldSizeTotalFormatted,labelHa:this.$t("ha"),isTotal:!0},...this.usages.map((e=>({...e,label:e.title,labelHa:this.$t("ha"),labelPercentage:"%"})))]},fieldSizeTotal(){return this.selectedFields.reduce(((e,t)=>"number"!==typeof t.fieldSize?e:e+t.fieldSize),0)},fieldSizeTotalFormatted(){return Bl()(this.fieldSizeTotal).format()},usages(){const e={};return this.selectedFields.forEach((({fieldSize:t,kindofuse:i})=>
1{"number"!==typeof t||null==i||i<2||(null==e[i]&&(e[i]={key:i,title:this.kindOfUseById[i].name,size:0,percentage:100}),e[i].size+=t)})),Object.values(e).sort(((e,t)=>t.size-e.size)).map((e=>0===this.fieldSizeTotal?e:{...e,size:Bl()(e.size).format(),percentage:Bl()(100*e.size/this.fieldSizeTotal).format({mantissa:1})}))},kindOfUseById(){return this.kindOfUseTypes.reduce(((e,t)=>({...e,[t.id]:t})),{})},companyHasFreeLicense(){return this.$store.state.auth.currentCompanies.some((e=>e.licensePackageId===ae.FARMDOK_FREE))},companyHasNoLicense(){return this.$store.state.auth.currentCompanies.some((e=>e.licensePackageId===ae.NO_LICENSE))}},methods:{addBlurClass(e,t=[]){return e.isTotal||!this.companyHasFreeLicense&&!this.companyHasNoLicense?t:[...t,"table-cell--blurred"]}}},Xie=Jie,Qie=(0,ew.Z)(Xie,qie,Yie,!1,null,"6f99dc8c",null),eae=Qie.exports,tae=function(){var e=this,t=e._self._c;return t("Widget",{staticClass:"widget-map"},[t("div",{staticClass:"widget-map__map",class:{"widget-map__map--expanded":e.expanded}},[e.visible&&e.initialized?t("FieldsMap",{attrs:{"disable-map-controls":"","re-center-on-field-update":"",controls:["zoom"],companies:e.companies,disabledFields:e.disabledFields,activeFields:e.activeFields,selectionSource:"TABLE"}}):e._e()],1),e.expanded?t("div",{staticClass:"widget-map__field-info"},[null!=e.fieldInfo?t("h2",{staticClass:"h1 mb-4"},[e._v(e._s(e.fieldInfo.name)+" ("+e._s(e.fieldInfo.processOrderName)+")")]):e._e(),null!=e.fieldInfo?t("div",{staticClass:"widget-map__field-info-grid"},[t("span",{staticClass:"widget-map__field-info-grid-item--1"},[e._v(e._s(e.$t("Feldstück Nummer:")))]),t("span",{staticClass:"widget-map__field-info-grid-item--2"},[e._v(e._s(e.fieldInfo.mfa))]),t("span",{staticClass:"widget-map__field-info-grid-item--1"},[e._v(e._s(e.$t("Feld Nummer:")))]),t("span",{staticClass:"widget-map__field-info-grid-item--2"},[e._v(e._s(e.fieldInfo.number))]),t("span",{staticClass:"widget-map__field-info-grid-item--1"},[e._v(e._s(e.$t("Größe (in ha):")))]),t("span",{staticClass:"widget-map__field-info-grid-item--2"},[e._v(e._s(e._f("numbro")(e.fieldInfo.size)))]),t("span",{staticClass:"widget-map__field-info-grid-item--3"},[e._v(e._s(e.$t("Kultur:")))]),t("span",{staticClass:"widget-map__field-info-grid-item--4"},[e._v(e._s(e.fieldInfo.crop))]),t("span",{staticClass:"widget-map__field-info-grid-item--3"},[e._v(e._s(e.$t("Sorte:")))]),t("span",{staticClass:"widget-map__field-info-grid-item--4"},[e._v(e._s(e.fieldInfo.variety))])]):e._e()]):e._e()])},iae=[],aae={name:"WidgetMap",components:{Widget:ete,FieldsMap:b7},props:{visible:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1},visibleFields:{type:Array,required:!1,default:()=>[]},selectedFields:{type:Array,required:!1,default:()=>[]},crops:{type:Object,default:()=>({})},varieties:{type:Object,default:()=>({})}},data(){return{initialized:!1}},computed:{companies(){return this.$store.state.auth.currentCompanies},disabledFields(){const e=this.selectedFields.map((e=>e.id));return this.visibleFields.reduce(((t,i)=>e.includes(i.id)?t:{...t,[i.id]:i}),{})},activeFields(){return this.selectedFields.reduce(((e,t)=>({...e,[t.id]:t})),{})},fieldInfo(){if(1!==this.selectedFields.length)return null;const[e]=this.selectedFields;let t=this.$t("Nicht gepflegt");null!=e.cropId&&null!=this.crops[e.cropId]&&(t=this.crops[e.cropId].name);let i=this.$t("Nicht gepflegt");return null!=e.varietyId&&null!=this.varieties[e.varietyId]&&(i=this.varieties[e.varietyId].name),{name:e.name,mfa:Ru(e,"fieldGroup.mfa"),number:e.fieldNumber,size:e.fieldSize,crop:t,variety:i,processOrderName:e.processOrder.name}}},async created(){this.initialized=!0}},nae=aae,rae=(0,ew.Z)(nae,tae,iae,!1,null,"162fae44",null),sae=rae.exports,oae=function(){var e=this,t=e._self._c;return e.notesVisible?t("Widget",{attrs:{title:e.$t("Notizen"),subtitle:e.subtitle}},[e.notesEnabled?t("Table",{attrs:{fixed:"",headerless:"",fields:e.tableFields,items:e.tableItems,busy:e.notesFetching},scopedSlots:e._u([{key:"empty",fn:function(){return[e._v(" "+e._s(e.$t("Noch keine Notizen vorhanden."))+" ")]},proxy:!0}
1,e.expanded?null:{key:"cell()",fn:function({value:i}){return[t("span",{attrs:{title:i}},[e._v(e._s(i))])]}},e.expanded?{key:"cell(userComment)",fn:function({value:i,item:a}){return[t("span",{attrs:{title:i}},[e._v(e._s(i))]),a.pictures.length>0?t("div",{staticClass:"mt-2 widget-notes__thumbs"},e._l(a.pictures,(function(i,n){return t("img",{key:i.id,staticClass:"widget-notes__thumb",attrs:{src:i.uriSmallThumb,alt:i.alt},on:{click:function(t){return e.openGallery(a.pictures,n)}}})})),0):e._e()]}}:null],null,!0)}):t("FeatureNotAvailable",{attrs:{"add-link-to-shop":e.canPurchaseLicenses}}),t("ModalImageCarousel",{attrs:{images:e.carouselImages,"start-index":e.carouselStartIndex},model:{value:e.carouselOpen,callback:function(t){e.carouselOpen=t},expression:"carouselOpen"}})],1):e._e()},lae=[],dae=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",attrs:{size:"xl","body-class":"modal-image-gallery","footer-variant":"none",scrollable:"",visible:e.visible,title:e.$t("Bilder")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"default",fn:function(){return[t("BCarousel",{attrs:{controls:"",indicators:"","no-wrap":"",interval:0,value:e.startIndex}},e._l(e.imagesComputed,(function(i){return t("BCarouselSlide",{key:i.src,scopedSlots:e._u([{key:"img",fn:function(){return[t("img",{staticClass:"modal-image-gallery__img",attrs:{src:i.src,alt:i.alt}})]},proxy:!0}],null,!0)})})),1)]},proxy:!0}])})},cae=[];ow.vI.add(uw.IJ7);var uae={name:"ModalCreateProcessOrder",components:{ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},images:{type:Array,required:!0},startIndex:{type:Number,default:0}},computed:{imagesComputed(){return this.images.map((e=>({src:"string"===typeof e?e:e.src})))}}}
1,pae=uae,hae=(0,ew.Z)(pae,dae,cae,!1,null,"09c5da9a",null),mae=hae.exports,fae={name:"WidgetNotes",components:{FeatureNotAvailable:Ew,Table:uie,Widget:ete,ModalImageCarousel:mae},props:{expanded:{type:Boolean,default:!1},selectedFields:{type:Array,required:!0},subtitle:{type:String,required:!1},notes:{type:Object,default:()=>({})},notesFetching:{type:Boolean,default:!1}},data(){return{carouselOpen:!1,carouselImages:[],carouselStartIndex:0}},computed:{notesVisible(){return 0!==this.companyIds.length&&this.companyIds.some((e=>this.$store.getters.companyFeatureVisible(e,Hr.FEATURE_NOTES)))},notesEnabled(){return 0!==this.companyIds.length&&this.companyIds.every((e=>this.$store.getters.companyFeatureEnabled(e,Hr.FEATURE_NOTES)))},canPurchaseLicenses(){return 0!==this.companyIds.length&&this.companyIds.every((e=>this.$store.getters.companyFeatureEnabled(e,Hr.CAN_PURCHASE_LICENSE)))},companyIds(){const e=new Set;return this.$store.state.auth.currentCompanies.forEach((t=>{null!=t&&null!=t.id&&e.add(t.id)})),[...e]},tableFields(){return[{key:"date",width:"85px"},{key:"userComment",tdClass:this.expanded?"":"text-truncate"}]},tableItems(){return Object.values(this.notes).filter((e=>this.selectedFields.some((t=>e.fieldId===t.id)))).map((e=>{const{id:t,userComment:i}=e;return{id:t,date:g()(1e3*e.creationDate).format("L"),userComment:i,pictures:e.pictures.map((e=>({id:e.id,uri:P+e.uri,uriSmallThumb:P+e.uriSmallThumb})))}}))}},methods:{openGallery(e,t){this.carouselOpen=!0,this.carouselImages=e.map((e=>e.uri)),this.carouselStartIndex=t}}},gae=fae,yae=(0,ew.Z)(gae,oae,lae,!1,null,"a4717ea6",null),vae=yae.exports,bae=function(){var e=this,t=e._self._c;return e.visible?t("Widget",{staticClass:"widget-nutrient-balance",attrs:{title:e.$t("Nährstoffbilanz"),subtitle:e.subtitle}},[e.fetching?t("div",{staticClass:"text-primary"},[t("FontAwesomeIcon",{attrs:{icon:"circle-notch",spin:""}})],1):t("div",{staticClass:"nutrient-balance__container",class:{"nutrient-balance__container--blurred":!e.enabled}},[t("div",{staticClass:"widget-nutrient-balance__legend"},[t("div",[e._v(e._s(e.$t("Einheit kg/ha")))]),t("div",[t("span",{staticClass:"widget-nutrient-balance__legend-dot widget-nutrient-balance__legend-dot--planned"}),t("span",{staticClass:"widget-nutrient-balance__legend-description widget-nutrient-balance__legend-description--planned"},[e._v(" "+e._s(e.useNeededAsPlanned?e.$t("Bedarf"):e.$t("Geplant"))+" ")]),t("span",{staticClass:"widget-nutrient-balance__legend-dot widget-nutrient-balance__legend-dot--fertilized"}),t("span",{staticClass:"widget-nutrient-balance__legend-description widget-nutrient-balance__legend-description--fertilized"},[e._v(" "+e._s(e.$t("Gedüngt"))+" ")]),t("span",{staticClass:"widget-nutrient-balance__legend-dot widget-nutrient-balance__legend-dot--remaining"}),t("span",{staticClass:"widget-nutrient-balance__legend-description widget-nutrient-balance__legend-description--remaining"},[e._v(" "+e._s(e.$t("Frei"))+" ")]),e.useNeededAsPlanned?e._e():t("span",{staticClass:"widget-nutrient-balance__legend-dot widget-nutrient-balance__legend-dot--needed"}),e.useNeededAsPlanned?e._e():t("span",{staticClass:"widget-nutrient-balance__legend-description widget-nutrient-balance__legend-description--needed"},[e._v(" "+e._s(e.$t("Bedarf"))+" ")])])]),t("div",{staticClass:"nutrient-balance__chart-container"},e._l(e.nutrients,(function(i){return t("div",{key:i.key},[null==i.data||0===i.data.length?t("span",{staticClass:"nutrient-balance__no-data"},[e._v(" "+e._s(e.$t("Die Werte konnten nicht geladen werden."))+" ")]):t("svg",{attrs:{width:i.chartWidth,height:i.chartHeight}},[e._l(i.data,(function(i){return t("g",{key:i.key,staticClass:"nutrient-balance__bar",class:i.status,attrs:{transform:`translate(${i.x}, ${i.y})`}},[t("rect",{attrs:{rx:"2",width:i.width,height:i.height}}),t("text",{staticClass:"widget-nutrient-balance__bar-value",class:{"widget-nutrient-balance__bar-value--negative":i.value<0},attrs:{x:i.valueX,y:i.valueY}},[e._v(" "+e._s(i.valueFormatted)+" ")])])})),e.useNeededAsPlanned?e._e():t("g",{staticClass:"nutrient-balance__needed",attrs:{transform:`translate(${i.neededX}, ${i.neededY})`}},[t("rect",{attrs:{height:"1",width:i.neededWidth}}),t("rect",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:i.neededFormatted,expression:"nutrient.neededFormatted",modifiers:{hover:!0}}],attrs:{transform:"translate(0, -5)",height:"11",width:i.neededWidth}})])],2),t("h5",[e._v(e._s(i.label))])])})),0)]),e.enabled?e._e():t("FeatureNotAvailable",{attrs:{"no-back-link":""}}
1)],1):e._e()},wae=[];const Cae=2,Fae=170,Aae=30,kae=0,Sae=40,Eae=5,Iae=[{key:"n",label:"N"},{key:"p",label:"P₂O₅"},{key:"k",label:"K₂O"}];var _ae={name:"WidgetNutrientBalance",components:{Widget:ete,FeatureNotAvailable:Ew},props:{selectedFields:{type:Array,required:!0},subtitle:{type:String,default:null},isSharedField:{type:Boolean,default:!1}},data(){return{data:{},fetching:!1,source:null}},computed:{companyId(){return this.$store.state.auth.currentCompanies&&this.$store.state.auth.currentCompanies[0].id?this.$store.state.auth.currentCompanies[0].id:null},enabled(){return null!=this.companyId&&this.$store.getters.companyFeatureEnabled(this.companyId,Hr.FEATURE_NUTRIENT_BALANCE)},fieldId(){return this.selectedFields.length<1?null:this.selectedFields[0].id},useNeededAsPlanned(){return Iae.every((e=>0===this.data[`${e.key}Planned`]))},visible(){return!this.isSharedField||this.isSharedField&&this.data},nutrients(){const e=(0,yte.Z)(Object.keys(this.data).filter((e=>e.indexOf("Fertilized")>0||e.indexOf("Planned")>0||e.indexOf("Needed")>0)).map((e=>this.data[e])).filter((e=>"number"===typeof e))),t=(0,vte.Z)().domain([0,e]).range([0,Fae-Aae-kae]);return Iae.map((e=>{const i=`${e.key}Fertilized`,a=`${e.key}Planned`,n=`${e.key}RemainingToFertilize`,r=`${e.key}Needed`;if(null==this.data[i]||null==this.data[a]||null==this.data[n]||null==this.data[r])return e;let s=this.data[n];this.useNeededAsPlanned&&(s=this.data[r]-this.data[i]);let o=[{key:this.useNeededAsPlanned?r:a,value:this.useNeededAsPlanned?this.data[r]:this.data[a]},{key:i,value:this.data[i]},{key:n,value:s,status:{"nutrient-balance__bar--negative":s<0}}];return o=o.map(((e,i)=>{const a=i*(Sae+Eae)+Eae;let n,r,s;return n=i<2?Fae-t(e.value)-kae:Fae-t((0,yte.Z)(o,(e=>e.value)))-kae,r=i<2?t(e.value)+kae-5:t((0,yte.Z)(o,(e=>e.value)))+kae-5,s=i<2?t(Math.abs(e.value)):Math.min(t(Math.abs(e.value)),t((0,yte.Z)(o.map((e=>e.value))))-Cae),0===e.value&&(s=Cae,n=Fae-kae-Cae),{...e,x:a,y:n,width:Sae,height:s,valueX:Sae/2,valueY:-5,valueFormatted:Bl()(e.value).format({mantissa:1}),labelX:Sae/2,labelY:r}})),{...e,data:o,chartHeight:Fae,chartWidth:Sae*o.length+Eae*(o.length+1),neededX:Eae,neededY:Fae-t(this.data[r])-kae,neededWidth:3*Sae+2*Eae,neededFormatted:Bl()(this.data[r]).format({mantissa:1})}}))}},watch:{fieldId(){this.loadData()}},created(){this.source=l().CancelToken.source(),this.loadData()},deactivated(){this.source.cancel()},methods:{async loadData(){if(null==this.fieldId)return;if(!this.enabled)return void(this.data=JSON.parse('{"id":null,"fieldId":null,"tstamp":null,"deleted":null,"nPlanned":0,"nFertilized":87.92,"nRemainingToFertilize":67.08,"pPlanned":0,"pFertilized":5.89,"pRemainingToFertilize":64.11,"kPlanned":0,"kFertilized":13.15,"kRemainingToFertilize":76.85,"nNeeded":155,"pNeeded":70,"kNeeded":90}'));this.data={},this.fetching=!0;const e=`?permissionMode=fieldSharing&fieldSharingCompanyId=${this.$store.state.auth.currentCompanies[0].id}`;try{const{data:t}=await l().get(`/admin/rest/field/fertilization_data_for_field/${this.fieldId}${this.isSharedField?e:""}`,{cancelToken:this.source.token});if(this.fetching=!1,"success"!==t.status||t.data.length<1)return;this.data=t.data}catch(t){this.fetching=!1,this.data=null}}}},Dae=_ae,Mae=(0,ew.Z)(Dae,bae,wae,!1,null,"0a06cb52",null),Pae=Mae.exports,Tae=function(){var e=this,t=e._self._c;return e.reportsComputed.length>0?t("Widget",{attrs:{title:e.$t("Berichte")}},[e.companyClusterActive?t("div",[t("div",{staticClass:"widget-reports__report"},[t("p",{staticClass:"widget-reports__report-description"},[e._v(" "+e._s(e.$t("Wähle einen Betrieb um deine Berichte anzuzeigen."))+" ")]),t("ButtonLink",{attrs:{to:{name:"reports"}}},[e._v(" "+e._s(e.$t("Zu den Berichten"))+" ")])],1)]):t("div",e._l(e.reportsComputed,(function(i){return t("div",{key:i.key,staticClass:"widget-reports__report"},[t("h3",[e._v(e._s(i.title))]),t("p",{staticClass:"widget-reports__report-description",class:{"widget-reports__report-description--blurred":!i.enabled}},[e._v(" "+e._s(i.description)+" ")]),i.enabled?t("ButtonLink",{attrs:{target:"_blank",href:i.link}}
1,[e._v(" "+e._s(e.$t("Zum Bericht"))+" ")]):t("ButtonLink",{attrs:{to:{name:"shop"}}},[e._v(" "+e._s(e.$t("Jetzt Lizenz upgraden"))+" ")])],1)})),0)]):e._e()},xae=[],Bae={name:"WidgetReports",components:{ButtonLink:Fw,Widget:ete},data(){return{reports:{at:[{id:32,title:this.$t("Feld-Übersicht"),description:this.$t("Liste aller Feldgruppen und Felder im gewählten Erntejahr."),availableInFreeLicense:!0},{id:1,title:this.$t("Feldstücksliste"),description:this.$t("Liste aller Feldstücke und Schläge im gewählten Erntejahr."),availableInFreeLicense:!1},{id:27,title:this.$t("Kulturen"),description:this.$t("Liste aller Felder gruppiert nach Kulturen."),availableInFreeLicense:!1},{id:24,title:this.$t("Kulturen & Greening-Kennzahlen"),description:this.$t("Kulturen, Feldstücknutzung, Anbaudiversivizierung und ökologische Vorrangflächen."),availableInFreeLicense:!1},{id:49,title:this.$t("UBB"),description:this.$t("Umweltgerechte und biodiversitätsfördernde Bewirtschaftung."),availableInFreeLicense:!1}],international:[{id:32,title:this.$t("Feld-Übersicht"),description:this.$t("Liste aller Feldgruppen und Felder im gewählten Erntejahr."),availableInFreeLicense:!0},{id:27,title:this.$t("Kulturen"),description:this.$t("Liste aller Felder gruppiert nach Kulturen."),availableInFreeLicense:!1}]}}},computed:{companyClusterActive(){return this.$store.state.auth.currentCompanies.length>1},useAtReports(){return this.$store.state.auth.currentCompanies.some((e=>e.regionId===ee.AT))},reportsComputed(){let e="international";return this.useAtReports&&(e="at"),this.reports[e].map((e=>({...e,key:`report_${e.id}`,link:`${P}/admin/reports/preview/${e.id}`,enabled:e.availableInFreeLicense||this.reportShouldBeEnabled})))},companyHasFreeLicense(){return this.$store.state.auth.currentCompanies.some((e=>e.licensePackageId===ae.FARMDOK_FREE))},companyHasNoLicense(){return this.$store.state.auth.currentCompanies.some((e=>e.licensePackageId===ae.NO_LICENSE))},companyHasPrecisionLicense(){return this.$store.state.auth.currentCompanies.some((e=>e.licensePackageId===ae.PRECISION))},reportShouldBeEnabled(){return!(this.companyHasPrecisionLicense||this.companyHasNoLicense||this.companyHasFreeLicense)}}},Oae=Bae,$ae=(0,ew.Z)(Oae,Tae,xae,!1,null,"a045614a",null),Rae=$ae.exports,Nae=function(){var e=this,t=e._self._c;return t("div",[e.tableItemsFarmdok.length>0?t("Widget",{attrs:{title:e.$t("Bodenproben"),subtitle:e.tableItemsAgrana.length?"FARMDOK":null}}
1,[t("Table",{attrs:{fixed:"",fields:e.tableFieldsFarmdok,items:e.tableItemsFarmdok},scopedSlots:e._u([{key:"head(samples)",fn:function(i){return[t("div",{staticStyle:{display:"flex","flex-direction":"row"}},e._l(e.tableFieldsSamplesFarmdok,(function(i){return t("div",{key:i.key,style:{"flex-grow":null==i.width?"1":"0",width:i.width,padding:"0.75rem"}},[e._v(" "+e._s(i.label)+" ")])})),0)]}},{key:"cell(samples)",fn:function(i){return[t("Table",{staticClass:"m-0",attrs:{fixed:"",borderless:"",headerless:"",fields:e.tableFieldsSamplesFarmdok,items:i.item.samples}})]}},{key:"cell(userComment)",fn:function(i){return["string"===typeof i.item.userComment&&i.item.userComment.length>0?t("ButtonLink",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.left",value:{title:i.item.userComment},expression:"{ title: data.item.userComment }",modifiers:{hover:!0,left:!0}}],staticClass:"widget-measures__user-comment",attrs:{color:"black"}},[e._v(" "+e._s(i.item.userComment)+" ")]):e._e()]}}],null,!1,1478207531)})],1):e._e(),e.tableItemsAgrana.length>0?t("Widget",{attrs:{title:e.$t("Bodenproben"),subtitle:e.tableItemsFarmdok.length?"EUF":null}}
1,[t("Table",{attrs:{fixed:"",fields:e.tableFieldsAgrana,items:e.tableItemsAgrana},scopedSlots:e._u([{key:"head(samples)",fn:function(i){return[t("div",{staticStyle:{display:"flex","flex-direction":"row"}},e._l(e.tableFieldsSamplesAgrana,(function(i){return t("div",{key:i.key,style:{"flex-grow":null==i.width?"1":"0",width:i.width,padding:"0.75rem"}},[e._v(" "+e._s(i.label)+" ")])})),0)]}},{key:"cell(samples)",fn:function(i){return[t("Table",{staticClass:"m-0",attrs:{fixed:"",borderless:"",headerless:"",fields:e.tableFieldsSamplesAgrana,items:i.item.samples}})]}},{key:"cell(pdfLink)",fn:function(i){return[null!=i.item.pdfLink?t("ButtonLink",{attrs:{target:"_blank",href:i.item.pdfLink}},[e._v(" "+e._s(e.$t("Herunterladen"))+" ")]):e._e()]}},{key:"cell(userComment)",fn:function(i){return["string"===typeof i.item.userComment&&i.item.userComment.length>0?t("ButtonLink",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.left",value:{title:i.item.userComment},expression:"{ title: data.item.userComment }",modifiers:{hover:!0,left:!0}}],staticClass:"widget-measures__user-comment",attrs:{color:"black"}},[e._v(" "+e._s(i.item.userComment)+" ")]):e._e()]}}],null,!1,1050249297)})],1):e._e()],1)},zae=[],Lae={name:"WidgetSoilSamples",components:{ButtonLink:Fw,Table:uie,Widget:ete},props:{selectedField:{type:Object,required:!0},isSharedField:{type:Boolean,default:!1}},data(){return{soilSampleData:{},fetching:!1,source:l().CancelToken.source()}},computed:{tableFieldsFarmdok(){return[{key:"date",label:this.$t("Datum"),width:"100px"},{key:"samples",thClass:"p-0",tdClass:"p-0",width:"650px"},{key:"userComment",label:this.$t("Bemerkung"),tdClass:"text-truncate"}]},tableFieldsSamplesFarmdok(){return[{key:"number",label:this.$t("Nummer")},{key:"phLevel",label:this.$t("pH"),width:"70px"},{key:"humusContent",label:this.$t("Humus"),width:"80px",tdClass:"text-right"},{key:"p2o5Class",label:this.$t("P₂O₅-Klasse"),width:"100px"},{key:"k2oClass",label:this.$t("K₂O-Klasse"),width:"100px"},{key:"mgClass",label:this.$t("Mg-Klasse"),width:"100px"},{key:"caClass",label:this.$t("Ca-Klasse"),width:"100px"}]},tableItemsFarmdok(){return null!=this.soilSampleData&&Array.isArray(this.soilSampleData.farmdok)&&0!==this.soilSampleData.farmdok.length?[...this.soilSampleData.farmdok].sort(((e,t)=>t.creationDate-e.creationDate)).map((e=>({date:g()(1e3*e.creationDate).format("L"),samples:e.samples.map((e=>({...e.additionalData,humusContent:"number"===typeof e.additionalData.humusContent?Bl()(e.additionalData.humusContent).format():e.additionalData.humusContent}))),userComment:e.userComment}))):[]},tableFieldsAgrana(){return[{key:"date",label:this.$t("Datum"),width:"100px"},{key:"samples",thClass:"p-0",tdClass:"p-0",width:"670px"},{key:"pdfLink",label:this.$t("PDF Herunterladen"),width:"140px"},{key:"userComment",label:this.$t("Bemerkung"),tdClass:"text-truncate"}]},tableFieldsSamplesAgrana(){return[{key:"number",label:this.$t("Nummer")},{key:"ph",label:this.$t("pH"),width:"70px",tdClass:"text-right"},{key:"humus",label:this.$t("Humus"),width:"80px",tdClass:"text-right"},{key:"sustenanceN",label:this.$t("N"),width:"70px"},{key:"sustenanceP",label:this.$t("P"),width:"70px"},{key:"sustenanceK",label:this.$t("K"),width:"70px"},{key:"sustenanceCa",label:this.$t("Ca"),width:"70px"},{key:"sustenanceMg",label:this.$t("Mg"),width:"70px"},{key:"sustenanceB",label:this.$t("B"),width:"70px"}]},tableItemsAgrana(){return null!=this.soilSampleData&&Array.isArray(this.soilSampleData.agrana)&&0!==this.soilSampleData.agrana.length?[...this.soilSampleData.agrana].sort(((e,t)=>t.creationDate-e.creationDate)).map((e=>{let t=null;return"string"===typeof e.pdfLink&&e.pdfLink.length>0&&(t=`${P}${e.pdfLink}`),{date:g()(1e3*e.creationDate).format("L"),samples:e.samples.map((e=>({...e.additionalData,humus:"number"===typeof e.additionalData.humus?Bl()(e.additionalData.humus).format():e.additionalData.humus}))),pdfLink:t,userComment:e.userComment}})):[]},fieldId(){return null==this.selectedField?null:this.selectedField.id}},watch:{fieldId(){this.loadSoilSamples()}},created(){this.loadSoilSamples()},methods:{async loadSoilSamples(){if(null==this.fieldId)return;this.soilSampleData={},this.fetching=!0;const e=`?permissionMode=fieldSharing&fieldSharingCompanyId=${this.$store.state.auth.currentCompanies[0].id}`;try{const{data:t}=await l().get(`/admin/rest/field/soil_samples_for_field/${this.fieldId}${this.isSharedField?e:""}`,{cancelToken:this.source.token});if(this.fetching=!1,this.reloading=!1,"success"!==t.status||t.data.length<1)return;this.soilSampleData=t.data}catch(t){this.fetching=!1,this.reloading=!1}}}},Vae=Lae,Uae=(0,ew.Z)(Vae,Nae,zae,!1,null,"7ce36699",null),jae=Uae.exports;ow.vI.add(lw.wf8,lw.EfQ,lw.nNP,lw.A35,lw._tD);var Hae={name:"SatelliteFieldDetail",components:{ButtonLink:Fw,WidgetKPIs:eae,WidgetReports:Rae,WidgetCropRatio:Mie,ButtonBorderedIcon:ste,TheSatellite:Kee,WidgetNutrientBalance:Pae,WeatherInfo:aie,WidgetCropRotation:Uie,WidgetMap:sae,WidgetActivities:Cie,Widget
1Notes:vae,Widget:ete,WidgetSoilSamples:jae,WidgetCustomer:Kie},props:{loading:{type:Boolean,default:!1},selectedFields:{type:Array,required:!1,default:()=>[]},visibleFields:{type:Array,required:!1,default:()=>[]},currentFieldId:{type:String,default:null},visible:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1},crops:{type:Object,default:()=>({})},varieties:{type:Object,default:()=>({})}},data(){return{navigationDate:new Date}},created(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("activities/subscribe"),this.$store.dispatch("units/subscribe"),this.currentCompanyHasFeatureNotes.enabled&&this.currentCompanyHasFeatureNotes.visible&&this.$store.dispatch("notes/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.$store.dispatch("products/subscribe")},computed:{...(0,C.Se)({units:"units/data",customers:"customers/data",activityTypes:"activityTypes/data",activities:"activities/data",activitiesFetching:"activities/fetching",notes:"notes/data",notesFetching:"notes/fetching",kindOfUseTypes:"fields/kindOfUseTypes",findProductStorageDropdownItem:"products/dropdownItem"}),currentCompanyHasFeatureNotes(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_NOTES)},empty(){return!this.loading&&(0===this.selectedFields.length||!(!this.expanded||null!=this.currentField))},fieldsForExpandedMode(){return 1===this.selectedFields.length&&this.visibleFields.length>1?this.visibleFields:this.selectedFields},currentField(){let e=null;return this.fieldsForExpandedMode.some((t=>t.id===this.currentFieldId&&(e=t,!0))),e},labelCurrentField(){return sA.data(this.currentField)},previousField(){let e=null;return this.fieldsForExpandedMode.some(((t,i)=>t.id===this.currentFieldId&&(null!=this.fieldsForExpandedMode[i-1]&&(e=this.fieldsForExpandedMode[i-1]),!0))),e},labelPreviousField(){return null==this.previousField?this.$t("Kein weiteres Feld"):sA.data(this.previousField)},nextField(){let e=null;return this.fieldsForExpandedMode.some(((t,i)=>t.id===this.currentFieldId&&(null!=this.fieldsForExpandedMode[i+1]&&(e=this.fieldsForExpandedMode[i+1]),!0))),e},labelNextField(){return null==this.nextField?this.$t("Kein weiteres Feld"):sA.data(this.nextField)}},watch:{visibleFields(){this.currentCompanyHasFeatureNotes.enabled&&this.currentCompanyHasFeatureNotes.visible&&this.$store.dispatch("notes/subscribe"),this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("activities/subscribe"),this.$store.dispatch("units/subscribe")}},methods:{printPage(){window.print()}}},Gae=Hae,Wae=(0,ew.Z)(Gae,Vee,Uee,!1,null,"2f3458b6",null),Zae=Wae.exports,Kae=function(){var e=this,t=e._self._c;return t("TableBase",{key:e.id,ref:"table",staticClass:"table-fields-container",class:[{"table-fields-container--is-dragover":e.isDragover},{"table-fields-container--is-uploading":e.isUploading}],attrs:{"context-menu":"","hover-buttons":"",id:e.id,"data-dragover-label":e.isUploading?e.$t("Lade hoch ..."):e.$t("Leg deine Datei hier ab"),cells:e.columnDropdownCompaniesCells,"filter-string":e.filterString,"selected-rows":e.selectedRows,"visible-rows":e.visibleRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors,"hover-buttons-main-button-icon":["fas","arrow-to-left"],"hover-buttons-main-button-title":e.$t("Details anzeigen"),"read-only":e.fieldsReadOnly},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:cell":e.updateEntryByKeyAndValue,"create:newRow":e.insertAndSyncNewEntry,"remove:row":t=>e.removeEntries([t]),"click:status":e.onClickStatus,"click:sharedFieldInfo":e.onClickSharedFieldInfo,afterScrollVertically:function(t){return e.$emit("click:status")},afterScrollHorizontally:function(t){return e.$emit("click:status")},reload:e.loadData,edit:t=>e.$emit("edit",t),"update:isDragover":t=>e.isDragover=t,drop:e.onFileDrop,rowHoverMainButton:e.showDetailPage,"update:tableSettings":e.onTableSettingsChanged},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0},{key:"no-content",fn:function(){return[t("NoContent",{attrs:{type:e.noContentType.type,variant:e.noContentType.variant,fetching:e.noContentFetching,"error-response-data":e.noContentError,"read-only":e.fieldsReadOnly},on:{create:function(t){return e.$emit("create")},import:function(t){return e.$router.push({name:"fields/import"})},copyFromPreviousProcessOrder:()=>e.copyAllFieldsFromProcessOrder("previous"),copyFromNextProcessOrder:()=>e.copyAllFieldsFromProcessOrder("next"),refresh:e.refresh}})]},proxy:!0},e.isDragover||e.isUploading?null:{key:"no-search-results",fn:function(){return[t("NoContent",{attrs:{type:"search","read-only":e.fieldsReadOnly},on:{clearAllFilters:e.clearAllFilters}})]},proxy:!0}],null,!0)})},qae=[],Yae=function(){var e=this,t=e._self._c;return t("MaxWidthContainer",{staticClass:"fields-no-content",attrs:{size:"xl"}},[t("img",{staticClass:"fields-no-content__icon",attrs:{src:e.imageSrc,alt:"no-content"}}),t("h1",{staticClass:"mt-6 mb-4"},["company"===e.type?t("span",[e._v(" "+e._s(e.$t("Es wurden noch keine Felder angelegt. Erstelle neue Felder!"))+" ")]):e._e(
1),"cropYear"===e.type?t("span",[e._v(" "+e._s(e.$t("In diesem Erntejahr sind noch keine Flächen verfügbar."))+" ")]):e._e(),"search"===e.type?t("span",[e._v(" "+e._s(e.$t("Keine Ergebnisse gefunden. Ändere den Suchbegriff."))+" ")]):e._e()]),t("p",["company"===e.type?t("span",[e._v(" "+e._s(e.$t("Du kannst das auch bequem mit dem Smartphone oder Tablet auf der Couch machen oder auch alle deine Flächen auf einmal importieren."))+" ")]):e._e(),"cropYear"===e.type&&"copyFromPrevious"===e.variant?t("span",[e._v(" "+e._s(e.$t("Sollen die Flächen aus dem Vorjahr übernommen werden?"))+" ")]):e._e(),"cropYear"===e.type&&"copyFromNext"===e.variant?t("span",[e._v(" "+e._s(e.$t("Sollen die Flächen aus dem nachfolgenden Erntejahr übernommen werden?"))+" ")]):e._e()]),t("div",{staticClass:"mt-4"},["company"===e.type&&"import"===e.variant?t("Button",{attrs:{"leading-icon":"",icon:"cloud-upload",disabled:e.readOnly},on:{click:function(t){return e.$emit("import")}}},[e._v(" "+e._s(e.$t("Felder importieren"))+" ")]):e._e(),"company"===e.type&&"create"===e.variant?t("Button",{attrs:{"leading-icon":"",icon:"plus-circle",disabled:e.readOnly},on:{click:function(t){return e.$emit("create")}}},[e._v(" "+e._s(e.$t("Felder hinzufügen"))+" ")]):e._e(),"cropYear"===e.type&&"copyFromPrevious"===e.variant?t("Button",{attrs:{"leading-icon":"",icon:"file-import",fetching:e.fetching,disabled:e.readOnly||null!=e.errorResponseData},on:{click:function(t){return e.$emit("copyFromPreviousProcessOrder")}}},[e._v(" "+e._s(e.$t("Flächen aus dem Vorjahr übernehmen"))+" ")]):e._e(),"cropYear"===e.type&&"copyFromNext"===e.variant?t("Button",{attrs:{"leading-icon":"",icon:"file-import",fetching:e.fetching,disabled:e.readOnly||null!=e.errorResponseData},on:{click:function(t){return e.$emit("copyFromNextProcessOrder")}}},[e._v(" "+e._s(e.$t("Flächen aus dem Nachfolgejahr übernehmen"))+" ")]):e._e(),"search"===e.type?t("ButtonLink",{on:{click:function(t){return e.$emit("clearAllFilters")}}},[e._v(" "+e._s(e.$t("Suche zurücksetzen"))+" ")]):e._e()],1),null!=e.errorResponseData?t("div",[t("ErrorUserMessage",{attrs:{"response-data":e.errorResponseData}}),t("div",{staticClass:"mt-2"},[t("ButtonLink",{on:{click:function(t){return e.$emit("refresh")}}},[e._v(" "+e._s(e.$t("Neu laden"))+" ")])],1)],1):e._e()])},Jae=[];ow.vI.add(uw.Vmj,uw.KtF,uw.KN3);const Xae=i(8538);var Qae={name:"NoContent",components:{Button:gw,ButtonLink:Fw,MaxWidthContainer:Tw,ErrorUserMessage:cH},props:{type:{type:String,required:!0,validator:e=>["company","cropYear","search","loading"].includes(e)},variant:{type:String,default:null,validator(e){return["import","create","copyFromPrevious","copyFromNext"].includes(e)}},fetching:{type:Boolean,default:!1},errorResponseData:{type:Object,default:null},readOnly:{type:Boolean,default:!1}},computed:{imageSrc(){return["company","cropYear","search"].includes(this.type)?Xae(`./no-content-${this.type}.svg`):"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}}},ene=Qae,tne=(0,ew.Z)(ene,Yae,Jae,!1,null,"55a546c5",null),ine=tne.exports;const ane=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,hiddenPerDefault:!0,lockedPosition:!0},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...xF,hiddenPerDefault:!0},BF,{...jF,hiddenPerDefault:!0},{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},{...LF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...VF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],nne=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,lockedPosition:!0},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...TF,hiddenPerDefault:!0},xF,BF,{...UF,lockedVisibility:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_GROUNDWATER_PROTECTION)},{...jF,hiddenPerDefault:!0},{...OF,hiddenPerDefault:!0},{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},{...LF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...VF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],rne=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,lockedPosition:!0},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...xF,hiddenPerDefault:!0},BF,{...jF,hiddenPerDefault:!0},{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},{...LF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...VF,hiddenPerDefault:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var sne={international:ane,[ee.AT]:nne,[ee.DE]:rne};ow.vI.add(uw.ytF,lw.RrC,uw.s87);var one={name:"TableFieldsContainer",components:{TableFooter:hD,TableBase:oD,NoContent:ine},props:{filterString:{type:String,default:""},fieldIdsWithHarvestingMeasure:{type:Array,default(){return[]}}},mixins:[gD,mD("fields",{forceRefresh:!0}
1),fD("fields"),rI(XF.key),sI({[tA.key]:"fieldGroup.customer"}),dI({[DF.key]:"crop",[PF.key]:"preCrop"}),yD({[MF.key]:"variety"}),ID({[xF.key]:CD,[TF.key]:FD,[OF.key]:AD,[UF.key]:kD}),oI],data(){return{columnDefinition:sne,isDragover:!1,isUploading:!1,noContentFetching:!1,noContentError:null,nextCropYearHasFields:null,previousCropYearHasFields:null,sharedFieldsByFieldId:{},sharedFieldsCompaniesById:{},sharedFieldsByShareId:{},sharedFieldsInfoLoading:!0}},computed:{...(0,C.rn)("fields",{loadingNdvi:e=>e.loadingNdvi,loadingMbi:e=>e.loadingMbi,pendingNdvi:e=>Object.values(e.data).filter((e=>void 0===e.ndvi)),pendingMbi:e=>Object.values(e.data).filter((e=>void 0===e.mbi))}),id(){const e=this.currentCompanies.map((e=>e.id)).sort();return["hot-fields",...e].join("-")},loading(){const e=!!this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.getters["customers/loading"];return this.sharedFieldsInfoLoading||this.$store.getters["fields/loading"]||this.$store.getters["products/crops/loading"]||this.$store.getters["varieties/loading"]||e},cropYearNeighbourInfo(){const e=this.$store.getters["auth/availableProcessOrderNames"],t=this.$store.state.auth.currentProcessOrderName,i=String(Number(t)-1),a=String(Number(t)+1);return{current:t,previous:e.includes(i)?i:null,next:e.includes(a)?a:null}},noContentType(){return!0===this.previousCropYearHasFields?{type:"cropYear",variant:"copyFromPrevious"}:!0===this.nextCropYearHasFields?{type:"cropYear",variant:"copyFromNext"}:null===this.previousCropYearHasFields||null===this.nextCropYearHasFields?{type:"loading"}:this.currentCompanies.some((e=>[ee.AT,ee.DE].includes(e.regionId)))?{type:"company",variant:"import"}:{type:"company",variant:"create"}},processOrdersReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_PROCESS_ORDER)},fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)},currentProcessOrderIds(){return this.$store.getters["auth/currentProcessOrderIds"]},currentCompanyIds(){return this.$store.getters["auth/currentCompanyIds"]},currentCompanies(){return this.$store.state.auth.currentCompanies},sgdVersion(){return this.$store.getters["auth/currentProcessOrders"].map((e=>e.sgdVersion)).find(ka)??""}},watch:{currentProcessOrderIds(){this.loadData()},currentCompanyIds(){this.loadData()},fieldIdsWithHarvestingMeasure(){null!=this.$refs.table&&this.$refs.table.hotRender()},tableData(){this.noContentError=null,this.checkForFieldsInNeighbourCropYears()},loading(){this.checkForFieldsInNeighbourCropYears()}},created(){this.unsubscribeFromStore=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.loadSharedFieldsInfo()})),this.loadData(),this.loadSharedFieldsInfo()},beforeDestroy(){this.unsubscribeFromStore()},methods:{tableMounted(){this.loadNdviData(),this.loadMbiData()},async loadSharedFieldsInfo(e=!1,t=!0){if(e||(this.sharedFieldsInfoLoading=!0),t&&(this.sharedFieldsByFieldId={},this.sharedFieldsCompaniesById={},this.sharedFieldsByShareId={}),0===this.$store.getters["auth/currentProcessOrderIds"].length)return;const i=["field.processOrderId","IN",this.$store.getters["auth/currentProcessOrderIds"]],a=["/admin/rest/sharedField?version=2.0","disablePagination=1",`filter=${Ac(i)}`,`resolveInSeparateList=${Ac(["company"])}`];try{const{data:e}=await l().get(a.join("&"));Array.isArray(e.data)&&(this.sharedFieldsByFieldId=e.data.reduce(((e,t)=>{const i={...e};return null==i[t.fieldId]?i[t.fieldId]=[t.id]:i[t.fieldId]=[...i[t.fieldId],t.id],i}),{}),this.sharedFieldsByShareId=e.data.reduce(((e,t)=>{const i={...e};return i[t.id]=t,i}),{})),null!=e.resolved&&Array.isArray(e.resolved.company)&&(this.sharedFieldsCompaniesById=e.resolved.company.reduce(((e,t)=>({...e,[t.id]:t})),{}))}catch(n){console.error("TableFieldsContainer.vue :: unable to load shared fields info.",n)}this.sharedFieldsInfoLoading=!1,e&&null!=this.$refs.table&&this.$refs.table.hotRender(),this.$emit("updateSharedFieldInfo")},updateSharedFields(e){this.loadSharedFieldsInfo(Object.keys(this.sharedFieldsByFieldId).length>0,e)},showDetailPage([e]){this.selectedRows.length>0&&!this.selectedRows.includes(e)&&this.$emit("update:selectedRows",[...this.selectedRows,e]),this.$router.push({name:"fields/record",params:{fieldId:e}})},async onFileDrop(e){this.isDragover=!1;const{files:t}=e.dataTransfer;if(t.length<1)return;this.isUploading=!0;const i=new FormData;let a;Array.from(t).forEach((e=>{i.append("file[]",e)}));try{const{data:e}=await l().post("/admin/rest/field/import_upload_files",i);a=ue(e)}catch(n){a=ue(n)}this.isUploading=!1,await this.$router.push({name:"fields/import/load-data",params:{method:"upload",fileUploadResponseData:a}})},async loadAdditionalData(){this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe"),this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.dispatch("customers/subscribe"),await this.loadNdviData(),await this.loadMbiData()},onClickStatus({target:e,visualRow:t}){this.$emit("click:status",{target:e,guid:this.$refs.table.visualRowToGuid(t)})},onClickSharedFieldInfo({shareId:e}){const t=this.sharedFieldsByShareId[e],{sharingEmail:i}=this.sharedFieldsCompaniesById[t.companyId];this.$emit("click:sharedFieldInfo",{...t,sharingEmail:i})},async checkForFieldsInNeighbourCropYears(){if(this.previousCropYearHasFields=null,this.nextCropYearHasFields=null,this.loading||Object.keys(this.tableData).length>0)return;const e=await Promise.all([this.cropYearNeighbourInfo.previous,this.cropYearNeighbourInfo.next].map((async e=>null!=e&&this.$store.getters["auth/currentCompaniesHaveFieldsInCropYear"](e))));[this.previousCropYearHasFields,this.nextCropYearHasFields]=e},clearAllFilters(){this.$refs.table.clearAllFilters()},async copyAllFieldsFromProcessOrder(e){this.noContentFetching=!0;const t=await this.$store.dispatch("fields/copyAllFieldsFromProcessOrder",{direction:e});if("success"===t.status)return await this.refresh(),void(this.noContentFetching=!1);this.noContentError=t,this.noContentFetching=!1},async refresh(){this.noContentError=null,await this.$store.dispatch("fields/refresh"),await this.loadNdviData(),await this.loadMbiData()},async loadNdviData(){if(!this.$refs.table)return;await this.$refs.table.$nextTick(),await this.$refs.table.$nextTick();const e=this.$refs.table.getColumnsForPageSettings().find((e=>"ndvi"===e.key));e&&e.visible&&!this.loadingNdvi&&await this.$store.dispatch("fields/loadNdvi",this.pendingNdvi)},async loadMbiData(){if(!this.$refs.table)return;await this.$refs.table.$nextTick(),await this.$refs.table.$nextTick();const e=this.$refs.table.getColumnsForPageSettings().find((e=>"mbi"===e.key));e&&e.visible&&!this.loadingMbi&&await this.$store.dispatch("fields/loadMbi",this.pendingMbi)},async onTableSettingsChanged(){this.loadNdviData(),this.loadMbiData()}}},lne=one,dne=(0,ew.Z)(lne,Kae,qae,!1,null,"ccb45d20",null),cne=dne.exports;ow.vI.add(uw.UJf,uw.KtF,uw._mg,uw.KN3,uw.ytF,uw.I7k,uw.tFX,uw.XCy,lw.tU8,lw.DCV,lw.EfQ);var une={name:"PageFields",components:{ModalRemoveSharedFields:hee,ModalSplitField:Pee,ModalCombineFields:S9,ModalTableExport:_$,ModalEditStatus:j9,ModalCompleteCropYear:P9,PopoverFieldStatus:Lee,DropdownPageOptions:YL,TableFieldsContainer:cne,TheContentbar:HL,ThePageSkeleton:$w,CompanySwitch:qw,ProcessOrderSwitch:lV,SearchBar:YE,SatelliteFieldDetail:Zae,ModalPageSettings:HE,ModalEditFields:R9,ModalInsertFields:q9,ModalMoveFields:oee,Button:gw,ButtonDropdown:mV,ModalShareFields:See},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null,fieldIdsForModal:[],modalEditFieldsVisible:!1,modalSplitFieldVisible:!1,modalCombineFieldsVisible:!1,modalInsertFieldsVisible:!1,modalMoveFieldsVisible:!1,modalShareFieldsVisible:!1,modalShareFieldsData:null,modalRemoveShareFieldsVisible:!1,modalRemoveShareFieldsData:null,fieldStatusTarget:null,fieldStatusField:null,modalCompleteCropYearVisible:!1,modalEditStatusVisible:!1,additionalPageOptions:null}}
1,created(){this.$store.dispatch("activities/subscribe"),this.$store.dispatch("activityTypes/subscribe")},computed:{revalidateProducts(){return{currentCompanies:this.$store.state.auth.currentCompanies,cropYear:Number(this.$store.state.auth.currentProcessOrderName)}},activities(){return this.$store.getters["activities/data"]},activityTypes(){return this.$store.getters["activityTypes/data"]},...(0,C.Se)({satellite:"satellite",fields:"fields/data",crops:"products/crops/data",varieties:"varieties/data"}),loading(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)?this.$store.getters["fields/loading"]||this.$store.getters["customers/loading"]:this.$store.getters["fields/loading"]},fieldStatusFieldIsActiveAndHasHarvestingMeasure(){if(null!=this.fieldStatusField)return this.fieldIdsWithHarvestingMeasure.includes(this.fieldStatusField.id)&&"active"===this.fieldStatusField.status},allSelectedRowsHaveHarvestingMeasuresAndAreActive(){return this.selectedRows.filter((e=>null!=this.fields[e])).every((e=>this.fieldIdsWithHarvestingMeasure.includes(e)&&"active"===this.fields[e].status))},allSelectedRowsFieldStatus(){const e=[...new Set(this.selectedRows.filter((e=>null!=this.fields[e])).map((e=>this.fields[e].status)))];return e.length>1?void 0:e[0]},someSelectedRowsHaveFieldStatusCalculating(){return this.selectedRows.filter((e=>null!=this.fields[e])).some((e=>"calculating"===this.fields[e].status))},editMode(){return!this.loading&&Object.keys(this.fields).length>0&&this.selectedRows.length>0},fieldsForSatellite(){let e=this.selectedRows;return 0===e.length&&(e=this.visibleRows),e.filter((e=>null!=this.fields[e]&&![Z,W,G].includes(this.fields[e].storeStatus))).map((e=>this.fields[e]))},currentFieldIdForSatellite:{get(){return this.$route.params.fieldId},set(e){this.$router.push({name:"fields/record",params:{fieldId:e}})}},recommendCompleteYear(){if(0===this.fields.length||0===this.fieldIdsWithHarvestingMeasure.length)return!1;if(this.selectedRows.length>0)return this.allSelectedRowsHaveHarvestingMeasuresAndAreActive;const e={};return Object.values(this.fields).forEach((({id:t,cropId:i,status:a})=>{"active"===a&&null!=i&&(null==e[i]&&(e[i]=[]),this.fieldIdsWithHarvestingMeasure.includes(t)||e[i].push(t))})),Object.values(e).some((e=>0===e.length))},btnTitleCompleteCropYear(){return 0===this.selectedRows.length||"active"===this.allSelectedRowsFieldStatus?this.$t("Erntejahr abschließen"):"planned"===this.allSelectedRowsFieldStatus?this.$t("Erntejahr beginnen"):this.$t("Erntejahr-Status")},processOrdersReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_PROCESS_ORDER)},fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)},fieldsAdvancedEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELDS_ADVANCED)},exportDisabled(){return!this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EXPORT_FIELD)},fieldIdsWithHarvestingMeasure(){const e=[];return Object.values(this.activities).forEach((t=>{const i=this.activityTypes[t.activityTypeId];i?.roughId===ie.HARVEST&&e.push(t.fieldId)})),e}},watch:{revalidateProducts(){this.$store.dispatch("products/subscribe")},currentFieldIdForSatellite(){this.updateSatelliteState()}},mounted(){window.addEventListener("resize",this.onResize),this.unsubscribeFromStore=this.$store.subscribe((({type:e},t)=>{["fields/loadAll","fields/updateEntries","fields/syncAllFinish"].includes(e)&&this.reloadFieldsWithStatusCalculating(),"satellite/toggleExpand"===e&&(t.satellite.expanded&&this.fieldsForSatellite.length>0&&null==this.currentFieldIdForSatellite?this.$router.push({name:"fields/record",params:{fieldId:this.fieldsForSatellite[0].id}}):this.$router.push({name:"fields"}))})),this.updateSatelliteState(),this.setInitialSatelliteState()},beforeDestroy(){window.removeEventListener("resize",this.onResize),this.unsubscribeFromStore()},methods:{updateAdditionalPageOptions(){if(null==this.$refs.table||0===Object.keys(this.$refs.table.sharedFieldsByFieldId).length)return this.additionalPageOptions=null,this.modalRemoveShareFieldsData=null,void(this.modalShareFieldsData=null);this.modalRemoveShareFieldsData={sharedFieldsByFieldId:this.$refs.table.sharedFieldsByFieldId,sharedFieldsCompaniesById:this.$refs.table.sharedFieldsCompaniesById,sharedFieldsByShareId:this.$refs.table.sharedFieldsByShareId},this.additionalPageOptions=[{key:"ButtonRemoveSharedFields",disabled:!1,onClick:()=>{this.modalRemoveShareFieldsVisible=!0},icon:["far","share-alt"],label:this.$t("Freigaben entfernen")}]},updateSatelliteState(){null!=this.currentFieldIdForSatellite&&this.$store.commit("satellite/setState",{visible:!0,expanded:!0})},async setInitialSatelliteState(){if(!0===this.$store.state.satellite.visible)return;await this.$store.dispatch("fields/subscribe");const e=!0===this.$store.state.navbar.expanded?"(min-width: 1550px
1)":"(min-width: 1400px)";!0===window.matchMedia(e).matches&&Object.keys(this.fields).length>0&&this.$store.commit("satellite/setState",{visible:!0,expanded:!1})},updateSelectedForModal(e){this.selectedRows=e,this.fieldIdsForModal=this.selectedRows},create(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings(),this.modalInsertFieldsVisible=!0},edit(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings(),this.fieldIdsForModal=this.selectedRows,this.modalEditFieldsVisible=!0},editFromContainer(e){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings(),this.fieldIdsForModal=e,this.modalEditFieldsVisible=!0},split(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings(),this.fieldIdsForModal=this.selectedRows,this.modalSplitFieldVisible=!0},combine(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings(),this.fieldIdsForModal=this.selectedRows,this.modalCombineFieldsVisible=!0},importData(){this.$router.push({name:"fields/import"})},async completeCropYear(){0!==this.selectedRows.length?this.modalEditStatusVisible=!0:this.modalCompleteCropYearVisible=!0},urlToFile(e,t,i){return fetch(e).then((e=>e.arrayBuffer())).then((e=>new File([e],t,{type:i})))},async exportSelected(){const{type:e,okay:t}=await this.$refs.modalTableExport.show();if(t)if("xls"===e)this.$refs.table.$refs.table.export(this.selectedRows);else{const t=await jo(e,this.selectedRows),a=await this.urlToFile(`data:text/plain;base64,${t.data.fileBody}`,t.data.fileName,t.data.fileMimeType),{default:n}=await i.e(563).then(i.t.bind(i,75563,23));n(a,t.data.fileName)}},async exportData(){const{type:e,exportFiltered:t,okay:a}=await this.$refs.modalTableExport.show();if(!a)return;let n=[];if(n=t?this.$refs.table.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),"xls"===e)this.$refs.table.$refs.table.export(n);else{const t=await jo(e,n),a=await this.urlToFile(`data:text/plain;base64,${t.data.fileBody}`,t.data.fileName,t.data.fileMimeType),{default:r}=await i.e(563).then(i.t.bind(i,75563,23));r(a,t.data.fileName)}},sendFieldPositions(){const e=this.$t("FARMDOK Feldpositionen"),t=this.$refs.table.selectedRows.map((e=>{const t=this.$refs.table.tableData[e],i=sA.data(t),a=null!=t.cropId&&null!=this.crops[t.cropId]?` (${this.crops[t.cropId].name})`:"",n=null!=t.fieldSize?` (${Bl()(t.fieldSize).format()} ha)`:"",r=null!=t.fieldSize?`${Math.max(Math.round(800*Math.sqrt(t.fieldSize)),3445)}m`:"15z",s="number"===typeof t.lat&&"number"===typeof t.lon?`https://www.google.com/maps/place/${t.lat},${t.lon}/@${t.lat},${t.lon},${r}/data=!3m1!1e3`:this.$t("Keine Feldposition");return`${i}${a}${n}:\n${s}`})).join("\n\n"),i=document.createElement("a");i.href=`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(t)}`,i.target="_blank",i.click()},moveSelected(){this.fieldIdsForModal=this.selectedRows,this.modalMoveFieldsVisible=!0},share(){this.fieldIdsForModal=[...this.selectedRows],this.modalShareFieldsVisible=!0},editShare(e){this.fieldIdsForModal=[e.fieldId],this.modalShareFieldsVisible=!0,this.modalShareFieldsData=e},resetModalShareFieldsdata(){this.modalShareFieldsData=null},restoreFields(){this.$router.push({name:"fields/restore"})},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},reloadFieldsWithStatusCalculating:Xl()((async function(){const e=Object.values(this.fields).filter((({status:e})=>"calculating"===e)).map((({id:e})=>e));e.length<1||await this.$store.dispatch("fields/refreshByIds",e)}),3e4,{maxWait:12e4}),async onClickStatus(e){if(null==e)return this.fieldStatusTarget=null,void(this.fieldStatusField=null);const{target:t,guid:i}=e;if(this.fieldStatusTarget===t)return this.fieldStatusTarget=null,void(this.fieldStatusField=null);this.fieldStatusTarget=null,this.fieldStatusField=null,null!=this.fields[i]&&(await this.$nextTick(),this.fieldStatusTarget=t,this.fieldStatusField=this.fields[i])},onResize(){this.fieldStatusTarget=null,this.fieldStatusField=null},updateSharedFields(e){null!=this.$refs.table&&this.$refs.table.updateSharedFields(e)}}},pne=une,hne=(0,ew.Z)(pne,B7,O7,!1,null,"d2605206",null),mne=hne.exports,fne=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"scroll-y":!0!==e.stepsList[e.stepsCurrent].hasHot,"page-feature-enabled":!e.fieldsReadOnly},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[t("ButtonDropdown",{directives:[{name:"show",rawName:"v-show",value:"fields/import/preview-data"===e.currentStep&&e.selectedRows.length>0,expression:"currentStep === 'fields/import/preview-data' && selectedRows.length > 0"}],staticClass:"mr-2",attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection},on:{click:function(t){e.selectedRows=[]}}}),"fields/import/preview-data"===e.currentStep&&e.usedMappingIsCompanyMapping?t("Button",{staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonImportResetCompanyMapping",disabled:e.fetching,title:e.$t("Import zurücksetzen")},on:{click:e.resetCompanyMapping}}
1):e._e()]},proxy:!0},{key:"middle",fn:function(){return[t("Steps",{attrs:{current:e.stepsCurrent,steps:e.stepsList}})]},proxy:!0},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:"fields/import/preview-data"===e.currentStep&&0===e.selectedRows.length,expression:"currentStep === 'fields/import/preview-data' && selectedRows.length === 0"}],attrs:{type:i?"large":"","search-filter":e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("Button",{attrs:{color:"lightest"},on:{click:e.back}},[e._v(" "+e._s(0===e.stepsCurrent?e.$t("Abbrechen"):e.$t("Zurück"))+" ")]),t("Button",{attrs:{icon:["far","arrow-right"],disabled:!e.importNextEnabled,fetching:e.fetching},on:{click:e.next}},[e._v(" "+e._s(e.buttonNextLabel)+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("RouterView",{ref:"currentStepComponent",attrs:{fields:e.fields,"import-next-enabled":e.importNextEnabled,"import-method":e.importMethod,fetching:e.fetching,"import-data":e.importData,"import-target-company-id":e.importTargetCompanyId,"import-target-process-order-id":e.importTargetProcessOrderId,"selected-rows":e.selectedRows,"visible-rows":e.visibleRows,"filter-string":e.filterString,"manual-mapping":e.manualMapping,"selected-file-group-name":e.selectedFileGroupName},on:{"update:importNextEnabled":function(t){e.importNextEnabled=t},"update:import-next-enabled":function(t){e.importNextEnabled=t},"update:importMethod":function(t){e.importMethod=t},"update:import-method":function(t){e.importMethod=t},"update:fetching":function(t){e.fetching=t},"update:importData":function(t){e.importData=t},"update:import-data":function(t){e.importData=t},"update:importTargetCompanyId":function(t){e.importTargetCompanyId=t},"update:import-target-company-id":function(t){e.importTargetCompanyId=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:manualMapping":function(t){e.manualMapping=t},"update:manual-mapping":function(t){e.manualMapping=t},"update:selectedFileGroupName":function(t){e.selectedFileGroupName=t},"update:selected-file-group-name":function(t){e.selectedFileGroupName=t},back:e.back,next:e.next}})]},proxy:!0}])})},gne=[];ow.vI.add(lw.eFW);var yne={name:"PageFieldsImport",components:{SearchBar:YE,ButtonDropdown:mV,Button:gw,TheContentbar:HL,ThePageSkeleton:$w,Steps:LU},mixins:[D$("currentStepComponent")],data(){let e=null;return 1===this.$store.state.auth.currentCompanies.length&&(e=this.$store.state.auth.currentCompanies[0].id),{importNextEnabled:!1,importMethod:"upload",fetching:!1,importData:null,importTargetCompanyId:e,selectedRows:[],visibleRows:[],filterString:"",manualMapping:{},selectedFileGroupName:null}},computed:{...(0,C.Se)({fields:"fields/data",customers:"customers/data"}),currentStep(){return this.$route.name},availableSteps(){const e=[];return this.useStepChooseMethod&&e.push({name:"fields/import/choose-method",label:this.$t("Datenquelle")}),e.push({name:"fields/import/load-data",label:this.$t("Daten laden")}),this.useStepMapData&&e.push({name:"fields/import/map-data",label:this.$t("Daten")}),e.push({name:"fields/import/preview-data",label:this.$t("Vorschau"),hasHot:!0}),e},stepsCurrent(){let e=0;return this.availableSteps.some(((t,i)=>this.currentStep===t.name&&(e=i,!0))),e},stepsList(){return this.availableSteps.map(((e,t)=>({number:t+1,label:e.label})))},buttonNextLabel(){return"fields/import/preview-data"===this.currentStep?this.$t("Importieren"):this.$t("Weiter")},useStepChooseMethod(){return this.$store.state.auth.currentCompanies.some((e=>e.regionId===ee.AT))},useStepMapData(){return null!=this.importData&&(null==this.importData.mappedData||!Array.isArray(this.importData.mappedData)||0===this.importData.mappedData.length||(!!(Array.isArray(this.importData.mappings)&&this.importData.mappings.length>1)||!(null==this.importData.usedMappingId||!Array.isArray(this.importData.mappings)||!this.importData.mappings.some((e=>e.mapping.id===this.importData.usedMappingId&&"Manual"===e.type)))))},importTargetProcessOrderId(){if(null==this.importTargetCompanyId||null==this.$store.state.auth.currentProcessOrderName)return null;const e=this.$store.getters["auth/processOrderByCompanyIdAndNameAndType"](this.importTargetCompanyId,this.$store.state.auth.currentProcessOrderName);return null!=e?e.id:null},fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)},usedMappingIsCompanyMapping(){return!(null==this.importData||null==this.importData.usedMappingId||!Array.isArray(this.importData.mappings))&&this.importData.mappings.some((({mapping:e,type:t})=>e.id===this.importData.usedMappingId&&"Company"===t))}},mounted(){this.$store.dispatch("fields/subscribe"),this.$store.dispatch("customers/subscribe"),null!=this.$route.params.method?this.importMethod=this.$route.params.method:this.useStepChooseMethod&&(this.importMethod="eAma"),"fields/import"===this.$route.name&&this.$router.replace({...this.availableSteps[0],params:{method:this.importMethod}})},methods:{back(){0!==this.stepsCurrent?this.$router.push({...this.availableSteps[this.stepsCurrent-1],params:{method:this.importMethod}}):this.$router.push({name:"fields"})},async next(){if(null==this.$refs.currentStepComponent)return;let e=!0;"function"===typeof this.$refs.currentStepComponent.next&&(e=await this.$refs.currentStepComponent.next()),e&&this.$router.push({...this.availableSteps[this.stepsCurrent+1],params:{method:this.importMethod}})},async resetCompanyMapping(){this.fetching=!0;const e=await this.$confirm("Der Import für diese Datenquelle wurde eigens für deinen Betrieb eingerichtet. Möchtest du die Einstellungen für genau diese Datenquelle zurücksetzen? Du kannst den Import anschließend erneut durchführen und die Einstellungen nochmals vornehmen.");e?(await l().post(`/admin/rest/field/import_delete_custom_mapping/${this.importData.usedMappingId}`),this.fetching=!1,this.back()):this.fetching=!1}}},vne=yne,bne=(0,ew.Z)(vne,fne,gne,!1,null,"df489ed2",null),wne=bne.exports,Cne=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ThePageSkeleton,{attrs:{"page-feature-title":i.router.currentRoute.meta?.label,"page-feature-enabled":i.currentCompaniesHaveFeature.enabled,"page-feature-visible":i.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[i.sidebarFieldsVisible?t(i.TheContentbar,{scopedSlots:e._u([i.mapFeatureEnabled?{
1key:"left",fn:function({contentbarLarge:a}){return[i.editMode?e._e():t(i.Button,{attrs:{icon:"plus-circle","leading-icon":"",componentNamespaceName:"ButtonAddFields",disabled:i.fieldsReadOnly,tooltipOptions:{boundary:"viewport"}},on:{click:i.addFieldsButtonPressed}},[e._v(" "+e._s(i.t("Felder hinzufügen"))+" ")]),t(i.ButtonDropdown,{directives:[{name:"show",rawName:"v-show",value:i.editMode,expression:"editMode"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:i.t("Auswahl aufheben"),buttons:i.buttonUpdateSelection},on:{click:function(e){i.selectedFields=[]}}}),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:i.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"pencil-alt","leading-icon":"","component-namespace-name":"ButtonEditFields",disabled:i.fieldsReadOnly,title:i.t("Bearbeiten"),"icon-only":!a,"tooltip-options":{boundary:"viewport"}},on:{click:i.edit}}),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:i.editMode,expression:"editMode"}],staticClass:"text-danger",attrs:{color:"lightest",icon:"trash-alt","leading-icon":"","component-namespace-name":"ButtonDeleteFields",disabled:i.fieldsReadOnly,title:i.t("Löschen"),"icon-only":!a,"tooltip-options":{boundary:"viewport"}},on:{click:()=>i.sidebarFields.$refs.table.removeSelectedEntries()}}),t(i.Button,{directives:[{name:"show",rawName:"v-show",value:i.editMode&&i.featureGISObjectsEnabled,expression:"editMode && featureGISObjectsEnabled"}],attrs:{color:"lightest","leading-icon":"","component-namespace-name":"ButtonCheckDistance","icon-only":!a,"tooltip-options":{boundary:"viewport"},title:e.$t("Abstand prüfen")??"",icon:["far","bring-front"]},on:{click:function(e){i.checkDistanceActive=!0}}})]}}:null,{key:"right",fn:function({contentbarLarge:e}){return[t(i.ProcessOrderSwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.CompanySwitch,{staticClass:"ml-4",attrs:{slim:!e}}),t(i.DropdownPageOptions,{directives:[{name:"show",rawName:"v-show",value:!i.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{restoreLabel:i.t("Felder wiederherstellen"),restoreReadOnly:i.fieldsReadOnly,hideExport:!0,hideSettings:!0},on:{restore:i.restoreFields}})]}}],null,!0)}):e._e()]},proxy:!0},i.mapFeatureEnabled?{key:"sidebar",fn:function(){return[t(i.SidebarFields,{directives:[{name:"show",rawName:"v-show",value:i.sidebarFieldsVisible,expression:"sidebarFieldsVisible"}],ref:"sidebarFields",attrs:{tableId:"sidebar-table-fields-map",headlineLabel:"",allowFieldsWithNoContour:"",selectedRows:i.selectedFields},on:{"update:visibleRows":i.onUpdateVisibleFields,"update:selectedRows":e=>i.onUpdateSelectedFields(e,"TABLE")}}),i.createFieldsActive?t(i.CreateFieldsSidebar,{ref:"createFieldsSidebar",attrs:{currentFieldId:i.currentFieldId,newFields:i.newFields,visibleColumns:i.getVisibleColumns(),missingName:i.missingName,missingCompany:i.missingCompany,invalidNewFields:i.invalidNewFields,uniqueNameViolation:i.uniqueNameViolation,errorMessage:i.errorMessage},on:{"update:currentFieldId":i.updateCurrentFieldId,"update:newFields":i.updateNewFields,"update:selectedCompanyId":i.updateSelectedCompanyId,"save:newFields":i.saveNewFields,closeEditMode:i.resetDirtyFormValues,"update:createFieldsCurrentStep":e=>i.createFieldsCurrentStep=e}}):e._e(),i.editFieldsActive?t(i.EditFieldsSidebar,{ref:"editFieldsSidebar",attrs:{fieldIds:i.selectedFields,columns:i.getVisibleColumns(),invalidEditFields:i.invalidEditFields,uniqueNameViolation:i.uniqueNameViolation,errorMessage:i.errorMessage,geoDataChanges:i.geoDataChanges},on:{closeEditMode:i.resetDirtyFormValues,"save:editedFields":i.saveEditFields}}):e._e(),i.checkDistanceActive?t(i.CheckDistanceSidebar,{ref:"checkDistanceSidebar",on:{close:()=>i.checkDistanceActive=!1,"update:distance":e=>i.checkDistance=e}}):e._e(),i.createMapObjectActive||i.editMapObjectActive?t(i.MapObjectsSidebar,{ref:"mapObjectsSidebar",attrs:{currentMapObject:i.currentMapObject,isCreate:i.createMapObjectActive,isEdit:i.editMapObjectActive,objectType:i.currentMapObjectType,geometry:i.currentMapObjectGeometry,companies:i.companies,existingSubLayers:i.isolationZoneSubTypes},on:{onCancel:i.onCancelMapObjects,"update:geoObjectEntry":i.onUpdateMapObject,"save:geoObjectEntry":i.onSaveMapObject,"delete:geoObjectEntry":i.onDeleteMapObject}}
1):e._e(),i.createReportActive?t(i.SidebarCreateReport,{on:{close:()=>i.createReportActive=!1,"export:report":i.exportReport}}):e._e()]},proxy:!0}:null,{key:"content",fn:function(){return[i.loading?t("div",{staticClass:"w-100 h-100 d-flex"},[t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1):e._e(),i.mapFeatureEnabled?t(i.FieldsMapContainer,{ref:"fieldsMapContainer",attrs:{selectedFields:i.selectedFields,visibleFields:i.visibleFields,fields:i.fields,createFieldsActive:i.createFieldsActive,editFieldsActive:i.editFieldsActive,createReportActive:i.createReportActive,newFields:i.newFields,invalidNewFields:i.invalidNewFields,invalidEditFields:i.invalidEditFields,createMapObjectActive:i.createMapObjectActive,editMapObjectActive:i.editMapObjectActive,currentFieldId:i.currentFieldId,geoDataChanges:i.geoDataChanges,selectionSource:i.selectionSource,checkDistance:i.checkDistance,checkDistanceActive:i.checkDistanceActive},on:{"update:selectedFields":e=>i.onUpdateSelectedFields(e,"MAP"),"update:newFields":i.updateNewFields,"update:currentFieldId":i.updateCurrentFieldId,"update:invalidNewFields":e=>i.invalidNewFields=e,"update:splitFieldLineValid":i.splitFieldLineValid,"update:createFieldsActive":i.toggleCreateFieldsActive,"update:editFieldsActive":i.toggleEditFieldsActive,"save:newFields":i.saveNewFields,"save:editFields":function(e){return i.editFieldsSidebar.save()},"menuItem:clicked":i.handleMenuAction,"update:mapObjectPolyline":i.updateMapObjectPolyline,"click:mapObject":i.onMapObjectSelected,"update:createMapObjectActive":i.onCancelMapObjects,"update:editMapObjectActive":i.onCancelMapObjects,"save:mapObject":function(e){return i.mapObjectsSidebar.onSave()},"update:geoDataChanges":e=>i.geoDataChanges=e,"update:invalidEditFields":e=>i.invalidEditFields=e}}):t("div",{staticClass:"feature-not-enabled"},[t(i.FeatureNotAvailable,{attrs:{featureName:i.t("Karte"),featureVisible:i.mapFeatureVisible,addLinkToShop:!0}})],1)]},proxy:!0}],null,!0)})},Fne=[],Ane=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"check-distance-sidebar-wrapper"},[t("div",{staticClass:"check-distance-nav-buttons"},[t(i.Button,{staticClass:"btn-block",attrs:{title:e.$t("Schließen")??"","tooltip-options":{boundary:"viewport"},variant:"primary"},on:{click:()=>i.emit("close")}})],1),t("h1",{staticClass:"check-distance-heading"},[e._v(e._s(e.$t("Abstand prüfen")))]),t("p",[e._v(" "+e._s(e.$t("Wähle ein Feld in der Karte und gib den Prüfabstand ein. Die Feldkontur wird um den Prüfabstand nach außen verschoben und alle Felder gekennzeichnet, die vom Prüfabstand geschnitten werden."))+" ")]),t(i.FormFieldInput,{attrs:{id:"distanceControl",label:e.$t("Prüfstand in m")??"",required:!1,value:i.distance,description:e.$t("Hinweis: die maximale Prüfdistanz beträgt",{maxDistance:"2km"}),max:2e3,min:0,number:"",type:"number",variant:"vertical"},on:{update:i.updateDistance}})],1)},kne=[],Sne=(0,b.defineComponent)({__name:"CheckDistanceSidebar",emits:["update:distance","close"],setup(e,{emit:t}){const i=(0,b.ref)(200);function a(e){i.value=e??0,t("update:distance",i.value)}return{__sfc:!0,distance:i,emit:t,updateDistance:a,Button:gw,FormFieldInput:fk}}}),Ene=Sne,Ine=(0,ew.Z)(Ene,Ane,kne,!1,null,"29efd726",null),_ne=Ine.exports,Dne=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"export-report-sidebar-wrapper"},[t("div",{staticClass:"export-report-nav-buttons"},[t(i.ButtonWithArrow,{staticClass:"mr-1",attrs:{variant:"white",type:"left"},on:{click:i.closeSidebar}},[e._v(" "+e._s(i.$t("Abbrechen"))+" ")]),t(i.ButtonWithArrow,{staticClass:"buttonWithArrowRight",attrs:{variant:"primary",type:"right"},on:{click:i.closeSidebar}},[e._v(" "+e._s(i.$t("Close"))+" ")])],1),t("h1",{staticClass:"create-report-heading"},[e._v(e._s(i.$t("Bericht erstellen")))]),t("p",[e._v(" "+e._s(i.$t('Die Karte auf der rechten Seite zeigt den bedruckbaren Bereich. Du kannst eine Legende erstellen und sie irgendwo im druckbaren Bereich platzieren. Die Legende wird auf der Grundlage der Kulturen erstellt (Du kannst dies mit der Einstellung "Einfärben nach..." im Menü ändern).'))+" ")]),t(i.FormFieldInput,{attrs:{type:"text",required:!1,label:i.$t("Legendentitel"),placeholder:i.$t("Legende"),value:i.reportState.legendTitle,variant:"vertical"},on:{update:i.onUpdateLegendTitle}}),t(i.FormFieldRadioGroup,{attrs:{variant:"vertical",label:i.$t("Seitenausrichtung"),checked:i.reportState.orientation,stacked:!0},on:{change:i.onUpdateOrientation}},[t(i.FormRadio,{attrs:{variant:"default",value:i.Orientation.LANDSCAPE},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(e._s(i.$t("Querformat")))]},proxy:!0}])}),t(i.FormRadio,{attrs:{variant:"default",value:i.Orientation.PORTRAIT},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" "+e._s(i.$t("Hochformat")))]},proxy:!0}])})],1),t("BButton",{staticClass:"btn btn-export",attrs:{variant:"primary"},on:{click:i.exportReport}}
1,[t("span",[e._v(e._s(i.$t("Download")))])])],1)},Mne=[],Pne=(0,b.defineComponent)({__name:"SidebarCreateReport",emits:["close","onUpdateLegendTitle","export:report"],setup(e,{emit:t}){const i=Gb.translate;function a(){t("export:report",{orientation:N3.orientation,legendTitle:""===N3.legendTitle?i("Legend"):N3.legendTitle})}function n(e){N3.legendTitle=e}function r(e){N3.orientation=e}function s(){N3.legendTitle="",N3.orientation=R3.PORTRAIT,t("close")}return{__sfc:!0,$t:i,emit:t,exportReport:a,onUpdateLegendTitle:n,onUpdateOrientation:r,closeSidebar:s,reportState:N3,Orientation:R3,ButtonWithArrow:VK,FormFieldInput:fk,FormFieldRadioGroup:_T,FormRadio:kT}}}),Tne=Pne,xne=(0,ew.Z)(Tne,Dne,Mne,!1,null,"7c457427",null),Bne=xne.exports,One=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"create-fields-sidebar-wrapper"},[t(i.Pagination,{attrs:{pages:2,current:i.currentStep}}),t("div",{staticClass:"create-fields-nav-buttons"},[t(i.ButtonWithArrow,{staticClass:"mr-1",attrs:{variant:"white",type:"left"},on:{click:i.onButtonBack}},[e._v(" "+e._s(0===i.currentStep?i.t("Abbrechen"):i.t("Zurück"))+" ")]),t(i.ButtonWithArrow,{staticClass:"buttonWithArrowRight",attrs:{variant:"primary",type:"right",disabled:e.newFields.length<1||e.invali
1dNewFields.length>0},on:{click:i.onButtonNext}},[e._v(" "+e._s(1===i.currentStep?i.t("Speichern"):i.t("Weiter"))+" ")])],1),0===i.currentStep?t("div",{staticClass:"create-fields-wrapper"},[t("h1",{staticClass:"create-fields-heading"},[e._v(e._s(i.t("Felder hinzufügen")))]),t("div",{staticClass:"create-fields-content"},[e._v(" "+e._s(i.t("Wählen Sie Polygone in der Karte aus, um Felder zu erstellen. Sie können mehrere Polygone zusammenftühren, wenn sie mehrere Polygone zu einem Feld zusammenführen möchten."))+" ")])]):e._e(),1===i.currentStep?t("div",[t(i.FormFieldSetCreateFields,{attrs:{columns:e.visibleColumns,fields:e.newFields,currentFieldId:e.currentFieldId,missingName:e.missingName||e.uniqueNameViolation,missingCompany:e.missingCompany},on:{"update:newFields":i.updateNewFields,"update:currentFieldId":t=>e.$emit("update:currentFieldId",t),"update:selectedCompanyId":t=>e.$emit("update:selectedCompanyId",t)}})],1):e._e(),t("div",{staticClass:"error-message-container text-danger"},[e.uniqueNameViolation?[e._v(" "+e._s(e.errorMessage)+" ")]:e._e(),e.invalidNewFields.length?[e._v(" "+e._s(i.t("Ein oder mehrere Felder haben eine ungültige Kontur")??"")+" ")]:e._e()],2)],1)},$ne=[],Rne=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e.companies.length>1||e.useCustomers?t("FormFieldSet",{attrs:{headline:e.$t("Betrieb")}},[e.companies.length>1?t("FormFieldSelect",{attrs:{required:"",label:e.$t("Betrieb"),options:e.companyOptions,state:!e.missingCompanyState&&null},on:{update:e.onCompanyChanged}}):e._e(),e.useCustomers?t("FormFieldDropdown",{attrs:{required:"",label:e.$t("Kunde"),value:e.customerValueForDropdown,items:e.customersToDropdownItems,"items-loading":e.$store.state.customers.fetching},on:{update:t=>e.customerId=t.id}}):e._e()],1):e._e(),e._l(e.fields,(function(i,a){return t("FormFieldSet",{key:i.id,staticClass:"form-field-set-edit-fields",attrs:{collapsible:"",collapsed:e.currentFieldId!==i.id,headline:e.fieldSetHeadline(i)},on:{update:t=>e.updateFormFieldCollapsed(i,t)}},[t("FormFieldInput",{attrs:{label:e.$t("Feldstück Nr"),placeholder:e.$t("Feldstück Nr"),disabled:e.fetching},model:{value:i["fieldGroup.mfa"],callback:function(t){e.$set(i,"fieldGroup.mfa",t)},expression:"field['fieldGroup.mfa']"}}),null!=e.columnsByKey.fieldNumber&&e.columnsByKey.fieldNumber.visible?t("FormFieldInput",{attrs:{label:e.$t("Feld Nr"),placeholder:e.$t("Feld Nr"),disabled:e.fetching},model:{value:i.fieldNumber,callback:function(t){e.$set(i,"fieldNumber",t)},expression:"field.fieldNumber"}}):e._e(),e.useCustomers?t("FormFieldDropdown",{attrs:{label:e.$t("Kunde"),value:e.customerValueForDropdown,items:e.customersToDropdownItems,"items-loading":e.$store.state.customers.fetching,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("fieldGroup.customerId",t.id)}}):e._e(),t("FormFieldInput",{attrs:{required:"",label:e.$t("Bezeichnung"),placeholder:e.$t("Pflichtfeld"),disabled:e.fetching,state:(!e.missingNameState||e.currentFieldId!==i.id)&&null},on:{update:e.updateFieldName},model:{value:i.name,callback:function(t){e.$set(i,"name",t)},expression:"field.name"}}),t("FormFieldInput",{attrs:{type:"number",placeholder:"0",step:"0.01",label:e.$t("Größe (in ha)"),disabled:e.fetching},on:{blur:function(t){i.fieldSize=e.fieldSizeDecimals(i.fieldSize)}},model:{value:i.fieldSize,callback:function(t){e.$set(i,"fieldSize",t)},expression:"field.fieldSize"}}),t("FormFieldDropdown",{ref:"crop",refInFor:!0,attrs:{label:e.$t("Kultur"),value:e.cropValueForDropdown(i),items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("cropId",t.id,a),open:function(t){return e.onOpenDropdown({action:"products/crops/subscribe",ref:"crop"})}}}),null!=i.cropId&&e.showCopyCropToAllFields?t("div",{staticClass:"copy-crop-button-wrapper"},[t("BButton",{staticClass:"modal-insert-fields__button-copy-crop",attrs:{variant:"outline-primary",size:"sm"},on:{click:function(t){return e.copyCropToAllFields(i)}}},[e._v(" "+e._s(e.$t("Kultur für alle Felder übernehmen"))+" ")])],1):e._e(
1),null!=e.columnsByKey.varietyId&&e.columnsByKey.varietyId.visible?t("FormFieldDropdown",{ref:"variety",refInFor:!0,attrs:{label:e.$t("Sorte"),value:e.varietyValueForDropdown(i),items:e.varietiesToDropdownItems,"items-loading":e.$store.state.varieties.fetching,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("varietyId",t.id,a),open:function(t){return e.onOpenDropdown({action:"varieties/subscribe",ref:"variety"})}}}):e._e(),null!=e.columnsByKey.preCropId&&e.columnsByKey.preCropId.visible?t("FormFieldDropdown",{ref:"preCrop",refInFor:!0,attrs:{label:e.$t("Vorfrucht"),value:e.preCropValueForDropdown(i),items:e.cropsToDropdownItems,"items-loading":e.$store.state.products.crops.fetching,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("preCropId",t.id,a),open:function(t){return e.onOpenDropdown({action:"products/crops/subscribe",ref:"preCrop"})}}}):e._e(),null!=e.columnsByKey.catchcropVariant&&e.columnsByKey.catchcropVariant.visible?t("FormFieldDropdown",{ref:"catchcrop",refInFor:!0,attrs:{label:e.$t("Begrünung (Zwischenfrucht)"),value:e.catchcropValueForDropdown(i),items:e.catchcropDropdownItems,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("catchcropVariant",t.id,a),open:function(t){return e.onOpenDropdown({ref:"cat
1chcrop"})}}}):e._e(),null!=e.columnsByKey.kindofuse&&e.columnsByKey.kindofuse.visible?t("FormFieldDropdown",{ref:"kindOfUse",refInFor:!0,attrs:{label:e.$t("Nutzungsart"),value:e.kindOfUseValueForDropdown(i),items:e.kindOfUseDropdownItems,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("kindofuse",t.id,a),open:function(t){return e.onOpenDropdown({ref:"kindOfUse"})}}}):e._e(),null!=e.columnsByKey.comment&&e.columnsByKey.comment.visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("comment",i),label:e.$t("Kommentar"),placeholder:e.$t("Kommentar"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("comment",t,a)}}):e._e(),null!=e.columnsByKey.amaCode&&e.columnsByKey.amaCode.visible?t("FormFieldDropdown",{ref:"amaCode",refInFor:!0,attrs:{label:e.$t("AMA Code"),value:e.amaCodeValueForDropdown(i),items:e.amaCodeDropdownItems,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("amaCode",t.id,a),open:function(t){return e.onOpenDropdown({ref:"amaCode"})}}}):e._e(),null!=e.columnsByKey["additionalData.cadastralCommunity"]&&e.columnsByKey["additionalData.cadastralCommunity"].visible?t("FormFieldInput",{attrs:{value:i.additionalData.cadastralCommunity,label:e.$t("Gemeinde"),placeholder:e.$t("Gemeinde"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.cadastralCommunity",t,a)}}):e._e(),null!=e.columnsByKey["additionalData.plots"]&&e.columnsByKey["additionalData.plots"].visible?t("FormFieldInput",{attrs:{value:i.additionalData.plots,label:e.$t("Parzellen Nr."),placeholder:e.$t("Parzellen Nr."),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.plots",t,a)}}):e._e(),null!=e.columnsByKey["additionalData.owner"]&&e.columnsByKey["additionalData.owner"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.owner",i),label:e.$t("Eigentümer"),placeholder:e.$t("Eigentümer"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.owner",t,a)}}):e._e(),null!=e.columnsByKey["additionalData.rightOfUse"]&&e.columnsByKey["additionalData.rightOfUse"].visible?t("FormFieldInput",{attrs:{value:e.getFormFieldValue("additionalData.rightOfUse",i),label:e.$t("Nutzung durch"),placeholder:e.$t("Nutzung durch"),disabled:e.fetching},on:{update:t=>e.setFormFieldValue("additionalData.rightOfUse",t,a)}}):e._e(),null!=e.columnsByKey.gwArea&&e.columnsByKey.gwArea.visible?t("FormFieldDropdown",{ref:"gwArea",refInFor:!0,attrs:{label:e.$t("GW-Gebiet"),value:e.gwAreaValueForDropdown(i),items:e.gwAreaDropdownItems,disabled:e.fetching},on:{update:t=>e.setFormFieldValue("gwArea",t.id,a),open:function(t){return e.onOpenDropdown({ref:"gwArea"})}}}):e._e()],1)}))],2)},Nne=[];ow.vI.add(a_.KtF);var zne=(0,b.defineComponent)({name:"FormFieldSetCreateFields",components:{FormFieldDropdown:lk,FormFieldInput:fk,FormFieldSet:_k,FormFieldSelect:n9},mixins:[lI,g9,ED,y9],props:{fields:{type:Array,default:()=>[]},columns:{type:Array,default:null,validator(e){return null==e||!!Array.isArray(e)&&e.every((e=>null!=e&&"string"===typeof e.key&&"boolean"===typeof e.visible))}},missingName:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},currentFieldId:{type:String,default:null},missingCompany:{type:Boolean,default:!1}},data(){return{showAdditionalData:!1,companyId:null,customerId:"own",missingCompanyState:!1,missingNameState:!1}},mounted(){this.missingCompanyState=this.missingCompany,this.missingNameState=this.missingName},watch:{missingName(e){this.missingNameState=e},missingCompany(e){this.missingCompanyState=e}},computed:{columnsByKey(){return null==this.columns?{}:this.columns.reduce(((e,t)=>({...e,[t.key]:t})),{})},useCustomers(){return null!=this.customers&&(null!=this.columnsByKey[tA.key]&&this.columnsByKey[tA.key].visible&&Object.keys(this.customers).length>0)},customersToDropdownItems(){return[{id:"own-company",items:[{id:"own",name:this.$t("Eigener Betrieb")}],sort:!1},{name:this.$t("Kunden"),id:"customers",items:Object.values(this.customers),sort:!0}]},gwAreaDropdownItems(){return this.dropdownItemsForFieldsGetItems(kD)},catchcropDropdownItems(){return this.dropdownItemsForFieldsGetItems(FD)},kindOfUseDropdownItems(){return this.dropdownItemsForFieldsGetItems(CD)},amaCodeDropdownItems(){return this.dropdownItemsForFieldsGetItems(AD)},companies(){return this.$store.state.auth.currentCompanies},companyOptions(){return[{value:null,text:this.$t("Betrieb wählen"),disabled:!0},...this.companies.map((e=>({value:e.id,text:e.name})))]}},methods:{updateFieldName(e){e&&(this.missingNameState=!1)},onCompanyChanged(e){e&&(this.missingCompanyState=!1),this.$emit("update:selectedCompanyId",e)},copyCropToAllFields(e){const t=this.fields.map((t=>({...t,cropId:e.cropId}
1)));this.$emit("update:newFields",t)},updateFormFieldCollapsed(e,t){t?t&&this.currentFieldId===e.id&&this.$emit("update:currentFieldId",null):this.$emit("update:currentFieldId",e.id)},customerValueForDropdown(e){let t=null;if(null!=e["fieldGroup.customerId"]&&(t=e["fieldGroup.customerId"]),t){if(null!=this.customers[t])return{id:t,name:this.customers[t].name};if("own"===t)return{id:"own",name:this.$t("Eigener Betrieb")}}return{id:null,name:""}},cropValueForDropdown(e){return null!=e.cropId&&null!=this.crops[e.cropId]?{id:e.cropId,name:this.crops[e.cropId].name}:(Object.prototype.hasOwnProperty.call(e,"cropId"),{id:null,name:""})},varietyValueForDropdown(e){return null!=e.varietyId&&null!=this.varieties[e.varietyId]?{id:e.varietyId,name:this.varieties[e.varietyId].name}:(Object.prototype.hasOwnProperty.call(e,"varietyId"),{id:null,name:""})},preCropValueForDropdown(e){return null!=e.preCropId&&null!=this.crops[e.preCropId]?{id:e.preCropId,name:this.crops[e.preCropId].name}:(Object.prototype.hasOwnProperty.call(e,"preCropId"),{id:null,name:""})},catchcropValueForDropdown(e){return null!=e.catchcropVariant&&null!=this.catchCropVariantsById[e.catchcropVariant]?this.catchCropVariantsById[e.catchcropVariant]:{id:null,name:""}},kindOfUseValueForDropdown(e){return null!=e&&null!=this.kindOfUseTypesById[e.kindofuse]?this.kindOfUseTypesById[e.kindofuse]:{id:null,name:""}},amaCodeValueForDropdown(e){return null!=e.amaCode&&null!=this.amaCodesById[e.amaCode]?this.amaCodesById[e.amaCode]:{id:null,name:""}},gwAreaValueForDropdown(e){return null!=e.gwArea&&null!=this.gwAreasById[e.gwArea]?this.gwAreasById[e.gwArea]:{id:null,name:""}},fieldSetHeadline(e){return"string"===typeof e.name&&e.name.length>0?e.name:e.placeholderName},getFormFieldValue(e,t){return null!=t[e]?t[e]:null},setFormFieldValue(e,t,i){const a=[...this.fields];a[i][e]=t,this.$emit("update:newFields",a)},roundFieldSize(e){if(null==this.fields[e].fieldSize)return;const t=[...this.fields];t[e]={...t[e],fieldSize:+this.fieldSizeDecimals(`${t[e].fieldSize}`)},this.$emit("update:newFields",t)},onOpenDropdown({action:e,ref:t}){"string"===typeof e&&this.$store.dispatch(e),this.$emit("openDropdown",this.$refs[t])}}}),Lne=zne,Vne=(0,ew.Z)(Lne,Rne,Nne,!1,null,"571c8f09",null),Une=Vne.exports,jne=(0,b.defineComponent)({__name:"CreateFieldsSidebar",props:{currentFieldId:null,newFields:null,invalidNewFields:null,errorMessage:null,visibleColumns:null,missingName:{type:Boolean},missingCompany:{type:Boolean},uniqueNameViolation:{type:Boolean}},emits:["update:createFieldsCurrentStep","update:newFields","update:currentFieldId","update:selectedCompanyId","closeEditMode","save:newFields"],setup(e,{emit:t}){const i=Gb.translate,a=(0,b.ref)(0);function n(e){t("update:newFields",e)}function r(){0===a.value?t("closeEditMode"):1===a.value&&(a.value=0)}function s(){0===a.value?a.value=1:1===a.value&&t("save:newFields")}return(0,b.watch)(a,(e=>t("update:createFieldsCurrentStep",e))),{__sfc:!0,t:i,currentStep:a,emit:t,updateNewFields:n,onButtonBack:r,onButtonNext:s,Pagination:qk,ButtonWithArrow:VK,FormFieldSetCreateFields:Une}}}),Hne=jne,Gne=(0,ew.Z)(Hne,One,$ne,!1,null,"095f9c4d",null),Wne=Gne.exports,Zne=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"edit-fields-sidebar-wrapper"},[t("div",{staticClass:"create-fields-nav-buttons"},[t(i.ButtonWithArrow,{staticClass:"mr-1",attrs:{variant:"white",type:"left"},on:{click:i.closeEditMode}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]),t(i.ButtonWithArrow,{staticClass:"buttonWithArrowRight",attrs:{variant:"primary",type:"right",disabled:e.invalidEditFields.length>0||0===Object.keys(i.changes).length&&0===Object.keys(e.geoDataChanges).length},on:{click:i.save}},[e._v(" "+e._s(e.$t("Speichern"))+" ")])],1),t("h1",{staticClass:"edit-fields-heading"},[e._v(e._s(e.$t("Felder bearbeiten")))]),t(i.FormFieldSetEditFields,{attrs:{columns:e.columns,fields:i.fields,changes:i.changes,missingName:i.missingName,uniqueNameViolation:e.uniqueNameViolation},on:{update:e=>i.changes=e}}),t("div",{staticClass:"error-message-container text-danger"},[e.uniqueNameViolation?[e._v(" "+e._s(e.errorMessage)+" ")]:e._e(
1),e.invalidEditFields.length?[e._v(" "+e._s(e.$t("Ein oder mehrere Felder haben eine ungültige Kontur")??"")+" ")]:e._e()],2)],1)},Kne=[],qne=(0,b.defineComponent)({__name:"EditFieldsSidebar",props:{fieldIds:null,columns:null,invalidEditFields:null,errorMessage:null,uniqueNameViolation:{type:Boolean},geoDataChanges:null},emits:["closeEditMode","save:editedFields"],setup(e,{expose:t,emit:i}){const a=e,n=(0,b.computed)((()=>a.fieldIds.map((e=>Lb.state.fields.data[e])))),r=(0,b.ref)({}),s=(0,b.ref)(null);function o(){a.invalidEditFields.length>0||("string"!==typeof r.value.name||0!==r.value.name.length?i("save:editedFields",a.fieldIds,r.value):s.value=!0)}function l(){r.value={},i("closeEditMode")}return t({save:o}),{__sfc:!0,props:a,fields:n,changes:r,missingName:s,emit:i,save:o,closeEditMode:l,ButtonWithArrow:VK,FormFieldSetEditFields:C9}}}),Yne=qne,Jne=(0,ew.Z)(Yne,Zne,Kne,!1,null,"67b394d8",null),Xne=Jne.exports,Qne=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{staticClass:"isolation-zone-sidebar-wrapper"},[t("div",{staticClass:"create-fields-nav-buttons"},[t(i.ButtonWithArrow,{staticClass:"mr-1",attrs:{variant:"white",type:"left"},on:{click:i.onCancel}},[e._v(" "+e._s(i.$t("Abbrechen"))+" ")]),t(i.ButtonWithArrow,{staticClass:"buttonWithArrowRight",attrs:{variant:"primary",type:"right"},on:{click:i.onSave}},[e._v(" "+e._s(i.$t("Speichern"))+" ")])],1),t("div",[t("h1",{staticClass:"create-isolation-zones-header"},[e._v(e._s(i.titleString))]),t("div",{staticClass:"create-isolation-zones-content"},[e._v(" "+e._s(i.$t("Zeichnen Sie Polygone oder Linien in die Karte, um Ihr GIS-Objekt darzustellen."))+" ")])]),t("div",[e.companies.length>1?t(i.FormFieldSet,{attrs:{headline:i.$t("Betrieb")}},[e.companies.length>1?t(i.FormFieldSelect,{attrs:{required:!0,state:!i.missingCompany&&null,value:i.companyId,label:i.$t("Betrieb"),options:[{value:null,text:i.$t("Betrieb wählen"),disabled:!0},...e.companies.map((e=>({value:e.id,text:e.name})))]},on:{update:i.updateCompanyId}}):e._e()],1):e._e(),t(i.FormFieldSet,{attrs:{collapsible:!0,headline:i.geoObject.properties.name?i.geoObject.properties.name:"new map object"}},[t(i.FormFieldInput,{attrs:{label:i.$t("Bezeichnung")},model:{value:i.geoObject.properties.name,callback:function(t){e.$set(i.geoObject.properties,"name",t)},expression:"geoObject.properties.name"}}),i.props.objectType===i.GeoObjectType.IsolationZone?t(i.FormFieldInput,{attrs:{type:"number",label:i.$t("Mindestabstand")},model:{value:i.geoObject.properties.width,callback:function(t){e.$set(i.geoObject.properties,"width",t)},expression:"geoObject.properties.width"}}):e._e(),e.objectType===i.GeoObjectType.IsolationZone?t(i.FormFieldInput,{attrs:{label:i.$t("Unterebene"),dataList:e.existingSubLayers,dataListId:"mapobjects-sublayer-datalist",autocomplete:"off"},model:{value:i.geoObject.objectSubType,callback:function(t){e.$set(i.geoObject,"objectSubType",t)},expression:"geoObject.objectSubType"}}
1):e._e()],1),i.props.currentMapObject?t(i.ButtonLink,{attrs:{color:"red",icon:"trash-alt","leading-icon":""},on:{click:i.onDelete}},[e._v(" "+e._s(i.props.objectType===i.GeoObjectType.IsolationZone?i.$t("Isolationszone löschen"):i.$t("Vermehrungsgemeinschaft löschen"))+" ")]):e._e()],1)])},ere=[],tre=(0,b.defineComponent)({__name:"MapObjectsSidebar",props:{currentMapObject:null,objectType:null,geometry:null,companies:null,existingSubLayers:null},emits:["onCancel","update:geoObjectEntry","save:geoObjectEntry","delete:geoObjectEntry"],setup(e,{expose:t,emit:i}){const a=e,n=Gb.translate,r=(0,b.ref)({id:ma(),objectType:a.objectType===vt.IsolationZone?vt.IsolationZone:vt.MultiplierGroup,properties:{name:"",width:0},objectSubType:""}),s=(0,b.ref)(),o=(0,b.ref)(null);(0,b.onMounted)((()=>{a.currentMapObject&&(r.value={...a.currentMapObject}),r.value.processOrderId&&(s.value=a.companies.find((e=>e.processOrderId===r.value.processOrderId))?.id)}));const l=(0,b.computed)((()=>{switch(a.objectType){case vt.IsolationZone:return null===a.currentMapObject?n("Isolationszone erstellen"):n("Isolationszone bearbeiten");case vt.MultiplierGroup:return null===a.currentMapObject?n("Vermehrungsgemeinschaft erstellen"):n("Vermehrungsgemeinschaft bearbeiten");default:return""}}));function d(){if(a.companies.length>1&&!s.value)o.value=!0;else{if(a.geometry&&(r.value.geometry=a.geometry),a.companies.length>1){const e=a.companies.find((e=>e.id===s.value));if(!e)throw new Error(`company with id ${s.value} not found!`);r.value.processOrderId=e.processOrderId}else r.value.processOrderId=a.companies[0].processOrderId;a.currentMapObject?i("update:geoObjectEntry",{entry:r.value}):i("save:geoObjectEntry",{entry:r.value}),u()}}function c(){i("delete:geoObjectEntry",{entry:r.value}),u()}function u(){i("onCancel")}function p(e){s.value=e,o.value=!1}return t({onSave:d}),{__sfc:!0,$t:n,props:a,geoObject:r,companyId:s,missingCompany:o,titleString:l,onSave:d,onDelete:c,onCancel:u,updateCompanyId:p,emit:i,GeoObjectType:vt,ButtonLink:Fw,ButtonWithArrow:VK,FormFieldInput:fk,FormFieldSelect:n9,FormFieldSet:_k}}}),ire=tre,are=(0,ew.Z)(ire,Qne,ere,!1,null,"6c8f318d",null),nre=are.exports,rre=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FieldsMap",{ref:"fieldsMap",attrs:{crops:e.crops,varieties:e.varieties,companies:e.companies,customers:e.customers,activities:e.activities,activityTypes:e.activityTypes,activeFields:e.activeFields,defaultFields:e.defaultFields,editableFields:e.editableFields,disabledFields:e.disabledFields,splitFieldEnabled:e.splitFieldEnabled,splitFieldLineValid:e.splitFieldLineValid,reCenterOnFieldUpdate:e.reCenterOnFieldUpdate,hoverEffectsEnabled:!0,showMenu:!0,initialCenterIncludeDisabled:!0,featureFieldsNDVIMeanEnabled:e.featureFieldsNDVIMeanEnabled,featureLandCadastresEnabled:e.featureLandCadastresEnabled,featureGISObjectsEnabled:e.featureGISObjectsEnabled,landCadastres:e.landCadastres,fieldUtilization:e.fieldUtilization,insertEnabled:e.createFieldsActive&&!e.splitFieldEnabled,selectionSource:e.selectionSource,newFieldsSize:e.newFieldsSize,newFields:e.newFields,invalidNewFields:e.invalidNewFields,invalidEditFields:e.invalidEditFields,createFieldsActive:e.createFieldsActive,editFieldsActive:e.editFieldsActive,createReportActive:e.createReportActive,createMapObjectActive:e.createMapObjectActive,editMapObjectActive:e.editMapObjectActive,geoObjects:e.geoObjects,currentMapObjectType:e.currentMapObjectType,captureRegionOrientation:e.reportState.orientation,checkDistanceActive:e.checkDistanceActive,bufferFields:e.bufferFields,fieldsToWarn:e.fieldsToWarn},on:{"click:polygon":e.onPolygonClicked,loadActivities:e.loadActivities,loadNdvi:function(t){e.ndviRequested=!0},loadMbi:function(t){e.mbiRequested=!0},"update:bounds":e.loadLandCadastres,"update:fieldUtilization":e.loadFieldUtilization,insert:e.insert,addPolygon:e.addPolygon,"change:polygon":e.changePolygon,"change:marker":e.changeMarker,"change:fieldName":e.changeFieldName,"combine:polygons":e.combinePolygons,"click:marker":t=>e.currentField=t,"action:save":e.fieldSave,"action:removePolygon":e.onRemovePolygon,"action:discard":e.fieldDiscard,"click:layerPolygon":e.handleFeatureClick,"polygon:complete":e.polygonComplete,"update:splitFieldEnabled":e.updateSplitFieldEnabled,"update:newFieldPolygons":e.updateNewFieldPolygons,"update:createFieldsActive":t=>e.$emit("update:createFieldsActive",t),"update:editFieldsActive":t=>e.$emit("update:editFieldsActive",t),"action:split":e.split,"update:splitFieldLineValid":t=>e.splitFieldLineValid=t,"save:newFields":()=>
1e.$emit("save:newFields"),"save:editFields":()=>e.$emit("save:editFields"),"menuItem:clicked":t=>e.$emit("menuItem:clicked",t),"update:mapObjectPolyline":t=>e.$emit("update:mapObjectPolyline",t),"click:mapObject":t=>e.$emit("click:mapObject",t),"update:createMapObjectActive":t=>e.$emit("update:createMapObjectActive",t),"update:editMapObjectActive":t=>e.$emit("update:editMapObjectActive",t),"save:mapObject":()=>e.$emit("save:mapObject")}})},sre=[],ore=i(26916),lre=i(56615),dre=(0,b.defineComponent)({name:"FieldsMapContainer",components:{FieldsMap:b7},props:{selectedFields:{type:Array,required:!0},visibleFields:{type:Array,required:!0},fields:{type:Object,required:!0},createFieldsActive:{type:Boolean,default:!1},editFieldsActive:{type:Boolean,default:!1},createReportActive:{type:Boolean,default:!1},newFields:{type:Array,default:()=>[]},invalidNewFields:{type:Array,default:()=>[]},invalidEditFields:{type:Array,default:()=>[]},createMapObjectActive:{type:Boolean,default:!1},editMapObjectActive:{type:Boolean,default:!1},currentFieldId:{type:String,default:null},geoDataChanges:{type:Object,default:()=>{}},selectionSource:{type:String,default:"MAP"},checkDistance:{type:Number,default:200},checkDistanceActive:{type:Boolean,default:!1}},data(){return{reportState:N3,landCadastres:{},fieldUtilization:{},loadedBoundingBoxLandCadastres:null,loadedBoundingBoxFieldUtilization:null,cadastresLoading:!1,fieldUtilizationLoading:!1,reCenterOnFieldUpdate:!0,splitFieldEnabled:!1,splitFieldLineValid:!1,newFieldA:null,newFieldB:null,ndviRequested:!1,mbiRequested:!1}},async created(){this.$store.dispatch("varieties/subscribe"),this.$store.dispatch("products/crops/subscribe")},methods:{updateSplitFieldEnabled(e){this.splitFieldEnabled=e},split(){const e=[this.newFieldA,this.newFieldB];this.$emit("update:newFields",e),this.splitFieldEnabled=!1},updateNewFieldPolygons({geoJsonA:e,geoJsonB:t}){this.newFieldA=this.getNewFieldForGeoJson(e),this.newFieldB=this.getNewFieldForGeoJson(t)},getNewFieldForGeoJson(e){const[t,i]=e.coordinates[0].reduce((([e,t],[i,a])=>[e+i,t+a]),[0,0]),a=Math.floor((0,Y6.Z)(e))/1e4;return{...this.newFields[0],id:ma(),lon:t/e.coordinates[0].length,lat:i/e.coordinates[0].length,fieldContour:{geoJson:e,area:a},fieldSize:a}},async loadActivities(){await this.$store.dispatch("activities/subscribe"),await this.$store.dispatch("activityTypes/subscribe")},onPolygonClicked(e){if(null==this.disabledFields[e]&&!this.createReportActive)if(this.createFieldsActive||this.editFieldsActive)this.$emit("update:currentFieldId",e);else{const t=[...this.selectedFields],i=t.indexOf(e);-1!==i?t.splice(i,1):t.push(e),this.$emit("update:selectedFields",t)}},async loadNdvi(e){this.featureFieldsNDVIMeanEnabled&&!this.loadingNdvi&&this.$store.dispatch("fields/loadNdvi",e)},async loadMbi(e){this.featureFieldsNDVIMeanEnabled&&!this.loadingMbi&&this.$store.dispatch("fields/loadMbi",e)},async loadFieldUtilization(e){if(!e)return;if(this.fieldUtilizationLoading)return;if(this.isBoundsCovered(e,this.loadedBoundingBoxFieldUtilization))return;Object.values(this.fieldUtilization).length>1e3&&(this.fieldUtilization={},this.loadedBoundingBoxFieldUtilization=null);const t=e.toJSON(),i=[t.east,t.north,t.west,t.south],{mapApi:a}=this.$api;this.fieldUtilizationLoading=!0;const n=await a.mapLayerFieldUtilization({bbox:`[${i}]`});if("success"===n.data.status){this.loadedBoundingBoxFieldUtilization=e;const t=n.data.data,i={};t.forEach((e=>{i[e.id]=e})),this.fieldUtilization=i,this.fieldUtilizationLoading=!1}},async loadLandCadastres(e){if(!e||!this.featureLandCadastresEnabled)return;if(this.cadastresLoading)return;if(this.isBoundsCovered(e,this.loadedBoundingBoxLandCadastres))return;const t=e.toJSON(),i=[t.east,t.north,t.west,t.south],{mapApi:a}=this.$api;this.cadastresLoading=!0;const n=await a.mapLayerLandCadastre({bbox:`[${i}]`});if("success"===n.data.status){this.loadedBoundingBoxLandCadastres=e;const t=n.data.data,i={};t.forEach((e=>{i[e.id]=e})),this.landCadastres=i}this.cadastresLoading=!1},isBoundsCovered(e,t){if(t){const i=e.getNorthEast(),a=e.getSouthWest
1(),n=t.getNorthEast(),r=t.getSouthWest();return i.lat()<=n.lat()&&i.lng()<=n.lng()&&a.lat()>=r.lat()&&a.lng()>=r.lng()}return!1},insert(e){let t=null,i=null;null!=e.fieldContour&&(i=Math.floor((0,Y6.Z)(e.fieldContour.geoJson))/1e4,t={...e.fieldContour});const a=ma(),n={...e,"fieldGroup.mfa":"",name:"",fieldSize:i,cropId:null,id:a,fieldContour:t,placeholderName:this.$t("Feld {number}",{number:this.newFields.length+1})},r=[...this.newFields,n],s=f4(t.geoJson.coordinates);s?this.invalidNewFields.some((t=>t.id===e.id))&&this.$emit("update:invalidNewFields",this.invalidNewFields.filter((t=>t.id!==e.id))):this.$emit("update:invalidNewFields",[...this.invalidNewFields,n]),this.$emit("update:newFields",r),this.$emit("update:currentFieldId",a)},addPolygon(e){let t=null,i=null;null!=e.fieldContour&&(i=Math.floor((0,Y6.Z)(e.fieldContour.geoJson))/1e4,t={...e.fieldContour,id:fa(oe,e.id)});const a=f4(t.geoJson.coordinates);a?this.$emit("update:invalidEditFields",this.invalidEditFields.filter((t=>t.id!==e.id))):this.$emit("update:invalidEditFields",[...this.invalidEditFields,e]);const n={...this.geoDataChanges};null==n[e.id]?this.$emit("update:geoDataChanges",{...this.geoDataChanges,[e.id]:{fieldContour:t,fieldSize:i}}):(n[e.id]={fieldContour:t,fieldSize:i},this.$emit("update:geoDataChanges",n))},changePolygon({fieldContour:e,fieldId:t}){if(this.createFieldsActive){const i=Math.floor((0,Y6.Z)(e.geoJson))/1e4,a=this.newFields.map((a=>{if(a.id!==t)return a;const n=f4(e.geoJson.coordinates);return n?this.invalidNewFields.some((e=>e.id===a.id))&&this.$emit("update:invalidNewFields",this.invalidNewFields.filter((e=>e.id!==a.id))):this.$emit("update:invalidNewFields",[...this.invalidNewFields,a]),{...a,fieldSize:i,fieldContour:{...a.fieldContour,geoJson:e.geoJson,contourSize:i}}}));this.$emit("update:newFields",a)}else if(this.editFieldsActive){const i=Math.floor((0,Y6.Z)(e.geoJson))/1e4,a=f4(e.geoJson.coordinates),n=this.fields[t];a?this.$emit("update:invalidEditFields",this.invalidEditFields.filter((e=>e.id!==t))):this.$emit("update:invalidEditFields",[...this.invalidEditFields,n]);const r={...n.fieldContour,geoJson:e.geoJson,contourSize:i,tstamp:Math.floor((new Date).getTime()/1e3)},s={...this.geoDataChanges};null==s[t]?this.$emit("update:geoDataChanges",{...this.geoDataChanges,[t]:{fieldContour:r,fieldSize:i}}):(s[t]={fieldContour:r,fieldSize:i},this.$emit("update:geoDataChanges",s))}},changeMarker({lat:e,lon:t,fieldId:i}){if(this.createFieldsActive){const a=this.newFields.map((a=>a.id!==i?a:{...a,lat:e,lon:t}));this.$emit("update:newFields",a)}else if(this.editFieldsActive){const a={...this.geoDataChanges};null===a[i]?this.$emit("update:geoDataChanges",{...this.geoDataChanges,[i]:{lat:e,lon:t}}):(a[i]={lat:e,lon:t},this.$emit("update:geoDataChanges",a))}},changeFieldName({fieldId:e,name:t}){const i=this.newFields.map((i=>i.id!==e?i:{...i,name:t}));this.$emit("update:newFields",i)},fieldSave(e){this.currentFieldId===e&&this.$emit("update:currentFieldId",null)},onRemovePolygon(e){if(this.createFieldsActive){const t=this.newFields.map((t=>t.id!==e?t:{...t,fieldContour:null}));this.$emit("update:newFields",t)}else if(this.editFieldsActive){const t=this.fields[e],i={...this.geoDataChanges};null==i[e]?this.$emit("update:geoDataChanges",{...this.geoDataChanges,[e]:{fieldContour:null,fieldSize:null}}):(i[e]={fieldContour:null,fieldSize:null},this.$emit("update:geoDataChanges",i)),this.$emit("update:invalidEditFields",[...this.invalidEditFields,t])}},fieldDiscard(e){this.currentFieldId===e&&this.$emit("update:currentFieldId",null);const t=this.newFields.filter((t=>t.id!==e)).map(((e,t)=>({...e,placeholderName:this.$t("Feld {number}",{number:t+1})})));this.$emit("update:newFields",t),this.$emit("update:invalidNewFields",this.invalidNewFields.filter((t=>t.id!==e)))},handleFeatureClick({feature:e,latLng:t,data:i}){if(this.createFieldsActive){const a=i[e.getId()];if(a){const e={geoJson:a.geometry},i={lat:t.lat(),lon:t.lng(),fieldContour:e,additionalData:{cadastralCommunity:"cadastralMunicipality"in a?a.cadastralMunicipality:"",plots:"parcelNumber"in a?a.parcelNumber:""}};this.insert(i)}}}
1,polygonComplete(e){const t={},i=new google.maps.LatLngBounds,a=[];e.getPath().getArray().forEach((e=>{i.extend(e),a.push([e.lng(),e.lat()])})),t.fieldContour={geoJson:{coordinates:[a],type:"Polygon"}};const n=i.getCenter();t.lat=n.lat(),t.lon=n.lng(),this.insert(t)},combinePolygons(){const e=Object.values(this.newFields).filter((({fieldContour:e})=>null!=e)).filter((({fieldContour:e})=>null!=e.geoJson)).filter((({fieldContour:e})=>"Polygon"===e.geoJson.type)).map((({fieldContour:e,additionalData:t})=>lre.yue(e.geoJson.coordinates,{plots:t?t.plots.split(", "):[],cadastralCommunity:t?t.cadastralCommunity.split(", "):[]})));if(0===e.length)return;let t=e.reduce(((e,t)=>{if(null==e)return t;const i=[...e.properties.plots,...t.properties.plots],a=[...e.properties.cadastralCommunity,...t.properties.cadastralCommunity];return(0,z7.Z)(e,t,{properties:{plots:i,cadastralCommunity:a}})}),null);if(t&&"Polygon"!==t.geometry.type){const{properties:e}=t;t=(0,N7.Z)(t.geometry,{properties:t?.properties}),t&&(t.properties=e)}if(!t||"Polygon"!==t.geometry.type)return;const[i,a]=t.geometry.coordinates[0].reduce((([e,t],[i,a])=>[e+i,t+a]),[0,0]),n=Math.floor((0,Y6.Z)(t.geometry))/1e4,r={...this.newFields[0],id:ma(),lon:i/t.geometry.coordinates[0].length,lat:a/t.geometry.coordinates[0].length,fieldContour:{geoJson:t.geometry,area:n,tstamp:Math.floor((new Date).valueOf()/1e3)},additionalData:{plots:t.properties.plots.filter(hH).join(", "),cadastralCommunity:t.properties.cadastralCommunity.filter(hH).join(", ")},fieldSize:n};this.$emit("update:newFields",[r])},intersectionWithFieldBuffers(e){return this.bufferFeatures.some((t=>(0,ore.Z)(e,t)))}},computed:{...(0,C.rn)("fields",{loadingNdvi(e){return e.loadingNdvi},loadingMbi(e){return e.loadingMbi}}),pendingNdvi(){return this.ndviRequested?Object.values(this.fields).filter((e=>void 0===e.ndvi)):[]},pendingMbi(){return this.mbiRequested?Object.values(this.fields).filter((e=>void 0===e.mbi)):[]},...(0,C.rn)("geoObjects",{currentMapObjectType(e){return e.currentObjectType},geoObjects:e=>{const{hiddenIsolationZoneSubLayers:t}=e;return Object.values(e.data).reduce(((e,i)=>i.objectSubType&&t.includes(i.objectSubType)?e:{...e,[i.id]:i}),{})}}),newFieldsSize(){return this.newFields.reduce(((e,t)=>e+t.fieldSize),0)},fieldsVisible(){return this.visibleFields.reduce(((e,t)=>{const i=this.fields[t];return i?{...e,[t]:this.fields[t]}:e}),{})},activeFields(){if(this.editFieldsActive)return this.selectedFields.filter((e=>this.currentFieldId!==e)).reduce(((e,t)=>({...e,[t]:this.fields[t]})),{});if(!this.createFieldsActive){const e=this.selectedFields.filter((e=>this.visibleFields.includes(e)));return e.reduce(((e,t)=>{const i=this.fields[t];return i?{...e,[t]:this.fields[t]}:e}),{})}return this.newFields.filter((e=>e.id!==this.currentFieldId)).reduce(((e,t)=>({...e,[t.id]:t})),{})},defaultFields(){if(!this.createFieldsActive){const e=new Set(Object.keys(this.activeFields)),t=new Set(Object.keys(this.editableFields));return Object.values(this.fieldsVisible).reduce(((i,a)=>e.has(a.id)||t.has(a.id)?i:{...i,[a.id]:a}),{})}return{}},disabledFields(){if(this.createFieldsActive){const e=new Set(Object.keys(this.activeFields));return Object.values(this.fieldsVisible).reduce(((t,i)=>e.has(i.id)?t:{...t,[i.id]:i}),{})}if(this.editFieldsActive){const e=new Set(Object.keys(this.activeFields)),t=new Set(Object.keys(this.editableFields));return Object.values(this.fieldsVisible).reduce(((i,a)=>e.has(a.id)||t.has(a.id)?i:{...i,[a.id]:a}),{})}return{}},editableFields(){return this.editFieldsActive&&this.currentFieldId?{[this.currentFieldId]:{...this.fields[this.currentFieldId],...null!=this.geoDataChanges[this.currentFieldId]?this.geoDataChanges[this.currentFieldId]:{}}}:this.newFields.filter((e=>e.id===this.currentFieldId)).reduce(((e,t)=>({...e,[t.id]:t})),{})},companies(){return this.$store.state.auth.currentCompanies},customers(){return this.$store.state.customers.data},varieties(){return this.$store.state.varieties.data},crops(){return this.$store.state.products.crops.data},activities(){return this.$store.state.activities.data},activityTypes(){return this.$store.state.activityTypes.data},featureFieldsNDVIMeanEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELDS_NDVI_MEAN)&&this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_FIELDS_NDVI_MEAN)},featureLandCadastresEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MAP_LAND_CADASTRE)&&this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP_LAND_CADASTRE)},featureGISObjectsEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MAP_GEO_OBJECTS)&&this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP_GEO_OBJECTS)},bufferFeatures(){return this.selectedFields.map((e=>this.$store.state.fields.data[e])).map((e=>e?.fieldContour?.geometry)).filter(ka).flatMap((e=>e.coordinates)).map((e=>lre.TuJ(e))).map((e=>lre.f3b(e,this.checkDistance,{units:"meters"}))).filter(ka)},bufferFields(){return this.bufferFeatures.flatMap((e=>e.geometry.coordinates)).map(E3)},fieldsToWarn(){return Object.values(this.fieldUtilization).map((e=>e.geometry)).filter(this.intersectionWithFieldBuffers).flatMap((e=>e.coordinates)).map(E3)}},watch:{selectedFields(e,t){this.reCenterOnFieldUpdate||e.length===t.length||(this.reCenterOnFieldUpdate=!0)},newFields(){this.$emit("update:newFields",this.newFields)},createFieldsActive(e){e?this.reCenterOnFieldUpdate=!1:(this.landCadastres={},this.fieldUtilization={},this.$emit("update:currentFieldId",null))},editFieldsActive(e){e&&(this.reCenterOnFieldUpdate=!1)},splitFieldLineValid(e){this.$emit("update:splitFieldLineValid",e)},pendingNdvi(e){this.loadNdvi(e)},pendingMbi(e){this.loadMbi(e)}}}),cre=dre,ure=(0,ew.Z)(cre,rre,sre,!1,null,"0ea8b558",null),pre=ure.exports,hre=(0,b.defineComponent)({__name:"PageFieldsMap",setup(e){ow.vI.add(yF.AX7),ow.vI.add(lw.XQV);const t=Gb.translate,i=Vb(),a=(0,NL.tv)(),n=(0,b.ref)(null),r=(0,b.ref)(null),s=(0,b.ref)(null),o=(0,b.ref)(null),l=(0,b.ref)([]),d=(0,b.ref)([]),c=(0,b.ref)([{text:t("Auswahl aufheben"),handler:()=>n.value.$refs.table.$refs.table.selectableRowsBatchAction("clear")},{text:t("Auswahl umkehren"),handler:()=>n.value.$refs.table.$refs.table.selectableRowsBatchAction("reverse")}
1,{text:t("Alle auswählen"),handler:()=>n.value.$refs.table.$refs.table.selectableRowsBatchAction("all")}]),u=(0,b.ref)(!1),p=(0,b.ref)(!1),h=(0,b.ref)(null),m=(0,b.ref)(null),f=(0,b.ref)([]),g=(0,b.ref)({}),y=(0,b.ref)([]),v=(0,b.ref)([]),w=(0,b.ref)(null),C=(0,b.ref)(0),F=(0,b.ref)(null),A=(0,b.ref)(!1),k=(0,b.ref)(!1),S=(0,b.ref)(!1),E=(0,b.ref)(null),I=(0,b.ref)(!1),_=(0,b.ref)("MAP"),D=(0,b.ref)(!1),M=(0,b.ref)(200);(0,b.onMounted)((()=>{i.dispatch("fields/subscribe"),ye()}));const P=(0,b.computed)((()=>i.state.geoObjects.isCreateActive)),T=(0,b.computed)((()=>i.state.geoObjects.isEditActive)),x=(0,b.computed)((()=>!u.value&&!p.value&&!P.value&&!T.value&&!I.value&&!D.value)),B=(0,b.computed)((()=>i.state.geoObjects.currentObjectType)),O=(0,b.computed)((()=>h.value?i.getters["geoObjects/getById"](h.value):null)),$=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MAP_GEO_OBJECTS)&&i.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP_GEO_OBJECTS))),R=(0,b.computed)((()=>i.state.fields.data)),N=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeature(Hr.FEATURE_FIELDS))),z=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS))),L=(0,b.computed)((()=>i.getters["fields/loading"])),V=(0,b.computed)((()=>!L.value&&Object.keys(R.value).length>0&&l.value.length>0)),U=(0,b.computed)((()=>i.state.auth.currentCompanies)),j=(0,b.computed)((()=>i.state.auth.currentProcessOrderName)),H=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_MAP)&&i.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP))),G=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_MAP))),W=(0,b.computed)((()=>i.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELD_NAMES_UNIQUE))),Z=(0,b.computed)((()=>i.getters["geoObjects/getIsolationZoneSubTypes"].map((e=>e.name))));function K(e){u.value=e,e||me()}function q(e){p.value=e,e||me()}async function Y(e,a){if(A.value=!1,k.value=!1,S.value=!1,w.value="",v.value.length>0)return;const n={...a};if(n.name&&W.value){if(e.length>1)return S.value=!0,void(w.value=t("Felder dürfen nicht die gleichen Namen enthalten.")??"");const a=i.getters["fields/isUniqueFieldName"](n.name);if(a)return S.value=!0,void(w.value=t("Ein Feld mit diesem Namen existiert bereits.")??"")}e.forEach((async e=>{if(0===Object.values(n).length&&null==g.value[e])return;if(n.cropId){const t=i.getters["fields/getById"](e),a=i.getters["auth/getCompanyByProcessOrderId"](t.processOrderId),r=i.getters["products/getProductOrSibling"](n.cropId,a.id);n.cropId=r.id}const t={...n,...null!=g.value[e]?g.value[e]:{},id:e};"own"===n["fieldGroup.customerId"]&&(t["fieldGroup.customerId"]=null),await i.dispatch("fields/updateAndSyncEntry",{entry:t}),me()}))}function J(e){i.dispatch("geoObjects/updateAndSyncEntry",e)}function X(e){i.dispatch("geoObjects/insertAndSyncNewEntry",e)}function Q(e){i.dispatch("geoObjects/removeAndSyncEntry",e)}async function ee(e){const t=await i.getters["geoObjects/getById"](e);i.dispatch("geoObjects/setCurrentObjectType",t.objectType),h.value=e,i.dispatch("geoObjects/setIsEditActive",!0)}async function te(e){e!==s4.CREATE_REPORT?(i.dispatch("geoObjects/toggleIsCreateActive",!0),i.dispatch("geoObjects/setCurrentObjectType",re(e))):I.value=!0}function ie(e){E.value=e}function ae(){h.value=null,i.dispatch("geoObjects/setIsCreateActive",!1),i.dispatch("geoObjects/setIsEditActive",!1),r.value.$refs.fieldsMap.drawMapObjects(!0)}function ne(){return n.value.$refs.table.$refs.table.getVisibleColumns()}function re(e){switch(e){case s4.ISOLATION_ZONES:return vt.IsolationZone;case s4.MULTIPLIER_GROUPS:return vt.MultiplierGroup;default:throw new Error("Unknown menu item type")}}function se(){A.value=!1,k.value=!1,S.value=!1,w.value="";const e=0===C.value;U.value.length>1&&null==F.value&&(A.value=!0);const a=f.value.some((e=>!("string"===typeof e.name&&e.name.length>0)&&(pe(e.id),!0)));if(a&&!e&&(k.value=!0),!k.value&&!A.value){if(W.value){const e=f.value.some((e=>!!i.getters["fields/isUniqueFieldName"](e.name)&&(pe(e.id),!0)));if(e)return S.value=!0,void(w.value=t("Ein Feld mit diesem Namen existiert bereits.")??"")}f.value.forEach((t=>{const a={...t};U.value.length>1&&(a["processOrder.companyId"]=F.value),e&&(a.name=t.placeholderName),i.dispatch("fields/insertAndSyncNewEntry",{entry:a})})),me()}}function oe(){a.push({name:"fields/restore"})}function le(e){d.value=e}function de(e,t){_.value=t,l.value=e}function ce(){u.value=!0}function ue(e){f.value=e,w.value=""}function pe(e){m.value=e}function he(e){F.value=e,e&&(A.value=!1)}async function me(){l.value=[],f.value=[],g.value={},m.value=null,F.value=null,u.value=!1,p.value=!1,v.value=[],y.value=[],w.value=""}
1function fe(e){w.value=void 0===e||e?"":t("Die aktuelle Trennlinie ist ungültig. Zeichne eine Linie die das aktuelle Feld in genau zwei Teile teilt. Du kannst die Trennlinie durch Ziehen der Eckpunkte anpassen.")??""}function ge(){p.value=!0,1===l.value.length&&([m.value]=l.value)}function ye(){i.dispatch("geoObjects/subscribe")}async function ve(e){await r.value.$refs.fieldsMap.printMap(e)}return(0,b.watch)(U,(()=>ye())),(0,b.watch)(j,(()=>ye())),{__sfc:!0,t:t,store:i,router:a,sidebarFields:n,fieldsMapContainer:r,editFieldsSidebar:s,mapObjectsSidebar:o,selectedFields:l,visibleFields:d,buttonUpdateSelection:c,createFieldsActive:u,editFieldsActive:p,currentMapObjectId:h,currentFieldId:m,newFields:f,geoDataChanges:g,invalidNewFields:y,invalidEditFields:v,errorMessage:w,createFieldsCurrentStep:C,companyId:F,missingCompany:A,missingName:k,uniqueNameViolation:S,currentMapObjectGeometry:E,createReportActive:I,selectionSource:_,checkDistanceActive:D,checkDistance:M,createMapObjectActive:P,editMapObjectActive:T,sidebarFieldsVisible:x,currentMapObjectType:B,currentMapObject:O,featureGISObjectsEnabled:$,fields:R,currentCompaniesHaveFeature:N,fieldsReadOnly:z,loading:L,editMode:V,companies:U,processOrderName:j,mapFeatureEnabled:H,mapFeatureVisible:G,requireUniqueFieldName:W,isolationZoneSubTypes:Z,toggleCreateFieldsActive:K,toggleEditFieldsActive:q,saveEditFields:Y,onUpdateMapObject:J,onSaveMapObject:X,onDeleteMapObject:Q,onMapObjectSelected:ee,handleMenuAction:te,updateMapObjectPolyline:ie,onCancelMapObjects:ae,getVisibleColumns:ne,getMapObjectType:re,saveNewFields:se,restoreFields:oe,onUpdateVisibleFields:le,onUpdateSelectedFields:de,addFieldsButtonPressed:ce,updateNewFields:ue,updateCurrentFieldId:pe,updateSelectedCompanyId:he,resetDirtyFormValues:me,splitFieldLineValid:fe,edit:ge,fetchGeoObjects:ye,exportReport:ve,CheckDistanceSidebar:_ne,TheContentbar:HL,ThePageSkeleton:$w,SidebarCreateReport:Bne,CompanySwitch:qw,DropdownPageOptions:YL,FeatureNotAvailable:Ew,ProcessOrderSwitch:lV,Button:gw,ButtonDropdown:mV,CreateFieldsSidebar:Wne,EditFieldsSidebar:Xne,MapObjectsSidebar:nre,SidebarFields:QD,FieldsMapContainer:pre}}}),mre=hre,fre=(0,ew.Z)(mre,Cne,Fne,!1,null,"fe7aaa58",null),gre=fre.exports,yre=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-enabled":!e.fieldsReadOnly},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[t("ButtonDropdown",{directives:[{name:"show",rawName:"v-show",value:e.selectedRows.length>0,expression:"selectedRows.length > 0"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonsUpdateSelection},on:{click:function(t){e.selectedRows=[]}}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"mr-1",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("Button",{attrs:{color:"lightest","component-namespace-name":"ButtonClose"},on:{click:e.back}},[e._v(" "+e._s(e.$t("Schließen"))+" ")]),t("Button",{attrs:{color:"primary","component-namespace-name":"ButtonRestore",fetching:e.restoring,disabled:e.fieldsReadOnly},on:{click:e.restore}},[e._v(" "+e._s(e.$t("Wiederherstellen"))+" ")])]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableFieldsRestoreContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t}}})]},proxy:!0}])})},vre=[],bre=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",attrs:{"disable-read-only-bg":"","read-only":"",id:e.id,"filter-string":e.filterString,"
1selected-rows":e.selectedRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),reload:e.loadData},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])})},wre=[];const Cre=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...pF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,sortOrder:"desc"},{...XF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{...IF,hiddenPerDefault:!0,lockedPosition:!0,readOnly:!0},{...EF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{..._F,readOnly:!0},{...DF,readOnly:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],Fre=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...pF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,sortOrder:"desc"},{...XF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{...IF,lockedPosition:!0,readOnly:!0},{...EF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{..._F,readOnly:!0},{...DF,readOnly:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],Are=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...pF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,sortOrder:"desc"},{...XF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{...IF,lockedPosition:!0,readOnly:!0},{...EF,lockedVisibility:!0,lockedPosition:!0,readOnly:!0},{..._F,readOnly:!0},{...DF,readOnly:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var kre={international:Cre,[ee.AT]:Fre,[ee.DE]:Are},Sre={name:"TableFieldsRestoreContainer",components:{TableFooter:hD,TableBase:oD},props:{filterString:{type:String,default:""}},mixins:[gD,E1,rI(XF.key),dI({[DF.key]:"crop"}),oI],data(){return{columnDefinition:kre}},computed:{id(){return["hot-fields-restore",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},currentProcessOrderIds(){return this.$store.getters["auth/currentProcessOrderIds"]}},watch:{currentProcessOrderIds(){this.loadData()}},created(){this.loadData()},methods:{loadData(){const e=g()().startOf("day").subtract({days:90});if(!this.currentProcessOrderIds||0===this.currentProcessOrderIds.length)return;const t=["AND",["processOrderId","IN",this.currentProcessOrderIds],["deleted",">=",Math.round(e/1e3)]];this.loadTableData(`/admin/rest/field?showDeleted=1&disablePagination=1&filter=${Ro(t)}&resolve=${Ro(ud)}`)},async restore(){const e=[...this.selectedRows];try{await Promise.all([...new Array(Math.ceil(e.length/50)).keys()].map((t=>{const i=50*t,a=50*(t+1),n=["id","IN",e.slice(i,a)];return l().put(`/admin/rest/field/undelete/?filter=${Ro(n)}`)}))),await this.$store.dispatch("fields/reset"),await this.$store.dispatch("fields/subscribe"),await this.$store.dispatch("fields/recentlyRestoredSetByGuids",e)}catch(t){return console.error(t),this.addErrorsAfterRestore(e),!1}return!0},addErrorsAfterRestore(e){this.tableErrors=[...this.tableErrors,...e.map((e=>({type:J,guid:e,key:null,errorUserMessage:this.$t("Das Feld konnte nicht wieder hergestellt werden.")})))]}}},Ere=Sre,Ire=(0,ew.Z)(Ere,bre,wre,!1,null,"612923c2",null),_re=Ire.exports,Dre={name:"PageFieldsRestore",components:{TheContentbar:HL,ThePageSkeleton:$w,SearchBar:YE,TableFieldsRestoreContainer:_re,Button:gw,ButtonDropdown:mV},data(){return{filterString:"",selectedRows:[],visibleRows:[],buttonsUpdateSelection:[{text:this.$t("Auswahl aufheben"),handler:()=>this.$refs.table.$refs.table.selectableRowsBatchAction("clear")},{text:this.$t("Auswahl umkehren"),handler:()=>this.$refs.table.$refs.table.selectableRowsBatchAction("reverse")}
1,{text:this.$t("Alle auswählen"),handler:()=>this.$refs.table.$refs.table.selectableRowsBatchAction("all")}],restoring:!1}},computed:{fieldsReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_FIELDS)}},methods:{back(){this.$router.go(-1)},async restore(){this.restoring=!0;const e=await this.$refs.table.restore();this.restoring=!1,e&&this.back()}}},Mre=Dre,Pre=(0,ew.Z)(Mre,yre,vre,!1,null,"4909b902",null),Tre=Pre.exports,xre=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible,multiCompany:e.multipleCompaniesSelected},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function({contentbarLarge:i}){return[t("ButtonDropdown",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{outline:"","component-namespace-name":"ButtonRemoveSelection",boundary:"viewport",text:e.$t("Auswahl aufheben"),buttons:e.buttonUpdateSelection},on:{click:function(t){e.selectedRows=[]}}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"cloud-download","leading-icon":"","component-namespace-name":"ButtonExportFields",disabled:e.exportDisabled,title:e.$t("Auswahl exportieren"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.exportSelected}}),t("Button",{directives:[{name:"show",rawName:"v-show",value:e.editMode,expression:"editMode"}],attrs:{color:"lightest",icon:"paper-plane","leading-icon":"","component-namespace-name":"ButtonSendFieldPositions",disabled:e.exportDisabled,title:e.$t("Positionen senden"),"icon-only":!i,"tooltip-options":{boundary:"viewport"}},on:{click:e.sendFieldPositions}})]}},{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ProcessOrderSwitch",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!i}}),t("CompanySwitch",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{slim:!i}}),t("DropdownPageOptions",{directives:[{name:"show",rawName:"v-show",value:!e.editMode,expression:"!editMode"}],staticClass:"ml-4",attrs:{"restore-label":e.$t("Felder wiederherstellen"),restoreReadOnly:"","export-disabled":e.exportDisabled,"additional-options":e.additionalPageOptions},on:{settings:e.showSettings,export:e.exportData}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("TableSharedFieldsContainer",{ref:"table",attrs:{filterString:e.filterString,selectedRows:e.selectedRows,visibleRows:e.visibleRows,"field-ids-with-harvesting-measure":e.fieldIdsWithHarvestingMeasure},on:{"update:filterString":function(t){e.filterString=t},"update:filter-string":function(t){e.filterString=t},"update:selectedRows":function(t){e.selectedRows=t},"update:selected-rows":function(t){e.selectedRows=t},"update:visibleRows":function(t){e.visibleRows=t},"update:visible-rows":function(t){e.visibleRows=t},"click:status":e.onClickStatus}}),t("ModalPageSettings",{ref:"modalPageSettings",attrs:{columns:e.columnsForPageSettings}}),t("ModalTableExport",{ref:"modalTableExport",attrs:{title:e.selectedRows.length>0?e.$t("Selektierte Felder exportieren"):null,filtered:0===e.selectedRows.length&&null!=e.$refs.table&&!e.$refs.table.allVisible}})]},proxy:!0},{key:"satellite",fn:function(){return[t("SatelliteSharedFieldDetail",{directives:[{name:"show",rawName:"v-show",value:e.satellite.visible,expression:"satellite.visible"}],attrs:{loading:e.loading,visible:e.satellite.visible,expanded:e.satellite.expanded,"visible-fields":e.visibleRows.filter((t=>null!=e.sharedFields[t])).map((t=>e.sharedFields[t])),"selected-fields":e.fieldsForSatellite,"current-field-id":e.currentFieldIdForSatellite,crops:e.crops,varieties:e.varieties,activityTypes:e.activityTypes},on:{"update:currentFieldId":function(t){e.currentFieldIdForSatellite=t},"update:current-field-id":function(t){e.currentFieldIdForSatellite=t}}})]},proxy:!0},{key:"featureNotEnabled",fn:function(){return[t("MaxWidthContainer",{attrs:{left:"",size:"xl"}},[t("FeatureNotAvailable",{attrs:{featureName:e.$t("Freigegebene Felder")}})],1)]},proxy:!0},{key:"noMultiCompanySupport",fn:function(){return[t("PageNoMultiCompanySupport")]},proxy:!0}])})},Bre=[],Ore=function(){var e=this,t=e._self._c;return t("TheSatellite",{attrs:{empty:e.empty,expanded:e.expanded,title:e.$t("Schlagblatt")},scopedSlots:e._u([e.expanded?{key:"header-title",fn:function(){return[t("h2",{staticClass:"d-inline-block mr-5"},["string"===typeof e.labelCurrentField&&e.labelCurrentField.length>0?t("span",{staticClass:"font-weight-normal",domProps:{innerHTML:e._s(e.$t("Schlagblatt für {fieldName}",{fieldName:`<strong>${e.labelCurrentField}</strong>`}))}}):t("span",{domProps:{innerHTML:e._s(e.$t("Schlagblatt"))}})])]},proxy:!0}:null,e.expanded?{key:"header-center",fn:function(){return[t("div",{staticClass:"position-relative satellite-field-detail__prev-next-navigation"},[t("ButtonLink",{staticClass:"satellite-field-detail__center-button satellite-field-detail__center-button--left",attrs:{color:"black",disabled:null==e.previousField},on:{click:function(t){return e.$emit("update:currentFieldId",e.previousField.id)}}},[e._v(" "+e._s(e.labelPreviousField)+" ")]),t("div",[t("ButtonBorderedIcon",{attrs:{icon:["far","chevron-left"],disabled:null==e.previousField},on:{click:function(t){return e.$emit("update:currentFieldId",e.previousField.id)}}}),t("ButtonBorderedIcon",{attrs:{icon:["far","chevron-right"],disabled:null==e.nextField},on:{click:function(t){return e.$emit("update:currentFieldId",e.nextField.id)}}}
1)],1),t("ButtonLink",{staticClass:"satellite-field-detail__center-button satellite-field-detail__center-button--right",attrs:{color:"black",disabled:null==e.nextField},on:{click:function(t){return e.$emit("update:currentFieldId",e.nextField.id)}}},[e._v(" "+e._s(e.labelNextField)+" ")])],1)]},proxy:!0}:null,e.expanded?{key:"header-buttons",fn:function(){return[t("div",{staticClass:"satellite-field-detail__page-actions"},[t("ButtonBorderedIcon",{attrs:{title:e.$t("Seite drucken"),icon:["far","print"]},on:{click:e.printPage}})],1)]},proxy:!0}:null,e.expanded?null:{key:"default",fn:function(){return[t("WidgetMap",{attrs:{visible:e.visible,expanded:e.expanded,"visible-fields":e.visibleFields,"selected-fields":e.selectedFields,crops:e.crops,varieties:e.varieties}}),1===e.selectedFields.length?t("WidgetCustomer",{attrs:{expanded:e.expanded,"selected-fields":e.selectedFields,customers:e.customers}}):e._e(),1===e.selectedFields.length?t("WidgetActivities",{attrs:{selectedFields:[e.selectedFields[0]],activityTypes:e.activityTypes,activities:e.activities,activitiesFetching:e.activitiesFetching,units:e.units,findProductStorageDropdownItem:e.findProductStorageDropdownItem}}):e._e(),1===e.selectedFields.length?t("WidgetCropRotation",{attrs:{expanded:e.expanded,"selected-field":e.selectedFields[0],isSharedField:!0}}):e._e(),1===e.selectedFields.length?t("WidgetNotes",{attrs:{expanded:e.expanded,selectedFields:[e.selectedFields[0]],notes:e.sharedNotes,notesFetching:e.sharedNotesFetching}}):e._e(),e.selectedFields.length>1?t("WidgetCropRatio",{attrs:{fields:e.selectedFields,"crops-by-id":e.crops,"varieties-by-id":e.varieties}}):e._e(),e.selectedFields.length>1?t("WidgetKPIs",{attrs:{"selected-fields":e.selectedFields,kindOfUseTypes:e.kindOfUseTypes}}):e._e()]},proxy:!0},{key:"expanded-area",fn:function(){return[e.loading?t("div",{staticClass:"w-100 mb-5 bg-lightest",staticStyle:{height:"calc(40 * var(--vh, 1vh))"}}):e._e(),e.loading?t("div",{staticClass:"d-flex w-100",staticStyle:{height:"calc(40 * var(--vh, 1vh))"}},[t("div",{staticClass:"mr-5 flex-grow-1 bg-lightest"}),t("div",{staticClass:"flex-grow-1 bg-lightest"})]):e._e(),t("WidgetMap",{attrs:{visible:e.visible,expanded:e.expanded,"visible-fields":e.fieldsForExpandedMode,"selected-fields":null!=e.currentField?[e.currentField]:[],crops:e.crops,varieties:e.varieties}}),null!=e.currentField?t("WidgetActivities",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],activityTypes:e.sharedActivityTypes,activities:e.activities,activitiesFetching:e.activitiesFetching,units:e.units,isSharedField:!0,findProductStorageDropdownItem:e.findProductStorageDropdownItem}}):e._e(),t("div",{staticClass:"satellite-field-detail__column-container"},[t("div",{staticClass:"satellite-field-detail__column"},[null!=e.currentField?t("WidgetCustomer",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],customers:e.customers}}):e._e(),null!=e.currentField?t("WidgetCropRotation",{attrs:{expanded:e.expanded,"selected-field":e.currentField,isSharedField:!0}}):e._e(),null!=e.currentField?t("WidgetNotes",{attrs:{expanded:e.expanded,selectedFields:[e.currentField],notes:e.sharedNotes,notesFetching:e.sharedNotesFetching}}):e._e()],1),t("div",{staticClass:"satellite-field-detail__column"},[null!=e.currentField?t("WidgetNutrientBalance",{attrs:{selectedFields:[e.currentField],isSharedField:!0}}):e._e(),null!=e.currentField?t("Widget",{staticClass:"widget-weather-info"},[t("WeatherInfo",{attrs:{variant:"widget",selectedField:e.currentField,navigationDate:e.navigationDate},on:{"update:navigationDate":t=>e.navigationDate=t}})],1):e._e()],1)]),null!=e.currentField?t("WidgetSoilSamples",{attrs:{"selected-field":e.currentField,isSharedField:!0}}):e._e()]},proxy:!0},{key:"empty",fn:function(){return[t("div",{staticClass:"field-detail__message-empty"},[e._v(" "+e._s(e.$t("Keine Einträge vorhanden."))+" ")])]},proxy:!0}],null,!0)})},$re=[];ow.vI.add(lw.wf8,lw.EfQ,lw.nNP,lw.A35,lw._tD);var Rre={name:"SatelliteSharedFieldDetail",components:{ButtonLink:Fw,WidgetKPIs:eae,WidgetCropRatio:Mie,ButtonBorderedIcon:ste,TheSatellite:Kee,WidgetNutrientBalance:Pae,WeatherInfo:aie,WidgetCropRotation:Uie,WidgetMap:sae,WidgetActivities:Cie,Widget
1Notes:vae,Widget:ete,WidgetSoilSamples:jae,WidgetCustomer:Kie},props:{loading:{type:Boolean,default:!1},selectedFields:{type:Array,required:!1,default:()=>[]},visibleFields:{type:Array,required:!1,default:()=>[]},currentFieldId:{type:String,default:null},visible:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1},crops:{type:Object,default:()=>({})},varieties:{type:Object,default:()=>({})},activityTypes:{type:Object,default:()=>({})}},data(){return{navigationDate:new Date}},created(){this.$store.dispatch("sharedActivityTypes/subscribe"),this.$store.dispatch("activities/sharedActivities/subscribe"),this.$store.dispatch("units/subscribe"),this.currentCompanyHasFeatureNotes.enabled&&this.currentCompanyHasFeatureNotes.visible&&this.$store.dispatch("sharedNotes/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.$store.dispatch("products/subscribe")},computed:{...(0,C.Se)({units:"units/data",customers:"customers/data",sharedActivityTypes:"sharedActivityTypes/data",activities:"activities/sharedActivities/data",activitiesFetching:"activities/sharedActivities/fetching",sharedNotes:"sharedNotes/data",sharedNotesFetching:"sharedNotes/fetching",kindOfUseTypes:"fields/kindOfUseTypes",findProductStorageDropdownItem:"products/dropdownItem"}),currentCompanyHasFeatureNotes(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_NOTES)},empty(){return!this.loading&&(0===this.selectedFields.length||!(!this.expanded||null!=this.currentField))},fieldsForExpandedMode(){return 1===this.selectedFields.length&&this.visibleFields.length>1?this.visibleFields:this.selectedFields},currentField(){let e=null;return this.fieldsForExpandedMode.some((t=>t.id===this.currentFieldId&&(e=t,!0))),e},labelCurrentField(){return sA.data(this.currentField)},previousField(){let e=null;return this.fieldsForExpandedMode.some(((t,i)=>t.id===this.currentFieldId&&(null!=this.fieldsForExpandedMode[i-1]&&(e=this.fieldsForExpandedMode[i-1]),!0))),e},labelPreviousField(){return null==this.previousField?this.$t("Kein weiteres Feld"):sA.data(this.previousField)},nextField(){let e=null;return this.fieldsForExpandedMode.some(((t,i)=>t.id===this.currentFieldId&&(null!=this.fieldsForExpandedMode[i+1]&&(e=this.fieldsForExpandedMode[i+1]),!0))),e},labelNextField(){return null==this.nextField?this.$t("Kein weiteres Feld"):sA.data(this.nextField)}},watch:{visibleFields(){this.currentCompanyHasFeatureNotes.enabled&&this.currentCompanyHasFeatureNotes.visible&&this.$store.dispatch("notes/subscribe"),this.$store.dispatch("sharedActivityTypes/subscribe"),this.$store.dispatch("activities/subscribe"),this.$store.dispatch("units/subscribe")}},methods:{printPage(){window.print()}}},Nre=Rre,zre=(0,ew.Z)(Nre,Ore,$re,!1,null,"37a9309a",null),Lre=zre.exports,Vre=function(){var e=this,t=e._self._c;return t("TableBase",{ref:"table",staticClass:"table-fields-container",attrs:{"context-menu":"","hover-buttons":"",id:e.id,cells:e.columnDropdownCompaniesCells,"filter-string":e.filterString,"selected-rows":e.selectedRows,"visible-rows":e.visibleRows,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"table-errors":e.tableErrors,"hover-buttons-main-button-icon":["fas","arrow-to-left"],"hover-buttons-main-button-title":e.$t("Details anzeigen"),"read-only":""},on:{tableMounted:e.tableMounted,"update:filterString":t=>e.$emit("update:filterString",t),"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),"remove:row":t=>e.removeEntries([t]),afterScrollVertically:function(t){return e.$emit("click:status")},afterScrollHorizontally:function(t){return e.$emit("click:status")},reload:e.loadData,rowHoverMainButton:e.showDetailPage},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0},{key:"no-content",fn:function(){return[t("NoContent",{attrs:{type:e.noContentType.type,variant:e.noContentType.variant,fetching:e.noContentFetching,"error-response-data":e.noContentError,"read-only":""},on:{import:function(t){return e.$router.push({name:"fields/import"})},copyFromPreviousProcessOrder:()=>{},copyFromNextProcessOrder:()=>{},refresh:e.refresh}})]},proxy:!0},e.isDragover||e.isUploading?null:{key:"no-search-results",fn:function(){return[t("NoContent",{attrs:{type:"search","read-only":""},on:{clearAllFilters:e.clearAllFilters}})]},proxy:!0}],null,!0)})},Ure=[];const jre=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,hiddenPerDefault:!0,lockedPosition:!0},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...xF,hiddenPerDefault:!0},BF,{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},GF,WF,KF,{...qF,hiddenPerDefault:!0},YF,{...JF,hiddenPerDefault:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],Hre=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,lockedPosition:!0},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...TF,hiddenPerDefault:!0},xF,BF,{...OF,hiddenPerDefault:!0},{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},{...UF,lockedVisibility:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_GROUNDWATER_PROTECTION)},GF,WF,ZF,KF,{...qF,hiddenPerDefault:!0},YF,{...JF,hiddenPerDefault:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],Gre=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...eA,lockedVisibility:!0,lockedPosition:!0,sortOrder:"asc"},{...IF,lockedPosition:!0},{...tA,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&Object.values(e.state.customers.data).length>0},{...tA,hiddenPerDefault:!0,lockedPosition:!0,requiredFeatures:e=>e.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&0===Object.values(e.state.customers.data).length},{...aA,lockedVisibility:!0,lockedPosition:!0},_F,DF,MF,{...HF,requiredFeatures:(e,t)=>null!=t.sharedFieldsByFieldId&&Object.keys(t.sharedFieldsByFieldId).length>0},PF,{...xF,hiddenPerDefault:!0},BF,{...$F,hiddenPerDefault:!0},{...RF,hiddenPerDefault:!0},{...NF,hiddenPerDefault:!0},{...zF,hiddenPerDefault:!0},{...nA,lockedVisibility:!0},GF,WF,KF,{...qF,hiddenPerDefault:!0},YF,{...JF,hiddenPerDefault:!0},{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var Wre={international:jre,[ee.AT]:Hre,[ee.DE]:Gre};ow.vI.add(uw.ytF,lw.RrC,uw.s87);var Zre={name:"TableSharedFieldsContainer",components:{TableFooter:hD,TableBase:oD,NoContent:ine},props:{filterString:{type:String,default:""},fieldIdsWithHarvestingMeasure:{type:Array,default(){return[]}}},mixins:[gD,mD("sharedFields",{forceRefresh:!0}),rI(XF.key),sI({[tA.key]:"fieldGroup.customer"}),dI({[DF.key]:"crop",[PF.key]:"preCrop"}),yD({[MF.key]:"variety"}),ID({[xF.key]:CD,[TF.key]:FD,[OF.key]:AD,[UF.key]:kD}
1),oI],data(){return{columnDefinition:Wre,isDragover:!1,isUploading:!1,noContentFetching:!1,noContentError:null,nextCropYearHasFields:null,previousCropYearHasFields:null}},computed:{id(){return["hot-shared-fields",...this.$store.state.auth.currentCompanies.map((e=>e.id))].join("-")},loading(){const e=!!this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.getters["customers/loading"];return this.$store.getters["products/crops/loading"]||this.$store.getters["varieties/loading"]||this.$store.getters["sharedFields/loading"]||e},cropYearNeighbourInfo(){const e=this.$store.getters["auth/availableProcessOrderNames"],t=this.$store.state.auth.currentProcessOrderName,i=String(Number(t)-1),a=String(Number(t)+1);return{current:t,previous:e.includes(i)?i:null,next:e.includes(a)?a:null}},noContentType(){return!0===this.previousCropYearHasFields?{type:"cropYear",variant:"copyFromPrevious"}:!0===this.nextCropYearHasFields?{type:"cropYear",variant:"copyFromNext"}:null===this.previousCropYearHasFields||null===this.nextCropYearHasFields?{type:"loading"}:this.$store.state.auth.currentCompanies.some((e=>[ee.AT,ee.DE].includes(e.regionId)))?{type:"company",variant:"import"}:{type:"company",variant:"create"}},processOrdersReadOnly(){return this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_PROCESS_ORDER)},fieldsReadOnly(){return!0}},watch:{fieldIdsWithHarvestingMeasure(){null!=this.$refs.table&&this.$refs.table.hotRender()},tableData(){this.noContentError=null,this.checkForFieldsInNeighbourCropYears()},loading(){this.checkForFieldsInNeighbourCropYears()}},methods:{showDetailPage([e]){this.selectedRows.length>0&&!this.selectedRows.includes(e)&&this.$emit("update:selectedRows",[...this.selectedRows,e]),this.$router.push({name:"more/shared-fields/record",params:{fieldId:e}})},loadAdditionalData(){this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe"),this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)&&this.$store.dispatch("customers/subscribe")},onClickStatus({target:e,visualRow:t}){this.$emit("click:status",{target:e,guid:this.$refs.table.visualRowToGuid(t)})},async checkForFieldsInNeighbourCropYears(){if(this.previousCropYearHasFields=null,this.nextCropYearHasFields=null,this.loading||Object.keys(this.tableData).length>0)return;const e=await Promise.all([this.cropYearNeighbourInfo.previous,this.cropYearNeighbourInfo.next].map((async e=>null!=e&&this.$store.getters["auth/currentCompaniesHaveFieldsInCropYear"](e))));[this.previousCropYearHasFields,this.nextCropYearHasFields]=e},clearAllFilters(){this.$refs.table.clearAllFilters()},async refresh(){this.noContentError=null,await this.$store.dispatch("sharedFields/refresh")}}},Kre=Zre,qre=(0,ew.Z)(Kre,Vre,Ure,!1,null,"49da5dbf",null),Yre=qre.exports,Jre={name:"PageSharedFields",components:{ModalTableExport:_$,DropdownPageOptions:YL,TableSharedFieldsContainer:Yre,TheContentbar:HL,ThePageSkeleton:$w,MaxWidthContainer:Tw,PageNoMultiCompanySupport:Qw,CompanySwitch:qw,ProcessOrderSwitch:lV,SearchBar:YE,SatelliteSharedFieldDetail:Lre,ModalPageSettings:HE,Button:gw,ButtonDropdown:mV,FeatureNotAvailable:Ew},mixins:[D$("table")],data(){return{filterString:"",selectedRows:[],visibleRows:[],columnsForPageSettings:null,fieldIdsForModal:[],fieldStatusTarget:null,fieldStatusField:null,additionalPageOptions:null}},created(){this.currentCompaniesHaveFeature.visible&&this.currentCompaniesHaveFeature.enabled&&(this.$store.dispatch("activities/sharedActivities/subscribe"),this.$store.dispatch("sharedActivityTypes/subscribe"))},computed:{...(0,C.Se)({satellite:"satellite",sharedFields:"sharedFields/data",crops:"products/crops/data",varieties:"varieties/data"}),activities(){return this.$store.getters["activities/sharedActivities/data"]},activityTypes(){return this.$store.getters["sharedActivityTypes/data"]},currentCompanyId(){return this.$store.state.auth.currentCompanies?.[0]?.id},currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_FIELDS_SHARED)},multipleCompaniesSelected(){return this.$store.state.auth.currentCompanies.length>1},loading(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CUSTOMERS)?this.$store.getters["sharedFields/loading"]||this.$store.getters["customers/loading"]:this.$store.getters["sharedFields/loading"]},fieldStatusFieldIsActiveAndHasHarvestingMeasure(){if(null!=this.fieldStatusField)return this.fieldIdsWithHarvestingMeasure.includes(this.fieldStatusField.id)&&"active"===this.fieldStatusField.status},allSelectedRowsHaveHarvestingMeasuresAndAreActive(){return this.selectedRows.filter((e=>null!=this.sharedFields[e])).every((e=>this.fieldIdsWithHarvestingMeasure.includes(e)&&"active"===this.sharedFields[e].status))},allSelectedRowsFieldStatus(){const e=[...new Set(this.selectedRows.filter((e=>null!=this.sharedFields[e])).map((e=>this.sharedFields[e].status)))];return e.length>1?void 0:e[0]},someSelectedRowsHaveFieldStatusCalculating(){return this.selectedRows.filter((e=>null!=this.sharedFields[e])).some((e=>"calculating"===this.sharedFields[e].status))},editMode(){return!this.loading&&Object.keys(this.sharedFields).length>0&&this.selectedRows.length>0},fieldsForSatellite(){let e=this.selectedRows;return 0===e.length&&(e=this.visibleRows),e.filter((e=>null!=this.sharedFields[e]&&![Z,W,G].includes(this.sharedFields[e].storeStatus))).map((e=>this.sharedFields[e]))},currentFieldIdForSatellite:{get(){return this.$route.params.fieldId},set(e){this.$router.push({name:"more/shared-fields/record",params:{fieldId:e}})}},exportDisabled(){return!this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_EXPORT_FIELD)},fieldIdsWithHarvestingMeasure(){const e=[];
1return Object.values(this.activities).forEach((t=>{const i=this.activityTypes[t.activityTypeId];i?.roughId===ie.HARVEST&&e.push(t.fieldId)})),e}},watch:{currentFieldIdForSatellite(){this.updateSatelliteState()}},async mounted(){window.addEventListener("resize",this.onResize),this.currentCompaniesHaveFeature.visible&&this.currentCompaniesHaveFeature.enabled&&(this.unsubscribeFromStore=this.$store.subscribe((({type:e},t)=>{["sharedFields/loadAll"].includes(e)&&this.reloadFieldsWithStatusCalculating(),"satellite/toggleExpand"===e&&(t.satellite.expanded&&this.fieldsForSatellite.length>0&&null==this.currentFieldIdForSatellite?this.$router.push({name:"more/shared-fields/record",params:{fieldId:this.fieldsForSatellite[0].id}}):this.$router.push({name:"more/shared-fields"}))})),this.updateSatelliteState(),this.setInitialSatelliteState())},beforeDestroy(){window.removeEventListener("resize",this.onResize),this.unsubscribeFromStore()},methods:{updateSatelliteState(){null!=this.currentFieldIdForSatellite&&this.$store.commit("satellite/setState",{visible:!0,expanded:!0})},async setInitialSatelliteState(){if(!0===this.$store.state.satellite.visible)return;await this.$store.dispatch("sharedFields/subscribe");const e=!0===this.$store.state.navbar.expanded?"(min-width: 1550px)":"(min-width: 1400px)";!0===window.matchMedia(e).matches&&Object.keys(this.sharedFields).length>0&&this.$store.commit("satellite/setState",{visible:!0,expanded:!1})},urlToFile(e,t,i){return fetch(e).then((e=>e.arrayBuffer())).then((e=>new File([e],t,{type:i})))},async exportSelected(){const{type:e,okay:t}=await this.$refs.modalTableExport.show();if(t)if("xls"===e)this.$refs.table.$refs.table.export(this.selectedRows);else{const t=await jo(e,this.selectedRows,Ty.fieldSharing,this.currentCompanyId),a=await this.urlToFile(`data:text/plain;base64,${t.data.fileBody}`,t.data.fileName,t.data.fileMimeType),{default:n}=await i.e(563).then(i.t.bind(i,75563,23));n(a,t.data.fileName)}},async exportData(){const{type:e,exportFiltered:t,okay:a}=await this.$refs.modalTableExport.show();if(!a)return;let n=[];if(n=t?this.$refs.table.visibleRows:Object.values(this.$refs.table.tableData).map((e=>e.id)),"xls"===e)this.$refs.table.$refs.table.export(n);else{const t=await jo(e,n,Ty.fieldSharing,this.currentCompanyId),a=await this.urlToFile(`data:text/plain;base64,${t.data.fileBody}`,t.data.fileName,t.data.fileMimeType),{default:r}=await i.e(563).then(i.t.bind(i,75563,23));r(a,t.data.fileName)}},sendFieldPositions(){const e=this.$t("FARMDOK Feldpositionen"),t=this.$refs.table.selectedRows.map((e=>{const t=this.$refs.table.tableData[e],i=sA.data(t),a=null!=t.cropId&&null!=this.crops[t.cropId]?` (${this.crops[t.cropId].name})`:"",n=null!=t.fieldSize?` (${Bl()(t.fieldSize).format()} ha)`:"",r=null!=t.fieldSize?`${Math.max(Math.round(800*Math.sqrt(t.fieldSize)),3445)}m`:"15z",s="number"===typeof t.lat&&"number"===typeof t.lon?`https://www.google.com/maps/place/${t.lat},${t.lon}/@${t.lat},${t.lon},${r}/data=!3m1!1e3`:this.$t("Keine Feldposition");return`${i}${a}${n}:\n${s}`})).join("\n\n"),i=document.createElement("a");i.href=`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(t)}`,i.target="_blank",i.click()},async showSettings(){this.columnsForPageSettings=this.$refs.table.$refs.table.getColumnsForPageSettings();const e=await this.$refs.modalPageSettings.show();null!=e&&Array.isArray(e.columns)&&this.$refs.table.$refs.table.updateColumnsFromPageSettings(e.columns)},reloadFieldsWithStatusCalculating:Xl()((async function(){const e=Object.values(this.sharedFields).filter((({status:e})=>"calculating"===e)).map((({id:e})=>e));e.length<1||await this.$store.dispatch("sharedFields/refreshByIds",e)}),3e4,{maxWait:12e4}),async onClickStatus(e){if(null==e)return this.fieldStatusTarget=null,void(this.fieldStatusField=null);const{target:t,guid:i}=e;if(this.fieldStatusTarget===t)return this.fieldStatusTarget=null,void(this.fieldStatusField=null);this.fieldStatusTarget=null,this.fieldStatusField=null,null!=this.sharedFields[i]&&(await this.$nextTick(),this.fieldStatusTarget=t,this.fieldStatusField=this.fields[i])},onResize(){this.fieldStatusTarget=null,this.fieldStatusField=null}}},Xre=Jre,Qre=(0,ew.Z)(Xre,xre,Bre,!1,null,"75e103fe",null),ese=Qre.exports,tse=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:e}){return[t("ProcessOrderSwitch",{staticClass:"ml-4",attrs:{slim:!e}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!e}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"w-100 h-100 d-flex"},[t("FontAwesomeIcon",{staticClass:"text-medium m-auto",attrs:{size:"3x",spin:"",icon:["fad","spinner-third"]}})],1)]},proxy:!0}])})},ise=[];ow.vI.add(yF.AX7);var ase={name:"PageSoilSamples",components:{ThePageSkeleton:$w,TheContentbar:HL,ProcessOrderSwitch:lV,CompanySwitch:qw},data(){return{}}
1,computed:{currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_SOIL_SAMPLES)}},watch:{soilSamplesEnabled:{handler(){!0===this.currentCompaniesHaveFeature.enabled&&this.$router.replace({name:"soil-samples--agridat"})},immediate:!0}}},nse=ase,rse=(0,ew.Z)(nse,tse,ise,!1,null,"67285be5",null),sse=rse.exports,ose=function(){var e=this,t=e._self._c;return t("div",{staticClass:"import-choose-method"},[t("MaxWidthContainer",{attrs:{size:"xl"}},[t("div",{staticClass:"import__intro"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(e.$t("Wie möchtest du importieren?")))]),t("p",[e._v(e._s(e.$t("Bitte wähle eine Option und klicke auf Weiter.")))])]),t("div",[t("FormFieldRadioGroup",{attrs:{variant:"no-label","inner-container-class":"d-flex",checked:e.importMethod,stacked:!1},on:{input:t=>e.$emit("update:importMethod",t)}},[t("FormRadio",{attrs:{variant:"card",value:"eAma"},scopedSlots:e._u([{key:"image",fn:function(){return[t("img",{attrs:{alt:"eAMA Logo",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAAAdCAYAAABL7VmUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA91SURBVHgB7Vp3dFRlFv+9MiUTEkIXIqGj0jSCRMFERFBREVR0bbvHchR1VVSKCgKiAhJARFfs6CKurrJwVFRQbCigdEE6Ug6CEKSkTZJX997vzZu8mcyEUI7+k4vPGeZ99f6+e+/v3g8JjkiRT/k5wH8p0jODMHsosM+XoXSVIDWQKttUFcmCntsdhdOmQRajJG9aKycmFmkVtrXLtKQPAX2hCghdS13pcxrqtMuEfbfqsy7zt2nbRu3Q1qc0y4SUkoJqoZBs6M0zYaaGICkKauVUiw3LtmGaZktD13M13VrMeCjDgOAtCPRokJo2wXdm686p1/UPpFzaC1JGGuBjbI9tQYYcQJG/bo3a1kh4GFqsJFUdj34Wv9v85YTG5f5IOO4x+yJ2hzYPZp+CPfMQvChbjFj5M/3FtEwYJj0VGnTDgKZrlsqg3YbggLp10ibXuevGZqk39odULx30Fla40BksokQxopTAadI7JbUe6jdpTnZ78hZHJwtr167FZ599Kr57wWOwVFXFtddehw4dOgI4PvDKy8sxb95cbN68GZIsR7cSDAYxYMBAnHHGGQkPy5EjRzBnzhzs27cXMvWzLIseG4GAH7fddjuaNWuGkxLaRsU336J84VfkCU24Shb/1ysgdTsX6pX9gLIynltW+yO1dZrfNz71lqubhm6mFzYBduggSDuQ0xtBqtuA3B9Zna7BKj4Mu/AguVqDRpRjZ1UDUHnDJ+kqGZjly3/CqFGjsG7dz/D7/THvWWGs2Kys5ujcuTOOR/gQfPzxR3j00RHiOwMglEPjBQIBtGvXTgCnxO2htLSUQPsQ48aN5dain+24LlKTD/369UPz5s1xwmJaKP9iEYpGPApj03ZSgke3xB+QHkCwS0fYpAvV0GEYCtQWqvpaSq9uLVMG5sE68geB5IOS2QpKi86QgqGY8eWmrWGXFsLcsR7mgd20eKvynS9IE1o4GamoqMBXXy3CkCEP4OjRQqHMeHGtwTSPby5N0wRoY8aMFuB7wXHHTOR6DXJNb7zxOp5//jm4oLl9+HvEu524kAWVvDULReOeglVAHg5q5AUPakE+syXqTZgAq29flJF+VFo3z6uqKb6O/h6daIVltDtyeW2zobQ6B5I/orQoGJJwk1JqXSjtsmGzz92xLuIaaZLUDGfjJ7gLPr2ffjofkyY9i8LCoiqWlkxqGudWr16FadOeo7EL4fP5UZ2L9Y65YuUKvPzyDJSUlFazJrtKv2MKI05jhj+Yi+L8KXGgQVia3OI01Ht2EoL9+qBMt0S8E6+4pZSalqY0SYdJ1qa26AilTRcHNDJJ64/foZN1oTxMbrM+lNPbQW7YjCwxFeqZ58HcvZmstECAZ4aK2Y+J2Hg8IlHqoJM1fPDhB5hAJ6u0tIQU64tRRGKCYgvLMXSjmtFtEcc4nj3++GPYsmULKT+ARKDxeO6YFlmzoipYsuQHjB49GocPH04KmiBJVk3W4hFOl8JlKJ04GWVvvwXrQLylkQvueR5CI4ZBuawvdOGWYz2MKvkoW9PC1FyH2j4bUiBFAKBv+xnajwthlRzh5TmkJ2MFArkDoLY8S7Rj69QXzxPtpfRSmAYPXnPgZNq0Tpud/e4sTJ06RcQSJh5epWRk1EM4HCY3Wl6FpLCyND35fCopf9+ePZj23FSsX78+oev1iks4eOytm7Zi/ITx2LhxQ7XWz20F4zPMatdSuSlytUVFqHjzbZS98CK5SiYinpgqGZA7tEdocj6Us7vQodYFc+Xxvd5MtclvWnSi1NbtoTR2AqytlUFbvghmwb4o2RBd9u2BtupbqFlnkNZlsr7TKCb6YR3dDyujBLZR87jDRyFMc7//3/cItEnE9iqioLmB/5xzsonpXYM3Kcbs3fdbTFziE8hKFhtKND4pSCdCNX36dHy+4POIpSE6fiIrNk0HtP37D+DFF17AyhV0UANBt1c0DYkXnfat62bStbg75v/skmLo5Br1d98l0FhfSnR8SESYumfD/+STsDp1hFWuid+5lc0WJ+Z25lft4lIYW/fA1yVHgOFsWoKv0/n05CCG+/OGAy4JkYXLhBqEVUSmXlICizZgOwOgOuHgWlIaxquvzsCMGdOFUr2g8cnv0KETnnhiDEKhVLz++itVFMZKZOBY2YnEsnS8887bmDXrLaL6KdEl8fg8n0GhIFFMKigoICIyDZ/M/0SkCG4f7s8unA+MHUfC7IilJluLWCzv78ABaM9OgfnOLApFCpzah1itA1rf3vBPnQqpxekwGbQIS7epn/3rTsg550XhIIszoa/djZRrPRMFQvB37YVjiSTTYmixVnEJU0InDz1GfGbQmD3OnPkaZs9+i5QRiDI1VpBO7qZbt24YOnQ4zj47W7iq45VgMIC5c+cQG3xVWIw7PjPEhg0bITc3D4sWfSFcsHsgxGElYOYTYPPmzSEgzKiFs/U3bNiQ+vWifguFS3fHPKYwaFTEsMmrGRPzYX1IFSsjrqihEhHpeSF8T4yClHU6m3DkdwUSGZaeP1lYXOCC7tE0TGWw9a37oC3biNCgyEAcaH/dRI0NVMm2BXN0Tpx9lBazYzu5SiImNIF0DNBYEYcOHaKAP5KS60+ENSlKJWgs3bvnEIt7VcQ2J97guISV/9NPyykPfEwk2y7RcVOAhx8eilatWmHBgs88W3KS+vnzP8ayZcsodaigttzPcZ18EO677360aNESCxd+VnP2yO0oPtq/74d292BY339Pv7HLdnXKoBK3+NtN8D3zDJBBhQ83TtJ67D17od11N4wfl8BHbbyezPFP5Jq1xasdVsjJZWkxSt59hVzoBsfEPQuRGzQmhlnX+XuYTsOubRQTNUhhIg9OaSXhHlhpBw7sx0svvYgvv1xAoIVi3Bc/F198CVnaMNSrV5+sUo8hKjURbr958yZMmfKssAqvq2MXd/XVAzBw4ABii0vFofAKt//6668iAKtwQeP874YbbqJ+19KB+PH4KD8dGnv3HuijRsJaTKDBCxpJiPKxK6+BQu+joAmfTPa0fSeMp5+GuZJwQVVyJDRDqSS0NatRsXgJAhddCCktHaH+N6H4X/kwtm8Rm+AUQW3THml3PAIlqzXYL4fnvofypcscd1NUBiQAznVFBw8exPDhj2Dp0iWCpcWHwauu6o+xY59CamodUpaRkAQkE27LB2P//t/x1FNjKGdbGQMau9/LLrscI0eORjqlNfGgucJtvW6bQezVqzet+1E0atSw5qDx2ukQWavXQn/scfFJDtzTwHJAu+ceqA89SIw8nf24048NZ8dO
16HfcAeuXTWRUitM+TpyjRT1sU0LR6HGo/85Mqpo0pxjXAxn5r6Hih2+JdR6C0rQZ/dYdSpOmIhgb6zegePJ0Ko8dJXMihplZDEXQrtgJWKFr164RVsB5UQrdNHgVxSDeeus/8MADQ0Q8Ot6KCAsr++jRo8jPn0iubmkM7ee4lp19LrnOMaT8RgKM5PquXLxJYSIv72IiSGNRp06aAL/GolItc8ky6EMfhsUlrBiLofmb1IXvjjuhDhvq8BMjEtMov7O++Q76+PGwfv4FiSwtOgWpupCWm0FnFhUrVqF42nSkjxwBuUkTKI0aIzTwepqLfKkScVuct2z7FUVPPwNj82+0WVKSbMIu1iJl+8rBOU4UFOwnSxpJdcd1VUDjoD9o0I0Ud4aLnKt6Op1MJAHG7Nn/JlLxP2FplWUxE5mZmbj//gdEfApT0utUTaoXdo9ZWVkYNmw42rRpI1IVny9Yo9UgSOnRt99D59JaAtDsENVFHxwC+c7bHV25NJ8JzPKV0IaNgL1rN6oDjUXVYC8IQLoBjH2FheIXZqBi1Rqk3TuYLnpyIDduTLkamW9JGObefShf9DWKZ7wEY8tOmjfgeMckHmTx4m+EpW3Y8AuBForSaAYtLS0N9957PwYP/qdIrqsDzfFQdtRVuTFRliXxzJz5uoidrqW5h4IJzsSJU8hyelFJMBw/ahXXx4Bzv5YtW+LJJ59Gp05daG1akjXZVT+JnZnzPoY25CHgMFdDPKU1Lha3ykSA3K5y6018OhxOwZUX2r89bwH0iZNg72TQVMQq1Y5+uPOp5IWfPxf+s4hDdYnUyaEtXYEj27ZSJaUd/O07Ur4WgE3Zvr5jK/TNW4jalhBoSUpA/JDr4trguHFPYNeuXYLZcd7kbpBdz+DB9+Lmm28lxZQljTmuMDVnYGXZjoLmPMB3330tQGPwvWSGLY/Hz8vLJYspi1O6k8AnujJqRF7mvvseRE5OD+rnJMCV63AOBK9FUZwYyHOKFkHa4xv/gTE1n0A7ElG+WwKjebIyoT4+Eso1Ax3QnGxeWJr5/kfQqUaLPVTwEAl5/CF2rMOyuRxnkJESCx6Esq3vQxrblbIIcgbZ3FOyKekrKIZWsBL6spXObZ4lRWKkjJhiqGdw/sNr4RLQpo0bcQ7lYTndz49xn7Kk4pI+fdD74t60AKvamMYW2qBBfcHoODFm63KSYZlyvLOJCYYF6cnLyxOphatkVizP2++KfsJivHGNYxVfCfF9Hse/SmbrxMNeF/XG5ZdfIWqo3n4MWLOmTanfIHFI3KsdTuYbkVcyiVXbW7dDOa8nkJMXq3OZ8rTrB0HO7enkupFx2ZPhSKFgnuoFuUBPNZFaKS2jYkHPHGjksjW+TKWKEA+TQU9oMgJdL4X/obqQzyfMORjVnNZRjJP65EKe+WY0QZSJlDinOeY+12GAkSS8RkNTWyY4lueWQuw9wvqcq5XYeZgl8+86V0fiyAi34vllRa7qKvkPFcxZMYkSSFl2rlRsWDH7YVDFPMwDpISbcKxLSzAut+cblqQsOlL8pjl0yku5tks34OWuM7WHo2LjGmDijVD7tIHSN9WntlUMqw71qlGJQBRZ6Zoier0vSZHFxAIH2xtbanY2JNmTsIoxEPknA3bSeSqvmKpc18eNidi1AUlitjOWM58dt5/I++ha4rtWvxZx2JPi5rThg2saJtVEjHCFpn/CzevAsTD3CV4O9bS/I9j9dJ+vbdCy60mmVb2Gqc5m0DVEeORjsGv/sdApEzokNj9k5ZbiUw0qDJQTM169ZMni9xgQvuZmOiZAg0OFuN4jo7IKWit/vjhX4A5T0SIPU+Ny/q56XiDSkOkf/86mU/M4VyunWtxEy8WHcWFiwFTVcoHzNuYX7p1D5QVQrfzZIq7hIp9G5GHwGC8BnEuR3Eb80usma4H7a8S1OMvzmO5316K8T7yl1QL314jt+bTiPmP+Ca6U5LNW/lqJLyqK7/8HGViN+Pihl1gAAAAASUVORK5CYII="}})]},proxy:!0},{key:"default",fn:function(){return[e._v(" "+e._s(e.$t("Direkt von eAMA"))+" ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Du kannst die Flächen direkt von eAMA mit AMA-Betriebsnummer und AMA-Pin importieren."))+" ")]},proxy:!0}])}),t("FormRadio",{attrs:{variant:"card",value:"upload"},scopedSlots:e._u([{key:"image",fn:function(){return[t("FontAwesomeIcon",{staticClass:"text-black",attrs:{icon:"cloud-upload",size:"3x"}})]},proxy:!0},{key:"default",fn:function(){return[t("span",{staticClass:"d-block mt-4"},[e._v(" "+e._s(e.$t("Datei hochladen"))+" ")])]},proxy:!0},{key:"text",fn:function(){return[e._v(" "+e._s(e.$t("Du kannst Flächen mit Dateien im Format Shape, XML, KML, XLS, XLSX und CSV hochladen.")))]},proxy:!0}])})],1),t("Button",{staticClass:"float-right mr-3",on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1)])],1)},lse=[];ow.vI.add(uw.KN3);var dse={name:"ImportChooseMethod",components:{MaxWidthContainer:Tw,FormFieldRadioGroup:_T,FormRadio:kT,Button:gw},props:{importMethod:{type:String,default:"eAma"}},mounted(){this.updateImportNextEnabled()},watch:{importMethod(){this.updateImportNextEnabled()}},methods:{updateImportNextEnabled(){this.$emit("update:importNextEnabled",null!=this.importMethod)}}},cse=dse,use=(0,ew.Z)(cse,ose,lse,!1,null,"4222248c",null),pse=use.exports,hse=function(){var e=this,t=e._self._c;return t("div",["eAma"===e.$route.params.method?t("ImportEAma",{ref:"loadDataComponent",attrs:{"import-next-enabled":e.importNextEnabled,fetching:e.fetching,"import-target-process-order-id":e.importTargetProcessOrderId},on:{"update:importNextEnabled":t=>e.$emit("update:importNextEnabled",t),"update:fetching":t=>e.$emit("update:fetching",t),"update:importData":t=>e.$emit("update:importData",t),next:()=>e.$emit("next")}}):"upload"===e.$route.params.method?t("ImportFileUpload",{ref:"loadDataComponent",attrs:{"import-next-enabled":e.importNextEnabled,fetching:e.fetching,"file-upload-response-data":e.fileUploadResponseData,"import-target-process-order-id":e.importTargetProcessOrderId,"selected-file-group-name":e.selectedFileGroupName},on:{"update:importNextEnabled":t=>e.$emit("update:importNextEnabled",t),"update:fetching":t=>e.$emit("update:fetching",t),"update:importData":t=>e.$emit("update:importData",t),"update:selectedFileGroupName":t=>e.$emit("update:selectedFileGroupName",t),next:()=>e.$emit("next")}}
1):e._e(),t("ErrorUserMessage",{attrs:{centerText:!0,"error-user-message":e.userErrorMessage}})],1)},mse=[],fse=function(){var e=this,t=e._self._c;return t("div",{staticClass:"import-e-ama"},[t("MaxWidthContainer",{attrs:{size:"xl"}},[t("div",{staticClass:"import__intro text-small"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(e.$t("Voraussetzung: Einverständnis in eAMA abgeben!")))]),t("p",[e._v(" "+e._s(e.$t("Du musst in eAMA einmalig die Erlaubnis geben, dass deine Flächen in FARMDOK importieren werden dürfen."))+" ")]),t("ol",{staticClass:"import-e-ama__list"},[t("li",[e._v(e._s(e.$t("Steig auf www.eama.at mit Betriebsnummer und Pincode (oder Handysignatur) ein.")))]),t("li",[e._v(e._s(e.$t("Wechsle zum Reiter Kundendaten, Menüpunkt Datenfreigabe > Übersicht.")))]),t("li",[e._v(" "+e._s(e.$t("Drück bei Datenempfänger FARMDOK GmbH die Taste „Einwilligung starten“ und folge den Anweisungen."))+" ")])]),t("BLink",{attrs:{href:"https://www.eama.at/",target:"_blank"}},[e._v(" "+e._s(e.$t("eAMA öffnen"))+" ")])],1),t("hr",{staticClass:"w-100 mt-5 mb-5"}),t("h2",[e._v(e._s(e.$t("eAMA Online Flächen Import")))]),t("ValidationObserver",{ref:"validationObserver",staticClass:"w-100",scopedSlots:e._u([{key:"default",fn:function({errors:i}){return[t("FormFieldSelect",{attrs:{name:"type",options:[{value:"MFA",text:e.$t("Mehrfachantrag (MFA)")},{value:"HA",text:e.$t("Herbstantrag (HA)")}],label:e.$t("Antrag"),disabled:e.fetching},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}}),t("FormFieldSelect",{attrs:{name:"year",options:e.yearOptions,label:e.$t("Jahr"),disabled:e.fetching},model:{value:e.year,callback:function(t){e.year=t},expression:"year"}}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("eAMA-Betriebsnummer")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{attrs:{name:"bdmId",type:"text",autocomplete:"off",required:"",label:e.$t("eAMA-Betriebsnummer"),placeholder:e.$t("eAMA-Betriebsnummer"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},model:{value:e.bdmId,callback:function(t){e.bdmId=t},expression:"bdmId"}})]}}],null,!0)}),t("ValidationProvider",{attrs:{rules:"required",slim:"",name:e.$t("eAMA-Betriebsnummer")},scopedSlots:e._u([{key:"default",fn:function({errors:i,dirty:a}){return[t("FormFieldInput",{attrs:{name:"pin",type:"password",autocomplete:"off",required:"",label:e.$t("eAMA PIN"),placeholder:e.$t("eAMA PIN"),disabled:e.fetching,state:!(i.length>0&&!a)&&null},model:{value:e.pin,callback:function(t){e.pin=t},expression:"pin"}})]}}],null,!0)}),t("ErrorUserMessage",{attrs:{"vee-validate-errors":i,"error-user-message":e.userErrorMessage}}),t("div",{staticClass:"float-right"},[t("Button",{attrs:{disabled:!e.importNextEnabled,fetching:e.fetching},on:{click:function(t){return e.$emit("next")}}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1)]}}])})],1)],1)},gse=[],yse={name:"ImportEAma",components:{Button:gw,ErrorUserMessage:cH,FormFieldSelect:n9,FormFieldInput:fk,MaxWidthContainer:Tw},mixins:[cG],props:{importNextEnabled:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},importTargetProcessOrderId:{type:String,required:!0}},data(){let e=null;return this.$store.state.auth.currentCompanies.length>0&&([{bdmId:e}]=this.$store.state.auth.currentCompanies),{type:"MFA",year:String(Math.min(this.$store.state.auth.currentProcessOrderName,(new Date).getFullYear())),bdmId:e,pin:null}},computed:{yearOptions(){return this.$store.getters["auth/availableProcessOrderNames"].map((e=>({value:e,text:e}))).sort(((e,t)=>t.value-e.value))}},mounted(){this.$emit("update:importNextEnabled",!0)},methods:{async next(){this.$refs.validationObserver.reset();const e=await this.$refs.validationObserver.validate();if(!e)return!1;let t;this.$emit("update:fetching",!0);try{const{data:e}=await l().post("/admin/rest/field/import_eama",{version:"2.0",data:{eamaPrefix:this.type,eamaFarmNo:this.bdmId,eamaPin:this.pin,cropYear:this.year,targetProcessOrderId:this.importTargetProcessOrderId}});t=ue(e)}catch(i){t=ue(i)}return this.$emit("update:fetching",!1),"success"!==t.status?(this.setUserErrorMessageFromResponse(t),!1):(this.$emit("update:importData",t.data),!0)}}},vse=yse,bse=(0,ew.Z)(vse,fse,gse,!1,null,"3e5b2ece",null),wse=bse.exports,Cse=function(){var e=this,t=e._self._c;return t("div",{staticClass:"import-file-upload"},[t("MaxWidthContainer",{attrs:{size:"xl"}},[t("div",{staticClass:"import__intro"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(e.$t("Datei hochladen")))]),t("p",[e._v(" "+e._s(e.$t("Anleitung: Woher bekomme ich eine Datei mit meinen Feldern?"))+" "),t("BLink",{on:{click:function(t){e.infoModalVisible=!0}}},[e._v(" "+e._s(e.$t("Klicke hier für mehr Infos ..."))+" ")])],1)]),t("form",{staticClass:"import-file-upload__form",class:{"
1import-file-upload__form--is-dragover":e.isDragover},attrs:{method:"post",action:"",enctype:"multipart/form-data"},on:{drag:function(e){e.preventDefault()},dragstart:function(e){e.preventDefault()},dragend:function(t){t.preventDefault(),e.isDragover=!1},dragover:function(t){t.preventDefault(),e.isDragover=!0},dragenter:function(t){t.preventDefault(),e.isDragover=!0},dragleave:function(t){t.preventDefault(),e.isDragover=!1},drop:function(t){return t.preventDefault(),e.onFileDrop.apply(null,arguments)},click:e.onFormClick}},[t("label",{staticClass:"position-absolute"},[t("input",{ref:"input",staticClass:"import-file-upload__input",attrs:{type:"file",name:"file[]",multiple:""},on:{change:e.onFileChange}})]),0===e.fileGroups.length?t("div",{staticClass:"import-file-upload__form-empty-content"},[t("FontAwesomeIcon",{staticClass:"mb-3",attrs:{icon:"cloud-upload",size:"3x"}}),t("span",{staticClass:"import-file-upload__label-text-one"},[e._v(e._s(e.$t("ZIEHE DIE DATEI HIER HER")))]),t("span",[e._v(" "+e._s(e.labelUploadInfoParts[0])+" "),t("BLink",[e._v(" "+e._s(e.labelUploadInfoParts[1])+" ")]),e._v(" "+e._s(e.labelUploadInfoParts[2])+" ")],1),t("span",{staticClass:"mt-3 text-small"},[e._v(e._s(e.$t("Es können Dateien in den Formaten Shape, XML, KML, XLS, XLSX und CSV importiert werden.")))])],1):t("div",{staticClass:"import-file-upload__form-files-content"},[t("ul",{staticClass:"import-file-upload__file-groups-list"},e._l(e.fileGroups,(function(i){return t("li",{key:i.key,staticClass:"import-file-upload__file-group",class:{"
1import-file-upload__file-group--selected":e.selectedFileGroupName===i.key},on:{click:function(t){return e.$emit("update:selectedFileGroupName",i.key)}}},[i.files.length>1?t("div",{staticClass:"import-file-upload__file-group-title"},[e._v(" "+e._s(i.key)+" ")]):e._e(),t("ul",{staticClass:"import-file-upload__file-subgroup"},[e._l(i.files,(function(a){return t("li",{key:`${i.key}_${a.name}`,staticClass:"import-file-upload__item"},[t("div",{staticClass:"import-file-upload__item-label",class:{"import-file-upload__filename--single":1===i.files.length}},[e._v(" "+e._s(a.name)+" ")]),t("FontAwesomeIcon",{staticClass:"import-file-upload__item-icon import-file-upload__item-icon--success",attrs:{icon:["far","check-circle"]}})],1)})),e._l(i.errors,(function(a){return t("li",{key:`${i.key}_${a.key}`,staticClass:"text-danger import-file-upload__item"},[t("div",{staticClass:"import-file-upload__item-label"},[e._v(" "+e._s(a.errorUserMessage[0])+" ")]),t("FontAwesomeIcon",{staticClass:"text-danger import-file-upload__item-icon",attrs:{icon:["far","exclamation-circle"]}})],1)})),e._l(i.warnings,(function(a){return t("li",{key:`${i.key}_${a.key}`,staticClass:"text-warning import-file-upload__item"},[t("div",{staticClass:"import-file-upload__item-label"},[e._v(" "+e._s(a.errorUserMessage[0])+" ")]),t("FontAwesomeIcon",{staticClass:"text-warning import-file-upload__item-icon",attrs:{icon:["far","exclamation-triangle"]}})],1)}))],2)])})),0),t("div",{staticClass:"import-file-upload__form-button-container"},[t("span",{staticClass:"cursor-pointer",on:{click:()=>e.$refs.input.click()}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"cloud-upload"}}),e._v(" "+e._s(e.$t("Weitere Dateien durch Ablegen hinzufügen"))+" ")],1),t("div",[t("Button",{attrs:{outline:"",disabled:e.fetching},on:{click:e.onReset}},[e._v(" "+e._s(e.$t("Alle Dateien entfernen"))+" ")]),t("Button",{attrs:{disabled:!e.importNextEnabled,fetching:e.fetching},on:{click:e.onNext}},[e._v(" "+e._s(e.$t("Weiter"))+" ")])],1)])])]),t("p",{staticClass:"mt-4"},[e._v(" "+e._s(e.labelCsvDownloadLinkParts[0])+" "),t("BLink",{attrs:{download:"",href:`${e.baseUrl}farmdok_field_import_example.csv`}},[e._v(" "+e._s(e.labelCsvDownloadLinkParts[1])+" ")]),e._v(" "+e._s(e.labelCsvDownloadLinkParts[2])+" ")],1),t("ErrorUserMessage",{staticClass:"mt-3",attrs:{"error-user-message":e.userErrorMessage}})],1),t("ModalImportFileUploadInfo",{model:{value:e.infoModalVisible,callback:function(t){e.infoModalVisible=t},expression:"infoModalVisible"}})],1)},Fse=[],Ase=function(){var e=this,t=e._self._c;return t("ModalWrapper",{attrs:{size:"xl","no-cancel-button":"",visible:e.visible,title:e.$t("Felder exportieren"),"ok-title":e.$t("Schließen")},on:{change:t=>e.$emit("change",t)}},[e.showEAmaInfo?t("div",[t("h2",[e._v("Export aus dem eAMA INVEKOS-GIS Client")]),t("p",[e._v("Tut uns leid, die Schritte liegen nicht in unserer Macht...")]),t("ol",[t("li",[e._v(" Steige bei eAMA mit deiner Betriebsnummer und deinem Passwort ein ("),t("a",{attrs:{href:"http://www.eama.at",target:"_blank"}},[e._v("www.eama.at")]),e._v(") ")]),t("li",[e._v(" Wähle im Registerblatt "),t("strong",[e._v('"Flächen" - "Flächen erfassen" - "INVEKOS-GIS" - "INVEKOS-GIS ab 2015 aufrufen".')])]),t("li",[e._v(" Die "),t("strong",[e._v('Datei "default.jnlp"')]),e._v(" wird auf deinen Rechner geladen. Öffne die Datei. Der Java GeoMedia Smart Client wird geöffnet. ")]),t("li",[e._v(" Wechsle in das Fenster mit der Landkarte. Gehe am oberen Rand auf "),t("strong",[e._v('"Extras" - "GIS Datenexport"')]),e._v(" (ganz links). ")]),t("li",[e._v("Wähle das Kontrollkästchen für das "),t("strong",[e._v('Dateiformat "XML"')]),e._v(" an und drücke weiter.")]),t("li",[e._v(" Wähle das Kontrollkästchen "),t("strong",[e._v('"beantragte Schläge inkl. GSTK (XML)"')]),e._v(" und drücke "),t("strong",[e._v('"Anfordern"')]),e._v(". ")]),t("li",[e._v(" In der darunter liegenden Liste erscheint ein neuer Eintrag. Gehe rechts auf "),t("strong",[e._v('"Download"')]),e._v(" und speichere die Datei lokal auf deinem Rechner (am besten am Desktop, da f
1indest du sie einfach wieder). ")])])]):e._e(),e.showGermanInfo?t("div",[t("h2",[e._v("Export aus Antragssystem")]),t("p",[e._v(" Exportiere deine Flächen- und Geodaten aus dem in Ihrem Bundesland verwendeten Antragssystem."),t("br"),e._v(" In der Tabelle unterhalb sind die unterstützten Dateiformate für Ihr Bundesland angeführt. ")])]):e._e(),t("div",[t("h2",[e._v(e._s(e.$t("Import in Farmdok")))]),t("ol",[t("li",[e._v(" "+e._s(e.$t("Ziehe die exportierte(n) Datei(en) mit der Maus in das weiße Rechteck mit dem strichlierten Rahmen (Drag & Drop)."))+" "),e.showEAmaInfo?e._e():t("div",[e._v(" "+e._s(e.$t("Falls deine Exportdateien als zip-Datei zur Verfügung stehen, kannst du ganz einfach diese zip-Datei inkl. aller Daten in das weiße Rechteck ziehen."))+" ")])]),t("li",[e._v(e._s(e.$t("Die Importvorschau wird geladen. Hier kannst du bereits Anpassungen vornehmen.")))]),t("li",[e._v(e._s(e.$t('Drücke "Importieren" um den Import abzuschließen.')))])]),t("p",[e._v(" "+e._s(e.$t("Fertig! Die Felder/Feldstücke inkl. Geokonturen wurden importiert und stehen für die Maßnahmenbuchung zur Verfügung!"))+" ")]),t("p",[e._v(" "+e._s(e.$t("Probleme? Bitte schreib uns an [email protected] und übermittle die verwendeten Importdateien."))+" ")])]),e.showGermanInfo?t("div",[t("table",{staticClass:"table table-bordered"},[t("tbody",[t("tr",[t("td",[t("p",[t("strong",[e._v("Bundesland")])])]),t("td",[t("p",[t("strong",[e._v("Dateiformat")])])]),t("td",[t("p",[t("strong",[e._v("Erklärung zum Import")])])])]),t("tr",[t("td",[t("p",[e._v("Bayern")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[t("a",{attrs:{target:"_blank",href:"https://www.farmdok.com/import-anleitung/"}},[e._v("Zur Anleitung")])])])]),t("tr",[t("td",[t("p",[e._v("Nordrhein-Westfalen")])]),t("td",[t("p",[e._v(" Shape"),t("br"),t("em",[e._v("oder")]),t("u",[t("br")]),e._v("gml ")])]),t("td",[t("p",[e._v(" Verwende die Dateien im Ordner TS_SHAPE. Importiere alle 4 Dateien (.dbf .prj .shp .shx)"),t("br"),t("em",[e._v("oder")]),t("u",[t("br")]),e._v("Verwende die TS .gml Datei (eine Datei) ")])])]),t("tr",[t("td",[t("p",[e._v("Mecklenburg-Vorpommern")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v("Importiere alle 4 Dateien (.dbf .prj .shp .shx)")])])]),t("tr",[t("td",[t("p",[e._v(" Brandenburg"),t("br"),e._v(" Berlin ")])]),t("td",[t("p",[e._v("xml")])]),t("td",[t("p",[e._v("Verwende die .xml Datei (eine Datei)")])])]),t("tr",[t("td",[t("p",[e._v("Sachsen-Anhalt")])]),t("td",[t("p",[e._v(" Xml"),t("br"),t("em",[e._v("und")]),t("u",[t("br")]),e._v("shape ")])]),t("td",[t("p",[e._v(" Verwende "),t("em",[e._v("beide")]),e._v(" Dateiformate (importiere am besten alle Dateien gleichzeitig):"),t("br"),e._v(" xml (eine Datei)"),t("br"),t("em",[e._v("und")]),t("u",[t("br")]),e._v("Shape (Teilflächen; 4 Dateien – .dbf .prj .shp .shx) ")])])]),t("tr",[t("td",[t("p",[e._v(" Schleswig-Holstein"),t("br"),e._v(" Hamburg ")])]),t("td",[t("p",[e._v("xml")])]),t("td",[t("p",[e._v("Verwende die .xml Datei (eine Datei)")])])]),t("tr",[t("td",[t("p",[e._v("Sachsen")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v("Verwende die Dateien mit der Bezeichnung „Schläge“. Importiere alle 4 Dateien (.dbf .prj .shp .shx)")])])]),t("tr",[t("td",[t("p",[e._v("Hessen")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v("Verwende die Dateien mit der Bezeichnung „SCHLAG“. Importiere alle 4 Dateien (.dbf .prj .shp .shx)")])])]),t("tr",[t("td",[t("p",[e._v("Saarland")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v("Verwende die Dateien mit der Bezeichnung „schlag“. Importiere alle 4 Dateien (.dbf .prj .shp .shx)")])])]),t("tr",[t("td",[t("p",[e._v("Rheinland-Pfalz")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v(" Verwende die Dateien mit der Bezeichnung „schlagdaten“. Importiere alle 4 Dateien (.dbf .prj .shp .shx) ")])])]),t("tr",[t("td",[t("p",[e._v("Thüringen")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[e._v("Verwende die Dateien im Ordner Teilflächen. Importiere alle 5 Dateien (.dat .dbf .prj .shp .shx)")])])]),t("tr",[t("td",[t("p",[e._v("Baden-Württemberg")])]),t("td",[t("p",[e._v("shape")])]),t("td",[t("p",[t("a",{attrs:{target:"_blank",href:"https://www.farmdok.com/import-anleitung/"}},[e._v("Zur Anleitung")])])])]),t("tr",[t("td",[t("p",[e._v(" Niedersachsen"),t("br"),e._v(" Bremen ")])]),t("td",[t("p",[e._v(" Shape"),t("br"),t("em",[e._v("und")]),t("u",[t("br")]),e._v("xml ")])]),t("td",[t("p",[e._v(" Verwende "),t("em",[e._v("beide")]),e._v(" Dateiformate (importiere am besten alle Dateien gleichzeitig):"),t("br"),e._v(" xml (eine Datei)"),t("br"),t("em",[e._v("und")]),t("u",[t("br")]),e._v("Shape (Teilschläge;
1 3 Dateien - .dbf .shp .shx) ")])])])])])]):e._e()])},kse=[],Sse={name:"ModalImportFileUploadInfo",components:{ModalWrapper:OC},model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1}},computed:{showEAmaInfo(){return this.$store.state.auth.currentCompanies[0].regionId===ee.AT},showGermanInfo(){return this.$store.state.auth.currentCompanies[0].regionId===ee.DE}}},Ese=Sse,Ise=(0,ew.Z)(Ese,Ase,kse,!1,null,"75274612",null),_se=Ise.exports;ow.vI.add(uw.KN3,lw.RLE,lw.eHv,lw.f8k);var Dse={name:"ImportFileUpload",components:{Button:gw,ErrorUserMessage:cH,MaxWidthContainer:Tw,ModalImportFileUploadInfo:_se},mixins:[cG],props:{importNextEnabled:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},fileUploadResponseData:{type:Object,default:null},importTargetProcessOrderId:{type:String,default:null},selectedFileGroupName:{type:String,default:null}},data(){return{infoModalVisible:!1,labelUploadInfo:this.$t("oder klicke {linkStart}Datei auswählen{linkEnd}, um eine Datei hinzuzufügen.",{linkStart:"#####",linkEnd:"#####"}),labelCsvDownloadLink:this.$t("Vorlage im Format .CSV {linkStart}herunterladen{linkEnd}",{linkStart:"#####",linkEnd:"#####"}),isDragover:!1,uploadedFiles:null,baseUrl:M}},computed:{labelUploadInfoParts(){return this.labelUploadInfo.split("#####")},labelCsvDownloadLinkParts(){return this.labelCsvDownloadLink.split("#####")},fileGroups(){return null==this.uploadedFiles||0===Object.values(this.uploadedFiles).length?[]:Object.keys(this.uploadedFiles).filter((e=>Array.isArray(this.uploadedFiles[e].files)&&this.uploadedFiles[e].files.length>0)).map((e=>{const t=[];null!=this.uploadedFiles[e].errors&&Object.keys(this.uploadedFiles[e].errors).forEach((i=>{t.push({key:i,...this.uploadedFiles[e].errors[i]})}));const i=[];return null!=this.uploadedFiles[e].warnings&&Object.keys(this.uploadedFiles[e].warnings).forEach((t=>{i.push({key:t,...this.uploadedFiles[e].warnings[t]})})),{key:e,files:this.uploadedFiles[e].files,errors:t,warnings:i}}))},fileGroupsByKey(){return this.fileGroups.reduce(((e,t)=>({...e,[t.key]:t})),{})}},watch:{selectedFileGroupName(){this.updateImportNextEnabled()},fileGroups(e){Array.isArray(e)&&0!==e.length?"string"===typeof this.selectedFileGroupName&&this.selectedFileGroupName.length>0||(this.$emit("update:selectedFileGroupName",e[0].key),this.updateImportNextEnabled()):this.$emit("update:selectedFileGroupName",null)}},async mounted(){this.updateImportNextEnabled(),this.$emit("update:fetching",!0);let e=this.fileUploadResponseData;if(null==e)try{const{data:t}=await l().get("/admin/rest/field/import_upload_files_status");e=ue(t)}catch(t){e=ue(t)}"success"===e.status||"partialSuccess"===e.status?("partialSuccess"===e.status&&(this.userErrorMessage=Object.values(e.errors).reduce(((e,t)=>null==t.errorUserMessage?e:Array.isArray(t.errorUserMessage)?[...e,...t.errorUserMessage]:[...e,t.errorUserMessage]),[])),this.uploadedFiles=e.data,this.$emit("update:fetching",!1)):this.setUserErrorMessageFromResponse(e)},methods:{updateImportNextEnabled(){const e=null!=this.selectedFileGroupName&&null!=this.fileGroupsByKey[this.selectedFileGroupName]&&(!Array.isArray(this.fileGroupsByKey[this.selectedFileGroupName].errors)||0===this.fileGroupsByKey[this.selectedFileGroupName].errors.length);this.$emit("update:importNextEnabled",e)},onFormClick(){0===this.fileGroups.length&&null!=this.$refs.input&&this.$refs.input.click()},onFileDrop(e){this.isDragover=!1,this.submit(e.dataTransfer.files)},onFileChange(e){this.submit(e.target.files)},async submit(e){if(e.length<1)return;this.userErrorMessage=null,this.$emit("update:fetching",!0);const t=new FormData;let i;Array.from(e).forEach((e=>{t.append("file[]",e)}));try{const{data:e}=await l().post("/admin/rest/field/import_upload_files",t);i=ue(e)}catch(a){i=ue(a)}if("success"!==i.status&&"partialSuccess"!==i.status)return this.setUserErrorMessageFromResponse(i),void this.$emit("update:fetching",!1);"partialSuccess"===i.status&&(this.userErrorMessage=Object.values(i.errors).reduce(((e,t)=>null==t.errorUserMessage?e:Array.isArray(t.errorUserMessage)?[...e,...t.errorUserMessage]:[...e,t.errorUserMessage]),[])),this.uploadedFiles=i.data,this.$emit("update:fetching",!1)},async onReset(e){let t;e.stopPropagation(),this.userErrorMessage=null,this.$emit("update:fetching",!0);try{const{data:e}=await l().post("/admin/rest/field/import_upload_files_reset");t=ue(e)}catch(i){t=ue(i)}"success"!==t.status?this.setUserErrorMessageFromResponse(t):this.uploadedFiles=null,this.$emit("update:fetching",!1)},onNext(e){e.stopPropagation(),this.$emit("next")},async next(){let e;this.userErrorMessage=null,this.$emit("update:fetching",!0);try{const{data:t}=await l().post("/admin/rest/field/import_map_data_from_uploaded_files",{version:"2.0",data:{mappingId:null,manualMapping:null,processOrderId:this.importTargetProcessOrderId,fileGroupName:this.selectedFileGroupName}});e=ue(t)}catch(t){e=ue(t)}return this.$emit("update:fetching",!1),"success"!==e.status?(this.setUserErrorMessageFromResponse(e),!1):e.data.mappings&&0!==e.data.mappings.length||e.data.rawData&&0!==e.data.rawData.length?(this.$emit("update:importData",e.data),!0):(this.userErrorMessage=`${this.selectedFileGroupName} ${this.$t("Upload fehlgeschlagen! Die Datei scheint defekt zu sein.\n           Probiere den Export aus der Quellapplikation zu einem späteren Zeitpunkt nochmal.\n           Sollte das Problem weiterhin auftreten, sende die Datei bitten an den Support.")}`,!1)}}},Mse=Dse,Pse=(0,ew.Z)(Mse,Cse,Fse,!1,null,"1b285ab5",null),Tse=Pse.exports,xse={name:"ImportLoadData",components:{ImportFileUpload:Tse,ImportEAma:wse,ErrorUserMessage:cH},props:{importNextEnabled:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},fileUploadResponseData:{type:Object,default:null},importTargetProcessOrderId:{type:String,default:null},selectedFileGroupName:{type:String,default:null},userErrorMessage:{type:String,default:null}},mounted(){["eAma","upload"].includes(this.$route.params.method)||this.$emit("back")}
1,methods:{async next(){return null!=this.$refs.loadDataComponent&&this.$refs.loadDataComponent.next()}}},Bse=xse,Ose=(0,ew.Z)(Bse,hse,mse,!1,null,"6d96efb1",null),$se=Ose.exports,Rse=function(){var e=this,t=e._self._c;return t("div",{staticClass:"import-map-data"},[t("MaxWidthContainer",{attrs:{size:"xl"}},[t("div",{staticClass:"import__intro"},[t("h2",{staticClass:"h1 my-3"},[e._v(e._s(e.$t("Daten in FARMDOK zuordnen.")))])]),t("ErrorUserMessage",{attrs:{"error-user-message":e.userErrorMessage}}),e.mappings.length>0?t("div",{staticClass:"w-100"},[t("p",[e._v(" "+e._s(e.$t("FARMDOK konnte den Ursprung deiner Daten leider nicht eindeutig feststellen. Bitte wähle aus der folgenden Liste den richtigen Eintrag aus:"))+" ")]),t("FormFieldSelect",{staticClass:"w-100",attrs:{required:"",disabled:e.fetching,label:e.$t("Daten Ursprung"),options:e.mappings},model:{value:e.mappingId,callback:function(t){e.mappingId=t},expression:"mappingId"}})],1):e._e()],1),e.useMappingsTable?t("div",{staticClass:"w-100"},[t("Table",{attrs:{fixed:"",transparent:"",size:"md",fields:e.tableFields,items:Object.values(e.importDataColumns)},scopedSlots:e._u([{key:"cell(status)",fn:function({item:i}){return[null!=e.selectedFarmdokColumns[i.key]?t("FontAwesomeIcon",{staticClass:"text-primary import-map-data__status-icon",attrs:{icon:["far","check-circle"]}}):t("FontAwesomeIcon",{staticClass:"text-danger import-map-data__status-icon",attrs:{icon:["far","exclamation-circle"]}})]}},{key:"cell(examples)",fn:function({value:i}){return e._l(i,(function(i,a){return t("div",{key:a},[e._v(" "+e._s(i)+" ")])}))}},{key:"cell(mapping)",fn:function({item:i}){return[t("FormFieldSelect",{staticClass:"w-100",attrs:{variant:"no-label",disabled:e.fetching,value:e.selectedFarmdokColumns[i.key],options:e.farmdokColumns},on:{update:t=>e.updateFarmdokColumn(i,t)}})]}}],null,!1,2642150438)})],1):e._e()],1)},Nse=[];ow.vI.add(lw.f8k,lw.RLE);const zse="DO_NOT_MAP";var Lse={name:"ImportMapData",components:{ErrorUserMessage:cH,FormFieldSelect:n9,MaxWidthContainer:Tw,Table:uie},mixins:[cG],props:{fetching:{type:Boolean,default:!1},importTargetCompanyId:{type:String,default:null},importData:{type:Object,default:null},importTargetProcessOrderId:{type:String,default:null},manualMapping:{type:Object,default:null},selectedFileGroupName:{type:String,default:null}},data(){const e=[{value:null,text:this.$t("Wählen ..."),disabled:!0},{value:zse,text:this.$t("Nicht übernehmen")},{value:"fieldGroup.number",text:this.$t("Feldstück Nummer")},{value:"field.number",text:this.$t("Nummer")},{value:"field.name",text:this.$t("Bezeichnung")},{value:"field.fieldSize",text:this.$t("Größe")},{value:"crop.name",text:this.$t("Kultur")},{value:"variety.name",text:this.$t("Sorte")},{value:"preCrop.name",text:this.$t("Vorfrucht")},{value:"field.kindofuse",text:this.$t("Nutzungsart")},{value:"field.comment",text:this.$t("Kommentar")},{value:"field.amaCode",text:this.$t("AMA Code")},{value:"field.additionalData.cadastralCommunity",text:this.$t("Gemeinde")},{value:"field.additionalData.plots",text:this.$t("Parzellen")},{value:"field.additionalData.owner",text:this.$t("Eigentümer")},{value:"field.additionalData.rightOfUse",text:this.$t("Nutzung durch")}];return{mappingId:null,farmdokColumns:e,selectedFarmdokColumns:{}}},computed:{tableFields(){return[{label:this.$t("Zugeordnet"),key:"status",width:"100px",tdClass:"text-center align-middle"},{label:this.$t("Spaltenüberschrift aus Datei"),key:"key",width:"20%",tdClass:"align-middle font-weight-bold"},{label:this.$t("Daten-Vorschau"),key:"examples",width:"25%",tdClass:"align-middle"},{label:this.$t("FARMDOK Eigenschaft"),key:"mapping",tdClass:"align-middle"}]},mappings(){return null==this.importData||!Array.isArray(this.importData.mappings)||this.importData.mappings.length<2?[]:[{value:null,text:this.$t("Wählen"),disabled:!0},...this.importData.mappings.map((({mapping:e})=>({value:e.id,text:e.name})))]},mappedData(){return null!=this.importData&&Array.isArray(this.importData.mappedData)&&0!==this.importData.mappedData.length?this.importData.mappedData:null},rawData(){return null==this.importData?null:this.importData.rawData},importDataColumns(){return null!=this.rawData&&Array.isArray(this.rawData.headers)&&Array.isArray(this.rawData.records)?this.rawData.headers.reduce(((e,t,i)=>({...e,[t]:{key:t,examples:this.rawData.records.map((e=>e[i])).filter((e=>"string"===typeof e&&e.length>0)).slice(0,4)}})),{}):null},useMappingsTable(){return 0===this.mappings.length&&null==this.mappedData&&null!=this.rawData}},watch:{mappings(){this.updateImportNextEnabled()},mappingId(){this.userErrorMessage=null,this.updateImportNextEnabled()}},created(){null!=this.manualMapping&&null!=this.importDataColumns&&(Object.keys(this.manualMapping).forEach((e=>{null!=this.importDataColumns[e]&&b["default"].set(this.selectedFarmdokColumns,e,this.manualMapping[e])})),this.$emit("update:manualMapping",this.selectedFarmdokColumns))},mounted(){0!==this.mappings.length||this.useMappingsTable||this.$emit("back"),this.updateImportNextEnabled()},methods:{updateImportNextEnabled(){this.$emit("update:importNextEnabled",this.mappings.length<2||null!=this.mappingId)},updateFarmdokColumn(e,t){this.userErrorMessage=null,null!=this.importDataColumns[e.key]&&(t!==zse&&Object.keys(this.selectedFarmdokColumns).forEac
1h((e=>{this.selectedFarmdokColumns[e]===t&&b["default"].set(this.selectedFarmdokColumns,e,null)})),b["default"].set(this.selectedFarmdokColumns,e.key,t),this.$emit("update:manualMapping",this.selectedFarmdokColumns))},async next(){if(this.userErrorMessage=null,this.mappings.length>1&&null==this.mappingId)return this.userErrorMessage=this.$t("Bitte wähle einen Eintrag aus."),!1;if(this.useMappingsTable&&!Object.values(this.importDataColumns).some((e=>"field.name"===this.selectedFarmdokColumns[e.key])))return this.userErrorMessage=this.$t('FARMDOK Eigenschaft "{fieldName}" muss gewählt sein.',{fieldName:this.$t("Bezeichnung")}),!1;let e,t=null;this.useMappingsTable&&(t=Object.keys(this.importDataColumns).reduce(((e,t)=>({...e,[t]:this.selectedFarmdokColumns[t]||null})),{})),this.$emit("update:fetching",!0);try{const{data:i}=await l().post("/admin/rest/field/import_map_data_from_uploaded_files",{version:"2.0",data:{mappingId:this.mappingId,manualMapping:t,processOrderId:this.importTargetProcessOrderId,fileGroupName:this.selectedFileGroupName}});e=ue(i)}catch(i){e=ue(i)}return this.$emit("update:fetching",!1),"success"!==e.status?(this.setUserErrorMessageFromResponse(e),!1):(this.$emit("update:importData",e.data),!0)}}},Vse=Lse,Use=(0,ew.Z)(Vse,Rse,Nse,!1,null,"3ba3e1f0",null),jse=Use.exports,Hse=function(){var e=this,t=e._self._c;return t("div",{staticClass:"import-preview-data"},[null!=e.userErrorMessage?t("ErrorUserMessage",{staticClass:"m-3",attrs:{"error-user-message":e.userErrorMessage}}):e._e(),t("TableBase",{ref:"table",staticClass:"import-preview-data__table",attrs:{id:"hot-import-preview-data","invert-selection-bg":"",cells:e.cells,loading:e.loading,"table-settings":e.tableSettings,"table-data":e.tableData,"selected-rows":e.selectedRows,"filter-string":e.filterString},on:{tableMounted:e.tableMounted,"update:selectedRows":t=>e.$emit("update:selectedRows",t),"update:visibleRows":t=>e.$emit("update:visibleRows",t),"update:filterString":t=>e.$emit("update:filterString",t),"update:cell":e.updateEntryByKeyAndValue,"click:columnHeaderLink":e.onClickColumnHeaderLink,hoverNotification:e.onHoverNotification},scopedSlots:e._u([{key:"footer",fn:function(){return[t("TableFooter",{attrs:{"total-rows":Object.keys(e.tableData).length,"visible-rows":e.visibleRows.length,"selected-rows":e.selectedRows.length}},[e._v(" "+e._s(e.$t("Summe Größe: {sizeTotalFormatted} ha",{sizeTotalFormatted:e.sizeTotalFormatted}))+" ")])]},proxy:!0}])}),e.mappingNotificationTarget?t("BTooltip",{attrs:{placement:"bottom",show:"",target:e.mappingNotificationTarget}},[e._v(" "+e._s(e.$t("Der Wert in der Datenquelle (aus dem Import) konnte nicht eindeutig erkannt werden. Bitte wähle eine Eintrag aus der Liste. Andernfalls kann kein Wert importiert werden."))+" ")]):e._e()],1)},Gse=[];const Wse=e=>{if("number"===typeof e)return e;if("string"!==typeof e){const t=Number(e);return Number.isNaN(e)?0:t}let t=1;"-"===e[0]&&(t=-1);const i=e.indexOf("."),a=e.indexOf(",");let n=null;return i>a&&i>-1?n=i:a>i&&a>-1&&(n=a),null==n?t*Number(e.replace(/[^0-9]/g,"")):t*Number(`${e.slice(0,n).replace(/[^0-9]/g,"")}.${e.slice(n+1).replace(/[^0-9]/g,"")}`)},Zse=b["default"].i18n.translate,Kse={...eA,key:"importedFieldGroup.number",lockedVisibility:!0,lockedPosition:!0,readOnly:!0,className:"imported-data",sortOrder:"asc"},qse={...IF,key:"importedField.number",lockedVisibility:!0,lockedPosition:!0,readOnly:!0,className:"imported-data"},Yse={...EF,key:"importedField.name",width:220,lockedVisibility:!0,lockedPosition:!0,readOnly:!0,className:"imported-data border-right text-bold"},Jse={key:"mappedCustomer.id",header:{title:()=>b["default"].i18n.translate("Kunde")},type:"dropdown",width:240,className:"border-right imported-data",getRendererValue({value:e}){return e?Lb.state.customers.data[e].name:""},async getItems(){if(null==this.$parent.fields)return[];const e=Object.values(Lb.state.customers.data);return[{name:null,id:"reset",items:[{id:"",name:"-"}]},{name:this.$t("Kunden"),id:"customers",items:e.map((e=>({id:e.id,name:e.name,disabled:!1})))}]},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},Xse={key:"mappedField.id",header:{title:()=>b["default"].i18n.translate("Feld")},type:"dropdown",width:300,className:"border-right",getRendererValue({value:e,visualRow:t}){const i=this.visualRowToGuid(t);if(!e&&null==this.tableData[i])return"";const a=e||this.tableData[i][Xse.key];return null==this.$parent.fields||null==this.$parent.fields[a]?this.$t("Neu"):sA.data(this.$parent.fields[a])},async getItems(e,t){if(null==this.$parent.fields)return[];const i=Object.values(this.tableData).reduce(((e,t)=>null==t[Xse.key]?e:[...e,t[Xse.key]]),[]),a=t.getSettings().columns.findIndex((e=>e.key===Jse.key)),n=t.toVisualColumn(a),r=t.getDataAtCell(e,n);return[{name:null,id:"reset",items:[{id:"new_field",name:this.$t("Neu")}]},{name:this.$t("Felder"),id:"fields",items:Object.values(this.$parent.fields).filter((e=>!r||e.fieldGroup.customerId===r)).map((e=>({id:e.id,name:sA.data(e),disabled:i.includes(e.id)}
1)))}]}},Qse={key:"importedCrop.id",header:{title:()=>`${Zse("Kultur")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"dropdown",width:250,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedCrop.name")},getRendererValue({value:e,visualRow:t}){if(null==e){const e=this.visualRowToGuid(t);return this.tableData[e]["importedCrop.name"]}return this.$parent.columnDropdownCropsGetRendererValue(null,{value:e})},async getItems(e){const t=await this.$parent.columnDropdownCropsGetItems(),i=this.visualRowToGuid(e);return Array.isArray(this.tableData[i]["mappedCrop.id"])&&0!==this.tableData[i]["mappedCrop.id"].length?[{id:"crops-suggestions",items:this.tableData[i]["mappedCrop.id"].filter((e=>null!=this.$parent.crops[e])).map((e=>({id:e,name:this.$parent.crops[e].name}))),name:b["default"].i18n.translate("Passende Kulturen"),sort:!0},...t]:t},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},eoe={key:"cropId",header:{title:()=>`${Zse("Kultur")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedCrop.name")},data({id:e}){return this.$parent.getCropNameForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.cropImportOption}},toe={..._F,key:"importedField.fieldSize",header:{title:()=>`${Zse("Größe")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},width:180,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.fieldSize")}},ioe={key:"fieldSize",header:{title:()=>`${Zse("Größe")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"numeric",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.fieldSize")},data({id:e}){return this.$parent.getFieldSizeForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.fieldSizeImportOption}},aoe={key:"importedField.kindOfUseId",header:{title:()=>`${Zse("Nutzungsart")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"dropdown",width:250,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.kindofuse")},getRendererValue({value:e,visualRow:t}){if(null==e){const e=this.visualRowToGuid(t);return this.tableData[e]["importedField.kindofuse"]}return this.$parent.dropdownItemsForFieldsGetRendererValue(CD,{value:e})},async getItems(){return this.$parent.dropdownItemsForFieldsGetItems(CD)},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},noe={key:"kindofuse",header:{title:()=>`${Zse("Nutzungsart")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.kindofuse")},data({id:e}){return this.$parent.getKindOfUseForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.kindOfUseImportOption}},roe={key:"importedField.varietyId",header:{title:()=>`${Zse("Sorte")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"dropdown",width:250,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedVariety.name")},getRendererValue({value:e,visualRow:t}){if(null==e){const e=this.visualRowToGuid(t);return this.tableData[e]["importedVariety.name"]}return this.$parent.columnDropdownVarietiesGetRendererValue(null,{value:e})},async getItems(e){const t=await this.$parent.columnDropdownVarietiesGetItems(),i=this.visualRowToGuid(e);return Array.isArray(this.tableData[i]["mappedVariety.id"])&&0!==this.tableData[i]["mappedVariety.id"].length?[{id:"variety-suggestions",items:this.tableData[i]["mappedVariety.id"].filter((e=>null!=this.$parent.varieties[e])).map((e=>({id:e,name:this.$parent.varieties[e].name}))),name:b["default"].i18n.translate("Passende Sorten"),sort:!0},...t]:t},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},soe={key:"varietyId",header:{title:()=>`${Zse("Sorte")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedVariety.name")},data({id:e}){return this.$parent.getVarietyNameForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.varietyImportOption}},ooe={key:"importedField.preCropId",header:{title:()=>`${Zse("Vorfrucht")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"dropdown",width:250,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedPreCrop.name")},getRendererValue({value:e,visualRow:t}){if(null==e){const e=this.visualRowToGuid(t);return this.tableData[e]["importedPreCrop.name"]}return this.$parent.columnDropdownCropsGetRendererValue(null,{value:e})},async getItems(e){const t=await this.$parent.columnDropdownCropsGetItems(),i=this.visualRowToGuid(e);return Array.isArray(this.tableData[i]["mappedPreCrop.id"])&&0!==this.tableData[i]["mappedPreCrop.id"].length?[{id:"crops-suggestions",items:this.tableData[i]["mappedPreCrop.id"].filter((e=>null!=this.$parent.crops[e])).map((e=>({id:e,name:this.$parent.crops[e].name}))),name:b["default"].i18n.translate("Passende Kulturen"),sort:!0},...t]:t},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},loe={key:"preCropId",header:{title:()=>`${Zse("Vorfrucht")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedPreCrop.name")},data({id:e}){return this.$parent.getPreCropNameForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.preCropImportOption}},doe={key:"importedField.comment",header:{title:()=>`${Zse("Kommentar")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"text",width:250,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.comment")}},coe={key:"comment",header:{title:()=>`${Zse("Kommentar")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.comment")},data({id:e}){return this.$parent.getCommentForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.commentImportOption}},uoe={key:"importedField.amaCodeId",header:{title:()=>`${Zse("AMA Code")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"dropdown",width:250,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.amaCode")},getRendererValue({value:e,visualRow:t}){if(null==e){const e=this.visualRowToGuid(t);return this.tableData[e]["importedField.amaCode"]}return this.$parent.dropdownItemsForFieldsGetRendererValue(AD,{value:e})},async getItems(){return this.$parent.dropdownItemsForFieldsGetItems(AD)},hoverNotification({visualRow:e,target:t}){const i=this.visualRowToGuid(e);this.$emit("hoverNotification",{id:i,target:t})}},poe={key:"amaCode",header:{title:()=>`${Zse("AMA Code")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.amaCode")},data({id:e}){return this.$parent.getAmaCodeForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.amaCodeImportOption}},hoe={key:"importedField.additionalData.cadastralCommunity",header:{title:()=>`${Zse("Gemeinde")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"text",width:250,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.cadastralCommunity")}},moe={key:"additionalData.cadastralCommunity",header:{title:()=>`${Zse("Gemeinde")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.cadastralCommunity")},data({id:e}){return this.$parent.getCadastralCommunityForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.cadastralCommunityImportOption}},foe={key:"importedField.additionalData.plots",header:{title:()=>`${Zse("Parzellen Nr.")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"text",width:250,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.plots")}},goe={key:"additionalData.plots",header:{title:()=>`${Zse("Parzellen Nr.")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.plots")},data({id:e}){return this.$parent.getPlotsForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.plotsImportOption}},yoe={key:"importedField.additionalData.owner",header:{title:()=>`${Zse("Eigentümer")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"text",width:250,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.owner")}},voe={key:"additionalData.owner",header:{title:()=>`${Zse("Eigentümer")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.owner")},data({id:e}){return this.$parent.getOwnerForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.ownerImportOption}}
1,boe={key:"importedField.additionalData.rightOfUse",header:{title:()=>`${Zse("Nutzung durch")} (${Zse("aus Import")})`,description:()=>b["default"].i18n.translate("Aus importierter Datei.")},type:"text",width:250,readOnly:!0,className:"imported-data",requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.rightOfUse")}},woe={key:"additionalData.rightOfUse",header:{title:()=>`${Zse("Nutzung durch")} (${Zse("in FARMDOK")})`,description:()=>b["default"].i18n.translate("In FARMDOK nach dem Import."),links:[{text:"Überschreiben",value:"overwrite"},{text:"Behalten",value:"keep"},{text:"Leere ergänzen",value:"fill"}]},type:"text",width:300,className:"border-right",readOnly:!0,requiredFeatures(e,t){return null!=t&&null!=t.importData&&Array.isArray(t.importData.mappedColumns)&&t.importData.mappedColumns.includes("importedField.additionalData.rightOfUse")},data({id:e}){return this.$parent.getRightOfUseForImportedRow(e)},getCurrentHeaderLinkValue(){return this.$parent.rightOfUseImportOption}},Coe=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},Jse,Kse,qse,Yse,Xse,Qse,eoe,toe,ioe,aoe,noe,roe,soe,ooe,loe,doe,coe,uoe,poe,hoe,moe,foe,goe,yoe,voe,boe,woe,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}],Foe=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},Jse,Kse,qse,Yse,Qse,toe,aoe,roe,ooe,doe,uoe,hoe,foe,yoe,boe,{...mI,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0}];var Aoe={name:"ImportPreviewData",components:{ErrorUserMessage:cH,TableFooter:hD,TableBase:oD},mixins:[gD,oI,dI(),ID(),yD(),cG],props:{fields:{type:Object,default:()=>({})},importData:{type:Object,default:null},importTargetProcessOrderId:{type:String,required:!0},manualMapping:{type:Object,default:null}},data(){let e=Coe;0===Object.values(this.fields).length&&(e=Foe);const t=0===Object.values(this.$store.getters.customers).length;return t&&(e=e.filter((e=>"mappedCustomer.id"!==e.key))),{loading:!0,columnDefinition:e,tableData:{},importSuccess:!1,mappingNotificationTarget:null,cropImportOption:"fill",fieldSizeImportOption:"fill",kindOfUseImportOption:"fill",varietyImportOption:"fill",preCropImportOption:"fill",commentImportOption:"fill",amaCodeImportOption:"fill",cadastralCommunityImportOption:"fill",plotsImportOption:"fill",ownerImportOption:"fill",rightOfUseImportOption:"fill"}},computed:{...(0,C.Se)({crops:"products/crops/data",varieties:"varieties/data"})},watch:{selectedRows(){this.userErrorMessage=null}},async mounted(){if(this.$store.dispatch("fields/subscribe",{forceRefresh:!0}),null==this.importData||null==this.importData.mappedData||!Array.isArray(this.importData.mappedData))return void this.$emit("back");this.$emit("update:importNextEnabled",!1),await Promise.all([new Promise((e=>setTimeout(e,300))),this.$store.dispatch("products/crops/subscribe"),this.$store.dispatch("varieties/subscribe")]);const e=[];this.tableData=this.importData.mappedData.reduce(((t,i,a)=>{const n=String(a);e.push(n);let r=null;null!=i[Xse.key]&&null!=this.fields[i[Xse.key]]&&(r=i[Xse.key]);let s=null;Array.isArray(i["mappedCustomer.id"])&&1===i["mappedCustomer.id"].length&&([s]=i["mappedCustomer.id"]);let o=null;Array.isArray(i["mappedCrop.id"])&&1===i["mappedCrop.id"].length&&([o]=i["mappedCrop.id"]);let l=null;Array.isArray(i["mappedVariety.id"])&&1===i["mappedVariety.id"].length&&([l]=i["mappedVariety.id"]);let d=null;Array.isArray(i["mappedPreCrop.id"])&&1===i["mappedPreCrop.id"].length&&([d]=i["mappedPreCrop.id"]);let c=null;null!=i["mappedKindofuse.id"]&&(c=i["mappedKindofuse.id"]);let u=i[toe.key];return null!=u&&0!==u||null==i["importedField.shape"]||"Polygon"!==i["importedField.shape"].type||(u=Math.floor((0,Y6.Z)(i["importedField.shape"]))/1e4),{...t,[n]:{...i,id:n,[Xse.key]:r,[Jse.key]:s,"importedCustomer.name":i["importedCustomer.name"],"importedCustomer.hbnr":i["importedCustomer.hbnr"],"importedCustomer.tbnr":i["importedCustomer.tbnr"],"importedCustomer.number":i["importedCustomer.number"],[toe.key]:u,[Qse.key]:o,[roe.key]:l,[ooe.key]:d,[aoe.key]:c}}}),{}),this.$emit("update:selectedRows",e),this.loading=!1,this.$emit("update:importNextEnabled",!0),window.onbeforeunload=()=>this.$t("Die Felder wurden noch nicht erstellt. Bist du sicher, dass du den Import abbrechen willst?")},beforeDestroy(){window.onbeforeunload=void 0},async beforeRouteLeave(e,t,i){if(0===e.name.indexOf("fields/import")||this.importSuccess)return void i();const a=await this.$confirm("Die Felder wurden noch nicht erstellt. Bist du sicher, dass du den Import abbrechen willst?");i(a)},methods:{getCropIdForImportedRow(e){if("keep"===this.cropImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].cropId}if("overwrite"===this.cropImportOption)return this.tableData[e][Qse.key];if("fill"===this.cropImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&null!=this.fields[t].cropId?this.fields[t].cropId:this.tableData[e][Qse.key]}return null},getCropNameForImportedRow(e){const t=this.getCropIdForImportedRow(e);return null==t||null==this.crops[t]?"":this.crops[t].name},getFieldSizeForImportedRow(e){if("keep"===this.fieldSizeImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:Wse(this.fields[t].fieldSize)}if("overwrite"===this.fieldSizeImportOption)return Wse(this.tableData[e][toe.key]);if("fill"===this.fieldSizeImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&null!=this.fields[t].fieldSize?Wse(this.fields[t].fieldSize):Wse(this.tableData[e][toe.key])}return null},getKindOfUseIdForImportedRow(e){if("keep"===this.kindOfUseImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].kindofuse}if("overwrite"===this.kindOfUseImportOption)return this.tableData[e][aoe.key];if("fill"===this.kindOfUseImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&null!=this.fields[t].cropId?this.fields[t].kindofuse:this.tableData[e][aoe.key]}return null},getKindOfUseForImportedRow(e){const t=this.getKindOfUseIdForImportedRow(e);return this.dropdownItemsForFieldsGetRendererValue(CD,{value:t})},getVarietyIdForImportedRow(e){if("keep"===this.varietyImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].varietyId}if("overwrite"===this.varietyImportOption)return this.tableData[e][roe.key];if("fill"===this.varietyImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&null!=this.fields[t].varietyId?this.fields[t].varietyId:this.tableData[e][roe.key]}return null},getVarietyNameForImportedRow(e){const t=this.getVarietyIdForImportedRow(e);return null==t||null==this.varieties[t]?"":this.varieties[t].name},getPreCropIdForImportedRow(e){if("keep"===this.preCropImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].preCropId}if("overwrite"===this.preCropImportOption)return this.tableData[e][ooe.key];if("fill"===this.preCropImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&null!=this.fields[t].preCropId?this.fields[t].preCropId:this.tableData[e][ooe.key]}return null},getPreCropNameForImportedRow(e){const t=this.getPreCropIdForImportedRow(e);return null==t||null==this.crops[t]?"":this.crops[t].name},getCommentForImportedRow(e){if("keep"===this.commentImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].comment}if("overwrite"===this.commentImportOption)return this.tableData[e][doe.key];if("fill"===this.commentImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof this.fields[t].comment&&this.fields[t].comment.length>0?this.fields[t].comment:this.tableData[e][doe.key]}return null},getAmaCodeIdForImportedRow(e){if("keep"===this.amaCodeImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:this.fields[t].amaCode}if("overwrite"===this.amaCodeImportOption)return this.tableData[e][uoe.key];if("fill"===this.amaCodeImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof this.fields[t].amaCode&&this.fields[t].amaCode.length>0?this.fields[t].amaCode:this.tableData[e][uoe.key]}return null},getAmaCodeForImportedRow(e){const t=this.getAmaCodeIdForImportedRow(e);return this.dropdownItemsForFieldsGetRendererValue(AD,{value:t})},getCadastralCommunityForImportedRow(e){if("keep"===this.cadastralCommunityImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:Ru(this.fields[t],"additionalData.cadastralCommunity")}if("overwrite"===this.cadastralCommunityImportOption)return this.tableData[e][hoe.key];if("fill"===this.cadastralCommunityImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof Ru(this.fields[t],"additionalData.cadastralCommunity")&&Ru(this.fields[t],"additionalData.cadastralCommunity").length>0?Ru(this.fields[t],"additionalData.cadastralCommunity"):this.tableData[e][hoe.key]}return null},getPlotsForImportedRow(e){if("keep"===this.plotsImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:Ru(this.fields[t],"additionalData.plots")}if("overwrite"===this.plotsImportOption)return this.tableData[e][foe.key];if("fill"===this.plotsImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof Ru(this.fields[t],"additionalData.plots")&&Ru(this.fields[t],"additionalData.plots").length>0?Ru(this.fields[t],"additionalData.plots"):this.tableData[e][foe.key]}return null},getOwnerForImportedRow(e){if("keep"===this.ownerImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:Ru(this.fields[t],"additionalData.owner")}if("overwrite"===this.ownerImportOption)return this.tableData[e][yoe.key];if("fill"===this.ownerImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof Ru(this.fields[t],"additionalData.owner")&&Ru(this.fields[t],"additionalData.owner").length>0?Ru(this.fields[t],"additionalData.owner"):this.tableData[e][yoe.key]}return null},getRightOfUseForImportedRow(e){if("keep"===this.rightOfUseImportOption){const t=this.tableData[e][Xse.key];return null==t||null==this.fields[t]?null:Ru(this.fields[t],"additionalData.r
1ightOfUse")}if("overwrite"===this.rightOfUseImportOption)return this.tableData[e][boe.key];if("fill"===this.rightOfUseImportOption){const t=this.tableData[e][Xse.key];return null!=t&&null!=this.fields[t]&&"string"===typeof Ru(this.fields[t],"additionalData.rightOfUse")&&Ru(this.fields[t],"additionalData.rightOfUse").length>0?Ru(this.fields[t],"additionalData.rightOfUse"):this.tableData[e][boe.key]}return null},async onHoverNotification({target:e}){e!==this.mappingNotificationTarget&&(this.mappingNotificationTarget=null,await this.$nextTick(),this.mappingNotificationTarget=e)},cells(e,t,i){if(null==this.tableSettings||null==this.tableSettings.columns||null==this.tableSettings.columns[t])return i;const a=this.tableSettings.columns[t];if(a.key===Jse.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;const s=this.tableData[n];return null!=s&&null!=s["mappedCustomer.id"]&&(r={category:this.$t("Kunde in der Datenquelle (aus dem Import)"),value:s["importedCustomer.name"]??s["importedCustomer.hbnr"]??s["importedCustomer.tbnr"]??s["importedCustomer.number"]}),null==s||null!=s[a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===Qse.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;return null!=this.tableData[n]&&null!=this.tableData[n]["importedCrop.name"]&&(r={category:this.$t("Kultur in der Datenquelle (aus dem Import)"),value:this.tableData[n]["importedCrop.name"]}),null==this.tableData[n]||null!=this.tableData[n][a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===eoe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.cropImportOption)t.push("overwrite-data");else if("fill"===this.cropImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&null!=this.fields[this.tableData[i][Xse.key]].cropId||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===ioe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.fieldSizeImportOption)t.push("overwrite-data");else if("fill"===this.fieldSizeImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&null!=this.fields[this.tableData[i][Xse.key]].fieldSize||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===aoe.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;return null!=this.tableData[n]&&null!=this.tableData[n]["importedField.kindofuse"]&&(r={category:this.$t("Nuzungsart in der Datenquelle (aus dem Import)"),value:this.tableData[n]["importedField.kindofuse"]}),null==this.tableData[n]||null!=this.tableData[n][a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===noe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.kindOfUseImportOption)t.push("overwrite-data");else if("fill"===this.kindOfUseImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&null!=this.fields[this.tableData[i][Xse.key]].kindofuse||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===roe.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;return null!=this.tableData[n]&&null!=this.tableData[n]["importedVariety.name"]&&(r={category:this.$t("Sorte in der Datenquelle (aus dem Import)"),value:this.tableData[n]["importedVariety.name"]}),null==this.tableData[n]||null!=this.tableData[n][a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===soe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.varietyImportOption)t.push("overwrite-d
1ata");else if("fill"===this.varietyImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&null!=this.fields[this.tableData[i][Xse.key]].varietyId||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===ooe.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;return null!=this.tableData[n]&&null!=this.tableData[n]["importedPreCrop.name"]&&(r={category:this.$t("Vorfrucht in der Datenquelle (aus dem Import)"),value:this.tableData[n]["importedPreCrop.name"]}),null==this.tableData[n]||null!=this.tableData[n][a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===loe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.preCropImportOption)t.push("overwrite-data");else if("fill"===this.preCropImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&null!=this.fields[this.tableData[i][Xse.key]].preCropId||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===coe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.commentImportOption)t.push("overwrite-data");else if("fill"===this.commentImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof this.fields[this.tableData[i][Xse.key]].comment&&0!==this.fields[this.tableData[i][Xse.key]].comment.length||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===uoe.key){let t=[];"string"===typeof a.className&&(t=a.className.split(" "));const n=this.$refs.table.physicalRowToGuid(e);let r=null;return null!=this.tableData[n]&&null!=this.tableData[n]["importedField.amaCode"]&&(r={category:this.$t("AMA Code in der Datenquelle (aus dem Import)"),value:this.tableData[n]["importedField.amaCode"]}),null==this.tableData[n]||null!=this.tableData[n][a.key]?{...i,className:t.join(" "),showNotification:!1,dropdownComparableItem:r}:{...i,className:[...t,"warning"].join(" "),showNotification:!0,dropdownComparableItem:r}}if(a.key===poe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.amaCodeImportOption)t.push("overwrite-data");else if("fill"===this.amaCodeImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof this.fields[this.tableData[i][Xse.key]].amaCode&&0!==this.fields[this.tableData[i][Xse.key]].amaCode.length||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===moe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.cadastralCommunityImportOption)t.push("overwrite-data");else if("fill"===this.cadastralCommunityImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.cadastralCommunity")&&0!==Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.cadastralCommunity").length||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===goe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.plotsImportOption)t.push("overwrite-data");else if("fill"===this.plotsImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.plots")&&0!==Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.plots").length||t.push("overwrite-d
1ata")}return{...i,className:t.join(" ")}}if(a.key===voe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.ownerImportOption)t.push("overwrite-data");else if("fill"===this.ownerImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.owner")&&0!==Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.owner").length||t.push("overwrite-data")}return{...i,className:t.join(" ")}}if(a.key===woe.key){let t=[];if("string"===typeof a.className&&(t=a.className.split(" ")),"overwrite"===this.rightOfUseImportOption)t.push("overwrite-data");else if("fill"===this.rightOfUseImportOption){const i=this.$refs.table.physicalRowToGuid(e);null!=this.tableData[i]&&null!=this.tableData[i][Xse.key]&&null!=this.fields[this.tableData[i][Xse.key]]&&"string"===typeof Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.rightOfUse")&&0!==Ru(this.fields[this.tableData[i][Xse.key]],"additionalData.rightOfUse").length||t.push("overwrite-data")}return{...i,className:t.join(" ")}}return i},onClickColumnHeaderLink({column:e,link:t}){e.key===eoe.key&&(this.cropImportOption=t.value),e.key===ioe.key&&(this.fieldSizeImportOption=t.value),e.key===noe.key&&(this.kindOfUseImportOption=t.value),e.key===soe.key&&(this.varietyImportOption=t.value),e.key===loe.key&&(this.preCropImportOption=t.value),e.key===coe.key&&(this.commentImportOption=t.value),e.key===poe.key&&(this.amaCodeImportOption=t.value),e.key===moe.key&&(this.cadastralCommunityImportOption=t.value),e.key===goe.key&&(this.plotsImportOption=t.value),e.key===voe.key&&(this.ownerImportOption=t.value),e.key===woe.key&&(this.rightOfUseImportOption=t.value),this.$refs.table.hotRender()},updateEntryByKeyAndValue({columnKey:e,guid:t,value:i}){this.userErrorMessage=null;const a={[Qse.key]:"importedCrop.name",[aoe.key]:"importedField.kindofuse",[roe.key]:"importedVariety.name",[ooe.key]:"importedPreCrop.name",[uoe.key]:"importedField.amaCode",[Jse.key]:"mappedCustomer.id"};if(e===Jse.key){const i=this.tableData[t][e];this.overwriteRowsOfMatchingValues({referenceColumn:Jse.key,targetColumn:Xse.key,referenceValue:i,targetValue:"new_field"})}if(e===Xse.key){const e=this.fields[i],a=e?.fieldGroup.customerId??"";this.tableData[t][Jse.key]=a}Object.keys(a).includes(e)?this.updateMultipleEntries({columnKey:e,importedValueColumnKey:a[e],guid:t,value:i}):this.tableData={...this.tableData,[t]:{...this.tableData[t],[e]:i}}},updateMultipleEntries({columnKey:e,importedValueColumnKey:t,guid:i,value:a}){const n=this.tableData[i][t];this.tableData=Object.values(this.tableData).reduce(((r,s)=>s.id===i||null==s[e]&&s[t]===n?{...r,[s.id]:{...s,[e]:a}}:r),this.tableData)},overwriteRowsOfMatchingValues({referenceColumn:e,targetColumn:t,referenceValue:i,targetValue:a}){this.tableData=Object.values(this.tableData).reduce(((n,r)=>r[e]===i?{...n,[r.id]:{...r,[t]:a}}:n),this.tableData)},calculateSizeTotalAddFieldSize(e,t){const i=Number(this.getFieldSizeForImportedRow(t.id));return Number.isNaN(i)?e:e+i},async next(){if(this.userErrorMessage=null,await this.$nextTick(),this.selectedRows.length<1)return void(this.userErrorMessage=this.$t("Du musst zumindest ein Feld für den Import wählen."));let e=0,t=!1;const i=this.selectedRows.map((i=>{let a=this.tableData[i][Xse.key];null==a||"new_field"===a?a=ma():e+=1,null==this.tableData[i][Qse.key]&&(t=!0);const n=ce({processOrderId:this.importTargetProcessOrderId,"fieldGroup.mfa":this.tableData[i][Kse.key],"fieldGroup.customerId":this.tableData[i][Jse.key],fieldNumber:this.tableData[i][qse.key],name:this.tableData[i][Yse.key],cropId:this.getCropIdForImportedRow(i)||null,fieldSize:this.getFieldSizeForImportedRow(i),kindofuse:this.getKindOfUseIdForImportedRow(i),varietyId:this.getVarietyIdForImportedRow(i),preCropId:this.getPreCropIdForImportedRow(i),comment:this.getCommentForImportedRow(i),amaCode:this.getAmaCodeIdForImportedRow(i),additionalData:{cadastralCommunity:this.getCadastralCommunityForImportedRow(i),plots:this.getPlotsForImportedRow(i),owner:this.getOwnerForImportedRow(i),rightOfUse:this.getRightOfUseForImportedRow(i)}},dd,cd);if(null!=this.tableData[i]["importedField.shape"]&&"Polygon"===this.tableData[i]["importedField.shape"].type){const{lat:e,lon:t}=i4(this.tableData[i]["importedField.shape"]);n.fieldContour={geoJson:this.tableData[i]["importedField.shape"],fieldId:a},n.fieldContour.id=fa(oe,a),n.lat=e,n.lon=t}return{...n,id:a}}));let a,n=!0;if(e>0||i.length/Object.keys(this.tableData).length<.5||t&&["overwrite","fill"].includes(this.cropImportOption)){const a=[];i.length>1?a.push(this.$t("Du importierst {count} Felder.",{count:i.length})):1===i.length&&a.push(this.$t("Du importierst ein Feld.")),e>1?a.push(this.$t("Dabei werden {count} bestehende Felder verändert.",{count:e})):1===e&&a.push(this.$t("Dabei wird ein bestehendes Feld verändert.")),this.tableSettings.columns.some((e=>e.key===Qse.key))&&t&&["overwrite","fill"].includes(this.cropImportOption)&&a.push(this.$t("Nicht alle importierten Kulturen konnten FARMDOK Kulturen zugeordnet werden.")),a.push(this.$t("Möchtest du fortfahren?")),n=await this.$confirm({title:this.$t("Importieren"),message:a.join(" ")})}if(n){this.$emit("update:fetching",!0);try{const e=Rs()(i,100),t=e.map((e=>l().put("/admin/rest/field/",{version:"2.0",data:e}).then((e=>e.data)))),n=(await Promise.all(t)).reduce(((e,t)=>({...e,data:[...e.data,...t.data],total:e.total+t.total})));a=ue(n)}catch(r){a=ue(r)}
1"success"!==a.status?(this.setUserErrorMessageFromResponse(a),await this.$router.push({name:"fields/import/load-data",params:{userErrorMessage:a.errorUserMessage[0],importNextEnabled:!0,method:"upload"}})):(this.importSuccess=!0,this.userErrorMessage=null,null!=this.manualMapping&&Object.keys(this.manualMapping).length>0?await Promise.all([l().post("/admin/rest/field/import_store_custom_mapping"),l().post("/admin/rest/field/import_upload_files_reset"),this.$store.dispatch("fields/reset")]):await Promise.all([l().post("/admin/rest/field/import_upload_files_reset"),this.$store.dispatch("fields/reset")]),await this.$router.push({name:"fields"})),this.$emit("update:fetching",!1)}}}},koe=Aoe,Soe=(0,ew.Z)(koe,Hse,Gse,!1,null,"8ee69f18",null),Eoe=Soe.exports;const Ioe=()=>{const e=["field-groups","fields"];return Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_CROP_ROTATION)&&e.push("crop-rotation"),Lb.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_SOIL_SAMPLES)&&e.push("soil-samples"),e},_oe={to:{name:"fields"},label:()=>b["default"].i18n.translate("Zurück zu Felder")};var Doe=[{path:`${M}fields`,name:"fields",component:mne,meta:{requiresAuth:!0,tabs:Ioe,label:()=>b["default"].i18n.translate("Felder"),featureControl:Hr.FEATURE_FIELDS},async beforeEnter(e,t,i){null!=t&&"string"===typeof t.name&&0!==t.name.indexOf("fields")&&await Lb.dispatch("fields/reset"),i()}},{path:`${M}fields/record/:fieldId`,name:"fields/record",component:mne,meta:{requiresAuth:!0,tabs:Ioe,label:()=>b["default"].i18n.translate("Felder"),featureControl:Hr.FEATURE_FIELDS}},{path:`${M}fields/restore`,name:"fields/restore",component:Tre,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder wiederherstellen"),subheader:()=>b["default"].i18n.translate("Felder wiederherstellen, die in den letzten 90 Tagen gelöscht wurden"),back:_oe,featureControl:Hr.FEATURE_FIELDS}},{path:`${M}fields/import`,name:"fields/import",component:wne,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder importieren"),back:_oe,featureControl:Hr.FEATURE_FIELDS},children:[{path:"choose-method",name:"fields/import/choose-method",component:pse,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder importieren"),back:_oe}},{path:"load-data/:method",name:"fields/import/load-data",component:$se,props:!0,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder importieren"),back:_oe}},{path:"map-data",name:"fields/import/map-data",component:jse,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder importieren"),back:_oe}},{path:"preview-data",name:"fields/import/preview-data",component:Eoe,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Felder importieren"),back:_oe}}]},{path:`${M}fields/crop-rotation`,name:"crop-rotation",component:x7,meta:{requiresAuth:!0,tabs:Ioe,label:()=>b["default"].i18n.translate("Fruchtfolge"),featureControl:Hr.FEATURE_CROP_ROTATION}},{path:`${M}fields/soil-samples`,name:"soil-samples",component:sse,meta:{requiresAuth:!0,tabs:Ioe,label:()=>b["default"].i18n.translate("Bodenproben"),featureControl:Hr.FEATURE_SOIL_SAMPLES}},{path:`${M}more/shared-fields`,name:"more/shared-fields",component:ese,meta:{requiresAuth:!0,tabs:["more/shared-fields"],label:()=>b["default"].i18n.translate("Freigegebene Felder"),featureControl:Hr.FEATURE_FIELDS_SHARED}},{path:`${M}more/shared-fields/record/:fieldId`,name:"more/shared-fields/record",component:ese,meta:{requiresAuth:!0,tabs:["more/shared-fields"],label:()=>b["default"].i18n.translate("Freigegebene Felder"),featureControl:Hr.FEATURE_FIELDS_SHARED}},{path:`${M}map`,name:"map",redirect:{name:"map/fields"}},{path:`${M}map/fields`,name:"map/fields",component:gre,meta:{requiresAuth:!0,tabs:["map/fields","map/activities"],label:()=>b["default"].i18n.translate("Karte"),labelTab:()=>b["default"].i18n.translate("Felder"),featureControl:Hr.FEATURE_FIELDS}},{path:`${M}map/activities`,name:"map/activities",component:I7,meta:{requiresAuth:!0,tabs:["map/fields","map/activities"],label:()=>b["default"].i18n.translate("Karte"),labelTab:()=>b["default"].i18n.translate("Maßnahmen"),featureControl:Hr.FEATURE_ACTIVITIES}}],Moe=function(){var e=this,t=e._self._c;return t("div",[e._v(" "+e._s(e.$t("404: Nicht gefunden."))+" ")])},Poe=[],Toe={name:"PageNotFound"},xoe=Toe,Boe=(0,ew.Z)(xoe,Moe,Poe,!1,null,"06512941",null),Ooe=Boe.exports,$oe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("PageApplicationMaps",{attrs:{workflowKey:"spraying",stepCount:4},on:{onNavigationNext:e.onNavigationNext},scopedSlots:e._u([{key:"steps",fn:function(){return[t("SidebarFields",{directives:[{name:"show",rawName:"v-show",value:1===e.paginationStep,expression:"paginationStep === 1"}],attrs:{tableId:"sidebar-table-fields-spraying",selectedRows:e.selectedFieldIds,customColumnDefinition:e.columnDefinition},on:{"update:selectedRows":function(t){e.selectedFieldIds=t},"update:selected-rows":function(t){e.selectedFieldIds=t}}}),t("SidebarZones",{directives:[{name:"show",rawName:"v-show",value:2===e.paginationStep,expression:"paginationStep === 2"}],attrs:{workflowKey:"spraying"}}),3===e.paginationStep?t("SidebarCreateApplicationMapSpraying"):e._e(),4===e.paginationStep?t("SidebarExportSpraying"):e._e(),t("ModalConfirmation",{attrs:{primaryText:e.$t("Zurück"),messages:e.messages},on:{ignore:function(t){return e.stepForward()}},model:{value:e.confirmationRequired,callback:function(t){e.confirmationRequired=t},expression:"confirmationRequired"}})]},proxy:!0}])})},Roe=[];const Noe=[{...oA,hiddenInPageSettings:!0,lockedVisibility:!0,lockedPosition:!0},{...XF,lockedVisibility:!0,lockedPosition:!0,requiredFeatures:e=>e.state.auth.currentCompanies.length>1},{...rA,header:{title:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld"),description:()=>b["default"].i18n.translate("Kunde - Feldstück - Feld")},width:145,lockedPosition:!0,sortOrder:"asc"},{..._F,readOnly:!0,width:70},{...DF,lockedPosition:!1,readOnly:!0,width:85},{...MF,readOnly:!0,width:85},{...IF,hiddenPerDefault:!0,readOnly:!0},{...tA,hiddenPerDefault:!0,readOnly:!0},{...EF,hiddenPerDefault:!0,className:"",width:145,readOnly:!0},{...nA,hiddenPerDefault:!0,readOnly:!0},dA];var zoe={international:Noe},Loe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{attrs:{title:e.title,okTitle:e.primaryText,cancelTitle:e.secondaryText,visible:e.visible},on:{change:t=>e.$emit("hide",t)},scopedSlots:e._u([{key:"buttons",fn:function(){return[t("Button",{attrs:{variant:"primary","component-namespace-name":"ButtonBack"},on:{click:e.reset}},[e._v(" "+e._s(e.primaryText)+" ")]),t("Button",{attrs:{variant:"white","component-namespace-name":"ButtonIgnore"},on:{click:e.ignore}},[e._v(" "+e._s(e.secondaryText)+" ")])]},proxy:!0}])},e._l(e.messages,(function(i,a){return t("p",{key:a,staticClass:"text-ju
1stify"},[e._v(e._s(i))])})),0)},Voe=[];const Uoe=b["default"].i18n.translate;var joe=(0,b.defineComponent)({components:{Button:gw,ModalWrapper:OC},name:"ModalConfirmation",emits:["hide","ignore","reset"],props:{visible:{type:Boolean,required:!1,default:!1},title:{type:String,required:!1,default:`${Uoe("Achtung")}!`},primaryText:{type:String,required:!1,default:Uoe("Zurücksetzen")},secondaryText:{type:String,required:!1,default:Uoe("Weiter")},messages:{type:Array,required:!1,default:()=>[]}},model:{prop:"visible",event:"hide"},methods:{ignore(){this.$emit("hide",!1),this.$emit("ignore")},reset(){this.$emit("hide",!1),this.$emit("reset")}}}),Hoe=joe,Goe=(0,ew.Z)(Hoe,Loe,Voe,!1,null,null,null),Woe=Goe.exports,Zoe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-zones"},[t("SidebarHeadline",{attrs:{text:e.$t("Zonenkarte erstellen")}}),t("div",{staticClass:"sidebar-zones__scrollable-container"},[t("SidebarSubHeadline",{staticClass:"mt-0"},[t("Tabs",{attrs:{tabs:[e.buttonSatellites,e.buttonUpload],fill:""}})],1),t("SidebarContentWrapper",[e.buttonUpload.active?t("FormUploadZoneFiles",{attrs:{workflowKey:e.workflowKey}}):e._e(),e.buttonSatellites.active?t("FormZones",{attrs:{workflowKey:e.workflowKey}}):e._e()],1),t("SidebarContentWrapper",[t("SidebarSubHeadline",{staticClass:"pl-0",attrs:{text:e.$t("Zonen Ergebnis")}}),t("TableZonesContainer",{attrs:{workflowKey:e.workflowKey}})],1)],1)],1)},Koe=[],qoe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("FormFieldDatepicker",{ref:"datepicker",attrs:{variant:"vertical",label:e.$t("Datum"),loading:e.loadingHeatmaps,disabledDates:{customPredictor:e.disableIf},step:5},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}}),t("FormFieldSetBordered",{attrs:{collapsible:!0,labelLinkOpen:e.$t("Einstellungen anzeigen"),labelLinkClose:e.$t("Einstellungen verstecken"),collapsed:!0,headline:e.$t("Einstellungen für die Zonierung")},scopedSlots:e._u([{key:"description",fn:function(){return[t("span",[e._v(e._s(e.$t("Zonen basiert auf {indexType}, Anzahl der Zonen: {quantisationCode}",{indexType:e.selectedIndex.name,quantisationCode:e.selectedQuantisationCode.name})))])]},proxy:!0}])},[t("ControlSatelliteIndex",{attrs:{indexTypes:e.indexTypes},model:{value:e.selectedIndex,callback:function(t){e.selectedIndex=t},expression:"selectedIndex"}}),t("ControlNumZones",{model:{value:e.selectedQuantisationCode,callback:function(t){e.selectedQuantisationCode=t},expression:"selectedQuantisationCode"}})],1)],1)},Yoe=[],Joe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("FormFieldDropdown",{ref:"quantisationCode",attrs:{items:e.dropdownItems,label:e.$t("Anzahl der Zonen")??"",disableDelete:"",slimMargin:"",variant:"vertical",value:e.quantisationCode,id:"quantisation-code"},on:{update:t=>e.$emit("update:quantisationCode",t)}}),t("BTooltip",{attrs:{target:"quantisation-code",triggers:"hover",delay:500}},[e._v(" "+e._s(e.$t("„hoch“ ergibt mehrere, kleine Teilflächen; „niedrig“ weniger, größere"))+" ")])],1)},Xoe=[];const Qoe=b["default"].i18n.translate;var ele=(0,b.defineComponent)({name:"ControlNumZones",components:{FormFieldDropdown:lk},props:{quantisationCode:{type:Object,required:!1,default:()=>({id:"medium",name:Qoe("Mittel")})}},emits:["update:quantisationCode"],model:{prop:"quantisationCode",event:"update:quantisationCode"},data(){const e=[{id:"high",name:Qoe("Hoch")},{id:"medium",name:Qoe("Mittel")},{id:"low",name:Qoe("Gering")}];return{quantisationCodes:e,dropdownItems:[{items:e}]}}}),tle=ele,ile=(0,ew.Z)(tle,Joe,Xoe,!1,null,"54dfe1c8",null),ale=ile.exports,nle=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("FormFieldDropdown",{ref:"indexType",attrs:{items:e.indexTypes,label:e.$t("Satellitenindex")??"",disableDelete:"",slimMargin:"",variant:"vertical",value:e.selectedIndex,id:"index-type"},on:{update:t=>e.$emit("update:selectedIndex",t)}}),t("BTooltip",{attrs:{target:"index-type",triggers:"hover",delay:500}},[e._v(" "+e._s(e.$t("Der Index wird aus Satellitendaten berechnet und bildet die Basis für die Teilflächen (Zonen)."))+" ")])],1)},rle=[],sle=(0,b.defineComponent)({name:"ControlSatelliteIndex",components:{FormFieldDropdown:lk},props:{selectedIndex:{type:Object,required:!1,default:()=>({id:"",name:""})},indexTypes:{type:Array,required:!0,default:()=>[]}},emits:["update:selectedIndex"],model:{prop:"selectedIndex",event:"update:selectedIndex"}}),ole=sle,lle=(0,ew.Z)(ole,nle,rle,!1,null,"756822ac",null),dle=lle.exports;
1function cle(e){const[t,i,,,a]=e.icon,n="fad"===e.prefix,r=Array.isArray(a)?a:[a];return`<svg\n    aria-hidden="true"\n    focusable="false"\n    data-prefix="${e.prefix}"\n    data-icon="${e.iconName}"\n    role="img"\n    xmlns="http://www.w3.org/2000/svg"\n    viewBox="0 0 ${t} ${i}"\n    class="svg-inline--fa ${e.iconName}"\n  >\n    ${n?'<g class="fa-duotone-group">':""}\n      ${r.map(((e,t)=>{const i=n&&1===t;return`<path\n            fill="currentColor"\n            d="${e}"\n            class="${i?"fa-secondary":""}"\n          ></path>`})).join("")}\n    ${n?"</g>":""}\n  </svg>`}const ule=b["default"].i18n.translate,ple=cle(yF.uM9);var hle=(0,b.defineComponent)({name:"FormZones",components:{FormFieldDatepicker:g_,FormFieldSetBordered:Cee,ControlNumZones:ale,ControlSatelliteIndex:dle},props:{workflowKey:{type:String,required:!0}},data(){return{activeDate:new Date,activeIndexType:void 0,activeQuantisationCode:{id:"medium",name:ule("Mittel")}}},computed:{...(0,C.rn)("precisionFarming/applicationMaps",{selectedFieldIds(e){return e[this.workflowKey].selectedFields},indexTypeSelected(e,t){return t[`${this.workflowKey}/selectedIndexType`]},heatmaps(e){const t=e[this.workflowKey].heatmaps.current;return Object.entries(t).filter((([e])=>e.includes(this.selectedQuantisationCode.id))).filter((([e])=>e.includes(this.selectedIndex.id))).map((([,e])=>e))},loadingHeatmaps(e){return e[this.workflowKey].heatmaps.fetching},availability(e,t){return t[`${this.workflowKey}/availableTimestamps`]},heatmapTimestampSelectedIndex(e,t){return t[`${this.workflowKey}/heatmapTimestampSelectedIndex`]}}),availableTimestamps(){return this.availability},availableDates(){const{timeArray:e}=this.availableTimestamps;return e.sort(((e,t)=>e-t)).map((e=>g().unix(e)))},indexTypes(){return this.$store.getters[`precisionFarming/applicationMaps/${this.workflowKey}/indexTypes`]},selectedDate:{set(e){this.activeDate=e;const t=g()(e).startOf("day"),{timeArray:i}=this.availableTimestamps,a=i.find((e=>g().unix(e).isSame(t,"day")))??t.unix();this.setHeatmapTimestamp(a)},get(){const e=this.$store.state[`precisionFarming/applicationMaps/${this.workflowKey}`],t=e?.selectedHeatmapTimestamp;return t?g().unix(t).toDate():this.activeDate}},disableIf(){const{selectedIndex:e,isForecastable:t,availableDates:i}=this;return a=>{if(t(e))return!1;const n=g()(a);return!i.some((e=>e.isSame(n,"day")))}},selectedIndex:{set(e){this.activeIndexType=e,this.setSelectedIndexType(e.id)},get(){return this.activeIndexType??this.initialIndexType()}},selectedQuantisationCode:{set(e){this.activeQuantisationCode=e,this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedQuantisationCode`,e.id),this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/loadHeatmaps`)},get(){return this.activeQuantisationCode}}},methods:{mostRecentDate(){const e=this.availableDates.find(((e,t,i)=>t===i.length-1))?.toDate();return e??new Date},isForecastable(e){return e.id?.includes("DNN_")??!1},dayCellContent(e){return e.isHighlighted?`${e.date}${ple}`:`${e.date}`},initialIndexType(){const e=this.$store.state.precisionFarming.applicationMaps[this.workflowKey].selectedIndexType,t={id:"",name:""},i=this.indexTypes.flatMap((e=>e.items)).find((t=>t.id===e));return i??t},setSelectedIndexType(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedIndexType`,e)},setHeatmapTimestamp(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setHeatmapTimestamp`,e)},async loadHeatmaps(){return this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/loadHeatmaps`)}},watch:{selectedDate(){this.loadHeatmaps()},async selectedIndex(e,t){const i=this.selectedFieldIds.map((e=>this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setMultipolyTimestamp`,e)));await Promise.all(i),this.isForecastable(t)&&!this.isForecastable(e)&&(this.selectedDate=this.mostRecentDate()),this.loadHeatmaps()}}}),mle=hle,fle=(0,ew.Z)(mle,qoe,Yoe,!1,null,"114a3d65",null),gle=fle.exports,yle=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.ResultTable,{attrs:{columns:i.columns,data:i.tableData,footer:i.footer}})},vle=[],ble=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[e.loading?t("TableLoading",{attrs:{columns:e.columns}}):t("table",{class:e.tableClass},[t("colgroup",e._l(e.columns,(function(e){return t("col",{key:e.key,style:{minWidth:`${e.width}px`}})})),0),t("thead",[t("tr",e._l(e.columns,(function(i){return t("th",{key:i.key,class:e.thClass(i)},[e._v(" "+e._s(i.header.title())+" ")])})),0)]),t("tbody",e._l(e.data,(function(i,a){return t("tr",{key:a},e._l(e.columns,(function(n){return t("td",{key:`${n.key}_${a}`,class:e.tdClass(n)},["number"===n.type?t("span",[e._v(" "+e._s(e.displayValue(i[n.key]))+" ")]):"badge"===n.type?t("span",[t("ZoneBadge",{attrs:{zone:i[n.key]}}
1)],1):"text"===n.type?t("span",[e._v(" "+e._s(i[n.key])+" ")]):"numberInput"===n.type?t("FormFieldInputNumberFormattedInteger",{attrs:{value:i[n.key].value,disabled:i[n.key].disabled,variant:"no-label-sm"},on:{update:t=>e.$emit("input",{key:n.key,rowIndex:a,value:t})}}):e._e()],1)})),0)})),0),e.footer?t("tfoot",[t("tr",e._l(e.columns,(function(i){return t("td",{key:`footer_${i.key}`,class:e.tdClass(i)},["number"===i.type?t("span",[e._v(" "+e._s(e.displayValue(e.footer[i.key]))+" ")]):"numberInput"===i.type?t("span",{staticStyle:{"padding-right":"0.75rem"}},[e._v(" "+e._s(e.footer[i.key])+" ")]):t("span",[e._v(" "+e._s(e.footer[i.key])+" ")])])})),0)]):e._e()])],1)},wle=[],Cle=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInputNumberFormatted",{attrs:{id:e.id,autocomplete:e.autocomplete,required:e.required,label:e.label,name:e.name,placeholder:e.placeholder,disabled:e.disabled,variant:e.variant,state:e.state,various:e.various,value:e.value,formatter:e.formatter,parser:e.parser,lazy:e.lazy},on:{input:t=>e.$emit("input",t),change:t=>e.$emit("change",t),update:t=>e.$emit("update",t),blur:()=>e.$emit("blur"),focus:()=>e.$emit("focus"),keypress:t=>e.$emit("keypress",t)}})},Fle=[],Ale=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInput",{attrs:{id:e.id,autocomplete:e.autocomplete,required:e.required,label:e.label,name:e.name,placeholder:e.placeholder,disabled:e.disabled,variant:e.variant,state:e.computedState,stateMessage:e.computedStateMessage,various:e.various,type:"text",value:e.computedValue,formatter:e.formatter,lazyFormatter:e.lazy,lazy:e.lazy},on:{input:t=>e.$emit("input",t),change:t=>e.$emit("change",t),update:e.onUpdate,blur:()=>e.$emit("blur"),focus:()=>e.$emit("focus"),keypress:t=>e.$emit("keypress",t)}})},kle=[],Sle=(0,b.defineComponent)({name:"FormFieldInputNumberFormatted",components:{FormFieldInput:fk},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},autocomplete:{type:String,default:null},value:{type:Number,default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},name:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},formatter:{type:Function,required:!0},parser:{type:Function,required:!0},stateMessage:{type:String,default:null},min:{type:Number,default:null},max:{type:Number,default:null}},data(){return{validationStateMessage:null,validationState:null}},computed:{computedValue(){return this.formatter(this.value)},computedState(){return this.validationState??this.state},computedStateMessage(){return this.validationStateMessage??this.stateMessage}},methods:{onUpdate(e){const t=this.formatter(e),i=this.parser(t),a=this.validate(i);a?(this.$emit("error",!0),this.setError(a.msg)):(this.$emit("error",!1),this.setError(null)),this.$emit("update",i)},validate(e){return null===e?null:null!==this.min&&e<this.min?{msg:`Value can not be smaller than ${this.min}`}:this.max&&e>this.max?{msg:`Value can not be greater than ${this.max}`}:null},setError(e){e?(this.setState(!1),this.setStateMessage(e)):(this.setState(null),this.setStateMessage(null))},setStateMessage(e){this.validationStateMessage=e},setState(e){this.validationState=e}}}),Ele=Sle,Ile=(0,ew.Z)(Ele,Ale,kle,!1,null,null,null),_le=Ile.exports,Dle=(0,b.defineComponent)({name:"FormFieldInputNumberFormattedInteger",components:{FormFieldInputNumberFormatted:_le},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},autocomplete:{type:String,default:null},value:{type:[String,Number],default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},name:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},methods:{formatter(e){return null===e||""===e?"":Nl(e).format({thousandSeparated:!0,mantissa:0})},parser(e){return null===e?null:Nl.unformat(e)}}}),Mle=Dle,Ple=(0,ew.Z)(Mle,Cle,Fle,!1,null,null,null),Tle=Ple.exports,xle=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"badge text-white text-outline-sm",style:{background:e.isCloudy?"white":e.zone.color}}
1,[e._v(" "+e._s(e.isCloudy?"":e.zone.name)+" ")])},Ble=[];function Ole(e){if(!e)return"";try{const t="string"===typeof e?Nl(rS(e)).format():Nl(e).format();return t}catch{}return`${e}`}var $le=(0,b.defineComponent)({name:"ZoneBadge",props:{zone:{type:Object,required:!0}},computed:{isCloudy(){if("string"===typeof this.zone.name){const e=this.zone.name.includes("cloud")||this.zone.name.includes("snow");return e}return!1}},methods:{displayValue:Ole}}),Rle=$le,Nle=(0,ew.Z)(Rle,xle,Ble,!1,null,"1db58152",null),zle=Nle.exports,Lle=(0,b.defineComponent)({name:"ResultTable",components:{FormFieldInputNumberFormattedInteger:Tle,ZoneBadge:zle,TableLoading:x_,MultiRootWrapper:jM},props:{columns:{type:Array,required:!0},data:{type:Array,required:!0},footer:{type:Object,required:!1},variant:{type:String,default:"without-borders"},loading:{type:Boolean,default:!1}},methods:{displayValue:Ole,thClass(e){switch(e.align){case"left":return"text-left";case"center":return"text-center";case"right":return"text-right";default:return""}},tdClass(e){const t=[];switch("numberInput"===e.type&&t.push(`table-simple-${this.variant}-number-input`),e.align){case"left":t.push("content-left");break;case"center":t.push("content-center");break;case"right":t.push("content-right");break;default:break}return t.join(" ")}},computed:{tableClass(){const e=["result-table"];return e.push(`table-simple-${this.variant}`),"with-borders"===this.variant&&(e.push("border-medium"),e.push("border-bottom")),e.join(" ")}}}),Vle=Lle,Ule=(0,ew.Z)(Vle,ble,wle,!1,null,null,null),jle=Ule.exports,Hle=(0,b.defineComponent)({__name:"TableZonesContainer",props:{workflowKey:null},setup(e){const t=e,i=Gb.translate,a=Vb(),n=(0,b.ref)([{key:"zone",header:{title:()=>i("Zone")||"Zone"},type:"badge"},{key:"value",header:{title:()=>i("Wert")||"Wert"},type:"number"},{key:"size",header:{title:()=>i("Größe in ha")||"Größe in ha"},type:"number"}]),r=(0,b.computed)((()=>a.getters[`precisionFarming/applicationMaps/${t.workflowKey}/zones`])),s=(0,b.computed)((()=>r.value.map((({size:e})=>e??0)).reduce(((e,t)=>e+t),0))),o=(0,b.computed)((()=>({zone:i("Total")||"Total",value:"",size:s.value}))),l=(0,b.computed)((()=>r.value.map((e=>({zone:e,value:e.rate,size:e.size})))));return{__sfc:!0,t:i,store:a,props:t,columns:n,zones:r,totalArea:s,footer:o,tableData:l,ResultTable:jle}}}),Gle=Hle,Wle=(0,ew.Z)(Gle,yle,vle,!1,null,null,null),Zle=Wle.exports,Kle=function(){var e=this,t=e._self._c;return t("div",{staticClass:"sidebar-content-wrapper"},[e._t("default")],2)},qle=[],Yle={name:"SidebarContentWrapper"},Jle=Yle,Xle=(0,ew.Z)(Jle,Kle,qle,!1,null,"1dfa0e3d",null),Qle=Xle.exports,ede=function(){var e=this,t=e._self._c;return t("div",{staticClass:"sidebar-sub-headline"},[null!=e.text?t("h3",{staticClass:"sidebar-sub-headline__title"},[e._v(" "+e._s(e.text)+" ")]):e._e(),e._t("default")],2)},tde=[],ide={name:"SidebarSubHeadline",props:{text:{type:String,default:null}}},ade=ide,nde=(0,ew.Z)(ade,ede,tde,!1,null,"740cd557",null),rde=nde.exports,sde=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"form-upload-zone-files",class:{"form--is-dragover":e.isDragover},on:{drag:function(e){e.preventDefault()},dragstart:function(e){e.preventDefault()},dragend:function(t){t.preventDefault(),e.isDragover=!1},dragover:function(t){t.preventDefault(),e.isDragover=!0},dragenter:function(t){t.preventDefault(),e.isDragover=!0},dragleave:function(t){t.preventDefault(),e.isDragover=!1},drop:function(t){return t.preventDefault(),e.onFileDrop.apply(null,arguments)}}},[t("label",{staticClass:"position-absolute"},[t("input",{ref:"input",staticClass:"input",attrs:{type:"file",accept:e.supportedFileFormats.map((e=>e.fileEnding)).map((e=>`.${e}`)).join(",")},on:{change:e.onFileChange}})]),e.errorMessage||e.uploadedZonesByFilename&&!(Object.keys(e.uploadedZonesByFilename).length<1)?t("div",{staticClass:"form-files-content"},[t("ErrorUserMessage",{staticClass:"mx-3",attrs:{errorUserMessage:e.errorMessage}}),t("FilesList",{attrs:{fileGroups:e.filesList}}),t("FilesListButtons",{attrs:{uploadVisible:!1},on:{onAddAdditionalFiles:e.onEmptyFormClick,onReset:e.onReset}})],1):t("EmptyState",{attrs:{supportedFileFormats:e.supportedFileFormats,maxFileSize:e.maxFileSize},on:{onEmptyFormClick:e.onEmptyFormClick}})],1),t("ModalAskRateKey",{ref:"modalAskRateKey"}
1),t("ModalAskRateValue",{ref:"modalAskRateValue"})],1)},ode=[],lde=i(79590),dde=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",staticClass:"modal-ask-rate-key",attrs:{"no-cancel-button":"",title:e.$t("Zonen erstellen")}},[t("p",{staticClass:"mt-3 mb-3"},[e._v(" "+e._s(e.$t("In der hochgeladenen Datei befinden sich mehrere Werte. Welcher davon soll zum Erstellen der Zonen benutzt werden?"))+" ")]),t("BFormSelect",{staticClass:"w-50 mb-3",attrs:{options:e.options},model:{value:e.rateKey,callback:function(t){e.rateKey=t},expression:"rateKey"}})],1)},cde=[],ude={name:"ModalAskRateKey",components:{ModalWrapper:OC},data(){return{rateKey:null,rateKeys:null}},computed:{options(){return Array.isArray(this.rateKeys)?this.rateKeys.map((e=>({value:e,text:e}))):[]}},methods:{async show(e){this.rateKeys=e,[this.rateKey]=this.rateKeys;const t=await this.$refs.modalWrapper.show();return t?this.rateKey:null}}},pde=ude,hde=(0,ew.Z)(pde,dde,cde,!1,null,"3c4a76a0",null),mde=hde.exports,fde=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modalWrapper",staticClass:"modal-ask-rate-key",attrs:{title:e.$t("Zonen erstellen")}},[t("p",{staticClass:"mt-3 mb-3"},[e._v(" "+e._s(e.$t("Die hochgeladenen Zonen stimmen nicht mit den selektierten Feldern überein. FARMDOK erstellt eine Zone für jedes Feld ohne Zone. Welcher Wert soll diesen Zonen zugewiesen werden?"))+" ")]),t("BFormSelect",{staticClass:"w-50 mb-3",attrs:{options:e.options},model:{value:e.rate,callback:function(t){e.rate=t},expression:"rate"}})],1)},gde=[],yde={name:"ModalAskRateValue",components:{ModalWrapper:OC},data(){return{rate:null,rates:null}},computed:{options(){return Array.isArray(this.rates)?this.rates.map((e=>({value:e,text:Nl(e).format()}))):[]}},methods:{async show(e){this.rates=e,[this.rate]=this.rates;const t=await this.$refs.modalWrapper.show();return t?this.rate:null}}},vde=yde,bde=(0,ew.Z)(vde,fde,gde,!1,null,"72b831fa",null),wde=bde.exports;ow.vI.add(uw.nYk);var Cde={name:"FormUploadZoneFiles",components:{ModalAskRateKey:mde,ModalAskRateValue:wde,EmptyState:g2,FilesList:F2,FilesListButtons:_2,ErrorUserMessage:cH},props:{workflowKey:{type:String,required:!0}},data(){return{errorMessage:null,file:null,supportedFileFormats:[{fileEnding:"zip",displayName:"Shape"}],maxFileSize:10,isDragover:!1}},computed:{...(0,C.Se)({fields:"fields"}),...(0,C.rn)({selectedFields(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedFields},uploadedZonesByFilename(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZonesByFilename`]},zones(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zones`]}}),filesList(){return this.uploadedZonesByFilename?Object.keys(this.uploadedZonesByFilename).map((e=>({file:{name:e},errors:[]}))):[]}},created(){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setPaginationCallbackAsync`,((e,t)=>new Promise((i=>{2!==e||3!==t?i(!0):this.onNavigateNext(i)}))))},beforeDestroy(){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setPaginationCallbackAsync`,null)},methods:{onEmptyFormClick(){this.$refs.input.click()},onFileChange(e){this.addFiles(e.target.files)},async addFiles(e){Array.from(e).forEach((e=>this.importZonesFromFile(e)))},onFileDrop(e){this.isDragover=!1,this.addFiles(e.dataTransfer.files)},onReset(){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setUploadedZonesByFilename`,{})},async importZonesFromFile(e){if(null==e)return;if(this.errorMessage=null,"zip"!==e.name.substr(-3)||!e.type.includes("zip"))return void(this.errorMessage=this.$t("Derzeit werden nur Zip-Dateien unterstützt."));const{default:t}=await i.e(3).then(i.t.bind(i,79003,23)),a=new FileReader;a.onload=async()=>{if(2===a.readyState&&!a.error)try{let e=await t(a.result);if(null==e)return void(this.errorMessage=this.$t("Keine Shape-Datei im Zip gefunden."));Array.isArray(e)||(e=[e]),await Promise.all(e.map((async e=>{const t=await this.addPropertiesToFeatures(e);null!=t&&this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZoneFilesAddGeoJson`,{filename:t.fileName,geoJson:t})})))}catch(e){console.error(e),this.errorMessage=this.$t("Keine Shape-Datei im Zip gefunden.")}},a.readAsArrayBuffer(e)},async addPropertiesToFeatures(e){const t=new Set;
1e.features.forEach((e=>{null!=e.properties&&Object.keys(e.properties).forEach((e=>t.add(e)))}));let i="RATE";if(1===t.size?[i]=[...t]:t.size>1&&(i=await this.$refs.modalAskRateKey.show([...t])),null==i)return null;const a=new Set;e.features.forEach((e=>{this.selectedFields.forEach((t=>{const i=(0,h4.yu)(this.fields[t].fieldContour.geoJson.coordinates);null!=(0,lde.Z)(e,i)&&a.add(t)}))}));const n=e.features.map((e=>null==e.properties||null==e.properties[i]||Number.isNaN(Number(e.properties[i]))?0:Number(e.properties[i]))),r=Math.min(...n),s=Math.max(...n);return{...e,features:e.features.map((e=>{const t=e.properties||{};let a=0;Number.isNaN(Number(t[i]))||(a=Number(t[i]));const n={...e,properties:{...t,RATE:a,"fill-opacity":1,"stroke-opacity":1,"stroke-width":1,size:(0,Y6.Z)(e)}};let o="white";if(null!=n.properties.fill)o=n.properties.fill;else if(null!=n.properties[i]){const e=300*(n.properties[i]-r)/(s-r);o=`hsl(${e}, 100%, 50%)`}return n.properties.fill=o,n.properties.stroke=o,n})),properties:{fieldIds:[...a]}}},async onNavigateNext(e){const t=new Set;if(Object.values(this.uploadedZonesByFilename).forEach((e=>{null!=e.properties&&Array.isArray(e.properties.fieldIds)&&e.properties.fieldIds.forEach((e=>{t.add(e)}))})),this.selectedFields.every((e=>t.has(e))))return void e(!0);const i=await this.$refs.modalAskRateValue.show(this.zones.map((e=>e.rate)));null!=i&&this.createZonesForFields(this.selectedFields.filter((e=>![...t].includes(e))),i),e(null!=i)},createZonesForFields(e,t){let i=null;this.zones.some((e=>e.rate===t&&(({color:i}=e),!0)));const a=[];e.forEach((e=>{let n=rA.data.call(this,this.fields[e]);if(a.includes(n)){let e="2";while(a.includes(`${n} (${e})`))e+=1;n=`${n} (${e})`}a.push(n);const r=(0,h4.yu)(this.fields[e].fieldContour.geoJson.coordinates);r.properties={RATE:t,fill:i,"fill-opacity":1,stroke:i,"stroke-opacity":1,"stroke-width":1,size:(0,Y6.Z)(r)};const s={features:[r],type:"FeatureCollection",properties:{fieldIds:[e]}};this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZoneFilesAddGeoJson`,{filename:n,geoJson:s})}))}}},Fde=Cde,Ade=(0,ew.Z)(Fde,sde,ode,!1,null,"a7f46e3e",null),kde=Ade.exports,Sde=(0,b.defineComponent)({name:"SidebarZones",components:{FormZones:gle,SidebarContentWrapper:Qle,SidebarHeadline:iI,SidebarSubHeadline:rde,Tabs:mte,FormUploadZoneFiles:kde,TableZonesContainer:Zle},props:{workflowKey:{type:String,required:!0}},computed:{zoneGenerationMode(){return this.$store.state.precisionFarming.applicationMaps[this.workflowKey].zoneGenerationMode},buttonSatellites(){return{type:"button",label:this.$t("Satellit")||"Satellit",active:this.zoneGenerationMode===Oh,onClick:()=>this.setZoneGenerationMode(Oh)}},buttonUpload(){return{type:"button",label:this.$t("Upload")||"Upload",active:this.zoneGenerationMode===$h,onClick:()=>this.setZoneGenerationMode($h)}}},methods:{setZoneGenerationMode(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setZoneGenerationMode`,e)}}}),Ede=Sde,Ide=(0,ew.Z)(Ede,Zoe,Koe,!1,null,"48eec7f9",null),_de=Ide.exports,Dde=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-create-application-map",attrs:{id:"sidebar-create-application-map"}},[t("SidebarHeadline",{attrs:{text:e.$t("Applikationskarte erstellen")||""}}),t("div",{staticClass:"sidebar-create-application-map__scrollable-container"},[t("SidebarContentWrapper",{staticClass:"mb-5"},[t("AlertLiveCheckContainer",{attrs:{clickable:!0}}),t("ModalRuleCheckViolationsContainer"),t("ProductListContainer")],1),t("hr",{staticClass:"mt-0"}),t("SidebarContentWrapper",{staticClass:"mb-5"},[t("SidebarSubHeadline",{staticClass:"mb-3",attrs:{text:e.$t("Applikationskarte")}}),t("SprayControlsContainer"),t("ResultTableContainer")],1),t("hr",{staticClass:"mt-0"}),t("SidebarContentWrapper",{staticClass:"mb-5"},[t("SidebarSubHeadline",{staticClass:"mb-3",attrs:{text:e.$t("Bedarf")}}),t("DemandTableContainer")],1)],1),t("FooterLiveCheckContainer",{staticClass:"shadow-lg text-small p-footer text-left"})],1)},Mde=[],Pde=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.violations.length?t("BLink",{class:{"cursor-default":!e.clickable},on:{click:e.toggle}},[t("BAlert",{staticClass:"bg-danger text-white rounded-md py-2",attrs:{show:!0,variant:"danger",fade:!0,dismissible:!1}},[t("div",{staticClass:"d-flex align-items-center"},[t("FontAwesomeIcon",{attrs:{icon:["fa","triangle-exclamation"]}}),t("span",{staticClass:"flex-grow-1 text-center",domProps:{innerHTML:e._s(e.violationMessage)}}
1)],1)])],1):e._e()},Tde=[];ow.vI.add(uw.qmU);const xde=(0,b.defineComponent)({name:"AlertLiveCheckContainer",props:{clickable:{type:Boolean,required:!1,default:!1}},created(){this.$store.dispatch("activities/ruleCheck/rules/subscribe")},data(){return{bgColor:O.DANGER}},computed:{showModal:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal=e}},...(0,C.rn)("precisionFarming/applicationMaps/spraying",["violations"]),...(0,C.rn)("activities/ruleCheck/rules",{rules:"data"}),violationMessage(){if(!this.violations.length)return"Unbekannter Fehler";const e=this.violations[0],t=this.rules[e.ruleId];return t?ms(t.shortMessage,t.parameterNames,e.violationData):"Unbekannter Fehler"}},methods:{toggle(){this.clickable&&(this.showModal=!0)}}}),Bde=()=>{(0,b.useCssVars)(((e,t)=>({"7eeba50c":e.bgColor})))},Ode=xde.setup;xde.setup=Ode?(e,t)=>(Bde(),Ode(e,t)):Bde;var $de=xde,Rde=$de,Nde=(0,ew.Z)(Rde,Pde,Tde,!1,null,"6e968f0d",null),zde=Nde.exports,Lde=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FooterRuleCheckStatus",{attrs:{violations:e.violations.length,status:e.status,disabled:0===e.violations.length},on:{click:function(t){e.showRuleViolationModal=!0}}})},Vde=[],Ude=(0,b.defineComponent)({name:"FooterLiveCheckContainer",components:{FooterRuleCheckStatus:DR},computed:{...(0,C.rn)("precisionFarming/applicationMaps/spraying",{violations:"violations",loading:"checkingViolation"}),showRuleViolationModal:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal=e}},status(){return this.loading?"LOADING":this.violations.length?"violation":"OK"}}}),jde=Ude,Hde=(0,ew.Z)(jde,Lde,Vde,!1,null,"cdf2882c",null),Gde=Hde.exports,Wde=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalRuleCheckViolations",{attrs:{violations:e.violationMessages,featureDismissViolationEnabled:e.featureDismissViolationEnabled},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}})},Zde=[],Kde=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modalWrapper",attrs:{visible:e.visible,title:e.$t("Achtung")},on:{cancel:function(t){return e.$emit("hide")}},scopedSlots:e._u([{key:"default",fn:function(){return[t("Pagination",{attrs:{pages:e.pages,current:e.currentPage}}),e.currentViolation?t("div",{staticClass:"section-header",domProps:{innerHTML:e._s(e.currentViolation)}}):e._e(),e.featureDismissViolationEnabled?t("FormCheckbox",[e._v(e._s(e.$t("Dieses Problem nicht mehr anzeigen")))]):e._e()]},proxy:!0},{key:"buttons",fn:function(){return[t("BButton",{attrs:{variant:"primary"},on:{click:e.onPrimaryClick}},[e._v(" "+e._s(e.primaryButtonLabel)+" ")]),e.hasPreviousViolation?t("BButton",{attrs:{variant:"white"},on:{click:e.onPreviousClick}},[e._v(" "+e._s(e.$t("Zurück"))+" ")]):e._e()]},proxy:!0}])})},qde=[],Yde=(0,b.defineComponent)({name:"ModalRuleCheckViolations",props:{violations:{type:Array,required:!0},visible:{type:Boolean,default:!1},featureDismissViolationEnabled:{type:Boolean,required:!1,default:!1}},emits:["hide"],model:{prop:"visible",event:"hide"},data:()=>({currentPage:0}),components:{ModalWrapper:OC,Pagination:qk,BButton:u.T,FormCheckbox:Gw},computed:{pages(){return this.violations.length},primaryButtonLabel(){return this.hasNextViolation?this.$t("Weiter")||"Weiter":this.$t("Ok")||"Ok"},hasNextViolation(){return this.currentPage<this.pages-1},hasPreviousViolation(){return this.currentPage>0},currentViolation(){return this.violations[this.currentPage]}},watch:{visible(e){e&&this.goToFirstViolation()}},methods:{onPrimaryClick(){this.hasNextViolation?this.showNextViolation():this.$emit("hide")},showNextViolation(){this.currentPage+=1},onPreviousClick(){this.hasPreviousViolation&&(this.currentPage-=1)},goToFirstViolation(){this.currentPage=0},isViolationNotChecked(e){return!!e}}}),Jde=Yde,Xde=(0,ew.Z)(Jde,Kde,qde,!1,null,"6dfb505f",null),Qde=Xde.exp
1orts,ece=(0,b.defineComponent)({name:"ModalRuleCheckViolationsContainer",components:{ModalRuleCheckViolations:Qde},computed:{visible:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.showRuleViolationModal=e}},...(0,C.rn)("precisionFarming/applicationMaps/spraying",["violations"]),...(0,C.rn)("activities/ruleCheck/rules",{rules:"data"}),violationMessages(){return this.violations.map((e=>{const t=this.rules[e.ruleId];return ms(t.longMessage,t.parameterNames,e.violationData)})).filter(a4).filter(ka)},featureDismissViolationEnabled(){return!this.$store.getters.currentCompaniesHaveFeatureReadonly(Hr.FEATURE_RULE_CHECK)}}}),tce=ece,ice=(0,ew.Z)(tce,Wde,Zde,!1,null,"a5a5a352",null),ace=ice.exports,nce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("DemandTable",{attrs:{zones:e.zones,protections:e.protections,reducedVegetationPerZone:e.reducedVegetationPerZone,reducedSprayMixPerZone:e.reducedSprayMixPerZone}})},rce=[],sce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[t("div",{staticClass:"container"},[t("div",{staticClass:"result-total row"},[t("span",{staticClass:"col-sm px-0"},[e._v(e._s(e.$t("Flächensumme")))]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(" "+e._s(e.numbro(e.per100Liter(e.totalArea)).format())+" ha ")]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(e._s(e.numbro(e.totalArea).format())+" ha")])]),t("div",{staticClass:"result-total row"},[t("span",{staticClass:"col-sm px-0"},[e._v(e._s(e.$t("Spritzbrühe")))]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(e._s(e.numbro(e.per100Liter(e.totalDeployedSpray)).format())+" l")]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(e._s(e.numbro(e.totalDeployedSpray).format())+" l")])]),e._l(e.protections,(function(i,a){return t("div",{key:a,staticClass:"result-total row"},[t("span",{staticClass:"col-sm px-0"},[e._v(e._s(i.product.name||e.$t("Produkt")))]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(" "+e._s(e.numbro(e.per100Liter(e.totals[a])).format())+" "+e._s(e.unit(i))+" ")]),t("span",{staticClass:"col-sm px-0 text-right"},[e._v(e._s(e.numbro(e.totals[a]).format())+" "+e._s(e.unit(i)))])])}))],2)])},oce=[],lce=(0,b.defineComponent)({name:"DemandTable",components:{MultiRootWrapper:jM},props:{protections:{type:Array,required:!1,default:()=>[]},zones:{type:Array,required:!1,default:()=>[]},reducedVegetationPerZone:{type:Array,required:!1,default:()=>[]},reducedSprayMixPerZone:{type:Array,required:!1,default:()=>[]}},data(){return{numbro:Nl}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/spraying",{areas:(e,t)=>t.areas,workingMeans:e=>e.workingMeans}),totalArea(){return this.areas.reduce(((e,t)=>e+t),0)},totals(){return this.workingMeans.map((e=>e.amount*this.totalArea))},totalDeployedSpray(){return MK()(this.reducedSprayMixPerZone,this.areas).map((([e,t])=>[e??1,t??1])).map((([e,t])=>e*t)).reduce(((e,t)=>e+t),0)}},methods:{unit(e){return e.unit.split("/").shift()??""},per100Liter(e){return e/this.totalDeployedSpray*100}}}),dce=lce,cce=(0,ew.Z)(dce,sce,oce,!1,null,"7707f6e5",null),uce=cce.exports,pce=(0,b.defineComponent)({name:"DemandTableContainer",components:{DemandTable:uce},computed:{...(0,C.rn)("precisionFarming/applicationMaps/spraying",{protections(e){return e.calculation.products}}),...(0,C.Se)("precisionFarming/applicationMaps/spraying",["zones","reducedVegetationPerZone","reducedSprayMixPerZone"])}}),hce=pce,mce=(0,ew.Z)(hce,nce,rce,!1,null,null,null),fce=mce.exports,gce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ControlProductList",{attrs:{workflowKey:"spraying"},model:{value:e.products,callback:function(t){e.products=t},expression:"products"}})},yce=[],vce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e._l(e.products,(function(i,a){return t("FormFieldSet",{key:a,staticClass:"mb-3",attrs:{headline:`${a+1}. ${i.product.name||e.$t("Produkt")}`,collapsible:!0,collapsed:!1,indented:!1}},[t("ControlPlantProtection",{staticClass:"mb-3",attrs:{"workflow-key":"spraying",plantProtection:i,activityType:e.protection},on:{"update:plantProtection":t=>e.update(t,a)}}),t("RemoveSectionButton",{attrs:{label:e.$t("Produkt entfernen")||"Produkt entfernen",disabled:1===e.products.length},on:{remove:()=>e.remove(a)}})],1)})),t("AddSectionButton",{attrs:{label:e.$t("Produkt hinzufügen")??"",disabled:e.products.length===e.maxSize},on:{click:()=>e.add(e.newProduct())}})],2)},bce=[],wce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("ControlProductSelection",{staticClass:"mb-2",attrs:{workflowKey:e.workflowKey,activityType:e.activityType,variant:"vertical"},model:{value:e.product,callback:function(t){e.product=t},expression:"product"}}),t("ControlPestSelection",{staticClass:"mb-2",attrs:{workflowKey:e.workflowKey,productId:e.product.id??"",disabled:!e.enablePest,variant:"vertical"},model:{value:e.pest,callback:function(t){e.pest=t},expression:"pest"}}),t("ControlProductAmount",{staticClass:"mt-1 mb-2",attrs:{productId:e.product.id??"",disabled:!e.product.id,variant:"vertical"},model:{value:e.amount,callback:function(t){e.amount=t},expression:"amount"}}),t("ButtonLink",{staticClass:"d-block mb-2",attrs:{href:e.catalogLink,target:"_blank",disabled:!e.catalogLink}},[e._v(" "+e._s(e.$t(e.currentRegionCode?"Link zu AGES Register":"Pflanzenschutzmittelkatalog öffnen"))+" ")])],1)},Cce=[],Fce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDropdown",{attrs:{label:e.$t("Schädling auswählen")??"",variant:e.variant,value:e.selectedPest,items:e.availablePests,disableDelete:"",slimMargin:"",positionFixed:!1,placeholder:e.availablePests[0].items.length?e.$t("Tippen um zu suchen"):e.$t("Kein gültiger Schädling vorhanden"),disabled:e.disabled},on:{update:t=>e.$emit("update:selectedPest",t)}})},Ace=[];ow.vI.add(uw.I7k);var kce=(0,b.defineComponent)({name:"ControlPestSelection",components:{FormFieldDropdown:lk},props:{workflowKey:{type:String,required:!0},autoSelectLoneItem:{type:Boolean,required:!1,default:!0},selectedPest:{type:Object,required:!1,default:()=>({id:"",name:""})},disabled:{type:Boolean,required:!1,default:!1},variant:ix.props.variant,productId:{type:String,required:!1,default:""}},emits:["update:selectedPest"],model:{prop:"selectedPest",event:"update:selectedPest"},created(){this.$store.dispatch("pests/subscribe"),this.productId&&this.$store.dispatch("pesticideIndications/loadByIds",[this.productId])}
1,computed:{...(0,C.rn)("pesticideIndications",{availablePests(e,t){return t.dropdownItems(this.productId,this.cropIds,[g()().unix()])}}),...(0,C.rn)("precisionFarming/applicationMaps",{selectedFieldIds(e){return e[this.workflowKey].selectedFields}}),...(0,C.rn)("fields",{fields:"data"}),selectedFields(){return this.selectedFieldIds.map((e=>this.fields[e])).filter(ka)},cropIds(){return this.selectedFields.map((e=>e.cropId)).filter(ka).filter(a4)}},watch:{productId(e){e&&this.$store.dispatch("pesticideIndications/loadByIds",[e])},availablePests(e){const t=e.flatMap((e=>e.items)).length;1===t&&this.autoSelectLoneItem&&this.$emit("update:selectedPest",e[0].items[0])}}}),Sce=kce,Ece=(0,ew.Z)(Sce,Fce,Ace,!1,null,null,null),Ice=Ece.exports,_ce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInputNumberFormattedDisplayValue",{attrs:{variant:e.variant,id:"amount",placeholder:e.numbro(0).format({mantissa:e.mantissa}),value:e.amount,label:`${e.$t("Maximale Menge")} ${e.unit?`in ${e.unit.name}`:""}`,formatter:e.formatter,lazy:!0,disabled:e.disabled},on:{update:t=>e.$emit("update:amount",t)}})},Dce=[],Mce=(0,b.defineComponent)({name:"ControlProductAmount",components:{FormFieldInputNumberFormattedDisplayValue:ix},props:{amount:{type:Number,required:!0,default:0},productId:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},variant:ix.props.variant},emits:["update:amount"],model:{prop:"amount",event:"update:amount"},created(){this.$store.dispatch("units/subscribe")},computed:{...(0,C.rn)("units",{units:"data"}),...(0,C.Se)("products",["findProductById"]),...(0,C.Se)("productCategories",["isHerbicide"]),mantissa(){const e=this.findProductById(this.productId);return this.isHerbicide(e?.categoryId)?3:2},unit(){const e=this.findProductById(this.productId);return this.units[e?.unitId??""]}},methods:{formatter(e){return Nl(e).format({mantissa:this.unit?.ddiDecimals??this.mantissa})},numbro:Nl}}),Pce=Mce,Tce=(0,ew.Z)(Pce,_ce,Dce,!1,null,"264cb1e7",null),xce=Tce.exports,Bce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDropdown",{attrs:{label:e.$t("Produkt auswählen")??"",variant:e.variant,value:e.selectedProduct,items:e.availableProducts,disableDelete:"",slimMargin:"",positionFixed:!1},on:{update:t=>e.$emit("update:selectedProduct",t)}})},Oce=[];ow.vI.add(uw.I7k);var $ce=(0,b.defineComponent)({name:"ControlProductSelection",components:{FormFieldDropdown:lk},props:{workflowKey:{type:String,required:!0},selectedProduct:{type:Object,required:!1,default:()=>({id:"",name:""})},activityType:{type:Object,required:!1,default:()=>{}},variant:ix.props.variant},emits:["update:selectedProduct"],model:{prop:"selectedProduct",event:"update:selectedProduct"},created(){this.$store.dispatch("products/subscribe"),this.$store.dispatch("productVisibilities/subscribe"),this.$store.dispatch("productCategories/subscribe"),this.$store.dispatch("storagePlaces/subscribe"),this.$store.dispatch("activityTypes/subscribe")},computed:{...(0,C.rn)("precisionFarming/applicationMaps",{selectedFieldIds(e){return e[this.workflowKey].selectedFields}}),...(0,C.rn)("fields",{fields:"data"}),selectedFields(){return this.selectedFieldIds.map((e=>this.fields[e])).filter(ka)},...(0,C.rn)("auth",{currentCompanies:"currentCompanies"}),...(0,C.Se)("auth",{processOrders:"currentProcessOrders"}),...(0,C.rn)("productVisibilities",{productVisibilities(e){return Object.values(e.data)}}),...(0,C.rn)("productCategories",{productCategories(e){return Object.values(e.data)}}),...(0,C.rn)("products",{availableProducts(e,t){return this.isDataLoaded?t.compatibleProductsToDropdownItems(this.activityType,this.currentCompanies,this.processOrders,this.productVisibilities,this.productCategories,this.selectedFields,this.storagePlaces,[g()().unix()]):[]}}),...(0,C.Se)("products",["allProducts"]),...(0,C.rn)("storagePlaces",{storagePlaces(e){return Object.values(e.data)}}),isDataLoaded(){return this.activityType&&this.currentCompanies&&this.processOrders&&this.productVisibilities&&this.productCategories}}}),Rce=$ce,Nce=(0,ew.Z)(Rce,Bce,Oce,!1,null,null,null),zce=Nce.exports,Lce=(0,b.defineComponent)({name:"ControlPlantProtection",components:{ButtonLink:Fw,ControlProductAmount:xce,ControlPestSelection:Ice,ControlProductSelection:zce},props:{plantProtection:{type:Object,required:!1,default:()=>({product:{id:"",name:""},pest:{id:"",name:""},amount:0,unit:""})},workflowKey:{type:String,required:!0},activityType:{type:Object,required:!1,default:()=>{}}},emits:["update:plantProtection"],model:{prop:"plantProtection",event:"update:plantProtection"},computed:{product:{get(){return this.plantProtection.product},set(e){const t={...this.plantProtection,product:e,pest:{id:"",name:""},unit:this.unit(e.id??"")?.name||""};this.$emit("update:plantProtection",t)}},pest:{get(){return this.plantProtection.pest},set(e){const t={...this.plantProtection,pest:e};this.$emit("update:plantProtection",t)}},amount:{get(){return this.plantProtection.amount},set(e){const t={...this.plantProtection,amount:e};this.$emit("update:plantProtection",t)}},...(0,C.Se)("products",["findProductById"]),...(0,C.Se)("productCategories",["isHerbicide"]),...(0,C.Se)("pesticideIndications",["findByProductAndPestId"]),featurePestsEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_PESTS)},featurePestsVisible(){return this.$store.getters.currentCompaniesHaveFeatureVisible(Hr.FEATURE_PESTS)},enablePest(){const e=this.findProductById(this.product.id);return this.featurePestsEnabled&&this.featurePestsVisible&&this.isHerbicide(e?.categoryId)},...(0,C.rn)("auth",["currentCompanies"]),...(0,C.rn)("units",{units:"data"}),currentRegionCode(){return this.currentCompanies.length?this.currentCompanies[0].region.code:""},catalogLink(){const e=this.product.id,[t]=this.pest.id?.split("_")||[""],i=this.findByProductAndPestId(e,t);if(!i?.externalId)return"";const[a,n]=i.externalId.split("/");return"de"===this.currentRegionCode?`https://psm-zulassung.bvl.bund.de/psm/jsp/BlattAnwendg.jsp?awg_id=${i.externalId}&kennr=${a}`:`https://psmregister.baes.gv.at/psmregister/faces/indication.jspx?refNr=${a}&indNr=${n}&locale=de`}},methods:{unit(e){const t=this.findProductById(e);return this.units[t.unitId]}}}),Vce=Lce,Uce=(0,ew.Z)(Vce,wce,Cce,!1,null,"d30d3228",null),jce=Uce.exports,Hce=(0,b.defineComponent)({name:"ControlProductList",components:{FormFieldSet:_k,RemoveSectionButton:IM,AddSectionButton:bM,ControlPlantProtection:jce},props:{workflowKey:{type:String,required:!0},products:{type:Array,required:!1,default:()=>[]},maxSize:{type:Number,required:!1,default:5}},emits:["update:products"],model:{prop:"products",event:"update:products"},computed:{...(0,C.rn)("activityTypes",{protection(e,t){return t.byRoughAndFineId(ie.PROTECT)}})},methods:{add(e){const t=[...this.products,e];this.$emit("update:products",t)},update(e,t){const i=this.products.map(((i,a)=>a===t?e:i));this.$emit("update:products",i)},newProduct(){return{product:{id:"",name:""},pest:{id:"",name:""},amount:0,unit:""}}
1,remove(e){const t=this.products.filter(((t,i)=>i!==e));this.$emit("update:products",t)}}}),Gce=Hce,Wce=(0,ew.Z)(Gce,vce,bce,!1,null,"4bc30180",null),Zce=Wce.exports,Kce=(0,b.defineComponent)({name:"ProductListContainer",components:{ControlProductList:Zce},computed:{products:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.calculation.products},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.calculation.products=e}},...(0,C.Se)("products",["findProductById"]),...(0,C.rn)("units",{units:"data"}),...(0,C.Se)("auth",{processOrderIds:"currentProcessOrderIds",companyIds:"currentCompanyIds"}),...(0,C.rn)("precisionFarming/applicationMaps/spraying",{selectedFieldIds:"selectedFields"}),...(0,C.rn)("fields",{fields:"data"}),...(0,C.Se)("activityTypes",{byRoughId:"byRoughAndFineId"})},watch:{products:{immediate:!0,handler(e){const t=e.some((e=>!e.amount));if(t)return;const i=this.byRoughId(ie.PROTECT),a=this.processOrderIds.find((()=>!0))??"",n=this.companyIds.find((()=>!0))??"",r={id:ma(),timeStart:g()().unix(),processOrderId:a,activityTypeId:i?.id,companyId:n,fields:this.selectedFieldIds.map(this.toTrackField),tstamp:g()().unix(),products:e.map(this.toTrackProduct),equipment:[],loads:[]};this.liveCheck(r)}}},methods:{async liveCheck(e){return this.$store.dispatch("precisionFarming/applicationMaps/spraying/liveCheck",e)},toTrackProduct(e){const t=e.product.id,[i,a]=e.pest.id?.split("_")||["",""],n=this.findProductById(t);return{id:ma(),tstamp:g()().unix(),productId:t,pestId:i||void 0,pesticideIndicationId:a||void 0,amount:e.amount,unitId:n?.unitId||void 0}},toTrackField(e){const t=this.fields[e];return{id:ma(),tstamp:g()().unix(),fieldId:e,processedArea:t?.fieldSize,manual:!1}}}}),qce=Kce,Yce=(0,ew.Z)(qce,gce,yce,!1,null,null,null),Jce=Yce.exports,Xce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[t("ResetButton",{directives:[{name:"show",rawName:"v-show",value:e.isOverwritten,expression:"isOverwritten"}],attrs:{disabled:!e.isOverwritten,buttonText:e.$t("Tabelle zurücksetzen"),onClick:()=>e.resetOverwrite}}),t("ResultTable",{attrs:{zones:e.zones,reduction:e.reduction,sprayMix:e.sprayMix,protections:e.protections},on:{"update:workingMeans":e.updateWorkingMeans},model:{value:e.summaryData,callback:function(t){e.summaryData=t},expression:"summaryData"}})],1)},Qce=[],eue=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[t("table",{staticClass:"table-simple-without-borders table-simple-with-bottom-borders",attrs:{id:"sidebar-create-application-map__table-distribution"}},[t("thead",[t("tr",[t("th",{staticClass:"text-left"},[e._v(e._s(e.$t("Zone")))]),t("th",{staticClass:"text-center"},[e._v(e._s(e.$t("Spritzbrühe")))]),e._l(e.protections,(function(i,a){return t("th",{key:a,staticClass:"text-center"},[e._v(" "+e._s(i.product.name||e.$t("Produkt"))+" ")])}))],2)]),t("tbody",e._l(e.zones,(function(i,a){return t("tr",{key:a,staticClass:"bg-white"},[t("td",{staticClass:"text-left"},[t("ZoneBadge",{attrs:{zone:i}})],1),t("td",[t("FormFieldInputNumberFormattedDisplayValue",{staticClass:"form-control--number-input m-0 mt-1",attrs:{value:e.reducedSprayMixPerZone[a],formatter:e.formatter,lazy:!0,variant:"no-label-sm",disabled:!0},on:{update:t=>e.reducedSprayMixPerZone=e.overwriteSprayMix(t,a)}}
1)],1),e._l(e.protections,(function(i,n){return t("td",{key:n},[t("FormFieldInputNumberFormattedDisplayValue",{staticClass:"form-control--number-input m-0 mt-1",attrs:{value:e.reduceProduct(i.amount,a),formatter:e.formatter,lazy:!0,variant:"no-label-sm",disabled:!0},on:{update:t=>e.reducedVegetationPerZone=e.overwriteReducedVegetation(i.amount,a,t)}})],1)}))],2)})),0),t("tfoot",[t("tr",[t("td",{staticClass:"table-simple-with-borders__cell-sum border-0 text-left"},[e._v(" "+e._s(e.$t("Mittel"))+" ")]),t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e.numbro(e.sprayMixMid).format())+" ")]),e._l(e.workingMeans,(function(i,a){return t("td",{key:a,staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e.numbro(i).format())+" ")])}))],2)])])])},tue=[],iue=(0,b.defineComponent)({name:"ResultTable",components:{FormFieldInputNumberFormattedDisplayValue:ix,ZoneBadge:zle,MultiRootWrapper:jM},props:{zones:{type:Array,required:!0,default:()=>[]},protections:{type:Array,required:!0,default:()=>[]},sprayMix:{type:Number,required:!0,default:200},summaryData:{type:Object,required:!1,default:()=>({reducedSprayMixPerZone:[],reducedVegetationPerZone:[]})}},emits:["update:summaryData","update:workingMeans"],model:{prop:"summaryData",event:"update:summaryData"},data(){return{numbro:Nl}},computed:{reducedSprayMixPerZone:{get(){return this.summaryData.reducedSprayMixPerZone},set(e){const t={reducedSprayMixPerZone:e,reducedVegetationPerZone:this.reducedVegetationPerZone};this.$emit("update:summaryData",t)}},reducedVegetationPerZone:{get(){return this.summaryData.reducedVegetationPerZone},set(e){const t={reducedSprayMixPerZone:this.reducedSprayMixPerZone,reducedVegetationPerZone:e};this.$emit("update:summaryData",t)}},vegetationMax(){return Math.max(...this.reducedVegetationPerZone)},areas(){return this.zones.map((({size:e})=>e))},sprayMixMid(){const e=this.areas.reduce(((e,t)=>e+t),0),t=MK()(this.reducedSprayMixPerZone,this.areas).map((([e,t])=>[e??1,t??1])).map((([e,t])=>e*t)).reduce(((e,t)=>e+t),0);return t/e},workingMeans(){return this.protections.map((e=>this.mean(e.amount)))}},methods:{mean(e){const t=this.areas.reduce(((e,t)=>e+t),0),i=this.zones.map(((t,i)=>this.reduceProduct(e,i))),a=MK()(this.areas,i).map((([e,t])=>[e??1,t??1])).map((([e,t])=>e*t)).reduce(((e,t)=>e+t),0);return a/t},overwriteSprayMix(e,t){return this.reducedSprayMixPerZone.map(((i,a)=>a===t?e:i))},overwriteReducedVegetation(e,t,i){const a=i/e*this.vegetationMax;return this.reducedVegetationPerZone.map(((e,i)=>i===t?a:e))},formatter(e){return Nl(e).format()},reduceProduct(e,t){return e*this.reducedVegetationPerZone[t]/this.vegetationMax}},watch:{workingMeans(e){this.$emit("update:workingMeans",e)}}}),aue=iue,nue=(0,ew.Z)(aue,eue,tue,!1,null,null,null),rue=nue.exports,sue=function(){var e=this,t=e._self._c;return t("div",{staticClass:"resetButton"},[t("ButtonLink",{staticClass:"text-small pb-4",attrs:{disabled:e.disabled},on:{click:e.onClick}},[e._v(" "+e._s(e.buttonText)+" ")])],1)},oue=[],lue={name:"ResetButton",components:{ButtonLink:Fw},props:{buttonText:{type:String,default:"Reset"},onClick:{type:Function,default:()=>{}},disabled:{type:Boolean,required:!1,default:!1}}},due=lue,cue=(0,ew.Z)(due,sue,oue,!1,null,"35a3c45a",null),uue=cue.exports,pue=(0,b.defineComponent)({name:"ResultTableContainer",components:{MultiRootWrapper:jM,ResetButton:uue,ResultTable:rue},computed:{...(0,C.rn)("precisionFarming/applicationMaps/spraying",{reduction(e){return e.calculation.reduction},sprayMix(e){return e.calculation.sprayMix},protections(e){return e.calculation.products}}),...(0,C.Se)("precisionFarming/applicationMaps/spraying",["zones","areas","reducedSprayMixPerZone","reducedVegetationPerZone","sprayMixMid","isOverwritten"]),...(0,C.Se)("products",["findProductById"]),...(0,C.Se)("pesticideIndications",{findIndicationByProductAndPestId:"findByProductAndPestId"}),...(0,C.nv)("precisionFarming/applicationMaps/spraying",["resetOverwrite"]),summaryData:{get(){return{reducedSprayMixPerZone:this.reducedSprayMixPerZone,reducedVegetationPerZone:this.reducedVegetationPerZone}},set(e){this.$store.dispatch("precisionFarming/applicationMaps/spraying/updateOverwrite",{summaryData:e})}}},methods:{...(0,C.OI)("precisionFarming/applicationMaps/spraying",["setWorkingMeans"]),updateWorkingMeans(e){const t=this.protections.map(((t,i)=>this.toWorkingMean(t,e[i])));this.setWorkingMeans(t)},toWorkingMean(e,t){const i=e.product.id??"",[a,n]=e.pest.id?.split("_")||["",""],r=this.findProductById(i);return{workingMeanId:i,pestId:a,pesticideIndicationId:n,unitId:r?.unitId??"",amount:t}}}}),hue=pue,mue=(0,ew.Z)(hue,Xce,Qce,!1,null,null,null),fue=mue.exports,gue=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[t("FormSlider",{attrs:{label:`${e.$t("Spritzbrühe")} in l/ha`,min:0,max:400,disabled:e.isOverwritten},model:{value:e.sprayMix,callback:function(t){e.sprayMix=t},expression:"sprayMix"}}),t("FormSlider",{attrs:{label:e.$t("Maximale Reduktion der Produkt-Konzentration"),min:0,max:.5,interval:.01,formatter:e.reductionFormatter,parser:e.reductionParser,disabled:e.isOverwritten},model:{value:e.reduction,callback:function(t){e.reduction=t},expression:"reduction"}})],1)},yue=[],vue=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("BFormGroup",{directives:[{name:"show",rawName:"v-show",value:!e.hide
1Slider,expression:"!hideSlider"}],staticClass:"slider-group",attrs:{"label-for":"slider-number-input","label-class":"label"}},[t("div",[t("span",{staticClass:"label",attrs:{slot:"label"},slot:"label"},[e._v(" "+e._s(e.label)+" ")]),t("VueSlider",{staticClass:"pt-4 px-2",attrs:{tooltip:"none",min:e.min,max:e.max,processStyle:{backgroundColor:"var(--primary)"},dotSize:[20,20],interval:e.interval,silent:!0,data:e.data,value:e.value,disabled:e.disabled},on:{change:e.update}}),t("div",{staticClass:"slider-marks-wrapper"},[t("div",[e._v(e._s(e.formatter(e.min)))]),t("div",{staticClass:"input-container"},[t("FormFieldInput",{staticClass:"form-control--number-input m-0 mt-1",attrs:{type:"text",name:"slider-number-input",variant:"no-label-sm",value:e.formatter(e.value),lazy:!0,state:!e.inputErrorMessage&&null,lazyFormatter:!0,disabled:e.disabled},on:{change:t=>e.update(e.parser(t))}})],1),t("div",{staticClass:"text-right"},[e._v(e._s(e.formatter(e.max)))])]),t("div",{staticClass:"error-container"},[t("ErrorUserMessage",{staticClass:"m-0",attrs:{"error-user-message":e.inputErrorMessage}})],1),null!=e.additionalInformation?t("p",{staticClass:"additional-information"},[e._v(e._s(e.additionalInformation))]):e._e()],1)])},bue=[],wue=i(79454),Cue=i.n(wue),Fue=(0,b.defineComponent)({name:"FormSlider",components:{VueSlider:Cue(),FormFieldInput:fk,ErrorUserMessage:cH},props:{label:{type:String,required:!1,default:""},value:{type:Number,required:!1,default:50},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},hideSlider:{type:Boolean,required:!1,default:!1},data:{type:Array,required:!1,default:()=>{}},interval:{type:Number,required:!1,default:1},additionalInformation:{type:String,required:!1,default:null},formatter:{type:Function,required:!1,default:e=>Nl(e).format({mantissa:0})},parser:{type:Function,required:!1,default:e=>{const t=/\d+/,i=e.match(t)?.shift();return Number(i)}},disabled:{type:Boolean,required:!1,default:!1}},emits:["setValue","update:value"],model:{prop:"value",event:"update:value"},data(){return{inputErrorMessage:"",numbro:Nl}},methods:{update(e){const t=this.between(e,this.min,this.max);t?(this.$emit("setValue",e),this.$emit("update:value",e),this.inputErrorMessage=null):this.inputErrorMessage=this.$t("Wert muss zwischen {min} und {max} sein",{min:this.formatter(this.min),max:this.formatter(this.max)})??""},between(e,t,i,a=!0){const n=Math.min(t,i),r=Math.max(t,i);return a?n<=e&&e<=r:n<e&&e<r}}}),Aue=Fue,kue=(0,ew.Z)(Aue,vue,bue,!1,null,"6cb3e711",null),Sue=kue.exports,Eue=(0,b.defineComponent)({name:"SprayControlsContainer",components:{MultiRootWrapper:jM,FormSlider:Sue},data(){return{numbro:Nl}},computed:{reduction:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.calculation.reduction},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.calculation.reduction=e}},sprayMix:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.calculation.sprayMix},set(e){this.$store.state.precisionFarming.applicationMaps.spraying.calculation.sprayMix=e}},...(0,C.Se)("precisionFarming/applicationMaps/spraying",["isOverwritten"])},methods:{reductionFormatter(e){return Nl(e).format({mantissa:0,output:"percent",prefix:e?"-":""})},reductionParser(e){const t=/\d+/,i=e.match(t)?.shift();return Number(i)/100}}}),Iue=Eue,_ue=(0,ew.Z)(Iue,gue,yue,!1,null,null,null),Due=_ue.exports,Mue=(0,b.defineComponent)({name:"SidebarCreateApplicationMapSpraying",components:{FooterLiveCheckContainer:Gde,ModalRuleCheckViolationsContainer:ace,AlertLiveCheckContainer:zde,DemandTableContainer:fce,ProductListContainer:Jce,ResultTableContainer:fue,SprayControlsContainer:Due,SidebarContentWrapper:Qle,SidebarHeadline:iI,SidebarSubHeadline:rde},computed:{...(0,C.rn)({paginationStep(e){return e.precisionFarming.applicationMaps.spraying.paginationStep}})}}),Pue=Mue,Tue=(0,ew.Z)(Pue,Dde,Mde,!1,null,"06a64116",null),xue=Tue.exports,Bue=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Export",{attrs:{workflowKey:"spraying"}},[t("ExportTable",{attrs:{tableHeaders:e.tableHeaders,tableRows:e.tableRows}})],1)},Oue=[],$ue=function(){var e=this,t=e._self._c;return t("div",{staticClass:"export text-dark",attrs:{id:"application-maps__export"}},[t("SidebarContentWrapper",[t("h2",{staticClass:"text-black"},[e._v(e._s(e.$t("Sende Applikationskarte")))]),t("div",[t("Tabs",{staticClass:"mt-3",attrs:{tabs:e.tabs,fill:""}}),e.buttonDownload.active?t("DownloadTab",{attrs:{workflowKey:e.workflowKey,buttonsDisabled:e.downloadButtonDisabled},on:{exportTriggered:e.setStepsCompleted,createApplicationMapEvent:e.createApplicationMapEvent}}
1):e._e(),e.buttonSendTo.active?t("SendToTab",{attrs:{workflowKey:e.workflowKey,buttonsDisabled:e.buttonsDisabled},on:{sendApplicationMapTriggered:e.setStepsCompleted,createApplicationMapEvent:e.createApplicationMapEvent}}):e._e(),e.buttonPlanTask.active?t("PlanTaskTab",{attrs:{workflowKey:e.workflowKey,buttonsDisabled:e.planTaskButtonDisabled},on:{planTaskTriggered:e.setStepsCompleted,"update:errorMessage":t=>e.$emit("update:errorMessage",t)}}):e._e()],1),e.$slots.default?t("SidebarSubHeadline",{staticClass:"pl-0",attrs:{text:e.$t("Zusammenfassung je Schlag")}}):e._e(),e._t("default")],2)],1)},Rue=[],Nue=function(){var e=this,t=e._self._c;return t("BContainer",{staticClass:"settings"},[t("p",{staticClass:"small"},[e._v(" "+e._s(e.$t("Wähle ein Dateiformat abhängig vom Terminal, auf dem die Applikationskarte verwendet werden soll."))+" "+e._s(e.$t("Wähle “Standard” wenn dein Terminal-Hersteller nicht in der Liste angeführt ist."))+" ")]),t("FormFieldDropdown",{ref:"shapeType",staticClass:"formControl",attrs:{label:e.$t("Dateiformat"),variant:"vertical",value:e.shapeTypeValueForDropdown,items:e.shapeTypesToDropDownItems,disableDelete:"",slimMargin:"",hideLabel:""},on:{update:t=>e.selectedShapeType=t.id}}),e.companySelectRequired?t("CompanySelectFormFieldDropdown",{ref:"company",staticClass:"formControl",attrs:{companies:e.currentCompanies,variant:"vertical",disableDelete:"",hideLabel:"",required:e.companySelectRequired,"data-cy":"company-select-form-field-dropdown"},model:{value:e.selectedCompany,callback:function(t){e.selectedCompany=t},expression:"selectedCompany"}}):e._e(),t("div",[t("BButton",{staticClass:"btn btn-export",attrs:{variant:"primary",disabled:e.downloadButtonDisabled},on:{click:e.exportApplicationMap}},[t("span",[e._v(e._s(e.$t("Download")))])])],1)],1)},zue=[];function Lue(e){return null==e||0===e||""===e||"0"===e}var Vue={computed:{...(0,C.Se)({fields:"fields"}),...(0,C.rn)({zoneDosage(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zoneDosage`]},zones(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zones`]},selectedFields(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedFields},currentHeatmaps(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/currentHeatmaps`]},uploadedZonesByFilename(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZonesByFilename`]},zoneGenerationMode(e){return e.precisionFarming.applicationMaps[this.workflowKey].zoneGenerationMode}})},methods:{getFieldName(e){let t="";return Lue(e.fieldGroup.mfa)||(t=`${e.fieldGroup.mfa}_`),Lue(e.fieldNumber)||(t+=`${e.fieldNumber}_`),t+=`${e.name}_`,t},getApplicationMapName(){const e=this.selectedFields[0],t=this.fields[e];let i=this.getFieldName(t);return this.selectedFields.length>1&&(i+="MULTI_"),i+=`${g()().format("YYYY-MM-DD")}`,i},getFeatures(e){let t={};return this.zoneGenerationMode===Oh?t=this.getFeaturesFromHeatmaps():this.zoneGenerationMode===$h&&(t=this.getFeaturesFromUploadedZones()),Object.keys(t).reduce(((i,a)=>({...i,[a]:t[a].map((t=>{const i={geometry:t.geometry,type:t.type,properties:{}};return"amazone"===e?i.properties[a]=this.getDosageByColor(t.properties.customColor??t.properties.fill):i.properties.RATE=this.getDosageByColor(t.properties.customColor??t.properties.fill),i}))})),{})},getFeaturesFromHeatmaps(){return Object.keys(this.currentHeatmaps).reduce(((e,t)=>{const i=t.split("_")[0],a=this.fields[i];let n=this.getFieldName(a);return n=n.substr(0,n.length-1),{...e,[n]:this.currentHeatmaps[t].features}}),{})},getFeaturesFromUploadedZones(){return Object.keys(this.uploadedZonesByFilename).reduce(((e,t)=>({...e,[t]:this.uploadedZonesByFilename[t].features})),{})},async applicationMapAsShape(e,t=this.getApplicationMapName()){const{write:a}=await i.e(301).then(i.t.bind(i,18301,19)),{default:n}=await Promise.resolve().then(i.t.bind(i,55733,23)),r=new n;let s=r;"johndeere"===e?s=r.folder("Rx"):"trimble"===e&&(s=r.folder("AgGPS").folder("Prescriptions"));const o=this.getFeatures(e);Object.keys(o).forEach((e=>{const t=o[e];s.file(`${e}.prj`,'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]');const i=t.map((e=>e.properties)),n=t.map((e=>e.geometry.coordinates)),r=this.invertContour(n);a(i,"POLYGON",r,((t,i)=>{s.file(`${e}.shp`,i.shp.buffer,{binary:!0}),s.file(`${e}.shx`,i.shx.buffer,{binary:!0}),s.file(`${e}.dbf`,i.dbf.buffer,{binary:!0})}))}));const l=await r.generateAsync({compression:"STORE",type:"blob"});return{file:l,filename:`${t}.zip`}},getDosageByColor(e){const t=(this.zoneDosage??this.zones).find((t=>t.color===e));return t.dosage??t.rate??null},invertContour(e){return e.map((e=>e.map((e=>[...e].reverse()))))}}},Uue=function(){var e=this,t=e._self._c;return t("FormFieldDropdown",{attrs:{label:e.$t("Wähle den ausführenden Betrieb"),placeholder:e.$t("Wähle den ausführenden Betrieb"),value:e.dropdownValue,items:e.dropdownItems,id:e.id,required:e.required,variant:e.variant,state:e.state,itemsLoading:e.itemsLoading,various:e.various,disabled:e.disabled,disableDelete:e.disableDelete,slimMargin:e.slimMargin,hideLabel:e.hideLabel},on:{update:e.update}})},jue=[],Hue={name:"CompanySelectFormFieldDropdown",components:{FormFieldDropdown:lk},props:{companies:{type:Array,required:!0},selectedCompany:{type:Object,required:!0,validator:e=>["id","name"].every((t=>Object.keys(e).includes(t)))},id:{type:String,default:null},required:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg"].includes(e)},state:{type:Boolean,default:null},itemsLoading:{type:Boolean,default:!1},various:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disableDelete:{type:Boolean,default:!1},slimMargin:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1}},model:{prop:"selectedCompany",event:"update:selectedCompany"},computed:{dropdownValue(){return this.selectedCompany},dropdownItems(){return[{items:this.companies}]}},methods:{update(e){const t=this.companies.find((t=>t.id===e.id));this.$emit("update:selectedCompany",t)}}},Gue=Hue,Wue=(0,ew.Z)(Gue,Uue,jue,!1,null,null,null),Zue=Wue.exports;function Kue(e){const{databaseId:t}=e;if("number"!==typeof t)throw new Error(`Missing company databaseId in current company: ${e}`);return t}var que={name:"DownloadTab",components:{FormFieldDropdown:lk,CompanySelectFormFieldDropdown:Zue},mixins:[Vue],props:{workflowKey:{type:String,required:!0},buttonsDisabled:{type:Boolean,default:!1}},data(){return{shapeTypes:[{id:"default",name:this.$t("Standard - Shapef
1ile")},{id:"agleader",name:"Ag Leader - Shapefile"},{id:"amazone",name:"AMAZONE - Shapefile"},{id:"johndeere",name:"JOHN DEERE - Shapefile"},{id:"raven",name:"RAVEN - Shapefile"},{id:"topcon",name:"TOPCON - Shapefile"},{id:"trimble",name:"Trimble - Shapefile"},{id:"isoxml",name:"ISOXML"}],selectedShapeType:"default",downloadInProgress:!1}},computed:{...(0,C.rn)({taskDataAsync(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/taskDataAsync`]},currentCompanies(e){return e.auth.currentCompanies}}),selectedCompany:{get(){return this.$store.state.precisionFarming.applicationMaps[this.workflowKey].selectedCompany},set(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedCompany`,e)}},shapeTypeValueForDropdown(){return this.shapeTypes.find((e=>e.id===this.selectedShapeType))},shapeTypesToDropDownItems(){return[{items:this.shapeTypes}]},companySelectRequired(){return"isoxml"===this.selectedShapeType&&1!==this.currentCompanies.length},downloadButtonDisabled(){return this.buttonsDisabled||this.downloadInProgress||this.companySelectRequired&&!this.selectedCompany.id}},methods:{async exportApplicationMap(){this.$emit("exportTriggered"),this.downloadInProgress=!0,this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!0);const e=await this.taskDataAsync(this.$store.dispatch);if(this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!1),"isoxml"===this.selectedShapeType)return this.exportIsoXml(e),void(this.downloadInProgress=!1);const{default:t}=await i.e(563).then(i.t.bind(i,75563,23)),{file:a,filename:n}=await this.applicationMapAsShape(this.selectedShapeType);t(a,n),e.data.usage="shape",this.createApplicationMapEvent(e),this.downloadInProgress=!1},async exportIsoXml(e){try{const t=Kue(this.selectedCompany),{data:i}=await l().post(`/admin/comp/${t}/precision-farming/application-maps/isoxml/export`,e),a=e=>decodeURIComponent(atob(e).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join("")),n=new File([a(i.data)],"TASKDATA.xml",{type:"application/xml"}),r=document.createElement("a");r.download="TASKDATA.xml",r.href=URL.createObjectURL(n),r.click()}catch(t){console.error(t)}},createApplicationMapEvent(e){this.$emit("createApplicationMapEvent",e)}}},Yue=que,Jue=(0,ew.Z)(Yue,Nue,zue,!1,null,"9d7a06b0",null),Xue=Jue.exports,Que=function(){var e=this,t=e._self._c;return t("BContainer",{staticClass:"settings"},[t("p",{staticClass:"small"},[e._v(" "+e._s(e.$t("Aktualisiere den in der Arbeitsplanung geplanten Auftrag und füge die eben erstellte Applikationskarte hinzu."))+" ")]),e.companySelectRequired?t("CompanySelectFormFieldDropdown",{ref:"company",staticClass:"formControl",attrs:{companies:e.currentCompanies,variant:"vertical",disableDelete:"",hideLabel:"",required:e.companySelectRequired,"data-cy":"company-select-form-field-dropdown"},model:{value:e.selectedCompany,callback:function(t){e.selectedCompany=t},expression:"selectedCompany"}}):e._e(),t("div",{staticClass:"export__datepicker-wrapper"},[t("div",{staticClass:"export__calendar"},[t("FontAwesomeIcon",{staticClass:"export__calendar-icon",attrs:{icon:["fa","calendar-alt"]}}),t("Datepicker",{staticClass:"export__datepicker",attrs:{"calendar-class":"export__datepicker-calendar","input-class":"export__datepicker-input","calendar-button-icon":"fa fa-calendar","maximum-view":"day",language:e.$store.getters.datepickerTranslation,value:e.selectedTaskDate},on:{selected:t=>{e.setSelectedTaskDate(t)}}}),t("span",{staticClass:"export__datepicker-timestamp"},[e._v(" "+e._s(e.taskDateFormatted)+" ")])],1),t("div",{staticClass:"export__datepicker-button-wrapper"},[t("BButton",{staticClass:"text-black",attrs:{variant:"link"},on:{click:function(t){return e.moveSelectedTaskDateBy(-1)}}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-left"}})],1),t("BButton",{staticClass:"text-black",attrs:{variant:"link"},on:{click:function(t){return e.moveSelectedTaskDateBy(1)}}},[t("FontAwesomeIcon",{attrs:{icon:"chevron-right"}})],1)],1)]),t("div",[t("BButton",{staticClass:"btn",attrs:{variant:"primary",disabled:e.createTaskButtonDisabled},on:{click:e.createTask}}
1,[t("span",[e._v(e._s(e.buttonCreateTaskLabel))])])],1)],1)},epe=[],tpe={name:"PlanTaskTab",components:{Datepicker:iS.Z,CompanySelectFormFieldDropdown:Zue},props:{workflowKey:{type:String,required:!0},buttonsDisabled:{type:Boolean,default:!1}},data(){return{createTaskInProgress:!1}},computed:{...(0,C.rn)({task(e){return e.precisionFarming.applicationMaps[this.workflowKey].task},taskDataAsync(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/taskDataAsync`]},selectedTaskDate(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/selectedTaskDate`]},currentCompanies(e){return e.auth.currentCompanies}}),selectedCompany:{get(){return this.$store.state.precisionFarming.applicationMaps[this.workflowKey].selectedCompany},set(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedCompany`,e)}},taskDateFormatted(){return g()(this.selectedTaskDate).format("DD.MM.YYYY")},buttonCreateTaskLabel(){return null==this.task?this.$t("Auftrag erstellen"):this.$t("Auftrag aktualisieren")},createTaskButtonDisabled(){return this.buttonsDisabled||this.createTaskInProgress||this.companySelectRequired&&!this.selectedCompany.id},companySelectRequired(){return 1!==this.currentCompanies.length}},watch:{task:{immediate:!0,handler(e){null==e||"number"!==typeof e.timeStart?this.setSelectedTaskDate(new Date):this.setSelectedTaskDate(new Date(1e3*e.timeStart))}}},methods:{setSelectedTaskDate(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedTaskDate`,e)},moveSelectedTaskDateBy(e){const t=this.selectedTaskDate.setDate(this.selectedTaskDate.getDate()+e);this.setSelectedTaskDate(new Date(t))},async createTask(){this.$emit("update:errorMessage",null),this.createTaskInProgress=!0,this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!0);const e=await this.taskDataAsync(this.$store.dispatch);this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!1);const t=Kue(this.selectedCompany);let i=!1;try{this.task?(await l().put(`/admin/comp/${t}/taskplan/update/${this.task.id}`,e),i=!0):(await l().post(`/admin/comp/${t}/taskplan/insert`,e),i=!0)}catch(a){a.response&&this.$emit("update:errorMessage",a.response.data.errorUserMessage)}finally{this.createTaskInProgress=!1}i&&this.$router.push({name:"task-plan"})}}},ipe=tpe,ape=(0,ew.Z)(ipe,Que,epe,!1,null,"73c00452",null),npe=ape.exports,rpe=function(){var e=this,t=e._self._c;return t("MultiRootWrapper",[t("BContainer",{staticClass:"settings"},[t("p",{staticClass:"small"},[e._v(" "+e._s(e.$t("Sende die Applikationskarte direkt an die Cloud-Plattform deines Maschinenherstellers."))+" "+e._s(e.$t("Von dort kannst du sie vom Terminal deines Traktors abrufen ohne einen USB-Stick."))+" ")]),t("p",{staticClass:"font-weight-bold"},[e._v(" "+e._s(e.$t("Applikationskarte senden an ..."))+" ")]),t("div",[t("BButton",{staticClass:"btn btn-send-via-api",attrs:{variant:"white",disabled:e.buttonsDisabled},on:{click:e.sendApplicationMap}},[t("div",{staticClass:"john-deere-wrapper"},[t("div",[t("img",{attrs:{alt:"John Deere Logo",src:i(36808)}})]),t("span",[e._v("MyJohnDeere")])])])],1)]),e.showModalSendToJohnDeere?t("ModalSendToJohnDeere",{attrs:{workflowKey:e.workflowKey},model:{value:e.showModalSendToJohnDeere,callback:function(t){e.showModalSendToJohnDeere=t},expression:"showModalSendToJohnDeere"}}):e._e()],1)},spe=[],ope=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modal",staticClass:"modal-send-to-john-deere",attrs:{size:"xl",visible:e.visible,title:e.$t("Applikationskarte an John Deere senden")},on:{change:t=>e.$emit("change",t)},scopedSlots:e._u([{key:"map-container",fn:function(){return[t("div",{staticClass:"modal-send-to-john-deere__image-container"},[t("div",[t("BImg",{attrs:{fluid:"",src:i(24929)}})],1),t("div",{staticStyle:{"max-width":"430px"}},[t("BImg",{attrs:{"fluid-grow":"",src:i(47852)}})],1)])]},proxy:!0},{key:"buttons",fn:function(){return[e.uploadSuccess?e._e():t("BButton",{staticClass:"mr-3",attrs:{variant:"primary",disabled:e.uploadingFiles||null==e.selectedOrganization||0===e.selectedOrganization.length}
1,on:{click:e.sendToBackend}},[t("span",[e._v(e._s(e.$t("Senden")))])]),e.uploadSuccess?e._e():t("BButton",{staticClass:"text-dark",attrs:{variant:"white"},on:{click:()=>e.$refs.modal.hide()}},[t("span",[e._v(e._s(e.$t("Abbrechen")))])]),e.uploadSuccess?t("BButton",{staticClass:"text-dark",attrs:{variant:"white"},on:{click:()=>e.$refs.modal.hide()}},[t("span",[e._v(e._s(e.$t("Schließen")))])]):e._e()]},proxy:!0}])},[t("div",{staticClass:"modal-send-to-john-deere__main mt-3",attrs:{id:"modal-send-to-john-deere"}},[t("HeaderDarkGray",[e._v(" "+e._s(e.$t("Deine Organisationen in MyJohnDeere"))+" ")]),e.fetchingOrganizations?t("Loading"):null==e.organizations&&null!=e.urlGetCode?t("div",{staticClass:"m-3"},[t("p",[e._v(" "+e._s(e.$t("Mit FARMDOK kannst du Aufträge bzw. Applikationskarten direkt an deine John Deere Maschinen schicken. Dafür benötist du lediglich einen Account auf MyJohnDeere.com und musst deine Maschinen mit diesem Account verknüpfen. Du kannst die Applikationskarte auch ohne Account übertragen indem du sie herunterlädst und händisch mit einem USB-Stick überträgst."))+" ")]),t("BButton",{attrs:{variant:"primary"},on:{click:e.openGetCodePage}},[e._v(" "+e._s(e.$t("Login mit MyJohnDeere"))+" ")])],1):null!=e.organizations?t("div",[t("div",{staticClass:"m-3"},[t("span",{domProps:{innerHTML:e._s(e.$t("Du bist auf MyJohnDeere mit <u>{userEmail}</u> eingeloggt. Falls du mehr als eine Organisation auf MyJohnDeere hast wähle bitte die passende aus der Liste.",{userEmail:e.userEmail}))}})]),t("BFormGroup",{staticClass:"m-3",attrs:{label:e.$t("Organisation"),"label-for":"name","label-cols":"4"}},[t("Dropdown",{attrs:{items:e.selectedOrganizationDropdownItems},on:{select:t=>e.setSelectOrganization(t)}})],1),t("div",{staticClass:"m-3"},[t("BLink",{attrs:{href:"https://files.deere.com/",target:"_blank"}},[e._v(" "+e._s(e.$t("MyJohnDeere öffnen"))+" ")])],1),t("div",{staticClass:"m-3"},[t("BLink",{attrs:{id:"modal-send-to-john-deere__disconnect"},on:{click:e.disconnect}},[e._v(" "+e._s(e.$t("Verbindung zu MyJohnDeere trennen"))+" ")]),t("BTooltip",{attrs:{target:"modal-send-to-john-deere__disconnect",container:"modal-send-to-john-deere",placement:"bottom",delay:"500",trigger:"hover"}},[e._v(" "+e._s(e.$t("Falls du einen anderen MyJohnDeere Account verwenden möchtest logge dich bitte auf MyJohnDeere.com aus. Dann trenne die Verbindung in FARMDOK. Danach kannst du dich mit dem neuen Account verbinden."))+" ")])],1),t("HeaderDarkGray",[e._v(" "+e._s(e.$t("Deine Maschinen in MyJohnDeere.com"))+" ")]),t("div",{staticClass:"m-3"},[t("div",{staticClass:"mb-3"},[t("span",{domProps:{innerHTML:e._s(e.$t("Wähle die Maschine an die du den Auftrag bzw. die Applikationskarte senden möchtest. Wähle <b>MyJohnDeere</b> falls du die Daten in die MyJohnDeere Plattform senden möchtest."))}})]),t("BFormGroup",{attrs:{label:e.$t("Verfügbare Maschinen"),"label-for":"name","label-cols":"4"}},[t("Dropdown",{attrs:{items:e.machinesDropdownItems},on:{select:t=>e.selectedMachine=t.id}})],1)],1),t("HeaderDarkGray",[e._v(" "+e._s(e.$t("Auftrag/Applikationskarte"))+" ")]),t("div",{staticClass:"m-3"},[t("BFormGroup",{attrs:{label:`${e.$t("Dateiname")} (.zip)`,"label-for":"name","label-cols":"4"}},[t("BaseInput",{staticClass:"form-control font-weight-bold",attrs:{placeholder:e.$t("Dateiname")},model:{value:e.fileName,callback:function(t){e.fileName=t},expression:"fileName"}})],1),t("BFormGroup",{attrs:{label:e.$t("Dateityp"),"label-for":"name","label-cols":"4"}},[t("BaseInput",{staticClass:"form-control font-weight-bold",attrs:{disabled:""},model:{value:e.fileType,callback:function(t){e.fileType=t},expression:"fileType"}})],1),t("BFormGroup",{attrs:{label:e.$t("Datum"),"label-for":"name","label-cols":"4"}},[t("BaseInput",{staticClass:"form-control font-weight-bold",attrs:{disabled:""},model:{value:e.fileDate,callback:function(t){e.fileDate=t},expression:"fileDate"}})],1)],1)],1):e._e(),null!=e.errorUserMessage?t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.errorUserMessage)+" ")]):e._e(),null!=e.selectedOrganization&&0===e.selectedOrganization.length?t("p",{staticClass:"text-danger"},[e._v(" "+e._s(e.$t("Keine Organisation in deinem John Deere Account vorhanden."))+" ")]):e._e(
1),e.uploadSuccess?t("p",{staticClass:"text-primary"},[e._v(" "+e._s(e.$t("Dateien erfolgreich an John Deere gesendet."))+" ")]):e._e()],1)])},lpe=[],dpe=function(){var e=this,t=e._self._c;return t("h3",{staticClass:"header-dark-gray bg-dark text-white",style:{marginLeft:e.marginLeft}},[e._t("default")],2)},cpe=[],upe={name:"HeaderDarkGray",props:{variant:{type:String,default:"none"}},computed:{marginLeft(){return"margin-left-negative-30"===this.variant?"-30px":0}}},ppe=upe,hpe=(0,ew.Z)(ppe,dpe,cpe,!1,null,"21b05fee",null),mpe=hpe.exports;const fpe="SEND_TO_TERMINAL";var gpe={name:"ModalOverlaySendToJohnDeere",components:{HeaderDarkGray:mpe,Loading:z$,BaseInput:_J,Dropdown:nk,ModalWrapper:OC},mixins:[Vue],model:{prop:"visible",event:"change"},props:{visible:{type:Boolean,default:!1},workflowKey:{type:String,required:!0}},data(){return{organizations:null,machines:null,machinesAxiosSource:null,fetchingOrganizations:!1,selectedOrganization:null,selectedMachine:null,urlGetCode:null,userEmail:null,uploadingFiles:!1,errorUserMessage:null,uploadSuccess:!1,fileName:null,fileDate:g()().format("DD.MM.YYYY"),fileType:"Prescription"}},computed:{...(0,C.rn)({currentCompanies(e){return e.auth.currentCompanies}}),selectedOrganizationDropdownItems(){const e={id:null,name:""};null!==this.selectedOrganization&&(e.id=this.selectedOrganization,e.name=this.selectedOrganizationById[this.selectedOrganization].name);const t=[];let i=[];return null!=this.organizations&&(i=this.organizations.map((e=>({id:e.id,name:e.name})))),t.push({name:this.$t("Organisation"),id:"organizations",items:i,sort:!0}),{data:t,loading:null!=this.machinesAxiosSource,selected:e}},machinesDropdownItems(){const e={id:null,name:""};this.selectedMachine===fpe?(e.id=fpe,e.name=this.$t("MyJohnDeere")):null!=this.selectedMachine&&(e.id=this.selectedMachine,e.name=this.machinesById[this.selectedMachine].name);const t=[{name:this.$t("Plattform"),id:"myjohndeere",items:[{id:fpe,name:this.$t("MyJohnDeere")}],sort:!1}];let i=[];return null!=this.machines&&(i=this.machines.map((e=>({id:e.id,name:e.name})))),t.push({name:this.$t("Maschinen"),id:"machines",items:i,sort:!0}),{data:t,loading:null!=this.machinesAxiosSource,selected:e}},selectedOrganizationById(){return null==this.organizations?null:this.organizations.reduce(((e,t)=>({...e,[t.id]:t})),{})},machinesById(){return null==this.machines?null:this.machines.reduce(((e,t)=>({...e,[t.id]:t})),{})},companyDatabaseId(){return Kue(this.currentCompanies[0])}},async created(){this.onFocus=()=>this.updateOrganizations(),window.addEventListener("focus",this.onFocus),this.fileName=this.getApplicationMapName(),await this.updateOrganizations(),await this.updateMachines()},beforeDestroy(){window.removeEventListener("focus",this.onFocus)},methods:{setSelectOrganization(e){this.selectedOrganization=e.id,this.updateMachines()},async updateOrganizations(){if(!this.fetchingOrganizations){this.fetchingOrganizations=!0;try{const{data:e}=await l().get(`/admin/comp/${this.companyDatabaseId}/johnDeere/userData`);null!=e&&null!=e.data&&"string"===typeof e.data.url?this.urlGetCode=e.data.url:null!=e&&null!=e.data&&Array.isArray(e.data.organizations)?(this.organizations=e.data.organizations,this.organizations.length>0&&(this.selectedOrganization=this.organizations[0].id,window.removeEventListener("focus",this.onFocus)),"string"===typeof e.data.user&&(this.userEmail=e.data.user)):this.organizations=null,this.fetchingOrganizations=!1}catch(e){console.error(e),this.organizations=null,this.fetchingOrganizations=!1}}},async updateMachines(){if(null!=this.machinesAxiosSource&&this.machinesAxiosSource.cancel(),this.errorUserMessage=null,this.machinesAxiosSource=l().CancelToken.source(),this.machines=[],this.selectedMachine=fpe,null!=this.organizations){if(!this.selectedOrganization)return this.errorUserMessage=this.$t("Das Abrufen der Maschinenliste von John Deere fehlgeschlagen."),void(this.machinesAxiosSource=null);try{const{data:e}=await l().get(`/admin/comp/${this.companyDatabaseId}/johnDeere/getMachinesList?organizationId=${this.selectedOrganization}`,{cancelToken:this.machinesAxiosSource.token});null!=e&&null!=e.data&&Array.isArray(e.data.machines)&&(this.machines=e.data.machines),this.machinesAxiosSource=null}catch(e){l().isCancel(e)||(this.errorUserMessage=this.$t("Das Abrufen der Maschinenliste von John Deere fehlgeschlagen.")),this.machinesAxiosSource=null}}else this.machinesAxiosSource=null},openGetCodePage(){window.open(this.urlGetCode)}
1,async sendToBackend(){if(this.uploadingFiles)return;this.errorUserMessage=null;const{file:e,filename:t}=await this.applicationMapAsShape("johndeere",this.fileName),i=new FormData;i.append("file",e,t),i.append("organizationId",this.selectedOrganization);try{this.uploadingFiles=!0,this.selectedMachine!==fpe?(i.append("machineId",this.selectedMachine),await l().post(`/admin/comp/${this.companyDatabaseId}/johnDeere/fileTransfer`,i)):await l().post(`/admin/comp/${this.companyDatabaseId}/johnDeere/fileUpload`,i),this.uploadSuccess=!0,this.uploadingFiles=!1}catch(a){null!=a&&null!=a.response&&null!=a.response.data&&"string"===typeof a.response.data.errorUserMessage?this.errorUserMessage=a.response.data.errorUserMessage:this.errorUserMessage=this.$t("Fileupload zu John Deere fehlgeschlagen."),this.uploadingFiles=!1}},async disconnect(){try{this.uploadingFiles=!0,await l().get(`/admin/comp/${this.companyDatabaseId}/johnDeere/disconnect`),this.$refs.modal.hide()}catch(e){null!=e&&null!=e.response&&null!=e.response.data&&"string"===typeof e.response.data.errorUserMessage?this.errorUserMessage=e.response.data.errorUserMessage:this.errorUserMessage=this.$t("Verbindung trennen fehlgeschlagen."),this.uploadingFiles=!1}}}},ype=gpe,vpe=(0,ew.Z)(ype,ope,lpe,!1,null,"5967d8dd",null),bpe=vpe.exports,wpe={name:"SendToTab",components:{ModalSendToJohnDeere:bpe,MultiRootWrapper:jM},props:{workflowKey:{type:String,required:!0},buttonsDisabled:{type:Boolean,default:!1}},data(){return{showModalSendToJohnDeere:!1}},computed:{...(0,C.rn)({taskDataAsync(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/taskDataAsync`]}})},methods:{async sendApplicationMap(){this.$emit("sendApplicationMapTriggered"),this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!0);const e=await this.taskDataAsync(this.$store.dispatch);this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setFetchingTask`,!1),e.data.usage="myJohnDeere",this.createApplicationMapEvent(e),this.showModalSendToJohnDeere=!0},createApplicationMapEvent(e){this.$emit("createApplicationMapEvent",e)}}},Cpe=wpe,Fpe=(0,ew.Z)(Cpe,rpe,spe,!1,null,"686323c4",null),Ape=Fpe.exports,kpe={name:"Export",components:{SidebarContentWrapper:Qle,SidebarSubHeadline:rde,Tabs:mte,DownloadTab:Xue,SendToTab:Ape,PlanTaskTab:npe},props:{workflowKey:{type:String,required:!0}},data(){return{buttonDownload:{type:"button",label:this.$t("Download"),active:!0,onClick:()=>{this.buttonDownload.active=!0,this.buttonSendTo.active=!1,this.buttonPlanTask.active=!1}},buttonSendTo:{type:"button",label:this.$t("Senden an"),active:!1,onClick:()=>{this.buttonDownload.active=!1,this.buttonSendTo.active=!0,this.buttonPlanTask.active=!1}},buttonPlanTask:{type:"button",label:this.$t("Auftrag planen"),active:!1,onClick:()=>{this.buttonDownload.active=!1,this.buttonSendTo.active=!1,this.buttonPlanTask.active=!0}}}},watch:{selectedCompany:{immediate:!0,handler(){this.selectedCompany.id||this.setSelectedCompany(this.currentCompanies[0])}}},computed:{...(0,C.Se)({fields:"fields",byRoughAndFineId:"activityTypes/byRoughAndFineId",processOrderByCompanyIdAndNameAndType:"auth/processOrderByCompanyIdAndNameAndType"}),...(0,C.rn)({currentHeatmaps(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/currentHeatmaps`]},uploadedZonesByFilename(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZonesByFilename`]},zoneGenerationMode(e){return e.precisionFarming.applicationMaps[this.workflowKey].zoneGenerationMode},fetchingTask(e){return e.precisionFarming.applicationMaps[this.workflowKey].fetchingTask},fetchingMaterial(e){return e.precisionFarming.applicationMaps[this.workflowKey].fetchingMaterial},currentCompanies(e){return e.auth.currentCompanies},selectedCompany(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedCompany}}),tabs(){return[this.buttonDownload,this.buttonSendTo,this.buttonPlanTask]},buttonsDisabled(){return this.zoneGenerationMode===Oh?0===Object.values(this.currentHeatmaps).length:this.zoneGenerationMode!==$h||0===Object.values(this.uploadedZonesByFilename).length},downloadButtonDisabled(){return this.fetchingMaterial||this.buttonsDisabled},planTaskButtonDisabled(){return this.fetchingTask||this.fetchingMaterial||this.buttonsDisabled}},methods:{setStepsCompleted(){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setStepsCompleted`,!0)},setSelectedCompany(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedCompany`,e)},async createApplicationMapEvent(e){try{const t=Kue(this.selectedCompany);await l().post(`/admin/comp/${t}/precision-farming/application-maps/event`,e)}catch(t){console.error(t)}}}},Spe=kpe,Epe=(0,ew.Z)(Spe,$ue,Rue,!1,null,"90039408",null),Ipe=Epe.exports,_pe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("MultiRootWrapper",[t("table",{staticClass:"table-output table-simple-without-borders"},[t("thead",[t("tr",{staticClass:"text-right"},[t("th"),e._l(e.tableHeaders,(function(i,a){return t("th",{key:a},[e._v(e._s(i))])}))],2)]),t("tbody",e._l(e.tableRows,(function(i,a){return t("tr",{key:a,staticClass:"text-right",class:{"border-medium":a!==e.tableRows.length-1,"border-0":a===e.tableRows.length-1}},[t("td",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.right",modifiers:{hover:!0,right:!0}}],staticClass:"text-left col-field-name",attrs:{title:i.title}},[e._v(" "+e._s(i.name)+" ")]),e._l(i.values,(function(i,a){return t("td",{key:a},[e._v(" "+e._s(i)+" ")])}))],2)})),0)]),e.tableHint?t("small",{staticClass:"table-hint"}
1,[e._v(" "+e._s(e.tableHint)+" ")]):e._e()])},Dpe=[],Mpe=(0,b.defineComponent)({name:"ExportTable",components:{MultiRootWrapper:jM},props:{tableHeaders:{type:Array,required:!0,default:()=>[]},tableRows:{type:Array,required:!0,default:()=>[]},tableHint:{type:String,required:!1,default:""}}}),Ppe=Mpe,Tpe=(0,ew.Z)(Ppe,_pe,Dpe,!1,null,"0e263e44",null),xpe=Tpe.exports,Bpe=(0,b.defineComponent)({name:"SidebarExportSpraying",components:{Export:Ipe,ExportTable:xpe},data(){return{numbro:Nl}},computed:{...(0,C.rn)("fields",{fields:"data"}),...(0,C.rn)("precisionFarming/applicationMaps/spraying",{selectedFieldIds(e){return e.selectedFields},calculation(e){return e.calculation},reducedVegetationPerZone(e,t){return t.reducedVegetationPerZone},heatmaps(e,t){return t.heatmapsOfSelectedFields},zones(e,t){return t.zones}}),selectedFields(){return this.selectedFieldIds.map((e=>this.fields[e])).filter(ka)},tableHeaders(){const e=this.calculation.products.map((e=>e.product.name));return[this.$t("Spritzbrühe")??"",...e]},totalArea(){return this.selectedFields.map((e=>e.fieldSize)).reduce(((e,t)=>e+t),0)},vegetationMax(){return Math.max(...this.reducedVegetationPerZone)},productReductionsPerZone(){return this.zones.map(((e,t)=>this.calculation.products.map((e=>this.reduceProduct(e.amount,t)))))},tableRows(){return this.heatmaps.map(((e,t)=>{const i=this.selectedFields[t],a=this.calculation.sprayMix*i.fieldSize/this.totalArea,n=this.calculation.products.map(((t,i)=>this.productMid(e,i)));return{title:i.name,name:i.name,values:[Nl(a).format(),...n.map((e=>Nl(e).format()))]}}))}},methods:{reduceProduct(e,t){return e*this.reducedVegetationPerZone[t]/this.vegetationMax},productReductionMatrix(e,t){const i=this.zones.findIndex((t=>t.color===e));return this.productReductionsPerZone[i][t]},productMid(e,t){const i=e.color_codes.filter((e=>e.area>0)).map((e=>{const i=this.productReductionMatrix(e.col,t);return i*e.area})).reduce(((e,t)=>e+t),0);return i/e.area}}}),Ope=Bpe,$pe=(0,ew.Z)(Ope,Bue,Oue,!1,null,null,null),Rpe=$pe.exports,Npe=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"sidebar",fn:function(){return[e._t("headerLogo"),t("Navigation",{attrs:{workflowKey:e.workflowKey,stepCount:e.stepCount},on:{onNavigationNext:t=>e.$emit("onNavigationNext",t)}}),e._t("steps")]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"application-maps__map-wrapper",attrs:{id:"application-maps__map-wrapper"}},[null!=e.map&&null!=e.polygonHovered?t("MapItemTooltip",{key:e.polygonHovered,staticClass:"application-maps__map-tooltip",attrs:{map:e.map,polygon:e.polygons[e.polygonHovered]}},[t("div",{staticClass:"text-left"},[t("ul",{staticClass:"application-maps__map-tooltip-list"},[t("li",{staticClass:"application-maps__map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.name)+" ")]),null!=e.polygonHoveredData.crop?t("li",{staticClass:"application-maps__map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.crop)+" ")]):e._e(),null!=e.polygonHoveredData.size?t("li",{staticClass:"application-maps__map-tooltip-list-item"},[e._v(" "+e._s(e.polygonHoveredData.size)+" ")]):e._e()])])]):e._e(),e.map?[e._l(e.allFeatures,(function(i){return[t("GoogleMapsPolygon",{key:`polygon-${i.heatmapKey}:${i.featureIndex}:${i.geometry.coordinates[0]}`,attrs:{map:e.map,paths:e.toGoogleMapsPolygon(i.geometry.coordinates),fillColor:i.properties.customColor??i.properties.fill,fillOpacity:1,strokeWeight:0,zIndex:10,visible:!0},on:{click:function(t){e.activeHeatmapFeature=i}}}),["seeding","seedingSoy","fertilization","spraying"].includes(e.workflowKey)?t("GoogleMapsLabel",{key:`label-${i.heatmapKey}-${i.featureIndex}`,attrs:{map:e.map,position:e.featureCenter(i),skewed:!1,set:e.zone=e.zoneByHexCode(i.properties.customColor??i.properties.fill),label:e.format(e.valueByWorkflow(e.zone)),fillColor:"",textColor:"#FFFFFF",zIndex:10,visible:!0}}):e._e()]})),e.activeHeatmapFeature&&e.zonesAreLoaded?t("GoogleMapsOverlay",{attrs:{map:e.map,position:e.featureCenter(e.activeHeatmapFeature),skewed:!0,fillColor:"#FFFFFF",visible:!0,zIndex:12}},[t("FormFieldDropdown",{attrs:{items:e.dropdownCategories,colorCoded:"",label:"Select custom zone value",variant:"vertical",disableDelete:""},model:{value:e.selectedZone,callback:function(t){e.selectedZone=t},expression:"selectedZone"}}),t("BButtonGroup",{staticClass:"d-flex flex-row"},[t("BButton",{staticClass:"w-50",attrs:{size:"sm",variant:"primary",disabled:e.selectedZone.id===e.activeHeatmapFeature.customColor},on:{click:e.updateFeatureValue}},[e._v(e._s(e.$t("OK"))+" ")]),t("BButton",{staticClass:"w-50",attrs:{size:"sm",variant:"white"},on:{click:e.hideOverlay}}
1,[e._v(" "+e._s(e.$t("Abbrechen"))+" ")])],1)],1):e._e()]:e._e(),t("div",{ref:"map-container",staticClass:"application-maps__map-container"})],2)]},proxy:!0},{key:"featureNotEnabled",fn:function(){return[t("MaxWidthContainer",{attrs:{left:"",size:"xl"}},[t("h2",{staticClass:"my-4"},[e._v(e._s(e.$t("Jetzt upgraden auf FARMDOK PERFORMANCE!")))]),t("p",[e._v(" "+e._s(e.$t("Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu FARMDOK Monitoring. Die Anwendung ermöglicht es Vegetations­unterschiede teilflächenspezifisch in der Karte darzustellen und den zeitlichen Verlauf zu analysieren."))+" ")]),t("p",[e._v(" "+e._s(e.$t("Für die Auswertung werden Daten der Sentinel Erdbeobachtungs­satelliten verwendet. Satelliten- & Wetterdaten zeigen Biomassezuwachs (NDVI- und MSAVI2-Index), Stickstoffverbrauch (REIP-Index) und Wassergehalt (NDWI-Index) auf. Sie sind die optimale Unterstützung für effektive Produktionsentscheidungen."))+" ")]),t("div",{staticClass:"row my-4"},[t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(28817),alt:"Application maps preview"}})]),t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(55024),alt:"Application maps preview"}})]),t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(58941),alt:"Application maps preview"}})])]),t("Button",{staticClass:"d-print-none",attrs:{"leading-icon":"",variant:"danger",icon:["far","shopping-cart"]},on:{click:()=>e.$router.push({name:"shop"})}},[e._v(" Zum Shop ")])],1)]},proxy:!0}],null,!0)})},zpe=[],Lpe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{ref:"content",staticClass:"tooltip b-tooltip",attrs:{id:"content"}},[e._t("default")],2)},Vpe=[],Upe=(0,b.defineComponent)({__name:"GoogleMapsOverlay",props:{map:null,position:null,skewed:{type:Boolean,default:!0},fillColor:{default:"#FFFFF"},textColor:{default:"#000000"},visible:{type:Boolean,default:!0},zIndex:null},setup(e){const t=e;(0,b.useCssVars)(((e,t)=>({f6c343bc:e.textColor,"7ff3738c":e.fillColor,"55ebc384":t.fontSize,a44fa7e8:e.zIndex})));class i extends google.maps.OverlayView{constructor(e){super(),(0,tt.Z)(this,"options",void 0),this.options=e,this.setMap(e.map)}onAdd(){}onRemove(){}draw(){const e=this.options.div(),t=this.getProjection().fromLatLngToContainerPixel(this.options.position());let i=t?.x||0,a=t?.y||0;this.options.skewed||(i-=e.offsetWidth/2,a-=e.offsetHeight/2),e.style.left=`${i}px`,e.style.top=`${a}px`}}const a=(0,b.ref)(`${s()}pt`),n=(0,b.ref)(),r=new i({map:t.map,position:()=>t.position,skewed:t.skewed,div:()=>n.value});function s(){const e=(t.map.getZoom()||11)-10;return e>0?e:1}return(0,b.onUnmounted)((()=>{r.setMap(null)})),t.map.addListener("zoom_changed",(()=>{a.value=`${s()}pt`})),(0,b.watch)((()=>t.position),(()=>{r.draw()})),{__sfc:!0,Overlay:i,props:t,fontSize:a,content:n,overlay:r,estimateFontSize:s}}}),jpe=Upe,Hpe=(0,ew.Z)(jpe,Lpe,Vpe,!1,null,"03db55fc",null),Gpe=Hpe.exports,Wpe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div")},Zpe=[],Kpe=(0,b.defineComponent)({__name:"GoogleMapsPolygon",props:{map:null,paths:null,fillColor:{default:"#555555"},fillOpacity:{default:.7},strokeColor:{default:"#555555"},strokeOpacity:{default:1},strokeWeight:{default:2},strokeStyle:{default:"solid"},geodesic:{type:Boolean,default:!0},visible:{type:Boolean,default:!0},zIndex:{default:10}},emits:["click"],setup(e,{emit:t}){const i=e,a=(0,b.reactive)(new google.maps.Polygon({map:i.map,paths:i.paths,fillColor:i.fillColor,fillOpacity:i.fillOpacity,strokeColor:i.strokeColor,strokeOpacity:"dashed"===i.strokeStyle?0:i.strokeOpacity,strokeWeight:i.strokeWeight,geodesic:i.geodesic,visible:i.visible,zIndex:i.zIndex}));return a.addListener("click",(()=>t("click"))),(0,b.watch)((()=>i.fillColor),(e=>a.setOptions({fillColor:e}))),(0,b.onUnmounted)((()=>{a.setMap(null)})),{__sfc:!0,props:i,polygon:a,emit:t}}}),qpe=Kpe,Ype=(0,ew.Z)(qpe,Wpe,Zpe,!1,null,null,null),Jpe=Ype.exports;function Xpe(e){const t=e.map((e=>e.lng())).reduce(((e,t)=>e+t)),i=e.map((e=>e.lat())).reduce(((e,t)=>e+t)),a=t/e.length,n=i/e.length;return new google.maps.LatLng({lng:a,lat:n})}function Qpe(e){return e.map((e=>E3(e)))}var ehe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"navigation"},[t("Pagination",{attrs:{pages:e.stepCount,current:e.currentPageIndex}}),t("div",{staticClass:"controls"},[t("ButtonWithArrow",{staticClass:"mr-1",attrs:{variant:"white",type:"left"},on:{click:function(t){return e.goToStep(-1)}}},[e._v(" "+e._s(1===e.paginationStep?e.$t("Abbrechen"):e.$t("Zurück"))+" ")]),t("ButtonWithArrow",{staticClass:"buttonWithArrowRight",attrs:{variant:"primary",type:"right",disabled:!e.paginationNextEnabled||e.loading,tooltipOptions:e.tooltipOptions,"data-cy":"navigation-next-btn"},on:{click:e.onButtonNext}},[e._v(" "+e._s(e.paginationStep===e.stepCount?e.$t("Abschließen"):e.$t("Weiter"))+" "),e.loading?t("Loading",{attrs:{inline:!0,color:"secondary"}}
1):e._e()],1)],1)],1)},the=[],ihe={name:"navigation",props:{workflowKey:{type:String,required:!0},stepCount:{type:Number,required:!0}},data(){return{pages:4}},components:{Loading:z$,ButtonWithArrow:VK,Pagination:qk},computed:{...(0,C.rn)({paginationStep(e){return e.precisionFarming.applicationMaps[this.workflowKey].paginationStep},paginationNextEnabled(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/paginationNextEnabled`]},paginationNextDisabledReason(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/paginationNextDisabledReason`]},loading(e){return e.precisionFarming.applicationMaps[this.workflowKey].checkingViolation}}),currentPageIndex(){return this.paginationStep-1},tooltipOptions(){return{title:this.paginationNextDisabledReason,disabled:!this.paginationNextDisabledReason}}},methods:{goToStep(e){const t=this.paginationStep+e;if(t<1)return this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/reset`),void this.$router.push({name:"application-maps"});this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setPaginationStep`,this.paginationStep+e)},stepsCompleted(){this.$router.push({name:"application-maps"}),this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/reset`)},nextStep(){this.paginationStep<this.stepCount?this.goToStep(1):this.stepsCompleted()},onButtonNext(){this.$listeners&&this.$listeners.onNavigationNext?this.$emit("onNavigationNext",(()=>{this.nextStep()})):this.nextStep()}}},ahe=ihe,nhe=(0,ew.Z)(ahe,ehe,the,!1,null,"485ac26f",null),rhe=nhe.exports;ow.vI.add(uw.A35,uw._tD,lw.sq$);let she=null;var ohe={name:"PageApplicationMaps",components:{GoogleMapsPolygon:Jpe,FormFieldDropdown:lk,GoogleMapsOverlay:Gpe,GoogleMapsLabel:h3,ThePageSkeleton:$w,Navigation:rhe,MapItemTooltip:fE,MaxWidthContainer:Tw,Button:gw},props:{noContentbar:{type:Boolean,default:!1},workflowKey:{type:String,required:!0},stepCount:{type:Number,required:!0}},inject:{googleMapsSettings:{default:()=>X}},data(){return{map:null,polygonHovered:null,storeUnsubscribe:null,activeHeatmapFeature:void 0,heatmapClickListener:null,selectedZone:{id:"",name:""}}},computed:{...(0,C.Se)({fields:"fields"}),...(0,C.rn)({paginationStep(e){return e.precisionFarming.applicationMaps[this.workflowKey].paginationStep},zoneGenerationMode(e){return e.precisionFarming.applicationMaps[this.workflowKey].zoneGenerationMode},fieldsWithHeatmap(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/fieldsWithHeatmap`]},polygons(e){return e.precisionFarming.applicationMaps[this.workflowKey].polygons},heatmaps(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/currentHeatmaps`]},uploadedZonesByFilename(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZonesByFilename`]},zones(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zones`]},zoneDosage(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zoneDosage`]},selectedIndexType(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedIndexType},heatmapsOfSelectedFields(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/heatmapsOfSelectedFields`]},...(0,C.Se)("precisionFarming/applicationMaps/spraying",["reducedSprayMixPerZone"])}),allFeatures(){return this.heatmapsOfSelectedFields.flatMap((e=>e.features))},currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC)},selectedFields:{get(){return this.$store.state.precisionFarming.applicationMaps[this.workflowKey].selectedFields},set(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setSelectedFields`,e)}},selectedFieldsData(){return Object.entries(this.fields).filter((([e])=>this.selectedFields.includes(e))).reduce(((e,[t,i])=>(e[t]=i,e)),{})},polygonHoveredData(){if(null==this.polygonHovered||null==this.polygons[this.polygonHovered])return{color:"",name:"",crop:"",size:""};const{lineChartColor:e,name:t}=this.polygons[this.polygonHovered];let{crop:i,size:a}=this.polygons[this.polygonHovered];return null!=i&&(i=i.name),null==a&&(a=she.maps.geometry.spherical.computeArea(this.polygons[this.polygonHovered].getPath())/1e4),a=this.$t("{size} ha",{size:Bl()(a).format()}),{color:e,name:t,crop:i,size:a}},zonesAreLoaded(){const e=["fertilization","spraying","seeding","seedingSoy"].includes(this.workflowKey);return 2===this.paginationStep&&e&&!!this.zones.length},dropdownCategories(){const e=this.zones.map(this.toDropdownItem);return[{name:"Zones",id:"0",items:e,sort:!1}]},pointsInFocus(){return(this.selectedFields||this.fieldsWithHeatmap).filter(hH).map((e=>this.polygons[e])).filter(ka).map((e=>e.getPath())).flatMap((e=>e.getArray()))}},watch:{paginationStep(){1!==this.paginationStep&&2!==this.paginationStep||(this.polygonsRedraw(),this.uploadedZonesRedraw()),2!==this.paginationStep&&this.hideOverlay()},zoneGenerationMode(){this.polygonsRedraw(),this.uploadedZonesRedraw()},selectedFields(e,t){this.selectedFieldsOnUpdate(e,t)},polygons(){this.polygonsRedraw()},heatmapsOfSelectedFields:{deep:!0,handler(){this.polygonsRedraw()}},uploadedZonesByFilename(){this.polygonsRedraw(),this.uploadedZonesRedraw()},pointsInFocus(e,t){if(e.length>t.length){const t=new she.maps.LatLngBounds;e.forEach((e=>t.extend(e))),this.map?.fitBounds(t,60)}},activeHeatmapFeature(e){if(!e)return;const t=e.properties.customColor??e.properties.fill,i=this.zoneByHexCode(t);this.selectedZone=this.toDropdownItem(i)}},mounted(){this.storeUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.mapInit()})),this.mapInit()},beforeDestroy(){she.maps.event.removeListener(this.heatmapClickListener),this.storeUnsubscribe()},methods:{toGoogleMapsPolygon:Qpe,toGoogleMapsPath:E3,toGoogleMapsPoint:S3,calculatePolygonCenter:Xpe,hideOverlay(){this.activeHeatmapFeature=void 0},zoneByHexCode(e){return this.zones?.find((t=>t.color===e))},toDropdownItem(e){return e?{id:e.color,name:this.format(this.valueByWorkflow(e)),value:e.rate}:{id:"",name:"",value:0}},updateFeatureValue(){const e={...this.activeHeatmapFeature};e.vegetation.custom_value_q=this.selectedZone.value,e.properties.customColor=this.selectedZone.id,this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/updateFeature`,e),this.hideOverlay()},format(e){const t="REIP"===this.selectedIndexType||"seeding"===this.workflowKey||"seedingSoy"===this.workflowKey;return Bl()(e??0).format({thousandSeparated:!0,mantissa:t?0:2})},featureCenter(e){const t=lre.yue(e.geometry.coordinates);let i=lre.Scw(t);if(!lre.FWy(i,t)){const e=lre.TuJ([[i.geometry.coordinates[0]-.1,i.geometry.coordinates[1]],[i.geometry.coordinates[0]+.1,i.geometry.coordinates[1]]]),a=lre.HLN(e,t);if(a.features.length>=2){a.features.sort(((e,t)=>e.geometry.coordinates[0]-t.geometry.coordinates[0]));const e=lre.H2w(a.features[0],a.features[1]);if(lre.FWy(e,t))i=e;else if(a.features.length>2){const e=lre.H2w(a.features[a.features.length-2],a.features[a.features.length-1]);i=lre.FWy(e,t)?e:lre.Om1(t)}else i=lre.Om1(t)}else i=lre.Om1(t)}return this.toGoogleMapsPoint(i.geometry.coordinates)},async mapInit(){if(!this.currentCompaniesHaveFeature.enabled)return;she=await cE();
1const e={tilt:0,mapTypeId:she.maps.MapTypeId.HYBRID,disableDefaultUI:!0,mapTypeControl:!0,mapTypeControlOptions:{style:she.maps.MapTypeControlStyle.DROPDOWN_MENU,position:she.maps.ControlPosition.TOP_RIGHT,mapTypeIds:[she.maps.MapTypeId.SATELLITE,she.maps.MapTypeId.ROADMAP,she.maps.MapTypeId.HYBRID]},zoomControl:!0,zoomControlOptions:{position:she.maps.ControlPosition.RIGHT_CENTER},fullscreenControl:!1,isFractionalZoomEnabled:!0,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]};this.map=new she.maps.Map(this.$refs["map-container"],e),await this.initFields(),this.map.addListener("click",(()=>{this.hideOverlay()}))},async initFields(){await this.$store.dispatch("auth/subscribe"),await this.$store.dispatch("fields/subscribe");const e=new she.maps.LatLngBounds;Object.keys(this.fields).forEach((t=>{const i=this.fields[t];if(null==i.fieldContour||null==i.fieldContour.geoJson||"Polygon"!==i.fieldContour.geoJson.type)return;const{geoJson:a}=i.fieldContour,n={name:rA.data.call(this,i),crop:i.crop,size:i.fieldSize},{lat:r,lon:s}=i,o={lat:r,lon:s};this.polygonAdd(t,o,a,n),a.coordinates[0].forEach((t=>e.extend({lng:t[0],lat:t[1]})))})),Object.values(this.fields).length>0?this.mapFitBounds({bounds:e}):this.map.setOptions(this.googleMapsSettings.GOOGLE_MAPS_DEFAULT_CENTER),this.selectedFieldsOnUpdate(this.selectedFields,[]),this.$nextTick((()=>{this.uploadedZonesRedraw()}))},mapFitBounds({bounds:e,maxZoom:t=16,usePan:i=!1}){this.map&&(she.maps.event.addListenerOnce(this.map,"bounds_changed",(()=>{this.map?.setOptions({maxZoom:null})})),this.map.setOptions({maxZoom:t}),i?(this.map.setZoom(t),this.map.panToBounds(e,500)):this.map.fitBounds(e))},selectedFieldsOnUpdate(e,t){const i=e.filter((e=>!t.includes(e)&&this.polygons[e])),a=t.filter((t=>!e.includes(t)&&this.polygons[t]));i.forEach((e=>{this.activatePolygon(e)})),a.forEach((e=>{this.deactivatePolygon(e)}))},polygonAdd(e,t,i,a){const n=new she.maps.Polygon({...a,field_key:e,paths:i.coordinates[0].map((e=>({lng:e[0],lat:e[1]}))),strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeOpacity:1,strokeWeight:2,fillColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,state:Rh.INACTIVE,lat:t.lat,lon:t.lon});[n.pathsForAxios]=i.coordinates,she.maps.event.addListener(n,"click",(()=>{if(1===this.paginationStep){const t=this.polygons[e].state;this.polygonSwitchState(e,t)}})),she.maps.event.addListener(n,"mouseover",(()=>{this.polygonHovered=e})),she.maps.event.addListener(n,"mouseout",(()=>{this.polygonHovered===e&&(this.polygonHovered=null)})),this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/addPolygon`,n)},polygonsRedraw(){Object.values(this.polygons).forEach((e=>{const{state:t}=e;let i={};t===Rh.ACTIVE?(i={strokeColor:this.googleMapsSettings.POLYGON_ACTIVE_STROKE_COLOR,fillColor:this.googleMapsSettings.POLYGON_ACTIVE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1},this.zoneGenerationMode===Oh&&this.fieldsWithHeatmap.includes(e.field_key)&&(i.fillOpacity=0,i.strokeOpacity=0)):t===Rh.INACTIVE&&(i={fillColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1}),e.setMap(this.map),e.setOptions(i)}))},deactivatePolygon(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/polygonSetState`,{key:e,state:Rh.INACTIVE})},addToSelected(e){this.selectedFields.includes(e)||(this.selectedFields=[...this.selectedFields,e])},removeFromSelected(e){this.selectedFields.includes(e)&&(this.selectedFields=this.selectedFields.filter((t=>t!==e)))},activatePolygon(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/polygonSetState`,{key:e,state:Rh.ACTIVE})},polygonSwitchState(e,t){t===Rh.INACTIVE?this.addToSelected(e):this.removeFromSelected(e)},uploadedZonesRedraw(){this.zoneGenerationMode===$h&&(this.map.data.forEach((e=>{this.map.data.remove(e)})),Object.values(this.uploadedZonesByFilename).forEach((e=>{this.map.data.addGeoJson(e),this.map.data.setStyle((e=>{const t=e.getProperty("fill");return{fillColor:t,strokeColor:"transparent",fillOpacity:.8,zIndex:10}}))})))},valueByWorkflow(e){if(!e)return 0;const t=this.zones.findIndex((t=>t===e));switch(this.workflowKey){case"seeding":return e.manualSeedRate??e.seedRateWithLossCompensation;case"seedingSoy":return(e.manualSeedRate??e.seedRateWithLossCompensation)/1e4;case"fertilization":return 2===this.paginationStep?e.rate:this.zoneDosage[t].dosage;case"fertilizationCereals":return 0;case"spraying":return 2===this.paginationStep?e.rate:this.reducedSprayMixPerZone[t];default:throw new Error("Workflow is unknown")}}}}
1,lhe=ohe,dhe=(0,ew.Z)(lhe,Npe,zpe,!1,null,"ebb9786a",null),che=dhe.exports,uhe=(0,b.defineComponent)({name:"PageApplicationMapsSpraying",components:{ModalConfirmation:Woe,SidebarExportSpraying:Rpe,SidebarCreateApplicationMapSpraying:xue,PageApplicationMaps:che,SidebarZones:_de,SidebarFields:QD},data(){return{columnDefinition:zoe,stepForward:()=>{},confirmationRequired:!1}},created(){this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("products/subscribe"),this.$store.dispatch("activities/ruleCheck/rules/subscribe")},computed:{...(0,C.rn)("precisionFarming/applicationMaps/spraying",{paginationStep(e){return e.paginationStep},calculation(e){return e.calculation}}),...(0,C.Se)({zones:"precisionFarming/applicationMaps/spraying/zones"}),selectedFieldIds:{get(){return this.$store.state.precisionFarming.applicationMaps.spraying.selectedFields},set(e){this.$store.commit("precisionFarming/applicationMaps/spraying/setSelectedFields",e)}},...(0,C.rn)("fields",{fields:"data"}),...(0,C.Se)("products",["findProductById","isHerbicide","isInsecticide"]),selectedFields(){return this.selectedFieldIds.map((e=>this.fields[e])).filter(ka)},messages(){const e=[],t=this.$t("Es wurden Felder mit verschiedenen Kulturen oder Sorten ausgewählt. Bitte beachte den Sorteneinfluss bei der Wahl der Mittel und Mengen. Mittel und Aufwandmengen müssen für alle ausgewählten Kulturen und Sorten geeignet sein!");1===this.paginationStep&&e.push(t);const i=this.$t("Die Variation von Ausbringmengen bei der Applikation von Herbiziden birgt das Risiko, dass der Schaderreger nicht effektiv bekämpft wird. Die variable Ausbringung von Herbiziden wir nicht empfohlen.");3===this.paginationStep&&this.hasHerbicides()&&e.push(i);const a=this.$t("Die Variation von Ausbringmengen bei der Applikation von Insektiziden birgt hohes Risiko der Bildung von Resistenzen. Die variable Ausbringung von Insektiziden wird nicht empfohlen.");3===this.paginationStep&&this.hasInsecticides()&&e.push(a);const n=this.$t("Bitte beachte die technischen Möglichkeiten deiner Feldspritze. Prüfe ob deine Feldspritze in der Lage ist die festgelegte Menge Spritzbrühe auszubringen.");3===this.paginationStep&&this.incompatibleSprayTool()&&e.push(n);const r=this.$t("Bitte beachte das Risiko von Resistenzbildung bei zu geringen Ausbringmengen von Insektiziden.");3===this.paginationStep&&this.hasInsecticides()&&this.hasReductionHigherThan10()&&e.push(r);const s=this.$t("Bitte beachte die Risiken von Resistenzbildung und abgeschwächter oder ausbleibender Wirkung bei zu geringen Ausbringmengen von Herbiziden.");return 3===this.paginationStep&&this.hasHerbicides()&&this.hasReductionHigherThan25()&&e.push(s),e.filter(ka)}},methods:{onNavigationNext(e){this.isConfirmationRequired()?(this.stepForward=e,this.confirmationRequired=!0):e()},selectedDifferentCrops(){const e=this.selectedFields.map((e=>e.cropId)).filter(a4).filter(ka),t=this.selectedFields.map((e=>e.varietyId)).filter(a4).filter(ka);return e.length>1||t.length>1},isConfirmationRequired(){switch(this.paginationStep){case 1:return this.selectedDifferentCrops();case 3:return(this.hasHerbicides()||this.hasInsecticides()||this.incompatibleSprayTool())&&this.hasFunctionId();default:return!1}},hasHerbicides(){return this.calculation.products.some((e=>this.isHerbicide(e.product.id??"")))},hasInsecticides(){return this.calculation.products.some((e=>this.isInsecticide(e.product.id??"")))},incompatibleSprayTool(){const{sprayMix:e}=this.calculation;return e<100||e>300},hasReductionHigherThan10(){return this.calculation.reduction>.1},hasReductionHigherThan25(){return this.calculation.reduction>.25},hasFunctionId(){const e=this.calculation.products.map((e=>this.findProductById(e.product.id))).filter(ka).every((e=>!e.pesticide?.functionId));return!e}}}),phe=uhe,hhe=(0,ew.Z)(phe,$oe,Roe,!1,null,null,null),mhe=hhe.exports;function fhe(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}var ghe=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveBasicFeature.enabled,"page-feature-visible":e.currentCompaniesHaveBasicFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:i}){return[t("SearchBar",{staticClass:"ml-4",attrs:{type:i?"large":"",searchFilter:e.filterString},on:{"update:searchFilter":function(t){e.filterString=t},"update:search-filter":function(t){e.filterString=t}}}),t("ProcessOrderSwitch",{staticClass:"ml-4 mr-3",attrs:{slim:!i}}),t("CompanySwitch",{staticClass:"ml-1",attrs:{slim:!i}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"card-container"},e._l(e.workflowsComputed,(function(i,a){return t("Card",{key:`card-${a}`,attrs:{headline:i.name,subTitle:i.subTitle,description:i.description,primaryButtonLabel:e.$t("Karte erstellen"),imageCompanyLogoUrl:i.companyLogoUrl,saatbauImage:i.saatbauImage,secondaryButtonLabel:i.onSecondaryClick?e.$t("Learn more"):null},on:{onPrimaryClick:function(t){return e.$router.push({name:`application-maps/workflows/${i.key}`})},onSecondaryClick:function(e){i.onSecondaryClick&&i.onSecondaryClick()}}})})),1)]},proxy:!0}])})},yhe=[],vhe=i.p+"img/FARMDOK_Logo.8f269e4b.svg",bhe=i.p+"img/Terrazo_green_black.9345c0b8.svg",whe=i.p+"img/corn.98e2eeea.svg",Che=i.p+"img/saatbau_logo_white.403df00a.svg",Fhe=i.p+"img/soy.f293c725.svg";const Ahe=[];var khe={name:"PageApplicationMapsUseCaseSelection",components:{ThePageSkeleton:$w,TheContentbar:HL,CompanySwitch:qw,SearchBar:YE,ProcessOrderSwitch:lV,Card:LQ},data(){return{filterString:"",workflows:[{name:"Precision Seeding",subTitle:this.$t("AUSSAAT"),description:this.$t("Applikationskarten für Sa
1atbau Mais Aussaat."),key:"seeding",companyLogoUrl:Che,availabilityFeature:Hr.FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE,saatbauImage:whe},{name:"Precision Seeding",subTitle:this.$t("AUSSAAT"),description:this.$t("Applikationskarten für Saatbau Soja Aussaat."),key:"seeding-soy",companyLogoUrl:Che,availabilityFeature:Hr.FEATURE_APPLICATION_MAPS_SEEDING_SOY,saatbauImage:Fhe},{name:`Terrazo ${this.$t("Düngekarte für Getreide")}`,subTitle:this.$t("DÜNGUNG"),description:this.$t("Applikationskarten für Ausgleichs- oder Qualitätsdüngung von Getreide. Ein Projekt von Josephinum Research."),key:"fertilization-cereals",companyLogoUrl:bhe,availabilityFeature:Hr.FEATURE_APPLICATION_MAPS_TERRAZO,onSecondaryClick:()=>{window.open("https://www.josephinum.at/forschung-und-pruefung/agrartechnik/projekte/terrazo.html","_blank")}},{name:this.$t("Düngekarte für alle Kulturen"),subTitle:this.$t("DÜNGUNG"),description:this.$t("Applikationskarten für Ausgleichs- oder Qualitätsdüngung. Zonierung mittels Satelliten oder importierten Daten."),key:"fertilization",companyLogoUrl:vhe,availabilityFeature:Hr.FEATURE_APPLICATION_MAPS_TERRAZO},{name:this.$t("Variable Pflanzenschutzkarte"),subTitle:this.$t("PFLANZENSCHUTZ"),description:this.$t("Applikationskarten für die variable Ausbringung von Wachstumsregler und Fungiziden auf Basis von Satellitendaten."),key:"spraying",companyLogoUrl:vhe,availabilityFeature:Hr.FEATURE_APPLICATION_MAPS_SPRAYING_FD_BASIC}]}},computed:{...(0,C.Se)({currentCompaniesHaveFeature:"currentCompaniesHaveFeature"}),currentCompaniesHaveBasicFeature(){return this.currentCompaniesHaveFeature(Hr.FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC)},workflowsComputed(){const e=this.filterWorkflowsByAvailabilityFeature(this.workflows);return this.filterWorkflowsBySearch(this.filterWorkflowsThatAreHidden(e))}},methods:{filterWorkflowsThatAreHidden(e){return e.filter((e=>!Ahe.includes(e.availabilityFeature)))},filterWorkflowsByAvailabilityFeature(e){return e.filter((e=>!!e.availabilityFeature&&!(!this.currentCompaniesHaveFeature(e.availabilityFeature).enabled||!this.currentCompaniesHaveFeature(e.availabilityFeature).visible)))},filterWorkflowsBySearch(e){return"string"!==typeof this.filterString||0===this.filterString.length?e:e.filter((e=>!!e.name.toLowerCase().includes(this.filterString.toLowerCase())||(!("string"!==typeof e.subTitle||!e.subTitle.toLowerCase().includes(this.filterString.toLowerCase()))||!("string"!==typeof e.description||!e.description.toLowerCase().includes(this.filterString.toLowerCase())))))}}},She=khe,Ehe=(0,ew.Z)(She,ghe,yhe,!1,null,"0f79a408",null),Ihe=Ehe.exports,_he=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("PageApplicationMaps",{attrs:{workflowKey:e.workflowKey,stepCount:4},on:{onNavigationNext:e.onNavigationNext},scopedSlots:e._u([{key:"steps",fn:function(){return[t("SidebarFields",{directives:[{name:"show",rawName:"v-show",value:1===e.paginationStep,expression:"paginationStep === 1"}],attrs:{tableId:"sidebar-table-fields-fertilization",selectedRows:e.selectedFields,customColumnDefinition:e.columnDefinition},on:{"update:selectedRows":function(t){e.selectedFields=t},"update:selected-rows":function(t){e.selectedFields=t}}}),t("SidebarZones",{directives:[{name:"show",rawName:"v-show",value:2===e.paginationStep,expression:"paginationStep === 2"}],attrs:{workflowKey:e.workflowKey}}),3===e.paginationStep?t("SidebarCreateApplicationMapFertilization",{attrs:{workflowKey:e.workflowKey}}):e._e(),t("SidebarExportFertilization",{directives:[{name:"show",rawName:"v-show",value:4===e.paginationStep,expression:"paginationStep === 4"}],attrs:{workflowKey:e.workflowKey}})]},proxy:!0}])})},Dhe=[],Mhe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-create-application-map",attrs:{id:"sidebar-create-application-map"}},[t("SidebarHeadline",{attrs:{text:e.$t("Applikationskarte erstellen")||""}}),t("div",{staticClass:"sidebar-create-application-map__scrollable-container"},[t("SidebarContentWrapper",{staticClass:"mb-5 mt-0"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Produkt")}}),t("ProductsDropdownContainer",{attrs:{workflowKey:e.workflowKey,productCategoryType:e.productCategoryType,productCategoryTypeName:"mineralFertilizers",dropdownTooltipTitle:e.mineralFertilizerDropdownTooltipTitle,nameForManualInput:e.$t("Eigener Dünger")||""}}),t("FormFieldInput",{ref:"averageDosage",attrs:{type:"number",variant:"vertical",placeholder:e.$t("Wert"),step:"1",value:e.averageDosage,label:e.$t("Setze mittlere Dosierung in kg/ha"),id:"sidebar-create-application-map__average-dosage",required:""},on:{update:e.updateAverageDosage}}),t("NutrientAmountSelectionContainer",{attrs:{workflowKey:e.workflowKey}})],1),t("hr",{staticClass:"mt-0"}),t("SidebarContentWrapper",{staticClass:"mb-5"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Verteilung auf dem Feld")}}),t("FormFieldDropdown",{ref:"objective",attrs:{label:e.$t("Düngeziel")||"",variant:"vertical",value:e.strategyValueForDropdown,items:e.strategiesToDropdownItems,disableDelete:""},on:{update:t=>e.setStrategy(t)}}),t("FormSlider",{attrs:{label:e.$t("Differenz zwischen Zonen (%)"),value:e.zoneDifference,min:e.minZoneDifference,max:e.maxZoneDifference,hideSlider:null===e.zoneDifference},on:{setValue:e.setZoneDifference}}),t("ResetButton",{directives:[{name:"show",rawName:"v-show",value:null===e.zoneDifference,expression:"zoneDifference === null"}],attrs:{buttonText:e.$t("Tabelle zurücksetzen"),onClick:e.resetZoneDifference}}),t("table",{staticClass:"table-simple-without-borders table-simple-with-bottom-borders",attrs:{id:"sidebar-create-application-map__table-distribution"}},[t("thead",[t("tr",[t("th",{staticClass:"text-center"},[e._v(e._s(e.$t("Zone")))]),t("th",{staticClass:"text-center"},[e._v(e._s(e.$t("Dosierung")))]),t("th",{staticClass:"text-center"},[e._v("N")]),t("th",{staticClass:"text-center"},[e._v("P₂O₅")]),t("th",{staticClass:"text-center"},[e._v("K₂O")])])]),t("tbody",e._l(e.zoneDosage,(function(i,a){return t("tr",{key:a,staticClass:"bg-white"},[t("td",[t("div",{staticClass:"sidebar-create-application-map__zone-color text-white",style:{background:i.color}},[t("span",{directives:[{name:"show",rawName:"v-show",value:"string"===typeof i.name&&i.name.indexOf("snow")<0&&i.name.indexOf("cloud")<0,expression:"\n                    typeof zone.name === 'string' && zone.name.indexOf('snow') < 0 && zone.name.indexOf('cloud') < 0\n                  "}]},[e._v(" "+e._s(i.name)+" ")])])]),t("td",[t("BaseInputNumber",{staticClass:"border-0 form-control-sm table-simple-without-border__number-input",attrs:{value:i.dosage,type:"number",step:"1"},on:{input:t=>{e.updateCalculation("dosage",a,t)}}})],1),t("td",[t("BaseInputNumber",{staticClass:"border-0 form-control-sm table-simple-without-border__number-input",attrs:{value:i.n,type:"number",step:"1",disabled:0===e.n},on:{input:t=>{e.updateCalculation("n",a,t)}}})],1),t("td",[t("BaseInputNumber",{staticClass:"border-0 form-control-sm table-simple-without-border__number-input",attrs:{value:i.p,type:"number",step:"1",disabled:0===e.p},on:{input:t=>{e.updateCalculation("p",a,t)}}})],1),t("td",[t("BaseInputNumber",{staticClass:"border-0 form-control-sm table-simple-without-border__number-input",attrs:{value:i.k,type:"number",step:"1",disabled:0===e.k},on:{input:t=>{e.updateCalculation("k",a,t)}}})],1)])})),0),t("tfoot",[t("tr",[t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e.$t("Mittel"))+" ")]),t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"}
1,[e._v(" "+e._s(e._f("numbro")(e.averageDosageCalculated,{mantissa:0}))+" ")]),t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e._f("numbro")(e.averageDosageCalculated*e.n/100,{mantissa:0}))+" ")]),t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e._f("numbro")(e.averageDosageCalculated*e.p/100,{mantissa:0}))+" ")]),t("td",{staticClass:"table-simple-with-borders__cell-sum border-0"},[e._v(" "+e._s(e._f("numbro")(e.averageDosageCalculated*e.k/100,{mantissa:0}))+" ")])])])])],1),t("hr",{staticClass:"mt-0"}),t("RequiredAmountTable",{attrs:{zoneSizesTotal:e.zoneSizesTotal,additionalTotal:{heading:e.$t("Gesamtmenge"),amount:e.fertilizerAmountTotal,unit:"kg"}}})],1)],1)},Phe=[],The=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("NutrientAmountSelection",{attrs:{calculation:e.calculation,calculationNutrients:e.calculationNutrients,averageDosage:e.calculation.averageDosage??null,disableAmountLine:e.disableAmountLine},on:{"update:nutrient":e.updateNutrient,"update:nutrientAmount":e.updateNutrientAmount}})},xhe=[],Bhe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSetBordered",{staticClass:"overflow-hidden",attrs:{headline:e.$t("Nährstoffmenge"),description:e.shareNutrientAmountDescription,labelLinkOpen:e.$t("Nährstoffmenge ändern"),labelLinkClose:e.$t("Optionen schließen"),hideDescriptionOnOpen:!0}},[t("p",{staticClass:"form-field-set-bordered__headline-description"},[e._v(" "+e._s(e.descriptionText)+" ")]),t("NutrientAmountTable",{attrs:{nutrients:e.nutrientTableData,nutrientAmounts:e.nutrientAmountTableData},on:{"update:nutrient":e.updateNutrient,"update:nutrientAmount":e.updateNutrientAmount}})],1)},Ohe=[],$he=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ResultTable",{attrs:{columns:e.columns,data:e.tableData,variant:"with-borders"},on:{input:e.onInput}})},Rhe=[],Nhe=(0,b.defineComponent)({name:"NutrientAmountTable",components:{ResultTable:jle},props:{nutrients:{type:Object,required:!0},nutrientAmounts:{type:Object}},data(){const e=[{key:"placeholder",header:{title:()=>""},type:"text"},{key:"n",header:{title:()=>"N"},type:"numberInput",width:60},{key:"p",header:{title:()=>"P₂O₅"},type:"numberInput",width:60},{key:"k",header:{title:()=>"K₂O"},type:"numberInput",width:60}];return{columns:e}},computed:{tableData(){const e=[];return e.push({placeholder:"NPK in %",n:{value:this.nutrients.n},p:{value:this.nutrients.p},k:{value:this.nutrients.k}}),this.nutrientAmounts&&e.push({placeholder:this.$t("Menge in kg/ha")||"Menge in kg/ha",n:{value:this.nutrientAmounts.n,disabled:0===this.nutrients.n},p:{value:this.nutrientAmounts.p,disabled:0===this.nutrients.p},k:{value:this.nutrientAmounts.k,disabled:0===this.nutrients.k}}),e}},methods:{updateNutrient(e,t){this.$emit("update:nutrient",e,t)},updateNutrientAmount(e,t){this.$emit("update:nutrientAmount",e,t)},onInput({key:e,rowIndex:t,value:i}){const a=0;t===a?this.updateNutrient(e,i??null):this.updateNutrientAmount(e,i??null)}}}),zhe=Nhe,Lhe=(0,ew.Z)(zhe,$he,Rhe,!1,null,null,null),Vhe=Lhe.exports,Uhe=(0,b.defineComponent)({name:"NutrientAmountSelection",components:{NutrientAmountTable:Vhe,FormFieldSetBordered:Cee},props:{calculationNutrients:{type:Object,required:!0},averageDosage:{type:Number},disableAmountLine:{type:Boolean,default:!1}},data(){const e=["n","p","k"];return{nutrients:e}},computed:{descriptionText(){return this.nutrientAmountTableData?this.$t("Inhaltsstoffe des Düngers in %")||"Inhaltsstoffe des Düngers in %":this.$t("Inhaltsstoffe des Düngers in % und Ausbringmenge am Feld in kg/ha")||"Inhaltsstoffe des Düngers in % und Ausbringmenge am Feld in kg/ha"},nutrientKeys(){return this.nutrients},shareNutrientAmountDescription(){const e=[];return this.nutrientKeys.forEach((t=>{const i=this.getNutrientAmountDescription(t);i&&e.push(i)})),e.join(", ")},nutrientTableData(){return{n:this.getNutrient("n"),p:this.getNutrient("p"),k:this.getNutrient("k")}},nutrientAmountTableData(){return this.disableAmountLine?null:{n:this.getNutrientAmount("n")??0,p:this.getNutrientAmount("p")??0,k:this.getNutrientAmount("k")??0}}},methods:{getNutrient(e){const t=this.calculationNutrients[e];return t?100*t:0},getNutrientAmount(e){const t=this.calculationNutrients[e];return this.averageDosage&&t?this.averageDosage*t:null},getNutrientAmountDescription(e){const t=this.getNutrientAmount(e);return null!==t&&0!==this.getNutrient(e)?`${e.toString().toUpperCase()} ${t.toFixed()}
1 kg/ha`:null},updateNutrient(e,t){this.$emit("update:nutrient",e,t)},updateNutrientAmount(e,t){this.$emit("update:nutrientAmount",e,t)}}}),jhe=Uhe,Hhe=(0,ew.Z)(jhe,Bhe,Ohe,!1,null,"4218c34c",null),Ghe=Hhe.exports,Whe=(0,b.defineComponent)({name:"NutrientAmountSelectionContainer",components:{NutrientAmountSelection:Ghe},props:{workflowKey:{type:String,required:!0},disableAmountLine:{type:Boolean,default:!1}},computed:{...(0,C.rn)({calculation(e){return e.precisionFarming.applicationMaps[this.workflowKey].calculation}}),calculationNutrients(){const e={n:this.calculation.n,p:this.calculation.p,k:this.calculation.k};return e}},methods:{updateNutrient(e,t){const i=t?t/100:null;this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:e,value:i})},updateNutrientAmount(e,t){let i=Math.max(0,t??0);this.calculation[e]>0&&(i/=this.calculation[e]),this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"averageDosage",value:i}),this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setManualDosage`,null)}}}),Zhe=Whe,Khe=(0,ew.Z)(Zhe,The,xhe,!1,null,null,null),qhe=Khe.exports,Yhe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDropdown",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:{container:"#sidebar-create-application-map",delay:{show:500}},expression:"{ container: '#sidebar-create-application-map', delay: { show: 500 } }",modifiers:{hover:!0}}],ref:"product",attrs:{label:e.$t("Produkt wählen")||"",variant:"vertical",value:e.calculation.material,items:e.dropdownItems,disableDelete:"",slimMargin:""},on:{update:t=>e.dropdownSelect(t)},nativeOn:{mouseleave:function(t){return e.onTooltipMouseleave.apply(null,arguments)}}})},Jhe=[],Xhe=(0,b.defineComponent)({name:"SidebarCreateApplicationMapFertilization",components:{FormFieldDropdown:lk},props:{workflowKey:{type:String,required:!0},productCategoryType:{type:String,required:!0},productCategoryTypeName:{type:String,required:!0},dropdownTooltipTitle:{type:String},nameForManualInput:{type:String,required:!0}},computed:{...(0,C.rn)("auth",["currentCompanies"]),...(0,C.rn)("productVisibilities",{productVisibilities:e=>Object.values(e.data)}),...(0,C.rn)("productCategories",{productCategories:"data"}),...(0,C.rn)("storagePlaces",{storagePlaces:e=>Object.values(e.data)}),...(0,C.rn)({calculation(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/calculation`]},selectedFields(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedFields}}),...(0,C.Se)({currentProcessOrders:"auth/currentProcessOrders"}),dropdownItems(){const e=this.$store.getters["activityTypes/activityTypeByType"](this.productCategoryType);if(!e||!this.currentCompanies||!this.currentProcessOrders||!this.productVisibilities||!this.productCategories)return[];const t=this.selectedFields.map((e=>this.$store.state.fields.data[e])).filter((e=>void 0!==e)),i=this.$store.getters["products/compatibleProductsToDropdownItems"](e,this.currentCompanies,this.currentProcessOrders,this.productVisibilities,Object.values(this.productCategories),t,this.storagePlaces);return[{name:this.$t("Manuelle Eingabe"),id:"manual",items:[{id:"manual",name:this.nameForManualInput}],sort:!1},...i]}},created(){this.$store.dispatch(`products/${this.productCategoryTypeName}/subscribe`),this.$store.dispatch("activityTypes/subscribe"),this.$store.dispatch("auth/subscribe"),this.$store.dispatch("productCategories/subscribe"),this.$store.dispatch("productVisibilities/subscribe"),this.$store.dispatch("storagePlaces/subscribe")},methods:{dropdownSelect(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setMaterial`,e)},onTooltipMouseleave(){this.$root.$emit("bv::hide::tooltip")}}}),Qhe=Xhe,eme=(0,ew.Z)(Qhe,Yhe,Jhe,!1,null,null,null),tme=eme.exports,ime=function(){var e=this,t=e._self._c;return t("SidebarContentWrapper",[t("SidebarSubHeadline",{staticClass:"mb-3",attrs:{text:e.$t("Bedarf")}}),t("div",{staticClass:"result-total d-flex justify-content-between"},[t("span",[e._v(e._s(e.$t("Flächensumme")))]),t("span",[e._v(e._s(e._f("numbro")(e.zoneSizesTotal))+" ha")])]),t("div",{staticClass:"result-total d-flex justify-content-between"},[t("span",[e._v(e._s(e.additionalTotal.heading))]),t("span",[e._v(e._s(e._f("numbro")(e.additionalTotal.amount,{mantissa:0}))+" "+e._s(e.additionalTotal.unit))])]),null!=e.additionalInformation?t("p",{staticClass:"additional-information"}
1,[e._v(e._s(e.additionalInformation))]):e._e()],1)},ame=[],nme={name:"RequiredAmountTable",components:{SidebarContentWrapper:Qle,SidebarSubHeadline:rde},props:{zoneSizesTotal:{type:Number,default:0},additionalTotal:{type:Object,heading:{type:String,default:""},amount:{type:Number,default:0},unit:{type:String,default:""}},additionalInformation:{type:String,default:null}}},rme=nme,sme=(0,ew.Z)(rme,ime,ame,!1,null,"3f8550a7",null),ome=sme.exports,lme=function(){var e=this,t=e._self._c;return t("BFormInput",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip",value:e.tooltipOptions,expression:"tooltipOptions"}],staticClass:"form-control--text-input",class:{"form-control--text-right":"right"===e.align},attrs:{placeholder:e.internalPlaceholder,id:e.id,type:"number",required:e.internalRequired,disabled:e.internalDisabled,state:e.state,step:e.step,min:e.min,max:e.max,formatter:e.roundNumber},model:{value:e.internalValue,callback:function(t){e.internalValue=t},expression:"internalValue"}})},dme=[],cme={name:"BaseInputNumber",mixins:[kJ],props:{value:{type:Number},min:{type:String,default:"0"},max:{type:String,default:null},step:{type:String,default:"1"},round:{type:Boolean,default:!0},align:{type:String,default:"right"}},methods:{roundNumber(e){let t=e;if(this.round){let i=0;this.step.includes(".")&&(i=this.step.split(".")[1].length);const a=10**i;t=Math.round(e*a)/a}return t}},computed:{internalValue:{get(){return null==this.value?null:this.roundNumber(this.value)},set(e){this.$emit("input",Number(e))}}}},ume=cme,pme=(0,ew.Z)(ume,lme,dme,!1,null,null,null),hme=pme.exports,mme=(0,b.defineComponent)({name:"SidebarCreateApplicationMapFertilization",components:{BaseInputNumber:hme,SidebarContentWrapper:Qle,SidebarHeadline:iI,SidebarSubHeadline:rde,RequiredAmountTable:ome,FormFieldDropdown:lk,FormFieldInput:fk,ResetButton:uue,FormSlider:Sue,ProductsDropdownContainer:tme,NutrientAmountSelectionContainer:qhe},props:{workflowKey:{type:String,required:!0}},data(){return{mineralFertilizerDropdownTooltipTitle:this.$t("Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden."),productCategoryType:My.MINERAL_FERTILIZER,strategies:[{id:"quality",name:this.$t("Qualitätsdüngung (3. Gabe)")},{id:"balancing",name:this.$t("Ausgleichsdüngung (1. Gabe)")},{id:"manual",name:this.$t("manuelle Dosierung"),disabled:!0}],minZoneDifference:0,maxZoneDifference:20,initialZoneDifference:0}},computed:{...(0,C.rn)({paginationStep(e){return e.precisionFarming.applicationMaps[this.workflowKey].paginationStep},calculation(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/calculation`]},zones(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zones`]},zoneDosage(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zoneDosage`]}}),averageDosage(){return null!=this.calculation.manualDosage?null:this.calculation.averageDosage},n:{get(){return 100*this.calculation.n},set(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"n",value:e/100})}},p:{get(){return 100*this.calculation.p},set(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"p",value:e/100})}},k:{get(){return 100*this.calculation.k},set(e){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"k",value:e/100})}},zoneDifference(){return null!=this.calculation.manualDosage?null:100*this.calculation.zoneDifference},strategiesToDropdownItems(){return[{items:this.strategies}]},strategyValueForDropdown(){return null!=this.calculation.manualDosage?this.strategies.find((e=>"manual"===e.id)):this.strategies.find((e=>e.id===this.calculation.strategy))},fertilizerAmountTotal(){return null==this.zoneDosage?0:this.zoneDosage.reduce(((e,t,i)=>e+t.dosage*this.zones[i].size),0)},averageDosageCalculated(){return this.fertilizerAmountTotal/this.zones.reduce(((e,t)=>e+t.size),0)},zoneSizesTotal(){return this.zones.reduce(((e,t)=>e+t.size),0)}},created(){this.zoneDifference&&(this.initialZoneDifference=this.zoneDifference)},watch:{paginationStep(e){3===e&&null==this.calculation.averageDosage&&this.$nextTick((()=>{this.$refs.averageDosage.$el.focus()}))}},methods:{updateCalculation(e,t,i){this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/setManualDosage`,{key:e,index:t,value:i})},updateAverageDosage(e){const t=parseFloat(e);Number.isNaN(t)?this.setAverageDosage(null):this.setAverageDosage(t)},setAverageDosage(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"averageDosage",value:e}),this.resetManualDosage()},setStrategy(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"strategy",value:e.id}),"manual"!==e.id&&this.resetManualDosage()},setZoneDifference(e){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setCalculationField`,{key:"zoneDifference",value:e/100}),this.resetManualDosage()},resetManualDosage(){this.$store.commit(`precisionFarming/applicationMaps/${this.workflowKey}/setManualDosage`,null)},resetZoneDifference(){this.setZoneDifference(this.initialZoneDifference)}}}),fme=mme,gme=(0,ew.Z)(fme,Mhe,Phe,!1,null,"0527e378",null),yme=gme.exports,vme=function(){var e=this,t=e._self._c;return t("Export",{attrs:{workflowKey:e.workflowKey}},[t("ExportTable",{attrs:{tableHeaders:e.tableHeaders,tableRows:e.tableRows,tableHint:e.$t("Alle Werte in kg/ha")}})],1)},bme=[],wme={name:"SidebarExportFertilization",components:{Export:Ipe,ExportTable:xpe},props:{workflowKey:{type:String,required:!0}},data(){return{tableHeaders:[this.$t("Dosierung"),"N","P₂O₅","K₂O"]}},computed:{...(0,C.Se)({fields:"fields"}),...(0,C.rn)({zoneDosage(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/zoneDosage`]},selectedFields(e){return e.precisionFarming.applicationMaps[this.workflowKey].selectedFields},currentHeatmaps(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/currentHeatmaps`]},calculation(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/calculation`]},uploadedZonesByFilename(e,t){return t[`precisionFarming/applicationMaps/${this.workflowKey}/uploadedZonesByFilename`]},zoneGenerationMode(e){return e.precisionFarming.applicationMaps[this.workflowKey].zoneGenerationMode}}),fieldValuesByHeatmaps(){return Object.keys(this.currentHeatmaps).map((e=>{const t=this.currentHeatmaps[e],i=e.split("_")[0],a={name:rA.data.call(this,this.fields[i]),dosage:0,title:null};a.name.length>
119&&(a.title=a.name),t.color_codes.forEach((e=>{a.dosage+=this.getDosageForZone(e.col)*e.area/1e4}));const n=t.color_codes.reduce(((e,t)=>e+t.area),0)/1e4;return n>0&&(a.dosage/=n),a.n=a.dosage*this.calculation.n,a.p=a.dosage*this.calculation.p,a.k=a.dosage*this.calculation.k,a}))},fieldValuesByUploadedFiles(){const e={};return this.selectedFields.forEach((t=>{const i={name:rA.data.call(this,this.fields[t]),title:null,dosage:0};i.name.length>19&&(i.title=i.name),e[t]=i})),Object.values(this.uploadedZonesByFilename).forEach((t=>{null!=t.properties&&Array.isArray(t.properties.fieldIds)&&t.properties.fieldIds.forEach((i=>{if(null==e[i])return;let a=0,n=0;t.features.forEach((e=>{const t=e.properties.fill,{size:i}=e.properties;a+=this.getDosageForZone(t)*i/1e4,n+=i/1e4})),n>0&&(a/=n),e[i].dosage+=a}))})),Object.values(e).map((e=>({...e,n:e.dosage*this.calculation.n,p:e.dosage*this.calculation.p,k:e.dosage*this.calculation.k})))},fieldValues(){return this.zoneGenerationMode===Oh?this.fieldValuesByHeatmaps:this.zoneGenerationMode===$h?this.fieldValuesByUploadedFiles:[]},tableRows(){return this.fieldValues.map((e=>({title:()=>e.title,name:e.name,values:[Nl(e.dosage).format({mantissa:0}),Nl(e.n).format({mantissa:0}),Nl(e.p).format({mantissa:0}),Nl(e.k).format({mantissa:0})]})))}},methods:{getDosageForZone(e){const t=this.zoneDosage?.find((t=>t.color===e));return t?.dosage||0}}},Cme=wme,Fme=(0,ew.Z)(Cme,vme,bme,!1,null,null,null),Ame=Fme.exports,kme=(0,b.defineComponent)({name:"PageApplicationMapsFertilization",components:{PageApplicationMaps:che,SidebarCreateApplicationMapFertilization:yme,SidebarZones:_de,SidebarFields:QD,SidebarExportFertilization:Ame},data(){return{workflowKey:Wh.FERTILIZATION,columnDefinition:zoe}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilization",["paginationStep"]),...(0,C.Se)({zones:"precisionFarming/applicationMaps/fertilization/zones"}),selectedFields:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilization.selectedFields},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilization/setSelectedFields",e)}}},watch:{zones(){this.setManualDosage(null)}},methods:{...(0,C.OI)("precisionFarming/applicationMaps/fertilization",["setManualDosage"]),onNavigationNext(e){e()}}}),Sme=kme,Eme=(0,ew.Z)(Sme,_he,Dhe,!1,null,null,null),Ime=Eme.exports,_me=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("PageApplicationMaps",{attrs:{workflowKey:e.workflowKey,stepCount:4},on:{onNavigationNext:e.onNavigationNext},scopedSlots:e._u([{key:"headerLogo",fn:function(){return[t("HeaderLogo",{attrs:{src:e.headerLogo.src,alt:e.headerLogo.alt}})]},proxy:!0},{key:"steps",fn:function(){return[1===e.paginationStep?t("SidebarFieldsContainer"):e._e(),2===e.paginationStep?t("SidebarZonesContainer"):e._e(),3===e.paginationStep?t("SidebarCreateApplicationMap",{attrs:{workflowKey:e.workflowKey}}):e._e(),4===e.paginationStep?t("SidebarExport",{attrs:{workflowKey:e.workflowKey}}):e._e()]},proxy:!0}])})},Dme=[],Mme=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Export",{attrs:{"workflow-key":e.workflowKey}})},Pme=[],Tme=(0,b.defineComponent)({name:"SidebarExport",components:{Export:Ipe},props:{workflowKey:{type:String,required:!0}}}),xme=Tme,Bme=(0,ew.Z)(xme,Mme,Pme,!1,null,null,null),Ome=Bme.exports,$me=function(){var e=this,t=e._self._c;return t("SidebarContentWrapper",{staticClass:"mb-3"},[t("div",{staticClass:"header-logo-container"},[t("img",{staticClass:"header-logo",attrs:{src:e.src,alt:"Logo"}})])])},Rme=[],Nme={name:"HeaderLogo",components:{SidebarContentWrapper:Qle},props:{src:{type:String,required:!0},alt:{type:String,default:"Logo"}}},zme=Nme,Lme=(0,ew.Z)(zme,$me,Rme,!1,null,"b48c07fa",null),Vme=Lme.exports,Ume=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-create-application-map",attrs:{id:"sidebar-create-application-map"}},[t("SidebarHeadline",{attrs:{text:e.$t("Applikationskarte erstellen")}}),t("ScrollableContent",[t("ProductSelectionContainer",{attrs:{workflowKey:e.workflowKey}}),t("ApplicationMapContainer"),t("RequiredAmountContainer")],1)],1)},jme=[],Hme=function(){var e=this,t=e._self._c;e._self._setupProxy;
1return t("SidebarContentWrapper",{staticClass:"mb-5 mt-0 sidebar-content"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Applikationskarte")}}),t("ApplicationSelection",{attrs:{applicationTypeDropdownItems:e.applicationDropdownItems,selectedApplicationType:e.selectedApplicationType},on:{"update:applicationType":e.updateApplicationSelection}}),"first"===e.application.applicationType?t("FirstApplicationForm",{attrs:{targetNRate:e.application.applicationTypeFirst.targetNRate},on:{"update:targetNRate":t=>e.updateApplicationField("applicationTypeFirst.targetNRate",t),error:e.onError}}):"second"===e.application.applicationType?t("SecondApplicationForm"):"third"===e.application.applicationType?t("ThirdApplicationForm",{attrs:{application:e.application},on:{"update:applicationField":e.updateApplicationField,error:e.onError}}):e._e(),e.showZoneDosageTable?t("ZoneDosageTableContainer"):e._e()],1)},Gme=[],Wme=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDropdown",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",value:{container:"#sidebar-create-application-map",delay:{show:500}},expression:"{ container: '#sidebar-create-application-map', delay: { show: 500 } }",modifiers:{hover:!0}}],ref:"application",attrs:{label:e.$t("Berechne einen Vorschlag für ..."),variant:"vertical",value:e.selectedApplicationType,items:e.applicationTypeDropdownItems,itemsLoading:0===e.applicationTypeDropdownItems.length,disableDelete:"",slimMargin:""},on:{update:t=>e.$emit("update:applicationType",t.id)}})},Zme=[],Kme=(0,b.defineComponent)({name:"ApplicationSelection",components:{FormFieldDropdown:lk},props:{selectedApplicationType:{type:Object,required:!1},applicationTypeDropdownItems:{type:Array,required:!0}}}),qme=Kme,Yme=(0,ew.Z)(qme,Wme,Zme,!1,null,"592d70a2",null),Jme=Yme.exports,Xme=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("FormFieldInputNumberFormattedTwoDecimals",{ref:"targetNRate",attrs:{variant:"vertical",placeholder:e.$t("Wert"),value:e.targetNRate,label:e.$t("Ziel N-Rate (kg/ha)"),id:"target-n-rate",lazy:!0,min:25,max:80,required:""},on:{update:t=>e.$emit("update:targetNRate",t),error:t=>e.$emit("error",t)}})],1)},Qme=[],efe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldInputNumberFormatted",{attrs:{id:e.id,autocomplete:e.autocomplete,required:e.required,label:e.label,name:e.name,placeholder:e.placeholder,variant:e.variant,state:e.state,various:e.various,value:e.value,formatter:e.formatter,parser:e.parser,lazy:e.lazy,min:e.min,max:e.max,stateMessage:e.stateMessage},on:{input:t=>e.$emit("input",t),change:t=>e.$emit("change",t),update:t=>e.$emit("update",t),blur:()=>e.$emit("blur"),focus:()=>e.$emit("focus"),keypress:t=>e.$emit("keypress",t),error:t=>e.$emit("error",t)}})},tfe=[],ife=(0,b.defineComponent)({name:"FormFieldInputNumberTwoDecimals",components:{FormFieldInputNumberFormatted:_le},model:{prop:"value",event:"update"},props:{id:{type:String,default:null},autocomplete:{type:String,default:null},value:{type:[String,Number],default:null},required:{type:Boolean,default:!1},label:{type:String,default:null},name:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},variant:{type:String,default:"horizontal",validator:e=>["horizontal","vertical","vertical-lg","no-label","no-label-sm"].includes(e)},state:{type:Boolean,default:null},various:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},min:{type:Number,default:null},max:{type:Number,default:null},stateMessage:{type:String,default:null}},methods:{formatter(e){return null===e||""===e?"":Nl(e).format({thousandSeparated:!0,mantissa:2})},parser(e){return null===e?null:Nl.unformat(e)}}}),afe=ife,nfe=(0,ew.Z)(afe,efe,tfe,!1,null,null,null),rfe=nfe.exports,sfe=(0,b.defineComponent)({name:"FirstApplicationForm",components:{FormFieldInputNumberFormattedTwoDecimals:rfe},model:{prop:"targetNRate",event:"update:targetNRate"},props:{targetNRate:{type:Number}}}),ofe=sfe,lfe=(0,ew.Z)(ofe,Xme,Qme,!1,null,null,null),dfe=lfe.exports,cfe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("span",{staticClass:"mt-3 info-text"},[e._v(" "+e._s(e.$t("Bei Wintergetreide wird für die 2. Gabe eine konstante Düngermenge empfohlen. Wurde die erste Gabe nicht mittels Applikationskarte ausgleichend gedüngt, so kann für die 2. Gabe der Berechnungsvorschlag der erste Gabe angewendet werden."))+" ")])},ufe=[],pfe=(0,b.defineComponent)({name:"SecondApplicationForm"}),hfe=pfe,mfe=(0,ew.Z)(hfe,cfe,ufe,!1,null,"8f1be4d2",null),ffe=mfe.exports,gfe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("FormFieldInputNumberFormattedTwoDecimals",{ref:"targetYield",attrs:{variant:"vertical",placeholder:e.$t("Wert"),value:e.application.applicationTypeThird.targetYield,label:e.$t("Zielertrag (kg/ha)"),id:"target-yield",lazy:!0,min:0,max:12e3,required:""},on:{update:t=>e.updateApplicationField("applicationTypeThird.targetYield",t),error:t=>e.$emit("error",t)}}),t("FormFieldDropdown",{ref:"humidityAreaType",staticClass:"mb-0",attrs:{variant:"vertical",placeholder:e.$t("Wert"),step:"1",value:e.selectedHumidtyAreaTypeDropdownItem,label:e.$t("Feuchtgebiet oder Trockengebiet")||"",id:"humidty-area-type",items:e.humidityAreaTypes,required:""},on:{update:t=>e.updateApplicationField("applicationTypeThird.humidityAreaType",t.id)}}),t("FormFieldDropdown",{ref:"targetGrainQuality",staticClass:"mb-0",attrs:{variant:"vertical",placeholder:e.$t("Wert"),step:"1",value:e.selectedTargedGrainQualityDropdownItem,label:e.$t("Kornqualität"),id:"target-grain-quality",items:e.grainQualityTypes,required:""},on:{update:t=>e.updateApplicationField("applicationTypeThird.targetGrainQuality",t.id)}}),t("FormFieldInputNumberFormattedTwoDecimals",{ref:"averageFertilizerRate1N",attrs:{variant:"vertical",placeholder:e.$t("Wert"),value:e.application.applicationTypeThird.averageFertilizerRate1N,label:e.$t("N-Rate 1. Gabe (kg/ha)"),id:"avg-fertilizer-rate-1-n",lazy:!0,min:0,max:100,required:""},on:{update:t=>e.updateApplicationField("applicationTypeThird.averageFertilizerRate1N",t),error:t=>e.$emit("error",t)}}),t("FormFieldInputNumberFormattedTwoDecimals",{ref:"averageFertilizerRate2N",attrs:{type:"number",variant:"vertical",placeholder:e.$t("Wert"),value:e.application.applicationTypeThird.averageFertilizerRate2N,label:e.$t("N-Rate 2. Gabe (kg/ha)"),id:"avg-fertilizer-rate-2-n",lazy:!0,min:0,max:100},on:{update:t=>e.updateApplicationField("applicationTypeThird.averageFertilizerRate2N",t),error:t=>e.$emit("error",t)}})],1)},yfe=[];const vfe={id:null,name:""};var bfe=(0,b.defineComponent)({name:"ThirdApplicationForm",components:{FormFieldDropdown:lk,FormFieldInputNumberFormattedTwoDecimals:rfe},props:{application:{type:Object,required:!0}},data(){const e=[{items:[{id:_t.HumidArea,name:this.$t("Feuchtgebiet")||"Feuchtgebiet"},{id:_t.DryArea,name:this.$t("Trockengebiet")||"Trockengebiet"}]}],t=[{items:[{id:It.LiveStock,name:this.$t("Futter")||"Futter"},{id:It.Milling,name:this.$t("Mahlen")||"Mahlen"},{id:It.Quality,name:this.$t("Qualität")||"Qualität"},{id:It.Premium,name:this.$t("Premium")||"Premium"}]}];return{humidityAreaTypes:e,grainQualityTypes:t}}
1,computed:{selectedHumidtyAreaTypeDropdownItem(){return this.humidityAreaTypes[0].items.find((e=>e.id===this.application.applicationTypeThird.humidityAreaType))??vfe},selectedTargedGrainQualityDropdownItem(){return this.grainQualityTypes[0].items.find((e=>e.id===this.application.applicationTypeThird.targetGrainQuality))??vfe}},methods:{updateApplicationField(e,t){this.$emit("update:applicationField",e,t)}}}),wfe=bfe,Cfe=(0,ew.Z)(wfe,gfe,yfe,!1,null,null,null),Ffe=Cfe.exports,Afe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ResultTable",{staticClass:"mt-4",attrs:{columns:e.columns,data:e.zoneDosageTableData,footer:e.footer,loading:e.loading,variant:"centered"},on:{input:e.onInput}})},kfe=[],Sfe=(0,b.defineComponent)({name:"ZoneDosageTableContainer",components:{ResultTable:jle},data(){const e=[{key:"zone",header:{title:()=>this.$t("Zone")||"Zone"},type:"badge"},{key:"dosage",header:{title:()=>this.$t("Dosierung")||"Dosierung"},type:"numberInput"},{key:"n",header:{title:()=>"N"},type:"numberInput"},{key:"p",header:{title:()=>"P₂O₅"},type:"numberInput"},{key:"k",header:{title:()=>"K₂O"},type:"numberInput"}];return{columns:e}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["zones","calculation"]),...(0,C.Se)({zoneDosage:"precisionFarming/applicationMaps/fertilizationCereals/zoneDosage",weightedAverageDosage:"precisionFarming/applicationMaps/fertilizationCereals/weightedAverageDosage"}),zoneDosageTableData(){return this.zoneDosage?.map((e=>({zone:{name:e.name,color:e.color},dosage:{value:e.dosage},n:{value:e.n,disabled:0===this.calculation.n},p:{value:e.p,disabled:0===this.calculation.p},k:{value:e.k,disabled:0===this.calculation.k}})))??[]},footer(){return{zone:this.$t("Mittel")||"Mittel",dosage:Bl()(this.weightedAverageDosage).format({mantissa:0}),n:this.getWeightedAvgDosage(this.calculation.n),p:this.getWeightedAvgDosage(this.calculation.p),k:this.getWeightedAvgDosage(this.calculation.k)}},loading(){return this.zones.loading}},methods:{onInput({key:e,rowIndex:t,value:i}){const a={key:e,index:t,value:i};this.$store.dispatch("precisionFarming/applicationMaps/fertilizationCereals/setManualDosage",a)},getWeightedAvgDosage(e){const t=this.weightedAverageDosage*e;return Bl()(t).format({mantissa:0})}}}),Efe=Sfe,Ife=(0,ew.Z)(Efe,Afe,kfe,!1,null,null,null),_fe=Ife.exports,Dfe=(0,b.defineComponent)({name:"ApplicationMapContainer",components:{SecondApplicationForm:ffe,FirstApplicationForm:dfe,ZoneDosageTableContainer:_fe,ApplicationSelection:Jme,SidebarSubHeadline:rde,SidebarContentWrapper:Qle,ThirdApplicationForm:Ffe},data(){const e=[{id:bm.MANUAL,name:this.$t("Kein Vorschlag (manuelle Eingabe)")||"Kein Vorschlag (manuelle Eingabe)"},{id:bm.FIRST,name:this.$t("Wintergetreide {n}. Gabe",{n:"1"})||"Wintergetreide {n}. Gabe"},{id:bm.SECOND,name:this.$t("Wintergetreide {n}. Gabe",{n:"2"})||"Wintergetreide {n}. Gabe"},{id:bm.THIRD,name:this.$t("Wintergetreide {n}. Gabe",{n:"3"})||"Wintergetreide {n}. Gabe"}];return{applicationTypes:e,debouncedLoadFeaturesAndZones:null}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["calculation","application"]),...(0,C.Se)("precisionFarming/applicationMaps/fertilizationCereals",["selectedField"]),applicationDropdownItems(){return[{items:this.applicationTypes}]},selectedApplicationType(){return this.applicationTypes.find((e=>this.application.applicationType===e.id))||{id:null,name:""}},showZoneDosageTable(){return"second"!==this.selectedApplicationType?.id},loadDefaultValuesTrigger(){const e=[this.selectedField,this.application.applicationType];return e.map((e=>JSON.stringify(e))).join("-")}},watch:{loadDefaultValuesTrigger:{handler(){this.loadDefaultValues()}}},methods:{loadDefaultValues(){this.loadAndUpdateTargetYield(),this.loadAndUpdateNRates()},async loadAndUpdateTargetYield(){if(this.application.applicationType!==bm.THIRD)return;const e=await this.loadTargetYield(this.selectedField),t=this.roundToTwoDecimals(e);this.updateApplicationField("applicationTypeThird.targetYield",t)},async loadTargetYield(e){const{cultivationPlanApi:t}=this.$api;try{const i=await t.cultivationPlanAtList({fieldIds:e}),a=i.data.data?.[0].expectedYield??null;return this.convertToKgPerHa(a)}catch(i){return null}},async loadAndUpdateNRates(){if(this.application.applicationType!==bm.THIRD
1)return;const{nFertilizedFirstApplication:e,nFertilizedOtherApplications:t}=await this.loadNRates(),i=this.roundToTwoDecimals(e),a=this.roundToTwoDecimals(t);this.updateApplicationField("applicationTypeThird.averageFertilizerRate1N",i),this.updateApplicationField("applicationTypeThird.averageFertilizerRate2N",a)},async loadNRates(){const{fertilizationPlanApi:e}=this.$api;try{const t=await e.fertilizationPlanFieldBasedList({fieldIds:this.selectedField}),{nFertilizedFirstApplication:i,nFertilizedOtherApplications:a}=t.data.data?.[0]??{nFertilizedFirstApplication:null,nFertilizedOtherApplications:null};return{nFertilizedFirstApplication:i,nFertilizedOtherApplications:a}}catch(t){return{nFertilizedFirstApplication:null,nFertilizedOtherApplications:null}}},convertToKgPerHa(e){return e?1e3*e:null},roundToTwoDecimals(e){return null===e?null:Math.round(100*e)/100},updateApplicationSelection(e){this.updateApplicationField("applicationType",e),e!==bm.MANUAL&&this.resetManualDosage()},updateApplicationField(e,t){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setApplicationField",{key:e,value:t})},resetManualDosage(){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setManualDosage",null)},onError(e){this.updateApplicationField("error",e)}}}),Mfe=Dfe,Pfe=(0,ew.Z)(Mfe,Hme,Gme,!1,null,"531c23c9",null),Tfe=Pfe.exports,xfe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("SidebarContentWrapper",{staticClass:"mb-5 mt-0"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Produkt")}}),t("ProductsDropdownContainer",{attrs:{workflowKey:e.workflowKey,productCategoryType:e.productCategoryType,productCategoryTypeName:"mineralFertilizers",dropdownTooltipTitle:e.mineralFertilizerDropdownTooltipTitle,nameForManualInput:e.$t("Eigener Dünger")||"Eigener Dünger"}}),t("NutrientAmountSelectionContainer",{attrs:{workflowKey:e.workflowKey,disableAmountLine:!0}})],1)},Bfe=[],Ofe=(0,b.defineComponent)({name:"ProductSelectionContainer",components:{SidebarSubHeadline:rde,SidebarContentWrapper:Qle,ProductsDropdownContainer:tme,NutrientAmountSelectionContainer:qhe},props:{workflowKey:{type:String,required:!0}},data(){const e=My.MINERAL_FERTILIZER,t=this.$t("Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden.")||"Durch das Produkt werden die Inhaltsstoffe (N, P₂O₅, K₂O) definiert. Inhaltsstoffe in Prozent und Menge in kg/ha können aber auch manuell eingegeben werden.";return{productCategoryType:e,mineralFertilizerDropdownTooltipTitle:t}}}),$fe=Ofe,Rfe=(0,ew.Z)($fe,xfe,Bfe,!1,null,"a535485a",null),Nfe=Rfe.exports,zfe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("hr",{staticClass:"mt-0"}),t("RequiredAmountTable",{attrs:{zoneSizesTotal:e.zoneSizesTotal,additionalTotal:{heading:e.$t("Gesamtmenge"),amount:e.fertilizerAmountTotal,unit:"kg"}}})],1)},Lfe=[],Vfe=(0,b.defineComponent)({name:"RequiredAmountContainer",components:{RequiredAmountTable:ome},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["zones"]),...(0,C.Se)({zoneDosage:"precisionFarming/applicationMaps/fertilizationCereals/zoneDosage"}),zoneSizesTotal(){return this.zones.data?.reduce(((e,t)=>e+t.size),0)??0},fertilizerAmountTotal(){return this.zoneDosage?.reduce(((e,t,i)=>e+t.dosage*(this.zones.data?.[i]?.size??0)),0)??0}}}),Ufe=Vfe,jfe=(0,ew.Z)(Ufe,zfe,Lfe,!1,null,"5a65d976",null),Hfe=jfe.exports,Gfe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"scrollable-content"},[e._t("default")],2)},Wfe=[],Zfe=(0,b.defineComponent)({name:"ScrollableContent"}),Kfe=Zfe,qfe=(0,ew.Z)(Kfe,Gfe,Wfe,!1,null,"623ba9e6",null),Yfe=qfe.exports,Jfe=(0,b.defineComponent)({name:"SidebarCreateApplicationMap",components:{ProductSelectionContainer:Nfe,RequiredAmountContainer:Hfe,ApplicationMapContainer:Tfe,SidebarHeadline:iI,ScrollableContent:Yfe},props:{workflowKey:{type:String,required:!0}}}),Xfe=Jfe,Qfe=(0,ew.Z)(Xfe,Ume,jme,!1,null,"650b1ef1",null),ege=Qfe.exports,tge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("SidebarFields",{staticClass:"cereals-sidebar-fields",attrs:{tableId:"sidebar-fields-fertilization-cereals",selectedRows:e.selectedFields,headlineLabel:e.$t("Feld auswählen"),customColumnDefinition:e.columnDefinition},on:{"update:selectedRows":function(t){e.selectedFields=t},"update:selected-rows":function(t){e.selectedFields=t}}})},ige=[],age=(0,b.defineComponent)({name:"SidebarFieldsContainer",components:{SidebarFields:QD},data(){return{columnDefinition:zoe}},computed:{selectedFields:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.selectedFields},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setSelectedFields",e)}}}}
1),nge=age,rge=(0,ew.Z)(nge,tge,ige,!1,null,null,null),sge=rge.exports,oge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("SidebarZones",{attrs:{visualizationMode:e.visualizationMode}})},lge=[],dge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-zones"},[t("SidebarHeadline",{attrs:{text:e.$t("Zonenkarte erstellen")}}),t("ScrollableContent",[t("SidebarContentWrapper",[t("DatepickerContainer"),t("VisualizationSelectContainer"),t("AccordionContainer"),e.showResultTable?t("ResultTableContainer"):e._e()],1)],1)],1)},cge=[],uge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Accordion",{attrs:{selectedNumberOfZones:e.selectedNumberOfZones,selectedZoningMode:e.selectedZoningMode,borderZoneCorrection:e.borderZoneCorrection,collapsed:e.collapsed},on:{"update:selectedNumberOfZones":function(t){e.selectedNumberOfZones=t},"update:selected-number-of-zones":function(t){e.selectedNumberOfZones=t},"update:selectedZoningMode":function(t){e.selectedZoningMode=t},"update:selected-zoning-mode":function(t){e.selectedZoningMode=t},"update:borderZoneCorrection":function(t){e.borderZoneCorrection=t},"update:border-zone-correction":function(t){e.borderZoneCorrection=t},"update:collapsed":function(t){e.collapsed=t}}})},pge=[],hge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldSetBordered",{staticClass:"field-set bg-white",attrs:{headline:e.$t("Einstellungen für die Zonierung"),collapsed:e.collapsed},on:{update:t=>e.$emit("update:collapsed",t)},scopedSlots:e._u([{key:"description",fn:function(){return[e._v(e._s(e.description))]},proxy:!0},{key:"default",fn:function(){return[t("FormFieldSelect",{attrs:{label:e.$t("Anzahl der Zonen"),value:e.selectedNumberOfZones,options:e.numberOfZones,variant:"vertical"},on:{update:t=>e.$emit("update:selectedNumberOfZones",t)}}),t("FormFieldSelect",{attrs:{label:e.$t("Zonierung"),value:e.selectedZoningMode,options:e.zoningModes,variant:"vertical"},on:{update:t=>e.$emit("update:selectedZoningMode",t)}}),t("FormCheckbox",{attrs:{checked:e.borderZoneCorrection,switch:""},on:{input:t=>e.$emit("update:borderZoneCorrection",t)}},[e._v(e._s(e.borderZoneCorrectionLabel))])]},proxy:!0}])})},mge=[],fge=(0,b.defineComponent)({name:"Accordion",components:{FormFieldSetBordered:Cee,FormFieldSelect:n9,FormCheckbox:Gw},props:{selectedNumberOfZones:{type:Number,required:!0},selectedZoningMode:{type:String,required:!0},borderZoneCorrection:{type:Boolean,required:!0},collapsed:{type:Boolean,required:!0}},data(){const e=[{value:2,text:"2"},{value:3,text:"3"},{value:4,text:"4"},{value:5,text:"5"}],t=[{value:ym.EQUAL_ZONE_SIZE,text:this.$t("Gleiche Zonengröße")||"Gleiche Zonengröße"},{value:ym.EQUAL_INDEX_DISTANCE,text:this.$t("Gleicher Indexabstand")||"Gleicher Indexabstand"},{value:ym.JENKS_NATURAL_BREAKS,text:this.$t("Jenks natural breaks")||"Jenks natural breaks"}];return{numberOfZones:e,zoningModes:t}}
1,computed:{description(){const e=this.zoningModes.find((e=>e.value===this.selectedZoningMode))?.text,t=this.numberOfZones.find((e=>e.value===this.selectedNumberOfZones))?.text,i=this.borderZoneCorrection?this.$t("Randbereich korrigiert"):this.$t("Randbereich nicht korrigiert");return this.collapsed?`${t} ${this.$t("Zonen")}, ${e}, ${i}`:null},borderZoneCorrectionLabel(){return this.borderZoneCorrection?this.$t("Randbereich korrigiert")||"Randbereich korrigiert":this.$t("Randbereich nicht korrigiert")||"Randbereich nicht korrigiert"}}}),gge=fge,yge=(0,ew.Z)(gge,hge,mge,!1,null,null,null),vge=yge.exports,bge=(0,b.defineComponent)({name:"AccordionContainer",components:{Accordion:vge},data(){return{collapsed:!0}},computed:{selectedNumberOfZones:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.zoneMap.numberOfZones},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setNumberOfZones",e)}},selectedZoningMode:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.zoneMap.zoningMode},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setZoningMode",e)}},borderZoneCorrection:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.zoneMap.borderZoneCorrection},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setBorderZoneCorrection",e)}}},watch:{collapsed(e){!1===e&&this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setVisualizationMode",vm.ZONES)}}}),wge=bge,Cge=(0,ew.Z)(wge,uge,pge,!1,null,null,null),Fge=Cge.exports,Age=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Datepicker",{attrs:{cloudyDates:e.cloudyDates,disabledDates:e.disabledDates,loading:e.loading},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}})},kge=[],Sge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldDatepicker",{attrs:{selectedDate:e.selectedDate,label:e.$t("Datum"),variant:"vertical",highlightedDates:e.cloudyDates,disabledDates:e.disabledDates,dayCellContent:e.dayCellContent,loading:e.loading,calendarClass:"calendar-class"},on:{setSelectedDate:t=>e.$emit("setSelectedDate",t)}})},Ege=[];ow.vI.add(yF.uM9);const Ige=cle(yF.uM9);var _ge=(0,b.defineComponent)({name:"Datepicker",components:{FormFieldDatepicker:g_},model:{prop:"selectedDate",event:"setSelectedDate"},props:{selectedDate:{type:Date,default:null},cloudyDates:{type:Object,default:void 0},disabledDates:{type:Object,default:void 0},loading:{type:Boolean,default:!1}},methods:{dayCellContent(e){return e.isHighlighted?`${e.date}${Ige}`:e.date}}}),Dge=_ge,Mge=(0,ew.Z)(Dge,Sge,Ege,!1,null,null,null),Pge=Mge.exports,Tge=(0,b.defineComponent)({name:"DatepickerContainer",components:{Datepicker:Pge},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["fieldTimestamps"]),...(0,C.Se)("precisionFarming/applicationMaps/fertilizationCereals",["selectedField"]),selectedDate:{get(){const e=this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.zoneMap.date;return e?new Date(ca(e)):null},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setDate",da(e.getTime()))}},loading(){return this.fieldTimestamps.loading},cloudyDates(){return{customPredictor:e=>{const t=g()(e),i=this.fieldTimestamps.data??[],a=i.find((e=>g().unix(e.timestamp||0).isSame(t,"day")));return 1===a?.coverageRatio?.cloud}}},disabledDates(){const e=this.getLastAvailableTimestamp(),t=e?g().unix(e).add(1,"day").toDate():void 0;return{from:t,customPredictor:e=>{const t=g()(e),i=this.fieldTimestamps.data??[];return!i.some((e=>g().unix(e.timestamp||0).isSame(t,"day")))}}}},watch:{selectedField:{handler(){if(this.selectedField){const e=this.selectedField;this.$store.dispatch("precisionFarming/applicationMaps/fertilizationCereals/loadFieldTimestamps",e)}},immediate:!0},fieldTimestamps(){this.initSelectedDateIfNecessary()}},methods:{initSelectedDateIfNecessary(){this.fieldTimestamps.loading||this.selectedDate&&this.isAvailableDate(this.selectedDate)||this.initSelectedDate(
1)},isAvailableDate(e){const t=this.fieldTimestamps.data??[];return t.some((t=>g().unix(t.timestamp||0).isSame(e,"day")))},initSelectedDate(){const e=this.getLastClearSkyTimestamp();if(!e)throw new Error("no timestamps available to init date");this.selectedDate=new Date(ca(e))},getLastAvailableTimestamp(){const e=this.fieldTimestamps.data??[],t=e.map((e=>e.timestamp)).filter((e=>void 0!==e)).sort(((e,t)=>e-t));if(0===t.length)return null;const[i]=t.slice(-1);return i},getLastClearSkyTimestamp(){const e=this.fieldTimestamps.data??[],t=e.filter((e=>0===e.coverageRatio?.cloud&&void 0!==e.timestamp));if(t.length>0){const e=t.map((e=>e.timestamp)).sort(((e,t)=>t-e));return e[0]}return this.getLastAvailableTimestamp()}}}),xge=Tge,Bge=(0,ew.Z)(xge,Age,kge,!1,null,null,null),Oge=Bge.exports,$ge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ResultTable",{attrs:{columns:e.columns,data:e.tableData,loading:e.loading}})},Rge=[],Nge=(0,b.defineComponent)({name:"ResultTableContainer",components:{ResultTable:jle},data(){const e=[{key:"zone",header:{title:()=>this.$t("Zone")||"Zone"},type:"badge"},{key:"size",header:{title:()=>this.$t("Fläche in ha")||"Fläche in ha"},type:"number"},{key:"minNdvi",header:{title:()=>this.$t("Min. NDVI")||"Min. NDVI"},type:"number"},{key:"avgNdvi",header:{title:()=>this.$t("Avg. NDVI")||"Avg. NDVI"},type:"number"},{key:"maxNdvi",header:{title:()=>this.$t("Max. NDVI")||"Max. NDVI"},type:"number"}];return{columns:e}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["zones"]),tableData(){return this.zones.data?.map((e=>({zone:{name:e.name,color:e.color},size:e.size,minNdvi:e.minNdvi??0,avgNdvi:e.avgNdvi??0,maxNdvi:e.maxNdvi??0})))||[]},loading(){return this.zones.loading}}}),zge=Nge,Lge=(0,ew.Z)(zge,$ge,Rge,!1,null,null,null),Vge=Lge.exports,Uge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("VisualizationSelect",{model:{value:e.selectedVisualizationMode,callback:function(t){e.selectedVisualizationMode=t},expression:"selectedVisualizationMode"}})},jge=[],Hge=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("FormFieldRadioGroup",{attrs:{checked:e.selectedVisualizationMode,label:e.$t("Anzeige"),variant:"vertical",options:e.options},on:{input:t=>e.$emit("update:selectedVisualizationMode",t)}})},Gge=[],Wge=(0,b.defineComponent)({name:"VisualizationSelect",components:{FormFieldRadioGroup:_T},model:{prop:"selectedVisualizationMode",event:"update:selectedVisualizationMode"},props:{selectedVisualizationMode:{type:String,required:!0}},data(){const e=[{text:this.$t("Satellitenbild")||"Satellitenbild",value:vm.SATELLITE_IMAGE},{text:this.$t("Vegetation")||"Vegetation",value:vm.VEGETATION},{text:this.$t("Zonen")||"Zonen",value:vm.ZONES}];return{options:e}}}),Zge=Wge,Kge=(0,ew.Z)(Zge,Hge,Gge,!1,null,null,null),qge=Kge.exports,Yge=(0,b.defineComponent)({name:"VisualizationSelectContainer",components:{VisualizationSelect:qge},computed:{selectedVisualizationMode:{get(){return this.$store.state.precisionFarming.applicationMaps.fertilizationCereals.zoneMap.visualizationMode},set(e){this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setVisualizationMode",e)}}}}),Jge=Yge,Xge=(0,ew.Z)(Jge,Uge,jge,!1,null,null,null),Qge=Xge.exports,eye=(0,b.defineComponent)({name:"SidebarZones",components:{SidebarHeadline:iI,SidebarContentWrapper:Qle,DatepickerContainer:Oge,AccordionContainer:Fge,VisualizationSelectContainer:Qge,ResultTableContainer:Vge,ScrollableContent:Yfe},props:{visualizationMode:{type:String,required:!0}},computed:{showResultTable(){return this.visualizationMode===vm.ZONES}}}),tye=eye,iye=(0,ew.Z)(tye,dge,cge,!1,null,"f4b72a64",null),aye=iye.exports,nye=(0,b.defineComponent)({name:"SidebarZonesContainer",components:{SidebarZones:aye},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["zoneMap"]),visualizationMode(){return this.zoneMap.visualizationMode}}}),rye=nye,sye=(0,ew.Z)(rye,oge,lge,!1,null,null,null),oye=sye.exports;function lye(e,t,i,a){const{applicationType:n}=a;switch(n){case bm.FIRST:try{return dye(e,t,i,a)}catch{return mye(e,t,i)}case bm.THIRD:try{return uye(e,t,i,a)}catch{return mye(e,t,i)}default:return hye(e,t,i)}}function dye(e,t,i,a){return{...mye(e,t,i),fertilizerAdviceParams:cye(a)}}
1function cye(e){const{applicationTypeFirst:{targetNRate:t}}=e;if(null===t)throw new Error("targetNRate must be set");return{averageFertilizerRate:t}}function uye(e,t,i,a){return{...mye(e,t,i),fertilizerAdviceParams:pye(a)}}function pye(e){const{applicationTypeThird:{averageFertilizerRate1N:t,averageFertilizerRate2N:i,targetYield:a,humidityAreaType:n,targetGrainQuality:r}}=e;if(null===t)throw new Error("averageFertilizerRate1N must be set");if(null===i)throw new Error("averageFertilizerRate2N must be set");if(null===a)throw new Error("targetYield must be set");if(null===n)throw new Error("humidityAreaType must be set");if(null===r)throw new Error("targetGrainQuality must be set");return{averageFertilizerRate1N:t,averageFertilizerRate2N:i,expectedYield:a,humidityAreaType:n,targetGrainQuality:r}}function hye(e,t,i){return mye(e,t,i)}function mye(e,t,i){const{visualizationMode:a,numberOfZones:n,borderZoneCorrection:r,zoningMode:s}=i;return{fieldId:e,dbId:t,visualizationMode:a,numberOfZones:n,borderZoneCorrection:r,zoningMode:s}}var fye=(0,b.defineComponent)({name:"PageApplicationMapsFertilizationCereals",components:{PageApplicationMaps:che,SidebarFieldsContainer:sge,HeaderLogo:Vme,SidebarZonesContainer:oye,SidebarCreateApplicationMap:ege,SidebarExport:Ome},data(){return{workflowKey:Wh.FERTILIZATION_CEREALS,headerLogo:{src:bhe,alt:"Terrazo Logo"}}},created(){this.unwatch=this.$watch("loadFeaturesAndZonesTrigger",Xl()(this.dispatchLoadFeaturesAndZonesIfPayloadAvailable,500),{immediate:!0})},beforeDestroy(){this.unwatch()},computed:{...(0,C.rn)("precisionFarming/applicationMaps/fertilizationCereals",["paginationStep","zoneMap","application"]),...(0,C.Se)("precisionFarming/applicationMaps/fertilizationCereals",["selectedField","dbId"]),loadFeaturesAndZonesPayload(){return this.selectedField&&this.dbId&&!this.application.error?lye(this.selectedField,this.dbId,this.zoneMap,this.application):null},loadFeaturesAndZonesTrigger(){return JSON.stringify(this.loadFeaturesAndZonesPayload)}},methods:{onNavigationNext(e){switch(this.paginationStep){case 1:this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setVisualizationMode",vm.SATELLITE_IMAGE);break;case 2:this.$store.commit("precisionFarming/applicationMaps/fertilizationCereals/setVisualizationMode",vm.ZONES);break;default:}e()},dispatchLoadFeaturesAndZonesIfPayloadAvailable(){this.loadFeaturesAndZonesPayload&&this.$store.dispatch("precisionFarming/applicationMaps/fertilizationCereals/loadFeaturesAndZones",this.loadFeaturesAndZonesPayload)}}}),gye=fye,yye=(0,ew.Z)(gye,_me,Dme,!1,null,null,null),vye=yye.exports,bye=function(){var e=this,t=e._self._c;return t("PageApplicationMaps",{attrs:{workflowKey:e.workflowKey,stepCount:3},on:{onNavigationNext:e.onNavigationNext},scopedSlots:e._u([{key:"headerLogo",fn:function(){return[t("HeaderLogo",{attrs:{src:e.headerLogo.src,alt:e.headerLogo.alt}})]},proxy:!0},{key:"steps",fn:function(){return[t("SidebarFields",{directives:[{name:"show",rawName:"v-show",value:1===e.paginationStep,expression:"paginationStep === 1"}],attrs:{tableId:"sidebar-table-fields-seeding","selected-rows":e.selectedFields,customColumnDefinition:e.columnDefinition},on:{"update:selectedRows":function(t){e.selectedFields=t},"update:selected-rows":function(t){e.selectedFields=t}}}),2===e.paginationStep?t("SidebarCreateApplicationMapSeedingSoy",{ref:"createApplicationMap"}):e._e(),t("SidebarExportSeeding",{directives:[{name:"show",rawName:"v-show",value:3===e.paginationStep,expression:"paginationStep === 3"}],attrs:{workflowKey:e.workflowKey}}),t("ModalConfirmation",{attrs:{messages:e.messages},on:{reset:e.reset,ignore:function(t){return e.stepForward()}},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}})]},proxy:!0}])})},wye=[],Cye=i.p+"img/saatbau_Logo_Sondervariante_Kompakt_72dpi_RGB_144.62c5d94c.png",Fye=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-create-application-map",attrs:{id:"sidebar-create-application-map"}},[t("SidebarHeadline",{attrs:{text:e.$t("Applikationskarte erstellen")}}),t("ScrollableContent",[t("SidebarContentWrapper",{staticClass:"mb-5 mt-0"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Produkt")}}),t("FormFieldDropdown",{ref:"variety",attrs:{label:e.$t("Sorte wählen"),variant:"vertical",value:e.varietyToDropdownItem(e.calculation.variety),items:e.varietiesToDropdownItems,itemsLoading:e.varieties.fetching,required:"",disableDelete:""},on:{update:e.setVariety}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.manualSeedRatesDefined,expression:"!manualSeedRatesDefined"}],staticClass:"refinement-container"},[t("FormSlider",{attrs:{label:e.$t("Basissaatstärke"),min:e.seedrateMinSqM,max:e.seedrateMaxSqM,value:e.basicSeedStrengthSqM,interval:e.precision},on:{setValue:e.setBasicSeedStrength}}),t("hr",{staticClass:"mt-0"}),t("SidebarSubHeadline",{attrs:{text:e.$t("Verteilung auf dem Feld")}}),t("FormFieldSetBordered",{staticClass:"overflow-hidden",attrs:{headline:e.$t("Minimale & maximale Saatstärke"),description:e.fieldDistributionMinMaxDescription,labelLinkOpen:e.$t("Min/max Saatstärke ändern"),labelLinkClose:e.$t("Optionen schließen")}},[t("FormFieldInput",{staticClass:"mb-2",attrs:{type:"text",name:"fieldDistributionMinInput",variant:"vertical",placeholder:e.$t("Wert"),value:e.fieldDistributionMinInput,label:e.$t("Minimale Saatstärke"),formatter:e.numberFormat,state:!e.errorMessages.seedrateMin&&null},on:{update:e.setManualFieldDistributionMin,blur:function(t){return e.roundValue("manualMinSeedrate")}}}),t("ErrorUserMessage",{staticClass:"mt-0",attrs:{"error-user-message":e.errorMessages.seedrateMin}}),t("FormFieldInput",{staticClass:"mb-2",attrs:{type:"text",name:"fieldDistributionMaxInput",variant:"vertical",placeholder:e.$t("Wert"),value:e.fieldDistributionMaxInput,label:e.$t("Maximale Saatstärke"),formatter:e.numberFormat,state:!e.errorMessages.seedrateMax&&null},on:{update:e.setManualFieldDistributionMax,blur:function(t){return e.roundValue("manualMaxSeedrate")}}}),t("ErrorUserMessage",{staticClass:"mt-0",attrs:{"error-user-message":e.errorMessages.seedrateMax}})],1),t("FormFieldDropdown",{attrs:{label:e.$t("Anzahl der Zonen"),variant:"vertical",items:e.quantisationCategories,disableDelete:""},on:{update:e.updateQuantisation},model:{value:e.selectedQuantisation,callback:function(t){e.selectedQuantisation=t},expression:"selectedQuantisation"}}),t("FormSlider",{staticClass:"pt-2",attrs:{label:e.$t("Verlustausgleich (%)"),min:0,max:10,value:100*e.calculation.lossCompensation,additionalInformation:e.$t("Berater-Tipp: Hast du Verluste durch mechanische Pflege, Wild oder ähnliche Einflüsse berücksichtigt?")},on:{setValue:e.setLossCompensation}}),t("ModalLossCompensationInfo",{ref:"lossCompensationInfoModal"}),t("ButtonLink",{staticClass:"text-small",on:{click:e.showLossCompensationInfoModal}},[e._v(e._s(e.$t("Mehr erfahren...")))]),e.isDrillVariety?t("FormSlider",{staticClass:"pt-2",attrs:{label:e.$t("Tausendkorngewicht (g)"),min:100,max:300,value:e.calculation.thousandGrainWeight},on:{setValue:e.setThousandGrainWeight}}
1):e._e()],1),t("ResetButton",{directives:[{name:"show",rawName:"v-show",value:e.manualSeedRatesDefined,expression:"manualSeedRatesDefined"}],attrs:{buttonText:e.$t("Tabelle zurücksetzen"),onClick:e.resetManualSeedRates}}),e.calculation.variety.id?t("ZonesTableContainer"):e._e()],1),t("hr",{staticClass:"mt-0"}),t("RequiredAmountTable",{staticClass:"mb-3",attrs:{zoneSizesTotal:e.zoneSizesTotal,additionalTotal:{heading:e.$t("Gesamtmenge"),amount:e.packagesTotal,unit:e.$t("Packungen")},additionalInformation:e.$t("Standardeinheit {amount} Körner je Packung",{amount:e.standardPackageSizeFormatted})}}),t("div",{staticClass:"d-flex justify-content-center pb-4"},[t("Button",{staticClass:"mt-0",attrs:{outline:""}},[t("a",{attrs:{href:e.getSeedOrderButtonHref,target:"_blank"}},[e._v(e._s(e.getSeedOrderButtonText))])])],1)],1)],1)},Aye=[],kye=function(){var e=this,t=e._self._c;return t("ModalWrapper",{ref:"modal",attrs:{noCancelButton:"",okTitle:e.$t("Schließen"),size:"lg",title:e.$t("Berater-Tipp")}},[t("p",[e._v(" "+e._s(e.$t("Mit diesem Schieberegler kannst du kalkulierbare Verluste berücksichtigen und die Saatstärke pauschal korrigieren (1-15%). Pflanzenverluste können beispielsweise auftreten durch:"))+" ")]),t("ul",[t("li",[e._v(" "+e._s(e.$t("mechanische Pflegemaßnahmen"))+" ")]),t("li",[e._v(" "+e._s(e.$t("Saatzeitpunkt außerhalb des Optimums"))+" ")]),t("li",[e._v(" "+e._s(e.$t("Saatbett-Bedingungen (Scholligkeit, Wasserverfügbarkeit, …)"))+" ")]),t("li",[e._v(" "+e._s(e.$t("tierische Schäden (Bsp.: Wild, Vögel, Insekten, …)"))+" ")])]),t("p",[e._v(" "+e._s(e.$t("Für Fragen steht Ihr regionaler Berater gerne zur Verfügung (Beraterzuordnung nach Region)."))+" ")]),t("ButtonLink",{attrs:{href:"https://www.saatbau.com/beratung/",target:"_blank"}},[e._v(" "+e._s(e.$t("Meinen persönlichen Berater kontaktieren..."))+" ")])],1)},Sye=[],Eye={name:"ModalLossCompensationInfo",components:{ModalWrapper:OC,ButtonLink:Fw},methods:{async show(){return this.$refs.modal.show()}}},Iye=Eye,_ye=(0,ew.Z)(Iye,kye,Sye,!1,null,null,null),Dye=_ye.exports,Mye=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ResultTable",{attrs:{columns:e.columns,data:e.tableData,footer:e.footer},on:{input:e.onInput}})},Pye=[],Tye=(0,b.defineComponent)({name:"ZonesTableContainer",components:{ResultTable:jle},data(){return{}},computed:{zones(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/zones"]},calculation(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.calculation},varieties(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.varieties},isDrillVariety(){const e=this.varieties.current.find((e=>e.id===this.calculation.variety.id));return null!==this.calculation.variety.id&&"Drill"===e?.seedingMethod},columns(){const e=[{key:"zone",header:{title:()=>this.$t("Zone")||"Zone"},type:"badge"},{key:"seedRateGrains",header:{title:()=>this.$t("Ko/m^2")||"Kö/m²"},type:"numberInput",align:"right"}];return this.isDrillVariety&&e.push({key:"seedRateKg",header:{title:()=>this.$t("kg/ha")||"kg/ha"},type:"text",align:"right"}),e},weightedAvgSeedRate(){if(!this.zones||0===this.zones.length)return 0;const e=this.zones.map((e=>e.manualSeedRate??e.seedRateWithLossCompensation??0)),t=this.zones.map((e=>e.size));return Hm(Sm(e,t))},tableData(){return this.zones&&0!==this.zones.length?this.zones.map((e=>{const t=0===e.size?0:e.manualSeedRate??e.seedRateWithLossCompensation??0,i=t/1e4,a=this.isDrillVariety?Math.round(i*this.calculation.thousandGrainWeight/100):0,n={zone:{name:"",color:e.color},seedRateGrains:{value:Math.round(i)}};return this.isDrillVariety&&(n.seedRateKg=Nl(a).format({mantissa:0})),n})):[]},weightedAvgSeedRateKgPerHa(){if(!this.isDrillVariety||!this.zones||0===this.zones.length)return 0;const e=this.zones.map((e=>{const t=e.manualSeedRate??e.seedRateWithLossCompensation??0,i=t/1e4;return i*this.calculation.thousandGrainWeight/100})),t=this.zones.map((e=>e.size));return Math.round(Sm(e,t))},footer(){const e={zone:this.$t("Durchschnitt")||"Durchschnitt",seedRateGrains:Nl(this.weightedAvgSeedRate/1e4).format({mantissa:0})};return this.isDrillVariety&&(e.seedRateKg=Nl(this.weightedAvgSeedRateKgPerHa).format({mantissa:0})),e}},watch:{weightedAvgSeedRate(){this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setAverageDosage",this.weightedAvgSeedRate)}},methods:{onInput({key:e,rowIndex:t,value:i}){if("seedRateGrains"!==e)return;const a=this.zones[t]?.name,n=1e4*(i??0);this.setManualSeedRate(a,n)},setManualSeedRate(e,t){this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setManualSeedRate",{zoneName:e,manualSeedRate:t})}}}),xye=Tye,Bye=(0,ew.Z)(xye,Mye,Pye,!1,null,null,null),Oye=Bye.exports;function $ye(e,t){const i=Math.round(e/t)*t;return i<t?t:i}var Rye=(0,b.defineComponent)({name:"SidebarCreateApplicationMapSeedingSoy",components:{Button:gw,SidebarContentWrapper:Qle,SidebarHeadline:iI,SidebarSubHeadline:rde,RequiredAmountTable:ome,FormFieldDropdown:lk,FormSlider:Sue,FormFieldSetBordered:Cee,FormFieldInput:fk,ErrorUserMessage:cH,ResetButton:uue,ModalLossCompensationInfo:Dye,ButtonLink:Fw,ScrollableContent:Yfe,ZonesTableContainer:Oye},data(){const e=[{id:"high",name:this.$t("Hoch")||""},{id:"medium",name:this.$t("Mittel")||""},{id:"low",name:this.$t("Gering")||""}],t=[{name:"Quantisation",id:"0",items:e,sort:!1}],i=e[1];return{precision:1,errorMessages:{seedrateMin:null,seedrateMax:null},standardPackageSize:15e4,quantisationCategories:t,selectedQuantisation:i,rawFieldDistributionMin:null,rawFieldDistributionMax:null}},computed:{getSeedOrderButtonHref(){return this.$store.state.auth.currentCompanies[0].regionId===te.SI?"https://www.saatbau.com/si/maisbutler/":"https://www.sesam24.at/saatbau-spa/EUR/login"},getSeedOrderButtonText(){return this.$store.state.auth.currentCompanies[0].regionId===te.SI?this.$t("MAISBUTLER Anfrage"):this.$t("Sa
1atgut jetzt bestellen SESAM24")},varieties(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.varieties},calculation(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.calculation},seedrateMinSqM(){return Math.round((this.calculation.seedrateMin||0)/1e4)},seedrateMaxSqM(){return Math.round((this.calculation.seedrateMax||0)/1e4)},basicSeedStrengthSqM(){return Math.round((this.calculation.basicSeedStrength||0)/1e4)},zones(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/zones"]},zonesMinSeedrate(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/zonesMinSeedrate"]},zonesMaxSeedrate(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/zonesMaxSeedrate"]},currentHeatmaps(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.heatmaps.current},selectedFields(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.selectedFields},varietiesToDropdownItems(){return[{items:[{id:"manual",name:this.$t("Eigene Saatstärke")??""}]},{items:this.varieties.current.map(this.varietyToDropdownItem)}]},fieldDistributionMinMaxDescription(){return this.$t("{seedrateMin} bis {seedrateMax} Körner pro m^2",{seedrateMin:this.fieldDistributionMinInput,seedrateMax:this.fieldDistributionMaxInput})??""},fieldDistributionMin(){return this.zonesMinSeedrate},fieldDistributionMax(){return this.zonesMaxSeedrate},fieldDistributionMinInput(){return null!==this.calculation.manualMinSeedrate?this.numberFormat(Math.round(this.calculation.manualMinSeedrate/1e4).toString()):this.numberFormat(Math.round(this.fieldDistributionMin/1e4).toString())},fieldDistributionMaxInput(){return null!==this.calculation.manualMaxSeedrate?this.numberFormat(Math.round(this.calculation.manualMaxSeedrate/1e4).toString()):this.numberFormat(Math.round(this.fieldDistributionMax/1e4).toString())},manualSeedRatesDefined(){const{manualSeedRates:e}=this.calculation;return 0!==Object.keys(e).length},zoneSizesTotal(){return this.zones.reduce(((e,t)=>e+t.size),0)},packagesTotal(){const e=this.zones.reduce(((e,t)=>t.manualSeedRate?e+t.manualSeedRate*t.size:e+(t.seedRate??0)*t.size),0);return Number.isNaN(e)?0:Math.ceil(e/this.standardPackageSize)},standardPackageSizeFormatted(){return Nl(this.standardPackageSize).format({mantissa:0})},isDrillVariety(){const e=this.varieties.current.find((e=>e.id===this.calculation.variety.id));return null!==this.calculation.variety.id&&"Drill"===e?.seedingMethod}},watch:{currentHeatmaps(){this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setAreaWeightedVarietyMean")},selectedFields:{async handler(){await this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/loadVarieties",{forceRefresh:!1}),null===this.calculation.variety.id?this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setDefaultVariety"):this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/updateVarietyDependencies")},immediate:!0}},methods:{setVariety(e){"manual"===e.id&&this.setManualSeedRatesToZero(),this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setVariety",e),this.errorMessages={seedrateMin:null,seedrateMax:null},this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null},setBasicSeedStrength(e){const t=1e4*e;this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setCalculationField",{key:"basicSeedStrength",value:t})},setLossCompensation(e){const t=e/100;this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setCalculationField",{key:"lossCompensation",value:t})},setThousandGrainWeight(e){this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setCalculationField",{key:"thousandGrainWeight",value:e})},setManualSeedRate(e,t){const i=Nl.unformat(t);this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setManualSeedRate",{zoneName:e,manualSeedRate:i})},setManualFieldDistributionMin(e){this.rawFieldDistributionMin=e;const t=Nl.unformat(e),i=this.rawFieldDistributionMax??this.fieldDistributionMaxInput,a=Nl.unformat(i);t>a?this.errorMessages.seedrateMin=this.$t("Die minimale Saatstärke darf nicht größer als die maximale Saatstärke sein."):(this.errorMessages.seedrateMin=null,this.errorMessages.seedrateMax=null,this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null,this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setManualMinMaxSeedrate",{seedrateMin:1e4*t,seedrateMax:1e4*a}))},setManualFieldDistributionMax(e){this.rawFieldDistributionMax=e;const t=this.rawFieldDistributionMin??this.fieldDistributionMinInput,i=Nl.unformat(t),a=Nl.unformat(e);a<i?this.errorMessages.seedrateMax=this.$t("Die maximale Saatstärke darf nicht kleiner als die minimale Saatstärke sein."):(this.errorMessages.seedrateMin=null,this.errorMessages.seedrateMax=null,this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null,this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setManualMinMaxSeedrate",{seedrateMin:1e4*i,seedrateMax:1e4*a}))},setManualSeedRatesToZero(){const e={};
1this.zones.forEach((t=>{e[t.name]=0})),this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setCalculationField",{key:"manualSeedRates",value:e})},resetManualSeedRates(){this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/setVariety",this.calculation.variety)},numberFormat(e){const t=Number(e.replace(/\D/g,""));return Nl(t).format({mantissa:0})},roundValue(e){const t=this.calculation[e];if(!t)return;const i=$ye(t,this.precision);this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setCalculationField",{key:e,value:i})},showLossCompensationInfoModal(){this.$refs.lossCompensationInfoModal.show()},updateQuantisation(e){this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setQuantisationCode",e.id),this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/loadHeatmaps")},varietyToDropdownItem(e){return of(e,(e=>this.$t(e)))}}}),Nye=Rye,zye=(0,ew.Z)(Nye,Fye,Aye,!1,null,"9cc236d0",null),Lye=zye.exports,Vye=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Export",{attrs:{workflowKey:e.workflowKey},on:{"update:errorMessage":e.setErrorMessage}},[t("ExportTable",{attrs:{tableHeaders:e.tableHeaders,tableRows:e.tableRows,tableHint:e.$t("Alle Werte in Körner/m^2")}}),e.errorMessage?t("div",{staticClass:"error-message"},[e._v(" "+e._s(e.errorMessage)+" ")]):e._e()],1)},Uye=[],jye=(0,b.defineComponent)({name:"SidebarExportSeedingSoy",components:{Export:Ipe,ExportTable:xpe},props:{workflowKey:{type:String,required:!0}},data(){return{tableHeaders:[this.$t("Saatstärke")],errorMessage:null}},computed:{fields(){return this.$store.state.fields.data},calculation(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/calculation"]},currentHeatmaps(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/currentHeatmaps"]},zones(){return this.$store.getters["precisionFarming/applicationMaps/seedingSoy/zones"]},zoneGenerationMode(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.zoneGenerationMode},selectedFields(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.selectedFields},paginationStep(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.paginationStep},fieldValues(){const e=this.fieldIdsOfHeatmaps(this.currentHeatmaps);return e.map((e=>this.calcFieldValues(e)))},tableRows(){return this.fieldValues.map((e=>({title:()=>e.title,name:e.name,values:[Bl()(e.avgSeedRate).format({mantissa:0})]})))},paginationStepOrSelectedFieldsOrVarietyChanged(){return`${this.paginationStep}|${this.selectedFields}|${this.calculation.variety}`}},watch:{paginationStepOrSelectedFieldsOrVarietyChanged(){3===this.paginationStep&&this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/findAndSetMaterial`)}},methods:{fieldIdsOfHeatmaps(e){return Object.keys(e).map((e=>{const t=e.split("_")[0];return t}))},calcFieldValues(e){const t=this.getFieldName(e),i=this.getFieldTitle(t),a=this.calcAvgSeedRate(e);return{name:t,title:i,avgSeedRate:a}},getFieldName(e){return rA.data.call(this,this.fields[e])},getFieldTitle(e){return e.length>19?e:null},calcAvgSeedRate(e){let t=0;const i=this.findHeatmapOfField(e);if(!i)return t;i.color_codes.forEach((e=>{const i=this.findZoneOfColorCode(e),a=i?.manualSeedRate||i?.seedRateWithLossCompensation||0;t+=a*e.area}));const a=i.color_codes.reduce(((e,t)=>e+t.area),0);a>0&&(t/=a);const n=Math.round(Hm(t)/1e4);return n},findHeatmapOfField(e){const t=Object.entries(this.currentHeatmaps).find((([t])=>t.split("_")[0]===e)),i=t?.[1];return i},findZoneOfColorCode(e){return this.zones.find((t=>t.color===e.col))},setErrorMessage(e){this.errorMessage=e}}}),Hye=jye,Gye=(0,ew.Z)(Hye,Vye,Uye,!1,null,"7ee9132c",null),Wye=Gye.exports,Zye={name:"PageApplicationMapsSeedingSoy",components:{PageApplicationMaps:che,SidebarFields:QD,HeaderLogo:Vme,SidebarCreateApplicationMapSeedingSoy:Lye,SidebarExportSeeding:Wye,ModalConfirmation:Woe},data(){return{workflowKey:Wh.SEEDING_SOY,headerLogo:{src:Cye,alt:"Saatbau Logo"},columnDefinition:zoe,visible:!1,stepForward:()=>{}}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/seedingSoy",["paginationStep"]),...(0,C.Se)({zones:"precisionFarming/applicationMaps/seedingSoy/zones"}
1),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_APPLICATION_MAPS_SEEDING_SOY)},selectedFields:{get(){return this.$store.state.precisionFarming.applicationMaps.seedingSoy.selectedFields},set(e){this.$store.commit("precisionFarming/applicationMaps/seedingSoy/setSelectedFields",e)}},seedRatesExceedThresholds(){const e=3e5,t=9e5;return this.zones.some((t=>{const i=t.manualSeedRate??t.seedRateWithLossCompensation??t.seedRate??0;return i<e}))?"lower":this.zones.some((e=>{const i=e.manualSeedRate??e.seedRateWithLossCompensation??e.seedRate??0;return i>t}))?"upper":null},messages(){const e=[],t=this.$t("upper"===this.seedRatesExceedThresholds?"höher":"niedriger"),i=this.$t("Die Saatstärke ist in einer oder mehreren Zonen beträchtlich {comparative} als üblich.",{comparative:t}),a=this.$t("Möchtest Du mit diesen Werten fortsetzten oder die Einstellungen auf die empfohlenen Werte zurücksetzen?");return e.push(`${i} ${a}`),e}},methods:{async onNavigationNext(e){this.stepForward=e,2===this.paginationStep&&this.seedRatesExceedThresholds?this.visible=!0:e()},reset(){this.$store.dispatch("precisionFarming/applicationMaps/seedingSoy/resetManualSeedrates")}}},Kye=Zye,qye=(0,ew.Z)(Kye,bye,wye,!1,null,null,null),Yye=qye.exports,Jye=function(){var e=this,t=e._self._c;return t("PageApplicationMaps",{attrs:{workflowKey:e.workflowKey,stepCount:3},on:{onNavigationNext:e.onNavigationNext},scopedSlots:e._u([{key:"headerLogo",fn:function(){return[t("HeaderLogo",{attrs:{src:e.headerLogo.src,alt:e.headerLogo.alt}})]},proxy:!0},{key:"steps",fn:function(){return[t("SidebarFields",{directives:[{name:"show",rawName:"v-show",value:1===e.paginationStep,expression:"paginationStep === 1"}],attrs:{tableId:"sidebar-table-fields-seeding","selected-rows":e.selectedFields,customColumnDefinition:e.columnDefinition},on:{"update:selectedRows":function(t){e.selectedFields=t},"update:selected-rows":function(t){e.selectedFields=t}}}),2===e.paginationStep?t("SidebarCreateApplicationMapSeeding",{ref:"createApplicationMap"}):e._e(),t("SidebarExportSeeding",{directives:[{name:"show",rawName:"v-show",value:3===e.paginationStep,expression:"paginationStep === 3"}],attrs:{workflowKey:e.workflowKey}}),t("ModalConfirmation",{attrs:{messages:e.messages},on:{reset:e.reset,ignore:function(t){return e.stepForward()}},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}})]},proxy:!0}])})},Xye=[],Qye=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-create-application-map",attrs:{id:"sidebar-create-application-map"}},[t("SidebarHeadline",{attrs:{text:e.$t("Applikationskarte erstellen")}}),t("ScrollableContent",[t("SidebarContentWrapper",{staticClass:"mb-5 mt-0"},[t("SidebarSubHeadline",{attrs:{text:e.$t("Produkt")}}),t("FormFieldDropdown",{ref:"variety",attrs:{label:e.$t("Sorte wählen"),variant:"vertical",value:e.varietyToDropdownItem(e.calculation.variety),items:e.varietiesToDropdownItems,itemsLoading:e.varieties.fetching,required:"",disableDelete:""},on:{update:e.setVariety}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.manualSeedRatesDefined,expression:"!manualSeedRatesDefined"}],staticClass:"refinement-container"},[t("FormSlider",{attrs:{label:e.$t("Basissaatstärke"),min:e.calculation.seedrateMin,max:e.calculation.seedrateMax,value:e.calculation.basicSeedStrength,interval:e.precision},on:{setValue:e.setBasicSeedStrength}}),t("hr",{staticClass:"mt-0"}),t("SidebarSubHeadline",{attrs:{text:e.$t("Verteilung auf dem Feld")}}),t("FormFieldSetBordered",{staticClass:"overflow-hidden",attrs:{headline:e.$t("Minimale & maximale Saatstärke"),description:e.fieldDistributionMinMaxDescription,labelLinkOpen:e.$t("Min/max Saatstärke ändern"),labelLinkClose:e.$t("Optionen schließen")}},[t("FormFieldInput",{staticClass:"mb-2",attrs:{type:"text",name:"fieldDistributionMinInput",variant:"vertical",placeholder:e.$t("Wert"),value:e.fieldDistributionMinInput,label:e.$t("Minimale Saatstärke"),formatter:e.numberFormat,state:!e.errorMessages.seedrateMin&&null},on:{update:e.setManualFieldDistributionMin,blur:function(t){return e.roundValue("manualMinSeedrate")}}}),t("ErrorUserMessage",{staticClass:"mt-0",attrs:{"error-user-message":e.errorMessages.seedrateMin}}),t("FormFieldInput",{staticClass:"mb-2",attrs:{type:"text",name:"fieldDistributionMaxInput",variant:"vertical",placeholder:e.$t("Wert"),value:e.fieldDistributionMaxInput,label:e.$t("Maximale Saatstärke"),formatter:e.numberFormat,state:!e.errorMessages.seedrateMax&&null},on:{update:e.setManualFieldDistributionMax,blur:function(t){return e.roundValue("manualMaxSeedrate")}}}),t("ErrorUserMessage",{staticClass:"mt-0",attrs:{"error-user-message":e.errorMessages.seedrateMax}})],1),t("FormFieldDropdown",{attrs:{label:e.$t("Anzahl der Zonen"),variant:"vertical",items:e.quantisationCategories,disableDelete:""},on:{update:e.updateQuantisation},model:{value:e.selectedQuantisation,callback:function(t){e.selectedQuantisation=t},expression:"selectedQuantisation"}}),t("FormSlider",{staticClass:"pt-2",attrs:{label:e.$t("Verlustausgleich (%)"),min:0,max:10,value:100*e.calculation.lossCompensation,additionalInformation:e.$t("Berater-Tipp: Hast du Verluste durch mechanische Pflege, Wild oder ähnliche Einflüsse berücksichtigt?")},on:{setValue:e.setLossCompensation}}),t("ModalLossCompensationInfo",{ref:"lossCompensationInfoModal"}),t("ButtonLink",{staticClass:"text-small",on:{click:e.showLossCompensationInfoModal}}
1,[e._v(e._s(e.$t("Mehr erfahren...")))])],1),t("ResetButton",{directives:[{name:"show",rawName:"v-show",value:e.manualSeedRatesDefined,expression:"manualSeedRatesDefined"}],attrs:{buttonText:e.$t("Tabelle zurücksetzen"),onClick:e.resetManualSeedRates}}),e.calculation.variety.id?t("ZonesTableContainer"):e._e()],1),t("hr",{staticClass:"mt-0"}),t("RequiredAmountTable",{staticClass:"mb-3",attrs:{zoneSizesTotal:e.zoneSizesTotal,additionalTotal:{heading:e.$t("Gesamtmenge"),amount:e.packagesTotal,unit:e.$t("Packungen")},additionalInformation:e.$t("Standardeinheit {amount} Körner je Packung",{amount:e.standardPackageSizeFormatted})}}),t("div",{staticClass:"d-flex justify-content-center pb-4"},[t("Button",{staticClass:"mt-0",attrs:{outline:""}},[t("a",{attrs:{href:e.getSeedOrderButtonHref,target:"_blank"}},[e._v(e._s(e.getSeedOrderButtonText))])])],1)],1)],1)},eve=[],tve=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ResultTable",{attrs:{columns:e.columns,data:e.tableData,footer:e.footer},on:{input:e.onInput}})},ive=[],ave=(0,b.defineComponent)({name:"ZonesTableContainer",components:{ResultTable:jle},data(){const e=[{key:"zone",header:{title:()=>this.$t("Zone")||"Zone"},type:"badge"},{key:"seedRate",header:{title:()=>this.$t("Saatstärke in Körner/ha")||"Saatstärke in Körner/ha"},type:"numberInput",align:"right"}];return{columns:e}},computed:{zones(){return this.$store.getters["precisionFarming/applicationMaps/seeding/zones"]},weightedAvgSeedRate(){if(!this.zones||0===this.zones.length)return 0;const e=this.zones.map((e=>e.manualSeedRate??e.seedRateWithLossCompensation??0)),t=this.zones.map((e=>e.size));return Hm(Sm(e,t))},tableData(){return this.zones&&0!==this.zones.length?this.zones.map((e=>{const t=0===e.size?0:e.manualSeedRate??e.seedRateWithLossCompensation??0;return{zone:{name:"",color:e.color},seedRate:{value:t}}})):[]},footer(){return{zone:this.$t("Durchschnitt")||"Durchschnitt",seedRate:Nl(this.weightedAvgSeedRate).format({mantissa:0})}}},watch:{weightedAvgSeedRate(){this.$store.dispatch("precisionFarming/applicationMaps/seeding/setAverageDosage",this.weightedAvgSeedRate)}},methods:{onInput({key:e,rowIndex:t,value:i}){if("seedRate"!==e)return;const a=this.zones[t]?.name;this.setManualSeedRate(a,i??0)},setManualSeedRate(e,t){this.$store.dispatch("precisionFarming/applicationMaps/seeding/setManualSeedRate",{zoneName:e,manualSeedRate:t})}}}),nve=ave,rve=(0,ew.Z)(nve,tve,ive,!1,null,null,null),sve=rve.exports;function ove(e,t){const i=Math.round(e/t)*t;return i<t?t:i}var lve=(0,b.defineComponent)({name:"SidebarCreateApplicationMapSeeding",components:{Button:gw,SidebarContentWrapper:Qle,SidebarHeadline:iI,SidebarSubHeadline:rde,RequiredAmountTable:ome,FormFieldDropdown:lk,FormSlider:Sue,FormFieldSetBordered:Cee,FormFieldInput:fk,ErrorUserMessage:cH,ResetButton:uue,ModalLossCompensationInfo:Dye,ButtonLink:Fw,ScrollableContent:Yfe,ZonesTableContainer:sve},data(){const e=[{id:"high",name:this.$t("Hoch")||""},{id:"medium",name:this.$t("Mittel")||""},{id:"low",name:this.$t("Gering")||""}],t=[{name:"Quantisation",id:"0",items:e,sort:!1}],i=e[1];return{precision:500,errorMessages:{seedrateMin:null,seedrateMax:null},standardPackageSize:5e4,quantisationCategories:t,selectedQuantisation:i,rawFieldDistributionMin:null,rawFieldDistributionMax:null}},computed:{getSeedOrderButtonHref(){return this.$store.state.auth.currentCompanies[0].regionId===te.SI?"https://www.saatbau.com/si/maisbutler/":"https://www.sesam24.at/saatbau-spa/EUR/login"},getSeedOrderButtonText(){return this.$store.state.auth.currentCompanies[0].regionId===te.SI?this.$t("MAISBUTLER Anfrage"):this.$t("Sa
1atgut jetzt bestellen SESAM24")},varieties(){return this.$store.state.precisionFarming.applicationMaps.seeding.varieties},calculation(){return this.$store.state.precisionFarming.applicationMaps.seeding.calculation},zones(){return this.$store.getters["precisionFarming/applicationMaps/seeding/zones"]},zonesMinSeedrate(){return this.$store.getters["precisionFarming/applicationMaps/seeding/zonesMinSeedrate"]},zonesMaxSeedrate(){return this.$store.getters["precisionFarming/applicationMaps/seeding/zonesMaxSeedrate"]},currentHeatmaps(){return this.$store.state.precisionFarming.applicationMaps.seeding.heatmaps.current},selectedFields(){return this.$store.state.precisionFarming.applicationMaps.seeding.selectedFields},varietiesToDropdownItems(){return[{items:[{id:"manual",name:this.$t("Eigene Saatstärke")??""}]},{items:this.varieties.current.map(this.varietyToDropdownItem)}]},fieldDistributionMinMaxDescription(){return this.$t("{seedrateMin} bis {seedrateMax} Körner pro Hektar",{seedrateMin:this.fieldDistributionMinInput,seedrateMax:this.fieldDistributionMaxInput})??""},fieldDistributionMin(){return this.zonesMinSeedrate},fieldDistributionMax(){return this.zonesMaxSeedrate},fieldDistributionMinInput(){return null!==this.calculation.manualMinSeedrate?this.numberFormat(this.calculation.manualMinSeedrate.toString()):this.numberFormat(this.fieldDistributionMin.toString())},fieldDistributionMaxInput(){return null!==this.calculation.manualMaxSeedrate?this.numberFormat(this.calculation.manualMaxSeedrate.toString()):this.numberFormat(this.fieldDistributionMax.toString())},manualSeedRatesDefined(){const{manualSeedRates:e}=this.calculation;return 0!==Object.keys(e).length},zoneSizesTotal(){return this.zones.reduce(((e,t)=>e+t.size),0)},packagesTotal(){const e=this.zones.reduce(((e,t)=>t.manualSeedRate?e+t.manualSeedRate*t.size:e+(t.seedRate??0)*t.size),0);return Number.isNaN(e)?0:Math.ceil(e/this.standardPackageSize)},standardPackageSizeFormatted(){return Nl(this.standardPackageSize).format({mantissa:0})}},watch:{currentHeatmaps(){this.$store.dispatch("precisionFarming/applicationMaps/seeding/setAreaWeightedVarietyMean")},selectedFields:{async handler(){await this.$store.dispatch("precisionFarming/applicationMaps/seeding/loadVarieties",{forceRefresh:!1}),null===this.calculation.variety.id?this.$store.dispatch("precisionFarming/applicationMaps/seeding/setDefaultVariety"):this.$store.dispatch("precisionFarming/applicationMaps/seeding/updateVarietyDependencies")},immediate:!0}},methods:{setVariety(e){"manual"===e.id&&this.setManualSeedRatesToZero(),this.$store.dispatch("precisionFarming/applicationMaps/seeding/setVariety",e),this.errorMessages={seedrateMin:null,seedrateMax:null},this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null},setBasicSeedStrength(e){this.$store.commit("precisionFarming/applicationMaps/seeding/setCalculationField",{key:"basicSeedStrength",value:e})},setLossCompensation(e){const t=e/100;this.$store.commit("precisionFarming/applicationMaps/seeding/setCalculationField",{key:"lossCompensation",value:t})},setManualSeedRate(e,t){const i=Nl.unformat(t);this.$store.dispatch("precisionFarming/applicationMaps/seeding/setManualSeedRate",{zoneName:e,manualSeedRate:i})},setManualFieldDistributionMin(e){this.rawFieldDistributionMin=e;const t=Nl.unformat(e),i=this.rawFieldDistributionMax??this.fieldDistributionMaxInput,a=Nl.unformat(i);t>a?this.errorMessages.seedrateMin=this.$t("Die minimale Saatstärke darf nicht größer als die maximale Saatstärke sein."):(this.errorMessages.seedrateMin=null,this.errorMessages.seedrateMax=null,this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null,this.$store.dispatch("precisionFarming/applicationMaps/seeding/setManualMinMaxSeedrate",{seedrateMin:t,seedrateMax:a}))},setManualFieldDistributionMax(e){this.rawFieldDistributionMax=e;const t=this.rawFieldDistributionMin??this.fieldDistributionMinInput,i=Nl.unformat(t),a=Nl.unformat(e);a<i?this.errorMessages.seedrateMax=this.$t("Die maximale Saatstärke darf nicht kleiner als die minimale Saatstärke sein."):(this.errorMessages.seedrateMin=null,this.errorMessages.seedrateMax=null,this.rawFieldDistributionMin=null,this.rawFieldDistributionMax=null,this.$store.dispatch("precisionFarming/applicationMaps/seeding/setManualMinMaxSeedrate",{seedrateMin:i,seedrateMax:a}))},setManualSeedRatesToZero(){const e={};
1this.zones.forEach((t=>{e[t.name]=0})),this.$store.commit("precisionFarming/applicationMaps/seeding/setCalculationField",{key:"manualSeedRates",value:e})},resetManualSeedRates(){this.$store.dispatch("precisionFarming/applicationMaps/seeding/setVariety",this.calculation.variety)},numberFormat(e){const t=Number(e.replace(/\D/g,""));return Nl(t).format({mantissa:0})},roundValue(e){const t=this.calculation[e];if(!t)return;const i=ove(t,this.precision);this.$store.commit("precisionFarming/applicationMaps/seeding/setCalculationField",{key:e,value:i})},showLossCompensationInfoModal(){this.$refs.lossCompensationInfoModal.show()},updateQuantisation(e){this.$store.commit("precisionFarming/applicationMaps/seeding/setQuantisationCode",e.id),this.$store.dispatch("precisionFarming/applicationMaps/seeding/loadHeatmaps")},varietyToDropdownItem(e){return of(e,(e=>this.$t(e)))}}}),dve=lve,cve=(0,ew.Z)(dve,Qye,eve,!1,null,"8220354a",null),uve=cve.exports,pve=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("Export",{attrs:{workflowKey:e.workflowKey},on:{"update:errorMessage":e.setErrorMessage}},[t("ExportTable",{attrs:{tableHeaders:e.tableHeaders,tableRows:e.tableRows,tableHint:e.$t("Alle Werte in Körner/ha")}}),e.errorMessage?t("div",{staticClass:"error-message"},[e._v(" "+e._s(e.errorMessage)+" ")]):e._e()],1)},hve=[],mve=(0,b.defineComponent)({name:"SidebarExportSeeding",components:{Export:Ipe,ExportTable:xpe},props:{workflowKey:{type:String,required:!0}},data(){return{tableHeaders:[this.$t("Saatstärke")],errorMessage:null}},computed:{fields(){return this.$store.state.fields.data},calculation(){return this.$store.getters["precisionFarming/applicationMaps/seeding/calculation"]},currentHeatmaps(){return this.$store.getters["precisionFarming/applicationMaps/seeding/currentHeatmaps"]},zones(){return this.$store.getters["precisionFarming/applicationMaps/seeding/zones"]},zoneGenerationMode(){return this.$store.state.precisionFarming.applicationMaps.seeding.zoneGenerationMode},selectedFields(){return this.$store.state.precisionFarming.applicationMaps.seeding.selectedFields},paginationStep(){return this.$store.state.precisionFarming.applicationMaps.seeding.paginationStep},fieldValues(){const e=this.fieldIdsOfHeatmaps(this.currentHeatmaps);return e.map((e=>this.calcFieldValues(e)))},tableRows(){return this.fieldValues.map((e=>({title:()=>e.title,name:e.name,values:[Bl()(e.avgSeedRate).format({mantissa:0})]})))},paginationStepOrSelectedFieldsOrVarietyChanged(){return`${this.paginationStep}|${this.selectedFields}|${this.calculation.variety}`}},watch:{paginationStepOrSelectedFieldsOrVarietyChanged(){3===this.paginationStep&&this.$store.dispatch(`precisionFarming/applicationMaps/${this.workflowKey}/findAndSetMaterial`)}},methods:{fieldIdsOfHeatmaps(e){return Object.keys(e).map((e=>{const t=e.split("_")[0];return t}))},calcFieldValues(e){const t=this.getFieldName(e),i=this.getFieldTitle(t),a=this.calcAvgSeedRate(e);return{name:t,title:i,avgSeedRate:a}},getFieldName(e){return rA.data.call(this,this.fields[e])},getFieldTitle(e){return e.length>19?e:null},calcAvgSeedRate(e){let t=0;const i=this.findHeatmapOfField(e);if(!i)return t;i.color_codes.forEach((e=>{const i=this.findZoneOfColorCode(e),a=i?.manualSeedRate||i?.seedRateWithLossCompensation||0;t+=a*e.area}));const a=i.color_codes.reduce(((e,t)=>e+t.area),0);return a>0&&(t/=a),t=Hm(t),t},findHeatmapOfField(e){const t=Object.entries(this.currentHeatmaps).find((([t])=>t.split("_")[0]===e)),i=t?.[1];return i},findZoneOfColorCode(e){return this.zones.find((t=>t.color===e.col))},setErrorMessage(e){this.errorMessage=e}}}),fve=mve,gve=(0,ew.Z)(fve,pve,hve,!1,null,"1b8d2f76",null),yve=gve.exports,vve={name:"PageApplicationMapsSeeding",components:{PageApplicationMaps:che,SidebarFields:QD,HeaderLogo:Vme,SidebarCreateApplicationMapSeeding:uve,SidebarExportSeeding:yve,ModalConfirmation:Woe},data(){return{workflowKey:Wh.SEEDING,headerLogo:{src:Cye,alt:"Saatbau Logo"},columnDefinition:zoe,visible:!1,stepForward:()=>{}}},computed:{...(0,C.rn)("precisionFarming/applicationMaps/seeding",["paginationStep"]),...(0,C.Se)({zones:"precisionFarming/applicationMaps/seeding/zones"}
1),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_APPLICATION_MAPS_SAATBAU_MAIZE)},selectedFields:{get(){return this.$store.state.precisionFarming.applicationMaps.seeding.selectedFields},set(e){this.$store.commit("precisionFarming/applicationMaps/seeding/setSelectedFields",e)}},seedRatesExceedThresholds(){const e=5e4,t=15e4;return this.zones.some((t=>{const i=t.manualSeedRate??t.seedRateWithLossCompensation??t.seedRate??0;return i<e}))?"lower":this.zones.some((e=>{const i=e.manualSeedRate??e.seedRateWithLossCompensation??e.seedRate??0;return i>t}))?"upper":null},messages(){const e=[],t=this.$t("upper"===this.seedRatesExceedThresholds?"höher":"niedriger"),i=this.$t("Die Saatstärke ist in einer oder mehreren Zonen beträchtlich {comparative} als üblich.",{comparative:t}),a=this.$t("Möchtest Du mit diesen Werten fortsetzten oder die Einstellungen auf die empfohlenen Werte zurücksetzen?");return e.push(`${i} ${a}`),e}},methods:{async onNavigationNext(e){this.stepForward=e,2===this.paginationStep&&this.seedRatesExceedThresholds?this.visible=!0:e()},reset(){this.$store.dispatch("precisionFarming/applicationMaps/seeding/resetManualSeedrates")}}},bve=vve,wve=(0,ew.Z)(bve,Jye,Xye,!1,null,null,null),Cve=wve.exports,Fve=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"page-feature-title":e.$router.currentRoute.meta.label,"page-feature-enabled":e.currentCompaniesHaveFeature.enabled,"page-feature-visible":e.currentCompaniesHaveFeature.visible},scopedSlots:e._u([{key:"contentbar",fn:function(){return[e.noContentbar?e._e():t("TheContentbar",{scopedSlots:e._u([{key:"right",fn:function({contentbarLarge:e}){return[t("ProcessOrderSwitch",{staticClass:"ml-4",attrs:{slim:!e}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!e}})]}}],null,!1,1944758292)})]},proxy:!0},{key:"sidebar",fn:function(){return[t("SidebarFields",{attrs:{tableId:"sidebar-table-fields-monitoring",allowFieldsWithNoContour:"",selectedRows:e.selectedFields},on:{"update:selectedRows":function(t){e.selectedFields=t},"update:selected-rows":function(t){e.selectedFields=t}}})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"monitoring__map-wrapper",attrs:{id:"monitoring__map-wrapper"}},[null!=e.map?t("MapItemTooltip",{staticClass:"monitoring__map-tooltip",attrs:{map:e.map,polygon:e.polygons[e.hoveredPolygon]}},[t("div",{staticClass:"text-left"},[t("ul",{staticClass:"monitoring__map-tooltip-list"},[t("li",{staticClass:"monitoring__map-tooltip-list-item"},[e.fieldsForOverlay.length>1&&null!=e.hoveredPolygonData.color?t("span",{staticClass:"monitoring__map-tooltip-list-item-color"},[t("span",{style:{background:e.hoveredPolygonData.color}})]):e._e(),e._v(" "+e._s(e.hoveredPolygonData.name)+" ")]),null!=e.hoveredPolygonData.crop?t("li",{staticClass:"monitoring__map-tooltip-list-item"},[e._v(" "+e._s(e.hoveredPolygonData.crop)+" ")]):e._e(),null!=e.hoveredPolygonData.size?t("li",{staticClass:"monitoring__map-tooltip-list-item"},[e._v(" "+e._s(e.hoveredPolygonData.size)+" ")]):e._e()])])]):e._e(),t("div",{ref:"map-container",staticClass:"monitoring__map-container"}),t("div",{staticClass:"monitoring__map-legend bg-lightest"},e._l(e.legendEntries,(function(i){return t("div",{key:i.label,style:i.style},[e._v(e._s(i.label))])})),0),t("div",{directives:[{name:"show",rawName:"v-show",value:e.mapLoader.visible,expression:"mapLoader.visible"}],staticClass:"monitoring__map-loader"},[t("FontAwesomeIcon",{staticClass:"monitoring__map-loader-svg text-primary",style:e.mapLoader.position,attrs:{icon:"circle-notch",spin:""}})],1),e.overlay.loading||e.fieldsForOverlay.length>0?t("MonitoringOverlay",{staticClass:"visible",scopedSlots:e._u([{key:"header",fn:function(){return[t("h3",{staticClass:"h5 font-weight-bold mb-0"},[e._v(e._s(e.$t("Monitoring")))])]},proxy:!0},{key:"main",fn:function(){return[t("IndexGraph",{attrs:{navigationDate:e.navigationDate,hoveredPolygon:e.hoveredPolygon},on:{"update:navigationDate":t=>e.navigationDate=t}}),e.overlay.folded?e._e():t("WeatherInfo",{attrs:{variant:"compact",selectedField:e.selectedFieldForWeather,navigationDate:e.navigationDate},on:{"update:navigationDate":t=>e.navigationDate=t}})]},proxy:!0}],null,!1,728475313)}
1):e._e()],1)]},proxy:!0},{key:"featureNotEnabled",fn:function(){return[t("MaxWidthContainer",{attrs:{left:"",size:"xl"}},[t("h2",{staticClass:"my-4"},[e._v(e._s(e.$t("Jetzt upgraden auf FARMDOK PERFORMANCE!")))]),t("p",[e._v(" "+e._s(e.$t("Steige um auf FARMDOK PERFORMANCE und du erhältst Zugang zu FARMDOK Monitoring. Die Anwendung ermöglicht es Vegetations­unterschiede teilflächenspezifisch in der Karte darzustellen und den zeitlichen Verlauf zu analysieren."))+" ")]),t("p",[e._v(" "+e._s(e.$t("Für die Auswertung werden Daten der Sentinel Erdbeobachtungs­satelliten verwendet. Satelliten- & Wetterdaten zeigen Biomassezuwachs (NDVI- und MSAVI2-Index), Stickstoffverbrauch (REIP-Index) und Wassergehalt (NDWI-Index) auf. Sie sind die optimale Unterstützung für effektive Produktionsentscheidungen."))+" ")]),t("div",{staticClass:"row my-4"},[t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(11381),alt:"Vegetation monitoring preview"}})]),t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(81781),alt:"Vegetation monitoring preview"}})]),t("div",{staticClass:"col-4"},[t("img",{staticClass:"w-100",attrs:{src:i(76905),alt:"Vegetation monitoring preview"}})])]),t("Button",{staticClass:"d-print-none",attrs:{"leading-icon":"",variant:"danger",icon:["far","shopping-cart"]},on:{click:()=>e.$router.push({name:"shop"})}},[e._v(" Zum Shop ")])],1)]},proxy:!0}])})},Ave=[];function kve(){const e="0123456789ABCDEF";let t="#";for(let i=0;i<6;i+=1)t+=e[Math.floor(16*Math.random())];return t}var Sve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"index-graph px-3"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"loading"},[t("FontAwesomeIcon",{staticClass:"text-primary",attrs:{icon:"circle-notch",spin:""}})],1),t("div",{staticClass:"date-picker"},[t("FormFieldDatepicker",{attrs:{variant:"horizontal",label:e.$t("Datum des Vegetationsindex"),loading:e.overlay.loading,disabledDates:e.disabledDates,step:5},on:{setSelectedDate:t=>e.selectedTimestamp=t},model:{value:e.defaultDate,callback:function(t){e.defaultDate=t},expression:"defaultDate"}})],1),t("div",[t("div",{staticClass:"w-100 border-bottom border-medium index-picker"},[t("Tabs",{attrs:{tabs:e.indexTypes.slice(0,3),size:"widget"===e.variant?"lg":"md",fill:!0}}),t("BDropdown",{staticClass:"m-0 p-0",attrs:{size:"md",variant:"outline",text:e.$t("Mehr")}},e._l(e.indexTypes.slice(3),(function(i){return t("BDropdownItem",{key:i.label,on:{click:()=>{e.rotateBy=i.rotateBy,i.onClick()}}},[e._v(e._s(i.label)+" ")])})),1)],1),e.overlay.folded?e._e():t("div",{staticClass:"main"},[t("LineChart",{directives:[{name:"show",rawName:"v-show",value:e.chartData,expression:"chartData"}],attrs:{chartData:e.chartData,selectedValueX:e.loading||e.dismissVerticalIndicator?null:e.selectedTimestamp,minX:e.minX.unix(),maxX:e.maxX.unix(),minY:0,axisData:e.axisData,missingDataMessage:e.$t("Keine Satellitendaten für den ausgewählten Zeitraum verfügbar."),nDecimals:2},on:{prev:e.previousDate,restore:e.resetDate,next:e.nextDate,mouseover:function(t){e.dismissVerticalIndicator=!0}}})],1)])])},Eve=[];ow.vI.add(uw.zc,uw.IV4,uw.IJ7);var Ive={name:"IndexGraph",mixins:[Zte],components:{Tabs:mte,LineChart:Wte,FormFieldDatepicker:g_},props:{hoveredPolygon:{type:String,default:null},variant:{type:String,default:"compact",validator:e=>["compact","widget"].includes(e)}},mounted(){this.selectedAggregate="Daily",this.selectedTimestamp=this.defaultDate},data(){return{selectedValueX:null,disabledDates:{customPredictor:e=>{const t=g()(e),i=g()().add(16,"days");return t.isAfter(i)}},pageIndex:0,dismissVerticalIndicator:!1,rotateBy:0}},methods:{rotateArrayBy(e,t){const i=[...e];for(let a=0;a<t;a+=1)i.push(i.shift());return i},toSen4IndexType(e){switch(e){case"DNN_NDVI":return"DnnNdvi";case"DNN_LAI":return"DnnLai";case"DNN_NDWI":return"DnnNdwi";case"DNN_CIRE":return"DnnCire";case"MBI":return"Mbi";case void 0:return;default:throw new Error(`Unsupported index type: ${e}`)}},toGraphDataPoints(e,t){const i=this.toRelevanceFunction(t),a=this.polygons[e.developerPayload].name,n=MK()(e.data?.time,e.data?.value).map((([e,t])=>[this.toMoment(e),t??0])).filter(i).map((([e,t])=>({x:e.unix(),y:t,caption:this.caption(e),placeholder:0===t})));return{...t,dataPoints:n,name:this.selectedFields.length>1?a:null,greyedOut:this.hoveredPolygon!==e.developerPayload&&null!==this.hoveredPolygon}},toGraphArea(e,t){const i=MK()(e.data?.time,e.data?.min,e.data?.max).map((([e,t,i])=>[this.toMoment(e),t??0,i??0])).map((([e,t,i])=>({x:e.unix(),yMin:t,yMax:i,caption:this.caption(e),placeholder:0===t||0===i})));return{...t,dataPoints:i}},toRelevanceFunction(e){if(e.isMean)return([e])=>e.isSameOrBefore(g()(),"day");if(e.isForecast)return([e])=>e.isAfter(g()(),"day");if(e.isMeanOverall)return()=>!["MBI"].includes(this.selectedIndexType);throw new Error("Unsupported lineType",e)}},computed:{...(0,C.Se)("precisionFarming/monitoring",["overlay","overlayFolded","polygons","multiPolyTimestamps","vegetationData","
1selectedHeatmapDbId","selectedFields"]),...(0,C.rn)("precisionFarming/monitoring/sen4",{loading:"fetching",sen4Actual(e){return this.requestParams.map((e=>({...e,statistics:"No"}))).map(Ig).map((t=>e.data[t])).filter(ka)},sen4Mean(e){return this.requestParams.map((e=>({...e,statistics:"MeanY5"}))).map(Ig).map((t=>e.data[t])).filter(ka)}}),requestParams(){return this.selectedFields.map((e=>({fieldId:e,startDate:this.minX.format("YYYY-MM-DD"),endDate:this.maxX.format("YYYY-MM-DD"),indexType:this.toSen4IndexType(this.selectedIndexType),statistics:"No",developerPayload:e})))},selectedIndexType:{get(){return this.$store.state.precisionFarming.monitoring.selectedIndexType},set(e){this.$store.dispatch("precisionFarming/monitoring/setSelectedDnnIndexType",e),this.$store.dispatch("precisionFarming/monitoring/loadDnnHeatmaps")}},selectedTimestamp:{get(){return this.$store.state.precisionFarming.monitoring.selectedTimestamp},set(e){const t=g()(e).startOf("day").unix();this.$store.dispatch("precisionFarming/monitoring/setSelectedTimestamp",t),this.loading||this.$store.dispatch("precisionFarming/monitoring/loadDnnHeatmaps"),this.dismissVerticalIndicator=!1}},chartData(){const e=this.sen4Actual.filter((()=>1===this.selectedFields.length)).map((e=>this.toGraphArea(e,{isMinMax:!0}))),t=this.sen4Actual.map((e=>this.toGraphDataPoints(e,{isMean:!0}))),i=this.sen4Actual.map((e=>this.toGraphDataPoints(e,{isForecast:!0}))),a=this.sen4Mean.filter((()=>1===this.selectedFields.length)).map((e=>this.toGraphDataPoints(e,{isMeanOverall:!0})));return[...e,...a,...t,...i]},minX(){return g()(this.navigationDate).startOf("year")},maxX(){return this.minX.clone().endOf("year")},axisData(){const e=[];for(const t=this.minX.clone();t.isSameOrBefore(this.maxX);t.add(1,"days")){const i=this.isHighlight(t);i&&e.push({caption:this.axisLabel(t),x:t.unix(),highlight:i})}return e},indexTypes(){const e=[{type:"button",onClick:()=>{this.selectedIndexType="DNN_NDVI"},label:this.$t("NDVI - Biomasse"),active:"DNN_NDVI"===this.selectedIndexType,rotateBy:0},{type:"button",onClick:()=>{this.selectedIndexType="DNN_LAI"},label:this.$t("LAI - Blattflächenindex"),active:"DNN_LAI"===this.selectedIndexType,rotateBy:1},{type:"button",onClick:()=>{this.selectedIndexType="DNN_NDWI"},label:this.$t("NDWI - Wassergehalt"),active:"DNN_NDWI"===this.selectedIndexType,rotateBy:2},{type:"button",onClick:()=>{this.selectedIndexType="DNN_CIRE"},label:this.$t("CIre - Chlorophyll"),active:"DNN_CIRE"===this.selectedIndexType,rotateBy:3},{type:"button",onClick:()=>{this.selectedIndexType="MBI"},label:this.$t("MBI - Mehrjährige Biomasse"),active:"MBI"===this.selectedIndexType,rotateBy:4}];return this.rotateArrayBy(e,this.rotateBy)}},watch:{requestParams(e){e.map((e=>({...e,statistics:"No"}))).forEach((e=>this.$store.dispatch("precisionFarming/monitoring/sen4/vegetationIndexGraph",e))),e.map((e=>({...e,statistics:"MeanY5"}))).forEach((e=>this.$store.dispatch("precisionFarming/monitoring/sen4/vegetationIndexGraph",e)))},selectedFields(){this.$store.dispatch("precisionFarming/monitoring/loadDnnHeatmaps")}},filters:{timestampToDate(e){return g().unix(e).format("DD.MM")},timestampToYear(e){return g().unix(e).format("YYYY")}}},_ve=Ive,Dve=(0,ew.Z)(_ve,Sve,Eve,!1,null,"2d2239e0",null),Mve=Dve.exports,Pve=function(){var e=this,t=e._self._c;return t("div",{staticClass:"overlay bg-white shadow",class:{"overlay--folded":e.overlay.folded}},[t("div",{staticClass:"header my-4 mx-3"},[e._t("header"),t("div",[t("BButton",{staticClass:"mr-1",attrs:{variant:"white"},on:{click:function(t){return e.toggleOverlay()}}},[e.overlay.folded?e._e():t("FontAwesomeIcon",{attrs:{icon:["far","chevron-up"]}}),e.overlay.folded?t("FontAwesomeIcon",{attrs:{icon:["far","chevron-down"]}}):e._e()],1),t("BButton",{attrs:{variant:"white"},on:{click:function(t){return e.close()}}},[t("FontAwesomeIcon",{attrs:{icon:["far","times"]}})],1)],1)],2),e._t("main")],2)},Tve=[];ow.vI.add(lw.ptq,lw.mTx,lw.NBC);var xve={name:"MonitoringOverlay",data(){return{widthNoScrollbars:null,widthScrollbars:null}},methods:{close(){this.$store.dispatch("precisionFarming/monitoring/closeOverlay")},toggleOverlay(){this.$store.commit("precisionFarming/monitoring/toggleOverlayFold")}},mounted(){window.addEventListener("keyup",(e=>
1{27===e.keyCode&&this.close()}))},computed:{...(0,C.Se)({overlay:"precisionFarming/monitoring/overlay"})}},Bve=xve,Ove=(0,ew.Z)(Bve,Pve,Tve,!1,null,"24b9da45",null),$ve=Ove.exports;ow.vI.add(uw.IJ7);var Rve={name:"PageMonitoring",components:{ThePageSkeleton:$w,TheContentbar:HL,SidebarFields:QD,MonitoringOverlay:$ve,IndexGraph:Mve,WeatherInfo:aie,MapItemTooltip:fE,CompanySwitch:qw,ProcessOrderSwitch:lV,MaxWidthContainer:Tw,Button:gw},props:{noContentbar:{type:Boolean,default:!1}},inject:{googleMapsSettings:{default:()=>X},polygonStates:{default:{INACTIVE:"inactive",ACTIVE:"active",HIDDEN:"hidden",HEATMAP:"heatmap"}},heatmapStates:{default:{INACTIVE:"inactive",ACTIVE:"active",LOADING:"loading",NONE:"none"}}},data(){return{storeUnsubscribe:null,google:null,map:null,markers:{},externalFieldsCount:0,navigationDate:new Date,initialLoaded:!1,fieldsForOverlayLoading:!1,mapLoader:{visible:!1,position:{top:0,left:0}},hoveredPolygon:null}},computed:{...(0,C.Se)({fields:"fields",polygons:"precisionFarming/monitoring/polygons",overlay:"precisionFarming/monitoring/overlay",currentHeatmaps:"precisionFarming/monitoring/currentHeatmaps",vegetationData:"precisionFarming/monitoring/vegetationData"}),currentCompaniesHaveFeature(){return this.$store.getters.currentCompaniesHaveFeature(Hr.FEATURE_VEGETATION_MONITORING)},selectedFields:{get(){return this.$store.state.precisionFarming.monitoring.selectedFields},set(e){this.$store.commit("precisionFarming/monitoring/setSelectedFields",e)}},fieldsForOverlay(){return Object.values(this.polygons).filter((e=>"active"===e.state))},selectedFieldForWeather(){if(this.fieldsForOverlay.length>0){const e=this.selectedFields[0];return this.fields[e]}return null},hoveredPolygonData(){if(null==this.hoveredPolygon||null==this.polygons[this.hoveredPolygon])return{color:"",name:"",crop:"",size:""};const{lineChartColor:e,name:t}=this.polygons[this.hoveredPolygon];let{crop:i,size:a}=this.polygons[this.hoveredPolygon];return null!=i&&(i=i.name),null==a&&(a=this.google.maps.geometry.spherical.computeArea(this.polygons[this.hoveredPolygon].getPath())/1e4),a=this.$t("{size} ha",{size:Bl()(a).format()}),{color:e,name:t,crop:i,size:a}},legendEntries(){if(0===Object.values(this.currentHeatmaps).length)return[];const e=Object.values(this.currentHeatmaps).reduce(((e,t)=>t.color_codes.reduce(((e,t)=>null!=e[t.name]?e:{...e,[t.name]:t}),e)),{});return Object.values(e).map((e=>{let t=e.name,i="var(--white)";return"cloud"===t?(t=this.$t("Wolken"),i="var(--black)"):"snow"===t?t=this.$t("Schnee"):Lm(e.col)[2]>40&&(i="var(--black)"),{label:t,style:{color:i,backgroundColor:e.col}}}))},pointsInFocus(){return this.selectedFields.filter(hH).map((e=>this.polygons[e])).filter(ka).map((e=>e.getPath())).flatMap((e=>e.getArray()))}},watch:{selectedFields(e,t){const i=e.filter((e=>!t.includes(e)&&this.polygons[e])),a=t.filter((t=>!e.includes(t)&&this.polygons[t]));i.forEach((e=>{this.activatePolygon(e)})),a.forEach((e=>{this.deactivatePolygon(e)}))},polygons(e){Object.keys(e).forEach((t=>{const i=e[t],a=i.state;let n={};this.currentHeatmaps[t]||(a===this.polygonStates.ACTIVE?n={strokeColor:this.googleMapsSettings.POLYGON_ACTIVE_STROKE_COLOR,fillColor:this.googleMapsSettings.POLYGON_ACTIVE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1}:a===this.polygonStates.HIDDEN?n={fillOpacity:0,strokeOpacity:0}:a===this.polygonStates.INACTIVE&&(n={fillColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,strokeOpacity:1}),i.setMap(this.map),i.setOptions(n))}))},currentHeatmaps(e){const t=Object.keys(e);this.map.data.forEach((e=>{this.map.data.remove(e)})),t.forEach((t=>{e[t].errorMessage||(this.map.data.addGeoJson(e[t]),this.polygons[t].setOptions({fillOpacity:0,strokeOpacity:0}))})),this.map.data.setStyle((e=>{const t=e.getProperty("fill");return{fillColor:t,strokeColor:"transparent",fillOpacity:1,zIndex:-1}}))},pointsInFocus(e,t){if(e.length>t.length){const t=new google.maps.LatLngBounds;e.forEach((e=>t.extend(e))),this.map?.fitBounds(t,{bottom:30,top:30,right:400,left:10})}}},mounted(){this.storeUnsubscribe=this.$store.subscribe((({type:e})=>{"afterResetData"===e&&this.reInitialize()})),this.reInitialize()},beforeDestroy(){this.storeUnsubscribe()},methods:{async reInitialize(){!1!==this.currentCompaniesHaveFeature.enabled&&(this.markers={},this.externalFieldsCount=0,this.initialLoaded=!1,this.fieldsForOverlayLoading=!1,this.mapLoader={visible:!1,position:{top:0,left:0}},this.hoveredPolygon=null,await this.initMaps(),await this.setInitialDrawings(),this.externalFieldsListener())},async initMaps(){const e=await cE();this.google=e;const t={tilt:0,mapTypeId:e.maps.MapTypeId.HYBRID,disableDefaultUI:!0,mapTypeControl:!0,mapTypeControlOptions:{style:e.maps.MapTypeControlStyle.DROPDOWN_MENU,position:e.maps.ControlPosition.TOP_RIGHT,mapTypeIds:[e.maps.MapTypeId.SATELLITE,e.maps.MapTypeId.ROADMAP,e.maps.MapTypeId.HYBRID]},zoomControl:!0,zoomControlOptions:{position:e.maps.ControlPosition.RIGHT_CENTER},fullscreenControl:!1,isFractionalZoomEnabled:!0,styles:[{featureType:"poi",stylers:[{visibility:"off"}]}]};this.map=new e.maps.Map(this.$refs["map-container"],t)},externalFieldsListener(){this.google.maps.event.addListener(this.map,"click",(async e=>{if(null==e.latLng||null==e.latLng.lat()||null==e.latLng.lng()||null==e.pixel||null==e.pixel.y||null==e.pixel.x)return;const t=e.latLng.lat(),i=e.latLng.lng();this.mapLoader.visible=!0,this.mapLoader.position={top:e.pixel.y,left:e.pixel.x},await this.getFieldContourByPoint(t,i).then((e=>{if(e){this.externalFieldsCount+=1;const a=`ext${this.externalFieldsCount}`,n={name:`${this.$t("Neues Feld")} ${this.externalFieldsCount}`};this.drawPolygon(a,{lat:t,lon:i},e,n,!0)}this.mapLoader.visible=!1}))}))},async setInitialDrawings(){if(!this.google||this.initialLoaded)return;await this.$store.dispatch("auth/subscribe"),await this.$store.dispatch("fields/subscribe");const e=new this.google.maps.LatLngBounds;await Promise.all(Object.keys(this.fields).map((async t=>{const i=this.fields[t],{lat:a,lon:n}=i;let r;if(null==i.fieldContour||null==i.fieldContour.geoJson||"Polygon"!==i.fieldContour.geoJson.type){if(null===a||null===n)return;await this.getFieldContourByPoint(a,n).then((e=>{e&&(r=e)}))}else({geoJson:r}=i.fieldContour);const s={name:rA.data.call(this,i),crop:i.crop,size:i.fieldSize};null!=r&&(this.drawPolygon(t,{lat:a,lon:n}
1,r,s),r.coordinates[0].forEach((t=>e.extend({lng:t[0],lat:t[1]}))))}))),Object.values(this.fields).length>0?this.map.fitBounds(e):this.map.setOptions(this.googleMapsSettings.GOOGLE_MAPS_DEFAULT_CENTER),this.initialLoaded=!0},drawPolygon(e,t,i,a,n){const r=new this.google.maps.Polygon({...a,field_key:e,paths:i.coordinates[0].map((e=>({lng:e[0],lat:e[1]}))),strokeColor:this.googleMapsSettings.POLYGON_VISIBLE_STROKE_COLOR,strokeOpacity:1,strokeWeight:2,fillColor:this.googleMapsSettings.POLYGON_VISIBLE_FILL_COLOR,fillOpacity:.3,clickable:!0,state:this.polygonStates.INACTIVE,lat:t.lat,lon:t.lon,lineChartColor:kve(),external:n,loadedVegetationData:{},heatmapState:this.heatmapStates.INACTIVE});[r.pathsForAxios]=i.coordinates,this.google.maps.event.addListener(r,"click",(()=>{this.switchPolygonState(e,r.state)})),this.google.maps.event.addListener(r,"mouseover",(()=>{r.state!==this.polygonStates.HIDDEN&&(this.hoveredPolygon=e)})),this.google.maps.event.addListener(r,"mouseout",(()=>{this.hoveredPolygon===e&&(this.hoveredPolygon=null)})),this.$store.commit("precisionFarming/monitoring/addPolygon",r),n&&this.activatePolygon(e)},switchPolygonState(e,t){t===this.polygonStates.INACTIVE||t===this.polygonStates.HIDDEN?this.addToSelected(e):this.removeFromSelected(e)},addToSelected(e){this.fields[e]&&!this.selectedFields.includes(e)&&(this.selectedFields=[...this.selectedFields,e])},removeFromSelected(e){null!=this.fields[e]&&this.selectedFields.includes(e)&&(this.selectedFields=this.selectedFields.filter((t=>t!==e)))},activatePolygon(e){this.$store.dispatch("precisionFarming/monitoring/setDnnPolygonState",{key:e,values:{state:this.polygonStates.ACTIVE}})},deactivatePolygon(e){this.$store.dispatch("precisionFarming/monitoring/setDnnPolygonState",{key:e,values:{state:this.polygonStates.INACTIVE}}),this.$store.commit("precisionFarming/monitoring/unsetCurrentHeatmap",e)},async getFieldContourByPoint(e,t){const{data:i}=await l().post("/admin/sen4/fieldContourByPoint",{lat:e,lon:t});try{return i.contour}catch{return!1}}}},Nve=Rve,zve=(0,ew.Z)(Nve,Fve,Ave,!1,null,"2f30ac10",null),Lve=zve.exports,Vve=[{path:`${M}precision-farming/monitoring`,name:"monitoring",component:Lve,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Vegetationsmonitoring"),featureControl:Hr.FEATURE_VEGETATION_MONITORING}},{path:`${M}precision-farming/application-maps`,name:"application-maps",component:Ihe,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Applikationskarten"),featureControl:Hr.FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC||Hr.FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE||Hr.FEATURE_APPLICATION_MAPS_SEEDING_SOY||Hr.FEATURE_APPLICATION_MAPS_TERRAZO}},{path:`${M}precision-farming/application-maps/:workflowKey/task/:taskId`,name:"application-maps__task",component:pJ,beforeEnter:async(e,t,i)=>{const{taskId:a,workflowKey:n}=e.params;try{const{data:e}=await l().get(`/admin/taskplan/get/${a}?version=2.0`);if(null!=e&&"success"===e.status&&null!=e.data){const t=fhe(n);await Lb.dispatch(`precisionFarming/applicationMaps/${t}/setTask`,e.data),i({name:`application-maps/workflows/${n}`})}else i({name:`application-maps/workflows/${n}`})}catch(r){console.error("Unable to set task for application maps.",r),i({name:"application-maps"})}},meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Applikationskarten"),featureControl:Hr.FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC||Hr.FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE||Hr.FEATURE_APPLICATION_MAPS_SEEDING_SOY||Hr.FEATURE_APPLICATION_MAPS_TERRAZO}},{path:`${M}precision-farming/application-maps/workflows/fertilization`,name:"application-maps/workflows/fertilization",component:Ime,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Düngekarte"),featureControl:Hr.FEATURE_APPLICATION_MAPS_FERTILIZATION_FD_BASIC}},{path:`${M}precision-farming/application-maps/workflows/seeding`,name:"application-maps/workflows/seeding",component:Cve,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Saatbau Mais Aussaatkarte"),featureControl:Hr.FEATURE_APPLICATION_MAPS_SEEDING_SAATBAU_MAIZE}},{path:`${M}precision-farming/application-maps/workflows/seeding-soy`,name:"application-maps/workflows/seeding-soy",component:Yye,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Saatbau Soja Aussaatkarte"),featureControl:Hr.FEATURE_APPLICATION_MAPS_SEEDING_SOY}},{path:`${M}precision-farming/application-maps/workflows/fertilization-cereals`,name:"application-maps/workflows/fertilization-cereals",component:vye,meta:{requiresAuth:!0,label:()=>`Terrazo ${b["default"].i18n.translate("Düngekarte für Getreide")}`,featureControl:Hr.FEATURE_APPLICATION_MAPS_TERRAZO}},{path:`${M}precision-farming/application-maps/workflows/spraying`,name:"application-maps/workflows/spraying",component:mhe,meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Variable Pflanzenschutzkarte"),featureControl:Hr.FEATURE_APPLICATION_MAPS_SPRAYING_FD_BASIC}}],Uve=function(){var e=this,t=e._self._c;return t("ThePageSkeleton",{attrs:{"scroll-y":""},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[t("Button",{attrs:{variant:"primary","component-namespace-name":"ButtonTest"}},[e._v(" This is a test button ")]),t("Button",{attrs:{color:"primary",outline:"","component-namespace-name":"ButtonOtherTest"}},[e._v(" This is another test button ")]),t("Button",{attrs:{color:"lightest","component-namespace-name":"ButtonPseudoTransparent"}},[e._v(" Pseudo Transparent Button ")]),t("Button",{attrs:{color:"lightest","component-namespace-name":"ButtonOtherPseudoTransparent",n
1otification:"",icon:"bell"}},[e._v(" Another Pseudo Transparent Button ")])]},proxy:!0},{key:"right",fn:function({contentbarLarge:e}){return[t("ProcessOrderSwitch",{staticClass:"ml-4",attrs:{slim:!e}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!e}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"page-button-test"},[t("h2",[e._v("Button Anatomy")]),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Sizes")]),t("div",{staticClass:"d-inline-block bg-medium mt-1 mb-1"},[t("Button",{attrs:{size:"sm"}},[e._v("Small Button")]),t("Button",{attrs:{size:"sm",outline:"",notification:""}},[e._v(" Another Small Button ")])],1),t("div",{staticClass:"d-inline-block bg-medium mt-1 mb-1"},[t("Button",[e._v("Default Button")]),t("Button",{attrs:{outline:""}},[e._v("Another Default Button")])],1),t("div",{staticClass:"d-inline-block bg-medium mt-1 mb-1"},[t("Button",{attrs:{size:"lg"}},[e._v("Large Button")]),t("Button",{attrs:{size:"lg",outline:""}},[e._v(" Another Large Button ")])],1)]),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Colors")]),t("div",[t("Button",{attrs:{color:"primary"}},[e._v("Primary Button")]),t("Button",{attrs:{color:"danger"}},[e._v("Danger Button")]),t("Button",{attrs:{color:"black"}},[e._v("Black Button")])],1),t("div",[t("Button",{attrs:{color:"primary",outline:""}},[e._v(" Primary Outline Button ")]),t("Button",{attrs:{color:"danger",outline:"",notification:""}},[e._v(" Danger Outline Button ")]),t("Button",{attrs:{color:"black",outline:""}},[e._v(" Black Outline Button ")]),t("Button",{attrs:{color:"medium",outline:""}},[e._v(" Medium Outline Button ")])],1)]),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Pseudo Transparency")]),t("div",{staticClass:"bg-lightest"},[t("Button",[e._v("Default Button")]),t("Button",{attrs:{color:"lightest"}},[e._v("Lightest Button")]),t("Button",{attrs:{color:"lightest"}},[e._v("Another Lightest Button")])],1),t("div",{staticClass:"bg-white"},[t("Button",[e._v("Default Button")]),t("Button",{attrs:{color:"white",notification:"primary"}},[e._v("White Button with notification")]),t("Button",{attrs:{color:"white"}},[e._v("Another White Button")])],1)]),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Icons")]),t("div",[t("Button",{attrs:{icon:"plus-circle","leading-icon":""}},[e._v(" Default Add ")]),t("Button",{attrs:{icon:["far","arrow-right"]}},[e._v(" Default Next ")]),t("Button",{attrs:{color:"white",icon:"pencil-alt","leading-icon":"",title:"Default Edit Icon Only","icon-only":e.iconOnly},on:{click:function(t){e.iconOnly=!e.iconOnly}}},[e._v(" Default Edit Icon Only ")]),t("Button",{attrs:{color:"white",icon:"trash-alt","leading-icon":"",title:"Default Scissors Icon Only",notification:"warning","icon-only":e.iconOnly},on:{click:function(t){e.iconOnly=!e.iconOnly}}},[e._v(" Default Delete Icon Only ")])],1),t("div",[t("Button",{attrs:{size:"sm",color:"black",icon:"plus-circle","leading-icon":""}},[e._v(" Small Add ")]),t("Button",{attrs:{size:"sm",color:"black",icon:["far","arrow-right"]}},[e._v(" Small Next ")])],1),t("Button",{attrs:{size:"lg",block:"",notification:""}},[e._v(" Block Button ")])],1),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Links")]),t("ButtonLink",[e._v("Hello Link")]),t("ButtonLink",{attrs:{icon:"pencil-alt"}},[e._v("Hello Link With Icon")]),t("ButtonLink",{attrs:{color:"black",icon:"pencil-alt"}},[e._v("Hello Black Link With Icon")])],1),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Bordered Icons")]),t("div",[t("ButtonBorderedIcon",{attrs:{icon:"pencil-alt"}}),t("ButtonBorderedIcon",{attrs:{icon:"pencil-alt",disabled:""}})],1)]),t("div",{staticClass:"page-button-test--examples-container"},[t("h3",[e._v("Split Button")]),t("div",[t("ButtonDropdown",{attrs:{text:"Split Button",buttons:e.splitButtons}}),t("ButtonDropdown",{attrs:{text:"Outline Split Button",outline:"",buttons:e.splitButtons}})],1)])])]},proxy:!0}])})},jve=[],Hve={name:"PageButtonTest",components:{ButtonDropdown:mV,TheContentbar:HL,ThePageSkeleton:$w,Button:gw,ButtonBorderedIcon:ste,ButtonLink:Fw,CompanySwitch:qw,ProcessOrderSwitch:lV},data(){return{iconOnly:!0,splitButtons:[{text:"First Button",handler:()=>null,disabled:!1,componentNamespaceName:"SplitButtonFirst"},{text:"Second Button",handler:()=>null,disabled:!1,componentNamespaceName:"SplitButtonSecond"},{text:"Third Button",handler:()=>null,disabled:!0,componentNamespaceName:"SplitButtonThird"}]}}},Gve=Hve,Wve=(0,ew.Z)(Gve,Uve,jve,!1,null,"d072392e",null),Zve=Wve.exports,Kve=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ThePageSkeleton",{attrs:{"scroll-y":""},scopedSlots:e._u([{key:"contentbar",fn:function(){return[t("TheContentbar",{scopedSlots:e._u([{key:"left",fn:function(){return[t("BButton",{attrs:{variant:"primary"},on:{click:e.toggleCollapsed}},[e._v(" Toggle Vertical Layout Collapsed ")])]},proxy:!0},{key:"right",fn:function({contentbarLarge:e}){return[t("ProcessOrderSwitch",{staticClass:"ml-4",attrs:{slim:!e}}),t("CompanySwitch",{staticClass:"ml-4",attrs:{slim:!e}})]}}])})]},proxy:!0},{key:"content",fn:function(){return[t("div",{staticClass:"p-3 bg-medium"},[t("FormFieldSetBordered",{staticClass:"field-set bg-white",attrs:{headline:"Additional Info"},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("This is the description.")]},proxy:!0},{key:"default",fn:function(){return[t("FormFieldInput",{staticClass:"mt-0",attrs:{label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormCheckbox",{model:{value:e.checkboxOne,callback:function(t){e.checkboxOne=t},expression:"checkboxOne"}},[e._v(" Single Checkbox One. ")]),t("FormFieldRadioGroup",{staticClass:"mb-0",attrs:{label:"Group with options",options:[{text:"First option.",value:"first"},{text:"Second option.",value:"second"},{text:"Third option.",value:"third"},{text:"Fourth option.",value:"fourth",disabled:!0}]},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}})]},proxy:!0}])}),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Text & Number Inputs",collapsible:""}}
1,[t("FormFieldInput",{attrs:{label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormFieldInput",{attrs:{label:"Enter a number",name:"number",type:"number"},model:{value:e.number,callback:function(t){e.number=t},expression:"number"}}),t("FormFieldInputNumberFormatted",{attrs:{label:"Enter a number (it will be eager formatted with 3 decimals)",name:"number",formatter:e.numberFormatterNumbro,parser:e.numberParserNumbro},model:{value:e.numberFormattedNumbro,callback:function(t){e.numberFormattedNumbro=t},expression:"numberFormattedNumbro"}}),t("FormFieldInputNumberFormatted",{attrs:{label:"Enter a number (it will be lazy formatted with 3 decimals)",name:"number",formatter:e.numberFormatterNumbro,parser:e.numberParserNumbro,lazy:!0},model:{value:e.numberFormattedNumbro,callback:function(t){e.numberFormattedNumbro=t},expression:"numberFormattedNumbro"}}),t("FormFieldInputNumberFormatted",{attrs:{label:"Enter a number (with min: -10 and max: 10)",name:"number",formatter:e.numberFormatterNumbro,parser:e.numberParserNumbro,lazy:!0,min:-10,max:10},model:{value:e.numberFormattedNumbro,callback:function(t){e.numberFormattedNumbro=t},expression:"numberFormattedNumbro"}}),t("FormFieldInputNumberFormatted",{attrs:{label:"Enter a number (with min: -10 and max: 10)",name:"number",formatter:e.numberFormatterNumbro,parser:e.numberParserNumbro,lazy:!0,min:-10,max:10,stateMessage:"Number valid between -10 and 10"},model:{value:e.numberFormattedNumbro,callback:function(t){e.numberFormattedNumbro=t},expression:"numberFormattedNumbro"}}),t("FormFieldInputNumberFormattedTwoDecimals",{attrs:{label:"Enter a number (it will be lazy formatted with 2 decimals)",name:"number",lazy:!0},model:{value:e.numberFormattedTwoDecimals,callback:function(t){e.numberFormattedTwoDecimals=t},expression:"numberFormattedTwoDecimals"}}),t("FormFieldInputNumberFormattedInteger",{attrs:{label:"Enter a number (it will be \n        formatted as integer)",name:"number"},model:{value:e.numberFormattedInteger,callback:function(t){e.numberFormattedInteger=t},expression:"numberFormattedInteger"}}),e._v(" value: "+e._s(e.numberFormattedInteger)+" "),t("FormFieldInputNumberFormattedDisplayValue",{attrs:{label:"Enter a number (it will be formatted only for display)",name:"number",formatter:e.numberFormatterTwoDecimals},model:{value:e.numberFormattedDisplayValueOnly,callback:function(t){e.numberFormattedDisplayValueOnly=t},expression:"numberFormattedDisplayValueOnly"}}),e._v(" value: "+e._s(e.numberFormattedDisplayValueOnly)+" "),t("FormFieldInputNumberFormattedDisplayValue",{attrs:{label:"Enter a number (it will be formatted only for display, update is lazy)",name:"number",formatter:e.numberFormatterTwoDecimals,lazy:!0},model:{value:e.numberFormattedDisplayValueOnly,callback:function(t){e.numberFormattedDisplayValueOnly=t},expression:"numberFormattedDisplayValueOnly"}}),e._v(" value: "+e._s(e.numberFormattedDisplayValueOnly)+" ")],1),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Checkboxes",collapsible:""}},[t("FormCheckbox",{model:{value:e.checkboxOne,callback:function(t){e.checkboxOne=t},expression:"checkboxOne"}},[e._v(" Single Checkbox One. ")]),t("FormCheckbox",{model:{value:e.checkboxTwo,callback:function(t){e.checkboxTwo=t},expression:"checkboxTwo"}},[e._v(" Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. Single Checkbox Two. With extra long text. ")]),t("FormCheckbox",{attrs:{switch:""},model:{value:e.checkboxThree,callback:function(t){e.checkboxThree=t},expression:"checkboxThree"}},[e._v(" Single Checkbox Three. ")]),t("FormFieldCheckboxGroup",{attrs:{label:"Group with options",options:[{text:"First option.",value:"first"},{text:"Second option.",value:"second"},{text:"Third option.",value:"third"},{text:"Fourth option.",value:"fourth",disabled:!0}]},model:{value:e.selectedCheckBoxes,callback:function(t){e.selectedCheckBoxes=t},expression:"selectedCheckBoxes"}}),t("FormFieldCheckboxGroup",{attrs:{label:"Vertical group with options",variant:"vertical",options:[{text:"First option.",value:"first"},{text:"Second option.",value:"second"},{text:"Third option.",value:"third"},{text:"Fourth option.",value:"fourth",disabled:!0}]},model:{value:e.selectedCheckBoxes,callback:function(t){e.selectedCheckBoxes=t},expression:"selectedCheckBoxes"}}),t("FormFieldCheckboxGroup",{attrs:{label:"Group with slot"},model:{value:e.selectedCheckBoxes,callback:function(t){e.selectedCheckBoxes=t},expression:"selectedCheckBoxes"}},[t("FormCheckbox",{attrs:{value:"first"}},[e._v("Select first.")]),t("FormCheckbox",{attrs:{value:"second"}},[e._v("Select second.")]),t("FormCheckbox",{attrs:{value:"third"}}
1,[e._v("Select third.")])],1),t("FormFieldCheckboxGroup",{attrs:{variant:"no-label"},model:{value:e.selectedCheckBoxes,callback:function(t){e.selectedCheckBoxes=t},expression:"selectedCheckBoxes"}},[t("FormCheckbox",{attrs:{value:"first",size:"sm"}},[e._v(" Select first. ")]),t("FormCheckbox",{attrs:{value:"second",size:"sm"}},[e._v(" Select second. ")]),t("FormCheckbox",{attrs:{value:"third",size:"sm",switch:""}},[e._v(" Select third. ")])],1),t("FormFieldCheckboxGroup",{attrs:{variant:"no-label"},model:{value:e.selectedCheckBoxes,callback:function(t){e.selectedCheckBoxes=t},expression:"selectedCheckBoxes"}},[t("FormCheckbox",{attrs:{value:"first",size:"lg"}},[e._v(" Select first. ")]),t("FormCheckbox",{attrs:{value:"second",size:"lg"}},[e._v(" Select second. ")]),t("FormCheckbox",{attrs:{value:"third",size:"lg",switch:""}},[e._v(" Select third. ")])],1)],1),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Radio buttons",collapsible:""}},[t("FormFieldInput",{attrs:{label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormFieldRadioGroup",{attrs:{label:"Group with options",options:[{text:"First option.",value:"first"},{text:"Second option.",value:"second"},{text:"Third option.",value:"third"},{text:"Fourth option.",value:"fourth",disabled:!0}]},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}}),t("FormFieldRadioGroup",{attrs:{label:"Vertical group with options",variant:"vertical",options:[{text:"First option.",value:"first"},{text:"Second option.",value:"second"},{text:"Third option.",value:"third"},{text:"Fourth option.",value:"fourth",disabled:!0}]},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}}),t("FormFieldRadioGroup",{attrs:{label:"Group with slot"},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}},[t("FormRadio",{attrs:{value:"first"}},[e._v("Select first.")]),t("FormRadio",{attrs:{value:"second"}},[e._v("Select second.")]),t("FormRadio",{attrs:{value:"third"}},[e._v("Select third.")])],1),t("FormFieldRadioGroup",{attrs:{variant:"no-label"},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}},[t("FormRadio",{attrs:{value:"first",size:"sm"}},[e._v(" Select first. ")]),t("FormRadio",{attrs:{value:"second",size:"sm"}},[e._v(" Select second. ")]),t("FormRadio",{attrs:{value:"third",size:"sm"}},[e._v(" Select third. ")])],1),t("FormFieldRadioGroup",{attrs:{variant:"no-label"},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}},[t("FormRadio",{attrs:{value:"first",size:"lg"}},[e._v(" Select first. ")]),t("FormRadio",{attrs:{value:"second",size:"lg"}},[e._v(" Select second. ")]),t("FormRadio",{attrs:{value:"third",size:"lg"}},[e._v(" Select third. ")])],1),t("FormFieldRadioGroup",{attrs:{label:"Group with slot"},model:{value:e.selectedRadio,callback:function(t){e.selectedRadio=t},expression:"selectedRadio"}},[t("FormRadio",{attrs:{value:"first",variant:"bordered"},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" Select first. ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" With some extra text. ")]},proxy:!0}])}),t("FormRadio",{attrs:{value:"second",variant:"bordered"},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" Select second. ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" With some extra text. ")]},proxy:!0}])}),t("FormRadio",{attrs:{value:"third",variant:"bordered"},scopedSlots:e._u([{key:"default",fn:function(){return[e._v(" Select third. ")]},proxy:!0},{key:"text",fn:function(){return[e._v(" With some extra text. ")]},proxy:!0}])})],1)],1),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Horizontal Layout"}},[t("FormFieldInput",{attrs:{label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormFieldInput",{attrs:{label:"Enter your lastname",name:"lastname",placeholder:"Lastname"},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{label:"Required Field",name:"required-field",placeholder:"This is a required field",required:""},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{label:"Disabled",name:"something",placeholder:"Something",disabled:""},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{label:"Valid",name:"something",placeholder:"Something",state:!0},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{label:"Invalid",name:"something",placeholder:"Something",state:!1},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{type:"password",label:"Passwort",name:"password",placeholder:"Enter password",state:"string"===typeof e.something&&e.something.length>3},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldSelect",{attrs:{label:"Select",options:[{value:"a",text:"Item 1"},{value:"b",text:"Item 2"}]},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}}),t("FormFieldSelect",{attrs:{label:"Select Required",required:"",options:[{value:"a",text:"Item 1"},{value:"b",text:"Item 2"}]},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}}),t("FormFieldDropdown",{attrs:{label:"Dropdown",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDropdown",{attrs:{label:"Dropdown Required",required:"",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDatepicker",{attrs:{label:"Datepicker",disabledDates:e.disabledDates,highlightedDates:e.highlightedDates,dayCellContent:e.dayCellContent},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}}),t("FormFieldDatepicker",{attrs:{label:"Datepicker",loading:!0},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}})],1),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Vertical Layout",collapsible:""},model:{value:e.collapsed,callback:function(t){e.collapsed=t},expression:"collapsed"}},[t("FormFieldInput",{attrs:{variant:"vertical",label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormFieldInput",{attrs:{variant:"vertical",label:"Enter your lastname",name:"lastname",placeholder:"Lastname"},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{variant:"vertical",label:"Required Field",name:"required-field",placeholder:"This is a required field",required:""},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{variant:"vertical",label:"Disabled",name:"something",placeholder:"Something",disabled:""},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{variant:"vertical",label:"Valid",name:"something",placeholder:"Something",state:!0},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{variant:"vertical",label:"Invalid",name:"something",placeholder:"Something",state:!1},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{variant:"vertical",type:"password",label:"Passwort",name:"password",placeholder:"Enter password"},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldSelect",{attrs:{variant:"vertical",label:"Select",options:[{value:"a",text:"Item 1"},{value:"b",text:"Item 2"}]},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}}),t("FormFieldSelect",{attrs:{variant:"vertical",label:"Select Required",required:"",options:[{value:"a",text:"Item 1"},{value:"b",text:"Item 2"}]},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}}),t("FormFieldDropdown",{attrs:{variant:"vertical",label:"Dropdown",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDropdown",{attrs:{variant:"vertical",label:"Dropdown Required",required:"",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDatepicker",{attrs:{variant:"vertical",label:"Datepicker"},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}})],1),t("FormFieldSet",{staticClass:"field-set bg-white",attrs:{headline:"Vertical Layout Large",collapsible:"",collapsed:""}},[t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Enter your name",name:"firstname",placeholder:"Firstname"},model:{value:e.firstname,callback:function(t){e.firstname=t},expression:"firstname"}}),t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Enter your lastname",name:"lastname",placeholder:"Lastname"},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Required Field",name:"required-field",placeholder:"This is a required field",required:""},model:{value:e.lastname,callback:function(t){e.lastname=t},expression:"lastname"}}),t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Disabled",name:"something",placeholder:"Something",disabled:""},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Valid",name:"something",placeholder:"Something",state:!0},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldInput",{attrs:{variant:"vertical-lg",label:"Invalid",name:"something",placeholder:"Something",state:!1},model:{value:e.something,callback:function(t){e.something=t},expression:"something"}}),t("FormFieldSelect",{attrs:{variant:"vertical-lg",label:"Select",options:[{value:"a",text:"Item 1"},{value:"b",text:"Item 2"}]},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}}),t("FormFieldDropdown",{attrs:{variant:"vertical-lg",label:"Dropdown",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDropdown",{attrs:{variant:"vertical-lg",label:"Dropdown Required",required:"",items:e.dropdownItems,"items-loading":e.dropdownItemsLoading},model:{value:e.dropdownSelected,callback:function(t){e.dropdownSelected=t},expression:"dropdownSelected"}}),t("FormFieldDatepicker",{attrs:{variant:"vertical-lg",label:"Datepicker"},model:{value:e.selectedDate,callback:function(t){e.selectedDate=t},expression:"selectedDate"}})],1)],1)]},proxy:!0}])})},qve=[],Yve=(0,b.defineComponent)({name:"PageFormTest",components:{FormCheckbox:Gw,FormFieldCheckboxGroup:A_,FormFieldDatepicker:g_,FormRadio:kT,FormFieldRadioGroup:_T,FormFieldDropdown:lk,CompanySwitch:qw,ProcessOrderSwitch:lV,TheContentbar:HL,ThePageSkeleton:$w,FormFieldSet:_k,FormFieldSetBordered:Cee,FormFieldSelect:n9,FormFieldInput:fk,FormFieldInputNumberFormatted:_le,FormFieldInputNumberFormattedTwoDecimals:rfe,FormFieldInputNumberFormattedInteger:Tle,FormFieldInputNumberFormattedDisplayValue:ix},data(){return{firstname:"foo",lastname:null,number:1234.567,numberFormattedNumbro:1234.567,numberFormattedTwoDecimals:1234.567,numberFormattedInteger:1234.567,numberFormattedDisplayValueOnly:1234.567,something:"gotcha",selected:"b",dropdownSelected:{id:null,name:""},dropdownItemsLoading:!0,dropdownItems:[{name:"Category X",id:"category_x",items:[{id:"a",name:"Item 1"},{id:"b",name:"Item 2"},{id:"c",name:"Item 3"}],sort:!0},{name:"Category Y",id:"category_y",items:[{id:"x",name:"Foo"},{id:"y",name:"Bar"},{id:"z",name:"Gotcha"}],sort:!0}],selectedRadio:"fourth",checkboxOne:!1,checkboxTwo:!0,checkboxThree:!1,selectedCheckBoxes:["fourth"],selectedDate:new Date,disabledDates:{to:new Date((new Date).setDate((new Date).getDate()-1))},highlightedDates:{dates:[new Date,new Date((new Date).setDate((new Date).getDate()+1))]},dayCellContent:e=>e.isHighlighted?`${e.date}!`:e.date,collapsed:!1}},mounted(){setTimeout((()=>{this.dropdownItemsLoading=!1}),3e3)},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},numberFormatterNumbro(e){return""===e||null===e?"":Nl(e).format({thousandSeparated:!0,mantissa:3})},numberParserNumbro(e){return null===e?null:Nl.unformat(e)},numberFormatterTwoDecimals(e){return null===e?"":Nl(e).format({thousandSeparated:!0,mantissa:2})},numberParserTwoDecimals(e){return null===e?null:Ea(rS(e),2)},parseNumber(e){return null===e?null:rS(e)}}}),Jve=Yve,Xve=(0,ew.Z)(Jve,Kve,qve,!1,null,"a7ddf40a",null),Qve=Xve.exports;const ebe=(e,t,i)=>{Lb.commit("redirectToAgriDat"),window.location=`${P}${e.fullPath}`},tbe=(e,t,i)=>{i()},ibe=[{path:M,name:"home",component:rF,meta:{isFullscreen:!0,requiresAuth:!0}},{path:`${M}button-test`,name:"button-test",component:Zve,meta:{requiresAuth:!0,label:"Button Test"}},{path:`${M}form-test`,name:"form-test",component:Qve,meta:{requiresAuth:!0,label:"Form Test"}},...rK,...S8,...oG,...bJ,{path:`${M}more`,name:"more",component:rF,meta:{requiresAuth:!0}},...A6,...Doe,...Vve].map((e=>({...e,beforeEnter:(t,i,a)=>{tbe(t,i,(()=>{"function"===typeof e.beforeEnter?e.beforeEnter(t,i,a):a()}))}}))),abe={to:{name:"management"},label:()=>
1b["default"].i18n.translate("Zurück zur Verwaltungs-Übersicht")},nbe=[{path:"/admin/map",name:"map",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Karte")}},{path:"/admin/notes",name:"notes",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Notizen")}},{path:"/admin/reports",name:"reports",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Berichte")}},{path:"/shop",name:"shop",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Shop")}},{path:"/voucher/referral",name:"referral",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Freunde einladen")}},{path:"/admin/fields",name:"fields--agridat",meta:{requiresAuth:!0,label({hash:e}={}){switch(e){case"#soil-samples":return b["default"].i18n.translate("Bodenproben");case"#crop-rotation":return b["default"].i18n.translate("Fruchtfolge");default:return b["default"].i18n.translate("Felder")}}}},{path:"/admin/fields#soil-samples",name:"soil-samples--agridat",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Bodenproben"),featureControl:Hr.FEATURE_SOIL_SAMPLES}},{path:"/admin/fields#crop-rotation",name:"crop-rotation--agridat",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Fruchtfolge"),featureControl:Hr.FEATURE_CROP_ROTATION}},{path:"/admin/user/profile",name:"profile",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Profil")}},{path:"/admin/user/invoices",name:"my-invoices",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Meine Rechnungen")}},{path:"/aboutus",name:"about-us",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Impressum")}},{path:"/admin/messaging",name:"notifications",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Benachrichtigungen")}},{path:"/admin/croppingPlan",name:"fertilization-plan",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Düngeplanung"),featureControl:Hr.FEATURE_FERTILIZATION_PLAN}},{path:"/admin/at/fertilizerPlan",name:"fertilization-plan--at",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Düngeplanung"),featureControl:Hr.FEATURE_FERTILIZATION_PLAN}},{path:"/admin/de/fertilizerPlan",name:"fertilization-plan--de",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Düngeplanung"),featureControl:Hr.FEATURE_FERTILIZATION_PLAN}},{path:"/admin/regional/de/fertilizerRegulation",name:"fertilizer-regulation",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Düngeverordnung"),featureControl:Hr.FEATURE_FERTILIZER_REGULATION}},{path:"/admin/regional/de/nutrientComparison",name:"nutrient-comparison",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Nährstoffvergleich"),featureControl:Hr.FEATURE_NUTRIENT_COMPARISON}},{path:"/admin/regional/de/substanceFlow",name:"substance-flow",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Stoffstrombilanz"),featureControl:Hr.FEATURE_SUBSTANCE_FLOW}},{path:"/admin/taskplan/list",name:"task-plan",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Arbeitsplanung"),featureControl:Hr.FEATURE_TASK_PLAN}},{path:"/admin/stockmovement",name:"stock-movement",meta:{requiresAuth:!0,label({hash:e}={}){switch(e){case"#stock-overview":return b["default"].i18n.translate("Lagerstände");default:return b["default"].i18n.translate("Lagerbewegungen")}},featureControl:Hr.FEATURE_STOCK_MOVEMENT}},{path:"/admin/prices/main",name:"cost-accounting",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Kostenrechnung"),featureControl:Hr.FEATURE_COST_ACCOUNTING}},{path:"/admin/menu/management",name:"management",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Verwaltung")}},{path:"/admin/user/list",name:"management/people",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Personen"),back:abe}},{path:"/admin/company",name:"management/company",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Betrieb"),back:abe}},{path:"/admin/customer/customerManagement",name:"management/customer-management",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Kundenverwaltung"),back:abe}},{path:"/admin/imexports",name:"management/exports",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Exporte"),back:abe}},{path:"/admin/company/settings",name:"management/company-settings",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Einstellungen"),back:abe}},{path:"/admin/material/category",name:"management/category",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Betriebsmittelkategorien"),back:abe}},{path:"/admin/material/crop",name:"management/material/crop",meta:{requiresAuth:!0,label({hash:e}={}){switch(e){case"#harvest":return b["default"].i18n.translate("Erntegüter");case"#varieties":return b["default"].i18n.translate("Sorten");case"#seeds":return b["default"].i18n.translate("Saatgut");default:return b["default"].i18n.translate("Kulturen")}},back:abe}},{path:"/admin/material/mineralFertilizer",name:"management/material/mineral-fertilizer",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Mineraldünger"),back:abe}},{path:"/admin/material/farmManure",name:"management/material/farm-fertilizer",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Wirtschaftsdünger"),back:abe}},{path:"/admin/material/secondaryFertilizer",name:"management/material/secondary-fertilizer",meta:{requiresAuth:!0,label(){return Lb.getters["auth/currentCompaniesRegionIds"].includes(ee.DE)?b["default"].i18n.translate("Sonstige organische Düngemittel"):b["default"].i18n.translate("Sekundärrohstoffe")},back:abe}},{path:"/admin/material/herbicide",name:"management/material/herbicide",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Pflanzenschutzmittel"),back:abe}},{path:"/admin/material/otherAuxiliaryFertilizer",name:"management/material/other-auxiliary-fertilizer",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Sonstige Hilfsstoffe und Dünger"),back:abe}},{path:"/admin/storage",name:"management/storage",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Lager"),back:abe}},{path:"/admin/animals/animalCategoryValues",name:"management/animals",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Tierkategorien und Nährstoffanfall"),back:abe}},{path:"/admin/equipment/main",name:"management/equipment",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Maschinen & Geräte"),back:abe}},{path:"/admin/equipment/category/main",name:"management/equipment-category",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Maschinen & Geräte Kategorien"),back:abe}},{path:"/admin/equipment/lists/main",name:"management/equipment-lists",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Maschinen & Geräte Listen"),back:abe}},{path:"/admin/measures/evaluation",name:"management/measures-evaluation",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Auswertung"),back:abe}},{path:"/admin/activities",name:"management/activity-types",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Tätigkeiten"),back:abe}},{path:"/admin/activities/fine",name:"management/activity-types-fine",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Detaillierte Tätigkeiten"),back:abe}},{path:"/admin/activities/rough",name:"management/activity-types-rough",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Grobe Tätigkeiten"),back:abe}},{path:"/admin/units",name:"management/units",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Einheiten"),back:abe}},{path:"/admin/user/admin",name:"admin/users",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"All users"}},{path:"/admin/user/instance",name:"admin/app-instances",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"User app instances"}},{path:"/admin/user/list/partner",name:"admin/partners",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Partners"}},{path:"/admin/company/management",name:"admin/companies",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Companies"}},{path:"/admin/company/suList/1",name:"admin/switch-company",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Switch company"}},{path:"/admin/company/management/multicompany",name:"admin/multi-companies",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Multicompany"}},{path:"/voucher/administration",name:"admin/used-vouchers",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Used vouchers"}},{path:"/admin/sbt/administration",name:"admin/agb",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"AGB versions"}},{path:"/admin/license/order/table",name:"admin/orders",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Orders"}},{path:"/admin/license/licenses",name:"admin/licenses",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Licenses"}},{path:"/admin/license/invoices",name:"admin/invoices",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Invoices"}},{path:"/admin/reports/administration",name:"admin/reports",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Reports"}},{path:"/admin/accesscontrol/permissiongroups",name:"admin/permission-groups",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Permission groups"}},{path:"/admin/accesscontrol/userroles",name:"admin/user-roles",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"User roles"}},{path:"/admin/accesscontrol/licensemodule",name:"admin/license-modules",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"License modules"}},{path:"/admin/accesscontrol/licensepackages",name:"admin/license-packages",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"License packages"}},{path:"/admin/accesscontrol/jsonexport",name:"admin/export",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Export"}},{path:"/admin/accesscontrol/jsonimport",name:"admin/import",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Import"}}
1,{path:"/admin/i18n/language/manage",name:"admin/languages",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Languages"}},{path:"/admin/material/materialGrabber",name:"admin/material-import",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Material import"}},{path:"/admin/fields/import/mappings",name:"admin/field-import-mappings",meta:{requiresAuth:!0,requiresSuperAdmin:!0,label:"Field import mappings"}},{path:"/voucher/list/bundles",name:"partner/voucher-bundles",meta:{requiresAuth:!0,label:()=>b["default"].i18n.translate("Gutscheine verwalten")}}].reduce(((e,t)=>{const i=[];return i.push({...t,beforeEnter:ebe},...["/comp/:companyId","/ordr/:orderId","/comp/:companyId/ordr/:orderId"].map((e=>({path:e+t.path,redirect:{name:t.name}})))),[...e,...i]}),[]);function rbe(){ibe.forEach((e=>Vl.addRoute(e))),nbe.forEach((e=>Vl.addRoute(e))),Vl.addRoute({path:"*",name:"404",component:Ooe,meta:{requiresAuth:!0}}),Vl.addRoute({path:`${M}logout`,name:"logout",beforeEnter:async(e,t,i)=>{await Lb.dispatch("auth/logout"),i({name:"login"})}}),Vl.beforeEach((async(e,t,i)=>{if(!e.matched.some((e=>e.meta.requiresAuth)))return i();await Lb.dispatch("auth/subscribe");const{oneTimeToken:a}=e.query;if(!Lb.state.auth.loggedIn){const t={name:"login"};return"/"!==e.fullPath&&e.fullPath!==M&&(t.query={redirect:e.fullPath,oneTimeToken:a}),i(t)}return e.meta.requiresSuperAdmin&&!Lb.state.auth.user.superAdmin?i(!1):i()})),Vl.afterEach((e=>{b["default"].nextTick((()=>{let t=null;"string"===typeof e.meta.label?t=e.meta.label:"function"===typeof e.meta.label&&(t=e.meta.label(e)),document.title=null!=t?`${t} – FARMDOK`:"FARMDOK"}))}))}function sbe(e){return null==e.meta||null==e.meta.featureControl?{visible:!0,enabled:!0,readonly:!1}:{visible:Lb.getters.currentCompaniesHaveFeatureVisible(e.meta.featureControl),enabled:Lb.getters.currentCompaniesHaveFeatureEnabled(e.meta.featureControl),readonly:Lb.getters.currentCompaniesHaveFeatureReadonly(e.meta.featureControl)}}var obe={name:"NavbarItem",components:{},props:{to:{type:[String,Object],default:null},icon:{type:[String,Array],required:!0},label:{type:String,default:null},submenu:{type:Array,default(){return[]}},expanded:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},data(){return{submenuOpen:!1,closeSubmenuTimeout:null}},computed:{labelComputed(){return null!=this.label?this.label:"function"===typeof this.$router.resolve(this.to).route.meta.label?this.$router.resolve(this.to).route.meta.label(this.$router.resolve(this.to).route):this.$router.resolve(this.to).route.meta.label},submenuComputed(){return this.submenu.reduce(((e,t)=>{const i=t.links.filter((e=>!0===sbe(this.$router.resolve(e.to).route).visible)).map((e=>({...e,label:(()=>null!=e.label?e.label:"function"===typeof this.$router.resolve(e.to).route.meta.label?this.$router.resolve(e.to).route.meta.label(this.$router.resolve(e.to).route):this.$router.resolve(e.to).route.meta.label)()})));return i.length<1?[...e]:[...e,{headline:t.headline,links:i}]}),[])},hasSubmenu(){return this.submenuComputed.length>0}},mounted(){this.$root.$on("navbar::closeAllSubmenus",this.closeSubmenu)},methods:{linkClick(e,t=!1){null!=e&&null!=e.currentTarget&&e.currentTarget.blur(),t?this.submenuOpen?this.closeSubmenu():this.openSubmenu():this.$emit("navigationLinkClicked")},openSubmenu(){null!=this.closeSubmenuTimeout&&clearTimeout(this.closeSubmenuTimeout),this.submenuOpen=!0},closeSubmenu(){null!=this.closeSubmenuTimeout&&clearTimeout(this.closeSubmenuTimeout),this.submenuOpen=!1},onMouseEnter(){this.isMobile()||this.openSubmenu()},async onMouseLeave(){this.isMobile()||(this.hasSubmenu?(await new Promise((e=>{this.closeSubmenuTimeout=setTimeout(e,400)})),this.closeSubmenu()):this.closeSubmenu())},onFocus(){this.isMobile()||this.openSubmenu()},onBlur(){this.isMobile()||this.closeSubmenu()},isMobile(){return window.matchMedia("(max-width: 767px)").matches}}},lbe=obe,dbe=(0,ew.Z)(lbe,XC,QC,!1,null,"33105e58",null),cbe=dbe.exports;ow.vI.add(uw.qmU,uw.Rpv,uw.rtB,uw.Fuz,uw.m08,uw.J9Y,uw.UJf,uw.L4e,uw.OS1,uw.fix,uw.sq$,uw.w9z,uw.b7W,uw.FR9,uw.OFe,uw.Wx7,uw.cNd,uw.iV1,uw.qLl,lw.xiG,lw.NBC,lw.cwv,lw.r9b,uw.EfQ,iC.emM);var ube={name:"TheNavbar",components:{DebugComponentWrapper:dC,IconBase:fC,IconLogo:CC,NavbarItem:cbe,MetaNav:JC}
1,data(){return{baseUrl:M,availableFeatures:Hr,showNavbar:!0}},created(){const e=this.$route.query;e.openedInMobileApp&&(this.showNavbar=!1)},computed:{expanded(){return this.$store.state.navbar.expanded},sharedFieldsEnabled(){return this.$store.getters.currentCompaniesHaveFeatureEnabled(Hr.FEATURE_FIELDS_SHARED)}},methods:{toggleNavbarVisibility(e){this.$store.commit("toggleNavbar"),null!=e&&null!=e.currentTarget&&e.currentTarget.blur(),this.$refs.navbarBottom.scrollTop=0,this.$root.$emit("navbar::closeAllSubmenus")},onNavigationLinkClicked(){window.matchMedia("(max-width: 767px)").matches&&this.toggleNavbarVisibility()}}},pbe=ube,hbe=(0,ew.Z)(pbe,eC,tC,!1,null,"28637e50",null),mbe=hbe.exports,fbe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pagebar"},[e.satellite.expanded?e._e():t("Tabs",{attrs:{tabs:e.tabs}}),e.satellite.available?t("TheSatelliteActions"):e._e()],1)},gbe=[],ybe=function(){var e=this,t=e._self._c;return t("div",{class:e.satelliteState},[!0===e.satellite.visible?t("BButton",{staticClass:"expand-satellite text-dark",attrs:{variant:"link"},on:{click:e.expandSatellite}},[!0!==e.satellite.expanded?t("FontAwesomeIcon",{attrs:{icon:["fas","arrow-to-left"]}}):e._e(),!0===e.satellite.expanded?t("span",[e._v(e._s(e.$t("Verkleinern")))]):e.satellite.expandAvailable?t("span",[e._v(e._s(e.expandButtonLabel))]):e._e(),!0===e.satellite.expanded?t("FontAwesomeIcon",{attrs:{icon:["fas","arrow-to-right"]}}):e._e()],1):e._e(),t("span",{staticClass:"flex-grow-1"}),t("BButton",{staticClass:"toggle-satellite text-dark",attrs:{variant:"link"},on:{click:e.toggleSatellite}},[!0!==e.satellite.visible?t("FontAwesomeIcon",{attrs:{icon:["fas","arrow-to-left"]}}):e._e(),!0!==e.satellite.visible?t("span",[e._v(e._s(e.$t("Details anzeigen")))]):!0===e.satellite.visible?t("span",[e._v(e._s(e.$t("Schließen")))]):e._e(),!0===e.satellite.visible?t("FontAwesomeIcon",{attrs:{icon:["far","times"]}}):e._e()],1)],1)},vbe=[];ow.vI.add(uw.s87,uw._Iw,lw.xiG,lw.NBC);var bbe={name:"TheSatelliteActions",methods:{toggleSatellite(){this.satellite.visible&&this.satellite.expanded&&this.$store.commit("satellite/toggleExpand"),this.$store.commit("satellite/toggleVisibility")},expandSatellite(){this.$store.commit("satellite/toggleExpand")}},computed:{...(0,C.Se)(["satellite"]),satelliteState(){return[{"satellite-actions":!0},{"satellite-actions--full":this.satellite.expanded}]},expandButtonLabel(){return null==this.satellite.expandButtonLabel?this.$t("Details anzeigen"):this.satellite.expandButtonLabel}}},wbe=bbe,Cbe=(0,ew.Z)(wbe,ybe,vbe,!1,null,"6be72a60",null),Fbe=Cbe.exports,Abe={name:"ThePagebar",components:{Tabs:mte,TheSatelliteActions:Fbe},computed:{...(0,C.Se)(["satellite"]),tabs(){let{tabs:e}=this.$route.meta;return"function"===typeof e&&(e=e(this.$route)),Array.isArray(e)?e.map((e=>{const{route:t}=this.$router.resolve({name:e});let i=e;if(null!=t.meta&&("string"===typeof t.meta.labelTab?i=t.meta.labelTab:"function"===typeof t.meta.labelTab?i=t.meta.labelTab(this.$route):"string"===typeof t.meta.label?({label:i}=t.meta):"function"===typeof t.meta.label&&(i=t.meta.label(this.$route))),0===t.matched.length){const t=e.split("-");return"button"===t[0]?{type:"text",label:t[1],onClick:()=>window.open(`/${t[2]}`,"_blank")}:{type:"text",label:i,tooltip:this.$t("Demnächst verfügbar")}}return{type:"route",label:i,route:t}})):[]}},methods:{}},kbe=Abe,Sbe=(0,ew.Z)(kbe,fbe,gbe,!1,null,"4910430d",null),Ebe=Sbe.exports,Ibe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"topbar"},[t("div",[null!=e.$route.meta.back&&"function"===typeof e.$route.meta.back.label?t("BLink",{staticClass:"topbar__back-link text-black",attrs:{to:e.$route.meta.back.to}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"long-arrow-left"}}),e._v(e._s(e.$route.meta.back.label())+" ")],1):e._e(),null!=e.$route.meta.back&&"string"===typeof e.$route.meta.back.label?t("BLink",{staticClass:"topbar__back-link text-black",attrs:{to:e.$route.meta.back.to}},[t("FontAwesomeIcon",{staticClass:"mr-2",attrs:{icon:"long-arrow-left"}}
1),e._v(e._s(e.$route.meta.back.label)+" ")],1):e._e(),t("h1",{staticClass:"position-relative"},[e._v(" "+e._s(e.title)+" "),t("DebugInstanceBadge")],1),"function"===typeof e.$route.meta.subheader?t("p",{staticClass:"topbar__subheader m-0"},[e._v(" "+e._s(e.$route.meta.subheader())+" ")]):e._e(),"string"===typeof e.$route.meta.subheader?t("p",{staticClass:"topbar__subheader m-0"},[e._v(" "+e._s(e.$route.meta.subheader)+" ")]):e._e()],1),t("MetaNav",{staticClass:"topbar__meta-nav"})],1)},_be=[];ow.vI.add(uw.qmU,uw.ILF,uw.jLD,uw.Fuz,uw.m08,uw.sE5,lw.sq$,uw.FU$,uw.sqG);var Dbe={name:"TheTopbar",components:{MetaNav:JC,DebugInstanceBadge:dW},computed:{title(){return"string"===typeof this.$route.meta.label?this.$route.meta.label:"function"===typeof this.$route.meta.label?this.$route.meta.label(this.$route):"FARMDOK"}}},Mbe=Dbe,Pbe=(0,ew.Z)(Mbe,Ibe,_be,!1,null,"fa567a34",null),Tbe=Pbe.exports;window.FARMDOK={tables:{}};var xbe={name:"app",components:{LoadingGlobal:pJ,PageNoMultiCompanySupport:Qw,TheNavbar:mbe,TheTopbar:Tbe,ThePagebar:Ebe},computed:{...(0,C.Se)({initialFetching:"auth/initialFetching"}),hasTabs(){let{tabs:e}=this.$route.meta;return"function"===typeof e&&(e=e(this.$route)),Array.isArray(e)&&e.length>=1},navbarExpanded(){return this.$store.state.navbar.expanded},isFullscreen(){return this.$route.meta.isFullscreen},noMultiCompanySupport(){return this.$store.state.auth.currentCompanies.length>1&&this.$route.meta.noMultiCompany}},provide:{googleMapsSettings:X},watch:{navbarExpanded:{handler(e){e?document.body.classList.add("navbar-expanded"):document.body.classList.remove("navbar-expanded")},immediate:!0}},mounted(){"1"==={VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"}.VUE_APP_EXPOSE&&(window.FARMDOK.app=this,window.FARMDOK.store=this.$store),window.addEventListener("resize",Xl()(this.calculateVh)),this.calculateVh()},methods:{calculateVh(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${e}px`)}}},Bbe=xbe,Obe=(0,ew.Z)(Bbe,Wb,Zb,!1,null,"0bf81a44",null),$be=Obe.exports;const Rbe=[],Nbe={};class zbe{constructor(e){this.options={authServiceUri:null,onLoggedOut(){},onAccessTokenRefresh(){},debuggingEnabled:!1},this.setOptions(e),null!=this.options.authServiceUri?(Rbe.push(this),this.TOKEN_STORAGE_KEY=Symbol("TOKEN_STORAGE_KEY"),this.EXPIRATION_TIMESTAMP_KEY=`jwtAuth_accessTokenExpiration_${Rbe.indexOf(this)}`,this.LOGOUT_KEY=`jwtAuth_logout_${Rbe.indexOf(this)}`,this.ignoreLocalStorageExpiration=!1,this.tokenLifetime=null,this.checkAccessToken=this.checkAccessToken.bind(this),this.syncLogout=this.syncLogout.bind(this)):console.error("JwtAuth: authServiceUri not provided")}setOptions(e){this.options={...this.options,...e},null!=e.authServiceUri&&(this.options.authServiceUri=this.options.authServiceUri.replace(/\/$/,""))}async initTokenChecking(){return window.removeEventListener("focus",this.checkAccessToken),window.removeEventListener("storage",this.syncLogout),window.addEventListener("focus",this.checkAccessToken),window.addEventListener("storage",this.syncLogout),this.checkAccessToken()}async login(e,t){const i=await this.requestRefreshToken(e,t);return"success"!==i.status||await this.initTokenChecking(),i}async loginOneTime(e){const t={version:"1.0",data:{oneTimeToken:e}};let i;try{const e=await l().post(`${this.options.authServiceUri}/loginOneTime`,t,{withCredentials:!0});({data:i}=e),this.debugLog("loginOneTime response:",i)}catch(a){null!=a&&null!=a.response&&null!=a.response.data&&({data:i}=a.response)}return null==i||"success"!==i.status?null==i||"error"!==i.status||null==i.errorCode?{status:"error",errorCode:"unknownError"}:i:(this.handleNewAccessToken(i.data.access_token),i)}async logout(){const{data:e}=await l().get(`${this.options.authServiceUri}/logout`,{withCredentials:!0});return this.handleNewAccessToken(null),"success"!==e.status?"error"!==e.status||null==e.errorCode?{status:"error",errorCode:"unknownError"}:e:(localStorage.setItem(this.LOGOUT_KEY,`${Date.now()}`),{status:"success"})}syncLogout(e){e.key===this.LOGOUT_KEY&&(this.debugLog("syncLogout"),this.handleNewAccessToken(null))}async requestRefreshToken(e,t){const i={version:"1.0",data:{email:e,password:t}};let a;try{const e=await l().post(`${this.options.authServiceUri}/login`,i,{withCredentials:!0});({data:a}=e),this.debugLog("requestRefreshToken response:",a)}catch(n){null!=n&&null!=n.response&&null!=n.response.data&&({data:a}=n.response)}return null==a||"success"!==a.status?null==a||"error"!==a.status||null==a.errorCode?{status:"error",errorCode:"unknownError"}:a:(this.handleNewAccessToken(a.data.access_token),a)}async requestAccessToken(){const{data:e}=await l().get(`${this.options.authServiceUri}/refresh`,{withCredentials:!0});return this.debugLog("requestAccessToken response:",e),"success"!==e.status?"error"!==e.status||null==e.errorCode?{status:"error",errorCode:"unknownError"}:e:(this.handleNewAccessToken(e.data.access_token),{status:"success"})}handleNewAccessToken(e){if(Nbe[this.TOKEN_STORAGE_KEY]=e,null!=e){const t=this.constructor.getExpirationTimeFromToken(e);this.tokenLifetime=t-(new Date).getTime();const i=this.constructor.getDataFromToken(e);localStorage.setItem(this.EXPIRATION_TIMESTAMP_KEY,JSON.stringify(t)),this.options.onAccessTokenRefresh.call(null,i)}else localStorage.removeItem(this.EXPIRATION_TIMESTAMP_KEY),this.loggedOut()}static getExpirationTimeFromToken(e){const t=(0,m.Z)(e);return 1e3*parseInt(t.exp,10)}static getDataFromToken(e){const t=(0,m.Z)(e);return t.data}async checkAccessToken(){if(window.Cypress)return!1;let e;if(null!=this.checkAccessTokenTimeout&&clearTimeout(this.checkAccessTokenTimeout),this.debugLog("Checking for existing access token."),null!=Nbe[this.TOKEN_STORAGE_KEY]){const t=Nbe[this.TOKEN_STORAGE_KEY];e=this.constructor.getExpirationTimeFromToken(t)}else this.ignoreLocalStorageExpiration||(e=JSON.parse(localStorage.getItem(this.EXPIRATION_TIMESTAMP_KEY)));const t=null!=this.tokenLifetime?Math.max(this.tokenLifetime/5,6e4):6e4,i=Math.min(t/6,3e4);if(null!=e&&(new Date).getTime()<e-t)return this.debugLog(`Token existing, will check again in ${Math.round(i/1e3)}s.`),this.checkAccessTokenTimeout=setTimeout(this.checkAccessToken,i),!0;this.debugLog("No token found or token expired."),this.debugLog("Requesting new token now.");const a=await this.requestAccessToken();return"success"===a.status?(this.debugLog(`New token acquired, will check again in ${Math.round(i/1e3)}s.`),this.checkAccessTokenTimeout=setTimeout((()=>this.checkAccessToken()),i),!0):(this.debugLog("Access token could not be retrieved."),this.checkAccessTokenTimeout=setTimeout((()=>this.checkAccessToken()),i),this.loggedOut(),!1)}
1loggedOut(){this.debugLog("Call onLoggedOut callback."),this.options.onLoggedOut.call()}debugLog(...e){if(!0!==this.options.debuggingEnabled)return;const t=(new Date).toLocaleTimeString();console.log(t,...e)}}class Lbe extends zbe{constructor(...e){super(...e),this.ignoreLocalStorageExpiration=!0}getAccessToken(){return Nbe[this.TOKEN_STORAGE_KEY]}}function Vbe(e,t){const i={...e};let a=i[t];return a.includes("{")?(null!=i.VUE_APP_ORIGIN&&""!==i.VUE_APP_ORIGIN||(i.VUE_APP_ORIGIN=`${window.location.protocol}//${window.location.hostname}`),a=a.replace(/\{([a-zA-Z0-9_]+)(\.([A-Za-z]+))?\}/g,((e,t,a,n)=>{if(null==n)return i[t];const r=new URL(i[t]);return r[n]})),a):a}const Ube=(()=>"object"===typeof window.FD&&"string"===typeof window.FD.jwtAuthServerUri&&window.FD.jwtAuthServerUri.length>0?window.FD.jwtAuthServerUri:Vbe({VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"},"VUE_APP_AUTH_ORIGIN"))(),jbe=new Lbe({authServiceUri:Ube,async onAccessTokenRefresh(e){if(!0!==Lb.state.auth.loggedIn&&Lb.commit("auth/setLoggedIn",{userId:e.user_id}),"login"===Vl.currentRoute.name||"register"===Vl.currentRoute.name&&!Lb.state.auth.fetchingRegister){let e={name:"home"};if("string"===typeof Vl.currentRoute.query.redirect&&Vl.currentRoute.query.redirect.length>0){const t=Vl.resolve(Vl.currentRoute.query.redirect);if(null==t||null==t.resolved||"404"===t.resolved.name)return Lb.commit("redirectToAgriDat"),void(window.location=`${P}${Vl.currentRoute.query.redirect}`);e=t.resolved}Vl.push(e).catch((()=>{}))}Lb.commit("auth/setJwtAuth",{}),Lb.commit("auth/setJwtAuth",jbe)},onLoggedOut(){!1!==Lb.state.auth.loggedIn&&Lb.commit("auth/setLoggedOut"),Vl.currentRoute.meta.requiresAuth&&Vl.push({name:"login"}).catch((()=>{}))}});Lb.commit("auth/setJwtAuth",jbe);var Hbe=i(12954),Gbe=i(34479);(0,Hbe.UF)("passive"),b["default"].component("ValidationObserver",Hbe._j),b["default"].component("ValidationProvider",Hbe.d_),(0,Hbe.l7)("length",Gbe.kE),(0,Hbe.l7)("min",Gbe.VV),(0,Hbe.l7)("email",{...Gbe.Do,message:b["default"].i18n.translate("Die E-Mail-Adresse ist ungültig.")}),(0,Hbe.l7)("min",{validate:(e,{length:t})=>e.length>=t,params:["length"],message:b["default"].i18n.translate("{field} muss mindestens {length} Zeichen lang sein.",{field:"{_field_}",length:"{length}"})}),(0,Hbe.l7)("required",{...Gbe.C1,message:b["default"].i18n.translate("{field} ist ein Pflichtfeld.",{field:"{_field_}"})}),(0,Hbe.l7)("FormFieldDropdownRequired",{validate:e=>null!=e&&null!=e.id,message:b["default"].i18n.translate("{field} ist ein Pflichtfeld.",{field:"{_field_}"})}),(0,Hbe.l7)("errorBackend",{computesRequired:!0,validate(e,{message:t}){return t},params:["message"]});var Wbe={install(e,{axiosInstance:t,store:i}){const a=new Pt(void 0,`${P}/rest`,t),n=new Rt(void 0,`${P}/rest`,t),r=new Lt(void 0,`${P}/rest`,t),s=new Wt(void 0,`${P}/rest`,t),o=new Xt(void 0,`${P}/rest`,t),l=new ti(void 0,`${P}/rest`,t),d=new Fi(void 0,`${P}/rest`,t),c=new bi(void 0,`${P}/rest`,t),u=new ci(void 0,`${P}/rest`,t),p=new _i(void 0,`${P}/rest`,t),h=new Ri(void 0,`${P}/rest`,t),m=new Bi(void 0,`${P}/rest`,t),f=new hi(void 0,`${P}/rest`,t),g=new oi(void 0,`${P}/rest`,t),y=new jt(void 0,`${P}/rest`,t),v=new Bt(void 0,`${P}/rest`,t),b=new ni(void 0,`${P}/rest`,t),w=new Li(void 0,`${P}/rest`,t),C=new Pi(void 0,`${P}/rest`,t),F=new Wi(void 0,`${P}/rest`,t),A=new ji(void 0,`${P}/rest`,t),k=new qt(void 0,`${P}/rest`,t),S=new Si(void 0,`${P}/rest`,t),E=new gi(void 0,`${P}/rest`,t),I={activitiesApi:a,applicationMapsApi:n,bbchApi:r,cultivationPlanApi:s,equipmentsApi:o,fertilizationPlanApi:l,productsApi:d,productCategoriesApi:c,pestsApi:u,ruleCheckApi:p,storagePlacesApi:h,stockMovementsApi:m,plantVarietiesApi:f,plantVarietiesWorkflowSeedingApi:E,mapApi:g,cnhApi:y,activityImportApi:v,fieldsApi:b,tracksApi:w,sen4Api:C,weatherApi:F,uploadApi:A,daturaApi:k,psmStatsApi:S};e.prototype.$api=I,i.$api=I}};const Zbe=l().create();Zbe.interceptors.request.use((e=>{const t=Lb.getters["auth/accessToken"]();return t?{...e,headers:{...e.headers,Authorization:`Bearer ${t}`}}:e}));var Kbe=Zbe,qbe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ModalWrapper",{ref:"modal",attrs:{title:e.title,"ok-title":e.okTitle,"ok-variant":e.okVariant}},[t("p",{staticClass:"mt-3 mb-3"},[e._v(" "+e._s(e.message)+" ")])])},Ybe=[],Jbe=(0,b.defineComponent)({name:"VueConfirmDialog",components:{ModalWrapper:OC},data(){return{clicked:!1}},computed:{title(){return"string"===typeof this.$root.dialogData.data.title?this.$root.dialogData.data.title:this.$t("Achtung")??"Achtung"},message(){return"string"===typeof this.$root.dialogData.data.message?this.$root.dialogData.data.message:this.$t("Aktion sicher ausführen?")??"Aktion sicher ausführen?"},okTitle(){if("string"===typeof this.$root.dialogData.data.okTitle)return this.$root.dialogData.data.okTitle},okVariant(){if("string"===typeof this.$root.dialogData.data.okVariant)return this.$root.dialogData.data.okVariant}},methods:{show(){return this.$refs.modal.show()}}}),Xbe=Jbe,Qbe=(0,ew.Z)(Xbe,qbe,Ybe,!1,null,"8297cf6c",null),ewe=Qbe.exports;const twe=()=>({title:null,message:null}),iwe={data:twe()};class awe{install(e){const t=new e({data:{dialogData:iwe},render:e=>e(ewe)});t.$mount(document.body.appendChild(document.createElement("div")));const i=async e=>(iwe.data=twe(),"string"===typeof e?iwe.data.message=e:null!=e&&(iwe.data={...e}),t.$children[0].show());e.prototype.$confirm=i}}var nwe=new awe;class rwe extends Bu.Z.editors.NumericEditor{init(){super.init()}prepare(e,t,i,a,n,r){super.prepare(e,t,i,a,n,r)}getValue(){const e=super.getValue(),t=rS(e);return t}}var swe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"date-editor"},[t("Datepicker",{ref:"datepicker",style:{border:0},attrs:{value:e.selectedDate,"calendar-class":"datepicker-calendar",inline:!0,"monday-first":!0},on:{selected:e.setDate}}),e.showTimePicker?t("div",{staticClass:"date-editor__time-picker"},[t("FormFieldInput",{attrs:{type:"time",value:e.selectedTime,variant:"vertical",placeholder:e.$t("hh:mm"),label:e.$t("Startzeit")},on:{update:e.setTime}}
1)],1):e._e()],1)},owe=[];const lwe=/^([01]\d|2[0-3]):([0-5]\d)$/;var dwe={name:"DateEditor",data(){return{selectedDate:null,selectedTime:"",showTimePicker:!1}},components:{Datepicker:iS.Z,FormFieldInput:fk},methods:{setDateTime(e,t=!1){if(this.showTimePicker=t,null==e&&!t)return this.selectedDate=null,void(this.selectedTime="");const i=null==e?new Date:new Date(e);this.selectedDate=i,this.selectedTime=this.formatTime24h(i)},setDate(e){null!=e&&(this.selectedDate=this.showTimePicker?this.withSelectedTime(e):e,this.$emit("input",this.selectedDate))},setTime(e){const t="string"===typeof e?e:e?.target?.value,i=this.parseTime(t);if(!i)return;this.selectedTime=t;const a=null==this.selectedDate?new Date:this.selectedDate;this.selectedDate=this.withSelectedTime(a),this.$emit("input",this.selectedDate)},withSelectedTime(e){const t=this.parseTime(this.selectedTime);if(!t)return new Date(e);const i=new Date(e);return i.setHours(t.hours,t.minutes,0,0),i},parseTime(e){if("string"!==typeof e||!lwe.test(e))return null;const[t,i]=e.split(":").map((e=>Number(e)));return{hours:t,minutes:i}},formatTime24h(e){const t=`${e.getHours()}`.padStart(2,"0"),i=`${e.getMinutes()}`.padStart(2,"0");return`${t}:${i}`}}},cwe=dwe,uwe=(0,ew.Z)(cwe,swe,owe,!1,null,null,null),pwe=uwe.exports;class hwe extends Bu.Z.editors.NumericEditor{init(){super.init()}prepare(e,t,i,a,n,r){super.prepare(e,t,i,a,n,r);const s="datetime"===r.type,o=null==n||Number.isNaN(n)?null:new Date(1e3*Number(n));this.dropdown.$children[0].setDateTime(o,s)}createElements(){super.createElements();const e=this.TEXTAREA_PARENT.appendChild(document.createElement("div"));this.dropdown=new b["default"]({render:e=>e(pwe)}).$mount(e),this.dropdown.$children[0].$on("input",(e=>{e instanceof Date&&!Number.isNaN(e.getTime())&&(this.setValue(Math.floor(e.getTime()/1e3)),"datetime"!==this.cellProperties.type&&this.finishEditing(!1))})),this.dropdown.$children[0].$on("hidden",(()=>{this.finishEditing(!0)}))}open(){super.open(),this.TEXTAREA_PARENT.firstChild.style.display="none",this.TEXTAREA_PARENT.style.height=`${this.TD.clientHeight+1}px`,this.TEXTAREA_PARENT.style.backgroundColor="white"}finishEditing(e,t,i){null==this.getValue()||0===this.getValue().length||"STATE_EDITING"===this.state&&Number(this.getValue())===this.originalValue?super.finishEditing(!0,t,i
1):super.finishEditing(e,t,i)}close(){super.close(),this.TEXTAREA_PARENT.firstChild.style.display="block",this.hot.listen()}}class mwe extends Bu.Z.editors.TextEditor{init(){super.init(),this.dropdownItems={data:[],loading:!0,selected:{id:null,name:""}},this.dropdownComparableItem={category:null,value:null},this.dropdownBoundary=null}prepare(e,t,i,a,n,r){super.prepare(e,t,i,a,n,r),"function"===typeof r.getDropdownBoundary&&(this.dropdownBoundary=r.getDropdownBoundary());const s=r.getRendererValue({value:n,visualRow:e,instance:this.instance}),o={id:n,name:s};b["default"].set(this.dropdownItems,"data",[]),b["default"].set(this.dropdownItems,"loading",!0),b["default"].set(this.dropdownItems,"selected",o);const l=+new Date;this.getItemsToken=l,r.getItems(e,this.instance).then((e=>{this.getItemsToken===l&&(b["default"].set(this.dropdownItems,"data",e),b["default"].set(this.dropdownItems,"loading",!1))})),null!=r.dropdownComparableItem?(b["default"].set(this.dropdownComparableItem,"category",r.dropdownComparableItem.category),b["default"].set(this.dropdownComparableItem,"value",r.dropdownComparableItem.value)):(b["default"].set(this.dropdownComparableItem,"category",null),b["default"].set(this.dropdownComparableItem,"value",null))}createElements(){super.createElements();const e=this.TEXTAREA_PARENT.appendChild(document.createElement("div")),t={dropdownItems:this.dropdownItems,dropdownComparableItem:this.dropdownComparableItem,dropdownVariant:"table-editor",dropdownBoundary:()=>null==this.dropdownBoundary?window:this.dropdownBoundary};this.dropdown=new b["default"]({render:e=>e(nk),provide:t}).$mount(e),this.dropdown.$children[0].$on("select",(e=>{b["default"].set(this.dropdownItems,"selected",e),this.setValue(e.id),this.finishEditing(!1)})),this.dropdown.$children[0].$on("close",(()=>{this.finishEditing(!0)}))}open(){super.open(),this.TEXTAREA_PARENT.getElementsByClassName("handsontableInput")[0].style.display="none",this.TEXTAREA_PARENT.style.width=`${this.TD.clientWidth}px`,this.TEXTAREA_PARENT.style.zIndex="200",this.dropdown.$children[0].open()}finishEditing(e,t,i){null==this.getValue()||"STATE_EDITING"===this.state&&this.getValue()===this.originalValue?super.finishEditing(!0,t,i
1):super.finishEditing(e,t,i)}close(){this.TEXTAREA_PARENT.style.removeProperty("z-index"),this.TEXTAREA_PARENT.getElementsByClassName("handsontableInput")[0].style.display="block",this.dropdown.$children[0].close(),super.close(),this.hot.listen()}}function fwe(e,t,i,a,n,r,s){Bu.Z.renderers.CheckboxRenderer(e,t,i,a,n,r,s),t.innerHTML="",t.classList.add("button-cell");const o=b["default"].extend(gw),l=new o({propsData:{size:"sm",color:"white",icon:"trash-alt",iconOnly:!0}});l.$mount(),l.$on("click",(()=>{s.onClick(i)})),e.addHook("beforeKeyDown",(t=>{const n=e.getSelected();n&&n[0][0]===i&&n[0][1]===a&&"Enter"===t.key&&s.onClick(i)})),t.appendChild(l.$el),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s])}const{fastInnerHTML:gwe}=Bu.Z.dom;function ywe(e,t,i,a,n,r,s,...o){if(Bu.Z.renderers.getRenderer("base")(e,t,i,a,n,r,s,...o),s.required&&(null==r||Number.isNaN(r)))return void bF.apply(this,[e,t,i,a,n,r,s,...o]);let l=r;null==r&&null!=s.placeholder&&(l=s.placeholder);const d="datetime"===s.type;l=xu(l,d),s.required&&b["default"].set(s,"valid",!!l),gwe(t,l),s.readOnly&&vF.apply(this,[e,t,i,a,n,l,s,...o]),IB(t,i,e)}function vwe(e,t,i,a,n,r,s,...o){if(s.required&&null==r)return void bF.apply(this,[e,t,i,a,n,r,s,...o]);const l=s.getRendererValue({value:r,visualRow:i,instance:e});if(Bu.Z.renderers.AutocompleteRenderer(e,t,i,a,n,l,s),s.readOnly&&t.classList.add("read-only"),wF(t,l),!s.showNotification)return;let d=t.querySelector("span.hot-floating-cell-icon");null==d&&(d=document.createElement("span")),d.className="hot-floating-cell-icon hot-floating-cell-icon--plain hot-floating-cell-icon--dropdown",d.innerHTML="";const[c]=(0,ow.qv)({prefix:"fal",iconName:"exclamation-circle"}).node;d.append(c),d.onmouseover=()=>s.hoverNotification({visualRow:i,target:d}),t.classList.add("hot-cell-with-floating-cell-icon"),t.classList.add("hot-cell-with-floating-cell-icon--dropdown"),t.append(d)}function bwe(e,t,i,a,n,r,s,...o){Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,b["default"].i18n.translate("#FEHLER"),s,...o])}ow.vI.add(a_.RLE);var wwe,Cwe=function(){var e=this,t=e._self._c;return t("span",{staticClass:"bg-white border text-dark number-indicator",attrs:{"data-cy":"number-indicator-body"},on:{click:e.onClick}},[e._v(" "+e._s(e.value)+" ")])},Fwe=[],Awe={props:{value:{type:Number,required:!0},onClick:{type:Function,required:!1}}},kwe=Awe,Swe=(0,ew.Z)(kwe,Cwe,Fwe,!1,null,null,null),Ewe=Swe.exports,Iwe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"subTableContainer",style:{height:`${e.tableHeight}px`},on:{dblclick:e.onParentCellDoubleClick}},[0===e.subTableData.length||e.expanded?t("TableBase",{ref:"table",staticClass:"hot-no-gridlines",attrs:{id:e.id,"table-settings":e.subTableSettings,"table-data":e.tableDataComputed,loading:!1},on:{"update:cell":e.updateCell,tableMounted:e.subTableMounted,"remove:row":t=>e.removeRow(t)}}):e._e(),!e.newRowEditorActive&&e.subTableData.length>0&&e.expanded?t("ButtonLink",{staticClass:"text-small button-add-product",style:{top:e.tableHeight-35+"px"},on:{click:t=>e.addButtonClicked(t)}},[e._v(e._s(e.addButtonTitle)+" ")]):e._e(),0!==e.subTableData.length||e.newRowEditorActive?e._e():t("div",{staticClass:"chevron-add-product",on:{click:t=>e.addButtonClicked(t)}},[e._v(" ▼ ")]),e.subTableData.length>=1&&!e.expanded?t("span",{staticClass:"td-text"},[e._v(" "+e._s(e.collapsedString)+" ")]):e._e()],1)},_we=[];(function(e){e["ArrowLeft"]="left",e["ArrowRight"]="right",e["ArrowUp"]="up",e["ArrowDown"]="down"})(wwe||(wwe={}));var Dwe=b["default"].extend({components:{TableBase:oD,ButtonLink:Fw},data(){return{hotInstance:null,tableInFocus:!1,clickedOutside:!1,preventSelection:!1,enablePropagation:!1,newRowEditorActive:!0}},mixins:[gD],props:{subTableData:{type:Array,default:()=>[]},subTableColumnDefinition:{type:Array,required:!0},columnKey:{type:String,required:!0},addButtonTitle:{type:String},expanded:{type:Boolean,default:!1}},computed:{collapsedString(){return this.subTableData.map((e=>e.displayName)).join(", ")},id(){return`hot-subtable-${this.columnKey}`},tableBounds(){return{rows:this.subTableData.length,columns:this.subTableColumnDefinition.length}},subTableSettings(){const e={afterOnCellMouseDown:e=>this.afterOnCellMouseDown(e),beforeKeyDown:e=>this.beforeKeyDown(e),afterSelectionEnd:(e,t)=>this.afterSelectionEnd(e,t),afterDeselect:()=>this.afterDeselect(),afterChange:()=>this.afterChange(),beforeOnCellMouseOver:e=>this.beforeOnCellMouseOver(e)};return{...this.tableSettings,height:`${this.tableHeight}px`,colHeaders:!1,observeChanges:!1,stretchH:"all",outsideClickDeselects:()=>!this.tableInFocus||(this.clickedOutside=!0,!0),...e}},tableDataComputed(){return this.subTableData.reduce(((e,t)=>({...e,[t.id]:t})),{})},tableHeight(){const e=41;let t=0;return this.subTableData?.length>0&&this.expanded&&(t=this.subTableData.length),(t+1)*e},tableRows(){return this.hotInstance?.countRows()||0},currentCellCoords(){if(!this.hotInstance)return null;const e=this.hotInstance.getSelected();return e?{row:e[0][0],col:e[0][1]}:null}},methods:{updateCell(e){const t=this.$refs.table?.guidToVisualRow(e.guid);this.$emit("updateCell",t,e),this.expanded||this.$emit("expand")},onParentCellDoubleClick(){this.expanded||(this.subTableData&&0!==this.subTableData.length?this.$emit("expand"):this.addButtonClicked(new MouseEvent("click")))},removeRow(e){this.$emit("remove:row",e)},selectParentTableCell(e){this.$emit("exitSubTable",e)},deselectParentTableCell(){this.$emit("deselectParentCell")},triggerMouseEvent(e,t){const i=document.createEvent("MouseEvent");
1i.initMouseEvent(e,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t.dispatchEvent(i)},selectFirstCell(){const e=this.hotInstance?.getCell(0,1);e&&this.triggerMouseEvent("mousedown",e)},nextCellOutsideBounds(e){return!!this.currentCellCoords&&("left"===e&&1===this.currentCellCoords.col&&0===this.currentCellCoords.row||("right"===e&&this.currentCellCoords.col===this.tableBounds.columns&&this.currentCellCoords.row===this.tableBounds.rows-1||("up"===e&&0===this.currentCellCoords.row||"down"===e&&this.currentCellCoords.row===this.tableBounds.rows-1)))},handleArrowKeys(e){const{key:t}=e;if(!Object.keys(wwe).includes(t))return;const i=wwe[t];this.nextCellOutsideBounds(i)&&(this.hotInstance?.deselectCell(),this.selectParentTableCell(i))},focusSubTableCell(e,t){if(this.enablePropagation)return void(this.enablePropagation=!1);this.tableInFocus=!0;const i=this.hotInstance?.getCell(e,t);i&&this.triggerMouseEvent("mousedown",i)},afterOnCellMouseDown(e){this.propagateToTarget(e.target)?this.enablePropagation=!0:this.tableInFocus&&e.stopPropagation()},propagateToTarget(e){const t=["htAutocompleteArrow"];if(!e)return!1;const i=e.classList;return t.some((e=>i.contains(e)))},beforeKeyDown(e){this.handleArrowKeys(e)},afterSelectionEnd(e,t){if(this.preventSelection)return this.hotInstance?.deselectCell(),this.clickedOutside=!1,void(this.preventSelection=!1);this.clickedOutside=!1,this.deselectParentTableCell(),this.tableInFocus||this.focusSubTableCell(e,t)},afterDeselect(){this.tableInFocus=!1},afterChange(){this.clickedOutside&&(this.preventSelection=!0),this.newRowEditorActive=!1},beforeOnCellMouseOver(e){e.stopImmediatePropagation()},subTableMounted(){this.hotInstance=this.$refs.table.hot},openCellEditor(e,t){this.newRowEditorActive=!0,this.hotInstance?.selectCell(e,t),this.hotInstance?.getActiveEditor()?.beginEditing()},addButtonClicked(e){e?.stopImmediatePropagation();const t=this.subTableData?.length||0;this.$refs.table.featureInsertRowCreateGuid(t),this.openCellEditor(t,1)},closeEditor(){this.newRowEditorActive&&this.hotInstance?.getActiveEditor()?.finishEditing()}},created(){this.columnDefinition=this.subTableColumnDefinition}}),Mwe=Dwe,Pwe=(0,ew.Z)(Mwe,Iwe,_we,!1,null,"9b043a14",null),Twe=Pwe.exports;const xwe=e=>{const t=e.getSelected();if(!t)return null;const i={row:t[0][0],col:t[0][1]},{type:a}=e.getCellMeta(i.row,i.col);return{coords:i,type:a}},Bwe=(e,t,i,a)=>{const n={left:{row:t,col:i-1},right:{row:t,col:i+1},up:{row:t>0?t-1:0,col:i},down:{row:t+1,col:i}};e&&n[e]&&a.selectCell(n[e].row,n[e].col)},Owe=(e,t,i,a,n)=>{const r=b["default"].extend(Twe),s=new r({propsData:{subTableData:e,subTableColumnDefinition:t.subTableColumns(a),columnKey:`${a}-${t.key}`,addButtonTitle:t.addButtonTitle,expanded:n}});return s.$mount(),i.appendChild(s.$el),s},$we=(e,t,i)=>{const a=b["default"].extend(Ewe),n=new a({propsData:{value:e.length,onClick:i}});n.$mount(),n.$el.classList.add("subtable__pill"),t.append(n.$el)};function Rwe(e,t,i,a,n,r,s){const o=t=>{const n=xwe(e);if(n&&"expand"===n.type&&i===n.coords.row&&a===n.coords.col){if(!1===t.isImmediatePropagationEnabled)return;t.stopImmediatePropagation(),s.toggleExpand(i)}};Bu.Z.renderers.CheckboxRenderer(e,t,i,a,n,r,s);const l=t.firstChild;let[d]=(0,ow.qv)({prefix:"fas",iconName:"chevron-down"}).node;r&&([d]=(0,ow.qv)({prefix:"fas",iconName:"chevron-up"}).node),t.classList.add("text-black"),t.classList.add("expand"),"function"===typeof s.expandableForRenderer&&s.expandableForRenderer(i)&&(t.insertBefore(d,l),e.addHook("beforeKeyDown",(e=>{"Enter"===e.key&&o(e)}))),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s])}ow.vI.add(uw.mTx,uw.ptq);const{fastInnerHTML:Nwe}=Bu.Z.dom;function zwe(e,t,i,a,n,r,s,...o){Bu.Z.renderers.getRenderer("base")(e,t,i,a,n,r,s,...o),"number"!==typeof r&&"string"!==typeof r||Nwe(t,r),t.classList.add("cell-footer","bg-lightest","border-top","border-right-0","text-bold"),b["default"].set(t.style,"height","30px")}function Lwe(e,t,i,a,n,r,s,...o){Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n," ",s,...o]);const l=document.createElement("span");l.classList.add("bg-lightest"),l.style.display="block",l.style.width="85%",l.style.height="21px",t.append(l)}const{isNumeric:Vwe}=Bu.Z.helper,{getRenderer:Uwe}=Bu.Z.renderers;function jwe(e,t,i,a,n,r,s,...o){let l=r;if(Vwe(l)){const{numericFormat:e}=s;let t=null;null!=e&&"string"===typeof e.culture&&(t=e.culture);let i="0";null!=e&&"string"===typeof e.pattern&&(i=e.pattern);let a="";"string"===typeof s.className&&({className:a}=s);const n=a.length?a.split(" "):[];if(null!=t&&!Bl().languages()[t]){const e=t.replace("-",""),i=Bl().allLanguages?Bl().allLanguages[t]:Bl()[e];i&&Bl().registerLanguage(i)}const r=Bl().language();null!=t&&Bl().setLanguage(t),l="number"===typeof s.decimalPlaces?Bl()(l).format({thousandSeparated:!0,mantissa:s.decimalPlaces}):Bl()(l).format(i),null!=r&&Bl().setLanguage(r),n.includes("htLeft")||n.includes("htCenter")||n.includes("htRight")||n.includes("htJustify")||n.push("htRight"),n.includes("htNumeric")||n.push("htNumeric"),s.className=n.join(" ")}Uwe("text")(e,t,i,a,n,l,s,...o),IB(t,i,e)}var Hwe=jwe;const Gwe=210;function Wwe(e,t,i,a,n,r,s,...o){const l=(t,n)=>{if("Enter"===t.key){const r=xwe(e);if(!r)return;"subtable"===r.type&&i===r.coords.row&&a===r.coords.col&&s.expanded(r.coords.row)&&(t.stopImmediatePropagation(),n.selectFirstCell(
1))}},d=(e,t)=>{const i=["dropdown__item","dropdown__select","base-search-term"],a=e.target.classList,n=i.some((e=>a.contains(e)));n||t?.closeEditor()},c=t=>{if(!s.expanded(i)){const n=xwe(e);n.coords.row===i&&n.coords.col===a&&(t?.stopImmediatePropagation(),s.toggleExpand(i))}},u=(e,t)=>t!==a?e:s.expanded(i)?Math.max(s.width,e):Math.max(Gwe,e);if(s.required&&("string"!==typeof r||0===r.length))return void bF.apply(this,[e,t,i,a,n,r,s,...o]);const p=s.getRendererValues({visualRow:i,visualCol:a});Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,p.map((e=>e.displayName)).join(", "),s,...o]),t.classList.add("subtable"),t.innerHTML="";const h=Owe(p,s,t,i,s.expanded(i));h.$on("updateCell",((e,t)=>{s.updateEntry(i,e,t)})),h.$on("remove:row",(e=>{s.removeRow(i,e)})),h.$on("deselectParentCell",(()=>{e.deselectCell()})),h.$on("exitSubTable",(t=>{Bwe(t,i,a,e)})),h.$on("expand",(()=>{c(null)})),e.addHook("beforeKeyDown",(e=>l(e,h))),e.addHook("beforeOnCellMouseDown",(e=>d(e,h))),e.addHook("modifyColWidth",((e,t)=>u(e,t))),p.length>1&&!s.expanded(i)&&$we(p||[],t,c),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o])}function Zwe(e,t,i,a,n,r,s,...o){if(s.required&&("string"!==typeof r||0===r.length))return void bF.apply(this,[e,t,i,a,n,r,s,...o]);const l=s.getToggleValues({value:r,visualRow:i});if(Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,l.join(", "),s,...o]),t.classList.add("table-toggle-renderer"),l.length>0){const e=document.createElement("span");e.classList.add("table-toggle-renderer__pill","bg-primary","text-white"),e.style.display="block",e.style.position="absolute",e.style.top="13px",e.style.right="20px",e.style.padding="0 9px",e.style.borderRadius="7px",e.style.lineHeight="1.2em",e.style.fontSize="13px",e.innerHTML=l.length,t.append(e)}s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o])}function Kwe(e,t,i,a,n,r,s,...o){if(s.required&&("string"!==typeof r||0===r.length))return void bF.apply(this,[e,t,i,a,n,r,s,...o]);const l="function"===typeof s.getRendererValue?s.getRendererValue({value:r,row:i}):r;wF(t,l),Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,r,s,...o]),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o]),IB(t,i,e)}function qwe(e,t,i,a,n,r,s,...o){Bu.Z.renderers.CheckboxRenderer(e,t,i,a,n,r,s,...o);const l=t.firstChild;let[d]=(0,ow.qv)({prefix:"far",iconName:"square"}).node;r===s.checkedTemplate?([d]=(0,ow.qv)({prefix:"far",iconName:"check-square"}).node,t.classList.add("text-black")):t.classList.add("text-medium"),t.classList.add("checkbox"),t.insertBefore(d,l),s.readOnly&&vF.apply(this,[e,t,i,a,n,r,s,...o]),IB(t,i,e)}function Ywe(e,t,i,a,n,r,s){Bu.Z.dom.empty(t),s.readOnly?vF(e,t,i,a,n):Bu.Z.renderers.BaseRenderer(e,t,i,a,n,r,s),s.editor=!1,IB(t,i,e),BB(t,i,s,e)}function Jwe(e,t,i,a,n,r,s,...o){if("function"===typeof s.renderNone&&s.renderNone(i,e))return Bu.Z.dom.empty(t),void(t.style.display="none");"function"===typeof s.renderEmpty&&s.renderEmpty(i,e)?Ywe(e,t,i,a,n,r,s):qwe(e,t,i,a,n,r,s,...o)}ow.vI.add(lw.pL1,lw.a3n);class Xwe extends Bu.Z.editors.NumericEditor{constructor(...e){super(...e),(0,tt.Z)(this,"amountUnitPair",void 0)}init(){super.init()}prepare(e,t,i,a,n,r){super.prepare(e,t,i,a,n?.amount,r),this.amountUnitPair=n}getValue(){const e=super.getValue(),t=rS(e);if(void 0===this.amountUnitPair)throw new Error("AmountUnitEditor.amountUnitPair is undefined, call prepare() first");return{...this.amountUnitPair,amount:t,isFixed:!0}}}function Qwe(e,t,i,a,n,r,s,...o){if(s.required&&null===r?.amount)return void bF(e,t,i,a,n,r,s,...o);const l=e.getDataAtRowProp(i,"product.productId"),d="number"===typeof s.decimalPlaces?s.decimalPlaces:s.getNDecimals(l),c="number"===typeof r?.amount?Bl()(r.amount).format({thousandSeparated:!0,mantissa:d}):"",u=r?.unitId?s.getUnitName(r.unitId)??"":"",p=r?.isFixed?"•":"",h=`${c} ${u} ${p}`;BB(t,i,s,e),IB(t,i,e),s.readOnly&&vF(e,t,i,a,n),Kwe(e,t,i,a,n,h,s,...o)}class eCe extends Bu.Z.editors.TextEditor{beginEditing(e,t){if(null==e&&Bu.Z.helper.isNumeric(this.originalValue)){const e=Ou(this.originalValue);super.beginEditing(e,t)}else super.beginEditing(e,t)}saveValue(e,t){const i=dS(e[0][0]);super.saveValue([[i]],t)}}function tCe(e,t,i,a,n,r,s,...o){if(s.required&&null==r)return void RequiredRenderer.apply(this,[e,t,i,a,n,r,s,...o]);const l=Ou(r);Bu.Z.renderers.TextRenderer.apply(this,[e,t,i,a,n,l,s,...o]),s.readOnly&&vF(e,t,i,a,n),IB(t,i,e)}function iCe(e,t,i,a,n,r,s){if(aCe(i,e,s))return Bu.Z.dom.empty(t),void(t.style.display="none");if(nCe(i,e,s))return void Ywe(e,t,i,a,n,r,s);if(rCe(i,r,e,s))return void Lwe(e,t,i,a,n,r,s);if("string"!==typeof s.type)throw new Error("cellProperties.type is not a string");const o=Bu.Z.renderers.getRenderer(s.type);o(e,t,i,a,n,r,s)}function aCe(e,t,i){return"function"===typeof i.renderNone&&i.renderNone(e,t)}function nCe(e,t,i){return"function"===typeof i.renderEmpty&&i.renderEmpty(e,t)}function rCe(e,t,i,a){return"function"===typeof a.renderLoading&&a.renderLoading(e,t,i)}function sCe(e,t,i,a,n,r,s,...o){Bu.Z.dom.empty(t);
1const[l]=(0,ow.qv)({prefix:"far",iconName:"circle-exclamation"}).node;t.appendChild(l),null!=s.warningIcon.onClick&&(t.style.cursor="pointer"),s.warningIcon.tooltipLabel&&(t.title=s.warningIcon.tooltipLabel);const d=oCe(s.warningIcon.color);l.classList.add(d),t.classList.add("warning-icon"),IB(t,i,e)}function oCe(e){switch(e){case"red":return"text-danger-dark";case"gray":return"text-gray-600";default:throw new Error(`Unsupported color: ${e}`)}}function lCe(e,t,i,a,n,r,s,...o){switch(r?.type){case kt.NotChecked:case yr.DUPLICATE:return dCe(s,"gray",r.tooltipLabel),void sCe(e,t,i,a,n,"",s,...o);case kt.Violation:case yr.INCOMPLETE:return dCe(s,"red",r.tooltipLabel),void sCe(e,t,i,a,n,"",s,...o);default:Bu.Z.dom.empty(t),IB(t,i,e)}}function dCe(e,t,i){e.warningIcon||(e.warningIcon={}),e.warningIcon.color=t,e.warningIcon.tooltipLabel=i}function cCe(e,t,i,a,n,r,s,...o){Bu.Z.dom.empty(t);const[l]=(0,ow.qv)({prefix:"fas",iconName:"trash-alt"}).node;t.appendChild(l),BB(t,i,s,e),IB(t,i,e),t.classList.add("trash-icon"),s.readOnly&&(vF(e,t,i,a,n),l.classList.add("opacity-35"),t.style.cursor="default")}ow.vI.add(lw.xHz),ow.vI.add(lw.xHz),ow.vI.add(uw.I7k),Bu.Z.cellTypes.registerCellType("checkbox",{renderer:qwe}),Bu.Z.cellTypes.registerCellType("farmdok.checkbox.optional",{renderer:Jwe}),Bu.Z.cellTypes.registerCellType("expand",{renderer:Rwe}),Bu.Z.cellTypes.registerCellType("date",{editor:hwe,renderer:ywe}),Bu.Z.cellTypes.registerCellType("datetime",{editor:hwe,renderer:ywe}),Bu.Z.cellTypes.registerCellType("dropdown",{editor:mwe,renderer:vwe}),Bu.Z.cellTypes.registerCellType("error",{renderer:bwe}),Bu.Z.cellTypes.registerCellType("footer",{renderer:zwe}),Bu.Z.cellTypes.registerCellType("loading",{renderer:Lwe}),Bu.Z.cellTypes.registerCellType("numeric",{editor:rwe,renderer:Hwe}),Bu.Z.cellTypes.registerCellType("text",{editor:Bu.Z.editors.TextEditor,renderer:Kwe}),Bu.Z.cellTypes.registerCellType("table",{renderer:Zwe}),Bu.Z.cellTypes.registerCellType("subtable",{renderer:Wwe}),Bu.Z.cellTypes.registerCellType("button",{renderer:fwe}),Bu.Z.cellTypes.registerCellType("farmdok.button",{renderer:EO}),Bu.Z.cellTypes.registerCellType("farmdok.expand",{renderer:UB}),Bu.Z.cellTypes.registerCellType("farmdok.dropdown",{editor:kB,renderer:OB}),Bu.Z.cellTypes.registerCellType("farmdok.subtablePrimaryColumn",{editor:kB,renderer:BO}),Bu.Z.cellTypes.registerCellType("farmdok.amountUnit",{editor:Xwe,renderer:Qwe}),Bu.Z.cellTypes.registerCellType("farmdok.collapsedSubtableRenderer",{renderer:TO}),Bu.Z.cellTypes.registerCellType("farmdok.warningIcon",{renderer:sCe}),Bu.Z.cellTypes.registerCellType("farmdok.trashIcon",{renderer:cCe}),Bu.Z.cellTypes.registerCellType("farmdok.ruleCheckStatus",{renderer:lCe}),Bu.Z.cellTypes.registerCellType("farmdok.duration",{editor:eCe,renderer:tCe}),Bu.Z.cellTypes.registerCellType("farmdok.placeholder",{renderer:Kwe}),Bu.Z.cellTypes.registerCellType("farmdok.empty",{renderer:Ywe}),Bu.Z.cellTypes.registerCellType("farmdok.optional",{renderer:iCe});i(88317);var uCe=i(15503);const pCe={apiKey:"AIzaSyDAHsKHKUlu7nvm_ojd0RsuwzR8OdqjxTM",authDomain:"farmdok-3ecc4.firebaseapp.com",databaseURL:"https://farmdok-3ecc4.firebaseio.com",projectId:"farmdok-3ecc4",storageBucket:"farmdok-3ecc4.appspot.com",messagingSenderId:"1097049611199",appId:"1:1097049611199:web:14d264da11647050b15f0a",measurementId:"G-LQ44VD5SG2"};uCe.Z.initializeApp(pCe);class hCe{constructor(e,t,i){this.instance=e,this.router=t,this.store=i,this.analytics=uCe.Z.analytics()}logEvent(e,t){this.analytics.logEvent(e,t)}}var mCe=hCe,fCe=i(88739),gCe=i.n(fCe);const yCe="RK8-84W-KR6Z";gCe().spa=!0,gCe().privacy.push({optOut:!1}),gCe().privacy.push({useIP:!1}),gCe().init(yCe),null!={VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"}.VUE_APP_CLEVERTAP_LOG_LEVEL&&gCe().setLogLevel({VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"}.VUE_APP_CLEVERTAP_LOG_LEVEL);class vCe{constructor(e,t,i){this.instance=e,this.router=t,this.store=i,this.clevertap=gCe(),this.init()}init(){this.store.subscribe((({type:e})=>{"auth/setLoggedIn"===e?this.onUserLogin():("auth/setUser"===e||"auth/updateUser"===e||"auth/updateCurrentCompany"===e)&&this.onSetUser()})),this.onUserLogin()}onUserLogin(){if(!this.store.state.auth.loggedIn)return;const e={Site:{Identity:this.store.state.auth.user.id}};this.clevertap.onUserLogin.push(e)}onSetUser(){if(!this.store.state.auth.loggedIn)return;let e;1===this.store.state.auth.userCompanies.length&&null!=this.store.state.auth.userCompanies[0].company&&null!=this.store.state.auth.userCompanies[0].company.tel&&(e=this.store.state.auth.userCompanies[0].company.tel);const t=this.store.state.auth.user.emailIsConfirmed&&!!this.store.state.auth.user.newsletter,i={Site:{Name:this.store.getters["auth/userName"],Identity:this.store.state.auth.user.id,Email:this.store.state.auth.user.email,Phone:e,newsletter:t,"MSG-email":!0}};this.clevertap.profile.push(i)}}var bCe=vCe;const wCe=["VueConfirmDialog"],CCe=()=>({field_count:0,total_hectares:0,crops:[]}),FCe=()=>({field_count:0,total_hectares:0,crop_year_name:null,crops:[]});class ACe{constructor(e,t,i){this.instance=e,this.router=t,this.store=i,this.analytics=new mCe(e,t,i),this.clevertap=new bCe(e,t,i)}init(){this.initGenericEvents(),this.initCustomEvents()}track(e,t){this.analytics.logEvent(e,t)}initGenericEvents(){this.instance.$on("modal-wrapper--shown",(e=>{wCe.some((t=>e.indexOf(t)>-1))||this.track("modal_show",{name:e})})),this.instance.$on("modal-wrapper--hidden",(e=>{wCe.some((t=>e.indexOf(t)>-1))||this.track("modal_hide",{name:e})})),this.instance.$on("the-satellite--shown",(e=>{this.track("satellite_show",{name:e})})),this.instance.$on("the-satellite--expanded",(e=>{this.track("satellite_expand",{name:e})})),this.instance.$on("the-satellite--shrunk",(e=>{this.track("satellite_shrink",{name:e})})),this.instance.$on("the-satellite--hidden",(e=>{this.track("satellite_hide",{name:e})})),this.instance.$on("button--click",(e=>{this.track("button_click",{name:e})})),this.router.afterEach((({name:e,path:t})=>{this.track("page_view",{name:e,path:t})}))}initCustomEvents(){this.newFields=CCe(),this.completedFields=FCe(),this.instance.$on("register--success",(e=>{const t={type:e.type,farmingSystem:e.farmingSystem,activityTypes:Array.isArray(e.activityTypes)?e.activityTypes.join(", "):"",crops:Array.isArray(e.crops)?e.crops.join(", "):"",goals:Array.isArray(e.goals)?e.goals.join(", "):""};null!=e.size&&null!=e.size.hectares&&(t.hectares=Number(e.size.hectares)),null!=e.size&&null!=e.size.employees&&(t.employees=Number(e.size.employees)),null!=e.size&&null!=e.size.customers&&(t.customers=Number(e.size.customers)),this.track("registration_completed",t)})),this.store.subscribe((({type:e,payload:t})=>{"fields/insert"===e?this.onFieldInsert(t):"fields/updateEntry"===e&&this.onFieldU
1pdate(t)})),this.store.subscribeAction({before:({type:e,payload:t})=>{"fields/updateAndSyncEntry"===e&&this.onBeforeUpdateField(t)}})}onFieldInsert({entry:e}){null!=e.name&&(clearTimeout(this.insertTimeout),this.newFields.field_count+=1,e.fieldSize>0&&(this.newFields.total_hectares+=e.fieldSize),null==e.cropId||null==this.store.state.products.crops.data[e.cropId]||this.newFields.crops.includes(this.store.state.products.crops.data[e.cropId].name)||this.newFields.crops.push(this.store.state.products.crops.data[e.cropId].name),this.insertTimeout=setTimeout((()=>this.logNewFields()),300))}onFieldUpdate({entry:e}){e.storeStatus===N&&this.onFieldInsert({entry:e})}logNewFields(){this.newFields.field_count<1||(this.track("fields_created",{...this.newFields,crops:this.newFields.crops.join(", ")}),this.newFields=CCe())}onBeforeUpdateField({entry:e}){if("completed"!==e.status||null==this.store.state.fields.data[e.id]||"completed"===this.store.state.fields.data[e.id].status)return;clearTimeout(this.completeTimeout);const t={...this.store.state.fields.data[e.id],...e};this.completedFields.field_count+=1,t.fieldSize>0&&(this.completedFields.total_hectares+=t.fieldSize),this.completedFields.crop_year_name=this.store.state.auth.currentProcessOrderName,null==t.cropId||null==this.store.state.products.crops.data[t.cropId]||this.completedFields.crops.includes(this.store.state.products.crops.data[t.cropId].name)||this.completedFields.crops.push(this.store.state.products.crops.data[t.cropId].name),this.completeTimeout=setTimeout((()=>this.logCompletedFields()),300)}logCompletedFields(){this.completedFields.field_count<1||(this.track("crop_year_completed",{...this.completedFields,crops:this.completedFields.crops.join(", ")}),this.completedFields=FCe())}}var kCe=ACe;rbe(),b["default"].config.productionTip=!1,b["default"].use(d.ZPm),b["default"].use(c.m$),b["default"].component("FontAwesomeIcon",s.GN),b["default"].component("BButton",u.T),b["default"].component("BTooltip",p.T),b["default"].use(v()),b["default"].use(nwe),b["default"].use(Wbe,{axiosInstance:Kbe,store:Lb}),Nl.setLanguage(Lb.state.locale),g().locale(Lb.state.locale),Lb.dispatch("checkLocale"),document.documentElement.lang=Lb.state.locale,l().defaults.baseURL=P,l().interceptors.request.use((e=>{if(0!==e.url?.indexOf("/admin/")||0===e.url.indexOf("/admin/rest")||0===e.url.indexOf("/admin/sen4")||0===e.url.indexOf("/admin/comp"))return e;if(1!==Lb.state.auth.currentCompanies.length||"number"!==typeof Lb.state.auth.currentCompanies[0].databaseId)throw new Error(`Missing company databaseId for deprecated AgriDat request: ${e.url}`);const{databaseId:t}=Lb.state.auth.currentCompanies[0];return{...e,url:`/admin/comp/${t}/${e.url.split("/admin/")[1]}`}})),l().interceptors.request.use((e=>{const t=Lb.getters["auth/accessToken"]();if(null==t||!e.url)return e;const i=(0,m.Z)(t),a=new URL(e.url,e.baseURL);return i.aud.includes(a.hostname)?{...e,headers:{...e.headers,Authorization:`Bearer ${t}`,"X-Process-Orders":JSON.stringify(Lb.getters["auth/currentProcessOrderIds"])}}:e})),l().interceptors.response.use((e=>e),(async e=>{throw e.response&&401===e.response.status&&Lb.dispatch("auth/logout"),e})),Lb.dispatch("auth/subscribe");const SCe=new b["default"]({router:Vl,store:Lb,render:e=>e($be)});window.Cypress&&(window.app=SCe),window.Buffer=window.Buffer||h.Buffer;const ECe=sessionStorage.getItem("farmdok-splash-animation-has-played"),ICe=null!=ECe?parseInt(ECe,10):0,_Ce=Math.max(ICe-(new Date).getTime(),0);if(setTimeout((()=>{SCe.$mount("#app")}),_Ce),"1"!=={VUE_APP_ORIGIN:"",VUE_APP_STANDALONE_ORIGIN:"",VUE_APP_AUTH_ORIGIN:"https://jwt.{VUE_APP_ORIGIN.hostname}",VUE_APP_BASEURL:"/farm/",VUE_APP_USE_GOOGLE_MAPS_API_KEY:"1",VUE_APP_TRACKING_USE_PRODUCTION_APP:"1",VUE_APP_IS_IN_AGRIDAT:"0",VUE_APP_START_PAGE:"fields",NODE_ENV:"production",BASE_URL:"/farm/"}.VUE_APP_DISABLE_TRACKING){const e=new kCe(SCe,Vl,Lb);e.init()}b["default"].use(c.m$)},94633:function(){},98969:function(e,t,i){var a={"./logo--cnh_industiral-black.svg":81547,"./no-content-activities.svg":13659};function n(e){var t=r(e);return i(t)}function r(e){if(!i.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=r,e.exports=n,n.id=98969},89467:function(e,t,i){var a={"./no-content-fields.svg":22190,"./no-content-files.svg":15305,"./no-content-partners.svg":3040,"./no-content-search.svg":76547};function n(e){var t=r(e);return i(t)}function r(e){if(!i.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=r,e.exports=n,n.id=89467},8538:function(e,t,i){var a={"./drop-file.svg":21675,"./map_marker_new.png":24052,"./ma
1p_marker_search_result.png":37475,"./map_marker_selected.png":7773,"./no-content-company.svg":6606,"./no-content-cropYear.svg":35008,"./no-content-search.svg":81592};function n(e){var t=r(e);return i(t)}function r(e){if(!i.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}n.keys=function(){return Object.keys(a)},n.resolve=r,e.exports=n,n.id=8538},81547:function(e,t,i){"use strict";e.exports=i.p+"img/logo--cnh_industiral-black.2923eb4e.svg"},13659:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-activities.feff9f2e.svg"},22190:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-fields.0791b40f.svg"},15305:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-files.3ffdc977.svg"},3040:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-partners.0791b40f.svg"},76547:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-search.4fd4f98f.svg"},21675:function(e,t,i){"use strict";e.exports=i.p+"img/drop-file.3ffdc977.svg"},6606:function(e,t,i){"use strict";
1e.exports=i.p+"img/no-content-company.0791b40f.svg"},35008:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-cropYear.82421675.svg"},81592:function(e,t,i){"use strict";e.exports=i.p+"img/no-content-search.4fd4f98f.svg"},24929:function(e,t,i){"use strict";e.exports=i.p+"img/JD_Logo_884x663.636669a7.png"},36808:function(e,t,i){"use strict";e.exports=i.p+"img/JD_Logo_884x663_Transparent.7e39d9ad.png"},47852:function(e,t,i){"use strict";e.exports=i.p+"img/JD_Tractor_Green.d16460c5.png"},95532:function(e,t,i){"use strict";e.exports=i.p+"img/case.bb33913e.png"},28206:function(e,t,i){"use strict";e.exports=i.p+"img/cnh_brand_pic_1.6b1afd8b.png"},2341:function(e,t,i){"use strict";e.exports=i.p+"img/nh.4176aa74.png"},66184:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAA0CAYAAAAjfRLqAAAYkElEQVR4nO2deWBTVdbAf++9vCRN2nRJSxcEWgq2pSyyyiJgAR1RxxEccQFcBpcZFXHQQUFGRNwX/BQ33FAcccEB2UQEqghWUUQUK1AQKNJCoWvaZn/vfX+kVGpeSoFCo9PfH11yt3OTk/vOO+fc+wRN08qAOFpp5fePw9DSEjQFTdNQdhXiXvkp3q++QzlcCqrW0mKdEgSTESmtHaYhZ2MemYNoizzpPjVFwf/TTjwbvsGfX4BSXIJaXQuqelxyCZEWpHYpGDLSMfU7C0P2mQhyeKmQEM4rtOZXUPYVUT3rGZwLPwKPp6VFOq2I9hhsD00h4vKLj1uxNU1DLS3H89FnVD/zGv6t25tdPkNmOlH33Ir54uEItkgEQWj2MY4TR1grdO38D6h+cA7Knl9aWpSWQxIxjRiM7YE7MfbMhiYojep04VrwIbWvvovvu/zjWomPG4MB8/mDiX5yOobOaadunKYRvgpd+8b7VN0xE63W1dKihAVyz2zi3nkOQ3qHRuupjmoqb5+B64OPwOM9TdKBoXMaCXmLEWNsp21MHRxiS46ui6bh+XIzVZNalflofN/l47j/aTSfL2QdpbiEqjtm4lrw4WlVZgD/zj3UPPcGmtay9zbhZdEDqtON85UFaE59ZZY6tsdy+UWIbRMRZLn5xq104Jj6WMjyyLtuCrk6+n4soPb5N3XLjAN6YRk3GsSm2ZfKgcPUPP0KWnVtUJlr4XJM5w3Ges1lDQs0De+3W6m6Yybejd+F7twoYx45DPfKXPDqfDFMRqwTrkDulhnUv+byoBw8jOuDFSFNQO+6jWi3XYfQgqt0+Cl0aTner7/XLROMMgm57yK1TWr2cWtfezdkmZiYQNTU23RvzDRNw3HvEyHbWsaPxnrj1U2WQ/P7Ucsq9L8gikr1w89hGjYQQ9skEAQ0TcO/fRfl19yBsnNvI3OIx77sdTxr83AvWaVfJy6GyMk3YejQNmQ/xgG9KB99k26ZWulAdVS3qNkRdiaH5nKhHCrVLRMTE0ASoZkva5rLjfOdpSHLTSPOQTCb9NtWOvBu+CZEQyOmP517XLIIBgOW8aMQUxJ1y5V9RbjeWoSmqmg+H+5laygdeW2jyiz36Yb9g7kYe3bFvXxNyHqmof0xtE8JWa5pGmqIzyYgfP2PFiPsVmgEAUEU0VNZZf8BSkdcjaFje8QzkpESE5CS2yC2sSMltUFsE4eYYEeMtDbJG3AEX34B/h279QtNRkxDz4YQ/lZ/4X78BT/rlkltk3B/9GmTPmO5WwamgX0Cf/fIxnL1pdQ8OVdHWD81c/+D5foxeNZuoGrKw6iHykL2a7poOLFzZiKekYxv5x68X28JWdd667WNvm/K/gPUzn07ZLkQbUOMiQpZfjoIO4UWo21InTqgllUEF2oa/h27QytfHUKMDbl7FuY/DcF84TAMmekIBv2paqqG94tNqIf1lUJKjMfYv1dIH6snNw+1rFK3TNm9j6qJ/25U1iNE/uvmeoUWDBJR0yfiXrZad65qUQlll0zAt3U7+P36HZqMWCdciW3WXQFTSdOofvQF8OnXF+2xqGUVuFbkHjU5L5rXg3qwFN/2XbgWf4xWXhVyDuZhAxFtLavQYee20/x+ap56BceM2aAoJ92f1KEtkZNvxDrhSgSTMXg8t4fyK24JrKQ6mC8eQdz7L+hHxFSVkj4Xn3TQwnzZSGJfeBAxLrbB664ln1A+bhK4jy+gJMTYsD1wJ5axo+rtfqW4hJKsYSFvtk8WuW937B++htTGfkr6byLh57YTDAYi75iAaXC/ZulPKSzCcd9TePO+1S1XHTV4cvNCtreMuzRkeNfz9ZaTVuaI0RcQ++rjQcoMYDp3AKYBvY6rPyHGRtzbzxL5j/ENbmI9n3x+6pS5VzbxH81vaWUGwvCmEAJ5A/YV84iaORm5ZzacpHtOq6rG+Z7+TV/tywvQQqyAYhs7ppE5+n2qKrXPzz8xgSQpEDaeOZmYlx4J2Px640dHYb15bJO7NXTPJO6tZzCdN7ihrB4v7tXrT0zWEAhWC3LfHkTdexv2xa+2dEClnrCzoY8gGI1ETfk7lnGjUPbux7/jZ5TiQ6iVVagVDrTKqoCbqKLu9+FyaCTooOcKVF1ual98K2SbiMsuRLRE6JYp+4rwfL5RX/boKMzDBgUXiCJifCzGQX0w9umOlN4BQWx8TTFfNBzzhcNwf5QbupIApvOHEP3Uv5Ez0oOK1cNl+Lb8FLK5fFY2hrR2+IsO4AvhMgUQkxOI+OtFGM5Mw9gjG6ldMmJK4jHncDoJW4WGgPlhaN8WQ/u2mIac3Whd1enCs/JTysfeDkpw7oJW6wx6zbNqXWg3VISZiNEX6BZpmoZn3UbUcv2bQevfriD68WmNyttUBLOJmOcf5GDHQSHdleY/n0fMK48hxcXolvt+3IF/5x79AUSRmFcew3hWF9SKKsqvvA3Pp3m6Y2keH+aROZh/cwUIJ8Lnq3WSiJYIjGf3hBDeDCmpTYP/NZ8f95JPQvYnd+mMFCpvwuPB+/lG/Zs1ScRy/eVNlrspuFd/HlKZBUsEMXMeCKnMALWvvxeyvdy3B3K3jEBfMTZsj92DoVOqbl2tvBLHlIeO6WVqSf4QCq05XbiWrebwuWNC5jAYB/Vp8L9Schjvd/kh+5R7ZiOFCG6oldV41n+tP845fTFkdmqi5E1ADUQHQ2HMGYCU3CZkuVJSintp6GBK1OQbECQJAEEQkHt0IW7hiwgh7HrfjwUcHnEVSnFJEydwegkbk0PTNJTCIjyr1+NatBLfD9vQaoLzGYLa+ZRGbWcAMSmBiEtGNHjNX7AbZfc+/QaCQMTokfUf9G/x5n0bOp9hwyYOxGQfU27dYWOiSdyW28Bu93z1Hcre/foNTEYsYy5uNBhSO+/9kO5P6cyOQTeQgiAgZ59J7GuPU3HzVLRKR1A79eBhKm+dTsxLDyMlJjRhZqePsFFo99LVOGb+H/78gmbP3438x3jkXl0bvOZatArN5datb7nmMkzn9g/ZX83Tr4YeTFHQnCfgPzdIRN48FjHCXP+SpmmNmkXG/j2DFPJo1EoH7v+u1C80GYm8eSyC1aJbbL54OFF33Yxjun6eivvjdVRNeZi4eU9BGN0Utrgkml/BtWw1FeMmBXy6zajMQoQZ663XEnXPLQjGX4MqmsuNa+EynQYCxpwBxM59JGQmn2/7z3i/2txsMgJgMBAxeiSRE69vsNpqFVUhs+fEBDsxT05HSgjh+9U0vN/9iPJLsU5jEfP5g7H8bUxID0W9l+n6MaB3pfL7cS1YQtV9T6Gd5lTVxmjRFVpTNdwfrqL8usnNnr8r9+6G9R/jsVx9adAK4nxvWXAI1yhjueoSoqZN1P8A63AvDb1inghS6hlYb7gK663XBPmjlf0H8eUXNGwgGzD/aShRM/6JfFaXkP3Wh/QrGs5TiIvBMn40tntvC+n//rWyQPTs+9Bqnbj++5Gu96j2hfkYUtthuX4MgtTi62MLK7SjmtpX3mk+ZTZImIafg+VvYzAN7Y8YYwuygzW/Qu1L//n1BUHAOPRsbPfdgdy7W4NLvi5ycPj8RBCTErCMHYX1xquQUs/QtdddKz9tYMMaumVg+/ckTMPPQYg6hjJ6PHjWbPj1imeQMI/MIWrarcjdsnTTAPQQrBFEPz0DKTmRmpffht+YaVp1La7FH2MZNwok/YzE00nL5nJoGsqhMrTqmpPrRxAQIq1I8bGNrq4AanklFbdMR4y0IPfpjilnAPKZHY8rO8+//8Bx51c0EDfKihgfF/Km8wiOB57Bv3MPcvesgJw9ujR5l7XqdFF5090IUZEY+/TAfP5gpHahU0Obgubxohw89GuCkyQiRloR4mKOOZfTRPjuKWyllRMg/JKTWmnlZAgbt10rTUM5VIZ/2y4ABLMRMSkBZW8RSCKGtHZIbZPQ/H68X25GzuqMGB+Lr2APUnwsQnQUvu+31bkW62xhg4Sxbw98P25HPVyO3DUDMSUR5edClKISBLMRQ5fOaNW1+I/
1aFWPI6IhaUYWc1Ql/YRGIAoaTNGmag1aF/p2hFO6n5pnX8P2wnYjLRmLonErNC29hPCsb3/f52JfPQyk+RPnVt2O79zasfx+H85UFmEfm4Fn3FZrHg2iPxbvhG9QKB3KPLJR9RTjfWoShY3tqnn+T2NefpHb+f1F+LkRzuTFkpiOltcf5yjvIPbIAMP95BNUPzsG+5NX6bV2Rt17bkm8N0KrQvzuMfXsQecffqPj7vUQ/NhXX8jWIcTFETZ9I2UXX4du+G2/uF1jGXor3m++JGDcKtaqGmufewJv3LW3y1yDZY3F3zcC7cQtR902ifPRN2Gb8E7lXNo57HsW9Yi34fJgv/ROGju2pfuR5BFsUUnICluv+iiAZUF0uNFWh6q4HMWR3buDnb0labeg/AMreX6i8/T7kXl2RO6fhyfsWuXsmyqEy1ENlaG53IDNQAGVX8GZazeVGsEYgGAyIiQmo5VVoXh+uhcupuG4y5pHnItoiUUpK8X6xCU9dsMc0pD9iGzue1V+c7imHpFWh/wAYMjthGTcapfggapUD9VApNU++jO/7n/B+9yOCJYKoe27BNuOf1Mx5I2hDg9g+Bffq9SiHyvCs2YB5aH8Ek5HIf1yD4cyOaI6awKaEju2xXPFnLJeeDy4P+HxE3n49StGBZtku1xxI999//92AfhZ7K2GJ5nRDrRPz+UPQapygaliuvAT/T7sQTEZM5/Qj5rkHMPbpjlpSipTSBjkjHfMFOfi27ULOTEeQJATZgCGrE8auGXhW5OJ6dykRl5yH6bzBqJUODB3bYx55Lr5tuzCktsO/bRee3Dw8uXlIqWcg2uMwDekX2Njcoa3u5oLTjKfVD/07RNM0UFQEg4SmqqBpCJKE5q9bJcW6oyDqygAQRARRQFOUQCqApoEGgigEDqzx+tC8XgRLRKCtogaCTQKBkLcggHZU6FsQgbpx66KRYbBzpTWw0sofitbAyv8KqqridrvxhzrH4w9Cq0L/j3Dw4EF69+7Ju+++09KinFJaRKHXr1/P+PHj2L59GwAPP/wQM2bcR2Wl/qbTVk4eTdOorq7G6w2f3OVTQYsodGJiIjt3FrBo0SJcLhdvvvkGLpebyMiTf57IqeLzz9fx8ccrT5lCVFVVsXDh+5SUhOdevd8LLaLQnTp1IjMzi3XrPmPz5s24XC4GDOiPIcSO7aZyKg7bPtLnwoULmTfvddxu/W1bJ9Ln0Rw+fJinnnqSwsLCZu33f40WCX2LosjVV49l2rR7WLZsKZIk0b//AAAOHDjAJ5+sQlU1LrjgApKTk/F6vaxb9xlt27alffsO5OaupVu37qSlpVFQUMDWrT9gtVpp06YNvXr1bjCW1+tlyZIPiY2N5eeff2bo0HPJyMhAEATy8/NZv/5z0tLSqKqqYvjwEdjtdvLy8qisrMDtdtOjRw80DQoLC6mqqqKwsJCMjAzWrfuM6OhoCgp2Ehlp5S9/ubT+QMcNG9aTn/8TXbt2ZeDAgQiCwLZt2ygsLMTv95GYmEjfvg2POtu0aRO1tbXk5q6la9euWCwWNm/ezDfffE1SUjIjR16A0RicQL9lyxYKCnYQHR1NRkYmqamp7N+/n1WrPsZisXLhhRcSHR0d1O7999+jU6fO9OzZk/379/Pll3mMGXNFUD2/38fKlSspKiqmV69e9O3bF0EQ+OmnfHbv3oMsyxQV7eeSS/5CfHz8CetEc9FiuRw5OTlYrVbWrl3DgAEDSUoKHGI+Zcpd7Nixg+rqajZv3sQTTzyF1+tl3rzXyckZhs0WzZw5c5g4cSJpaWls2vQNM2fej9Fo5O67pwYptMfjYfr0e0lMTKS0tJQffviBJ554AlXVeOyxR/nyyzySk5M5cOAAmZlZ2O12Fi9exIoVyxFFkTlznkeSREpKSnC5nJSUHKRDhw7Mm/c6u3btIj4+gV27dpKV1YWMjAzy83/ktttuxWazUVZWxnvvLaRr1658+WUes2c/haIo3HnnXUEKvXPnDtxuN1u2bMHjcVNRUc6ECddjNpspKyvD5XJx5ZVXBr2Pa9eu4aWXXsRisTBnznMkJSXy0EOz+Pbbb5EkiV9+2ceUKXcHtVu6dCnJycl069aNNWtWs3z5cl2FXrp0KfffPwOzOYJ3313Aa6+9Tnp6J/LyvmD27Nl06tSJXbt2UVJSwtSpzXO4zsnQYl4OWZYZNWo0JSUljB9/DYIgsG9fIRs3bmTq1Gncd98Mtm7dyi+//BI4pd6voKpq3d8+1DpnvqqqyLLM3LkvM27cuKBxAvX9TJt2L7NmPcTWrT9QW+ukrKyMvXv3MnXqNO688y6EutPwARRFITExkQ8/XEpOTg5DhgylX79+ZGVl0a/f2fXyXHjhRcyZ8xx2u529ewM5EosXLyYuLo533nkPp9PJ2rVr6vs0Go2sXZvLDTfcGCTnVVeNxW63M3nyncTGxrF48WKMRiNvvfU2aWlprFv3GR6dx9qpqkJERARvvjmfIUOGUlJSQn5+Ps8+O4cbb7yJhQvfr3+vjmbEiBFs374Nv9/Ppk2bGDBAf5f73LkvkZOTw4oVH3HgwAG2bdtWNx8Vq9XKggXvMnjwEAoKdjTlYz/ltKjbbujQoQAMGzYMgD179mI2m4mPjyc7uysOhwOHI/hciN8SFWXjjDPahSy3Wq3ExsaRkZGBw+FAURQ8Hg9ut4usrC4kJCQQEdEw+p+S0vaYl9CkpESMRiMmkxmXK3DU2O7duykrK+OZZ55BFEWKiorq66emphIb27QY1s6dBZjNZuLi4sjK6kJVVSVOZ/BxZgBms5nU1MAj1WprnVRXV7NgwQJWrVpFaWkplZXBZ22fffbZHDp0CLfbzdatP9C7d9+gOqqqUlCwk/j4BOLj47Hb7ZSW/np0WlxcHJIkYTIZUcPkQagtmj56xCY0mQK/fT4vgiAgihKybEBRFFT12EkvoiggNbKnTRBERFHEYJDw+fxomhZ4vELd6u73+4MONBdF8ZgPkhQEse73r6/5/X4sFgupqR2YNOkOsrKy6sskSWry1sUjMgmCUKcwaqM3fWLdQ4mOzKtDhw6ceeaZDBw4sO4L1/BmNj4+gZSUFBYt+gCDwUD79u11ZVAUf/17K8syvqMO9QnIBy39GIqjCavASps2bfD5fNTUVFNcXIzFYsVisSAIAgaDhNPpRNNUVFXFYtE/IEUPj8eNy+WitLSMyEgrkiTWr6yHDx+itramwQd1MtjtdqKiopgw4QZcLtcJu/kSExPx+fy4XC6Ki4uJiLBgbELOsSzLmEwmLrroYoYOHUp5eTlmc/BO9ujoaDIzM3nhhRfo0CGVlJTg3SZGo5H4+HgcDgcej5vy8nJiYhqeoScIgYXiaBwOR4tFJMNKoTMyMomMjGT+/PnMnj2b5ORkkpOTkWWZ+PgEFi58n2effZbi4mLS05t+fpzT6eTNN+fx9NOzSUlJwWg0YbPZiI2N5fnnn2PBgreprT32sWNNYdCgcyguLubxxx/n5ZfnUlFxYsGi4cNHcPjwIR599BG++uorsrKymvQlttvtJCYm8sgjD/Hiiy+yadM3iDpJQ7Is06PHWVRUVNC7d29dpQe4+OI/s37959x99xQEQSA1teFBjkeuqEfYv38/l102miVLPjzOGTcPLarQVqul3l0HAdPj6aefqbtsRzBlyhTi4uyYzWbGjh1LamoqO3cWcMstt5KeHkhVTExMpGfPnpgaOWfCZrMhCAKqqjJ+/LXYbDbi4uK45pprkSQJuz2enJyc+sBOeno6WVlZDfzinTt3pkuXbCRJwmAw0KVLF1JSUjCZTPTocVa9vT1q1Cguv/xyNm36mksvHcWoUaMASE5OoUuXbF3lAoiIiKBXr15ERQWeUTJo0DlMmnQH+/YVct5553HDDTfqtm3Xrj29e/dGkgKy2u12Jk6chMPhoLKyglmzHkQQBIxGI/37DyApKRkIKGLg6ieSkzMspHn1r39NoXfvPuzdu5ebbrqZnj0DTxRISUmhe/fuiKJAeno6mZmBZxvKsozdHhd0T3K6CLtsO03TcLvdiKJYb1sfwev14vV6sVgsIRXjtzgcDgYPHsTLL79CdnZXrFZr/YenaRo1NTVYLJZGbfDjRVVVnE5ng7FOtB+Xy0VEREST53uEQABIw2Qy68rg9/uZNesBPv00l9zczxoNavl8Prxe
1L1brMQ63qcPj8SDL8nHL3Aw4wm5PoSAIIb/dRqOxSXakfr9iUGhdEIT6FbE5EcXgsU60n6Yq0W8JZUIcobKykh9/3Moll/zlmBFaWZaRj+OxIL9diE4nYWVDnwpkWQ6bKFY4oWka3bp1Z9So0S0tSrMSdiZHK62cBA4DMB84setaK62EF67/B264eQBabTEcAAAAAElFTkSuQmCC"},24052:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAuCAYAAACvWdDAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAijSURBVHgBtVhtbFPXGX7vtfNhx/mw4xAFJcEwQjqybAtZpiHG19BaaYpoMwQd+1G2dAhtUBp+UBUmRpJO2qRJW6X9ApIIad2y5QciTBNTgZAKggApqEhBagsKkET5ICZOYsdf1763z3ty7ZrUdmzivtLxx73nnvuc533e97znSPQSpmmaA19voG1H+z6aI+b2p2hP0HrR+iVJekJpmpROX4BhEKfJu7CDBq4SfTZENPqYyDn1Va+KdUT2VUSbfkRUh2bOO4+rbWhPAVBL6UXJbgKExAPBrPjbRc5nb1Dvv4gGrlFKZs5bBPb6L0m12dsMBkMrxiKMSS8Fih/m+36/35Gbm9tHVy45BCDvAqVtzNwvDjJ77Nqf6y7VXgYUA1oLQNeo80NHyuwkMzBGr+9/Mj8/X19QUOBK5E45HhgdkEMA6u7IDCA2Zrq325Gfn3+hra2NCZFSAsXGD2RnZ7fyAHSllzJqACZ9PrT91KlT77a2tsYF9gIoZogBnTx58lfyjPMtMbNvwro+JNnn/UNjY6NN125iUGz9/f0y7EAqgFQMOO/1knNuXjSX203+oLLsc4hioquXimpra9/dt2+fzGTE3paW/JZHR0fry3Oz79B7bycd1+PzCxCqqn7tXm52NhUXFpDRYEg8ANKF9vfuuZs3b1b19fU9hyujA4mn9Nwhu91uw5EjRw4Z7/Rvo6F7CcfzBgLknJ2jeNSzhcJh8qGPxWxKnJMUhaRXanNNFWuuwo1PAIq9JAY08oe0+KTkcDiQ3wzb6d4dSmT8Qte8m5Yz7jfn8ZA1Pz9xp9FhKly7YXdNTU0//kWZYn8SR8GOHTukYDAoA1QlPX+WcBzWDL8wFfP4fEJ3iUE9ZvdbXS6XUY/ERVAReqenp+Xx8XEjRF75wlq2xNgtqZqqasknMP2M8L41iqJwwEWacJ+ko5SRZY2UYYsXCLHGkQdQxvXr1yuPHj0SMxDI2HWrV69mVy6mCF5IE5jBIFM6BiaW7aOvINxRioASTmcKGVQoFBojsyXhAOacHErVOCVkG5OQj8mHw2H33NycYWxsTNq7d6+4LEfCmtF6PB4Zi+Udqv5OwnE4B+WgpWKFlrzkHVBzTU5O3sVaSKWlpRJ0LZgy6kIXH3l5eTQyMnLXtmXXnmSLsB2JcWrGlVTERQBkMZkoqVXXUs+5zivIjxIaTU2JAJMimtJKSkq0hYUFDWvftXDVRjfZSxOOxW4ptVkpL85LWUPWgnywZEkOaMsucueY7ra3t49Z0BdMMQ6RkKPrDqjTcFO7fPny3PDw8Ee0e3/SMRkYM1ZRukoA5FZmL6aKVSVUYDbTsoba6sGDB5cgcC5v1aysLJWJYc9xntL09K5BUyr+h48dO/ZRoOHH40zvcoYBhM64JRV1rP10NzlJvr558+aLJpMpDHZVo9GoIbMLgYu1D6qXvV4vs2aACw1Pnz7VGhoanBt2vfYq9f+fMmpcGr91mN5v/+Cd+/fvOwHIh9otAD2HLly4wCLVhPt6enpUXFRxU+GbWG6UpqamvtkC2yDKV8qosdumps+dOXNmNBAIKAAVguvC5eXl0aiJZjb4V4WuVDCloAwOIm8FUey1hxvfdIttUyYMbvPXb5moq6s7g38KXBeEZEKIujDrifScKTSlF/C8HoRsNhujD+J3sKOjY6S3t/eP9M7vk2b5lIzdBpZaWlp+q3CmluUAmgIwSn19fZj1FMmZUab0K2Gz2axAX0HMIsBs7dmzp2/MH/zfit343p9oaPhxR1dX1yj+BUBEAG4TWlq3bp16+vRpLVIcxC5Mgr7CwkL2bdDnQ2mJSoVFeODAgb/6t742kUo0xjVMyGXIurdp06azmGgA8ggg2gI5OTkKargQazq2GIyC4ovMFuhU0VEpKioSbEH0gRs3bri6u7s/oLdb0ncj3OZ7tWnyxIkT7cw8s4SazQ+WgtBSCOlIjSHlRVARu379epjRz87OBjEbwRYA+5ubm+8+mp3/DzW3UMrGE4Dbbt26dY7dBmb8mKifWWKZIBWFuAxeuimNV0CL0hji43yVi4xrQoQwPRbMzjQzM/MPy3+7N2AbT8va/t/QF2u+3VNdXf0XyMAH1hew+HrgPn9lZWWAtQTXhZfW8fGKHfaiNjg4qDqdTmYriFlxucktePz48fdDP9vrSbY2CsPaxjo8dOjQOX6O2YaofWArAN0qPP5SLSUDRfpJC/s6zG5ENDLtPo6Yzs7OkcHPPu+gIycpoenhf/To0cMDAwPP2W0If9ZRAOtrpMJMWLwnLAsZmL4X492liEYemIFt3bq125VvvcfuiWvQ3dDks47z58+PMEPI3KwjP0+Q9crjaovnTCmdV0UtctCBAWQkNq7qsPibyzDrb2HG39u5c+cuVKnz2p9PaNqvG79qF/+pYQLj6P9D6IhzyFo0UEcWHofHo5VY5IwKUWLA2mSCFvjwrBwvewXfdWfPnv2dNj2laYffXAR0vFlD2LsPHjzYBOB87FiFiay2Wq2F2Bjk8DiU3ulhQmCCLURjFgqxPESPHfqqBLAa3P7Bw4cP/619fHERGADevn37bwBUz8DRr4Ingk0JF1jGpWcGKzUezMD02+32fERRKbsRL/7utm3bfjIxMfEJawSlSAcANaBvDcJ+LUSNXFxi4QmlAyitg1g0GULNgmBzId487OnMaJzDcvT7nHN4XVuAsBcA3FtWVubfuHGjWHBjDzGSWTqi40G14uJiXrRFtueo4iIN9/y8pumAvHwdjPmRaINcEqUDKG3TXSD0hW8L6wvflWCkCq0av9dDR+XYadvw26z3kzUtvchPa5uuJ1U+fgxjA6mgCazYUCr67jrMCy0v5FVVVZy1RZJc7oh6xaazFRU+RyR+F6CqKOJvPdKyMxb+aVgUGFoW56BIw38jA8p0+KdkEcb0DG3ARpLPmOTISkArsIzMJhZE2utZHPsSauNDOInf4i4AAAAASUVORK5CYII="},37475:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAuCAYAAACvWdDAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAi+SUR
1BVHgBtVhrbBTXFb6zD9vYa/zAxrLr2MvLDrjQ2gY1UGpwaymlPGRXglRK5RZqfiRVCVTqDxAGP6pKrRTor0YQy0VVUoqRTEmVqi0kgRQsgmISsFBa4zZ+xYuDbWzvw7szO7v5vmHG2jje2V0wR7r2zNzZme+e853vnLmSeAwLh8NO/KvF2ILxTQxnxPTHGP0YFzGuSJLULxI0KZF7AYYgjrsDyta/9w6IW5+Nid7xKeFy+2ZvWrUkQxSkp4qqZfmiylkg0pPtZ3C5GWMAAMNxvchsEiAkPgiWidM/4uW1bR9+It7+76CIxwAIwPJFw/rVIi8tpdlqtTaHHz1UPBYo/Fab9/v9zpSUlHfP9fQ52z78j4CXRKKWD88d3LRObFmWz9D+UA9p+HFAEdAyAHqn9b1uZ7zeMbOG9c/Sa/04rACwyWjALPOB0QHRQ++c7LqzIIBo9DTC78TzLzQ1NdEhUlygaM3NzVJSUlITH3Duzv/EQhqBfeQa39LY2PhKNGBzQUkEdOTIkZ+Oev31fMDTMNBBeBT12I4dO7J17n7JbJEnvAGxthw9evQnzLJYxuz6QUmRKMnJ1M49siyufuoSt0bGTH9HCeno6cusX7f2lT179jThvaFIuZB0MJKeppahoaFKa0b2B3Vv/tP0wdtLi5FRazVgc42g6I1I/frKgpLs4l97t09du3ZtVVVV1TguhYw5I3xhxreystKSk5Oz6/3+EWFmSG3RWF0xLyBaRUGO+MOu70Sdp7llhdzKKC0tLScOOsaY08Knu0lyOp3QN+sWhiCaGZoTy3jfzypXi9933Yl6T+/YpCgrfWbXypUrr4LL9JQWQiIU9NLWrVslWZYtAFVk5nZ6gS+Mx3Y8W2TqrXsoUaFQKMvn81n1TNTMQifdvXtXGh4ets7MzNgtFospKIYuXnOAN2YL4HvwvmJFUSykjtDpxD/S+fPnRV9fn6SqqlUssBGYmZFLwWDQ2t3dbYG3hAEqzNAVFBRYpqenNaRmLh+Z9olEzCPHrpUIoaWwsNBiiKkGwu12S3RhWlqaFaiHzVb3fr9LxGsMT+/YVNR5ygKi456amrKCPtLu3bt5OaylYnp6utZReL1eCd76gGSOZtSgWOJoWCwBZs91//79m3i/yMvLkx48ePBILKmkV65ckcbGxgQ8JQYHB29SGM0sljAagGIV8oqCXNHZ2XmJkRodHRXEIRg+XbTCubm5YXgq3NraevkbeVnuWFnz8lv/xksHvjLHfgudhYhVN7eXFgmHUG8eO3bsM4fDIcBpcps6pbUporq62gaUyZhMA7cW9/T0/LI3lPwSPRLLmBRsgQ1A1J547MKLz4uBu3eObty48U2Ez5ORkeGFiCrAoWqSgIMwkXo8HhXhVA8dOvRGjTNvxIxbIsIzBs/iBfTC2pXCHvC9B0B/XbRokQqtUm02Gz2l1T+NU2Q9+qdQZmamiuZOuXTp0uTly5dPHPp27HKSqJEWP1q3QrS0tLyanJwcxPuDqCIaKEiCFj6tzHR0dIRA8hAmVPznjUpdXd27udZwN1vYhTQ+b2Lw09dPnTo1FAgEFHgpaLfbVeiUatwz2+Sh1ISQgSrIrgCUDG7JaPZa9paXuEtyMsRCGMP2veI8V3l5+SmcKgidDEcoyDyViSaMgszapzdYjGcwOzub6GUcy21tbYMXL1789W+ff85U5eMxho1eOnjw4EtYsLZw1FoFXgqi7qllZWVhowudrcx6o0e5T4LCpkI70nDZgbEIjV/ztYnAdrM2JJYx28YH/t9WUVHxGjB54SUPOOUFj/0bNmxQSCGj+4zs0TX3QVmDuJme8nMgAeT6+vqTtSVfc8WTjfMZP0ZTgoFbAHQagAL4SgogbIHJyUmlv79f1QHN3j8LihfpP1TrEPRKwQpkrCaA6wG0rBNnz55tbayuTDiMDNuLZcX3Dx8+3EKe4lIA2eYnl6BLQZyrEU75MigdmMatJUuWqFgFY+4Hv/wEtm/fvpve0ZFzBBavcQFsi7u6ul5vb28fgtcDWCgBBR4+fCgz49iuzN1jmO+7L7xz504V5FPQr8tcFTrSGVyX16xZc6IiJ733BehMPMZ22O0a7qipqXmLC8NzCIiUUPD8IMXy+PHjobm/m/cL1SA9Dm1ZWVkp0JM0tKwOZEpqQ0OD8zevnvjT3s6r6WZFmbXtVxvLXNu2bauHpz7H87wA5IGnfOBtABKkzv20MvOU0HdauAIVbla4OhzPcLWQiaFPPv6o/Xfffy4qoEfpv1ocOHDg59evXx/H7zQaQAMD5Cs1UZhscFiiTRAY4s0fK+ixtGw0+LVp06Y/51hCt6J91ZB3TP8zZ84MEhA87dcXJuOLKcjn6ltC8wIz3XXRwVmQJbaJiYlk1MU0dIqpaF8dmzdvzkGNvPCLt7vSI5s+eujHX3e6EKZacGcGPPLgsheDsZYBKKgv9vHM2KPCsCJTFqG9yMJxIV7Gglhx+vTpl0emveGa9r+Fv/VaZ7j2jX+Ekfbu/fv314F/3HZclZqaWgBeZmBhySj8VpHY7mFUYBJWxk8gOwhKlc+F+BUDWBmO19+7d+8vZ2/3acAI8MaNGycJmMDhrWe4EC4ImWaL/ApeCGNTb0V9SoJMpKOTyIPqr8CL12Ef4Lsul+sqOXL79u02eGiDDtgJUqPO5jq4oEQAJbQRi2EBUe2ojeSXA9wiv+i9ZH2eTSKrgBfk9qK4+/Lz8/3QNzWytsUyi4jftCYMtSpoyASzChlJYfWzpumAZiC4MwhbAMkhM/3ZAcQLKGHTQ6Dxi2FBb80KXYRQrsL/UowV4FHh4sWLs3GcyvuEvl+RiCXiKUNUtTIETyggvB/AvPAMlVpLfXDKx0LOMoXizmIbc4v6iUAZxjCiewwuXbpURsr7UYJ87I0w5QO5/UgGZfny5YZqP52wzWd6KKk7dmqQMXBuY6Y+SfrbxJNZSP8CUfGZZtGr/iPFfVrETsSM/XexAPYFK2N7VbtRHVMAAAAASUVORK5CYII="},7773:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAuCAYAAACvWdDAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAmNSURBVHgBrVgLbBTXFX07u/7tx981jjdmWRuMAeMU23ElSg3GUaKSCpMG2WqoWoIjgtLULogSxVYlf5o2kap+VCpV9S+WQHXrSFacKLHUFHAKRoDKx6pQAINlHMe79q7xZz/e2d/k3MnOZmdtw67hSm9n583Mm/POPffe90bBVmGCIJhweAltF9o2NFPY5RtoY2j9aIMKhWKMxWiKWO4FGALR5PC5KgZmhtj1hVvsrutLZuZtoZvy1WvZUwl6Vp5WwspTi5lWpe5GdwvafQAUonrRwy4ChIIGgqXhtMvC217q+qqfDdiGWDQGQCKw2qf3sTVx6S1KpbIZYzGMyVYFih6m626325SYmHj2A8tnpq7JfgaWWKxGzNUbf0zskWtfDrpUWA0oApQLQGfeHe00fRolOw8zYuzQ0/vGFhYWSpOTk2dXcqdqOTB0DDJ05uR4z7KAAn4/s07bmNPuYIuuRebHOdzDktRJLCkpiemz9CwuPl72DLkeZnrVUNXX0tJSKb0ycmxlZEdzc7MCDygqKyv/3D350a7T5k+XgDFPWtjYvTERkMfjkVwtHunc5XQxGwAH/AGm1qoZx3Gh56/bb7Pi5E2mmudfnkf/5cHBwUgIcvcRSwSosbHx1ZnAfGf18Fuym7144b3b98QXR2vxYGt9wXoZa6SxrsKmuTvDt/JLS0tnIt3IRQ4C5JgAdzBINQtnKFZAZJ7gRMi9kiGK2QdT/0ktKir6ZU1NDSdJZjlQFP7cqVOnSqy+2Z2RYW8xT8UMKBzY9OSUrA/RzOLi4upg6eSdJaBIC6QlUMnp9fqq/85elw1AbrNNWVm0VpSxkY3XDrIDm/aG+qzTVhlbDr+L3bDfTikoKCjGuzlqMlBEEYGamZlBACl3XZi7JnuJdcrGojUC9Mm+NpaSoGMNz74uu2aLGGcE1SAlJaWqsLBQJiNOYqmiokIBmjmAMlr4GdnD7sVFFiuged7ODgwcl113OhyycypRgUAgbXZ2VkUYQqCklG+1WrnJyUkVRG4Mr2VklIck+wlccqGmRwTwMEA/7H+d/X/mzorjkFk8VkoX67xeLzElNfFHdN3Nmzc5ZNklyZQsXAvvfu94CIAELBpAkeNIRpEHUKoNGzbINUWuMxgM5ErxXKtUyx6kTC3Z20N/EI8EgIAcKNgbFaDIcSKBoYKIBEmgxMRFFBIon883oVPJQVHpkOwftz9mb5xtDgH7W2VzVIAixxEnz6mJPfv8/LxyYmJCUV1dLfZzYSVC4XA4OBTLy9t0BbKHNVqt7DwcGFk0gMgSk+SgytNLmMViuaLT6VhWVpYCuhaZUgWFLv5oNBo2Pj5+ZU/ejv3hyZOK65TZsgQY2Xs7jkcFSBon3Io
1x+ffb2z+z2+0KNDY1JSZYhaQpITMzU3A6nQKy65lnNPn27PhvByAt6NdkLnkJATN2VUQHaI1erIOS7dHvYBpPwpXW1tYJLTwBpgiHmMhDdQfUCbgoDAwMzI+Ojp4+lFMlGzTLkMXiE+LZaoyeyzI8JeujtRUi/iMInJa3AZScABFDnqM8JaAIk7AEaCqAc/+xY8dOV+rKJouTv9UWsZW3cX3MwOh+ei488qqznmcqOzu3ffv2D7H28iNXBVQqlYDMLgpcvBOq51wuF7GmhAuV9+/fF8rKymwvbnvuhf7pQRmwtIx0JgQEcc30KCOXGfPWUeEN9ZEsfpX7M/bOr1vrhoeHbQC0CLfy0LOvr6+PEpmgkNy3devWuOnp6XiA0wKYDgNpcd7e5/y89P2IZQyZRyzSNrEELaL5fVh5qpTiqlOj1UDUmcvmpca815hxKrW9pKTkrxjDAcnYAci1efNmHh4TQYUyOPwbwIGaF8tgD3ztwWKv9eTJk6cvzF7TUfGUuQWiNaw1sFiM3LZbW2pONiT/HTLxYgIeSMaH5t+5c6coIbpP1FRw5UeAfOnp6V5QSgsnT0dHx3h/f/87v8uvW5LlYzVyG4n76NGjb3gpU3Mcj+aFuL1YMvlJT1LODNWbYI9frVZ74UIPZsHjWc/+/fvP+qzuT2jAx7G/bH6Ljd0a7ejq6iLKeRDBQyKilvLy8gJNTU2CtDgIX8eI9GF9Q371QCduHN0kwoMHD/5xb2q5OTwaYzFsq1iCS3kNOmrDRHnIg0e08QkJCV6TyeTr7e0NhG9QQ6Cok9gCnQHc6E1NTRXZghj58+fPz/b09PymMfe1mN1Ibnsl/QVLQ0NDKzFPLCEA3GDJgwzug7gDYaTIQUl27tw5P6Gfm5vzYDYiWwDsrq2tveL4cu5fjXm1LFrTYQLktosXL7aT28CMGxN1E0skE6QiH5ZNLHI3s9wOmfpovU75KhFRmITo0KBPi9klPXjw4FTXg4830sL/UVZnfIVtW1jXi3X47yGDRbDuRPF1wH1uo9HIk5bgOn/ktwVumbHIi8LVq1cDNpuN2PJgVjz6qXlOnDjx9k+zXnSE18bljGpbFXR45MiRdnqO2IaoF8EWD916afxILT0MFAt+aSFf+8mNiEaifZEiprOzc/zOjVsdv934C7aSSeFfX1//5tDQ0Ay5DeFPOuKRLL13794Vk+RKz3MrXSBg8LeYTFkwGmlgAlZeXt6j53XX6uGe5awBurONWDq6u7vHiSGe50lHbpog6ZXGFb75zhTV96qQ0TPUaD+GxEZVOBluzMas12PG39m9e/dzWKUu1H3xnvD9y4dCrXPiQwETmMT934WOinDMRVuDpqVxwvd3qzLpGxWiRJmTk5MELdDHsxy8bBOOxW1tbT83u63CD/73pgio+voJAWFvP3z48I8AnD475mMihrS0tBRsDBJoHBbb18MVgYlsIRrjsBDTIHr00JcRwApx+dmRkZF/9pr/LewBMAJ46dKlPwFQKQHHfWtpItiUUHJTRX4zeFyjwZREP7b1OkRRFrkRL34GhbTSbDZ/ThrBUqQDgMpwbyHCPheiRi7O1NKEYgEU04dYNA5CjYNgEyFeDXa3ajTKYQnB65RzqK45IWwngLuys7PdW7ZsEQtuMHAeabGIjgYVMjIyqGiL2Z6iihZpuOammhYE5KJ+MOZGovXQkigWQDFb0AWivnDUkr5wNIKRfDSq1hugoxzstNPxXx28L7SNi9ZUsdwcTKoMOx4/NpBeNBErNpTe4O7aT4WWCnl+fj5l7W+Wt4onqu+lFmQrJHyKSPxPxqoilY7BSIt/YuEfg4WAocVRDpIazlUE6EmHf1QmMRbM0EpsJOkbEydVAvYY9kRmEw4i5nq2jH0NhG7vpLhXt7wAAAAASUVORK5CYII="},28817:function(e,t,i){"use strict";e.exports=i.p+"img/precision_01.413fe24e.png"},55024:function(e,t,i){"use strict";e.exports=i.p+"img/precision_02.e27b4f19.png"},58941:function(e,t,i){"use strict";e.exports=i.p+"img/precision_03.a31f2dd0.png"},11381:function(e,t,i){"use strict";e.exports=i.p+"img/crop_monitoring_01.9e3c5e48.png"},81781:function(e,t,i){"use strict";e.exports=i.p+"img/crop_monitoring_02.1a803d78.png"},76905:function(e,t,i){"use strict";e.exports=i.p+"img/crop_monitoring_03.53065d9d.png"},24654:function(){},22868:function(){},14777:function(){},99830:function(){},70209:function(){},87414:function(){},75042:function(){}},t={};function i(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=e,function(){i.amdD=function(){throw new Error("define cannot be used indirect")}}(),function(){i.amdO={}}(),function(){var e=[];i.O=function(t,a,n,r){if(!a){var s=1/0;for(c=0;c<e.length;c++){a=e[c][0],n=e[c][1],r=e[c][2];for(var o=!0,l=0;l<a.length;l++)(!1&r||s>=r)&&Object.keys(i.O).every((function(e){return i.O[e](a[l])}))?a.splice(l--,1):(o=!1,r<s&&(s=r));if(o){e.splice(c--,1);var d=n();void 0!==d&&(t=d)}}return t}r=r||0;for(var c=e.length;c>0&&e[c-1][2]>r;c--)e[c]=e[c-1];e[c]=[a,n,r]}}(),function(){i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};i.t=function(a,n){if(1&n&&(a=this(a)),8&n)return a;if("object"===typeof a&&a){if(4&n&&a.__esModule)return a;
1if(16&n&&"function"===typeof a.then)return a}var r=Object.create(null);i.r(r);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&n&&a;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){s[e]=function(){return a[e]}}));return s["default"]=function(){return a},i.d(r,s),r}}(),function(){i.d=function(e,t){for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(t,a){return i.f[a](e,t),t}),[]))}}(),function(){i.u=function(e){return"js/"+({244:"translation.xjs",405:"translation.sl",533:"translation.sk",836:"translation.cs",982:"translation.hu"}[e]||e)+"."+{3:"bcc6faef",188:"a0e1b238",244:"ec4b844e",301:"fdb4f6cf",405:"f1b49761",533:"023ac814",563:"89452174",836:"1533c56b",982:"e981289b"}[e]+".js"}}(),function(){i.miniCssF=function(e){}}(),function(){i.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="app-webclient:";i.l=function(a,n,r,s){if(e[a])e[a].push(n);else{var o,l;if(void 0!==r)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var u=d[c];if(u.getAttribute("src")==a||u.getAttribute("data-webpack")==t+r){o=u;break}}o||(l=!0,o=document.createElement("script"),o.charset="utf-8",o.timeout=120,i.nc&&o.setAttribute("nonce",i.nc),o.setAttribute("data-webpack",t+r),o.src=a),e[a]=[n];var p=function(t,i){o.onerror=o.onload=null,clearTimeout(h);var n=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((function(e){return e(i)})),t)return t(i)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),l&&document.head.appendChild(o)}}}(),function(){i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){i.p="/farm/"}(),function(){var e={143:0};i.f.j=function(t,a){var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else{var r=new Promise((function(i,a){n=e[t]=[i,a]}));a.push(n[2]=r);var s=i.p+i.u(t),o=new Error,l=function(a){if(i.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){var r=a&&("load"===a.type?"missing":a.type),s=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,n[1](o)}};i.l(s,l,"chunk-"+t,t)}},i.O.j=function(t){return 0===e[t]};var t=function(t,a){var n,r,s=a[0],o=a[1],l=a[2],d=0;if(s.some((function(t){return 0!==e[t]}))){for(n in o)i.o(o,n)&&(i.m[n]=o[n]);if(l)var c=l(i)}for(t&&t(a);d<s.length;d++)r=s[d],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(c)},a=self["webpackChunkapp_webclient"]=self["webpackChunkapp_webclient"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=i.O(void 0,[998],(function(){return i(99315)}));a=i.O(a)})();
2//# sourceMappingURL=app.aadf06db.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.