"use strict";(self.webpackChunk_farmos_org_farmos_map=self.webpackChunk_farmos_org_farmos_map||[]).push([[807],{7276:(t,e,i)=>{i.d(e,{Z:()=>c});var o,n=i(4754),r=i(2967),s=i(8641),a=i(8527),h=i(6442),u=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),d=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return u(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,i,o){var n=this.flatCoordinates,r=t-n[0],s=e-n[1],a=r*r+s*s;if(a=i[0]||t[1]<=i[1]&&t[3]>=i[1]||(0,s.forEachCorner)(t,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n{i.d(e,{N_:()=>S,ZP:()=>Z});var o,n=i(7276),r=i(291),s=i(5487),a=i(1090),h=i(4754),u=i(4049),d=i(2083),c=i(8630),_=i(2217),l=i(7403),p=i(6259),f=i(3643),g=i(188),y=i(4515),m=i(2033),v=i(9271),C=i(933),k=i(6885),w=i(8683),P=i(7539),E=i(2290),T=i(1900),F=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),x="Point",L="LineString",G="Polygon",D="Circle",M="drawstart",O=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return F(e,t),e}(r.ZP);function S(t,e){return function(i,o,r){var s=(0,E.fromUserCoordinate)(i[0],r),a=(0,E.fromUserCoordinate)(i[i.length-1],r),h=Math.sqrt((0,T.bI)(s,a)),u=o||(0,m.Bb)(new n.Z(s),t),d=e;if(!e&&0!==e){var c=a[0]-s[0],_=a[1]-s[1];d=Math.atan2(_,c)}(0,m.Ej)(u,s,h,d);var l=(0,E.getUserProjection)();return l&&u.transform(r,l),u}}const Z=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=k.Dv),(i=t.call(this,o)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case h.Z.POINT:case h.Z.MULTI_POINT:return x;case h.Z.LINE_STRING:case h.Z.MULTI_LINE_STRING:return L;case h.Z.POLYGON:case h.Z.MULTI_POLYGON:return G;case h.Z.CIRCLE:return D;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===G?3:2,i.maxPoints_=i.mode_===D?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:k.uX;var r,s=e.geometryFunction;if(!s){var a,c=i.mode_;c===D?s=function(t,e,i){var o=e||new n.Z([NaN,NaN]),r=(0,E.fromUserCoordinate)(t[0],i),s=(0,T.bI)(r,(0,E.fromUserCoordinate)(t[t.length-1],i));o.setCenterAndRadius(r,Math.sqrt(s));var a=(0,E.getUserProjection)();return a&&o.transform(i,a),o}:(c===x?a=g.default:c===L?a=d.Z:c===G&&(a=m.ZP),s=function(t,e,i){return e?c===G?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e})}return i.geometryFunction_=s,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new v.default({source:new C.default({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=(0,P.createEditingStyle)(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:w.rM,i.freehandCondition_,e.freehand?i.freehandCondition_=w.Bx:i.freehandCondition_=e.freehandCondition?e.freehandCondition:w.vY,i.addChangeListener(u.Z.ACTIVE,i.updateState_),i}return F(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===s.Z.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==x&&this.freehandCondition_(e);var i=e.type===_.Z.POINTERMOVE,o=!0;return!this.freehand_&&this.lastDragTime_&&e.type===_.Z.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===_.Z.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===_.Z.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===_.Z.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===_.Z.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===_.Z.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new c.Z(_.Z.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==x||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],n=this.mode_;if(n===x)e=!0;else if(n===D)e=2===this.sketchCoords_.length;else if(n===L)i=this.sketchCoords_.length>this.minPoints_;else if(n===G){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var s=this.getMap(),a=0,h=o.length;a=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===G&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;if(o===L||o===D){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===h.Z.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===G){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();t.length>=2&&(n=t[t.length-2].slice(),t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)),r.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===L?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===G&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===h.Z.MULTI_POINT?t.setGeometry(new p.Z([e])):this.type_===h.Z.MULTI_LINE_STRING?t.setGeometry(new l.Z([e])):this.type_===h.Z.MULTI_POLYGON&&t.setGeometry(new f.Z([e])),this.dispatchEvent(new O("drawend",t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new O("drawabort",t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===L||i===D)e=this.sketchCoords_;else{if(i!==G)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n{i.d(e,{Z:()=>k});var o,n=i(2071),r=i(5487),s=i(4754),a=i(4515),h=i(9781),u=i(2796),d=i(6885),c=i(8641),_=i(1900),l=i(2033),p=i(2290),f=i(4187),g=i(9374),y=i(5818),m=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});function v(t){return t.feature?t.feature:t.element?t.element:void 0}var C=[];const k=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=d.uX),n.stopDown||(n.stopDown=d.Dv),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new h.Z,i.GEOMETRY_SEGMENTERS_={Point:i.segmentPointGemetry_.bind(i),LineString:i.segmentLineStringGemetry_.bind(i),LinearRing:i.segmentLineStringGemetry_.bind(i),Polygon:i.segmentPolygonGemetry_.bind(i),MultiPoint:i.segmentMultiPointGemetry_.bind(i),MultiLineString:i.segmentMultiLineStringGemetry_.bind(i),MultiPolygon:i.segmentMultiPolygonGemetry_.bind(i),GeometryCollection:i.segmentGeometryCollectionGemetry_.bind(i),Circle:i.segmentCircleGemetry_.bind(i)},i}return m(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=(0,f.sq)(t),n=t.getGeometry();if(n){var s=this.GEOMETRY_SEGMENTERS_[n.getType()];if(s){this.indexedFeaturesExtents_[o]=n.getExtent((0,c.createEmpty)());var a=[];if(s(a,n),1===a.length)this.rBush_.insert((0,c.boundingExtent)(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var h=a.map((function(t){return(0,c.boundingExtent)(t)})),u=a.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(h,u)}}}i&&(this.featureChangeListenerKeys_[o]=(0,y.oL)(t,r.Z.CHANGE,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var i=this.snapTo(e.pixel,e.coordinate,e.map);return i&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=v(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=v(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=(0,f.sq)(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=(0,g.KX)(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,o=(0,f.sq)(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,s=[];r.forEachInExtent(n,(function(e){t===e.feature&&s.push(e)}));for(var a=s.length-1;a>=0;--a)r.remove(s[a])}i&&((0,y.bN)(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,r=this.getFeatures_();i&&(o.forEach(y.bN),o.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push((0,y.oL)(this.features_,n.Z.ADD,this.handleFeatureAdd_,this),(0,y.oL)(this.features_,n.Z.REMOVE,this.handleFeatureRemove_,this)):this.source_&&o.push((0,y.oL)(this.source_,u.Z.ADDFEATURE,this.handleFeatureAdd_,this),(0,y.oL)(this.source_,u.Z.REMOVEFEATURE,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n=i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_]),r=(0,c.boundingExtent)([o,n]),a=this.rBush_.getInExtent(r),h=a.length;if(0===h)return null;var u,d=i.getView().getProjection(),l=(0,p.fromUserCoordinate)(e,d),f=1/0,g=this.pixelTolerance_*this.pixelTolerance_,y=function(){if(u){var e=i.getPixelFromCoordinate(u);if((0,_.bI)(t,e)<=g)return{vertex:u,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var m=0;m