text: (function(t){function e(e){for(var n,s,r=e[0],l=e[1],c=e[2],d=0,h=[];d<r.length;d++)s=r[d],i[s]&&h.push(i[s][0]),i[s]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(t[n]=l[n]);u&&u(e);while(h.length)h.shift()();return o.push.apply(o,c||[]),a()}function a(){for(var t,e=0;e<o.length;e++){for(var a=o[e],n=!0,r=1;r<a.length;r++){var l=a[r];0!==i[l]&&(n=!1)}n&&(o.splice(e--,1),t=s(s.s=a[0]))}return t}var n={},i={app:0},o=[];function s(e){if(n[e])return n[e].exports;var a=n[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=t,s.c=n,s.d=function(t,e,a){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(a,n,function(e){return t[e]}.bind(null,n));return a},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],l=r.push.bind(r);r.push=e,r=r.slice();for(var c=0;c<r.length;c++)e(r[c]);var u=l;o.push([0,"chunk-vendors"]),a()})({0:function(t,e,a){t.exports=a("56d7")},"0129":function(t,e,a){"use strict";var n=a("033d"),i=a.n(n);i.a},"02f2":function(t,e,a){},"033d":function(t,e,a){},"034f":function(t,e,a){"use strict";var n=a("64a9"),i=a.n(n);i.a},"0881":function(t,e,a){"use strict";var n=a("bc3a"),i=a.n(n),o="/api/export";e["a"]={download:function(t,e){i()({url:"".concat(o,"/").concat(t,"/download"),method:"GET",responseType:"blob"}).then(function(a){var n=window.URL.createObjectURL(new Blob([a.data])),i=document.createElement("a");i.href=n,i.setAttribute("download","".concat(e,"-").concat(t,".json")),document.body.appendChild(i),i.click()})}}},"0bf9":function(t,e,a){},"0dae":function(t,e,a){"use strict";var n=a("73ae"),i=a.n(n);i.a},1:function(t,e){},"10c4":function(t,e,a){},"13f8":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-group tool-input-group"},[a("div",{staticClass:"input-group-prepend tool-option-pre"},[a("span",{staticClass:"input-group-text tool-option-font"},[t._v(t._s(t.name))])]),a("select",{directives:[{name:"model",rawName:"v-model",value:t.localValue,expression:"localValue"}],staticClass:"form-control tool-option-input",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.localValue=e.target.multiple?a:a[0]}}},t._l(t.options,function(e){return a("option",{key:e.key,domProps:{value:e.key,selected:e.selected}},[t._v(t._s(e.value))])}))])},i=[],o=(a("456d"),a("ac6a"),a("c5f6"),a("cadf"),a("551c"),a("097d"),{name:"PanelInputDropdown",model:{prop:"value",event:"update"},props:{name:{type:String,required:!0},value:{type:[Number,Array,Object,String],required:!0},values:{type:Object,required:!0}},data:function(){return{localValue:this.value}},watch:{localValue:function(){this.$emit("update",this.localValue)},value:function(t){this.localValue=t}},computed:{options:function(){var t=this,e=[];return Object.keys(this.values).forEach(function(a){e.push({key:a,value:t.values[a],selected:t.value==a})}),e}}}),s=o,r=(a("4c8c"),a("2877")),l=Object(r["a"])(s,n,i,!1,null,"5b67a607",null);l.options.__file="PanelInputDropdown.vue";e["a"]=l.exports},1539:function(t,e,a){"use strict";var n=a("be94"),i=a("bc3a"),o=a.n(i),s="/api/dataset",r="/api/image";e["a"]={allData:function(t){return o.a.get("".concat(s,"/data"),{params:Object(n["a"])({},t)})},getData:function(t,e){return o.a.get("".concat(s,"/").concat(t,"/data"),{params:Object(n["a"])({},e)})},create:function(t,e){return o.a.post("".concat(s,"/?name=").concat(t),{categories:e})},generate:function(t,e){return o.a.post("".concat(s,"/").concat(t,"/generate"),Object(n["a"])({},e))},scan:function(t){return o.a.get("".concat(s,"/").concat(t,"/scan"))},exportingCOCO:function(t,e){return o.a.get("".concat(s,"/").concat(t,"/export?categories=").concat(e))},getCoco:function(t){return o.a.get("".concat(s,"/").concat(t,"/coco"))},uploadCoco:function(t,e){var a=new FormData;return a.append("coco",e),o.a.post("".concat(s,"/").concat(t,"/coco"),a,{headers:{"Content-Type":"multipart/form-data"}})},uploadImages:function(t,e){var a=new FormData;return a.append("image",e),a.append("dataset_id",t),o.a.post("".concat(r,"/"),a,{headers:{"Content-Type":"multipart/form-data"}})},export:function(t,e){return o.a.get("".concat(s,"/").concat(t,"/").concat(e))},getUsers:function(t){return o.a.get("".concat(s,"/").concat(t,"/users"))},getStats:function(t){return o.a.get("".concat(s,"/").concat(t,"/stats"))},getExports:function(t){return o.a.get("".concat(s,"/").concat(t,"/exports"))},resetMetadata:function(t){return o.a.get("".concat(s,"/").concat(t,"/reset/metadata"))}}},1799:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"row align-items-center justify-content-center bg-light"},[a("ul",{staticClass:"pagination text-center"},[a("li",{staticClass:"page-item",on:{click:t.previousPage}},[t._m(0)]),t._l(t.range,function(e){return a("li",{key:e,class:{"page-item":!0,active:e+t.startPage==t.page}},[a("a",{staticClass:"page-link",on:{click:function(a){t.page=e+t.startPage}}},[t._v(t._s(e+t.startPage))])])}),a("li",{class:{"page-item":!0,disabled:t.page==t.pages},on:{click:t.nextPage}},[t._m(1)])],2)])},i=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a",{staticClass:"page-link",attrs:{"aria-label":"Previous"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("«")]),a("span",{staticClass:"sr-only"},[t._v("Previous")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a",{staticClass:"page-link",attrs:{"aria-label":"Next"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("»")]),a("span",{staticClass:"sr-only"},[t._v("Next")])])}],o=(a("c5f6"),{name:"Pagination",props:{pages:{type:Number,required:!0}},data:function(){return{range:11,page:1,timer:null}},methods:{previousPage:function(){this.page-=1,this.page<1&&(this.page=1)},nextPage:function(){this.page+=1,this.page>this.pages&&(this.page=this.pages)}},watch:{page:function(t,e){var a=this;t!==e&&(clearTimeout(this.timer),this.timer=setTimeout(function(){return a.$emit("pagechange",a.page)},0))}},computed:{startPage:function(){if(this.range>this.pages)return 0;var t=Math.round(this.range/2),e=this.page-t;return e<0?0:e>this.pages||e+this.range>this.pages?this.pages-this.range:e}},created:function(){this.range>this.pages&&(this.range=this.pages)}}),s=o,r=(a("6ccd"),a("2877")),l=Object(r["a"])(s,n,i,!1,null,null,null);l.options.__file="Pagination.vue";e["a"]=l.exports},"1ee6":function(t,e,a){},"1f08":function(t,e,a){},2:function(t,e){},"22e5":function(t,e,a){t.exports=a.p+"img/404-image.36797a63.png"},"267d":function(t,e,a){},"27e3":function(t,e,a){},"294d":function(t,e,a){"use strict";var n=a("37e5"),i=a.n(n);i.a},"2c05":function(t,e,a){"use strict";var n=a("02f2"),i=a.n(n);i.a},"2f9b":function(t,e,a){},"2fc5":function(t,e,a){},"307d":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-3"},[a("div",{staticClass:"card mb-4 shadow-sm",class:{border:t.annotated,"border-danger":t.annotated},on:{mouseover:function(e){t.hover=!0},mouseleave:function(e){t.hover=!1}}},[a("div",{on:{click:t.openAnnotator}},[a("v-lazy-image",{staticClass:"card-img-top",staticStyle:{width:"100%",display:"block"},style:{opacity:t.annotated?.3:1},attrs:{src:t.imageUrl,"src-placeholder":t.loaderUrl}})],1),t.annotated?a("b",{staticClass:"overlay-text text-center"},[t._v("\n      Being annotated by "+t._s(t.image.annotating.join(", "))+"\n    ")]):t._e(),a("div",{staticClass:"card-body",staticStyle:{width:"100%"},style:{opacity:t.annotated?.3:1}},[a("div",{staticClass:"row",staticStyle:{width:"100%"}},[a("span",{class:{"text-truncate":!t.hover},staticStyle:{width:"100%",float:"left"}},[a("strong",{staticClass:"card-title"},[t._v("\n            "+t._s(t.image.id)+". "+t._s(t.image.file_name)+"\n          ")])]),a("i",{staticClass:"card-text fa fa-ellipsis-v fa-x icon-more",attrs:{id:"dropdownImage"+t.image.id,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-hidden":"true"}}),a("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownImage"+t.image.id}},[a("button",{staticClass:"btn dropdown-item",on:{click:t.onDeleteClick}},[t._v("\n            Delete\n          ")]),a("button",{staticClass:"btn dropdown-item",on:{click:t.openAnnotator}},[t._v("\n            Annotate\n          ")]),a("button",{staticClass:"btn dropdown-item",on:{click:t.onDownloadClick}},[t._v("\n            Download Image & COCO\n          ")])])]),a("div",{staticClass:"row"},[a("p",{directives:[{name:"show",rawName:"v-show",value:t.image.num_annotations>0,expression:"image.num_annotations > 0"}]},[t._v("\n          "+t._s(t.image.num_annotations)+" annotation"),a("span",{directives:[{name:"show",rawName:"v-show",value:t.image.num_annotations>1,expression:"image.num_annotations > 1"}]},[t._v("s")])]),a("p",{directives:[{name:"show",rawName:"v-show",value:1==t.image.annotated&&t.image.num_annotations<0,expression:"image.annotated == true && image.num_annotations < 0"}]},[t._v("Annotated")]),a("p",{directives:[{name:"show",rawName:"v-show",value:0==t.image.annotated,expression:"image.annotated == false"}]},[t._v("No annotations")])]),a("div",{staticClass:"row"})])])])},i=[],o=(a("a481"),a("cadf"),a("551c"),a("097d"),a("bc3a")),s=a.n(o),r={name:"ImageCard",props:{image:{type:Object,required:!0}},data:function(){return{hover:!1,showAnnotations:!0,loaderUrl:a("fa5e")}},methods:{downloadURI:function(t,e){var a=document.createElement("a");a.href=t,a.download=e,document.body.appendChild(a),a.click(),a.remove()},openAnnotator:function(){this.$router.push({name:"annotate",params:{identifier:this.image.id}})},onDownloadClick:function(){var t=this;this.downloadURI("/api/image/"+this.image.id+"?asAttachment=true",this.image.file_name),s.a.get("/api/image/"+this.image.id+"/coco").then(function(e){var a="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e.data));t.downloadURI(a,t.image.file_name.replace(/\.[^\/.]+$/,"")+".json")})},onDeleteClick:function(){var t=this;s.a.delete("/api/image/"+this.image.id).then(function(){t.$parent.updatePage()})}},computed:{imageUrl:function(){var t=new Date;return this.showAnnotations?"/api/image/".concat(this.image.id,"?width=250&thumbnail=true&dummy=").concat(t.getTime()):"/api/image/"+this.image.id+"?width=250"},annotated:function(){return this.image.annotating?this.image.annotating.length>0:0}}},l=r,c=(a("d89f"),a("2877")),u=Object(c["a"])(l,n,i,!1,null,"2318b218",null);u.options.__file="ImageCard.vue";e["a"]=u.exports},"33bc":function(t,e,a){},"36f6":function(t,e,a){"use strict";var n=a("866d"),i=a.n(n);i.a},"37e5":function(t,e,a){},3803:function(t,e,a){"use strict";var n=a("da6d"),i=a.n(n);i.a},"3b3a":function(t,e,a){"use strict";var n=a("1ee6"),i=a.n(n);i.a},4114:function(t,e,a){},4348:function(t,e,a){"use strict";var n=a("2f9b"),i=a.n(n);i.a},"474e":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tags-input-root"},[a("div",{class:t.wrapperClass+" tags-input"},[t._l(t.tagBadges,function(e,n){return a("span",{key:n,staticClass:"tags-input-badge tags-input-badge-pill tags-input-badge-selected-default"},[a("span",{domProps:{innerHTML:t._s(e)}}),a("i",{staticClass:"tags-input-remove",attrs:{href:"#"},on:{click:function(e){e.preventDefault(),t.removeTag(n)}}})])}),a("input",{directives:[{name:"model",rawName:"v-model",value:t.input,expression:"input"}],ref:"taginput",attrs:{type:"text",placeholder:t.showPlaceholder?t.placeholder:""},domProps:{value:t.input},on:{keydown:[function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?(e.preventDefault(),t.tagFromInput(e)):null},function(e){return"button"in e||8===e.keyCode?t.removeLastTag(e):null},function(e){return"button"in e||!t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?t.nextSearchResult(e):null},function(e){return"button"in e||!t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?t.prevSearchResult(e):null},function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.onKeyDown(e)}],keyup:[function(e){return"button"in e||!t._k(e.keyCode,"esc",27,e.key,"Escape")?t.ignoreSearchResults(e):null},function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.searchTag(e)}],focus:t.onFocus,blur:t.hideTypeahead,value:t.tags,input:function(e){e.target.composing||(t.input=e.target.value)}}}),t.elementId?a("input",{directives:[{name:"model",rawName:"v-model",value:t.hiddenInput,expression:"hiddenInput"}],attrs:{type:"hidden",name:t.elementId,id:t.elementId},domProps:{value:t.hiddenInput},on:{input:function(e){e.target.composing||(t.hiddenInput=e.target.value)}}}):t._e()],2),a("div",{directives:[{name:"show",rawName:"v-show",value:t.searchResults.length,expression:"searchResults.length"}]},["badges"===t.typeaheadStyle?a("p",{class:"typeahead-"+t.typeaheadStyle},t._l(t.searchResults,function(e,n){return a("span",{key:n,staticClass:"tags-input-badge",class:{"tags-input-typeahead-item-default":n!=t.searchSelection,"tags-input-typeahead-item-highlighted-default":n==t.searchSelection},domProps:{textContent:t._s(e.text)},on:{mouseover:function(e){t.searchSelection=n},mousedown:function(a){a.preventDefault(),t.tagFromSearchOnClick(e)}}})})):"dropdown"===t.typeaheadStyle?a("ul",{class:"typeahead-"+t.typeaheadStyle},t._l(t.searchResults,function(e,n){return a("li",{key:n,class:{"tags-input-typeahead-item-default":n!=t.searchSelection,"tags-input-typeahead-item-highlighted-default":n==t.searchSelection},domProps:{textContent:t._s(e.text)},on:{mouseover:function(e){t.searchSelection=n},mousedown:function(a){a.preventDefault(),t.tagFromSearchOnClick(e)}}})})):t._e()])])},i=[],o=(a("7514"),a("28a5"),a("55dd"),a("386d"),a("a481"),a("ac6a"),a("456d"),a("c5f6"),{props:{elementId:{type:String,required:!0},existingTags:{type:Object,default:function(){return{}}},value:{type:[Array,String],default:function(){return[]}},typeahead:{type:Boolean,default:!1},typeaheadStyle:{type:String,default:"badges"},typeaheadActivationThreshold:{type:Number,default:1},typeaheadMaxResults:{type:Number,default:0},placeholder:{type:String,default:"Add a category"},limit:{type:Number,default:0},onlyExistingTags:{type:Boolean,default:!1},deleteOnBackspace:{type:Boolean,default:!0},allowDuplicates:{type:Boolean,default:!1},validate:{type:Function,default:function(){return!0}},addTagsOnComma:{type:Boolean,default:!1},wrapperClass:{type:String,default:"tags-input-wrapper-default"}},data:function(){return{badgeId:0,tagBadges:[],tags:[],input:"",oldInput:"",hiddenInput:"",searchResults:[],searchSelection:0}},created:function(){this.tagsFromValue(),this.$emit("initialized")},computed:{showPlaceholder:function(){return!this.onlyExistingTags||this.value.length!==Object.keys(this.existingTags).length}},watch:{tags:function(){this.hiddenInput=this.tags.join(","),this.$emit("input",this.tags)},value:function(){this.tagsFromValue()}},methods:{escapeRegExp:function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},tagFromInput:function(){var t=this.input.trim()!==this.input;if(this.searchResults.length&&this.searchSelection>=0&&!t)this.tagFromSearch(this.searchResults[this.searchSelection]),this.input="";else{var e=this.input.trim();if(!this.onlyExistingTags&&e.length&&this.validate(e)){this.input="";var a=this.makeSlug(e),n=this.existingTags[a];a=n?a:e,e=n||e,this.addTag(a,e)}}},tagFromSearchOnClick:function(t){this.tagFromSearch(t),this.$refs["taginput"].blur()},tagFromSearch:function(t){this.searchResults=[],this.input="",this.oldInput="",this.addTag(t.slug,t.text)},makeSlug:function(t){return t.toLowerCase().replace(/\s/g,"-")},addTag:function(t,e){if(this.limit>0&&this.tags.length>=this.limit)return!1;this.tagSelected(t)||(this.tagBadges.push(e.replace(/\s/g,"&nbsp;")),this.tags.push(t)),this.$emit("tag-added",t),this.$emit("tags-updated")},removeLastTag:function(){!this.input.length&&this.deleteOnBackspace&&this.removeTag(this.tags.length-1)},removeTag:function(t){var e=this.tags[t];this.tags.splice(t,1),this.tagBadges.splice(t,1),this.$emit("tag-removed",e),this.$emit("tags-updated")},searchTag:function(){if(!0===this.typeahead&&(this.oldInput!=this.input||!this.searchResults.length&&0==this.typeaheadActivationThreshold)){this.searchResults=[],this.searchSelection=0;var t=this.input.trim();if(t.length&&t.length>=this.typeaheadActivationThreshold||0==this.typeaheadActivationThreshold){for(var e in this.existingTags){var a=this.existingTags[e].toLowerCase();a.search(this.escapeRegExp(t.toLowerCase()))>-1&&!this.tagSelected(e)&&this.searchResults.push({slug:e,text:this.existingTags[e]})}this.searchResults.sort(function(t,e){return t.text<e.text?-1:t.text>e.text?1:0}),this.typeaheadMaxResults>0&&(this.searchResults=this.searchResults.slice(0,this.typeaheadMaxResults))}this.oldInput=this.input}},onFocus:function(){this.searchTag()},hideTypeahead:function(){var t=this;this.input.length||this.$nextTick(function(){t.ignoreSearchResults()})},nextSearchResult:function(){this.searchSelection+1<=this.searchResults.length-1&&this.searchSelection++},prevSearchResult:function(){this.searchSelection>0&&this.searchSelection--},ignoreSearchResults:function(){this.searchResults=[],this.searchSelection=0},clearTags:function(){this.tags.splice(0,this.tags.length),this.tagBadges.splice(0,this.tagBadges.length)},tagsFromValue:function(){var t=this;if(this.value&&this.value.length){var e=Array.isArray(this.value)?this.value:this.value.split(",");if(this.tags==e)return;this.clearTags(),e.forEach(function(e){var a=t.existingTags[e],n=a||e;t.addTag(e,n)})}else{if(0==this.tags.length)return;this.clearTags()}},tagSelected:function(t){var e=this;if(this.allowDuplicates)return!1;if(!t)return!1;var a=this.makeSlug(t),n=this.tags.find(function(t){return a==e.makeSlug(t)});return!!n},onKeyDown:function(t){","==t.key&&this.addTagsOnComma&&(t.preventDefault(),this.tagFromInput())}}}),s=o,r=(a("7e98"),a("2877")),l=Object(r["a"])(s,n,i,!1,null,null,null);l.options.__file="TagsInput.vue";e["a"]=l.exports},"4bf7":function(t,e,a){"use strict";var n=a("7511"),i=a.n(n);i.a},"4c8c":function(t,e,a){"use strict";var n=a("27e3"),i=a.n(n);i.a},"4dc3":function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"btn btn-outline-light tool-input-button",class:{active:t.value},on:{click:function(e){t.$emit("update",!t.value)}}},[t._v("\n  "+t._s(t.name)+"\n")])},i=[],o=(a("cadf"),a("551c"),a("097d"),{name:"ToggleButton",model:{prop:"value",event:"update"},props:{name:{type:String,required:!0},value:{type:Boolean,required:!0}}}),s=o,r=(a("f367"),a("2877")),l=Object(r["a"])(s,n,i,!1,null,"3ce95b90",null);l.options.__file="PanelToggle.vue";e["a"]=l.exports},"52e4":function(t,e,a){},"53bf":function(t,e,a){"use strict";var n=a("daca"),i=a.n(n);i.a},"56d7":function(t,e,a){"use strict";a.r(e);a("cadf"),a("551c"),a("097d"),a("5abe");var n=a("a026"),i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"app"}},[a("NavBar",{directives:[{name:"show",rawName:"v-show",value:t.showNavBar,expression:"showNavBar"}]}),a("RouterView",{key:t.$route.fullPath})],1)},o=[],s=(a("7f7f"),a("be94")),r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("nav",{staticClass:"navbar navbar-expand-lg navbar-dark fixed-top"},[a("i",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.backendStatus,expression:"backendStatus"}],staticClass:"fa fa-circle",staticStyle:{padding:"0 10px","font-size":"10px"},style:{color:t.color}}),a("RouterLink",{staticClass:"navbar-brand",attrs:{to:"/"}},[a("strong",[t._v(t._s(t.name))]),a("span",{staticClass:"subscript"},[t._v(t._s(t.version))])]),t._m(0),a("div",{staticClass:"collapse navbar-collapse",attrs:{id:"navbarSupportedContent"}},[a("ul",{staticClass:"navbar-nav mr-auto"},[a("li",{staticClass:"nav-item",class:{active:"datasets"===t.$route.name||"dataset"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link",attrs:{to:"/datasets"}},[t._v("Datasets")])],1),a("li",{directives:[{name:"show",rawName:"v-show",value:"annotate"===t.$route.name,expression:"$route.name === 'annotate'"}],staticClass:"nav-item",class:{active:"annotate"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link",attrs:{to:"/dataset/"+t.dataset.id}},[t._v("\n          "+t._s(t.dataset.name)+"\n        ")])],1),a("li",{staticClass:"nav-item",class:{active:"categories"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link",attrs:{to:"/categories"}},[t._v("Categories")])],1),a("li",{staticClass:"nav-item",class:{active:"undo"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link",attrs:{to:"/undo"}},[t._v("Undo")])],1),a("li",{staticClass:"nav-item",class:{active:"tasks"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link",attrs:{to:"/tasks"}},[t._v("Tasks")])],1),a("li",{directives:[{name:"show",rawName:"v-show",value:t.$store.getters["user/isAdmin"],expression:"$store.getters['user/isAdmin']"}],staticClass:"nav-item",class:{active:"admin"===t.$route.name}},[a("RouterLink",{staticClass:"nav-link d-none d-xl-block",attrs:{to:"/admin/panel"}},[t._v("Admin")])],1),t._m(1),t._m(2)]),a("Status",{staticClass:"nav-link left"}),t.loginEnabled?a("User",{staticClass:"nav-link left"}):t._e()],1)],1)},l=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"navbar-toggler",attrs:{type:"button","data-toggle":"collapse","data-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"}},[a("span",{staticClass:"navbar-toggler-icon"})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",{staticClass:"nav-item d-none d-xl-block"},[a("a",{staticClass:"nav-link",attrs:{href:"/api"}},[t._v("API")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",{staticClass:"nav-item d-none d-xl-block"},[a("a",{staticClass:"nav-link",attrs:{href:"https://github.com/jsbroks/coco-annotator/wiki"}},[t._v("Help")])])}],c=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-inline my-2 my-lg-0",staticStyle:{"margin-right":"10px"}},[a("div",{staticClass:"dropdown show"},[a("a",{staticClass:"btn-outline-light btn-sm dropdown-toggle",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[t._v("\n      "+t._s(t.display)+"\n    ")]),a("ul",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink",role:"menu"}},[a("li",[a("a",{directives:[{name:"show",rawName:"v-show",value:t.$store.getters["user/isAdmin"],expression:"$store.getters['user/isAdmin']"}],staticClass:"dropdown-item",attrs:{href:"#"}},[a("RouterLink",{staticClass:"route",attrs:{to:"/admin/panel"}},[t._v("Admin Panel")])],1)]),a("li",[a("a",{staticClass:"dropdown-item",attrs:{href:"#"}},[a("RouterLink",{staticClass:"route",attrs:{to:"/user"}},[t._v("User Settings")])],1)]),a("li",[a("a",{staticClass:"dropdown-item",attrs:{href:"#"},on:{click:t.logoutButton}},[t._v("Logout")])])])])])},u=[],d=(a("a481"),a("2f62")),h={name:"User",methods:Object(s["a"])({},Object(d["b"])("user",["logout"]),{logoutButton:function(){"annotate"!==this.$route.name?this.logout():this.$router.replace({name:"datasets"},this.logout)}}),computed:{user:function(){return this.$store.state.user.user},display:function(){return this.user?0===this.user.name.length?this.user.username:this.user.name:""}}},p=h,m=(a("4bf7"),a("2877")),g=Object(m["a"])(p,c,u,!1,null,"a8f7db5e",null);g.options.__file="User.vue";var f=g.exports,v=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"form-inline my-2 my-lg-0",staticStyle:{"margin-right":"10px"}},[a("div",{staticClass:"my-sm-0 btn-sm disabled",class:t.buttonType,staticStyle:{border:"none"}},[t.allLoaded?a("i",{staticClass:"fa fa-check fa-x status-icon",staticStyle:{float:"left"}}):a("i",{staticClass:"fa fa-spinner fa-pulse fa-x fa-fw status-icon"}),t._v("\n    "+t._s(t.message)+"\n  ")])])},y=[],b={name:"Status",data:function(){return{lastProcess:""}},computed:{buttonType:function(){return this.allLoaded?"btn-outline-success":"btn-outline-danger"},process:function(){return this.$store.state.process},message:function(){return this.process.length>1?"Multiple tasks running ...":1===this.process.length?this.process[0]:""===this.lastProcess?"Done":"Done "+this.lastProcess.charAt(0).toLowerCase()+this.lastProcess.slice(1)},allLoaded:function(){return 0===this.process.length}},watch:{process:function(){1===this.process.length&&(this.lastProcess=this.process[0])}}},C=b,_=(a("e300"),Object(m["a"])(C,v,y,!1,null,"56165909",null));_.options.__file="Status.vue";var w=_.exports,k={name:"NavBar",components:{Status:w,User:f},data:function(){return{color:"white",backendStatus:"Connection unknown"}},computed:{version:function(){return this.$store.state.info.version},loginEnabled:function(){return this.$store.state.info.loginEnabled},name:function(){return this.$store.state.info.name},socket:function(){return this.$store.state.info.socket},dataset:function(){var t=this.$store.state.dataset;return null==t?{name:"",id:""}:t}},watch:{socket:function(t){if(null==t)return this.color="white",void(this.backendStatus="Connection unknown");t?(this.color="green",this.backendStatus="Connected to backend"):(this.color="red",this.backendStatus="Could not connect to backend")}}},x=k,P=(a("5e63"),Object(m["a"])(x,r,l,!1,null,"766d3a38",null));P.options.__file="NavBar.vue";var A=P.exports,S={name:"App",components:{NavBar:A},methods:Object(s["a"])({},Object(d["c"])("user",["setUserInfo"]),Object(d["c"])("info",["getServerInfo","socket"]),{toAuthPage:function(){this.$router.push({name:"authentication"})}}),data:function(){return{loader:null}},computed:{showNavBar:function(){var t=["authentication","setup"];return-1===t.indexOf(this.$route.name)},isAuthenticated:function(){return this.$store.state.user.isAuthenticated},isAuthenticatePending:function(){return this.$store.state.user.isAuthenticatePending},loginRequired:function(){return!this.isAuthenticatePending&&!this.isAuthenticated},loading:function(){return this.$store.state.info.loading},socketConnection:function(){return this.$store.state.info.socket}},watch:{loading:function(){this.loading||null==this.loader||this.loader.hide()},socketConnection:function(){var t=this;this.socketConnection||setTimeout(function(){if(!t.socketConnection){var e={positionClass:"toast-bottom-left"};t.$toastr.warning("Connection lost to the backend","Connection Lost",e)}},1e3)},loginRequired:{handler:function(t){t?this.toAuthPage():"authentication"==this.$router.name&&this.$router.push({name:"datasets"})},immediate:!0}},sockets:{connect:function(){this.socket(!0)},disconnect:function(){this.socket(!1)}},mounted:function(){"annotate"!==this.$route.name.toLowerCase()&&(this.loader=this.$loading.show({height:100}))},created:function(){this.setUserInfo(),this.getServerInfo()}},O=S,$=(a("034f"),Object(m["a"])(O,i,o,!1,null,null,null));$.options.__file="App.vue";var E=$.exports,T=a("8c4f"),D=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},I=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("h1",[t._v("Web-based Image Annotaiton Tool")])])}],j={name:"Admin"},L=j,N=Object(m["a"])(L,D,I,!1,null,null,null);N.options.__file="About.vue";var B=N.exports,M=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{display:"block",height:"inherit"}},[a("aside",{directives:[{name:"show",rawName:"v-show",value:t.panels.show.left,expression:"panels.show.left"}],staticClass:"left-panel shadow-lg"},[a("div",{directives:[{name:"show",rawName:"v-show",value:"segment"==t.mode,expression:"mode == 'segment'"}]},[a("hr"),a("SelectTool",{ref:"select",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("hr"),a("BBoxTool",{ref:"bbox",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("PolygonTool",{ref:"polygon",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("MagicWandTool",{ref:"magicwand",attrs:{width:t.image.raster.width,height:t.image.raster.height,"image-data":t.image.data},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("BrushTool",{ref:"brush",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("EraserTool",{ref:"eraser",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("KeypointTool",{ref:"keypoint",on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}}),a("DEXTRTool",{ref:"dextr",attrs:{scale:t.image.scale},on:{setcursor:t.setCursor},model:{value:t.activeTool,callback:function(e){t.activeTool=e},expression:"activeTool"}})],1),a("hr"),a("AnnotateButton",{attrs:{"annotate-url":t.dataset.annotate_url}}),a("div",{directives:[{name:"show",rawName:"v-show",value:"segment"==t.mode,expression:"mode == 'segment'"}]},[a("CopyAnnotationsButton",{attrs:{categories:t.categories,"image-id":t.image.id,next:t.image.next,previous:t.image.previous}}),a("ShowAllButton"),a("HideAllButton")],1),a("hr"),a("CenterButton"),a("UndoButton"),a("hr"),a("DownloadButton",{attrs:{image:t.image}}),a("SaveButton"),a("ModeButton",{model:{value:t.mode,callback:function(e){t.mode=e},expression:"mode"}}),a("SettingsButton",{ref:"settings",attrs:{metadata:t.image.metadata,commands:t.commands}}),a("hr"),a("DeleteButton",{attrs:{image:t.image}})],1),a("aside",{directives:[{name:"show",rawName:"v-show",value:t.panels.show.right,expression:"panels.show.right"}],staticClass:"right-panel shadow-lg"},[a("hr"),a("FileTitle",{ref:"filetitle",attrs:{previousimage:t.image.previous,nextimage:t.image.next,filename:t.image.filename}}),t.categories.length>5?a("div",[a("div",{staticStyle:{padding:"0px 5px"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"search",attrs:{placeholder:"Category Search"},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}})])]):t._e(),a("div",{staticClass:"sidebar-section",style:{"max-height":"label"==t.mode?"100%":"57%"}},[0==t.categories.length?a("p",{staticStyle:{color:"lightgray","font-size":"12px"}},[t._v("\n        No categories have been enabled for this image.\n      ")]):t._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:"segment"==t.mode,expression:"mode == 'segment'"}],staticStyle:{overflow:"auto","max-height":"100%"}},t._l(t.categories,function(e,n){return a("Category",{key:e.id+"-category",ref:"category",refInFor:!0,attrs:{simplify:t.simplify,categorysearch:t.search,category:e,"all-categories":t.categories,opacity:t.shapeOpacity,hover:t.hover,index:n,current:t.current,"active-tool":t.activeTool,scale:t.image.scale},on:{click:t.onCategoryClick,"keypoints-complete":t.onKeypointsComplete}})})),a("div",{directives:[{name:"show",rawName:"v-show",value:"label"==t.mode,expression:"mode == 'label'"}],staticStyle:{overflow:"auto","max-height":"100%"}},t._l(t.categories,function(e){return a("CLabel",{key:e.id+"-label",attrs:{category:e,search:t.search},model:{value:t.image.categoryIds,callback:function(e){t.$set(t.image,"categoryIds",e)},expression:"image.categoryIds"}})}))]),a("div",{directives:[{name:"show",rawName:"v-show",value:"segment"==t.mode,expression:"mode == 'segment'"}]},[a("hr"),a("h6",{staticClass:"sidebar-title text-center"},[t._v(t._s(t.activeTool))]),a("div",{staticClass:"tool-section",staticStyle:{"max-height":"30%",color:"lightgray"}},[null!=t.$refs.bbox?a("div",[a("BBoxPanel",{attrs:{bbox:t.$refs.bbox}})],1):t._e(),null!=t.$refs.polygon?a("div",[a("PolygonPanel",{attrs:{polygon:t.$refs.polygon}})],1):t._e(),null!=t.$refs.select?a("div",[a("SelectPanel",{attrs:{select:t.$refs.select}})],1):t._e(),null!=t.$refs.magicwand?a("div",[a("MagicWandPanel",{attrs:{magicwand:t.$refs.magicwand}})],1):t._e(),null!=t.$refs.brush?a("div",[a("BrushPanel",{attrs:{brush:t.$refs.brush}})],1):t._e(),null!=t.$refs.eraser?a("div",[a("EraserPanel",{attrs:{eraser:t.$refs.eraser}})],1):t._e(),null!=t.$refs.keypoint?a("div",[a("KeypointPanel",{attrs:{keypoint:t.$refs.keypoint,"current-annotation":t.currentAnnotation}})],1):t._e(),null!=t.$refs.dextr?a("div",[a("DEXTRPanel",{attrs:{dextr:t.$refs.dextr}})],1):t._e()])])],1),a("div",{staticClass:"middle-panel",style:{cursor:t.cursor}},[a("v-touch",{on:{pinch:t.onpinch,pinchstart:t.onpinchstart}},[a("div",{staticClass:"frame",attrs:{id:"frame"},on:{wheel:t.onwheel}},[a("canvas",{ref:"image",staticClass:"canvas",attrs:{id:"editor",resize:""}})])])],1),a("div",{directives:[{name:"show",rawName:"v-show",value:t.annotating.length>0,expression:"annotating.length > 0"}],staticClass:"fixed-bottom alert alert-warning alert-dismissible fade show"},[a("span",[t._v("\n    This image is being annotated by "),a("b",[t._v(t._s(t.annotating.join(", ")))]),t._v(".\n    ")]),t._m(0)])])},U=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"alert","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],K=(a("7514"),a("ac6a"),a("c5f6"),a("2222")),F=a.n(K),R=a("bc3a"),q=a.n(R),V=a("9e59"),W={data:function(){return{commands:[]}},methods:Object(s["a"])({},Object(d["c"])(["undo"]),{annotator:function(){var t=this;return[{default:["arrowup"],function:this.moveUp,name:"Move Up Annotations"},{default:["arrowdown"],function:this.moveDown,name:"Move Down Annotations"},{default:["arrowright"],function:this.stepIn,name:"Expand Category"},{default:["arrowleft"],function:this.stepOut,name:"Collapse Category"},{default:["space"],name:"New Annotation",function:function(){t.currentCategory&&t.currentCategory.createAnnotation()}},{default:["backspace"],name:"Delete Current Annotation",function:function(){if(t.currentAnnotation){var e=t.currentAnnotation.currentKeypoint;e?(t.currentAnnotation.keypoints.deleteKeypoint(e),t.currentAnnotation.tagRecomputeCounter++,t.currentAnnotation.currentKeypoint=null):t.currentAnnotation.deleteAnnotation()}}},{default:["control","z"],name:"Undo Last Action",function:this.undo},{default:["s"],name:"Select Tool",function:function(){t.activeTool="Select"}},{default:["r"],name:"BBox Tool",function:function(){t.$refs.polygon.isDisabled||(t.activeTool="BBox")}},{default:["n"],name:"Next Image",function:this.nextImage},{default:["p"],name:"Previous Image",function:this.previousImage},{default:["v"],name:"Polygon Tool",function:function(){t.$refs.polygon.isDisabled||(t.activeTool="Polygon")}},{default:["w"],name:"Magic Wand Tool",function:function(){t.$refs.magicwand.isDisabled||(t.activeTool="Magic Wand")}},{default:["k"],name:"Keypoints Tool",function:function(){t.$refs.magicwand.isDisabled||(t.activeTool="Keypoints")}},{default:["b"],name:"Brush Tool",function:function(){t.$refs.brush.isDisabled||(t.activeTool="Brush")}},{default:["e"],name:"Eraser Tool",function:function(){t.$refs.eraser.isDisabled||(t.activeTool="Eraser")}},{default:["c"],name:"Center Image",function:this.fit},{default:["control","s"],name:"Save",function:this.save},{title:"BBox Tool Shortcuts",default:["escape"],name:"Remove Current BBox",function:this.$refs.bbox.deletePolygon},{title:"Polygon Tool Shortcuts",default:["escape"],name:"Remove Current Polygon",function:this.$refs.polygon.deletePolygon},{title:"Eraser Tool Shortcuts",default:["["],name:"Increase Radius",function:this.$refs.eraser.increaseRadius},{default:["]"],name:"Decrease Radius",function:this.$refs.eraser.decreaseRadius},{title:"Brush Tool Shortcuts",default:["["],name:"Increase Radius",function:this.$refs.brush.increaseRadius},{default:["]"],name:"Decrease Radius",function:this.$refs.brush.decreaseRadius},{title:"Magic Tool Shortcuts",default:["shift","click"],name:"Subtract Selection",readonly:!0}]}}),mounted:function(){"annotate"===this.$route.name&&(this.commands=this.annotator())}},z=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("i",{directives:[{name:"show",rawName:"v-show",value:null!=t.previousimage,expression:"previousimage != null"}],staticClass:"fa fa-arrow-left image-arrows",staticStyle:{float:"left"},on:{click:function(e){t.route(t.previousimage)}}}),a("i",{directives:[{name:"show",rawName:"v-show",value:null!=t.nextimage,expression:"nextimage != null"}],staticClass:"fa fa-arrow-right image-arrows",staticStyle:{float:"right"},on:{click:function(e){t.route(t.nextimage)}}}),a("h6",{staticClass:"text-center",staticStyle:{color:"white"}},[a("span",{staticClass:"d-inline-block text-truncate",staticStyle:{"max-width":"73%"}},[t._v(t._s(t.filename))])])])},H=[],Y={name:"FileTitle",props:{filename:{type:String,required:!0},previousimage:{type:Number,default:null},nextimage:{type:Number,default:null}},methods:{route:function(t){var e=this;this.$parent.current.annotation=-1,this.$nextTick(function(){e.$parent.save(function(){e.$router.push({name:"annotate",params:{identifier:t}})})})}}},G=Y,X=(a("9ed2"),Object(m["a"])(G,z,H,!1,null,"077f9a6a",null));X.options.__file="FileTitle.vue";var J=X.exports,Q=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.showCategory,expression:"showCategory"}],staticClass:"card",style:{"background-color":t.backgroundColor,"border-color":t.borderColor}},[a("div",{staticClass:"card-header",attrs:{id:"heading"+t.category.id}},[a("div",{style:{color:t.isVisible?"white":"gray"}},[a("div",{on:{click:t.onEyeClick}},[t.isVisible?a("i",{staticClass:"fa fa-eye category-icon",style:{color:t.showAnnotations?"white":t.color},attrs:{"aria-hidden":"true"}}):a("i",{staticClass:"fa fa-eye-slash category-icon",attrs:{"aria-hidden":"true"}})]),a("button",{staticClass:"btn btn-link btn-sm collapsed category-text",staticStyle:{color:"inherit"},attrs:{"aria-expanded":"false","aria-controls":"collapse"+t.category.id},on:{click:t.onClick}},[t._v("\n        "+t._s(t.category.name)+" ("+t._s(t.category.annotations.length)+")\n      ")]),a("i",{staticClass:"fa fa-gear category-icon",staticStyle:{float:"right",color:"white"},attrs:{"data-toggle":"modal","data-target":"#categorySettings"+t.category.id,"aria-hidden":"true"}}),a("i",{staticClass:"fa fa-plus category-icon",staticStyle:{float:"right",color:"white","padding-right":"0"},attrs:{"aria-hidden":"true"},on:{click:t.createAnnotation}})])]),a("ul",{directives:[{name:"show",rawName:"v-show",value:t.showAnnotations,expression:"showAnnotations"}],ref:"collapse",staticClass:"list-group"},[a("li",{directives:[{name:"show",rawName:"v-show",value:this.category.annotations.length>1,expression:"this.category.annotations.length > 1"}],staticClass:"list-group-item btn btn-link btn-sm text-left",style:{"background-color":t.backgroundColor,color:"white"}},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],staticClass:"annotation-search",attrs:{placeholder:"Search"},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}})]),t._l(t.category.annotations,function(e,n){return a("Annotation",{key:e.id,ref:"annotation",refInFor:!0,attrs:{search:t.search,simplify:t.simplify,annotation:e,current:t.current.annotation,opacity:t.opacity,index:n,"keypoint-edges":t.keypoint.edges,"keypoint-labels":t.keypoint.labels,"keypoint-colors":t.keypoint.colors,hover:t.hover.annotation,"active-tool":t.activeTool,scale:t.scale,"all-categories":t.getCategoriesList},on:{click:function(e){t.onAnnotationClick(n)},"keypoint-click":function(e){t.onKeypointClick(n,e)},"keypoints-complete":function(e){t.$emit("keypoints-complete")},deleted:t.annotationDeleted}})})],2),a("div",{ref:"category_settings",staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"categorySettings"+t.category.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v(t._s(t.category.name))]),t._m(0)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Supercategory")]),a("input",{staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.supercategory},on:{input:function(e){t.supercategory=e.target.value}}})]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-2 col-form-label"},[t._v("Color")]),a("div",{staticClass:"col-sm-9"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.color,expression:"color"}],staticClass:"form-control",attrs:{type:"color"},domProps:{value:t.color},on:{input:function(e){e.target.composing||(t.color=e.target.value)}}})])]),a("div",{staticClass:"form-group"},[a("KeypointsDefinition",{ref:"keypoints",attrs:{"element-id":"keypointLabels"},model:{value:t.keypoint,callback:function(e){t.keypoint=e},expression:"keypoint"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-success",class:{disabled:!t.isFormValid},attrs:{type:"button",disabled:!t.isFormValid,"data-dismiss":"modal"},on:{click:t.onUpdateClick}},[t._v("Update")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])])},Z=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],tt=(a("6762"),a("2fdb"),a("20d6"),a("386d"),a("2909")),et="/api/annotation/",at={create:function(t){return q.a.post(et,t)},delete:function(t){return q.a.delete("".concat(et).concat(t))},update:function(t,e){return q.a.put("".concat(et).concat(t),e)}},nt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{on:{mouseenter:t.onMouseEnter,mouseleave:t.onMouseLeave}},[a("li",{directives:[{name:"show",rawName:"v-show",value:t.showSideMenu,expression:"showSideMenu"}],staticClass:"list-group-item btn btn-link btn-sm text-left",style:{"background-color":t.backgroundColor,color:"white"}},[a("div",{on:{click:function(e){t.isVisible=!t.isVisible}}},[t.isVisible?a("i",{staticClass:"fa fa-eye annotation-icon",style:{float:"left","padding-right":"10px",color:t.color}}):a("i",{staticClass:"fa fa-eye-slash annotation-icon",staticStyle:{float:"left","padding-right":"10px",color:"gray"}})]),a("button",{staticClass:"btn btn-sm btn-link collapsed text-left annotation-text",style:{float:"left",width:"70%",color:t.isVisible?"white":"gray"},attrs:{"aria-expanded":"false","aria-controls":"collapse_keypoints"+t.annotation.id},on:{click:function(e){t.onAnnotationClick(!t.showKeypoints)}}},[0===t.name.length?[t._v("\n        "+t._s(t.index+1)+"\n      ")]:[t._v(" "+t._s(t.name)+" ")],t._v("\n      "+t._s(t.annotation.name)+"\n      "),t.isEmpty?a("i",{staticStyle:{"padding-left":"5px",color:"lightgray"}},[t._v("(Empty)")]):a("i",{staticStyle:{"padding-left":"5px",color:"lightgray"}},[t._v("(id: "+t._s(t.annotation.id)+")")])],2),a("i",{staticClass:"fa fa-gear annotation-icon",staticStyle:{float:"right"},attrs:{"data-toggle":"modal","data-target":"#annotationSettings"+t.annotation.id}}),a("i",{staticClass:"fa fa-trash-o annotation-icon",staticStyle:{float:"right"},on:{click:t.deleteAnnotation}})]),a("ul",{directives:[{name:"show",rawName:"v-show",value:t.showKeypoints,expression:"showKeypoints"}],ref:"collapse_keypoints",staticClass:"list-group keypoint-list"},t._l(t.keypointListView,function(e,n){return a("li",{key:n,staticClass:"list-group-item text-left keypoint-item",style:{"background-color":e.backgroundColor}},[a("div",[a("i",{staticClass:"fa fa-map-marker keypoint-icon",style:{color:e.iconColor}})]),a("a",{style:{float:"left",width:"70%",color:"white"},on:{click:function(e){t.onAnnotationKeypointClick(n)}}},[a("span",[t._v(" "+t._s(e.label)+" ")])]),0!==e.visibility?a("i",{staticClass:"fa fa-gear annotation-icon",staticStyle:{float:"right",color:"lightgray"},attrs:{"data-toggle":"modal","data-target":"#keypointSettings"+t.annotation.id},on:{click:function(e){t.onAnnotationKeypointSettingsClick(n)}}}):t._e(),0!==e.visibility?a("i",{staticClass:"fa fa-trash-o annotation-icon",staticStyle:{float:"right",color:"lightgray"},on:{click:function(e){t.onDeleteKeypointClick(n)}}}):t._e()])})),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"keypointSettings"+t.annotation.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("\n            "+t._s(t.getKeypointLabel(t.currentKeypoint))+"\n          ")]),t._m(0)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-3 col-form-label"},[t._v("Visibility")]),a("div",{staticClass:"col-sm-8"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.keypoint.visibility,expression:"keypoint.visibility"}],staticClass:"form-control",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.$set(t.keypoint,"visibility",e.target.multiple?a:a[0])}}},t._l(t.visibilityOptions,function(e,n){return a("option",{key:n,domProps:{value:n,selected:t.keypoint.visibility==n}},[t._v(t._s(e))])}))])])])]),t._m(1)])])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"annotationSettings"+t.annotation.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("\n            "+t._s(t.index+1)+"\n            "),a("i",{staticStyle:{color:"darkgray"}},[t._v("(id: "+t._s(t.annotation.id)+")")])]),t._m(2)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-3 col-form-label"},[t._v("Color")]),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.color,expression:"color"}],staticClass:"form-control",attrs:{type:"color"},domProps:{value:t.color},on:{input:function(e){e.target.composing||(t.color=e.target.value)}}})])]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-3 col-form-label"},[t._v("Name")]),a("div",{staticClass:"col-sm-8"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],staticClass:"form-control",domProps:{value:t.name},on:{input:function(e){e.target.composing||(t.name=e.target.value)}}})])]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-3 col-form-label"},[t._v("Category")]),a("div",{staticClass:"col-sm-8"},[a("select",{staticClass:"form-control",on:{change:t.setCategory}},t._l(t.allCategories,function(e){return a("option",{key:e.text,domProps:{selected:t.annotation.category_id===e.value}},[t._v("\n                    "+t._s(e.text)+"\n                  ")])}))])]),a("Metadata",{ref:"metadata",attrs:{metadata:t.annotation.metadata,exclude:"name"}})],1)]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-danger",attrs:{type:"button","data-dismiss":"modal"},on:{click:t.deleteAnnotation}},[t._v("\n            Delete\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])])},it=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],ot=(a("456d"),a("6b54"),a("55f9")),st=a.n(ot),rt=a("1157"),lt=a.n(rt),ct=(a("4f7f"),a("5df3"),a("1c4c"),a("8615"),a("d4ec")),ut=a("bee2"),dt=a("99de"),ht=a("7e84"),pt=a("45eb"),mt=a("262e"),gt=function(t){function e(t,a,n,i){var o;Object(ct["a"])(this,e),o=Object(dt["a"])(this,Object(ht["a"])(e).call(this)),i=i||{},o._edges={},o._lines={},o._labelled={},o._keypoints=[],o.labels=a,o.colors={};for(var s=0;s<n.length;++s)o.colors[String(s+1)]=n[s];return o.annotationId=i.annotationId,o.categoryName=i.categoryName,o.strokeColor=i.strokeColor||"red",o.lineWidth=i.strokeWidth||4,t=t||[],t.forEach(function(t){return o.addEdge(t)}),o}return Object(mt["a"])(e,t),Object(ut["a"])(e,[{key:"isEmpty",value:function(){return 0===this._keypoints.length}},{key:"bringToFront",value:function(){Object(pt["a"])(Object(ht["a"])(e.prototype),"bringToFront",this).call(this),Object.values(this._lines).forEach(function(t){return t.bringToFront()}),this._keypoints.forEach(function(t){return t.path.bringToFront()})}},{key:"addKeypoint",value:function(t){t.keypoints=this,t.path.keypoints=this,t.strokeColor=this.strokeColor,t.path.strokeWidth=this.strokeWidth;var e=t.indexLabel;this._labelled.hasOwnProperty(e)?t.indexLabel=-1:this._labelled[e]=t,this._keypoints.push(t),this.addChild(t.path),this._drawLines(t),t.path.bringToFront()}},{key:"deleteKeypoint",value:function(t){var e=this,a=t.indexLabel;this._labelled.hasOwnProperty(a)&&delete this._labelled[a],this._edges.hasOwnProperty(a)&&this._edges[a].forEach(function(t){return e.removeLine([t,a])});var n=this._keypoints.findIndex(function(e){return e==t});n>-1&&this._keypoints.splice(n,1),t.path.remove()}},{key:"moveKeypoint",value:function(t,e){var a=this,n=e.indexLabel,i=this._edges[n];i&&i.forEach(function(i){var o=a.getLine([i,n]);if(o)for(var s=0;s<o.segments.length;s++){var r=o.segments[s];if(r.point.isClose(e,0)){r.point=t;break}}}),e.move(t),e.path.bringToFront()}},{key:"exportJSON",value:function(t,e,a){for(var n=[],i=0;i<t.length;i++){var o=3*i;n[o]=0,n[o+1]=0,n[o+2]=0}return this._keypoints.forEach(function(t){var i=new F.a.Point(e/2,a/2),o=t.clone().add(i),s=t.indexLabel;-1==s?n.push.apply(n,[Math.round(o.x),Math.round(o.y),t.visibility]):(s=3*(s-1),n[s]=Math.round(o.x),n[s+1]=Math.round(o.y),n[s+2]=Math.round(t.visibility))}),n}},{key:"contains",value:function(t){return this._keypoints.findIndex(function(e){return e.path.contains(t)})>-1}},{key:"edges",value:function(){for(var t=[],e=Object.keys(this._edges),a=0;a<e.length;a++)for(var n=parseInt(e[a]),i=Array.from(this._edges[n]),o=0;o<i.length;o++){var s=parseInt(i[o]);s<n||t.push([n,s])}return t}},{key:"addEdge",value:function(t){if(2===t.length){var e=t[0],a=t[1];if("string"==typeof e&&(e=this.getLabelIndex(e)),"string"==typeof a&&(a=this.getLabelIndex(a)),!(e<0||a<0)){this._addEdgeIndex(e,a),this._addEdgeIndex(a,e);var n=this._labelled[e],i=this._labelled[a];n&&i&&this._drawLine(t,n,i)}}}},{key:"getLabelIndex",value:function(t){return this.labels.find(function(e){return e==t})}},{key:"_addEdgeIndex",value:function(t,e){this._edges.hasOwnProperty(t)?this._edges[t].has(e)||this._edges[t].add(e):this._edges[t]=new Set([e])}},{key:"_drawLines",value:function(t){var e=this;if(!(t.indexLabel<0)&&this._edges.hasOwnProperty(t.indexLabel)){var a=this._edges[t.indexLabel];a.forEach(function(a){var n=e._labelled[a];if(n){var i=[t.indexLabel,a];e._drawLine(i,t,n)}})}}},{key:"_drawLine",value:function(t,e,a){var n=this._hashEdge(t);if(!this._lines[n]){var i=new F.a.Path.Line(e,a);i.strokeColor=this.strokeColor,i.strokeWidth=this.lineWidth,i.indicator=!0,i.insertAbove(a.path),this._lines[n]=i}}},{key:"removeLine",value:function(t){var e=this._hashEdge(t),a=this._lines[e];a&&(a.remove(),delete this._lines[e])}},{key:"getLine",value:function(t){var e=this._hashEdge(t);return this._lines[e]}},{key:"_hashEdge",value:function(t){var e=Math.min(t[0],t[1]),a=Math.max(t[0],t[1]),n=e+a;return.5*n*(n-1)-a}},{key:"visible",set:function(t){this._visible=t,this._keypoints.forEach(function(e){return e.visible=t}),Object.values(this._lines).forEach(function(e){return e.visible=t})},get:function(){return this._visible}},{key:"color",set:function(t){var e=this;this._color=t,this.strokeColor=t,this._keypoints.forEach(function(a){a.fillColor=e.colors[a.indexLabel],a.strokeColor=t}),Object.values(this._lines).forEach(function(e){return e.strokeColor=t})},get:function(){return this._color}},{key:"lineWidth",set:function(t){this._lineWidth=t,this.strokeWidth=t,this._keypoints.forEach(function(e){return e.path.storkeWidth=t}),Object.values(this._lines).forEach(function(e){return e.strokeWidth=t})},get:function(){return this._lineWidth}},{key:"radius",set:function(t){this._radius=t,this._keypoints.forEach(function(e){return e.radius=t})},get:function(){return this._radius}}]),e}(F.a.Group),ft={NOT_LABELED:0,LABELED_NOT_VISIBLE:1,LABELED_VISIBLE:2,UNKNOWN:3},vt=function(){var t={};for(var e in ft)"UNKNOWN"!==e&&(t[ft[e]]=e.replace("_"," "));return t}(),yt=function(t){function e(t,a,n){var i;return Object(ct["a"])(this,e),i=Object(dt["a"])(this,Object(ht["a"])(e).call(this,t,a)),n=n||{},i.path=null,i.label=n.label||"",i.radius=n.radius||5,i.indexLabel=n.indexLabel||-1,i.visibility=n.visibility||ft.NOT_LABELED,i.visible=n.visible||!0,i.onClick=n.onClick,i.onDoubleClick=n.onDoubleClick,i.onMouseDrag=n.onMouseDrag,i._draw(),i.fillColor=n.fillColor||"red",i.strokeColor=n.strokeColor||"red",i.updateFillColor(),i}return Object(mt["a"])(e,t),Object(ut["a"])(e,[{key:"move",value:function(t){this.x=t.x,this.y=t.y,this._draw()}},{key:"_draw",value:function(){var t=this.strokeColor;null!==this.path&&(t=this.path.strokeColor,this.path.remove()),this.path=new F.a.Path.Circle(this,this.radius),this.path.onMouseDown=this.onMouseDown,this.path.onMouseUp=this.onMouseUp,this.path.onMouseDrag=this.onMouseDrag,this.path.onDoubleClick=this.onDoubleClick,this.path.onClick=this.onClick,this.path.indicator=!0,this.path.strokeColor=t,this.path.strokeWidth=.4*this.radius,this.path.visible=this.visible,this.path.keypoint=this,this.path.keypoints=this.keypoints,this.updateFillColor()}},{key:"getVisibilityDescription",value:function(){return vt[this.visibility]}},{key:"updateFillColor",value:function(){if(null!=this.path)switch(this.visibility){case ft.NOT_LABELED:this.path.fillColor="black";break;case ft.LABELED_NOT_VISIBLE:this.path.fillColor="white";break;default:this.path.fillColor=this.fillColor}}},{key:"visible",set:function(t){this._visible=t,this.path.visible=t},get:function(){return this._visible}},{key:"visibility",set:function(t){this._visibility=t,this.updateFillColor()},get:function(){return this._visibility}},{key:"radius",set:function(t){this._radius=t,this._draw()},get:function(){return this._radius}},{key:"strokeColor",set:function(t){this._strokeColor=t,this.path.strokeColor=this.selected?"white":t,this.updateFillColor()},get:function(){return this._strokeColor}},{key:"fillColor",set:function(t){this._fillColor=t,this.updateFillColor()},get:function(){return this._fillColor}},{key:"selected",set:function(t){this._selected=t,this.path.strokeColor=t?"white":this.strokeColor,this.path.bringToFront()},get:function(){return this._selected}}]),e}(F.a.Point),bt=function(){function t(e){var a=e.name,n=e.action,i=e.func,o=e.args;Object(ct["a"])(this,t),this.name=a,this.action=n,this.func=i,this.args=o}return Object(ut["a"])(t,[{key:"undo",value:function(){return this.func(this.args)}}]),t}(),Ct=a("474e"),_t=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("i",{staticClass:"fa fa-plus",staticStyle:{float:"right",margin:"0 4px",color:"green"},on:{click:t.createMetadata}}),a("p",{staticClass:"title",staticStyle:{margin:"0"}},[t._v(t._s(t.title))]),a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm"},[a("p",{staticClass:"subtitle"},[t._v(t._s(t.keyTitle))])]),a("div",{staticClass:"col-sm"},[a("p",{staticClass:"subtitle"},[t._v(t._s(t.valueTitle))])])]),a("ul",{staticClass:"list-group",staticStyle:{height:"50%"}},[0==t.metadataList.length?a("li",{staticClass:"list-group-item meta-item"},[a("i",{staticClass:"subtitle"},[t._v("No items in metadata.")])]):t._e(),t._l(t.metadataList,function(e,n){return a("li",{key:n,staticClass:"list-group-item meta-item"},[a("div",{staticClass:"row",staticStyle:{}},[a("div",{staticClass:"col-sm"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.key,expression:"object.key"}],staticClass:"meta-input",attrs:{type:"text",placeholder:t.keyTitle},domProps:{value:e.key},on:{input:function(a){a.target.composing||t.$set(e,"key",a.target.value)}}})]),a("div",{staticClass:"col-sm"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"object.value"}],staticClass:"meta-input",attrs:{type:"text",placeholder:t.valueTitle},domProps:{value:e.value},on:{input:function(a){a.target.composing||t.$set(e,"value",a.target.value)}}})])])])})],2)])},wt=[],kt={name:"Metadata",props:{metadata:{type:Object,required:!0},title:{type:String,default:"Metadata"},keyTitle:{type:String,default:"Keys"},valueTitle:{type:String,default:"Values"},exclude:{type:String,default:""}},data:function(){return{metadataList:[]}},methods:{export:function(){var t={};return this.metadataList.forEach(function(e){e.key.length>0&&(isNaN(e.value)?"true"===e.value.toLowerCase()||"false"===e.value.toLowerCase()?t[e.key]="true"===e.value.toLowerCase():t[e.key]=e.value:t[e.key]=parseInt(e.value))}),t},createMetadata:function(){this.metadataList.push({key:"",value:""})},loadMetadata:function(){if(null!=this.metadata)for(var t in this.metadata)if(this.metadata.hasOwnProperty(t)&&t!==this.exclude){var e=this.metadata[t];e=null==e?"":e.toString(),this.metadataList.push({key:t,value:e})}}},watch:{metadata:function(){this.loadMetadata()}},created:function(){this.loadMetadata()}},xt=kt,Pt=(a("6269"),Object(m["a"])(xt,_t,wt,!1,null,"53823512",null));Pt.options.__file="Metadata.vue";var At=Pt.exports,St=lt.a,Ot={name:"Annotation",components:{Metadata:At,TagsInput:Ct["a"]},props:{annotation:{type:Object,required:!0},index:{type:Number,required:!0},current:{type:Number,required:!0},hover:{type:Number,required:!0},opacity:{type:Number,required:!0},scale:{type:Number,default:1},search:{type:String,default:""},simplify:{type:Number,default:1},keypointEdges:{type:Array,required:!0},keypointLabels:{type:Array,required:!0},keypointColors:{type:Array,required:!0},activeTool:{type:String,required:!0},allCategories:{type:Array,default:function(){return[]}}},data:function(){return{isVisible:!0,showKeypoints:!1,color:this.annotation.color,compoundPath:null,keypoints:null,metadata:[],isEmpty:!0,name:"",uuid:"",pervious:[],count:0,currentKeypoint:null,keypoint:{tag:[],visibility:0,next:{label:-1,visibility:2}},sessions:[],session:{start:Date.now(),tools:[],milliseconds:0},tagRecomputeCounter:0,visibilityOptions:vt}},methods:Object(s["a"])({},Object(d["c"])(["addUndo"]),{initAnnotation:function(){var t=this.annotation.metadata.name;t&&(this.name=t,delete this.annotation.metadata["name"]),null!=this.compoundPath&&(this.compoundPath.remove(),this.compoundPath=null),this.createCompoundPath(this.annotation.paper_object,this.annotation.segmentation)},createCompoundPath:function(t,e){var a=this;t=t||null,e=e||null;var n=this.annotation.width,i=this.annotation.height;null!=t&&2!==t.length&&(t=null),null!=e&&0===e.length&&(e=null),null!=this.compoundPath&&this.compoundPath.remove(),null!=this.keypoints&&this.keypoints.remove(),this.compoundPath=new F.a.CompoundPath,this.compoundPath.onDoubleClick=function(){"Select"===a.activeTool&&St("#annotationSettings".concat(a.annotation.id)).modal("show")},this.keypoints=new gt(this.keypointEdges,this.keypointLabels,this.keypointColors,{annotationId:this.annotation.id,categoryName:this.$parent.category.name}),this.keypoints.radius=6*this.scale,this.keypoints.lineWidth=2*this.scale;var o=this.annotation.keypoints;if(o)for(var s=0;s<o.length;s+=3){var r=o[s]-n/2,l=o[s+1]-i/2,c=o[s+2];0===o[s]&&0===o[s+1]&&0===c||this.addKeypoint(new F.a.Point(r,l),c,s/3+1)}if(null!=t)this.compoundPath.importJSON(t);else if(null!=e)for(var u=new F.a.Point(n/2,i/2),d=0;d<e.length;d++){for(var h=e[d],p=new F.a.Path,m=0;m<h.length;m+=2){var g=new F.a.Point(h[m],h[m+1]);p.add(g.subtract(u))}p.closePath(),this.compoundPath.addChild(p)}this.compoundPath.data.annotationId=this.index,this.compoundPath.data.categoryId=this.categoryIndex,this.compoundPath.fullySelected=this.isCurrent,this.compoundPath.opacity=this.opacity,this.setColor(),this.compoundPath.onClick=function(){a.$emit("click",a.index)}},deleteAnnotation:function(){var t=this;q.a.delete("/api/annotation/"+this.annotation.id).then(function(){t.$socket.emit("annotation",{action:"delete",annotation:t.annotation}),t.delete(),t.$emit("deleted",t.index)})},delete:function(){var t=this;this.$parent.category.annotations.splice(this.index,1),null!=this.compoundPath&&this.compoundPath.remove(),null!=this.keypoints&&(this.keypoints._keypoints.forEach(function(e){t.keypoints.deleteKeypoint(e)}),this.keypoints.remove())},onAnnotationClick:function(t){this.keypointLabels.length&&(this.showKeypoints=t),this.isVisible&&this.$emit("click",this.index)},onAnnotationKeypointClick:function(t){this.isKeypointLabeled(t)&&(this.keypoint.tag=[String(t+1)],this.currentKeypoint=this.keypoints._labelled[this.keypoint.tag]),this.isVisible&&this.$emit("keypoint-click",t)},onAnnotationKeypointSettingsClick:function(t){this.keypoint.tag=[String(t+1)];var e=parseInt(String(this.keypoint.tag));if(this.keypoints&&e in this.keypoints._labelled){var a=this.keypoints._labelled[e];this.currentKeypoint=a}this.keypoint.visibility=this.getKeypointVisibility(t)},onDeleteKeypointClick:function(t){var e=String(t+1);e in this.keypoints._labelled&&this.deleteKeypoint(this.keypoints._labelled[e])},onMouseEnter:function(){null!=this.compoundPath&&(this.compoundPath.selected=!0)},onMouseLeave:function(){null!=this.compoundPath&&(this.compoundPath.selected=!1)},getCompoundPath:function(){return null==this.compoundPath&&this.createCompoundPath(),this.compoundPath},createUndoAction:function(t){null==this.compoundPath&&this.createCompoundPath();var e=this.compoundPath.clone();e.fullySelected=!1,e.visible=!1,this.pervious.push(e);var a=new bt({name:"Annotation "+this.annotation.id,action:t,func:this.undoCompound,args:{}});this.addUndo(a)},simplifyPath:function(){if(null!=this.compoundPath&&this.compoundPath.isEmpty()&&this.keypoints.isEmpty())this.deleteAnnotation();else{var t=this.simplify;this.compoundPath.flatten(1),this.compoundPath instanceof F.a.Path&&(this.compoundPath=new F.a.CompoundPath(this.compoundPath),this.compoundPath.data.annotationId=this.index,this.compoundPath.data.categoryId=this.categoryIndex);var e=[];this.compoundPath.children.forEach(function(a){var n=[];a.segments.forEach(function(t){n.push({x:t.point.x,y:t.point.y})}),n=st()(n,t,!0);var i=new F.a.Path(n);i.closePath(),e.push(i)}),this.compoundPath.removeChildren(),this.compoundPath.addChildren(e),this.compoundPath.fullySelected=this.isCurrent,this.keypoints.bringToFront(),this.emitModify()}},undoCompound:function(){0!=this.pervious.length&&(this.compoundPath.remove(),this.compoundPath=this.pervious.pop(),this.compoundPath.fullySelected=this.isCurrent)},addKeypoint:function(t,e,a){var n=this;if(null!=a||!this.keypoints.contains(t)){e=e||parseInt(this.keypoint.next.visibility),a=a||parseInt(this.keypoint.next.label);var i=new yt(t.x,t.y,{visibility:e||0,indexLabel:a||-1,fillColor:this.keypointColors[a-1],radius:6*this.scale,onClick:function(t){if(["Select","Keypoints"].includes(n.activeTool)){var e=t.target.keypoint;if(e!=n.currentKeypoint){if(n.onAnnotationClick(!0),n.onAnnotationKeypointClick(e.indexLabel-1),n.currentKeypoint){var a=n.currentKeypoint.indexLabel,i=e.indexLabel;if(n.keypoints&&a>0&&i>0){var o=[a,i];n.keypoints.getLine(o)?n.$parent.removeKeypointEdge(o):n.$parent.addKeypointEdge(o)}}n.currentKeypoint=e}else n.currentKeypoint=null}},onDoubleClick:function(t){if(n.$parent.isCurrent&&["Select","Keypoints"].includes(n.activeTool)){n.currentKeypoint=t.target.keypoint;var e="#keypointSettings".concat(n.annotation.id),a=n.currentKeypoint.indexLabel;n.keypoint.tag=-1==a?[]:[a.toString()],n.keypoint.visibility=n.currentKeypoint.visibility,St(e).modal("show")}},onMouseDrag:function(t){var e=t.target.keypoint;["Select","Keypoints"].includes(n.activeTool)&&n.keypoints.moveKeypoint(t.point,e)}});this.keypoints.addKeypoint(i),this.isEmpty=this.compoundPath.isEmpty()&&this.keypoints.isEmpty();var o=this.notUsedKeypointLabels;delete o[String(a)];var s=Object.keys(o);if(s.length>0){var r=s[0];for(var l in o)if(l>a){r=l;break}this.keypoint.next.label=r}else this.keypoint.next.label=-1,this.$emit("keypoints-complete");this.tagRecomputeCounter++}},deleteKeypoint:function(t){this.keypoints.deleteKeypoint(t)},unite:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null==this.compoundPath&&this.createCompoundPath();var i=this.compoundPath.unite(t);i.strokeColor=null,i.strokeWidth=0,i.onDoubleClick=this.compoundPath.onDoubleClick,i.onClick=this.compoundPath.onClick,this.annotation.isbbox=n,a&&this.createUndoAction("Unite"),this.compoundPath.remove(),this.compoundPath=i,this.keypoints.bringToFront(),e&&this.simplifyPath()},subtract:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null==this.compoundPath&&this.createCompoundPath();var n=this.compoundPath.subtract(t);n.onDoubleClick=this.compoundPath.onDoubleClick,a&&this.createUndoAction("Subtract"),this.compoundPath.remove(),this.compoundPath=n,this.keypoints.bringToFront(),e&&this.simplifyPath()},setColor:function(){null!=this.compoundPath&&(this.$parent.showAnnotations?(this.compoundPath.opacity=this.opacity,this.compoundPath.fillColor=this.color,this.keypoints.color=this.darkHSL):this.$parent.setColor())},setCategory:function(t){var e=t.target.value,a=this.annotation,n=this.$parent.category;this.$parent.$parent.updateAnnotationCategory(a,n,e),St("#annotationSettings".concat(a.id)).modal("hide")},export:function(){null==this.compoundPath&&this.createCompoundPath();var t=this.$refs.metadata.export();this.name.length>0&&(t.name=this.name);var e={id:this.annotation.id,isbbox:this.annotation.isbbox,color:this.color,metadata:t};this.simplifyPath(),this.compoundPath.fullySelected=!1;var a=this.compoundPath.exportJSON({asString:!1,precision:1});return this.keypoints.isEmpty()||(e.keypoints=this.keypoints.exportJSON(this.keypointLabels,this.annotation.width,this.annotation.height)),this.compoundPath.fullySelected=this.isCurrent,this.annotation.paper_object!==a&&(e.compoundPath=a),e.sessions=this.sessions,this.sessions=[],e},emitModify:function(){this.uuid=Math.random().toString(36).replace(/[^a-z]+/g,""),this.annotation.paper_object=this.compoundPath.exportJSON({asString:!1,precision:1}),this.$socket.emit("annotation",{uuid:this.uuid,action:"modify",annotation:this.annotation})},getKeypointLabel:function(t){return t&&t.keypoints.labels[t.indexLabel-1]},isKeypointSelected:function(t,e){return t==e+1},isKeypointLabeled:function(t){return this.keypoints&&!!this.keypoints._labelled[t+1]},getKeypointVisibility:function(t){var e=0;if(this.keypoints&&this.keypoints._labelled){var a=this.keypoints._labelled[t+1];a&&(e=a.visibility)}return e},getKeypointBackgroundColor:function(t){if(this.isHover&&this.$parent.isHover)return"#646c82";var e=this.keypoint.next.label;return"Select"===this.activeTool&&(e=this.keypoint.tag),this.isCurrent&&e==t+1?"rgb(30, 86, 36)":"#383c4a"}}),watch:{activeTool:function(t){if(this.isCurrent&&(this.session.tools.push(t),"Keypoints"===t)){this.showKeypoints||(this.showKeypoints=!0);for(var e=-1,a=0;a<this.keypointLabels.length;++a){if(!this.isKeypointLabeled(a)){e=a;break}e<0&&(e=a)}e>-1&&(this.keypoint.tag=[String(e+1)],this.currentKeypoint=this.keypoints._labelled[this.keypoint.tag],this.$emit("keypoint-click",e))}},opacity:function(t){this.compoundPath.opacity=t},color:function(){this.setColor()},isVisible:function(t){null!=this.compoundPath&&(this.compoundPath.visible=t,this.keypoints.visible=t)},compoundPath:function(){null!=this.compoundPath&&(this.compoundPath.visible=this.isVisible,this.setColor(),this.isEmpty=this.compoundPath.isEmpty()&&this.keypoints.isEmpty())},keypoints:function(){this.isEmpty=this.compoundPath.isEmpty()&&this.keypoints.isEmpty()},annotation:function(){this.initAnnotation()},isCurrent:function(t,e){t?(this.session.start=Date.now(),this.session.tools=[this.activeTool]):this.currentKeypoint=null,e&&(this.session.milliseconds=Date.now()-this.session.start,this.sessions.push(this.session)),null!=this.compoundPath&&(this.compoundPath.fullySelected=this.isCurrent)},currentKeypoint:function(t,e){e&&(e.selected=!1),t&&(t.selected=!0)},"keypoint.tag":function(t){var e=0===t.length?-1:t[0];-1!==e&&(this.currentKeypoint=this.keypoints._labelled[e]),this.tagRecomputeCounter++},"keypoint.visibility":function(t){this.currentKeypoint&&(this.currentKeypoint.visibility=t)},keypointEdges:function(t){var e=this;this.keypoints.color=this.darkHSL,t.forEach(function(t){return e.keypoints.addEdge(t)})},scale:{immediate:!0,handler:function(t){this.keypoints&&(this.keypoints.radius=6*t,this.keypoints.lineWidth=2*t)}}},computed:{categoryIndex:function(){return this.$parent.index},isCurrent:function(){return!(this.index!==this.current||!this.$parent.isCurrent)&&(null!=this.keypoints&&this.keypoints.bringToFront(),!0)},keypointListView:function(){for(var t=[],e=0;e<this.keypointLabels.length;++e){var a=this.getKeypointVisibility(e),n="rgb(40, 42, 49)";1==a?n="lightgray":2==a&&(n=this.keypointColors[e]),t.push({label:this.keypointLabels[e],visibility:a,iconColor:n,backgroundColor:this.getKeypointBackgroundColor(e)})}return t},isHover:function(){return this.index===this.hover},backgroundColor:function(){return this.isHover&&this.$parent.isHover?"#646c82":this.isCurrent?"#4b624c":"inherit"},showSideMenu:function(){var t=this.search.toLowerCase();return 0===t.length||(t===String(this.annotation.id)||(t===String(this.index+1)||this.name.toLowerCase().includes(this.search)))},darkHSL:function(){var t=new F.a.Color(this.color),e=Math.round(t.hue),a=Math.round(50*t.lightness),n=Math.round(100*t.saturation);return"hsl("+e+","+n+"%,"+a+"%)"},notUsedKeypointLabels:function(){this.tagRecomputeCounter;for(var t={},e=0;e<this.keypointLabels.length;e++)this.keypoints&&!this.keypoints._labelled[e+1]&&(t[e+1]=this.keypointLabels[e]);return t}},sockets:{annotation:function(t){var e=t.annotation;this.uuid!=t.uuid&&e.id==this.annotation.id&&("modify"==t.action&&this.createCompoundPath(e.paper_object,e.segmentation),"delete"==t.action&&this.delete())}},mounted:function(){var t=this;this.initAnnotation(),St("#keypointSettings".concat(this.annotation.id)).on("hidden.bs.modal",function(){t.currentKeypoint=null})}},$t=Ot,Et=(a("fbbe"),Object(m["a"])($t,nt,it,!1,null,"22cb2b9f",null));Et.options.__file="Annotation.vue";var Tt=Et.exports,Dt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("i",{staticClass:"fa fa-plus",staticStyle:{float:"right",margin:"0 4px",color:"green"},on:{click:t.createKeypoints}}),a("p",{staticClass:"title",staticStyle:{margin:"0"}},[t._v(t._s(t.title))]),a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm-5"},[a("p",{staticClass:"subtitle"},[t._v(t._s(t.keyTitle)+":")])]),a("div",{staticClass:"col-sm-7"},[a("p",{staticClass:"subtitle"},[t._v(t._s(t.valueTitle)+":")])])]),a("form",[a("ul",{staticClass:"list-group",staticStyle:{height:"50%"}},[0==t.keypoints.length?a("li",{staticClass:"list-group-item keypoint-item"},[a("i",{staticClass:"subtitle"},[t._v("No keypoints.")])]):t._e(),t._l(t.keypoints,function(e,n){return a("li",{key:n,staticClass:"list-group-item keypoint-item"},[a("div",{staticClass:"row form-group",staticStyle:{}},[a("div",{staticClass:"col-sm-5",staticStyle:{"padding-right":"5px"}},[a("input",{staticClass:"keypoint-input form-control",class:{"is-invalid":0!==e.label_error.length},attrs:{type:"text",required:0!==e.edges.length,placeholder:t.keyTitle},domProps:{value:e.label},on:{input:function(e){t.keypointLabelUpdated(n,e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v(t._s(e.label_error))])]),a("div",{staticClass:"col-sm-1 keypoint-color"},[a("input",{staticClass:"form-control",attrs:{type:"color"},domProps:{value:e.color},on:{input:function(e){t.colorUpdated(n,e.target.value)}}})]),a("div",{staticClass:"col-sm-6",staticStyle:{"padding-left":"5px"}},[a("TagsInput",{staticClass:"keypoint-input",attrs:{value:e.edges,placeholder:"Add connected label",elementId:"index"+n,"existing-tags":t.otherKeypointLabels(e.label),onlyExistingTags:!0,typeahead:!0,"typeahead-activation-threshold":0},on:{input:function(e){t.keypointEdgesUpdated(n,e)}}})],1)])])})],2)])])},It=[],jt=["#bf5c4d","#d99100","#4d8068","#0d2b80","#9c73bf","#ff1a38","#bf3300","#736322","#33fff1","#3369ff","#9d13bf","#733941","#ffb499","#d0d957","#0b5e73","#0000ff","#730b5e","#ff8533","#518c0e","#82c7d9","#0000d9","#ff1ab3","#733c17","#7cff4d","#1ab3ff","#0000cc","#cc0052","#cc9c66","#8ae6a2","#335280","#0000bf","#e673a1"],Lt={name:"KeypointsDefinition",components:{TagsInput:Ct["a"]},props:{value:{type:Object,required:!0},title:{type:String,default:"Keypoints"},keyTitle:{type:String,default:"Label"},valueTitle:{type:String,default:"Connects to"},exclude:{type:String,default:""}},computed:{valid:function(){if(!this.isMounted)return!1;for(var t=0;t<this.keypoints.length;++t)if(0!==this.keypoints[t].label_error.length)return!1;return!0}},data:function(){return{keypoints:[],hiddenValue:{edges:[],labels:[],colors:[]},isMounted:!1,nextDistinct:-1}},created:function(){this.keypoints=this.keypointsFromProp(),this.$emit("initialized")},mounted:function(){this.isMounted=!0},methods:{export:function(){for(var t=this,e=[],a=0;a<this.value.labels.length;++a)e.push({label:this.value.labels[a],edges:[],label_error:"",color:this.value.colors[a]});return this.value.edges.forEach(function(a){var n=a[0]-1,i=a[0]-1;e[n].edges.push(t.value.labels[i]),e[i].edges.push(t.value.labels[n])}),e},createKeypoints:function(){this.keypoints.push({label:"",label_error:"",edges:[],color:this.nextDistinctColor()})},keypointsFromProp:function(){var t=this,e=[];if(null!=this.value&&null!=this.value.labels&&this.value.labels.length){for(var a=0;a<this.value.labels.length;++a){var n=this.value.labels[a];n.length>0&&e.push({label:n,label_error:"",edges:[],color:this.value.colors[a]||"#000"})}this.value.edges.forEach(function(a){var n=a[0]-1,i=a[1]-1;n<e.length&&i<e.length&&(e[n].edges.push(t.value.labels[i]),e[i].edges.push(t.value.labels[n]))})}return e},colorUpdated:function(t,e){this.keypoints[t].color=e,this.hiddenValue=this.propFomKeypoints(),this.$emit("input",this.hiddenValue)},keypointLabelUpdated:function(t,e){var a=this.keypoints[t],n=a.label;if(a.label_error="",""!==e){for(var i=0;i<this.keypoints.length;++i)if(i!==t){var o=this.keypoints[i];e===o.label?(a.label_error="Duplicate keypoint label",o.label_error=a.label_error):n===o.label&&0!==o.label_error.length&&(o.label_error="")}}else 0!==a.edges.length&&(a.label_error="Label is required");if(a.label=e,""===a.label_error){if(""!==e)for(var s=0;s<this.keypoints.length;++s)if(s!==t){var r=this.keypoints[s];r.edges=r.edges.map(function(t){return t===n?e:t})}this.hiddenValue=this.propFomKeypoints(),this.$emit("input",this.hiddenValue)}else if(""!==e)for(var l=0;l<this.keypoints.length;++l)if(l!==t){var c=this.keypoints[l];c.edges=c.edges.filter(function(t){return t!=n})}},keypointEdgesUpdated:function(t,e){var a=new Set(e),n=this.keypoints[t];this.keypoints.forEach(function(t){if(t.label!==n.label){var e=new Set(t.edges);!a.has(t.label)&&e.has(n.label)?(e.delete(n.label),t.edges=Array.from(e)):a.has(t.label)&&!e.has(n.label)&&(e.add(n.label),t.edges=Array.from(e)),0===t.edges.length&&0===t.label.length&&t.label_error&&(t.label_error="")}}),this.keypoints[t].edges=e,this.hiddenValue=this.propFomKeypoints(),this.$emit("input",this.hiddenValue)},propFomKeypoints:function(){var t={},e=[],a=[];this.keypoints.forEach(function(t){t.label.length>0&&(e.push(t.label),a.push(t.color))}),this.keypoints.forEach(function(e){e.edges.forEach(function(a){a in t?t[a].add(e.label):(t[e.label]=t[e.label]||new Set,t[e.label].add(a))})});var n=[],i=function(a){var i=e.indexOf(a)+1;t[a].forEach(function(t){var a=e.indexOf(t)+1;n.push([i,a])})};for(var o in t)i(o);return{labels:e,edges:n,colors:a}},otherKeypointLabels:function(t){var e={};return null!=this.keypoints&&this.keypoints.forEach(function(a){""!==a.label&&a.label!==t&&(e[a.label]=a.label)}),e},clearKeypoints:function(){this.keypoints.splice(0,this.keypoints.length)},nextDistinctColor:function(){return jt[++this.nextDistinct]}},watch:{value:function(){this.hiddenValue!==this.value&&(this.hiddenValue=this.value,this.keypoints=this.keypointsFromProp())}}},Nt=Lt,Bt=(a("6f05"),Object(m["a"])(Nt,Dt,It,!1,null,"324ff2dd",null));Bt.options.__file="KeypointsDefinition.vue";var Mt=Bt.exports,Ut=lt.a,Kt={name:"Category",components:{Annotation:Tt,KeypointsDefinition:Mt},props:{category:{type:Object,required:!0},index:{type:Number,required:!0},current:{type:Object,required:!0},hover:{type:Object,required:!0},opacity:{type:Number,required:!0},scale:{type:Number,default:1},categorysearch:{type:String,required:!0},simplify:{type:Number,default:1},activeTool:{type:String,required:!0},allCategories:{type:Array,required:!0}},data:function(){return{group:null,supercategory:this.category.supercategory,color:this.category.color,keypoint:{labels:Object(tt["a"])(this.category.keypoint_labels),edges:Object(tt["a"])(this.category.keypoint_edges),colors:Object(tt["a"])(this.category.keypoint_colors)},selectedAnnotation:-1,showAnnotations:!1,isVisible:!1,search:"",isMounted:!1}},methods:{show:function(t){return 0===this.search.length||this.filterFound.indexOf(t)>-1},resetCategorySettings:function(){this.supercategory=this.category.supercategory,this.color=this.category.color,this.keypoint={labels:Object(tt["a"])(this.category.keypoint_labels),edges:Object(tt["a"])(this.category.keypoint_edges),colors:Object(tt["a"])(this.category.keypoint_colors)}},createAnnotation:function(){var t=this,e=this.$parent,a=this.category.annotations.length;at.create({image_id:e.image.id,category_id:this.category.id}).then(function(e){t.$socket.emit("annotation",{action:"create",category_id:t.category.id,annotation:e.data}),t.category.annotations.push(e.data),t.selectedAnnotation=a,t.$nextTick(function(){t.$parent.selectLastEditorTool(),t.$emit("click",{annotation:a,category:t.index,keypoint:-1})}),t.isVisible=!0,t.showAnnotations=!0;var n=t.$refs.annotation;if(null!=n){var i=n[a-1];null==i?t.$parent.scrollElement(t.$el):t.$parent.scrollElement(i.$el)}})},onUpdateClick:function(){this.category.keypoint_labels=Object(tt["a"])(this.keypoint.labels),this.category.keypoint_edges=Object(tt["a"])(this.keypoint.edges),this.category.keypoint_colors=Object(tt["a"])(this.keypoint.colors),this.category.supercategory=this.supercategory},export:function(){var t=this.$refs,e={id:this.category.id,name:this.category.name,show:this.category.show,visualize:this.isVisible,color:this.color,metadata:[],annotations:[],supercategory:this.category.supercategory,keypoint_labels:this.category.keypoint_labels,keypoint_edges:this.category.keypoint_edges,keypoint_colors:this.category.keypoint_colors};return t.hasOwnProperty("annotation")&&t.annotation.forEach(function(t){e.annotations.push(t.export())}),e},addKeypointEdge:function(t){this.keypoint.edges.push(t)},removeKeypointEdge:function(t){var e=this.keypoint.edges.findIndex(function(e){var a=Math.min(t[0],t[1])==Math.min(e[0],e[1]),n=Math.max(t[0],t[1])==Math.max(e[0],e[1]);return a&&n});if(-1!==e){var a=this.keypoint.edges[e];this.keypoint.edges.splice(e,1);var n=this.$refs.annotation;n&&n.forEach(function(t){return t.keypoints.removeLine(a)})}},onEyeClick:function(){this.isVisible=!this.isVisible,this.showAnnotations&&!this.isVisible&&(this.showAnnotations=!1),this.showAnnotations&&this.isCurrent&&this.$emit("click",{annotation:this.selectedAnnotation,category:this.index,keypoint:-1})},onKeypointClick:function(t,e){var a={annotation:t,category:this.index,keypoint:e};this.selectedAnnotation=t,this.showAnnotations=!0,this.$emit("click",a)},onAnnotationClick:function(t){var e={annotation:t,category:this.index,keypoint:-1};this.selectedAnnotation=t,this.showAnnotations=!0,this.$emit("click",e)},onClick:function(){var t={annotation:this.selectedAnnotation,category:this.index,keypoint:-1};this.$emit("click",t),0!==this.category.annotations.length&&(this.showAnnotations=!this.showAnnotations,this.showAnnotations&&!this.isVisible&&(this.isVisible=!0))},initCategory:function(){this.setColor()},getAnnotation:function(t){var e=this.$refs.annotation;return null==e?null:this.$refs.annotation[t]},setColor:function(){var t=this,e=this.$refs.annotation;null!=e&&this.isVisible&&(this.showAnnotations?e.forEach(function(t){return t.setColor()}):e.forEach(function(e){e.compoundPath.fillColor=t.color,e.keypoints.color=t.darkHSL,e.keypoints.bringToFront()}))},annotationDeleted:function(t){this.selectedAnnotation>=t&&this.selectedAnnotation--;var e={annotation:this.selectedAnnotation,category:this.index,keypoint:-1};this.$emit("click",e),0===this.category.annotations.length&&(this.isVisible=!1)}},computed:{showCategory:function(){var t=this.categorysearch.toLowerCase();return 0===t.length||this.category.name.toLowerCase().includes(t)},getCategoriesList:function(){return this.allCategories.map(function(t){return{value:t.id,text:t.name}})},isCurrent:function(){return this.current.category===this.index},isHover:function(){return this.hover.category===this.index},backgroundColor:function(){return this.isHover&&!this.showAnnotations?"#646c82":"inherit"},borderColor:function(){return this.isCurrent?"rgba(255, 255, 255, 0.25)":"#404552"},darkHSL:function(){var t=new F.a.Color(this.color),e=Math.round(t.hue),a=Math.round(50*t.lightness),n=Math.round(100*t.saturation);return"hsl("+e+","+n+"%,"+a+"%)"},isFormValid:function(){return this.isMounted&&this.$refs&&this.$refs.keypoints&&this.$refs.keypoints.valid}},watch:{color:function(){this.setColor()},opacity:function(){var t=this,e=this.$refs.annotation;null!=e&&e.forEach(function(e){return e.compoundPath.opacity=t.opacity})},isVisible:function(t){var e=this.$refs.annotation;null!=e&&(e.forEach(function(e){e.keypoints.visible=t,e.isVisible=t}),this.setColor())},showAnnotations:function(t){t||this.$emit("click",{annotation:-1,keypoint:-1,category:this.index}),this.setColor()},category:function(){this.initCategory()}},sockets:{annotation:function(t){var e=t.action,a=t.annotation;if(a.image_id==this.$parent.image.id&&a.category_id==this.category.id){var n=this.category.annotations.findIndex(function(t){return t.id==a.id});-1==n&&"create"==e&&this.category.annotations.push(a)}}},mounted:function(){this.initCategory(),Ut(this.$refs.category_settings).on("hidden.bs.modal",this.resetCategorySettings),this.isMounted=!0}},Ft=Kt,Rt=(a("3b3a"),Object(m["a"])(Ft,Q,Z,!1,null,"dd9b79f2",null));Rt.options.__file="Category.vue";var qt=Rt.exports,Vt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"card",on:{click:t.click}},[a("div",{staticClass:"card-header",attrs:{id:"heading"+t.category.id}},[a("div",{style:{color:t.isSelected?"white":"gray"}},[a("div",[t.isSelected?a("i",{staticClass:"fa fa-check-square-o category-icon"}):a("i",{staticClass:"fa fa-square-o category-icon"})]),a("span",{staticClass:"btn btn-link btn-sm collapsed category-text",staticStyle:{color:"inherit"},attrs:{"aria-expanded":"false"}},[t._v("\n        "+t._s(t.category.name)+"\n      ")])])])])},Wt=[],zt={name:"Label",model:{prop:"categoryIds",event:"update"},props:{category:{type:Object,required:!0},categoryIds:{type:Array,required:!0},search:{type:String,required:!0}},data:function(){return{}},computed:{show:function(){var t=this.search.toLowerCase();return 0===t.length||this.category.name.toLowerCase().includes(t)},isSelected:function(){return this.categoryIds.indexOf(this.category.id)>-1}},methods:{click:function(){var t=this.categoryIds.slice();this.isSelected?t.splice(t.indexOf(this.category.id),1):t.push(this.category.id),this.$emit("update",t)}}},Ht=zt,Yt=(a("b11a"),Object(m["a"])(Ht,Vt,Wt,!1,null,"251b6fe5",null));Yt.options.__file="Label.vue";var Gt=Yt.exports,Xt=(a("0d6d"),{model:{prop:"selected",event:"update"},props:{selected:{type:String,required:!0}},template:"<div><i v-tooltip.right='tooltip' class='fa fa-x' :class='icon' :style='{ color: iconColor }' @click='click'></i><br></div>",data:function(){return{tool:null,enabled:!1,cursor:"default",color:{enabled:"white",active:"#2ecc71",disabled:"gray",toggle:"red"}}},methods:{onMouseMove:function(){},onMouseDown:function(){},onMouseDrag:function(){},onMouseUp:function(){},click:function(){this.update()},update:function(){this.isDisabled||this.$emit("update",this.name)},setPreferences:function(){}},computed:{isActive:function(){return this.selected==this.name&&(this.$emit("setcursor",this.cursor),!0)},iconColor:function(){return this.isDisabled?this.color.disabled:this.isToggled?this.color.toggle:this.isActive?this.color.active:this.color.enabled},isDisabled:function(){return!1},tooltip:function(){return this.isDisabled?this.name+" (select an annotation to activate tool)":this.name+" Tool"}},watch:{isActive:function(t){t&&this.tool.activate()},isDisabled:function(t){t&&this.isActive&&this.$emit("update","Select")}},mounted:function(){this.tool=new F.a.Tool,this.tool.onMouseDown=this.onMouseDown,this.tool.onMouseDrag=this.onMouseDrag,this.tool.onMouseMove=this.onMouseMove,this.tool.onMouseUp=this.onMouseUp}});function Jt(t,e){if(0===t.indexOf("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length)throw new Error("Invalid HEX color.");var a=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return e?.299*a+.587*n+.114*i>186?"#000000":"#FFFFFF":(a=(255-a).toString(16),n=(255-n).toString(16),i=(255-i).toString(16),"#"+Qt(a)+Qt(n)+Qt(i))}function Qt(t,e){e=e||2;var a=new Array(e).join("0");return(a+t).slice(-e)}var Zt,te,ee={name:"PolygonTool",mixins:[Xt],props:{scale:{type:Number,default:1},settings:{type:[Object,null],default:null}},data:function(){return{icon:"fa-pencil",name:"Polygon",scaleFactor:3,cursor:"copy",polygon:{completeDistance:5,minDistance:2,path:null,guidance:!0,simplify:1,pathOptions:{strokeColor:"black",strokeWidth:1}},color:{blackOrWhite:!0,auto:!0,radius:10,circle:null},actionTypes:Object.freeze({ADD_POINTS:"Added Points",CLOSED_POLYGON:"Closed Polygon",DELETE_POLYGON:"Delete Polygon"}),actionPoints:0}},methods:Object(s["a"])({},Object(d["c"])(["addUndo","removeUndos"]),{export:function(){return{guidance:this.polygon.guidance,completeDistance:this.polygon.completeDistance,minDistance:this.polygon.minDistance,blackOrWhite:this.color.blackOrWhite,auto:this.color.auto,radius:this.color.radius}},setPreferences:function(t){this.polygon.guidance=t.guidance||this.polygon.guidance,this.polygon.completeDistance=t.completeDistance||this.polygon.completeDistance,this.polygon.minDistance=t.minDistance||this.polygon.minDistance,this.color.blackOrWhite=t.blackOrWhite||this.color.blackOrWhite,this.color.auto=t.auto||this.color.auto,this.color.radius=t.radius||this.color.radius},createPolygon:function(){this.color.auto&&(this.color.circle=new F.a.Path.Circle(new F.a.Point(0,0),this.color.radius)),this.polygon.path=new F.a.Path(this.polygon.pathOptions)},deletePolygon:function(){null!=this.polygon.path&&(this.polygon.path.remove(),this.polygon.path=null,null!=this.color.circle&&(this.color.circle.remove(),this.color.circle=null))},autoStrokeColor:function(t){if(null!=this.color.circle&&null!=this.polygon.path&&this.color.auto){this.color.circle.position=t;var e=this.$parent.image.raster,a=e.getAverageColor(this.color.circle);a&&(this.polygon.pathOptions.strokeColor=Jt(a.toCSS(!0),this.color.blackOrWhite))}},onMouseDrag:function(t){null!=this.polygon.path&&(this.actionPoints++,this.autoStrokeColor(t.point),this.polygon.path.add(t.point),this.autoComplete(30))},onMouseDown:function(t){var e=!1;null==this.polygon.path&&(e=!0,this.createPolygon()),this.actionPoints=1,this.polygon.path.add(t.point),this.autoComplete(3)||this.polygon.guidance&&e&&this.polygon.path.add(t.point)},onMouseUp:function(){if(null!=this.polygon.path){var t=new bt({name:this.name,action:this.actionTypes.ADD_POINTS,func:this.undoPoints,args:{points:this.actionPoints}});this.addUndo(t)}},onMouseMove:function(t){null!=this.polygon.path&&0!==this.polygon.path.segments.length&&(this.autoStrokeColor(t.point),this.polygon.guidance&&(this.removeLastPoint(),this.polygon.path.add(t.point)))},undoPoints:function(t){if(null!=this.polygon.path){var e=t.points,a=this.polygon.path.segments.length;this.polygon.guidance&&(a-=1),this.polygon.path.removeSegments(a-e,a)}},autoComplete:function(t){if(null==this.polygon.path)return!1;if(this.polygon.path.segments.length<t)return!1;var e=this.polygon.path.lastSegment.point,a=this.polygon.path.firstSegment.point,n=this.polygon.completeDistance;return!!e.isClose(a,n)&&this.complete()},complete:function(){return null!=this.polygon.path&&(this.removeLastPoint(),this.polygon.path.fillColor="black",this.polygon.path.closePath(),this.$parent.uniteCurrentAnnotation(this.polygon.path),this.polygon.path.remove(),this.polygon.path=null,this.color.circle&&(this.color.circle.remove(),this.color.circle=null),this.removeUndos(this.actionTypes.ADD_POINTS),!0)},removeLastPoint:function(){this.polygon.path.removeSegment(this.polygon.path.segments.length-1)}}),computed:{isDisabled:function(){return-1===this.$parent.current.annotation}},watch:{isActive:function(t){t&&(this.tool.activate(),localStorage.setItem("editorTool",this.name))},scale:function(t){this.polygon.pathOptions.strokeWidth=t*this.scaleFactor,null!=this.polygon.path&&(this.polygon.path.strokeWidth=t*this.scaleFactor)},"polygon.guidance":function(t){null!=this.polygon.path&&!t&&this.polygon.path.length>1&&this.removeLastPoint()},"polygon.minDistance":function(t){this.tool.minDistance=t},"polygon.pathOptions.strokeColor":function(t){null!=this.polygon.path&&(this.polygon.path.strokeColor=t)},"color.auto":function(t){t&&this.polygon.path&&(this.color.circle=new F.a.Path.Circle(new F.a.Point(0,0),this.color.radius)),!t&&this.color.circle&&(this.color.circle.remove(),this.color.circle=null)}},created:function(){},mounted:function(){this.tool.minDistance=this.minDistance}},ae=ee,ne=Object(m["a"])(ae,Zt,te,!1,null,null,null);ne.options.__file="PolygonTool.vue";var ie,oe,se=ne.exports,re=function t(e){Object(ct["a"])(this,t),this.x=e.x,this.y=e.y},le=function(){function t(e){Object(ct["a"])(this,t),this.point1=new re(e),this.point2=null}return Object(ut["a"])(t,[{key:"addPoint",value:function(t){this.point2=new re(t),this.point1_2=new re({x:this.point1.x,y:this.point2.y}),this.point2_1=new re({x:this.point2.x,y:this.point1.y})}},{key:"modifyPoint",value:function(t){this.point2=null,this.addPoint(t)}},{key:"getPoints",value:function(){if(!this.isComplete())return[this.point1];var t=[];return t[0]=this.point1,t[1]=this.point1_2,t[2]=this.point2,t[3]=this.point2_1,t[4]=this.point1,t}},{key:"removePoint",value:function(){this.point2=null,this.point1_2=null,this.point2_1=null}},{key:"isComplete",value:function(){return!!this.point2}}]),t}(),ce={name:"BBoxTool",mixins:[Xt],props:{scale:{type:Number,default:1},settings:{type:[Object,null],default:null}},data:function(){return{icon:"fa-object-group",name:"BBox",scaleFactor:3,cursor:"copy",bbox:null,polygon:{path:null,guidance:!0,pathOptions:{strokeColor:"black",strokeWidth:1}},color:{blackOrWhite:!0,auto:!0,radius:10,circle:null},actionTypes:Object.freeze({ADD_POINTS:"Added Points",CLOSED_POLYGON:"Closed Polygon",DELETE_POLYGON:"Delete Polygon"}),actionPoints:0}},methods:Object(s["a"])({},Object(d["c"])(["addUndo","removeUndos"]),{export:function(){return{completeDistance:this.polygon.completeDistance,minDistance:this.polygon.minDistance,blackOrWhite:this.color.blackOrWhite,auto:this.color.auto,radius:this.color.radius}},setPreferences:function(t){this.color.blackOrWhite=t.blackOrWhite||this.color.blackOrWhite,this.color.auto=t.auto||this.color.auto,this.color.radius=t.radius||this.color.radius},createBBox:function(t){var e=this;this.polygon.path=new F.a.Path(this.polygon.pathOptions),this.bbox=new le(t.point),this.bbox.getPoints().forEach(function(t){return e.polygon.path.add(t)})},modifyBBox:function(t){var e=this;this.polygon.path=new F.a.Path(this.polygon.pathOptions),this.bbox.modifyPoint(t.point),this.bbox.getPoints().forEach(function(t){return e.polygon.path.add(t)})},deleteBbox:function(){null!=this.polygon.path&&(this.polygon.path.remove(),this.polygon.path=null,null!=this.color.circle&&(this.color.circle.remove(),this.color.circle=null))},autoStrokeColor:function(t){if(null!=this.color.circle&&null!=this.polygon.path&&this.color.auto){this.color.circle.position=t;var e=this.$parent.image.raster,a=e.getAverageColor(this.color.circle);a&&(this.polygon.pathOptions.strokeColor=Jt(a.toCSS(!0),this.color.blackOrWhite))}},checkAnnotationExist:function(){return!!this.$parent.currentAnnotation&&!!this.$parent.currentAnnotation.annotation.paper_object.length},onMouseDown:function(t){null==this.polygon.path&&this.checkAnnotationExist()&&this.$parent.currentCategory.createAnnotation(),null!=this.polygon.path?(this.removeLastBBox(),this.modifyBBox(t),this.completeBBox()):this.createBBox(t)},onMouseMove:function(t){null!=this.polygon.path&&0!==this.polygon.path.segments.length&&(this.autoStrokeColor(t.point),this.removeLastBBox(),this.modifyBBox(t))},undoPoints:function(t){if(null!=this.polygon.path){var e=t.points,a=this.polygon.path.segments.length;this.polygon.path.removeSegments(a-e,a)}},completeBBox:function(){return null!=this.polygon.path&&(this.polygon.path.fillColor="black",this.polygon.path.closePath(),this.$parent.uniteCurrentAnnotation(this.polygon.path,!0,!0,!0),this.polygon.path.remove(),this.polygon.path=null,this.color.circle&&(this.color.circle.remove(),this.color.circle=null),this.removeUndos(this.actionTypes.ADD_POINTS),!0)},removeLastBBox:function(){this.polygon.path.removeSegments()}}),computed:{isDisabled:function(){return-1===this.$parent.current.annotation}},watch:{isActive:function(t){t&&(this.tool.activate(),localStorage.setItem("editorTool",this.name))},scale:function(t){this.polygon.pathOptions.strokeWidth=t*this.scaleFactor,null!=this.polygon.path&&(this.polygon.path.strokeWidth=t*this.scaleFactor)},"polygon.pathOptions.strokeColor":function(t){null!=this.polygon.path&&(this.polygon.path.strokeColor=t)},"color.auto":function(t){t&&this.polygon.path&&(this.color.circle=new F.a.Path.Rectangle(new F.a.Point(0,0),new F.a.Size(10,10))),!t&&this.color.circle&&(this.color.circle.remove(),this.color.circle=null)}},created:function(){},mounted:function(){}},ue=ce,de=Object(m["a"])(ue,ie,oe,!1,null,null,null);de.options.__file="BBoxTool.vue";var he,pe,me=de.exports,ge={name:"SelectTool",mixins:[Xt],props:{scale:{type:Number,default:1}},data:function(){return{icon:"fa-hand-pointer-o",name:"Select",cursor:"pointer",movePath:!1,point:null,segment:null,scaleFactor:15,edit:{indicatorWidth:0,indicatorSize:0,center:null,canMove:!1},hover:{showText:!0,text:null,textId:-1,box:null,textShift:0,fontSize:this.sacleFactor,shift:0,rounded:0,category:null,annotation:null,annotationText:null},keypoint:null,hitOptions:{segments:!0,stroke:!0,fill:!1,tolerance:10,match:function(t){return!t.item.hasOwnProperty("indicator")}}}},methods:{export:function(){return{showText:this.hover.showText}},setPreferences:function(t){this.hover.showText=t.showText||this.hover.showText},generateTitle:function(){var t=" ";if(this.keypoint){var e=this.keypoint.keypoint.indexLabel,a=this.keypoint.keypoints.labels[e-1],n=this.keypoint.keypoint.visibility,i=this.keypoint.keypoint.getVisibilityDescription(),o=this.keypoint.keypoints.annotationId,s=this.keypoint.keypoints.categoryName;return t+="Keypoint: "+a+" \n",t+="Visibility: "+n+" ("+i+") \n",-1!==o&&(t+="ID: "+o+" \n"),s&&(t+="Category: "+s+" \n"),t.replace(/\n/g," \n ").slice(0,-2)}if(this.hover.category&&this.hover.annotation){var r=this.hover.textId,l=this.hover.category.category.name;t+="ID: "+r+" \n",t+="Category: "+l+" \n"}if(this.$store.getters["user/loginEnabled"]){var c=this.hover.annotation.annotation.creator;null!=c&&(t+="Created by "+c+"\n\n")}return t.replace(/\n/g," \n ").slice(0,-2)+" \n "},generateStringFromMetadata:function(){if(this.keypoint)return"";var t="",e=this.hover.annotation.$refs.metadata.metadataList;return null==e||0===e.length?t+="No Metadata \n":(t+="Metadata \n",e.forEach(function(e){0!==e.key.length&&(t+=" "+e.key+" = "+e.value+" \n")})),t.replace(/\n/g," \n ").slice(0,-2)},hoverText:function(){if(this.hover.showText){if(!this.keypoint){if(null==this.hover.category)return;if(null==this.hover.annotation)return}var t=this.hover.position.add(this.hover.textShift,0);if(null==this.hover.text||this.hover.annotation.annotation.id!==this.hover.textId||null!=this.keypoint){null!==this.hover.text&&(this.hover.text.remove(),this.hover.box.remove());var e=this.generateTitle()+this.generateStringFromMetadata();this.hover.annotation&&(this.hover.textId=this.hover.annotation.annotation.id),this.hover.text=new F.a.PointText(t),this.hover.text.justification="left",this.hover.text.fillColor="black",this.hover.text.content=e,this.hover.text.indicator=!0,this.hover.text.fontSize=this.hover.fontSize,this.hover.box=new F.a.Path.Rectangle(this.hover.text.bounds,this.hover.rounded),this.hover.box.indicator=!0,this.hover.box.fillColor="white",this.hover.box.strokeColor="white",this.hover.box.opacity=.5,this.hover.box.insertAbove(this.rect)}this.hover.shift=(this.hover.text.bounds.bottomRight.x-this.hover.text.bounds.bottomLeft.x)/2,this.hover.box.position=t.add(this.hover.shift,0),this.hover.text.position=t.add(this.hover.shift,0),this.hover.box.bringToFront(),this.hover.text.bringToFront()}},checkBbox:function(t){if(!t)return!1;var e=t.data.annotationId,a=t.data.categoryId,n=this.$parent.getCategory(a),i=n.getAnnotation(e);return i.annotation.isbbox},onMouseDown:function(t){var e=this.$parent.paper.project.hitTest(t.point,this.hitOptions);if(e)if(t.modifiers.shift)"segment"===e.type&&e.segment.remove();else{var a=e.item,n=null;if("segment"===e.type)this.segment=e.segment,n=a.parent;else if("stroke"===e.type){var i=e.location;this.segment=a.insert(i.index+1,t.point)}else"CompoundPath"==t.item.className&&(this.initPoint=t.point,this.moveObject=t.item,n=t.item);this.isBbox=this.checkBbox(n),null!=this.point?this.edit.canMove=this.point.contains(t.point):this.edit.canMove=!1}},clear:function(){this.hover.category=null,this.hover.annotation=null,this.isBbox=!1,this.segment=null,this.moveObject=null,null!=this.hover.text&&(this.hover.text.remove(),this.hover.box.remove(),this.hover.text=null,this.hover.box=null)},createPoint:function(t){null!=this.point&&this.point.remove(),this.point=new F.a.Path.Circle(t,this.edit.indicatorSize),this.point.strokeColor="black",this.point.strokeWidth=this.edit.indicatorWidth,this.point.indicator=!0},onMouseDrag:function(t){if(this.isBbox&&this.moveObject){var e=this.initPoint.x-t.point.x,a=this.initPoint.y-t.point.y,n=this.moveObject.children[0].segments;n.forEach(function(t){var n=t.point;t.point=new F.a.Point(n.x-e,n.y-a)}),this.initPoint=t.point}if(this.segment&&this.edit.canMove){if(this.createPoint(t.point),this.isBbox){var i=this.segment.previous.point.x==this.segment.point.x,o=i?this.segment.previous:this.segment.next,s=i?this.segment.next:this.segment.previous;o.point=new F.a.Point(t.point.x,o.point.y),s.point=new F.a.Point(s.point.x,t.point.y)}this.segment.point=t.point}else if(!this.keypoint){var r=this.initPoint.x-t.point.x,l=this.initPoint.y-t.point.y,c=new F.a.Point(r,l),u=this.$parent.paper.view.center.add(c);this.$parent.paper.view.setCenter(u)}},onMouseUp:function(t){this.clear()},onMouseMove:function(t){this.initPoint=t.point;var e=this.$parent.paper.project.hitTest(t.point,this.hitOptions);if(e){var a=null;"segment"===e.type?a=e.segment.location.point:"stroke"===e.type&&(a=e.location.point),null!=a?(this.edit.center=a,this.createPoint(a)):null!=this.point&&(this.point.remove(),this.point=null)}this.$parent.hover.annotation=-1,this.$parent.hover.category=-1,this.$parent.paper.project.activeLayer.selected=!1;var n=t.item;if(this.keypoint=null,n&&n.data.hasOwnProperty("annotationId")&&n.data.hasOwnProperty("categoryId")){this.hover.position=t.point;var i=t.item.data.categoryId,o=t.item.data.annotationId;this.$parent.hover.categoryId=i,this.$parent.hover.annotation=o,this.hover.category=this.$parent.getCategory(i),null!=this.hover.category&&(this.hover.annotation=this.hover.category.getAnnotation(o),t.item.selected=!0,this.hoverText())}else if(t.item&&t.item.hasOwnProperty("keypoint"))this.hover.position=t.point,this.keypoint=n;else if(n&&n.lastChild&&n.lastChild.hasOwnProperty("keypoint")){this.hover.position=t.point;for(var s=0;s<n.children.length;++s)if(n.children[s].hasOwnProperty("keypoint")){var r=n.children[s].keypoint;if(t.point.getDistance(r)<=r.radius){this.keypoint=n.children[s];break}}}else this.clear()}},watch:{keypoint:function(t){this.clear(),t&&this.hoverText()},scale:{handler:function(t){if(this.hover.rounded=5*t,this.hover.textShift=40*t,this.hover.fontSize=t*this.scaleFactor,this.edit.distance=40*t,this.edit.indicatorSize=10*t,this.edit.indicatorWidth=2*t,this.edit.center&&null!=this.point&&this.createPoint(this.edit.center),null!=this.hover.text){this.hover.text.fontSize=this.hover.fontSize,this.hover.shift=(this.hover.text.bounds.bottomRight.x-this.hover.text.bounds.bottomLeft.x)/2;var e=this.hover.shift+this.hover.textShift;this.hover.text.position=this.hover.position.add(e,0),this.hover.box.bounds=this.hover.text.bounds}},immediate:!0},isActive:function(t){t?this.tool.activate():(this.hover.text&&(this.hover.text.remove(),this.hover.box.remove(),this.hover.box=null,this.hover.text=null),this.point&&(this.point.remove(),this.point=null,this.segment=null),this.hover.annotation&&(this.hover.annotation.compoundPath.selected=!1))}}},fe=ge,ve=Object(m["a"])(fe,he,pe,!1,null,null,null);ve.options.__file="SelectTool.vue";var ye,be,Ce=ve.exports,_e=a("53ca"),we=(a("55dd"),a("63d9"),a("34ef"),function(){var t={};function e(t,e,a){var n,i,o,s,r,l,c,u=t.width,d=t.height,h=t.data,p=new Uint8Array(h),m=t.bounds.minX,g=t.bounds.maxX,f=t.bounds.minY,v=t.bounds.maxY,y=u*d,b=new Uint8Array(y),C=[],_=Math.max(m,1),w=Math.min(g,u-2),k=Math.max(f,1),x=Math.min(v,d-2);if(a&&a.length>0)for(r=0;r<y;r++)1===a[r]&&(p[r]=1);for(s=k;s<x+1;s++)for(n=_;n<w+1;n++)r=s*u+n,0!==h[r]&&(l=r+u,c=r-u,0!==p[r+1]&&0!==p[r-1]&&0!==p[l]&&0!==p[l+1]&&0!==p[l-1]&&0!==p[c]&&0!==p[c+1]&&0!==p[c-1]||C.push(r));if(0==m)for(s=f;s<v+1;s++)1===h[s*u]&&C.push(s*u);if(g==u-1)for(s=f;s<v+1;s++)1===h[s*u+g]&&C.push(s*u+g);if(0==f)for(n=m;n<g+1;n++)1===h[n]&&C.push(n);if(v==d-1)for(n=m;n<g+1;n++)1===h[v*u+n]&&C.push(v*u+n);var P,A,S=[],O=e+u,$=e+d,E=2*e+1;for(y=C.length,o=0;o<y;o++){for(r=C[o],b[r]=1,S.push(r),n=r%u,s=(r-n)/u,P=e-n>0?e-n:0,A=O-n<E?O-n:E,l=r-e,i=P;i<A;i++)c=l+i,0===b[c]&&(b[c]=1,S.push(c));for(P=e-s>0?e-s:0,A=$-s<E?$-s:E,l=r-e*u,i=P;i<A;i++)c=l+i*u,0===b[c]&&(b[c]=1,S.push(c))}return S}function a(t){var e,a,n=t.width,i=t.data,o=t.bounds.minX,s=t.bounds.maxX,r=t.bounds.minY,l=t.bounds.maxY,c=s-o+3,u=l-r+3,d=new Uint8Array(c*u);for(a=r;a<l+1;a++)for(e=o;e<s+1;e++)1===i[a*n+e]&&(d[(a-r+1)*c+(e-o+1)]=1);return{data:d,width:c,height:u,offset:{x:o-1,y:r-1}}}return t.floodFill=function(t,e,a,n,i){var o,s,r,l,c,u,d,h,p,m,g=t.data,f=t.width,v=t.height,y=t.bytes,b=-1,C=f+1,_=-1,w=v+1,k=a*f+e,x=new Uint8Array(f*v),P=new Uint8Array(i||f*v);if(1===P[k])return null;k*=y;var A=[g[k],g[k+1],g[k+2],g[k+3]],S=[{y:a,left:e-1,right:e+1,dir:1}];do{for(l=S.shift(),m=!1,s=l.left+1;s<l.right;s++)if(d=l.y*f,k=(d+s)*y,1!==P[d+s]&&(o=g[k]-A[0],!(o>n||o<-n)&&(o=g[k+1]-A[1],!(o>n||o<-n)&&(o=g[k+2]-A[2],!(o>n||o<-n))))){m=!0,x[d+s]=1,P[d+s]=1,u=s-1;while(u>-1){if(h=d+u,k=h*y,1===P[h])break;if(o=g[k]-A[0],o>n||o<-n)break;if(o=g[k+1]-A[1],o>n||o<-n)break;if(o=g[k+2]-A[2],o>n||o<-n)break;x[h]=1,P[h]=1,u--}c=s+1;while(c<f){if(p=d+c,k=p*y,1===P[p])break;if(o=g[k]-A[0],o>n||o<-n)break;if(o=g[k+1]-A[1],o>n||o<-n)break;if(o=g[k+2]-A[2],o>n||o<-n)break;x[p]=1,P[p]=1,c++}u<C&&(C=u+1),c>b&&(b=c-1),r=l.y-l.dir,r>=0&&r<v&&(u<l.left&&S.push({y:r,left:u,right:l.left,dir:-l.dir}),l.right<c&&S.push({y:r,left:l.right,right:c,dir:-l.dir})),r=l.y+l.dir,r>=0&&r<v&&u<c&&S.push({y:r,left:u,right:c,dir:l.dir})}m&&(l.y<w&&(w=l.y),l.y>_&&(_=l.y))}while(S.length>0);return{data:x,width:t.width,height:t.height,bounds:{minX:C,minY:w,maxX:b,maxY:_}}},t.gaussBlur=function(t,e){var a,n,i,o,s,r,l,c,u=2*e+1,d=e*e,h=new Float32Array(u),p=0,m=t.width,g=t.height,f=t.data,v=t.bounds.minX,y=t.bounds.maxX,b=t.bounds.minY,C=t.bounds.maxY;for(a=0;a<e;a++){var _=(e-a)*(e-a),w=Math.exp(-_/(2*d))/(2*Math.PI*d);h[e+a]=h[e-a]=w,p+=2*w}for(a=0;a<u;a++)h[a]/=p;var k=new Uint8Array(m*g),x=e+m,P=e+g;for(s=b;s<C+1;s++)for(o=v;o<y+1;o++){for(r=0,n=s*m+o,l=e-o>0?e-o:0,c=x-o<u?x-o:u,i=n-e,a=l;a<c;a++)r+=f[i+a]*h[a];for(l=e-s>0?e-s:0,c=P-s<u?P-s:u,i=n-e*m,a=l;a<c;a++)r+=f[i+a*m]*h[a];k[n]=r>.5?1:0}return{data:k,width:m,height:g,bounds:{minX:v,minY:b,maxX:y,maxY:C}}},t.gaussBlurOnlyBorder=function(t,a,n){var i,o,s,r,l,c,u,d,h,p,m,g=e(t,a,n),f=2*a+1,v=2*a*a,y=new Float32Array(f),b=0,C=t.width,_=t.height,w=t.data,k=t.bounds.minX,x=t.bounds.maxX,P=t.bounds.minY,A=t.bounds.maxY,S=g.length;for(s=0;s<a;s++)o=(a-s)*(a-s),i=Math.exp(-o/v)/Math.PI,y[a+s]=y[a-s]=i,b+=2*i;for(s=0;s<f;s++)y[s]/=b;var O=new Uint8Array(w),$=a+C,E=a+_;for(s=0;s<S;s++){for(l=g[s],h=0,u=l%C,d=(l-u)/C,p=a-u>0?a-u:0,m=$-u<f?$-u:f,c=l-a,r=p;r<m;r++)h+=w[c+r]*y[r];if(h>.5)O[l]=1,u<k&&(k=u),u>x&&(x=u),d<P&&(P=d),d>A&&(A=d);else{for(p=a-d>0?a-d:0,m=E-d<f?E-d:f,c=l-a*C,r=p;r<m;r++)h+=w[c+r*C]*y[r];h>.5?(O[l]=1,u<k&&(k=u),u>x&&(x=u),d<P&&(P=d),d>A&&(A=d)):O[l]=0}}return{data:O,width:C,height:_,bounds:{minX:k,minY:P,maxX:x,maxY:A}}},t.createBorderMask=function(t){var e,a,n,i,o,s=t.width,r=t.height,l=t.data,c=t.bounds.minX,u=t.bounds.maxX,d=t.bounds.minY,h=t.bounds.maxY,p=u-c+1,m=h-d+1,g=new Uint8Array(p*m),f=Math.max(c,1),v=Math.min(u,s-2),y=Math.max(d,1),b=Math.min(h,r-2);for(a=y;a<b+1;a++)for(e=f;e<v+1;e++)n=a*s+e,0!==l[n]&&(i=n+s,o=n-s,0!==l[n+1]&&0!==l[n-1]&&0!==l[i]&&0!==l[i+1]&&0!==l[i-1]&&0!==l[o]&&0!==l[o+1]&&0!==l[o-1]||(g[(a-d)*p+(e-c)]=1));if(0==c)for(a=d;a<h+1;a++)1===l[a*s]&&(g[(a-d)*p]=1);if(u==s-1)for(a=d;a<h+1;a++)1===l[a*s+u]&&(g[(a-d)*p+(u-c)]=1);if(0==d)for(e=c;e<u+1;e++)1===l[e]&&(g[e-c]=1);if(h==r-1)for(e=c;e<u+1;e++)1===l[h*s+e]&&(g[(h-d)*p+(e-c)]=1);return{data:g,width:p,height:m,offset:{x:c,y:d}}},t.getBorderIndices=function(t){var e,a,n,i,o,s=t.width,r=t.height,l=t.data,c=[],u=s-1,d=r-1;for(a=1;a<d;a++)for(e=1;e<u;e++)n=a*s+e,0!==l[n]&&(i=n+s,o=n-s,0!==l[n+1]&&0!==l[n-1]&&0!==l[i]&&0!==l[i+1]&&0!==l[i-1]&&0!==l[o]&&0!==l[o+1]&&0!==l[o-1]||c.push(n));for(a=0;a<r;a++)1===l[a*s]&&c.push(a*s);for(e=0;e<s;e++)1===l[e]&&c.push(e);for(n=s-1,a=0;a<r;a++)1===l[a*s+n]&&c.push(a*s+n);for(n=(r-1)*s,e=0;e<s;e++)1===l[n+e]&&c.push(n+e);return c},t.traceContours=function(t){var e,n,i,o,s,r,l,c,u,d,h,p,m,g,f,v=a(t),y=[],b=0,C=v.width,_=2*C,w=v.height,k=v.data,x=v.offset.x,P=v.offset.y,A=new Uint8Array(k),S=[[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]];for(o=1;o<w-1;o++)for(i=1;i<C-1;i++)if(s=o*C+i,1===k[s])for(e=-C;e<_;e+=_)if(0===k[s+e]&&0===A[s+e]){c=e===C,b++,l=[],u=c?2:6,p=m=d={x:i,y:o},h=null;while(1){for(A[p.y*C+p.x]=b,n=0;n<8;n++){if(u=(u+1)%8,f=S[u],g={x:p.x+f[0],y:p.y+f[1]},r=g.y*C+g.x,1===k[r]){A[r]=b;break}A[r]=-1,g=null}if(null===g)break;if(p=g,h){if(m.x===d.x&&m.y===d.y&&p.x===h.x&&p.y===h.y)break}else h=g;l.push({x:m.x+x,y:m.y+P}),m=p,u=(u+4)%8}null!=g&&(l.push({x:d.x+x,y:d.y+P}),y.push({inner:c,label:b,points:l}))}return y},t.simplifyContours=function(t,e,a){var n,i,o,s,r,l,c,u,d,h,p,m,g,f,v,y,b,C,_,w,k,x=t.length,P=[];for(i=0;i<x;i++)if(s=t[i],r=s.points,l=s.points.length,l<a){for(c=[],o=0;o<l;o++)c.push({x:r[o].x,y:r[o].y});P.push({inner:s.inner,label:s.label,points:c,initialCount:l})}else{u=[0,l-1],d=[{first:0,last:l-1}];do{if(h=d.shift(),!(h.last<=h.first+1)){for(p=-1,m=h.first,n=h.first+1;n<h.last;n++)_=r[n],w=r[h.first],k=r[h.last],b=_.x-w.x,C=_.y-w.y,f=Math.sqrt(b*b+C*C),b=_.x-k.x,C=_.y-k.y,v=Math.sqrt(b*b+C*C),b=w.x-k.x,C=w.y-k.y,y=Math.sqrt(b*b+C*C),g=f>=Math.sqrt(v*v+y*y)?v:v>=Math.sqrt(f*f+y*y)?f:Math.abs((C*_.x-b*_.y+w.x*k.y-k.x*w.y)/y),g>p&&(m=n,p=g);p>e&&(u.push(m),d.push({first:h.first,last:m}),d.push({first:m,last:h.last}))}}while(d.length>0);for(c=[],l=u.length,u.sort(function(t,e){return t-e}),o=0;o<l;o++)c.push({x:r[u[o]].x,y:r[u[o]].y});P.push({inner:s.inner,label:s.label,points:c,initialCount:s.points.length})}return P},t}()),ke={name:"MagicWand",mixins:[Xt],props:{width:{type:null,required:!0},height:{type:null,required:!0},imageData:{required:!0,validator:function(t){return"object"===Object(_e["a"])(t)||null===t}}},data:function(){return{icon:"fa-magic",name:"Magic Wand",imageInfo:{},cursor:"crosshair",wand:{threshold:30,blur:40}}},watch:{isActive:function(t){t&&(this.tool.activate(),localStorage.setItem("editorTool",this.name))}},methods:{export:function(){return{threshold:this.wand.threshold,blur:this.wand.blur}},setPreferences:function(t){this.wand.threshold=t.threshold||this.wand.threshold,this.wand.blur=t.blur||this.wand.blur},flood:function(t,e,a,n){if(null!=this.imageData){var i={data:this.imageData.data,width:this.width,height:this.height,bytes:4},o=we.floodFill(i,t,e,a);n=n<1?1:Math.abs(n),o=we.gaussBlurOnlyBorder(o,n);var s=we.traceContours(o).filter(function(t){return!t.inner});if(s[0]){var r=i.width/2,l=i.height/2,c=s[0].points;c=c.map(function(t){return{x:t.x+.5-r,y:t.y+.5-l}});var u=new F.a.Path(c);return u.closed=!0,u}return null}},onMouseUp:function(){},onMouseDown:function(t){var e=Math.round(this.width/2+t.point.x),a=Math.round(this.height/2+t.point.y);if(!(e>this.width||a>this.height||e<0||a<0)){var n=this.flood(e,a,this.wand.threshold,this.wand.blur);t.modifiers.shift?this.$parent.currentAnnotation.subtract(n):this.$parent.currentAnnotation.unite(n),null!=n&&n.remove()}},onMouseDrag:function(t){this.onMouseDown(t)}},computed:{isDisabled:function(){return-1===this.$parent.current.annotation}}},xe=ke,Pe=Object(m["a"])(xe,ye,be,!1,null,null,null);Pe.options.__file="MagicWandTool.vue";var Ae,Se,Oe=Pe.exports,$e={name:"EraserTool",mixins:[Xt],props:{scale:{type:Number,default:1}},data:function(){return{icon:"fa-eraser",name:"Eraser",cursor:"none",scaleFactor:3,eraser:{brush:null,minimumArea:10,pathOptions:{strokeColor:"white",strokeWidth:1,radius:30}}}},methods:{removeBrush:function(){null!=this.eraser.brush&&(this.eraser.brush.remove(),this.eraser.brush=null)},moveBrush:function(t){null==this.eraser.brush&&this.createBrush(),this.eraser.brush.bringToFront(),this.eraser.brush.position=t},createBrush:function(t){t=t||new F.a.Point(0,0),this.eraser.brush=new F.a.Path.Circle({strokeColor:this.eraser.pathOptions.strokeColor,strokeWidth:this.eraser.pathOptions.strokeWidth,radius:this.eraser.pathOptions.radius,center:t})},onMouseMove:function(t){this.moveBrush(t.point)},onMouseDrag:function(t){this.moveBrush(t.point),this.erase()},onMouseDown:function(){this.$parent.currentAnnotation.createUndoAction("Subtract"),this.erase()},onMouseUp:function(){this.$parent.currentAnnotation.simplifyPath()},erase:function(){this.$parent.currentAnnotation.subtract(this.eraser.brush,!1,!1)},decreaseRadius:function(){this.isActive&&(this.eraser.pathOptions.radius-=2)},increaseRadius:function(){this.isActive&&(this.eraser.pathOptions.radius+=2)},export:function(){return{strokeColor:this.eraser.pathOptions.strokeColor,radius:this.eraser.pathOptions.radius}},setPreferences:function(t){this.eraser.pathOptions.strokeColor=t.strokeColor||this.eraser.pathOptions.strokeColor,this.eraser.pathOptions.radius=t.radius||this.eraser.pathOptions.radius}},computed:{isDisabled:function(){return-1==this.$parent.current.annotation}},watch:{"eraser.pathOptions.radius":function(){if(null!=this.eraser.brush){var t=this.eraser.brush.position;this.eraser.brush.remove(),this.createBrush(t)}},"eraser.pathOptions.strokeColor":function(t){null!=this.eraser.brush&&(this.eraser.brush.strokeColor=t)},isActive:function(t){null!=this.eraser.brush&&(this.eraser.brush.visible=t),t&&(this.tool.activate(),localStorage.setItem("editorTool",this.name))},scale:function(t){this.eraser.pathOptions.strokeWidth=t*this.scaleFactor,null!=this.eraser.brush&&(this.eraser.brush.strokeWidth=t*this.scaleFactor)}},mounted:function(){}},Ee=$e,Te=Object(m["a"])(Ee,Ae,Se,!1,null,null,null);Te.options.__file="EraserTool.vue";var De,Ie,je=Te.exports,Le={name:"EraserTool",mixins:[Xt],props:{scale:{type:Number,default:1}},data:function(){return{icon:"fa-paint-brush",name:"Brush",cursor:"none",scaleFactor:3,brush:{path:null,pathOptions:{strokeColor:"white",strokeWidth:1,radius:30}},selection:null}},methods:{removeBrush:function(){null!=this.brush.path&&(this.brush.path.remove(),this.brush.path=null)},removeSelection:function(){null!=this.selection&&(this.selection.remove(),this.selection=null)},moveBrush:function(t){null==this.brush.path&&this.createBrush(),this.brush.path.bringToFront(),this.brush.path.position=t},createBrush:function(t){t=t||new F.a.Point(0,0),this.brush.path=new F.a.Path.Circle({strokeColor:this.brush.pathOptions.strokeColor,strokeWidth:this.brush.pathOptions.strokeWidth,radius:this.brush.pathOptions.radius,center:t})},createSelection:function(){this.selection=new F.a.Path({strokeColor:this.brush.pathOptions.strokeColor,strokeWidth:this.brush.pathOptions.strokeWidth})},onMouseMove:function(t){this.moveBrush(t.point)},onMouseDown:function(){this.createSelection(),this.draw()},onMouseUp:function(){this.merge(),this.removeSelection()},onMouseDrag:function(t){this.moveBrush(t.point),this.draw()},draw:function(){var t=this.selection.unite(this.brush.path);this.selection.remove(),this.selection=t},merge:function(){this.$parent.uniteCurrentAnnotation(this.selection)},decreaseRadius:function(){this.isActive&&(this.brush.pathOptions.radius-=2)},increaseRadius:function(){this.isActive&&(this.brush.pathOptions.radius+=2)},export:function(){return{strokeColor:this.brush.pathOptions.strokeColor,radius:this.brush.pathOptions.radius}},setPreferences:function(t){this.brush.pathOptions.strokeColor=t.strokeColor||this.brush.pathOptions.strokeColor,this.brush.pathOptions.radius=t.radius||this.brush.pathOptions.radius}},computed:{isDisabled:function(){return-1==this.$parent.current.annotation}},watch:{"brush.pathOptions.radius":function(){if(null!=this.brush.path){var t=this.brush.path.position;this.brush.path.remove(),this.createBrush(t)}},"brush.pathOptions.strokeColor":function(t){null!=this.brush.path&&(this.brush.path.strokeColor=t)},isActive:function(t){null!=this.brush.path&&(this.brush.path.visible=t),t&&(this.tool.activate(),localStorage.setItem("editorTool",this.name))},scale:function(t){this.brush.pathOptions.strokeWidth=t*this.scaleFactor,null!=this.brush.path&&(this.brush.path.strokeWidth=t*this.scaleFactor)}},mounted:function(){}},Ne=Le,Be=Object(m["a"])(Ne,De,Ie,!1,null,null,null);Be.options.__file="BrushTool.vue";var Me,Ue,Ke=Be.exports,Fe={name:"KeypointTool",mixins:[Xt],props:{scale:{type:Number,default:1},settings:{type:[Object,null],default:null}},data:function(){return{icon:"fa-map-marker",name:"Keypoints",cursor:"cell"}},methods:{export:function(){return{}},onMouseDown:function(t){this.$parent.currentAnnotation.addKeypoint(t.point)}},computed:{isDisabled:function(){return-1===this.$parent.current.annotation}},watch:{},created:function(){},mounted:function(){}},Re=Fe,qe=Object(m["a"])(Re,Me,Ue,!1,null,null,null);qe.options.__file="KeypointTool.vue";var Ve,We,ze=qe.exports,He={name:"DEXTRTool",mixins:[Xt],props:{scale:{type:Number,default:1}},data:function(){return{icon:"fa-crosshairs",name:"DEXTR",cursor:"crosshair",settings:{padding:50,threshold:80},points:[]}},methods:{createPoint:function(t){var e=new F.a.Path.Circle(t,5);e.fillColor=this.$parent.currentAnnotation.color,e.data.point=t,this.points.push(e)},onMouseDown:function(t){this.createPoint(t.point)}},computed:{isDisabled:function(){return-1==this.$parent.current.annotation}},watch:{points:function(t){if(4==t.length){var e=this.points;this.points=[];var a=this.$parent.currentAnnotation,n=[],i=this.$parent.image.raster.width/2,o=this.$parent.image.raster.height/2;e.forEach(function(t){var e=t.position;n.push([Math.round(i+e.x),Math.round(o+e.y)])}),q.a.post("/api/model/dextr/".concat(this.$parent.image.id),Object(s["a"])({points:n},this.settings)).then(function(t){for(var e=t.data.segmentaiton,n=new F.a.Point(i,o),s=new F.a.CompoundPath,r=0;r<e.length;r++){for(var l=e[r],c=new F.a.Path,u=0;u<l.length;u+=2){var d=new F.a.Point(l[u],l[u+1]);c.add(d.subtract(n))}c.closePath(),s.addChild(c)}a.unite(s)}).finally(function(){return e.forEach(function(t){return t.remove()})})}}}},Ye=He,Ge=Object(m["a"])(Ye,Ve,We,!1,null,null,null);Ge.options.__file="DEXTRTool.vue";var Xe=Ge.exports,Je=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("i",{directives:[{name:"tooltip",rawName:"v-tooltip.right",value:t.name,expression:"name",modifiers:{right:!0}}],staticClass:"fa fa-x fa-clone",staticStyle:{color:"white"},attrs:{"data-toggle":"modal","data-target":"#copyAnnotations"}}),a("br"),a("div",{ref:"modal",staticClass:"modal fade",attrs:{id:"copyAnnotations",tabindex:"-1",role:"dialog","aria-labelledby":"copyAnnotationsLabel","aria-hidden":"true"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(0),a("div",{staticClass:"modal-body"},[a("form",{attrs:{novalidate:"true"}},[a("button",{staticClass:"btn btn-sm btn-light",staticStyle:{float:"left"},attrs:{type:"button"},on:{click:function(e){t.fromId=t.previous.toString()}}},[a("i",{staticClass:"fa fa-arrow-left"}),t._v(" Previous Image\n            ")]),a("button",{staticClass:"btn btn-sm btn-light",staticStyle:{float:"right","margin-left":"8px"},attrs:{type:"button"},on:{click:function(e){t.fromId=t.next.toString()}}},[t._v("\n              Next Image "),a("i",{staticClass:"fa fa-arrow-right"})]),a("div",{staticClass:"form-group"},[a("label",[t._v("Image ID")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.fromId,expression:"fromId"}],class:{"form-control":!0,"is-invalid":0!==t.validImageId.length},attrs:{placeholder:"Enter an image ID",required:""},domProps:{value:t.fromId},on:{input:function(e){e.target.composing||(t.fromId=e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v(t._s(t.validImageId))])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Copy Only Selected Categories")]),a("TagsInput",{attrs:{"element-id":"categoriesToCopy","existing-tags":t.categoryTags,typeahead:!0,"only-existing-tags":!0,"typeahead-activation-threshold":0},model:{value:t.selectedCategories,callback:function(e){t.selectedCategories=e},expression:"selectedCategories"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:function(e){t.close()}}},[t._v("\n            Close\n          ")]),a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:function(e){t.copyAnnotations()}}},[t._v("\n            Copy\n          ")])])])])])])},Qe=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title",attrs:{id:"copyAnnotationsLabel"}},[t._v("\n            Copy Annotations From Image\n          ")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])}],Ze=lt.a,ta={name:"CopyAnnotationsButton",props:{imageId:{type:Number,required:!0},next:{type:Number,default:null},previous:{type:Number,default:null},categories:{type:Array,required:!0}},components:{TagsInput:Ct["a"]},mixins:[V["a"]],data:function(){return{name:"Copy Annotations",fromId:"",selectedCategories:[],visible:!1}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess","resetUndo"]),{close:function(){Ze("#copyAnnotations").modal("hide")},copyAnnotations:function(){var t=this;if(""===this.validImageId){this.close();var e="Copying annotations from "+this.fromId,a=[];this.selectedCategories.forEach(function(t){return a.push(parseInt(t))}),this.$parent.save(function(){t.addProcess(e),q.a.post("/api/image/copy/"+t.fromId+"/"+t.imageId+"/annotations",{category_ids:a}).then(function(){t.$parent.getData()}).catch(function(e){t.axiosReqestError("Copying Annotations",e.response.data.message)}).finally(function(){return t.removeProcess(e)})})}}}),watch:{categories:{immediate:!0,handler:function(t){var e=[];t.forEach(function(t){e.push(t.id.toString())}),this.selectedCategories=e}}},computed:{validImageId:function(){var t="Enter a valid image ID";return null==this.fromId?t:""===this.fromId?t:isNaN(this.fromId)?"Value must be a number":this.fromId.trim()!==this.fromId?"Value must be a number":this.fromId===this.imageId?"Sorry, you can not clone the same image":""},categoryTags:function(){var t={};return this.categories.forEach(function(e){t[e.id]=e.name}),t}}},ea=ta,aa=(a("6632"),Object(m["a"])(ea,Je,Qe,!1,null,"aeec01ae",null));aa.options.__file="CopyAnnotationsButton.vue";var na,ia,oa=aa.exports,sa={template:"<div><i v-tooltip.right='name' class='fa fa-x' :class='icon' :style='{ color: iconColor }' @click='click'></i><br></div>",data:function(){return{color:{enabled:"white",active:"#2ecc71",disabled:"gray"},iconColor:"",delay:400}},methods:{click:function(){this.disabled||(this.toggleAnimation(),this.execute())},toggleAnimation:function(){var t=this;this.iconColor=this.color.active,setTimeout(function(){t.iconColor=t.color.enabled},this.delay)}},created:function(){this.iconColor=this.color.enabled}},ra={name:"CenterButton",mixins:[sa],data:function(){return{name:"Center Image",icon:"fa-align-center"}},methods:{execute:function(){this.$parent.fit()}}},la=ra,ca=Object(m["a"])(la,na,ia,!1,null,null,null);ca.options.__file="CenterButton.vue";var ua,da,ha=ca.exports,pa={name:"DownloadButton",mixins:[sa],props:{image:{type:Object,required:!0}},data:function(){return{name:"Download COCO",icon:"fa-download",include:{image:!0,coco:!0}}},methods:{downloadURI:function(t,e){var a=document.createElement("a");a.href=t,a.download=e,document.body.appendChild(a),a.click(),a.remove()},download:function(){var t=this;if(this.include.image){var e="/api/image/"+this.image.id+"?asAttachment=true";this.downloadURI(e,this.image.filename)}if(this.include.coco){var a="/api/image/"+this.image.id+"/coco";q.a.get(a).then(function(e){var a="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e.data)),n=t.image.filename.replace(/\.[^\/.]+$/,"")+".json";t.downloadURI(a,n)})}},execute:function(){this.$parent.save(this.download)}}},ma=pa,ga=Object(m["a"])(ma,ua,da,!1,null,null,null);ga.options.__file="DownloadButton.vue";var fa,va,ya=ga.exports,ba={name:"SaveButton",mixins:[sa],data:function(){return{name:"Save",icon:"fa-save"}},methods:{execute:function(){this.$parent.save()}}},Ca=ba,_a=Object(m["a"])(Ca,fa,va,!1,null,null,null);_a.options.__file="SaveButton.vue";var wa=_a.exports,ka=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("i",{directives:[{name:"tooltip",rawName:"v-tooltip.right",value:t.name,expression:"name",modifiers:{right:!0}}],staticClass:"fa fa-x fa-cog",staticStyle:{color:"white"},attrs:{"data-toggle":"modal","data-target":"#settings"}}),a("br"),a("div",{staticClass:"modal fade",attrs:{id:"settings",tabindex:"-1",role:"dialog","aria-labelledby":"settingsLabel","aria-hidden":"true"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(0),a("div",{staticClass:"modal-body"},[a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-2 col-form-label"},[t._v("Simplify")]),a("div",{staticClass:"col-sm-9"},[a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.$parent.simplify,expression:"$parent.simplify",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:t.$parent.simplify},on:{input:function(e){e.target.composing||t.$set(t.$parent,"simplify",t._n(e.target.value))},blur:function(e){t.$forceUpdate()}}})])]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-2 col-form-label"},[t._v("Annotate API")]),a("div",{staticClass:"col-sm-9"},[a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.$parent.dataset.annotate_url,expression:"$parent.dataset.annotate_url",modifiers:{number:!0}}],staticClass:"form-control",attrs:{type:"string"},domProps:{value:t.$parent.dataset.annotate_url},on:{input:function(e){e.target.composing||t.$set(t.$parent.dataset,"annotate_url",t._n(e.target.value))},blur:function(e){t.$forceUpdate()}}})])]),a("Metadata",{ref:"metadata",attrs:{metadata:t.metadata}}),a("p",{staticStyle:{margin:"5px 0 0 0"}},[t._v("Keyboard Shortcuts")]),t._m(1),a("ul",{staticClass:"list-group",staticStyle:{height:"50%"}},t._l(t.commands,function(t,e){return a("CustomShortcut",{key:e,ref:"shortcuts",refInFor:!0,attrs:{shortcut:t}})}))],1),t._m(2)])])])])},xa=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title",attrs:{id:"settingsLabel"}},[t._v("Image Settings")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm"},[a("p",{staticClass:"subtitle"},[t._v("Operation")])]),a("div",{staticClass:"col-sm"},[a("p",{staticClass:"subtitle"},[t._v("Shortcut")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])}],Pa=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[null!=t.shortcut.title?a("div",{staticStyle:{"font-size":"13px"}},[t._v("\n    "+t._s(t.shortcut.title)+"\n  ")]):t._e(),a("div",{staticClass:"row",staticStyle:{}},[a("div",{staticClass:"col-sm"},[t._v("\n      "+t._s(t.shortcut.name)+"\n      "),a("p",{directives:[{name:"show",rawName:"v-show",value:t.readonly,expression:"readonly"}],staticClass:"mute"},[t._v("(readonly)")])]),a("div",{staticClass:"col-sm"},[a("input",{staticClass:"input",attrs:{id:t._uid,type:"text",readonly:t.readonly},domProps:{value:t.keys.join("+").toUpperCase()}})])])])},Aa=[],Sa={name:"CustomShortcut",props:{shortcut:{type:Object,required:!0}},data:function(){return{keys:this.shortcut.default,keysDown:[],readonly:null!=this.shortcut.readonly&&this.shortcut.readonly}},methods:{export:function(){return{name:this.shortcut.name,keys:this.keys}},function:function(t){var e=t.target.tagName.toLowerCase();"input"!==e&&"textarea"!==e&&(t.preventDefault(),this.shortcut.function())},onkeydown:function(t){if(!this.readonly){var e=this.keyCorrections(t.key.toLowerCase());-1===this.keysDown.indexOf(e)&&this.keysDown.push(e),parseInt(t.target.id)===this._uid?(t.preventDefault(),this.keys=this.keysDown):"annotate"===this.$route.name&&this.keysDown.sort().join(",")===this.keys.sort().join(",")&&this.function(t)}},onkeyup:function(t){var e=this.keyCorrections(t.key.toLowerCase());" "===e&&(e="space"),this.keysDown=this.keysDown.filter(function(t){return t!==e})},keyCorrections:function(t){return" "==t?"space":t}},computed:{toggleKey:function(){return this.keysDown.toString().replace(/,/g,"+")}},created:function(){window.addEventListener("keyup",this.onKeyup=this.onkeyup.bind(this)),window.addEventListener("keydown",this.onKeydown=this.onkeydown.bind(this))},destroyed:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keydup",this.onKeyup)}},Oa=Sa,$a=(a("bdb2"),Object(m["a"])(Oa,Pa,Aa,!1,null,"6f65a694",null));$a.options.__file="CustomShortcut.vue";var Ea=$a.exports,Ta={name:"SettingsButton",components:{CustomShortcut:Ea,Metadata:At},props:{metadata:{type:Object,required:!0},commands:{type:Array,required:!0}},data:function(){return{name:"Image Settings"}},methods:{exportMetadata:function(){return this.$refs.metadata.export()},export:function(){var t={shortcuts:[]};return this.$refs.shortcuts.forEach(function(e){t.shortcuts.push(e.export())}),t}}},Da=Ta,Ia=(a("d9a3"),Object(m["a"])(Da,ka,xa,!1,null,"a1264000",null));Ia.options.__file="SettingsButton.vue";var ja,La,Na=Ia.exports,Ba={name:"ModeButton",mixins:[sa],model:{prop:"mode",event:"update"},props:{mode:{type:String,required:!0}},data:function(){return{name:"Mode: "+this.mode}},watch:{mode:function(){this.name="Mode: "+this.mode}},computed:{icon:function(){return"segment"==this.mode?"fa-pencil-square-o":"label"==this.mode?"fa-tags":""}},methods:{next:function(){return"segment"==this.mode?"label":"segment"},execute:function(){this.$emit("update",this.next())}}},Ma=Ba,Ua=Object(m["a"])(Ma,ja,La,!1,null,null,null);Ua.options.__file="ModeButton.vue";var Ka,Fa,Ra=Ua.exports,qa={name:"DeleteButton",mixins:[sa],props:{image:{type:Object,required:!0}},data:function(){return{name:"Delete Image",icon:"fa-trash-o"}},methods:{execute:function(){q.a.delete("/api/image/"+this.image.id).then(function(){})}}},Va=qa,Wa=Object(m["a"])(Va,Ka,Fa,!1,null,null,null);Wa.options.__file="DeleteButton.vue";var za,Ha,Ya=Wa.exports,Ga={name:"UndoButton",mixins:[sa],data:function(){return{icon:"fa-undo",disabled:!0}},methods:Object(s["a"])({},Object(d["c"])(["undo"]),{execute:function(){this.undo()}}),computed:{name:function(){var t=this.undoList.length;if(0==t)return"Nothing to undo";var e=this.undoList[t-1];return"Undo (Last Action: "+e.name+" "+e.action+")"},undoList:function(){return this.$store.state.undo}},watch:{undoList:function(){this.disabled=0===this.undoList.length,this.iconColor=this.disabled?this.color.disabled:this.color.enabled}},created:function(){this.iconColor=this.color.disabled}},Xa=Ga,Ja=Object(m["a"])(Xa,za,Ha,!1,null,null,null);Ja.options.__file="UndoButton.vue";var Qa,Za,tn=Ja.exports,en={name:"ShowAllButton",mixins:[sa],data:function(){return{name:"Show All",icon:"fa-eye"}},methods:{execute:function(){this.$parent.showAll()}}},an=en,nn=Object(m["a"])(an,Qa,Za,!1,null,null,null);nn.options.__file="ShowAllButton.vue";var on,sn,rn=nn.exports,ln={name:"HideAllButton",mixins:[sa],data:function(){return{name:"Hide All",icon:"fa-eye-slash"}},methods:{execute:function(){this.$parent.hideAll()}}},cn=ln,un=Object(m["a"])(cn,on,sn,!1,null,null,null);un.options.__file="HideAllButton.vue";var dn,hn,pn=un.exports,mn={name:"AnnotateButton",mixins:[sa,V["a"]],props:{annotateUrl:{required:!0,type:[String,Number]}},data:function(){return{icon:"fa-cloud-download",cursor:"copy",iconColor:"white",disabled:!0,loading:!1}},methods:{execute:function(){var t=this;if(this.validUrl){var e=this.$parent.image.raster.canvas,a=new FormData;e.toBlob(function(e){a.append("image",e),t.loading=!0,q.a.post(t.annotateUrl,a,{headers:{"Content-Type":"multipart/form-data"}}).then(function(e){var a=e.data.coco||{},n=a.images||[],i=a.categories||[],o=a.annotations||[];if(0!=n.length&&0!=i.length&&0!=o.length){var s={};i.forEach(function(t){s[t.id]=t}),o.forEach(function(e){var a=e.keypoints||[],n=e.segmentation||[],i=s[e.category_id],o=e.isbbox||!1;t.$parent.addAnnotation(i.name,n,a,o=o)})}}).catch(function(){t.axiosReqestError("Annotator","Could not read data from URL")}).finally(function(){return t.loading=!1})})}}},computed:{name:function(){return this.validUrl?"Annotate Image":"Annotate url is invalid"},validUrl:function(){return"number"!==typeof this.annotateUrl&&this.annotateUrl.length>2}},watch:{loading:function(){this.icon=this.loading?"fa-spinner fa-spin":"fa-cloud-download"},validUrl:function(){this.disabled=!this.validUrl},disabled:function(){this.iconColor=this.disabled?this.color.disabled:this.color.enabled}},created:function(){this.iconColor=this.color.disabled,this.disabled=!this.validUrl}},gn=mn,fn=Object(m["a"])(gn,dn,hn,!1,null,null,null);fn.options.__file="AnnotateButton.vue";var vn=fn.exports,yn=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.polygon.isActive,expression:"polygon.isActive"}]},[a("PanelButton",{attrs:{name:"Close Polygon"},on:{click:t.polygon.complete}}),a("PanelButton",{attrs:{name:"Delete Polygon"},on:{click:t.polygon.deletePolygon}}),a("PanelToggle",{attrs:{name:"Guidance"},model:{value:t.polygon.polygon.guidance,callback:function(e){t.$set(t.polygon.polygon,"guidance",e)},expression:"polygon.polygon.guidance"}}),a("PanelToggle",{attrs:{name:"Auto Select Color"},model:{value:t.polygon.color.auto,callback:function(e){t.$set(t.polygon.color,"auto",e)},expression:"polygon.color.auto"}}),a("PanelToggle",{directives:[{name:"show",rawName:"v-show",value:t.polygon.color.auto,expression:"polygon.color.auto"}],attrs:{name:"Only Black or White"},model:{value:t.polygon.color.blackOrWhite,callback:function(e){t.$set(t.polygon.color,"blackOrWhite",e)},expression:"polygon.color.blackOrWhite"}}),a("PanelInputString",{attrs:{name:"Stroke Color"},model:{value:t.polygon.polygon.pathOptions.strokeColor,callback:function(e){t.$set(t.polygon.polygon.pathOptions,"strokeColor",e)},expression:"polygon.polygon.pathOptions.strokeColor"}}),a("PanelInputNumber",{attrs:{name:"Auto Complete Distance",min:"0",max:"1000",step:"5"},model:{value:t.polygon.polygon.completeDistance,callback:function(e){t.$set(t.polygon.polygon,"completeDistance",e)},expression:"polygon.polygon.completeDistance"}}),a("PanelInputNumber",{attrs:{name:"Min Distance",min:"0",max:"500",step:"2"},model:{value:t.polygon.polygon.minDistance,callback:function(e){t.$set(t.polygon.polygon,"minDistance",e)},expression:"polygon.polygon.minDistance"}})],1)},bn=[],Cn=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"btn btn-outline-light tool-input-button",on:{click:function(e){t.$emit("click")}}},[t._v("\n  "+t._s(t.name)+"\n")])},_n=[],wn={name:"PanelButton",props:{name:{type:String,required:!0}}},kn=wn,xn=(a("6a7c"),Object(m["a"])(kn,Cn,_n,!1,null,"636b6f86",null));xn.options.__file="PanelButton.vue";var Pn=xn.exports,An=a("4dc3"),Sn=a("df42"),On=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-group tool-input-group"},[a("div",{staticClass:"input-group-prepend tool-option-pre"},[a("span",{staticClass:"input-group-text tool-option-font"},[t._v(t._s(t.name))])]),a("input",{directives:[{name:"model",rawName:"v-model.number",value:t.localValue,expression:"localValue",modifiers:{number:!0}}],staticClass:"form-control tool-option-input",attrs:{type:"number",min:t.min,max:t.max,step:t.step},domProps:{value:t.localValue},on:{input:function(e){e.target.composing||(t.localValue=t._n(e.target.value))},blur:function(e){t.$forceUpdate()}}})])},$n=[],En={name:"PanelInputNumber",model:{prop:"value",event:"update"},props:{name:{type:String,required:!0},value:{type:Number,required:!0},max:{type:String,default:"10"},min:{type:String,default:"1"},step:{type:String,default:"1"}},data:function(){return{localValue:this.value}},watch:{localValue:function(){this.$emit("update",this.localValue)},value:function(t){this.localValue=t}}},Tn=En,Dn=(a("36f6"),Object(m["a"])(Tn,On,$n,!1,null,"4de563f2",null));Dn.options.__file="PanelInputNumber.vue";var In=Dn.exports,jn={name:"PolygonPanel",components:{PanelButton:Pn,PanelToggle:An["a"],PanelInputString:Sn["a"],PanelInputNumber:In},props:{polygon:{type:Object,required:!0}}},Ln=jn,Nn=Object(m["a"])(Ln,yn,bn,!1,null,null,null);Nn.options.__file="PolygonPanel.vue";var Bn=Nn.exports,Mn=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.bbox.isActive,expression:"bbox.isActive"}]},[a("PanelButton",{attrs:{name:"Delete BBox"},on:{click:t.bbox.deleteBbox}}),a("PanelToggle",{attrs:{name:"Auto Select Color"},model:{value:t.bbox.color.auto,callback:function(e){t.$set(t.bbox.color,"auto",e)},expression:"bbox.color.auto"}}),a("PanelToggle",{directives:[{name:"show",rawName:"v-show",value:t.bbox.color.auto,expression:"bbox.color.auto"}],attrs:{name:"Only Black or White"},model:{value:t.bbox.color.blackOrWhite,callback:function(e){t.$set(t.bbox.color,"blackOrWhite",e)},expression:"bbox.color.blackOrWhite"}}),a("PanelInputString",{attrs:{name:"Stroke Color"},model:{value:t.bbox.polygon.pathOptions.strokeColor,callback:function(e){t.$set(t.bbox.polygon.pathOptions,"strokeColor",e)},expression:"bbox.polygon.pathOptions.strokeColor"}})],1)},Un=[],Kn={name:"BBoxPanel",components:{PanelButton:Pn,PanelToggle:An["a"],PanelInputString:Sn["a"],PanelInputNumber:In},props:{bbox:{type:Object,required:!0}}},Fn=Kn,Rn=Object(m["a"])(Fn,Mn,Un,!1,null,null,null);Rn.options.__file="BBoxPanel.vue";var qn=Rn.exports,Vn=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.select.isActive,expression:"select.isActive"}]},[a("PanelToggle",{attrs:{name:"Show Hover Text"},model:{value:t.select.hover.showText,callback:function(e){t.$set(t.select.hover,"showText",e)},expression:"select.hover.showText"}})],1)},Wn=[],zn={name:"SelectPanel",components:{PanelToggle:An["a"]},props:{select:{type:Object,required:!0}}},Hn=zn,Yn=Object(m["a"])(Hn,Vn,Wn,!1,null,null,null);Yn.options.__file="SelectPanel.vue";var Gn=Yn.exports,Xn=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.magicwand.isActive,expression:"magicwand.isActive"}]},[a("PanelInputNumber",{attrs:{name:"Threshold",min:"0",max:"1000",step:"5"},model:{value:t.magicwand.wand.threshold,callback:function(e){t.$set(t.magicwand.wand,"threshold",e)},expression:"magicwand.wand.threshold"}}),a("PanelInputNumber",{attrs:{name:"Blur",min:"0",max:"1000",step:"5"},model:{value:t.magicwand.wand.blur,callback:function(e){t.$set(t.magicwand.wand,"blur",e)},expression:"magicwand.wand.blur"}})],1)},Jn=[],Qn={name:"MagicWandPanel",components:{PanelInputNumber:In},props:{magicwand:{type:Object,required:!0}}},Zn=Qn,ti=Object(m["a"])(Zn,Xn,Jn,!1,null,null,null);ti.options.__file="MagicWandPanel.vue";var ei=ti.exports,ai=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.brush.isActive,expression:"brush.isActive"}]},[a("PanelInputNumber",{attrs:{name:"Radius",min:"0",max:"1000",step:"5"},model:{value:t.brush.brush.pathOptions.radius,callback:function(e){t.$set(t.brush.brush.pathOptions,"radius",e)},expression:"brush.brush.pathOptions.radius"}}),a("PanelInputString",{attrs:{name:"Stroke Color"},model:{value:t.brush.brush.pathOptions.strokeColor,callback:function(e){t.$set(t.brush.brush.pathOptions,"strokeColor",e)},expression:"brush.brush.pathOptions.strokeColor"}})],1)},ni=[],ii={name:"BrushPanel",components:{PanelInputString:Sn["a"],PanelInputNumber:In},props:{brush:{type:Object,required:!0}}},oi=ii,si=Object(m["a"])(oi,ai,ni,!1,null,null,null);si.options.__file="BrushPanel.vue";var ri=si.exports,li=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.eraser.isActive,expression:"eraser.isActive"}]},[a("PanelInputNumber",{attrs:{name:"Radius",min:"0",max:"1000",step:"5"},model:{value:t.eraser.eraser.pathOptions.radius,callback:function(e){t.$set(t.eraser.eraser.pathOptions,"radius",e)},expression:"eraser.eraser.pathOptions.radius"}}),a("PanelInputString",{attrs:{name:"Stroke Color"},model:{value:t.eraser.eraser.pathOptions.strokeColor,callback:function(e){t.$set(t.eraser.eraser.pathOptions,"strokeColor",e)},expression:"eraser.eraser.pathOptions.strokeColor"}})],1)},ci=[],ui={name:"EraserPanel",components:{PanelInputString:Sn["a"],PanelInputNumber:In},props:{eraser:{type:Object,required:!0}}},di=ui,hi=Object(m["a"])(di,li,ci,!1,null,null,null);hi.options.__file="EraserPanel.vue";var pi=hi.exports,mi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.keypoint.isActive,expression:"keypoint.isActive"}]},[a("PanelText",{attrs:{name:"Settings for next Keypoint"}}),a("div",{staticClass:"input-group tool-input-group"},[t._m(0),a("div",{staticClass:"form-control tool-option-input text-left"},[t._v("\n      "+t._s(t.keypointLabel)+"\n    ")])]),a("PanelInputDropdown",{attrs:{name:"Visibility",values:t.visibilityOptions},model:{value:t.visibility,callback:function(e){t.visibility=e},expression:"visibility"}})],1)},gi=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-group-prepend tool-option-pre"},[a("span",{staticClass:"input-group-text tool-option-font"},[t._v("Label")])])}],fi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tool-option-input tool-option-font"},[a("p",[t._v(t._s(t.name))])])},vi=[],yi={name:"PanelButton",props:{name:{type:String,required:!0}}},bi=yi,Ci=(a("6f41"),Object(m["a"])(bi,fi,vi,!1,null,"280e35cf",null));Ci.options.__file="PanelText.vue";var _i=Ci.exports,wi=a("13f8"),ki={name:"KeypointPanel",components:{PanelText:_i,PanelInputDropdown:wi["a"]},props:{keypoint:{type:Object,required:!0},currentAnnotation:{required:!0,validator:function(t){return"object"===Object(_e["a"])(t)||void 0===t}}},data:function(){return{visibility:2,label:-1,visibilityOptions:vt}},computed:{keypointLabel:function(){if(!this.currentAnnotation)return{};var t=this.currentAnnotation.keypoint.next.label,e=this.currentAnnotation.notUsedKeypointLabels,a=Object.keys(e);return(t<0||t>e)&&a.length>0?e[a[0]]:e[t]}}},xi=ki,Pi=(a("2c05"),Object(m["a"])(xi,mi,gi,!1,null,"ba75e03a",null));Pi.options.__file="KeypointPanel.vue";var Ai=Pi.exports,Si=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"show",rawName:"v-show",value:t.dextr.isActive,expression:"dextr.isActive"}]},[a("PanelInputNumber",{attrs:{name:"Padding",min:"0",max:"1000",step:"2"},model:{value:t.dextr.settings.padding,callback:function(e){t.$set(t.dextr.settings,"padding",e)},expression:"dextr.settings.padding"}}),a("PanelInputNumber",{attrs:{name:"Threshold",min:"0",max:"100",step:"5"},model:{value:t.dextr.settings.threshold,callback:function(e){t.$set(t.dextr.settings,"threshold",e)},expression:"dextr.settings.threshold"}})],1)},Oi=[],$i={name:"DEXTRPanel",components:{PanelInputNumber:In},props:{dextr:{type:Object,required:!0}}},Ei=$i,Ti=Object(m["a"])(Ei,Si,Oi,!1,null,null,null);Ti.options.__file="DEXTRPanel.vue";var Di=Ti.exports,Ii={name:"Annotator",components:{FileTitle:J,CopyAnnotationsButton:oa,Category:qt,CLabel:Gt,BBoxTool:me,BBoxPanel:qn,PolygonTool:se,PolygonPanel:Bn,SelectTool:Ce,MagicWandTool:Oe,EraserTool:je,BrushTool:Ke,KeypointTool:ze,DownloadButton:ya,SaveButton:wa,SettingsButton:Na,DeleteButton:Ya,CenterButton:ha,SelectPanel:Gn,MagicWandPanel:ei,BrushPanel:ri,EraserPanel:pi,ModeButton:Ra,UndoButton:tn,HideAllButton:pn,ShowAllButton:rn,KeypointPanel:Ai,AnnotateButton:vn,DEXTRTool:Xe,DEXTRPanel:Di},mixins:[V["a"],W],props:{identifier:{type:[Number,String],required:!0}},data:function(){return{activeTool:"Select",paper:null,shapeOpacity:.6,zoom:.2,cursor:"move",mode:"segment",simplify:1,panels:{show:{left:!0,right:!0}},current:{category:-1,annotation:-1,keypoint:-1},hover:{category:-1,annotation:-1,keypoint:-1},image:{raster:{},scale:0,metadata:{},ratio:0,rotate:0,id:null,url:"",dataset:0,previous:null,next:null,filename:"",categoryIds:[],data:null},text:{topLeft:null,topRight:null},categories:[],dataset:{annotate_url:""},loading:{image:!0,data:!0,loader:null},search:"",annotating:[],pinching:{old_zoom:1}}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess","resetUndo","setDataset"]),{save:function(t){var e=this,a="Saving";this.addProcess(a);var n=this.$refs,i={mode:this.mode,user:{bbox:this.$refs.bbox.export(),polygon:this.$refs.polygon.export(),eraser:this.$refs.eraser.export(),brush:this.$refs.brush.export(),magicwand:this.$refs.magicwand.export(),select:this.$refs.select.export(),settings:this.$refs.settings.export()},dataset:this.dataset,image:{id:this.image.id,metadata:this.$refs.settings.exportMetadata(),settings:{selectedLayers:this.current},category_ids:[]},settings:{activeTool:this.activeTool,zoom:this.zoom,tools:{}},categories:[]};null!=n.category&&"segment"===this.mode&&(this.image.categoryIds=[],n.category.forEach(function(t){var a=t.export();if(i.categories.push(a),a.annotations.length>0){var n=e.image.categoryIds;-1===n.indexOf(a.id)&&n.push(a.id)}})),i.image.category_ids=this.image.categoryIds,q.a.post("/api/annotator/data",JSON.stringify(i)).then(function(){null!=t&&t()}).finally(function(){return e.removeProcess(a)})},onpinchstart:function(t){if(t.preventDefault(),this.doneLoading){this.paper.view;return this.pinching.old_zoom=this.paper.view.zoom,!1}},onpinch:function(t){if(t.preventDefault(),this.doneLoading){var e=this.paper.view,a=e.viewToProject(new F.a.Point(t.center.x,t.center.y)),n=t.scale*this.pinching.old_zoom,i=this.paper.view.zoom/n,o=a.subtract(this.paper.view.center),s=a.subtract(o.multiply(i)).subtract(this.paper.view.center),r={zoom:n,offset:s};return r.zoom<10&&r.zoom>.01&&(this.image.scale=1/r.zoom,this.paper.view.zoom=r.zoom,this.paper.view.center=e.center.add(r.offset)),!1}},onwheel:function(t){if(t.preventDefault(),this.doneLoading){var e=this.paper.view;if(t.ctrlKey){var a=new F.a.Point(0,.5*t.deltaY);this.paper.view.setCenter(e.center.add(a))}else if(t.shiftKey){var n=new F.a.Point(.5*t.deltaY,0);this.paper.view.setCenter(e.center.add(n))}else{var i=e.viewToProject(new F.a.Point(t.offsetX,t.offsetY)),o=this.changeZoom(t.deltaY,i);o.zoom<10&&o.zoom>.01&&(this.image.scale=1/o.zoom,this.paper.view.zoom=o.zoom,this.paper.view.center=e.center.add(o.offset))}return!1}},fit:function(){var t=document.getElementById("editor"),e=this.image.raster.width,a=this.image.raster.height;this.paper.view.zoom=Math.min(t.width/e*.95,t.height/a*.8),this.image.scale=1/this.paper.view.zoom,this.paper.view.setCenter(0,0)},changeZoom:function(t,e){var a=this.paper.view.zoom,n=this.paper.view.center,i=1+this.zoom,o=t<0?a*i:a/i,s=a/o,r=e.subtract(n),l=e.subtract(r.multiply(s)).subtract(n);return{zoom:o,offset:l}},initCanvas:function(){var t=this,e="Initializing canvas";this.addProcess(e),this.loading.image=!0;var a=document.getElementById("editor");this.paper.setup(a),this.paper.view.viewSize=[this.paper.view.size.width,window.innerHeight],this.paper.activate(),this.image.raster=new F.a.Raster(this.image.url),this.image.raster.onLoad=function(){var a=t.image.raster.width,n=t.image.raster.height;t.image.raster.sendToBack(),t.fit(),t.image.ratio=a*n/1e6,t.removeProcess(e);var i=document.createElement("canvas").getContext("2d");i.canvas.width=a,i.canvas.height=n,i.drawImage(t.image.raster.image,0,0),t.image.data=i.getImageData(0,0,a,n);var o=.025*a,s=new F.a.Point(-a/2,-n/2-.5*o);t.text.topLeft=new F.a.PointText(s),t.text.topLeft.fontSize=o,t.text.topLeft.fillColor="white",t.text.topLeft.content=t.image.filename;var r=new F.a.Point(a/2,-n/2-.4*o);t.text.topRight=new F.a.PointText(r),t.text.topRight.justification="right",t.text.topRight.fontSize=o,t.text.topRight.fillColor="white",t.text.topRight.content=a+"x"+n,t.loading.image=!1}},setPreferences:function(t){var e=this.$refs;e.bbox.setPreferences(t.bbox||t.polygon||{}),e.polygon.setPreferences(t.polygon||{}),e.select.setPreferences(t.select||{}),e.magicwand.setPreferences(t.magicwand||{}),e.brush.setPreferences(t.brush||{}),e.eraser.setPreferences(t.eraser||{})},getData:function(t){var e=this,a="Loading annotation data";this.addProcess(a),this.loading.data=!0,q.a.get("/api/annotator/data/"+this.image.id).then(function(a){var n=a.data;e.loading.data=!1,e.image.metadata=n.image.metadata||{},e.image.filename=n.image.file_name,e.image.next=n.image.next,e.image.previous=n.image.previous,e.image.categoryIds=n.image.category_ids||[],e.annotating=n.image.annotating||[],e.dataset=n.dataset,e.categories=n.categories,e.setDataset(e.dataset);var i=n.preferences;e.setPreferences(i),null!=e.text.topLeft&&(e.text.topLeft.content=e.image.filename),e.$nextTick(function(){e.showAll()}),null!=t&&t()}).catch(function(){e.axiosReqestError("Could not find requested image","Redirecting to previous page."),e.$router.go(-1)}).finally(function(){return e.removeProcess(a)})},onCategoryClick:function(t){if(this.current.annotation=t.annotation,this.current.category=t.category,t.hasOwnProperty("keypoint")||(t.keypoint=-1),-1!==t.keypoint){this.current.keypoint=t.keypoint;this.currentCategory.category.annotations[this.current.annotation];var e=this.$refs.keypoint,a=this.$refs.select,n=this.$refs.category[this.current.category],i=n.$refs.annotation[this.current.annotation];i.showKeypoints=!0;var o=i.keypoints;if(o._labelled[t.keypoint+1]){var s=String(this.current.keypoint+1),r=o._labelled[s];r.selected=!0,this.activeTool=a,this.activeTool.click()}else this.currentAnnotation.keypoint.next.label=String(t.keypoint+1),this.activeTool=e,this.activeTool.click()}},onKeypointsComplete:function(){this.currentAnnotation.keypoint.next.label=-1,this.activeTool=this.$refs.select,this.activeTool.click()},getCategory:function(t){if(null==t)return null;if(t<0)return null;var e=this.$refs.category;return null==e?null:e.length<1||t>=e.length?null:this.$refs.category[t]},uniteCurrentAnnotation:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null!=this.currentAnnotation&&this.currentAnnotation.unite(t,e,a,n)},subtractCurrentAnnotation:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null!=this.currentCategory&&this.currentAnnotation.subtract(t,e,a)},selectLastEditorTool:function(){this.activeTool=localStorage.getItem("editorTool")||"Select"},setCursor:function(t){this.cursor=t},incrementCategory:function(){this.current.category>=this.categories.length-1?this.current.category=-1:(this.current.category+=1,this.currentKeypoint&&this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint))},decrementCategory:function(){if(-1===this.current.category){this.current.category=this.categories.length-1;var t=this.currentCategory.category.annotations.length;t>0&&(this.current.annotation=t-1)}else this.current.category-=1},incrementAnnotation:function(){var t=this.currentCategory.category.annotations.length;this.current.annotation===t-1?(this.incrementCategory(),this.current.annotation=-1):(this.current.annotation+=1,null!=this.currentAnnotation&&this.currentAnnotation.showKeypoints?(this.current.keypoint=0,this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint)):this.current.keypoint=-1)},decrementAnnotation:function(){var t=this.currentCategory.category.annotations.length;-1===this.current.annotation?this.current.annotation=t-1:0===this.current.annotation?this.decrementCategory():(this.current.annotation-=1,null!=this.currentAnnotation&&this.currentAnnotation.showKeypoints?(this.current.keypoint=this.currentAnnotation.keypointLabels.length-1,this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint)):this.current.keypoint=-1)},incrementKeypoint:function(){var t=this.currentAnnotation.keypointLabels.length;this.current.keypoint===t-1?this.incrementAnnotation():this.current.keypoint+=1,null!=this.currentKeypoint&&this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint)},decrementKeypoint:function(){0===this.current.keypoint?this.decrementAnnotation():this.current.keypoint-=1,null!=this.currentKeypoint&&this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint)},moveUp:function(){null!=this.currentCategory?null!=this.currentAnnotation?null!=this.currentKeypoint?this.decrementKeypoint():this.currentAnnotation.showKeypoints&&-1==this.current.keypoint?this.decrementKeypoint():this.decrementAnnotation():-1==this.current.annotation?this.decrementAnnotation():this.decrementCategory():this.decrementCategory()},moveDown:function(){null!=this.currentCategory?null!=this.currentAnnotation?null!=this.currentKeypoint?this.incrementKeypoint():this.currentAnnotation.showKeypoints&&-1==this.current.keypoint?this.incrementKeypoint():this.incrementAnnotation():-1==this.current.annotation?this.incrementAnnotation():this.incrementCategory():this.incrementCategory()},stepIn:function(){null!=this.currentCategory&&(this.currentCategory.isVisible?!this.currentCategory.showAnnotations&&this.currentAnnotationLength>0?(this.currentCategory.showAnnotations=!0,this.current.annotation=0,this.currentAnnotation.showKeypoints=!1,this.current.keypoint=-1):!this.currentAnnotation.showKeypoints&&this.currentAnnotation.keypointLabels.length>0&&(this.currentAnnotation.showKeypoints=!0,this.current.keypoint=0,this.currentAnnotation.onAnnotationKeypointClick(this.current.keypoint)):(this.currentCategory.isVisible=!0,this.current.annotation=0,this.currentAnnotation.showKeypoints=!1,this.current.keypoint=-1))},stepOut:function(){null!=this.currentCategory&&(null!=this.currentAnnotation&&this.currentAnnotation.showKeypoints?(this.currentAnnotation.showKeypoints=!1,this.current.keypoint=-1):this.currentCategory.showAnnotations?(this.currentCategory.showAnnotations=!1,this.current.annotation=-1):this.currentCategory.isVisible&&(this.currentCategory.isVisible=!1))},scrollElement:function(t){t.scrollIntoView({behavior:"smooth",block:"center"})},showAll:function(){null!=this.$refs.category&&this.$refs.category.forEach(function(t){t.isVisible=t.category.annotations.length>0})},hideAll:function(){null!=this.$refs.category&&this.$refs.category.forEach(function(t){t.isVisible=!1,t.showAnnotations=!1})},findCategoryByName:function(t){var e=this.$refs.category.find(function(e){return e.category.name.toLowerCase()===t.toLowerCase()});return e?e.category:null},addAnnotation:function(t,e,a){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e=e||[],a=a||[],0!=a.length||0!=e.length){var i=this.findCategoryByName(t);null!=i&&at.create({image_id:this.image.id,category_id:i.id,segmentation:e,keypoints:a,isbbox:n}).then(function(t){var e=t.data;i.annotations.push(e)})}},updateAnnotationCategory:function(t,e,a){var n=this.findCategoryByName(a);n&&t&&at.update(t.id,{category_id:n.id}).then(function(a){var i=Object(s["a"])({},a.data,t,{metadata:a.data.metadata,category_id:n.id});i&&(e.annotations=e.annotations.filter(function(e){return e.id!==t.id}),n.annotations.push(i))})},removeFromAnnotatingList:function(){if(null!=this.user){var t=this.annotating.indexOf(this.user.username);t>-1&&this.annotating.splice(t,1)}},nextImage:function(){null!=this.image.next&&this.$refs.filetitle.route(this.image.next)},previousImage:function(){null!=this.image.previous&&this.$refs.filetitle.route(this.image.previous)}}),watch:{doneLoading:function(t){t&&this.loading.loader&&this.loading.loader.hide()},currentCategory:function(){if(null!=this.currentCategory&&(null==this.currentAnnotation||!this.currentCategory.showAnnotations)){var t=this.currentCategory.$el;this.scrollElement(t)}},currentAnnotation:function(t){if(null!=t&&t.showAnnotations){var e=t.$el;this.scrollElement(e)}},"current.category":function(t){t<-1&&(this.current.category=-1);var e=this.categories.length;t>e&&(this.current.category=-1)},"current.annotation":function(t){if(t<-1&&(this.current.annotation=-1),null!=this.currentCategory){var e=this.currentAnnotationLength;t>e&&(this.current.annotations=-1)}},"current.keypoint":function(t){if(t<-1&&(this.current.keypoint=-1),null!=this.currentCategory){var e=this.currentAnnotationLength;t>e&&(this.current.keypoint=-1)}},annotating:function(){this.removeFromAnnotatingList()},user:function(){this.removeFromAnnotatingList()}},computed:{doneLoading:function(){return!this.loading.image&&!this.loading.data},currentAnnotationLength:function(){return null==this.currentCategory?null:this.currentCategory.category.annotations.length},currentKeypointLength:function(){return null==this.currentAnnotation?null:this.currentAnnotation.annotation.keypoints.length},currentCategory:function(){return this.getCategory(this.current.category)},currentAnnotation:function(){return null==this.currentCategory?null:this.currentCategory.getAnnotation(this.current.annotation)},currentKeypoint:function(){return null==this.currentCategory?null:null!=this.currentAnnotation&&0!==this.currentAnnotation.keypointLabels.length&&this.currentAnnotation.showKeypoints?-1==this.current.keypoint?null:{label:[String(this.current.keypoint+1)],visibility:this.currentAnnotation.getKeypointVisibility(this.current.keypoint)}:null},user:function(){return this.$store.getters["user/user"]}},sockets:{annotating:function(t){if(t.image_id===this.image.id)if(t.active){var e=this.annotating.indexOf(t.username);e<0&&this.annotating.push(t.username)}else this.annotating.splice(this.annotating.indexOf(t.username),1)}},beforeRouteLeave:function(t,e,a){var n=this;this.current.annotation=-1,this.$nextTick(function(){n.$socket.emit("annotating",{image_id:n.image.id,active:!1}),n.save(a)})},mounted:function(){this.setDataset(null),this.initCanvas(),this.getData(),this.$socket.emit("annotating",{image_id:this.image.id,active:!0})},created:function(){this.paper=new F.a.PaperScope,this.image.id=parseInt(this.identifier),this.image.url="/api/image/"+this.image.id}},ji=Ii,Li=(a("4348"),Object(m["a"])(ji,M,U,!1,null,"7092fdb5",null));Li.options.__file="Annotator.vue";var Ni=Li.exports,Bi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[a("h2",{staticClass:"text-center"},[t._v("Users")]),a("p",{staticClass:"text-center"},[t._v("\n        Total of "),a("strong",[t._v(t._s(t.total))]),t._v(" user accounts.\n      ")]),a("div",{staticClass:"row justify-content-md-center"},[a("div",{staticClass:"col-md-auto btn-group",staticStyle:{"padding-bottom":"20px"},attrs:{role:"group"}},[a("button",{staticClass:"btn btn-success",attrs:{type:"button","data-toggle":"modal","data-target":"#createUser"}},[t._v("\n            Create User\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:t.updatePage}},[t._v("\n            Refresh\n          ")])])]),a("div",{staticClass:"row justify-content-md-center",staticStyle:{"padding-bottom":"10px"}},[t._m(0),a("div",{staticClass:"col-md-2"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.limit,expression:"limit"}],staticClass:"form-control form-control-sm text-inline",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.limit=e.target.multiple?a:a[0]}}},[a("option",[t._v("50")]),a("option",[t._v("100")]),a("option",[t._v("500")]),a("option",[t._v("1000")])])])]),a("div",[a("table",{staticClass:"table table-hover table-sm"},[a("thead",{staticClass:"remove-top-border"},[a("tr",[a("th",{attrs:{scope:"col"}},[t._v("Username")]),a("th",{attrs:{scope:"col"}},[t._v("Name")]),a("th",{attrs:{scope:"col"}},[t._v("Admin")]),a("th",{staticClass:"text-center",attrs:{scope:"col"},on:{click:function(e){t.deleteUser(t.user)}}},[t._v("\n                Delete\n              ")])])]),a("tbody",t._l(t.users,function(e,n){return a("tr",{key:n},[a("td",[t._v(t._s(e.username))]),a("td",[t._v(t._s(e.name))]),a("td",[e.is_admin?a("i",{staticClass:"fa fa-circle text-center"}):a("i",{staticClass:"fa fa-circle-thin text-center"})]),a("td",[a("i",{staticClass:"fa fa-remove text-center delete-icon",on:{click:function(a){t.deleteUser(e)}}})])])}))])])])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"createUser"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(1),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group",class:{"was-validated":0!==t.create.username.length}},[a("label",[t._v("Username")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.create.username,expression:"create.username"}],staticClass:"form-control",attrs:{placeholder:"Username",required:""},domProps:{value:t.create.username},on:{input:function(e){e.target.composing||t.$set(t.create,"username",e.target.value)}}})]),a("div",{staticClass:"form-group",class:{"was-validated":0!==t.create.password.length}},[a("label",[t._v("Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.create.password,expression:"create.password"}],staticClass:"form-control",attrs:{placeholder:"Password",required:""},domProps:{value:t.create.password},on:{input:function(e){e.target.composing||t.$set(t.create,"password",e.target.value)}}})]),a("div",{staticClass:"form-group",class:{"was-validated":0!==t.create.name.length}},[a("label",[t._v("Name")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.create.name,expression:"create.name"}],staticClass:"form-control",attrs:{placeholder:"Name",required:""},domProps:{value:t.create.name},on:{input:function(e){e.target.composing||t.$set(t.create,"name",e.target.value)}}})]),a("div",{staticClass:"form-check"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.create.isAdmin,expression:"create.isAdmin"}],staticClass:"form-check-input",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.create.isAdmin)?t._i(t.create.isAdmin,null)>-1:t.create.isAdmin},on:{change:function(e){var a=t.create.isAdmin,n=e.target,i=!!n.checked;if(Array.isArray(a)){var o=null,s=t._i(a,o);n.checked?s<0&&t.$set(t.create,"isAdmin",a.concat([o])):s>-1&&t.$set(t.create,"isAdmin",a.slice(0,s).concat(a.slice(s+1)))}else t.$set(t.create,"isAdmin",i)}}}),a("label",{staticClass:"form-check-label"},[t._v("Admin")])])])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"submit"},on:{click:t.createUser}},[t._v("\n            Create User\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])])},Mi=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-2 text-right"},[a("span",[t._v("Limit")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Create a User")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])}],Ui="/api/admin/",Ki={getUsers:function(t){return q.a.get(Ui+"users?limit=".concat(t))},createUser:function(t){return q.a.post(Ui+"user/",Object(s["a"])({},t))},deleteUser:function(t){return q.a.delete(Ui+"user/".concat(t))}},Fi={name:"AdminPanel",mixins:[V["a"]],data:function(){return{users:[],limit:50,total:0,create:{name:"",username:"",isAdmin:!1,password:""}}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{updatePage:function(){var t=this,e="Loading users";this.addProcess(e),Ki.getUsers(this.limit).then(function(e){t.users=e.data.users,t.total=e.data.total}).finally(function(){return t.removeProcess(e)})},createUser:function(t){var e=this;t.preventDefault(),Ki.createUser(this.create).then(this.updatePage).catch(function(t){e.axiosReqestError("Create User",t.response.data.message)})},editUser:function(){},deleteUser:function(t){var e=this,a=confirm("Are you sure you want to delete "+t.username+". This action cannot be undone.");a&&Ki.deleteUser(t.username).then(this.updatePage).catch(function(t){e.axiosReqestError("Create User",t.response.data.message)})}}),watch:{limit:"updatePage"},created:function(){this.updatePage()}},Ri=Fi,qi=(a("806f"),Object(m["a"])(Ri,Bi,Mi,!1,null,"35ec6cfc",null));qi.options.__file="AdminPanel.vue";var Vi=qi.exports,Wi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[t._m(0),a("p",{staticClass:"text-center"},[t._v("\n        Loaded "),a("strong",[t._v(t._s(t.datasets.length))]),t._v(" datasets.\n      ")]),a("div",{staticClass:"row justify-content-md-center"},[a("div",{staticClass:"col-md-auto btn-group",staticStyle:{"padding-bottom":"20px"},attrs:{role:"group"}},[a("button",{staticClass:"btn btn-success",attrs:{type:"button","data-toggle":"modal","data-target":"#createDataset"}},[t._v("\n            Create\n          ")]),a("button",{staticClass:"btn btn-primary",attrs:{type:"button"}},[t._v("Import")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:" button"},on:{click:function(e){t.updatePage(t.page)}}},[t._v("\n            Refresh\n          ")])])]),a("hr"),t.datasets.length<1?a("p",{staticClass:"text-center"},[t._v("\n        You need to create a dataset!\n      ")]):a("div",{staticStyle:{"background-color":"gray"}},[a("Pagination",{attrs:{pages:t.pages},on:{pagechange:t.updatePage}}),a("div",{staticClass:"row bg-light"},t._l(t.datasets,function(e){return a("DatasetCard",{key:e.id,attrs:{dataset:e,categories:t.categories}})}))],1)])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"createDataset"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(1),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group",class:{"was-validated":0!==t.validDatasetName.length}},[a("label",[t._v("Dataset Name")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.create.name,expression:"create.name"}],staticClass:"form-control",attrs:{placeholder:"Dataset name",required:""},domProps:{value:t.create.name},on:{input:function(e){e.target.composing||t.$set(t.create,"name",e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v("\n                "+t._s(t.validDatasetName)+"\n              ")])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Default Categories")]),a("TagsInput",{attrs:{"element-id":"createCategory","existing-tags":t.categoryTags,typeahead:!0,"typeahead-activation-threshold":0},model:{value:t.create.categories,callback:function(e){t.$set(t.create,"categories",e)},expression:"create.categories"}})],1),a("div",{staticClass:"form-group",attrs:{required:""}},[a("label",[t._v("Folder Directory")]),a("input",{staticClass:"form-control",attrs:{disabled:""},domProps:{value:t.directory}})])])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.createDataset}},[t._v("\n            Create Dataset\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),t._m(2)])},zi=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h2",{staticClass:"text-center"},[t._v("\n        Datasets\n        "),a("i",{staticClass:"fa fa-question-circle help-icon",attrs:{"data-toggle":"modal","data-target":"#helpDataset","aria-hidden":"true"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Creating a Dataset")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"helpDataset"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Datasets")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])]),a("div",{staticClass:"modal-body"},[t._v("\n          More information can be found in the\n          "),a("a",{attrs:{href:"/help"}},[t._v("help section")]),t._v(".\n          "),a("hr"),a("h6",[t._v("What is a dataset?")]),t._v("\n          A dataset is a collection of images. It provides default category\n          options for all subsequent images. Each dataset has its own folder\n          in the /datasets directory.\n          "),a("hr"),a("h6",[t._v("How do I create one?")]),t._v('\n          Click on the "Create" button found on this webpage. A dataset name\n          must be provided.\n          '),a("hr"),a("h6",[t._v("How do I add images?")]),t._v("\n          Once you have created a dataset you can add images by placing them\n          in the create folder (while the server is running).\n        ")]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])}],Hi=a("1539"),Yi=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-3"},[a("div",{staticClass:"card mb-4 box-shadow"},[a("img",{staticClass:"card-img-top",staticStyle:{width:"100%",display:"block"},attrs:{src:t.imageUrl},on:{click:t.onImageClick,error:function(e){t.imageError=!0}}}),a("div",{staticClass:"card-body"},[a("span",{staticClass:"d-inline-block text-truncate",staticStyle:{"max-width":"85%",float:"left"}},[a("strong",{staticClass:"card-title"},[t._v(t._s(t.dataset.name))])]),a("i",{staticClass:"card-text fa fa-ellipsis-v fa-x icon-more",attrs:{id:"dropdownDataset"+t.dataset.id,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-hidden":"true"}}),a("br"),a("div",[t.dataset.numberImages>0?a("div",[t._v("\n          "+t._s(t.dataset.numberAnnotated)+" of "+t._s(t.dataset.numberImages)+" images\n          annotated.\n          "),a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar",style:{width:t.percent+"%"},attrs:{role:"progressbar"}})])]):a("p",[t._v("No images in dataset.")]),t._l(t.listCategories,function(e,n){return a("span",{key:n,staticClass:"badge badge-pill badge-primary category-badge",style:{"background-color":e.color}},[t._v("\n          "+t._s(e.name)+"\n        ")])})],2),a("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownDataset"+t.dataset.id}},[a("button",{staticClass:"dropdown-item",attrs:{"data-toggle":"modal","data-target":"#datasetEdit"+t.dataset.id}},[t._v("\n          Edit\n        ")]),t.dataset.permissions.owner?a("button",{staticClass:"dropdown-item",attrs:{"data-toggle":"modal","data-target":"#datasetShare"+t.dataset.id}},[t._v("\n          Share\n        ")]):t._e(),a("button",{directives:[{name:"show",rawName:"v-show",value:t.dataset.permissions.download,expression:"dataset.permissions.download"}],staticClass:"dropdown-item",on:{click:t.onCocoDownloadClick}},[t._v("\n          Download COCO\n        ")]),a("hr",{directives:[{name:"show",rawName:"v-show",value:t.dataset.permissions.delete,expression:"dataset.permissions.delete"}]}),a("button",{directives:[{name:"show",rawName:"v-show",value:t.dataset.permissions.delete,expression:"dataset.permissions.delete"}],staticClass:"dropdown-item delete",on:{click:t.onDeleteClick}},[t._v("\n          Delete\n        ")])])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.$store.getters["user/loginEnabled"],expression:"$store.getters['user/loginEnabled']"}],staticClass:"card-footer text-muted"},[t._v("\n      Created by "+t._s(t.dataset.owner)+"\n    ")])]),a("div",{staticClass:"modal fade",attrs:{role:"dialog",id:"datasetEdit"+t.dataset.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v(t._s(t.dataset.name))]),t._m(0)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Default Categories")]),a("TagsInput",{attrs:{"element-id":"changeDataset","existing-tags":t.categoryTags,typeahead:!0,"typeahead-activation-threshold":0},model:{value:t.selectedCategories,callback:function(e){t.selectedCategories=e},expression:"selectedCategories"}})],1),a("Metadata",{ref:"defaultAnnotation",attrs:{metadata:t.defaultMetadata,title:"Default Annotation Metadata","key-name":"Default Key","value-name":"Default Value"}})],1)]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-success",attrs:{type:"button","data-dismiss":"modal"},on:{click:t.onSave}},[t._v("\n            Save\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),a("div",{staticClass:"modal fade",attrs:{role:"dialog",id:"datasetShare"+t.dataset.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v(t._s(t.dataset.name))]),t._m(1)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Users shared with")]),a("TagsInput",{attrs:{"element-id":"usersList","existing-tags":t.users,typeahead:!0,"typeahead-activation-threshold":0,placeholder:"Add usernames"},model:{value:t.sharedUsers,callback:function(e){t.sharedUsers=e},expression:"sharedUsers"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-success",attrs:{type:"button","data-dismiss":"modal"},on:{click:t.onShare}},[t._v("\n            Save\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])])},Gi=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],Xi={name:"DatasetCard",components:{Metadata:At,TagsInput:Ct["a"]},props:{dataset:{type:Object,required:!0},categories:{type:Array,required:!0}},data:function(){return{imageError:!1,selectedCategories:[],defaultMetadata:this.dataset.default_annotation_metadata,noImageUrl:a("bd21"),notFoundImageUrl:a("22e5"),sharedUsers:[]}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{onImageClick:function(){var t=this.dataset.id;this.$router.push({name:"dataset",params:{identifier:t}})},onShare:function(){var t=this;this.dataset.users=this.sharedUsers,q.a.post("/api/dataset/"+this.dataset.id+"/share",{users:this.sharedUsers}).then(function(){t.$parent.updatePage()})},onCocoDownloadClick:function(){var t=this,e="Generating COCO for "+this.dataset.name;this.addProcess(e),q.a.get("/api/dataset/"+this.dataset.id+"/coco").then(function(e){var a="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e.data));t.downloadURI(a,t.dataset.name+".json")}).finally(function(){return t.removeProcess(e)})},onDeleteClick:function(){var t=this;q.a.delete("/api/dataset/"+this.dataset.id).then(function(){t.$parent.updatePage()})},onSave:function(){var t=this;this.dataset.categories=this.selectedCategories,q.a.post("/api/dataset/"+this.dataset.id,{categories:this.selectedCategories,default_annotation_metadata:this.$refs.defaultAnnotation.export()}).then(function(){t.$parent.updatePage()})},downloadURI:function(t,e){var a=document.createElement("a");a.href=t,a.download=e,document.body.appendChild(a),a.click(),a.remove()},createSelectedCategories:function(){var t=Array.from([]);this.listCategories.forEach(function(e){t.push(e.name)}),this.selectedCategories=t},createSelectedUsers:function(){this.sharedUsers=this.dataset.users}}),computed:{percent:function(){return this.dataset.numberAnnotated/this.dataset.numberImages*100},imageUrl:function(){return this.imageError?this.notFoundImageUrl:this.dataset.numberImages>0?"/api/image/"+this.dataset.first_image_id+"?width=250":this.noImageUrl},listCategories:function(){var t=this,e=[];return this.dataset.hasOwnProperty("categories")?0===this.dataset.categories.length?[]:(this.dataset.categories.forEach(function(a){var n=t.categories.filter(function(t){return t.id===a});1===n.length&&e.push(n[0])}),e):[]},categoryTags:function(){var t={};return this.categories.forEach(function(e){t[e.name]=e.name}),t},users:function(){var t={};return this.$parent.users.forEach(function(e){t[e.username]=e.username}),t}},mounted:function(){this.createSelectedCategories(),this.createSelectedUsers()}},Ji=Xi,Qi=(a("3803"),Object(m["a"])(Ji,Yi,Gi,!1,null,"781727d0",null));Qi.options.__file="DatasetCard.vue";var Zi=Qi.exports,to=a("1799"),eo={name:"Datasets",components:{DatasetCard:Zi,Pagination:to["a"],TagsInput:Ct["a"]},mixins:[V["a"]],data:function(){return{pages:1,limit:52,page:1,create:{name:"",categories:[]},datasets:[],subdirectories:[],categories:[],users:[]}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{updatePage:function(t){var e=this,a="Loading datasets";this.addProcess(a),t=t||this.page,this.page=t,Hi["a"].allData({limit:this.limit,page:t}).then(function(t){e.datasets=t.data.datasets,e.categories=t.data.categories,e.subdirectories=t.data.subdirectories,e.pages=t.data.pagination.pages,e.page=t.data.pagination.page,Ki.getUsers(e.limit).then(function(t){e.users=t.data.users}).finally(function(){return e.removeProcess(a)})})},createDataset:function(){var t=this;if(!(this.create.name.length<1)){var e=[];for(var a in this.create.categories)e.push(this.create.categories[a]);Hi["a"].create(this.create.name,e).then(function(){t.create.name="",t.create.categories=[],t.updatePage()}).catch(function(e){t.axiosReqestError("Creating Dataset",e.response.data.message)})}}}),watch:{user:function(){this.updatePage()}},computed:{directory:function(){var t=this.create.name.length>0?"/":"";return"/datasets/"+this.create.name+t},categoryTags:function(){var t={};return this.categories.forEach(function(e){t[e.name]=e.name}),t},validDatasetName:function(){return 0===this.create.name.length?"Dataset name is required":""},user:function(){return this.$store.state.user.user}},created:function(){this.updatePage()}},ao=eo,no=(a("8d4b"),Object(m["a"])(ao,Wi,zi,!1,null,"9cdfad9e",null));no.options.__file="Datasets.vue";var io=no.exports,oo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[t._m(0),a("p",{staticClass:"text-center"},[t._v("\n        Loaded "),a("strong",[t._v(t._s(t.categoryCount))]),t._v(" categories.\n      ")]),a("div",{staticClass:"row justify-content-md-center"},[a("div",{staticClass:"col-md-auto btn-group",staticStyle:{"padding-bottom":"20px"},attrs:{role:"group"}},[a("button",{staticClass:"btn btn-success",attrs:{type:"button","data-toggle":"modal","data-target":"#createCategories"}},[t._v("\n            Create\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:t.updatePage}},[t._v("\n            Refresh\n          ")])])]),a("hr"),t.categories.length<1?a("p",{staticClass:"text-center"},[t._v("\n        You need to create a category!\n      ")]):a("div",[a("Pagination",{attrs:{pages:t.pages},on:{pagechange:t.updatePage}}),a("div",{staticClass:"row"},t._l(t.categories,function(t){return a("CategoryCard",{key:t.id,attrs:{category:t}})}))],1)])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"createCategories"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(1),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Name:")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.newCategoryName,expression:"newCategoryName"}],staticClass:"form-control",class:{"is-invalid":0===t.newCategoryName.trim().length},attrs:{required:"true",placeholder:"Name"},domProps:{value:t.newCategoryName},on:{input:function(e){e.target.composing||(t.newCategoryName=e.target.value)}}})]),a("div",{staticClass:"form-group"},[a("label",[t._v("Supercategory:")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.newCategorySupercategory,expression:"newCategorySupercategory"}],staticClass:"form-control",attrs:{placeholder:"Supercategory"},domProps:{value:t.newCategorySupercategory},on:{input:function(e){e.target.composing||(t.newCategorySupercategory=e.target.value)}}})]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-2 col-form-label"},[t._v("Color:")]),a("div",{staticClass:"col-sm-9"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.newCategoryColor,expression:"newCategoryColor"}],staticClass:"form-control",attrs:{type:"color"},domProps:{value:t.newCategoryColor},on:{input:function(e){e.target.composing||(t.newCategoryColor=e.target.value)}}})])]),a("div",{staticClass:"form-group"},[a("KeypointsDefinition",{ref:"keypoints",attrs:{"element-id":"keypoints",placeholder:"Add a keypoint"},model:{value:t.newCategoryKeypoint,callback:function(e){t.newCategoryKeypoint=e},expression:"newCategoryKeypoint"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",class:{disabled:!t.isFormValid},attrs:{type:"button",disabled:!t.isFormValid},on:{click:t.createCategory}},[t._v("\n            Create Category\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),t._m(2)])},so=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h2",{staticClass:"text-center"},[t._v("\n        Categories\n        "),a("i",{staticClass:"fa fa-question-circle help-icon",attrs:{"data-toggle":"modal","data-target":"#helpCategories","aria-hidden":"true"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Creating a Category")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"helpCategories"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Categories")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])]),a("div",{staticClass:"modal-body"},[t._v("\n          More information can be found in the\n          "),a("a",{attrs:{href:"https://github.com/jsbroks/coco-annotator/wiki/Usage#creating-categories"}},[t._v("\n            getting started section\n          ")]),t._v(".\n          "),a("hr"),a("h6",[t._v("What is a category?")]),a("hr"),a("h6",[t._v("How do I create one?")]),t._v('\n          Click on the "Create" button found on this webpage. You must\n          provided a name for the category.\n        ')]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])}],ro="/api/category/",lo={allData:function(t){return q.a.get(ro+"data",{params:Object(s["a"])({},t)})},create:function(t){return q.a.post(ro,Object(s["a"])({},t))}},co=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-3"},[a("div",{staticClass:"card mb-4 box-shadow",on:{click:t.onCardClick}},[a("div",{staticClass:"card-body"},[a("span",{staticClass:"d-inline-block text-truncate",staticStyle:{"max-width":"75%",float:"left"}},[a("i",{staticClass:"fa fa-circle color-icon",style:{color:t.category.color},attrs:{"aria-hidden":"true"}}),a("strong",{staticClass:"card-title"},[t._v(t._s(t.category.name))])]),a("i",{staticClass:"card-text fa fa-ellipsis-v fa-x icon-more",attrs:{id:"dropdownCategory"+t.category.id,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-hidden":"true"}}),a("br"),a("div",[t.category.numberAnnotations>0?a("p",[t._v("\n          "+t._s(t.category.numberAnnotations)+" objects have been made with this\n          category.\n        ")]):a("p",[t._v("No annotations use this category")])]),a("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"dropdownCategory"+t.category.id}},[a("a",{staticClass:"dropdown-item",on:{click:t.onDeleteClick}},[t._v("Delete")]),a("button",{staticClass:"dropdown-item",attrs:{"data-toggle":"modal","data-target":"#categoryEdit"+t.category.id}},[t._v("Edit")])])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.$store.getters["user/loginEnabled"],expression:"$store.getters['user/loginEnabled']"}],staticClass:"card-footer text-muted"},[t._v("Created by "+t._s(t.category.creator))])]),a("div",{ref:"category_settings",staticClass:"modal fade",attrs:{role:"dialog",id:"categoryEdit"+t.category.id}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Category: "+t._s(t.category.name))]),t._m(0)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Name")]),a("input",{staticClass:"form-control",class:{"is-invalid":0===t.name.length},attrs:{type:"text",required:"true"},domProps:{value:t.name},on:{input:function(e){t.name=e.target.value}}})]),a("div",{staticClass:"form-group"},[a("label",[t._v("Supercategory")]),a("input",{staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.category.supercategory},on:{input:function(e){t.supercategory=e.target.value}}})]),a("div",{staticClass:"form-group row"},[a("label",{staticClass:"col-sm-2 col-form-label"},[t._v("Color")]),a("div",{staticClass:"col-sm-9"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.color,expression:"color"}],staticClass:"form-control",attrs:{type:"color"},domProps:{value:t.color},on:{input:function(e){e.target.composing||(t.color=e.target.value)}}})])]),a("div",{staticClass:"form-group"},[a("KeypointsDefinition",{ref:"keypoints",attrs:{"element-id":"keypoints",placeholder:"Add a keypoint"},model:{value:t.keypoint,callback:function(e){t.keypoint=e},expression:"keypoint"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-success",class:{disabled:!t.isFormValid},attrs:{type:"button",disabled:!t.isFormValid,"data-dismiss":"modal"},on:{click:t.onUpdateClick}},[t._v("Update")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("Close")])])])])])])},uo=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],ho=lt.a,po={name:"CategoryCard",mixins:[V["a"]],components:{KeypointsDefinition:Mt},data:function(){return{group:null,supercategory:this.category.supercategory,color:this.category.color,metadata:[],keypoint:{labels:Object(tt["a"])(this.category.keypoint_labels),edges:Object(tt["a"])(this.category.keypoint_edges),colors:Object(tt["a"])(this.category.keypoint_colors)},name:this.category.name,isMounted:!1}},props:{category:{type:Object,required:!0}},computed:{isFormValid:function(){return this.isMounted&&0!==this.name.length&&this.$refs&&this.$refs.keypoints&&this.$refs.keypoints.valid}},created:function(){this.resetCategorySettings()},methods:{resetCategorySettings:function(){this.name=this.category.name,this.supercategory=this.category.supercategory,this.color=this.category.color,this.keypoint={labels:Object(tt["a"])(this.category.keypoint_labels),edges:Object(tt["a"])(this.category.keypoint_edges),colors:Object(tt["a"])(this.category.keypoint_colors)}},onCardClick:function(){},onDownloadClick:function(){},onDeleteClick:function(){var t=this;q.a.delete("/api/category/"+this.category.id).then(function(){t.$parent.updatePage()})},onUpdateClick:function(){var t=this;q.a.put("/api/category/"+this.category.id,{name:this.name,color:this.color,supercategory:this.supercategory,metadata:this.metadata,keypoint_edges:this.keypoint.edges,keypoint_labels:this.keypoint.labels,keypoint_colors:this.keypoint.colors}).then(function(){t.axiosReqestSuccess("Updating Category","Category successfully updated"),t.category.name=t.name,t.category.supercategory=t.supercategory,t.category.color=t.color,t.category.metadata=Object(s["a"])({},t.metadata),t.category.keypoint_edges=Object(tt["a"])(t.keypoint.edges),t.category.keypoint_labels=Object(tt["a"])(t.keypoint.labels),t.category.keypoint_colors=Object(tt["a"])(t.keypoint.colors),t.$parent.updatePage()}).catch(function(e){t.axiosReqestError("Updating Category",e.response.data.message),t.$parent.updatePage()})}},mounted:function(){ho(this.$refs.category_settings).on("hidden.bs.modal",this.resetCategorySettings),this.isMounted=!0}},mo=po,go=(a("e3c8"),Object(m["a"])(mo,co,uo,!1,null,"2c30891c",null));go.options.__file="CategoryCard.vue";var fo=go.exports,vo={name:"Categories",components:{CategoryCard:fo,Pagination:to["a"],KeypointsDefinition:Mt},mixins:[V["a"]],data:function(){return{categoryCount:0,pages:1,page:1,limit:50,range:11,newCategoryName:"",newCategorySupercategory:"",newCategoryColor:null,newCategoryKeypoint:{labels:[],edges:[],colors:[]},categories:[],status:{data:{state:!0,message:"Loading categories"}}}},computed:{isFormValid:function(){return 0!==this.newCategoryName.length&&this.$refs&&this.$refs.keypoints&&this.$refs.keypoints.valid}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{updatePage:function(t){var e=this,a="Loading categories";this.addProcess(a),t=t||this.page,this.page=t,lo.allData({page:t,limit:this.limit}).then(function(t){e.categories=t.data.categories,e.page=t.data.pagination.page,e.pages=t.data.pagination.pages,e.categoryCount=t.data.pagination.total}).finally(function(){return e.removeProcess(a)})},createCategory:function(){var t=this;this.newCategoryName.length<1||lo.create({name:this.newCategoryName,supercategory:this.newCategorySupercategory,color:this.newCategoryColor,keypoint_labels:this.newCategoryKeypoint.labels,keypoint_edges:this.newCategoryKeypoint.edges,keypoint_colors:this.newCategoryKeypoint.colors}).then(function(){t.newCategoryName="",t.newCategorySupercategory="",t.newCategoryColor=null,t.newCategoryKeypoint={},t.updatePage()}).catch(function(e){t.axiosReqestError("Creating Category",e.response.data.message)})},previousPage:function(){this.page-=1,this.page<1&&(this.page=1)},nextPage:function(){this.page+=1,this.page>this.pages&&(this.page=this.pages)}}),created:function(){this.updatePage()}},yo=vo,bo=(a("896d"),Object(m["a"])(yo,oo,so,!1,null,"d3dc830a",null));bo.options.__file="Categories.vue";var Co=bo.exports,_o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[a("h2",{staticClass:"text-center"},[t._v("Undo")]),a("p",{staticClass:"text-center"},[t._v("\n        Total of "),a("strong",[t._v(t._s(t.undos.length))]),t._v(" items can be undone.\n      ")]),a("div",{staticClass:"row justify-content-md-center"},[a("div",{staticClass:"col-md-auto btn-group",staticStyle:{"padding-bottom":"20px"},attrs:{role:"group"}},[a("button",{staticClass:"btn btn-success disabled",attrs:{type:"button"}},[t._v("\n            Undo All\n          ")]),a("button",{staticClass:"btn btn-danger disabled",attrs:{type:"button"}},[t._v("\n            Delete All\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button"},on:{click:t.updatePage}},[t._v("\n            Refresh\n          ")])])]),a("div",{staticClass:"row justify-content-md-center",staticStyle:{"padding-bottom":"10px"}},[t._m(0),a("div",{staticClass:"col-md-2"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.type,expression:"type"}],staticClass:"form-control form-control-sm",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.type=e.target.multiple?a:a[0]}}},[a("option",{attrs:{value:"all"}},[t._v("All")]),a("option",{attrs:{value:"annotation"}},[t._v("Annotations")]),a("option",{attrs:{value:"category"}},[t._v("Categories")]),a("option",{attrs:{value:"dataset"}},[t._v("Datasets")])])]),t._m(1),a("div",{staticClass:"col-md-2"},[a("select",{directives:[{name:"model",rawName:"v-model",value:t.limit,expression:"limit"}],staticClass:"form-control form-control-sm text-inline",on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.limit=e.target.multiple?a:a[0]}}},[a("option",[t._v("50")]),a("option",[t._v("100")]),a("option",[t._v("500")]),a("option",[t._v("1000")])])])]),t.undos.length<1?a("p",{staticClass:"text-center"},[t._v("Nothing to undone!")]):a("div",[a("table",{staticClass:"table table-hover table-sm"},[t._m(2),a("tbody",t._l(t.undos,function(e,n){return a("tr",{key:n},[a("td",[t._v("\n                "+t._s(e.ago.length>0?e.ago:"0 seconds")+" ago\n              ")]),a("td",[t._v(t._s(e.instance))]),a("td",[t._v(t._s(e.id))]),a("td",[t._v(t._s(e.name))]),a("td",[a("i",{staticClass:"fa fa-undo text-center undo-icon",attrs:{"aria-hidden":"true"},on:{click:function(a){t.undoModel(e.id,e.instance)}}})]),a("td",[a("i",{staticClass:"fa fa-remove text-center delete-icon",attrs:{"aria-hidden":"true"},on:{click:function(a){t.deleteModel(e.id,e.instance)}}})])])}))])])])])])},wo=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-2 text-right"},[a("span",[t._v("Instance Type")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"col-md-2 text-right"},[a("span",[t._v("Limit")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("thead",{staticClass:"remove-top-border"},[a("tr",[a("th",{attrs:{scope:"col"}},[t._v("Date")]),a("th",{attrs:{scope:"col"}},[t._v("Instance Type")]),a("th",{attrs:{scope:"col"}},[t._v("ID")]),a("th",{attrs:{scope:"col"}},[t._v("Name")]),a("th",{staticClass:"text-center",attrs:{scope:"col"}},[t._v("Rollback")]),a("th",{staticClass:"text-center",attrs:{scope:"col"}},[t._v("Delete")])])])}],ko="/api/undo/",xo={all:function(t,e){return q.a.get(ko+"list/?limit=".concat(t,"&type=").concat(e))},undo:function(t,e){return q.a.post(ko+"?id=".concat(t,"&instance=").concat(e))},delete:function(t,e){return q.a.delete(ko+"?id=".concat(t,"&instance=").concat(e))}},Po={name:"Undo",data:function(){return{undos:[],limit:50,type:"all"}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{updatePage:function(){var t=this,e="Loading undo for "+this.type+" instance type";this.addProcess(e),xo.all(this.limit,this.type).then(function(e){t.undos=e.data}).finally(function(){return t.removeProcess(e)})},undoModel:function(t,e){xo.undo(t,e).then(this.updatePage)},deleteModel:function(t,e){xo.delete(t,e).then(this.updatePage)}}),watch:{limit:"updatePage",type:"updatePage"},created:function(){this.updatePage()}},Ao=Po,So=(a("de60"),Object(m["a"])(Ao,_o,wo,!1,null,"f029bf24",null));So.options.__file="Undo.vue";var Oo=So.exports,$o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{on:{mousemove:t.mouseMove}},[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"bg-light",style:{"margin-left":t.sidebar.width+"px"}},[a("nav",{staticClass:"nav border-bottom shadow-sm",staticStyle:{"background-color":"#4b5162"}},[a("a",{staticClass:"btn tab",style:{color:"images"==t.tab?"white":"darkgray"},on:{click:function(e){t.tab="images"}}},[a("i",{staticClass:"fa fa-picture-o",attrs:{"aria-hidden":"true"}}),t._v(" Images\n      ")]),a("a",{staticClass:"btn tab",style:{color:"exports"==t.tab?"white":"darkgray"},on:{click:function(e){t.tab="exports"}}},[a("i",{staticClass:"fa fa-share",attrs:{"aria-hidden":"true"}}),t._v(" Exports\n      ")]),a("a",{staticClass:"btn tab",style:{color:"members"==t.tab?"white":"darkgray"},on:{click:function(e){t.tab="members"}}},[a("i",{staticClass:"fa fa-users",attrs:{"aria-hidden":"true"}}),t._v(" Members\n      ")]),a("a",{staticClass:"btn tab",style:{color:"statistics"==t.tab?"white":"darkgray"},on:{click:function(e){t.tab="statistics"}}},[a("i",{staticClass:"fa fa-bar-chart",attrs:{"aria-hidden":"true"}}),t._v(" Statistics\n      ")]),a("a",{staticClass:"btn tab",style:{color:"settings"==t.tab?"white":"darkgray"},on:{click:function(e){t.tab="settings"}}},[a("i",{staticClass:"fa fa-cog",attrs:{"aria-hidden":"true"}}),t._v(" Settings\n      ")])]),a("div",{staticClass:"bg-light text-left",staticStyle:{overflow:"auto",height:"calc(100vh - 100px)",margin:"10px"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:"images"==t.tab,expression:"tab == 'images'"}],staticClass:"container"},[a("ol",{staticClass:"breadcrumb"},[a("li",{staticClass:"breadcrumb-item"}),a("li",{staticClass:"breadcrumb-item active"},[a("button",{staticClass:"btn btn-sm btn-link",on:{click:function(e){t.folders=[]}}},[t._v("\n              "+t._s(t.dataset.name)+"\n            ")])]),t._l(t.folders,function(e,n){return a("li",{key:n,staticClass:"breadcrumb-item"},[a("button",{staticClass:"btn btn-sm btn-link",attrs:{disabled:t.folders[t.folders.length-1]===e},on:{click:function(a){t.removeFolder(e)}}},[t._v("\n              "+t._s(e)+"\n            ")])])})],2),t.images.length<1?a("p",{staticClass:"text-center"},[t._v("\n          No images found in directory.\n        ")]):a("div",[a("Pagination",{attrs:{pages:t.pages},on:{pagechange:t.updatePage}}),a("div",{staticClass:"row"},t._l(t.images,function(t){return a("ImageCard",{key:t.id,attrs:{image:t}})})),a("Pagination",{attrs:{pages:t.pages},on:{pagechange:t.updatePage}})],1)]),a("div",{directives:[{name:"show",rawName:"v-show",value:"exports"==t.tab,expression:"tab == 'exports'"}],staticClass:"container"},[a("div",{staticClass:"card my-3 p-3 shadow-sm mr-2"},[t._m(0),t._l(t.datasetExports,function(e){return a("div",{staticClass:"media text-muted pt-3"},[a("div",{staticClass:"media-body lh-125 border-bottom border-gray"},[t._v("\n                "+t._s(e.id)+". Exported "+t._s(e.ago.length>0?e.ago:"0 seconds")+" ago\n                "),a("div",{staticStyle:{display:"inline"}},t._l(e.tags,function(e){return a("span",{staticClass:"badge badge-secondary",staticStyle:{margin:"1px"}},[t._v("\n                    "+t._s(e)+"\n                  ")])})),a("button",{staticClass:"btn btn-sm btn-success",staticStyle:{float:"right",margin:"2px",padding:"2px"},on:{click:function(a){t.downloadExport(e.id)}}},[t._v("\n                  Download\n                ")])])])})],2)]),a("div",{directives:[{name:"show",rawName:"v-show",value:"members"==t.tab,expression:"tab == 'members'"}],staticClass:"container"},[t._m(1),a("div",{staticClass:"card my-3 p-3 shadow-sm mr-2"},[t._m(2),t._l(t.users,function(e){return a("div",{staticClass:"media text-muted pt-3"},[a("img",{staticClass:"mr-2 rounded",staticStyle:{width:"32px",height:"32px"},attrs:{src:"https://d1nhio0ox7pgb.cloudfront.net/_img/o_collection_png/green_dark_grey/256x256/plain/user.png"}}),a("div",{staticClass:"media-body pb-3 mb-0 small lh-125 border-bottom border-gray"},[a("div",{staticClass:"d-flex justify-content-between align-items-center w-100"},[a("div",{staticClass:"text-gray-dark"},[a("strong",[t._v(t._s(e.name))]),t._v(" @"+t._s(e.username)+"\n                ")]),a("a",{attrs:{href:"#"}},[t._v(t._s(e.group))])]),a("span",{staticClass:"d-block"},[t._v("Last seen: "+t._s(new Date(e.last_seen["$date"]).toISOString().slice(0,19).replace("T"," "))+" UTC")])])])})],2)]),a("div",{directives:[{name:"show",rawName:"v-show",value:"statistics"==t.tab,expression:"tab == 'statistics'"}],staticClass:"container"},[null==t.stats?a("div",[t._v("\n          Crunching numbers...\n        ")]):a("div",[a("div",{staticClass:"row"},[t.stats.total?a("div",{staticClass:"card my-3 p-3 shadow-sm col-3 mr-2"},[t._m(3),t._l(Object.keys(t.stats.total),function(e){return a("div",{staticClass:"row"},[a("strong",{staticClass:"col-8"},[t._v(t._s(e)+":")]),a("span",{staticClass:"col-4"},[t._v(t._s(t.stats.total[e].toFixed(0)))])])})],2):t._e(),t.stats.average?a("div",{staticClass:"card my-3 p-3 shadow-sm col-4 mr-2"},[t._m(4),t._l(Object.keys(t.stats.average),function(e){return a("div",{staticClass:"row"},[a("strong",{staticClass:"col-8"},[t._v(t._s(e)+":")]),a("span",{staticClass:"col-4"},[t._v(t._s(t.stats.average[e].toFixed(0)))])])})],2):t._e(),t.stats.categories?a("div",{staticClass:"card my-3 p-3 shadow-sm col-4 mr-2"},[t._m(5),t._l(Object.keys(t.stats.categories),function(e){return a("div",{staticClass:"row"},[a("strong",{staticClass:"col-8"},[t._v(t._s(e)+":")]),a("span",{staticClass:"col-4"},[t._v(t._s(t.stats.categories[e].toFixed(0)))])])})],2):t._e(),t.stats.images_per_category?a("div",{staticClass:"card my-3 p-3 shadow-sm col-4 mr-2"},[t._m(6),t._l(Object.keys(t.stats.images_per_category),function(e){return a("div",{staticClass:"row"},[a("strong",{staticClass:"col-8"},[t._v(t._s(e)+":")]),a("span",{staticClass:"col-4"},[t._v(t._s(t.stats.images_per_category[e].toFixed(0)))])])})],2):t._e()])])]),a("div",{directives:[{name:"show",rawName:"v-show",value:"settings"==t.tab,expression:"tab == 'settings'"}],staticClass:"container"},[a("div",{staticClass:"card my-3 p-3 shadow-sm mr-2"},[t._m(7),a("button",{staticClass:"btn btn-sm btn-block btn-danger",on:{click:t.resetMetadata}},[t._v("\n            Rest All Metadata\n          ")])])])])]),a("div",{ref:"sidebar",staticClass:"sidebar",style:{width:t.sidebar.width+"px"},attrs:{id:"filter"}},[a("div",{staticStyle:{"padding-top":"10px"}}),a("h3",[t._v(t._s(t.dataset.name))]),a("p",{staticClass:"text-center",staticStyle:{color:"lightgray"}},[t._v("\n      Total of "),a("strong",{staticStyle:{color:"white"}},[t._v(t._s(t.imageCount))]),t._v(" images\n      displayed on "),a("strong",{staticStyle:{color:"white"}},[t._v(t._s(t.pages))]),t._v(" pages.\n    ")]),a("div",{staticClass:"row justify-content-md-center sidebar-section-buttons"},[a("button",{staticClass:"btn btn-success btn-block",attrs:{type:"button","data-toggle":"modal","data-target":"#generateDataset"}},[null!=t.generate.id?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar bg-success",style:{width:t.generate.progress+"%"}},[t._v("\n            Generating\n          ")])]):a("div",[t._v("Generate")])]),a("button",{staticClass:"btn btn-secondary btn-block",attrs:{type:"button"},on:{click:t.createScanTask}},[null!=t.scan.id?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar bg-secondary",style:{width:t.scan.progress+"%"}},[t._v("\n            Scanning\n          ")])]):a("div",[t._v("Scan")])]),a("button",{staticClass:"btn btn-primary btn-block",attrs:{type:"button"},on:{click:t.importModal}},[null!=t.importing.id?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar bg-primary",style:{width:t.importing.progress+"%"}},[t._v("\n            Importing\n          ")])]):a("div",[t._v("Import COCO")])]),a("button",{staticClass:"btn btn-primary btn-block",attrs:{type:"button"},on:{click:t.imageimportModal}},[null!=t.imageimporting.id?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar bg-primary",style:{width:t.imageimporting.progress+"%"}},[t._v("\n            Importing\n          ")])]):a("div",[t._v("Upload Images")])]),a("button",{staticClass:"btn btn-dark btn-block",attrs:{type:"button"},on:{click:t.exportModal}},[null!=t.exporting.id?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar bg-dark",style:{width:t.exporting.progress+"%"}},[t._v("\n            Exporting\n          ")])]):a("div",[t._v("Export COCO")])])]),a("hr"),a("h6",{staticClass:"sidebar-title text-center"},[t._v("Subdirectories")]),a("div",{staticClass:"sidebar-section",staticStyle:{"max-height":"30%",color:"lightgray"}},[t.subdirectories.length>0?a("div",t._l(t.subdirectories,function(e,n){return a("button",{key:n,staticClass:"btn badge badge-pill badge-primary category-badge",staticStyle:{margin:"2px"},on:{click:function(a){t.folders.push(e)}}},[t._v("\n          "+t._s(e)+"\n        ")])})):a("p",{staticStyle:{margin:"0","font-size":"13px",color:"gray"}},[t._v("\n        No subdirectory found.\n      ")])]),a("hr"),a("h6",{staticClass:"sidebar-title text-center"},[t._v("Filtering Options")]),a("div",{staticClass:"sidebar-section",staticStyle:{"max-height":"30%",color:"lightgray"}},[a("PanelString",{attrs:{name:"Contains"},on:{submit:t.updatePage},model:{value:t.query.file_name__icontains,callback:function(e){t.$set(t.query,"file_name__icontains",e)},expression:"query.file_name__icontains"}}),a("PanelToggle",{attrs:{name:"Show Annotated"},model:{value:t.panel.showAnnotated,callback:function(e){t.$set(t.panel,"showAnnotated",e)},expression:"panel.showAnnotated"}}),a("PanelToggle",{attrs:{name:"Show Not Annotated"},model:{value:t.panel.showNotAnnotated,callback:function(e){t.$set(t.panel,"showNotAnnotated",e)},expression:"panel.showNotAnnotated"}}),a("PanelDropdown",{attrs:{name:"Order",values:t.orderTypes},model:{value:t.order,callback:function(e){t.order=e},expression:"order"}})],1),a("div",{staticClass:"sidebar-section",staticStyle:{"max-height":"30%",color:"lightgray"}},[a("div",{staticClass:"form-group"},[a("label",[t._v("Show Annotated Categories ")]),a("TagsInput",{attrs:{"element-id":"selectedCategories",title:"Only shows images annotated with the selected categories for 'Show Annotated' button. Leave empty to show all annotated images.","existing-tags":t.categoryTags,typeahead:!0,"typeahead-activation-threshold":0},model:{value:t.selected.categories,callback:function(e){t.$set(t.selected,"categories",e)},expression:"selected.categories"}})],1)])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"generateDataset"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(8),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Keyword")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],staticClass:"form-control",domProps:{value:t.keyword},on:{input:function(e){e.target.composing||(t.keyword=e.target.value)}}})]),a("div",{staticClass:"form-group"},[a("label",[t._v("Limit")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.generateLimit,expression:"generateLimit"}],staticClass:"form-control",attrs:{type:"number"},domProps:{value:t.generateLimit},on:{input:function(e){e.target.composing||(t.generateLimit=e.target.value)}}})])])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.generateDataset}},[t._v("\n            Generate\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"cocoUpload"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(9),t._m(10),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:t.importCOCO}},[t._v("\n            Upload\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"imageUpload"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[t._m(11),t._m(12),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button","data-dismiss":"modal"},on:{click:t.importImages}},[t._v("\n            Upload\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])]),a("div",{staticClass:"modal fade",attrs:{tabindex:"-1",role:"dialog",id:"exportDataset"}},[a("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[a("div",{staticClass:"modal-content"},[a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Export "+t._s(t.dataset.name))]),t._m(13)]),a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Categories (Empty export all)")]),a("TagsInput",{attrs:{"element-id":"exportCategories","existing-tags":t.categoryTags,typeahead:!0,"typeahead-activation-threshold":0},model:{value:t.exporting.categories,callback:function(e){t.$set(t.exporting,"categories",e)},expression:"exporting.categories"}})],1)])]),a("div",{staticClass:"modal-footer"},[a("button",{staticClass:"btn btn-primary",attrs:{type:"button"},on:{click:t.exportCOCO}},[t._v("\n            Export\n          ")]),a("button",{staticClass:"btn btn-secondary",attrs:{type:"button","data-dismiss":"modal"}},[t._v("\n            Close\n          ")])])])])])])},Eo=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Exports")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card my-3 p-3 shadow-sm mr-2"},[a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Invite Members")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Existing Members")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Total")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Average")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Annotations Per Category")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Annotated Images Per Category")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("h6",{staticClass:"border-bottom border-gray pb-2"},[a("b",[t._v("Metadata")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Generate a Dataset")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Upload COCO Annotaitons")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:"coco"}},[t._v("COCO Annotation file (.json)")]),a("input",{staticClass:"form-control-file",attrs:{type:"file",id:"coco"}})])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-header"},[a("h5",{staticClass:"modal-title"},[t._v("Upload Images")]),a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"modal-body"},[a("form",[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:"images"}},[t._v("Images (.png, .jpg, etc)")]),a("input",{staticClass:"form-control-file",attrs:{type:"file",id:"images",multiple:""}})])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[a("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])}],To=a("6a12"),Do=To["a"],Io=(a("b046"),Object(m["a"])(Do,$o,Eo,!1,null,"da77b442",null));Io.options.__file="Dataset.vue";var jo=Io.exports,Lo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"bg-light"},[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 container",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-sm text-left"},[a("h1",[t._v("COCO Annotator")]),a("hr"),0===t.totalUsers?a("div",[a("h3",[t._v("You have successfully installed COCO Annotator!")]),a("p",[t._v("Use the registeration form to create an admin account")]),t._m(0)]):a("div",[t._m(1)])]),a("div",{staticClass:"col-sm"},[a("ul",{staticClass:"nav nav-tabs",attrs:{role:"tablist"}},[a("li",{directives:[{name:"show",rawName:"v-show",value:0!==t.totalUsers,expression:"totalUsers !== 0"}],staticClass:"nav-item"},[a("a",{staticClass:"nav-link",class:{active:"login"===t.tab},attrs:{id:"home-tab","data-toggle":"tab",href:"#login",role:"tab","aria-controls":"home","aria-selected":"true"},on:{click:function(e){t.tab="login"}}},[t._v("\n              Login\n            ")])]),a("li",{directives:[{name:"show",rawName:"v-show",value:t.showRegistrationForm,expression:"showRegistrationForm"}],staticClass:"nav-item"},[a("a",{ref:"registerTab",staticClass:"nav-link",class:{active:"register"===t.tab},attrs:{id:"contact-tab","data-toggle":"tab",href:"#register",role:"tab","aria-controls":"contact","aria-selected":"false"},on:{click:function(e){t.tab="register"}}},[t._v("\n              Register\n            ")])])]),a("div",{staticClass:"tab-content panel border-bottom border-right border-left text-left"},[a("div",{staticClass:"tab-pane fade show active",attrs:{id:"login",role:"tabpanel","aria-labelledby":"login-tab"}},[a("form",{ref:"loginForm",staticClass:"vld-parent"},[a("div",{staticClass:"form-group"},[a("label",[t._v("Username")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.loginForm.username,expression:"loginForm.username"}],staticClass:"form-control",attrs:{type:"text",required:""},domProps:{value:t.loginForm.username},on:{input:function(e){e.target.composing||t.$set(t.loginForm,"username",e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v("Invalid username format")])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.loginForm.password,expression:"loginForm.password"}],staticClass:"form-control",attrs:{type:"password"},domProps:{value:t.loginForm.password},on:{input:function(e){e.target.composing||t.$set(t.loginForm,"password",e.target.value)}}})]),a("button",{staticClass:"btn btn-primary btn-block",class:{disabled:!t.loginValid},attrs:{type:"submit"},on:{click:function(e){return e.preventDefault(),t.loginUser(e)}}},[t._v("\n                Login\n              ")])])]),a("div",{staticClass:"tab-pane fade",attrs:{id:"register",role:"tabpanel","aria-labelledby":"register-tab"}},[t.showRegistrationForm?a("form",{ref:"registerForm",staticClass:"vld-parent"},[a("div",{staticClass:"form-group",attrs:{novalidate:""}},[t._m(2),a("input",{directives:[{name:"model",rawName:"v-model",value:t.registerForm.name,expression:"registerForm.name"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.registerForm.name},on:{input:function(e){e.target.composing||t.$set(t.registerForm,"name",e.target.value)}}})]),a("div",{staticClass:"form-group"},[a("label",[t._v("Username")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.registerForm.username,expression:"registerForm.username"}],staticClass:"form-control",class:t.inputUsernameClasses(t.registerForm.username),attrs:{type:"text",required:""},domProps:{value:t.registerForm.username},on:{input:function(e){e.target.composing||t.$set(t.registerForm,"username",e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v("Invalid username format")])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.registerForm.password,expression:"registerForm.password"}],staticClass:"form-control",class:t.inputPasswordClasses(t.registerForm.password),attrs:{type:"password",required:""},domProps:{value:t.registerForm.password},on:{input:function(e){e.target.composing||t.$set(t.registerForm,"password",e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v("\n                  Minimum length of 5 characters.\n                ")])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Confirm Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.registerForm.confirmPassword,expression:"registerForm.confirmPassword"}],staticClass:"form-control",class:{"is-valid":t.registerForm.confirmPassword.length>0&&t.registerForm.confirmPassword===t.registerForm.password},attrs:{type:"password"},domProps:{value:t.registerForm.confirmPassword},on:{input:function(e){e.target.composing||t.$set(t.registerForm,"confirmPassword",e.target.value)}}})]),a("button",{staticClass:"btn btn-primary btn-block",class:{disabled:!t.registerValid},attrs:{type:"submit"},on:{click:function(e){return e.preventDefault(),t.registerUser(e)}}},[t._v("\n                Register\n              ")])]):a("div",[t._v("\n              You are not allowed to register new accounts\n            ")])])])])])])])},No=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v("\n            If you have any questions please checkout the\n            "),a("a",{attrs:{href:"https://github.com/jsbroks/coco-annotator/wiki"}},[t._v("wiki")]),t._v("\n            before posting\n            "),a("a",{attrs:{href:"https://github.com/jsbroks/coco-annotator/issues"}},[t._v("issues")]),t._v(".\n          ")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v("\n            COCO Annotator is a web-based image annotation tool designed for\n            versatility and efficiently label images to create training data\n            for image localization and object detection.\n            "),a("br"),a("br"),t._v("\n            Login to create a datasets.\n            "),a("br"),a("br"),t._v("\n            Find out more\n            "),a("a",{attrs:{href:"https://github.com/jsbroks/coco-annotator"}},[t._v("Github")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("label",[t._v("Full Name "),a("span",{staticClass:"text-mute"},[t._v("(Optional)")])])}],Bo={name:"Authentication",mixins:[V["a"]],props:{redirect:{type:Object,default:function(){return{name:"datasets"}}}},data:function(){return{tab:"login",registerForm:{loading:!1,name:"",username:"",password:"",confirmPassword:""},loginForm:{loading:!1,username:"",password:""}}},methods:Object(s["a"])({},Object(d["b"])("user",["register","login"]),Object(d["c"])("info",["increamentUserCount"]),{registerUser:function(){var t=this;if(this.registerValid){var e=this.$loading.show({container:this.$refs.registerForm,color:"#383c4a"}),a={user:this.registerForm,successCallback:function(){e.hide(),t.increamentUserCount(),t.$router.push(t.redirect)},errorCallback:function(e){return t.axiosReqestError("User Registration",e.response.data.message)}};this.register(a)}},loginUser:function(){var t=this;if(this.loginValid){var e=this.$loading.show({container:this.$refs.registerForm,color:"#383c4a"}),a={user:this.loginForm,successCallback:function(){e.hide(),t.$router.push(t.redirect)},errorCallback:function(e){return t.axiosReqestError("User Login",e.response.data.message)}};this.login(a)}},validUsername:function(t){return/^[0-9a-zA-Z_.-]+$/.test(t)},validPassword:function(t){return t.length>5},inputUsernameClasses:function(t){var e=this.validUsername(t);return{"is-invalid":!e&&0!=t.length,"is-valid":e}},inputPasswordClasses:function(t){var e=t.length>4;return{"is-invalid":!e&&0!=t.length,"is-valid":e}}}),computed:{registerValid:function(){return!!this.validUsername(this.registerForm.username)&&(!(this.registerForm.password.length<5)&&this.registerForm.password===this.registerForm.confirmPassword)},loginValid:function(){return!!this.validUsername(this.loginForm.username)&&0!=this.loginForm.password.length},totalUsers:function(){return this.$store.state.info.totalUsers},allowRegistration:function(){return this.$store.state.info.allowRegistration},showRegistrationForm:function(){return 0==this.totalUsers||this.allowRegistration},isAuthenticatePending:function(){return this.$store.state.user.isAuthenticatePending}},watch:{totalUsers:function(t){0===t&&this.$refs.registerTab.click()},isAuthenticatePending:{handler:function(){this.isAuthenticatePending&&this.$router.push({name:"datasets"})},immediate:!0}},mounted:function(){}},Mo=Bo,Uo=(a("ce7e"),Object(m["a"])(Mo,Lo,No,!1,null,"3a3b8550",null));Uo.options.__file="Auth.vue";var Ko=Uo.exports,Fo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[a("h2",{staticClass:"text-center"},[t._v("Hello, "+t._s(t.displayName))]),a("br"),a("div",{staticStyle:{"text-align":"left"}},[a("h4",[t._v("Change Password")]),a("br"),a("form",[a("div",{staticClass:"form-group"},[a("label",[t._v("Current Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.changePassword.password,expression:"changePassword.password"}],staticClass:"form-control",attrs:{type:"password",required:""},domProps:{value:t.changePassword.password},on:{input:function(e){e.target.composing||t.$set(t.changePassword,"password",e.target.value)}}})]),a("div",{staticClass:"form-group"},[a("label",[t._v("New Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.changePassword.new_password,expression:"changePassword.new_password"}],staticClass:"form-control",class:t.inputPasswordClasses(t.changePassword.new_password),attrs:{type:"password",required:""},domProps:{value:t.changePassword.new_password},on:{input:function(e){e.target.composing||t.$set(t.changePassword,"new_password",e.target.value)}}}),a("div",{staticClass:"invalid-feedback"},[t._v("\n              Minimum length of 5 characters.\n            ")])]),a("div",{staticClass:"form-group"},[a("label",[t._v("Confirm Password")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.changePassword.confirm_password,expression:"changePassword.confirm_password"}],staticClass:"form-control",class:{"is-valid":t.changePassword.confirm_password.length>0&&t.changePassword.confirm_password===t.changePassword.new_password},attrs:{type:"password"},domProps:{value:t.changePassword.confirm_password},on:{input:function(e){e.target.composing||t.$set(t.changePassword,"confirm_password",e.target.value)}}})]),a("button",{staticClass:"btn btn-primary btn-block",attrs:{type:"submit"},on:{click:function(e){return e.preventDefault(),t.changeUserPassword(e)}}},[t._v("\n            Submit\n          ")])])])])])])},Ro=[],qo={name:"AdminPanel",mixins:[V["a"]],data:function(){return{changePassword:{password:"",new_password:"",confirm_password:""}}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{changeUserPassword:function(){var t=this;this.validPassword(this.changePassword.new_password)&&0!==this.changePassword.password.length&&q.a.post("/api/user/password",Object(s["a"])({},this.changePassword)).then(function(){t.axiosReqestSuccess("Changing Password","Password has been changed")}).catch(function(e){t.axiosReqestError("Changing Password",e.response.data.message)})},validPassword:function(t){return t.length>5},inputPasswordClasses:function(t){var e=t.length>4;return{"is-invalid":!e&&0!=t.length,"is-valid":e}}}),computed:{user:function(){return this.$store.state.user.user},displayName:function(){return null==this.user?"":0==this.user.name.length?this.user.username:this.user.name}},watch:{limit:"updatePage"},created:function(){}},Vo=qo,Wo=(a("53bf"),Object(m["a"])(Vo,Fo,Ro,!1,null,"09be00b3",null));Wo.options.__file="User.vue";var zo=Wo.exports,Ho=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light shadow-sm",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[a("h2",{staticClass:"text-center"},[t._v("Tasks")]),a("p",{staticClass:"text-center"},[a("b",[t._v(t._s(t.total))]),t._v(" tasks are running")]),a("hr"),t._l(t.groups,function(e){return a("TaskGroup",{key:e,attrs:{name:e,tasks:t.groupping[e]}})})],2)])])},Yo=[],Go=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{margin:"10px"}},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-header text-left",on:{click:function(e){t.showTasks=!t.showTasks}}},[t._v("\n      "+t._s(t.name)+"\n\n      "),a("span",{staticStyle:{float:"right",color:"light-gray"}},[t._v("\n        "+t._s(t.runningTasks.length)+" of "+t._s(t.tasks.length)+" task"),a("span",{directives:[{name:"show",rawName:"v-show",value:1!=t.tasks.length,expression:"tasks.length != 1"}]},[t._v("s")]),t._v(" running\n      ")])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.showTasks,expression:"showTasks"}],staticClass:"card-body"},t._l(t.tasks,function(t,e){return a("Task",{key:e,attrs:{task:t}})}))])])},Xo=[],Jo=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card text-left",style:{"background-color":t.highlight?"lightgreen":"white"},attrs:{id:"task-"+this.task.id}},[a("div",{staticClass:"card-body title",on:{click:function(e){t.showLogs=!t.showLogs}}},[a("span",{staticClass:"text-muted"},[t._v(t._s(t.task.id)+".")]),t._v(" "+t._s(t.task.name)+"\n\n    "),a("div",{staticStyle:{float:"right"}},[a("span",{directives:[{name:"show",rawName:"v-show",value:t.errors>0,expression:"errors > 0"}],staticClass:"badge badge-danger",on:{click:function(e){e.stopPropagation(),t.onlyErrors=!t.onlyErrors}}},[t._v("\n        "+t._s(t.errors)+" error"),a("span",{directives:[{name:"show",rawName:"v-show",value:t.errors>1,expression:"errors > 1"}]},[t._v("s")])]),a("span",{directives:[{name:"show",rawName:"v-show",value:t.warnings>0,expression:"warnings > 0"}],staticClass:"badge badge-warning",on:{click:function(e){e.stopPropagation(),t.onlyWarnings=!t.onlyWarnings}}},[t._v("\n        "+t._s(t.warnings)+" warning"),a("span",{directives:[{name:"show",rawName:"v-show",value:t.warnings>1,expression:"warnings > 1"}]},[t._v("s")])])])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.showLogs,expression:"showLogs"}],staticClass:"card-body"},[a("div",{staticClass:"logs"},t._l(t.displayLogs.slice().reverse(),function(e,n){return a("p",{key:n,staticClass:"log",style:{color:t.textColor(e)}},[t._v(t._s(e))])})),a("button",{directives:[{name:"show",rawName:"v-show",value:t.completed,expression:"completed"}],staticClass:"btn btn-danger btn-block btn-sm delete",on:{click:t.deleteTask}},[t._v("\n      Delete\n    ")])]),a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar",class:{"bg-success":t.completed},style:{width:t.task.progress+"%"}})])])},Qo=[],Zo="/api/tasks/",ts={all:function(){return q.a.get(Zo)},delete:function(t){return q.a.delete(Zo+t)},getLogs:function(t){return q.a.get(Zo+t+"/logs")}},es={name:"Task",props:{task:{type:Object,required:!0}},data:function(){return{logs:["Loading logs"],showLogs:!1,highlight:!1,onlyErrors:!1,onlyWarnings:!1}},sockets:{taskProgress:function(t){t.id===this.task.id&&(this.task.progress=t.progress,this.task.warnings=t.warnings,this.task.errors=t.errors)}},methods:{textColor:function(t){return t.includes("[ERROR]")?"red":t.includes("[WARNING]")?"yellow":"white"},deleteTask:function(){var t=this;ts.delete(this.task.id).finally(function(){t.$parent.$parent.updatePage()})},getLogs:function(){var t=this;ts.getLogs(this.task.id).then(function(e){t.logs=e.data.logs})}},watch:{showLogs:"getLogs",completed:function(){this.showLogs&&this.getLogs()}},computed:{warnings:function(){var t=this.task.warnings;return null==t?0:t},errors:function(){var t=this.task.errors;return null==t?0:t},displayLogs:function(){var t=this.logs;return this.onlyErrors?this.logs.filter(function(t){return t.includes("[ERROR]")}):this.onlyWarnings?this.logs.filter(function(t){return t.includes("[WARNING]")}):t},completed:function(){return this.task.completed||this.task.progress>=100}},mounted:function(){var t=this,e=this.task.show;null!=e&&(this.showLogs=e,e&&setTimeout(function(){t.highlight=!0,t.$el.scrollIntoView({behavior:"smooth"}),setTimeout(function(){return t.highlight=!1},1e3)},200))}},as=es,ns=(a("918f"),Object(m["a"])(as,Jo,Qo,!1,null,"18792073",null));ns.options.__file="Task.vue";var is=ns.exports,os={name:"TaskGroup",components:{Task:is},props:{tasks:{type:Array,required:!0},name:{type:String,required:!0}},data:function(){return{showTasks:!0}},computed:{runningTasks:function(){return this.tasks.filter(function(t){return t.progress<100})}}},ss=os,rs=(a("0dae"),Object(m["a"])(ss,Go,Xo,!1,null,"8d8d504e",null));rs.options.__file="TaskGroup.vue";var ls=rs.exports,cs={name:"Tasks",components:{TaskGroup:ls},mixins:[V["a"]],data:function(){return{total:0,tasks:[]}},methods:Object(s["a"])({},Object(d["c"])(["addProcess","removeProcess"]),{updatePage:function(){var t=this,e="Loading tasks";this.addProcess(e),ts.all().then(function(e){t.tasks=e.data,null!=t.taskToShow&&t.showTask(t.taskToShow)}).finally(function(){return t.removeProcess(e)})},showTask:function(t){if(null!=t){var e=this.tasks.find(function(e){return e.id==t});null!=e&&(e.show=!0)}}}),watch:{taskToShow:"showTask"},computed:{taskToShow:function(){var t=this.$route.query.id;return null==t?null:parseInt(t)},user:function(){return this.$store.state.user.user},groups:function(){return Object.keys(this.groupping)},groupping:function(){var t={};return this.tasks.forEach(function(e){if(e.hasOwnProperty("group")){var a=e.group;t.hasOwnProperty(a)||(t[a]=[]),t[a].push(e)}}),t}},created:function(){this.updatePage()}},us=cs,ds=(a("d530"),Object(m["a"])(us,Ho,Yo,!1,null,"4a95c4f6",null));ds.options.__file="Tasks.vue";var hs=ds.exports,ps=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},ms=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticStyle:{"padding-top":"55px"}}),a("div",{staticClass:"album py-5 bg-light",staticStyle:{overflow:"auto",height:"calc(100vh - 55px)"}},[a("div",{staticClass:"container"},[a("h2",{staticClass:"text-center"},[t._v("Sorry! 404 Error")]),a("p",{staticClass:"text-center"},[t._v("\n        Could not find the page you are looking for.\n      ")])])])])}],gs={name:"PageNotFound"},fs=gs,vs=(a("0129"),Object(m["a"])(fs,ps,ms,!1,null,"62dc4f10",null));vs.options.__file="PageNotFound.vue";var ys=vs.exports;n["a"].use(T["a"]);var bs=new T["a"]({routes:[{path:"/about",name:"about",component:B},{alias:"/",path:"/datasets",name:"datasets",component:io},{path:"/categories",name:"categories",component:Co},{path:"/undo",name:"undo",component:Oo},{path:"/annotate/:identifier",name:"annotate",component:Ni,props:!0},{path:"/dataset/:identifier",name:"dataset",component:jo,props:!0},{path:"/auth",name:"authentication",component:Ko,props:!0},{path:"/user",name:"user",component:zo},{path:"/admin/panel",name:"admin",component:Vi},{path:"/tasks",name:"tasks",component:hs},{path:"*",component:ys}]}),Cs=(a("96cf"),a("1da1")),_s={isAuthenticated:!1,isAuthenticatePending:!0,isLogoutPending:!1,error:null,user:null},ws={isAdmin:function(t){return!!t.user&&t.user.is_admin},loginEnabled:function(t){return!!t.user&&(!t.user.anonymous||t.user.anonymous)},user:function(t){return t.user}},ks={loggingIn:function(t){t.isAuthenticatePending=!0},loggedIn:function(t,e){t.user=e,t.isAuthenticatePending=!1,t.isAuthenticated=!0},error:function(t,e){t.error=e,t.isAuthenticatePending=!1,t.isLogoutPending=!1},loggingOut:function(t){t.isLogoutPending=!0},loggedOut:function(t){t.user=null,t.isAuthenticated=!1,t.isLogoutPending=!1},clearError:function(t){t.error=null},setUserInfo:function(t){t.isAuthenticatePending=!0,q.a.get("/api/user/").then(function(e){t.user=e.data.user,t.isAuthenticated=!0,t.isAuthenticatePending=!1}).catch(function(){t.isAuthenticated=!1,t.isAuthenticatePending=!1})}},xs={register:function(){var t=Object(Cs["a"])(regeneratorRuntime.mark(function t(e,a){var n,i,o,r,l;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.commit,i=e.state,o=a.user,r=a.successCallback,l=a.errorCallback,!i.isAuthenticated){t.next=4;break}return t.abrupt("return",!1);case 4:return n("clearError"),n("loggingIn"),t.abrupt("return",q.a.post("/api/user/register",Object(s["a"])({},o)).then(function(t){return n("loggedIn",t.data.user),null!=r&&r(t),!0}).catch(function(t){return n("error",t),null!=l&&l(t),!1}));case 7:case"end":return t.stop()}},t,this)}));return function(e,a){return t.apply(this,arguments)}}(),login:function(){var t=Object(Cs["a"])(regeneratorRuntime.mark(function t(e,a){var n,i,o,r,l;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.commit,i=e.state,o=a.user,r=a.successCallback,l=a.errorCallback,!i.isAuthenticated){t.next=4;break}return t.abrupt("return",!1);case 4:return n("clearError"),n("loggingIn"),t.abrupt("return",q.a.post("/api/user/login",Object(s["a"])({},o)).then(function(t){return n("loggedIn",t.data.user),null!=r&&r(t),!0}).catch(function(t){return n("error",t),null!=l&&l(t),!1}));case 7:case"end":return t.stop()}},t,this)}));return function(e,a){return t.apply(this,arguments)}}(),logout:function(){var t=Object(Cs["a"])(regeneratorRuntime.mark(function t(e){var a,n;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.commit,n=e.state,n.isAuthenticated){t.next=3;break}return t.abrupt("return",!1);case 3:return a("loggingOut"),a("clearError"),t.abrupt("return",q.a.get("/api/user/logout").then(function(){return a("loggedOut"),!0}).catch(function(t){return a("error",t),!1}));case 6:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},Ps={namespaced:!0,state:_s,getters:ws,actions:xs,mutations:ks},As={loading:!0,success:!0,allowRegistration:!0,loginEnabled:!0,version:"loading",totalUsers:1,name:"COCO Annotator",socket:null},Ss={},Os={socket:function(t,e){t.socket=e},increamentUserCount:function(t){t.totalUsers++},getServerInfo:function(t){t.loading=!0,q.a.get("/api/info/").then(function(e){t.loading=!1,t.success=!0;var a=e.data;t.version=a.git.tag,t.allowRegistration=a.allow_registration,t.loginEnabled=a.login_enabled,t.totalUsers=a.total_users}).catch(function(){t.loading=!1,t.success=!0,t.version="unknown"})}},$s={},Es={namespaced:!0,state:As,getters:Ss,actions:$s,mutations:Os};n["a"].use(d["a"]);var Ts=new d["a"].Store({modules:{user:Ps,info:Es},state:{process:[],undo:[],dataset:""},mutations:{setDataset:function(t,e){t.dataset=e},addProcess:function(t,e){t.process.push(e)},removeProcess:function(t,e){var a=t.process.indexOf(e);a>-1&&t.process.splice(a,1)},resetUndo:function(t){t.undo=[]},addUndo:function(t,e){t.undo.push(e)},undo:function(t){var e=t.undo.pop();null!=e&&e.undo()},removeUndos:function(t,e){t.undo=t.undo.filter(function(t){return t.action!==e})}},actions:{}}),Ds=a("ddf5"),Is=a.n(Ds),js=a("e37d"),Ls=a("9062"),Ns=a.n(Ls),Bs=a("ca95"),Ms=a.n(Bs),Us=a("5132"),Ks=a.n(Us),Fs=a("8dc2");a("4989"),a("ab8b"),a("e1db"),a("e40d");n["a"].config.productionTip=!1,F.a.install(window),window.toastr=a("854a"),n["a"].use(Is.a),n["a"].use(js["a"]),n["a"].use(Ns.a),n["a"].use(Fs["VLazyImagePlugin"]),n["a"].use(new Ks.a({debug:!0,connection:window.location.origin})),n["a"].use(Ms.a,{name:"v-touch"}),new n["a"]({router:bs,store:Ts,render:function(t){return t(E)}}).$mount("#app")},"5e63":function(t,e,a){"use strict";var n=a("10c4"),i=a.n(n);i.a},6269:function(t,e,a){"use strict";var n=a("fd48"),i=a.n(n);i.a},"64a9":function(t,e,a){},6632:function(t,e,a){"use strict";var n=a("52e4"),i=a.n(n);i.a},"6a12":function(t,e,a){"use strict";(function(t){a("7514"),a("ac6a"),a("7f7f");var n=a("be94"),i=(a("c5f6"),a("9e59")),o=a("1539"),s=a("0881"),r=a("307d"),l=a("1799"),c=a("df42"),u=a("4dc3"),d=a("13f8"),h=a("1157"),p=a.n(h),m=a("474e"),g=a("2f62"),f=p.a;e["a"]={name:"Dataset",components:{ImageCard:r["a"],Pagination:l["a"],PanelString:c["a"],PanelToggle:u["a"],PanelDropdown:d["a"],TagsInput:m["a"]},mixins:[i["a"]],props:{identifier:{type:[Number,String],required:!0}},data:function(){return{pages:1,generateLimit:100,limit:52,imageCount:0,categories:[],images:[],folders:[],dataset:{id:0},users:[],subdirectories:[],status:{data:{state:!0,message:"Loading data"}},keyword:"",mouseDown:!1,sidebar:{drag:!1,width:.2*window.innerWidth,canResize:!1},scan:{progress:0,id:null},generate:{progress:0,id:null},importing:{progress:0,id:null},imageimporting:{progress:0,id:null},exporting:{categories:[],progress:0,id:null},selected:{categories:[]},datasetExports:[],tab:"images",order:"file_name",orderTypes:{file_name:"File Name",id:"Id",path:"File Path"},query:Object(n["a"])({file_name__icontains:""},this.$route.query),panel:{showAnnotated:!0,showNotAnnotated:!0},stats:null}},methods:Object(n["a"])({},Object(g["c"])(["addProcess","removeProcess"]),{generateDataset:function(){0!==this.keyword.length&&o["a"].generate(this.dataset.id,{keywords:[this.keyword],limit:this.generateLimit})},updatePage:function(t){var e=this,a="Loading images from dataset";this.addProcess(a),o["a"].getData(this.dataset.id,Object(n["a"])({page:t,limit:this.limit,folder:this.folders.join("/")},this.query,{annotated:this.queryAnnotated,category_ids__in:encodeURI(this.selected.categories),order:this.order})).then(function(t){var a=t.data;e.images=a.images,e.dataset=a.dataset,e.categories=a.categories,e.imageCount=a.total,e.pages=a.pages,e.subdirectories=a.subdirectories}).catch(function(t){e.axiosReqestError("Loading Dataset",t.response.data.message)}).finally(function(){return e.removeProcess(a)})},getUsers:function(){var t=this;o["a"].getUsers(this.dataset.id).then(function(e){t.users=e.data})},downloadExport:function(t){s["a"].download(t,this.dataset.name)},getExports:function(){var t=this;o["a"].getExports(this.dataset.id).then(function(e){t.datasetExports=e.data})},resetMetadata:function(){var t=confirm("You can not undo reseting of all metadata inthis dataset. This includes metadata of imagesand annotations.");t&&o["a"].resetMetadata(this.dataset.id)},getStats:function(){var t=this;o["a"].getStats(this.dataset.id).then(function(e){t.stats=e.data})},createScanTask:function(){var e=this;null==this.scan.id?o["a"].scan(this.dataset.id).then(function(t){var a=t.data.id;e.scan.id=a}).catch(function(t){e.axiosReqestError("Scanning Dataset",t.response.data.message)}).finally(function(){return e.removeProcess(t)}):this.$router.push({path:"/tasks",query:{id:this.scan.id}})},exportModal:function(){null==this.exporting.id?f("#exportDataset").modal("show"):this.$router.push({path:"/tasks",query:{id:this.exporting.id}})},exportCOCO:function(){var e=this;f("#exportDataset").modal("hide"),o["a"].exportingCOCO(this.dataset.id,this.exporting.categories).then(function(t){var a=t.data.id;e.exporting.id=a}).catch(function(t){e.axiosReqestError("Exporting COCO",t.response.data.message)}).finally(function(){return e.removeProcess(t)})},removeFolder:function(t){var e=this.folders.indexOf(t);this.folders.splice(e+1,this.folders.length)},importModal:function(){null==this.importing.id?f("#cocoUpload").modal("show"):this.$router.push({path:"/tasks",query:{id:this.importing.id}})},imageimportModal:function(){if(null!=this.imageimporting.id)return alert("yes"),void this.$router.push({path:"/tasks",query:{id:this.imageimporting.id}});f("#imageUpload").modal("show")},importCOCO:function(){var e=this,a=document.getElementById("coco");o["a"].uploadCoco(this.dataset.id,a.files[0]).then(function(t){var a=t.data.id;e.importing.id=a}).catch(function(t){e.axiosReqestError("Importing COCO",t.response.data.message)}).finally(function(){return e.removeProcess(t)})},importImages:function(){for(var e=this,a=document.getElementById("images"),n=0;n<a.files.length;n++)o["a"].uploadImages(this.dataset.id,a.files[n]).then(function(t){var a=t.data.id;e.imageimporting.id=a}).catch(function(t){e.axiosReqestError("Importing Images",t.response.data.message)}).finally(function(){return e.removeProcess(t)})},mouseMove:function(t){var e=this.$refs.sidebar,a=e.offsetWidth,n=t.x,i=Math.abs(a-n);if(this.sidebar.drag=i<4,this.sidebar.canResize){t.preventDefault();var o=.5*window.innerWidth;this.sidebar.width=Math.min(Math.max(t.x,150),o),localStorage.setItem("dataset/sideWidth",this.sidebar.width)}},startDrag:function(){this.mouseDown=!0,this.sidebar.canResize=this.sidebar.drag},stopDrag:function(){this.mouseDown=!1,this.sidebar.canResize=!1}}),computed:{queryAnnotated:function(){var t=this.panel.showAnnotated,e=this.panel.showNotAnnotated;return t&&e?null:t||e?t:" "},categoryTags:function(){var t={};return this.categories.forEach(function(e){return t[e.id]=e.name}),t}},sockets:{taskProgress:function(t){t.id===this.scan.id&&(this.scan.progress=t.progress),t.id===this.generate.id&&(this.generate.progress=t.progress),t.id===this.importing.id&&(this.importing.progress=t.progress),t.id===this.exporting.id&&(this.exporting.progress=t.progress)},annotating:function(t){var e=this.images.find(function(e){return e.id==t.image_id});if(null!=e)if(t.active){var a=e.annotating.indexOf(t.username);a<0&&e.annotating.push(t.username)}else e.annotating.splice(e.annotating.indexOf(t.username),1)}},watch:{tab:function(t){localStorage.setItem("dataset/tab",t),"members"==t&&this.getUsers(),"statistics"==t&&this.getStats(),"exports"==t&&this.getExports()},order:function(t){localStorage.setItem("dataset/order",t),this.updatePage()},queryAnnotated:function(){this.updatePage()},"selected.categories":function(t){this.updatePage()},folders:function(){this.updatePage()},"sidebar.drag":function(t){var e=this.$refs.sidebar;t?(this.$el.style.cursor="ew-resize",e.style.borderRight="4px solid #383c4a"):(this.$el.style.cursor="default",e.style.borderRight="")},"scan.progress":function(t){var e=this;t>=100&&setTimeout(function(){e.scan.progress=0,e.scan.id=null},1e3)},"importing.progress":function(t){var e=this;t>=100&&setTimeout(function(){e.importing.progress=0,e.importing.id=null},1e3)},"exporting.progress":function(t){var e=this;t>=100&&setTimeout(function(){e.exporting.progress=0,e.exporting.id=null,e.getExports()},1e3)}},beforeRouteUpdate:function(){this.dataset.id=parseInt(this.identifier),this.updatePage()},created:function(){var t=localStorage.getItem("dataset/tab"),e=localStorage.getItem("dataset/order"),a=localStorage.getItem("dataset/sideWidth");null!==a&&(this.sidebar.width=parseInt(a)),null!==t&&(this.tab=t),null!==e&&(this.order=e),this.dataset.id=parseInt(this.identifier),this.updatePage()},mounted:function(){window.addEventListener("mouseup",this.stopDrag),window.addEventListener("mousedown",this.startDrag)},destroyed:function(){window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("mousedown",this.startDrag)}}}).call(this,a("4362"))},"6a7c":function(t,e,a){"use strict";var n=a("96a1"),i=a.n(n);i.a},"6ccd":function(t,e,a){"use strict";var n=a("e828"),i=a.n(n);i.a},"6f05":function(t,e,a){"use strict";var n=a("b961"),i=a.n(n);i.a},"6f41":function(t,e,a){"use strict";var n=a("1f08"),i=a.n(n);i.a},"70b5":function(t,e,a){},"73ae":function(t,e,a){},7511:function(t,e,a){},"7e98":function(t,e,a){"use strict";var n=a("e364"),i=a.n(n);i.a},"7f94":function(t,e,a){},"806f":function(t,e,a){"use strict";var n=a("a4ee"),i=a.n(n);i.a},"84c0":function(t,e,a){},"866d":function(t,e,a){},"896d":function(t,e,a){"use strict";var n=a("a544"),i=a.n(n);i.a},"8d4b":function(t,e,a){"use strict";var n=a("9fe8"),i=a.n(n);i.a},"918f":function(t,e,a){"use strict";var n=a("9e2b"),i=a.n(n);i.a},9193:function(t,e,a){},"96a1":function(t,e,a){},"9e2b":function(t,e,a){},"9e59":function(t,e,a){"use strict";e["a"]={methods:{axiosReqestError:function(t,e){var a={progressBar:!0,positionClass:"toast-bottom-left"};this.$toastr.error(e,t,a)},axiosReqestSuccess:function(t,e){var a={progressBar:!0,positionClass:"toast-bottom-left"};this.$toastr.success(e,t,a)}}}},"9ed2":function(t,e,a){"use strict";var n=a("de48"),i=a.n(n);i.a},"9fe8":function(t,e,a){},a4ee:function(t,e,a){},a544:function(t,e,a){},b046:function(t,e,a){"use strict";var n=a("2fc5"),i=a.n(n);i.a},b11a:function(t,e,a){"use strict";var n=a("0bf9"),i=a.n(n);i.a},b961:function(t,e,a){},bb3a:function(t,e,a){},bd21:function(t,e,a){t.exports=a.p+"img/no-image.a37b37d9.png"},bdb2:function(t,e,a){"use strict";var n=a("9193"),i=a.n(n);i.a},c38a:function(t,e,a){},ce7e:function(t,e,a){"use strict";var n=a("4114"),i=a.n(n);i.a},d530:function(t,e,a){"use strict";var n=a("7f94"),i=a.n(n);i.a},d89f:function(t,e,a){"use strict";var n=a("267d"),i=a.n(n);i.a},d9a3:function(t,e,a){"use strict";var n=a("84c0"),i=a.n(n);i.a},da6d:function(t,e,a){},daca:function(t,e,a){},de48:function(t,e,a){},de60:function(t,e,a){"use strict";var n=a("bb3a"),i=a.n(n);i.a},df42:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"input-group tool-input-group"},[a("div",{staticClass:"input-group-prepend tool-option-pre"},[a("span",{staticClass:"input-group-text tool-option-font"},[t._v(t._s(t.name))])]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.localValue,expression:"localValue"}],staticClass:"form-control tool-option-input",domProps:{value:t.localValue},on:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.$emit("submit")},input:function(e){e.target.composing||(t.localValue=e.target.value)}}})])},i=[],o=(a("cadf"),a("551c"),a("097d"),{name:"PanelInputString",model:{prop:"value",event:"update"},props:{name:{type:String,required:!0},value:{type:String,required:!0}},data:function(){return{localValue:this.value}},watch:{localValue:function(){this.$emit("update",this.localValue)},value:function(t){this.localValue=t}}}),s=o,r=(a("294d"),a("2877")),l=Object(r["a"])(s,n,i,!1,null,"e06800f6",null);l.options.__file="PanelInputString.vue";e["a"]=l.exports},e300:function(t,e,a){"use strict";var n=a("70b5"),i=a.n(n);i.a},e364:function(t,e,a){},e3c8:function(t,e,a){"use strict";var n=a("c38a"),i=a.n(n);i.a},e64b:function(t,e,a){},e828:function(t,e,a){},f367:function(t,e,a){"use strict";var n=a("e64b"),i=a.n(n);i.a},fa5e:function(t,e){t.exports="data:image/gif;base64,R0lGODlhGwHUALMKACF3qi5/r4Ozz8jd6VeYvmKew9vo8N7q8pO91f///////wAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAKACwAAAAAGwHUAAAE/zDJSau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPyKRyyWw6n9CodEqtWq/YrHbL7Xq/4LB4TC6bz+i0es1uu9/wuHxOr9vv+Lx+z+/7/4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6NIDBAAABAPpSwjt9AAI8UgD9fXw+EXs+9oR8FckYD2CRAzSQzgEYMCBDIPoM9gvogwDBdoVMIBh3r57Fv8vBqgXgOOFdQIrWhAQIICAkCYy7itgQkC9lzBHKDQxkl6AnDoN8iQJVITMejRL2KSHs+iHAz3bBThwgqVLpyIOyCxAFavXr2DDih1L1ozVpjDOkl3aDm0LtgDceo0K4CcMunbD4o2xVyxcuSv+rm0JmIXasogTK17MuLHjx28JpzjsWHDNm4/7ltDMmPMIz4otK8X8mHJNyZBTAzGtuirp1idAwxYhezYI0bZJsM7Nu7fv38CDCx9OvLjx48iTK1/OvLnz59CjS59Ovbr169iza9/Ovbv37+DDix9Pvrz58+jTq1/Pvr379/Djy59Pv779+/jz69/Pv7///wAGKOAKgAQWaOCBCJIRAQAh+QQFCgAKACx9AFMAJgARAAAEZjDJSau9OGdTACiGJmpG4HlBOK5Ud3oFKyfvO7P1ea/uG++ig+kUOFwGBA9hsDu4CkYLIoeYCAIBAXAyyHmYgpd2m/QSEkPUlub1oF+BddsdPo2B5dw5cc2uE11eTH9SVIQYSEqDEQAh+QQFCgAKACyMAFQAHAAdAAAEbjDJSau9UoQgsLcCIALdZwYjEJhnurJeOJYwpnF1jhmFWBi6igE1CgCDkl4KUEBKliNnAiqSKlNN54EoChykiYOy8AWbz+j0eUAQEQZgBBThHFAB8GCbSkDeq0F/AEh7UH1BdlR5QXJLdFJsbnkRACH5BAUKAAoALJkAWwAPACMAAARoMMlJ6xQhCEsF+MDGJQEIBCNpoqMHim0Gp3Rt33iuS0bxFYaRoQQKBC0+E6DAUYKaTgAnaWJaDsRP4DA6JAvcnXicGhA+hMEI4URYBlGAmnKOEirxDz5fqTvvFHBRcxRsSm4cZmiEFBEAIfkEBQoACgAsiwBoABwAHQAABGwwyUmrvThXEYLQoCQAJPCFWVACAZqurXuN5SlbnHfvfO//wKDQYiiQCoafQVUKJHvGFaDgk5aqVoAvuqJaBgQSYXA5MEmBgwVhRZSjBXVlkAWQd+EsgVcn8fs8eVZ7O3RZdztsUm4+YGKIOxEAIfkEBQoACgAsfAB0ACYAEQAABGowpUEAIEPqzbvfiCUCyGee0jCOGXoKQSBI1WoRrimMsz3mn8AokPCJgB6hiFiz4ZCcnWim8rWgG5hME1qVPIaCpWDAUm5XjkFpCZSxLvGqAHcZ66g73iQf0fcfB2wAAQeAJgdyBYaHjRwRACH5BAUKAAoALHcAZwAdAB0AAARsMKVBACBD6s27RFYIIF7JDaKYmWaVWgRrvqJc0qHtuW+sn7jVbwNKkYYdCkyIbDqf0Ki0ZChYCgapISAKZKHWVCGKI9OiYdEYeuCGAgfpIVyIT4eCQEBwF4j4Um4WAVOCAIRSfiGAiXqMdxsRACH5BAUKAAoALHcAWgAPACMAAARkMMmZBgGADEoR/gDCVSC4UVeJEZwKti7GpSpLDfHZqeJYpRqfcEgsGn2GAqZgEBoCoEBzpCwVfDGsy1cFXUcH6CdwEB6qhfJxzW6730VBICAgCkB1oRgTGO4BfUJ3H3mCc4VsEQA7"},fbbe:function(t,e,a){"use strict";var n=a("33bc"),i=a.n(n);i.a},fd48:function(t,e,a){}});
  //# sourceMappingURL=app.006aa9ce.js.map