(function(e){function t(t){for(var n,o,r=t[0],_=t[1],l=t[2],d=0,h=[];d5&&this.addPolygon(e),this.polygonAddShapes.length&&this.polygonAddShapes.splice(0,this.polygonAddShapes.length),this.isAddingPolygon=!1},addPolygon:function(e){this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("poly")),{},{points:e,closed:!0,x:0,y:0})),this.shapesUpdated()},addRectangle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("rect")),{},{x:80/this.scale,y:50/this.scale,width:200/this.scale,height:200/this.scale})),this.shapesUpdated())},addCircle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("circle")),{},{x:180/this.scale,y:200/this.scale,radius:100/this.scale})),this.shapesUpdated())},addPerson:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("path")),{},{x:80/this.scale,y:80/this.scale,data:"m 105.61519,0 a 52.807596,52.807596 0 1 1 0,105.61519 52.807596,52.807596 0 0 1 0,-105.61519 m 0,105.61519 c 58.3524,0 105.61522,23.63141 105.61522,52.8076 V 264.038 H 0 V 158.42279 c 0,-29.17619 47.262803,-52.8076 105.61519,-52.8076 z",scale:{x:1/this.scale,y:1/this.scale}})),this.shapesUpdated())},getBaseShape:function(e){return{type:e,name:"shape-"+(new Date).valueOf(),fill:"#b0c4de",opacity:.5,stroke:"#0000ff",draggable:!0,strokeWidth:2,strokeScaleEnabled:!1,annotation:{title:"",text:"",linkTitle:"",link:""}}},getBaseShapeForPolygon:function(e){return{fill:"#a24545",opacity:.5,stroke:"#800000",strokeWidth:2,strokeScaleEnabled:!1}},deleteShape:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(e===this.selectedShapeName&&(this.selectedShapeName="",this.updateTransformer()),this.shapes.splice(t,1),this.shapesUpdated())},handleKeyEvent:function(e){this.editMode&&this.selectedShapeName&&"Delete"===e.key&&this.deleteShape(this.selectedShapeName)},handleScroll:function(e){if(e.evt){var t=e.evt;t.preventDefault();var a=t.deltaY<0?1:-1;this.changeScale(.02*a)}},changeScale:function(e){var t=this.scale+e;t<.1&&(t=.1),t>5&&(t=5),this.scale=t},handleDragEnd:function(e,t){t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleTransform:function(e,t){t.rotation=e.currentTarget.attrs.rotation,t.scaleX=e.currentTarget.attrs.scaleX,t.scaleY=e.currentTarget.attrs.scaleY,t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleMouseEnter:function(e){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="pointer",this.currentHoverShape=e)},handleMouseLeave:function(){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="default",this.currentHoverShape="")},handleGlobalMouseEnter:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="crosshair")},handleGlobalMouseLeave:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="default")},handleSideBarMouseEnter:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#c00",this.shapes[t].fill="#dec4b0")}},handleSideBarMouseLeave:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de")}},formSubmitted:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de"),this.shapesUpdated()},toggleShowShapes:function(){this.$refs.items.getStage().canvas._canvas.style.opacity=this.isShapesVisible?"0":"1",this.isShapesVisible=!this.isShapesVisible},shapesUpdated:function(){this.callback&&"function"===typeof this.callback&&this.callback(JSON.stringify(this.shapes)),this.localStorageKey&&localStorage.setItem(this.localStorageKey,JSON.stringify(this.shapes))},load:function(){if(this.initialDataId){var e=document.getElementById(this.initialDataId);e&&e.innerHTML&&(this.shapes=JSON.parse(e.innerHTML))}else if(this.initialData&&this.initialData.length>0)this.shapes=JSON.parse(this.initialData);else if(this.localStorageKey){var t=localStorage.getItem(this.localStorageKey)||"[]";this.shapes=JSON.parse(t)}this.editMode||this.shapes.forEach((function(e){return e.draggable&&delete e.draggable}))}}}},"555f":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-loader"},[a("div",{staticClass:"lds-ring"},[a("div"),a("div"),a("div"),a("div")])])}],s=a("2877"),o={},r=Object(s["a"])(o,n,i,!1,null,null,null);t["a"]=r.exports},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");for(var n=a("2b0e"),i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-container",style:{width:e.width+"px",height:e.height+"px"},attrs:{id:e.containerId}},[a("div",{staticClass:"pa-canvas"},[a("div",{staticClass:"pa-controls"},[a("a",{attrs:{href:"#",title:e.$t("zoom_in")},on:{click:function(t){return t.preventDefault(),e.changeScale(.1)}}},[a("icon",{attrs:{type:"zoom-in"}})],1),a("a",{attrs:{href:"#",title:e.$t("zoom_out")},on:{click:function(t){return t.preventDefault(),e.changeScale(-.1)}}},[a("icon",{attrs:{type:"zoom-out"}})],1),a("hr"),e.editMode?e._e():a("a",{attrs:{href:"#",title:e.$t(e.isShapesVisible?"hide_shapes":"show_shapes")},on:{click:function(t){return t.preventDefault(),e.toggleShowShapes(t)}}},[a("icon",{attrs:{type:e.isShapesVisible?"shapes-off":"shapes-on"}})],1),e.editMode?a("a",{attrs:{href:"#",title:e.$t(e.isAddingPolygon?"accept_polygon":"add_polygon")},on:{click:function(t){return t.preventDefault(),e.startPolygonDrawing(t)}}},[a("icon",{attrs:{type:e.isAddingPolygon?"add-polygon-accept":"add-polygon",fill:e.isAddingPolygon?"green":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_rectangle")},on:{click:function(t){return t.preventDefault(),e.addRectangle(t)}}},[a("icon",{attrs:{type:"add-rectangle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_circle")},on:{click:function(t){return t.preventDefault(),e.addCircle(t)}}},[a("icon",{attrs:{type:"add-circle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_person")},on:{click:function(t){return t.preventDefault(),e.addPerson(t)}}},[a("icon",{attrs:{type:"add-person",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e()]),a("v-stage",{ref:"stage",attrs:{config:{width:e.stageSize.width,height:e.stageSize.height,scaleX:e.scale,scaleY:e.scale,draggable:!0}},on:{mousedown:e.handleStageMouseDown,contextmenu:e.cancelEvent,mouseenter:e.handleGlobalMouseEnter,mouseleave:e.handleGlobalMouseLeave,wheel:e.handleScroll}},[a("v-layer",{ref:"background"},[a("v-image",{attrs:{config:{image:e.image}}})],1),a("v-layer",{ref:"items"},[e._l(e.shapes,(function(t){return["rect"===t.type?a("v-rect",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"circle"===t.type?a("v-circle",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"poly"===t.type?a("v-line",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"path"===t.type?a("v-path",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e()]})),e.editMode?a("v-transformer",{ref:"transformer"}):e._e()],2),e.editMode&&e.isAddingPolygon?a("v-layer",{ref:"polygon"},[e.polygonPoints.length>2?a("v-line",{attrs:{config:e.polygonPointsConfig}}):e._e(),e._l(e.polygonAddShapes,(function(e,t){return[a("v-rect",{key:t,attrs:{config:e}})]}))],2):e._e()],1),e.isLoading?a("loader"):e._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.isAddingPolygon,expression:"isAddingPolygon"}],staticClass:"pa-polygon-hint"},[e._v(e._s(e.$t("polygon_help")))])],1),a("div",{staticClass:"pa-infobar"},e._l(e.shapes,(function(t){return a("side-bar-entry",{key:t.name,attrs:{shape:t,"edit-mode":e.editMode,"selected-shape-name":e.selectedShapeName,"current-hover-shape":e.currentHoverShape},on:{"sidebar-entry-enter":function(t){return e.handleSideBarMouseEnter(t)},"sidebar-entry-leave":function(t){return e.handleSideBarMouseLeave(t)},"sidebar-entry-delete":function(t){return e.deleteShape(t)},"sidebar-entry-save":function(t){return e.formSubmitted(t)}}})})),1)])},s=[],o=a("3f4a"),r=o["a"],_=(a("cf25"),a("2877")),l=Object(_["a"])(r,i,s,!1,null,null,null),c=l.exports,d=document.getElementsByClassName("picture-annotation"),h=[],u=0;u