(function(e){function t(t){for(var n,o,s=t[0],c=t[1],l=t[2],d=0,p=[];d1?i[1]:void 0;return Promise.resolve({fileName:o,status:t,data:e.data,headers:r})}if(200!==t&&204!==t){var s=e.data;return z("An unexpected server error occurred.",t,s,r)}return Promise.resolve(null)},e.prototype.thumbnails=function(e,t){var r=this,n=this.baseUrl+"/Images/thumbnails/{id}";if(void 0===e||null===e)throw new Error("The parameter 'id' must be defined.");n=n.replace("{id}",encodeURIComponent(""+e)),n=n.replace(/[?&]$/,"");var a={responseType:"blob",method:"GET",url:n,headers:{Accept:"application/octet-stream"},cancelToken:t};return this.instance.request(a).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processThumbnails(e)}))},e.prototype.processThumbnails=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t||206===t){var a=e.headers?e.headers["content-disposition"]:void 0,i=a?/filename="?([^"]*?)"?(;|$)/g.exec(a):void 0,o=i&&i.length>1?i[1]:void 0;return Promise.resolve({fileName:o,status:t,data:e.data,headers:r})}if(200!==t&&204!==t){var s=e.data;return z("An unexpected server error occurred.",t,s,r)}return Promise.resolve(null)},e.prototype.addError=function(e,t){var r=this,n=this.baseUrl+"/Images?";void 0!==e&&null!==e&&(n+="error="+encodeURIComponent(""+e)+"&"),n=n.replace(/[?&]$/,"");var a={method:"GET",url:n,headers:{},cancelToken:t};return this.instance.request(a).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processAddError(e)}))},e.prototype.processAddError=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data;return Promise.resolve(null)}if(200!==t&&204!==t){a=e.data;return z("An unexpected server error occurred.",t,a,r)}return Promise.resolve(null)},e}()),b=function(){function e(e,t){this.jsonParseReviver=void 0,this.instance=t||v.a.create(),this.baseUrl=e||"https://api.medialibrary.aseaglobal.com"}return e.prototype.getAll=function(e){var t=this,r=this.baseUrl+"/api/Languages/all";r=r.replace(/[?&]$/,"");var n={method:"GET",url:r,headers:{Accept:"application/json"},cancelToken:e};return this.instance.request(n).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return t.processGetAll(e)}))},e.prototype.processGetAll=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data,i=null,o=a;if(Array.isArray(o)){i=[];for(var s=0,c=o;s1?i[1]:void 0;return Promise.resolve({fileName:o,status:t,data:e.data,headers:r})}if(200!==t&&204!==t){var s=e.data;return z("An unexpected server error occurred.",t,s,r)}return Promise.resolve(null)},e.prototype.post=function(e,t,r,n,a,i){var o=this,s=this.baseUrl+"/api/MediaResourceFiles";s=s.replace(/[?&]$/,"");var c=new FormData;if(null!==e&&void 0!==e&&c.append("Id",e.toString()),null===t||void 0===t)throw new Error("The parameter 'mediaResourceId' cannot be null.");c.append("MediaResourceId",t.toString()),null!==r&&void 0!==r&&c.append("MarketId",r.toString()),null!==n&&void 0!==n&&c.append("LanguageId",n.toString()),null!==a&&void 0!==a&&c.append("File",a.data,a.fileName?a.fileName:"File");var l={data:c,method:"POST",url:s,headers:{Accept:"application/json"},cancelToken:i};return this.instance.request(l).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return o.processPost(e)}))},e.prototype.processPost=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data,i=null,o=a;return i=E.fromJS(o),i}if(200!==t&&204!==t){a=e.data;return z("An unexpected server error occurred.",t,a,r)}return Promise.resolve(null)},e.prototype.delete=function(e,t){var r=this,n=this.baseUrl+"/api/MediaResourceFiles";n=n.replace(/[?&]$/,"");var a=JSON.stringify(e),i={data:a,method:"DELETE",url:n,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:t};return this.instance.request(i).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processDelete(e)}))},e.prototype.processDelete=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data,i=null,o=a;return i=E.fromJS(o),i}if(200!==t&&204!==t){a=e.data;return z("An unexpected server error occurred.",t,a,r)}return Promise.resolve(null)},e.prototype.addError=function(e,t){var r=this,n=this.baseUrl+"/api/MediaResourceFiles?";void 0!==e&&null!==e&&(n+="error="+encodeURIComponent(""+e)+"&"),n=n.replace(/[?&]$/,"");var a={method:"GET",url:n,headers:{},cancelToken:t};return this.instance.request(a).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processAddError(e)}))},e.prototype.processAddError=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data;return Promise.resolve(null)}if(200!==t&&204!==t){a=e.data;return z("An unexpected server error occurred.",t,a,r)}return Promise.resolve(null)},e}(),x=function(){function e(e,t){this.jsonParseReviver=void 0,this.instance=t||v.a.create(),this.baseUrl=e||"https://api.medialibrary.aseaglobal.com"}return e.prototype.getAll=function(e,t){var r=this,n=this.baseUrl+"/api/MediaResources/all?";void 0!==e&&null!==e&&(n+="type="+encodeURIComponent(""+e)+"&"),n=n.replace(/[?&]$/,"");var a={method:"GET",url:n,headers:{Accept:"application/json"},cancelToken:t};return this.instance.request(a).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processGetAll(e)}))},e.prototype.processGetAll=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data,i=null,o=a;if(Array.isArray(o)){i=[];for(var s=0,c=o;s1?i[1]:void 0;return Promise.resolve({fileName:o,status:t,data:e.data,headers:r})}if(200!==t&&204!==t){var s=e.data;return z("An unexpected server error occurred.",t,s,r)}return Promise.resolve(null)},e.prototype.addError=function(e,t){var r=this,n=this.baseUrl+"/api/Shares?";void 0!==e&&null!==e&&(n+="error="+encodeURIComponent(""+e)+"&"),n=n.replace(/[?&]$/,"");var a={method:"GET",url:n,headers:{},cancelToken:t};return this.instance.request(a).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return r.processAddError(e)}))},e.prototype.processAddError=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data;return Promise.resolve(null)}if(200!==t&&204!==t){a=e.data;return z("An unexpected server error occurred.",t,a,r)}return Promise.resolve(null)}}(),function(){function e(e,t){this.jsonParseReviver=void 0,this.instance=t||v.a.create(),this.baseUrl=e||"https://api.medialibrary.aseaglobal.com"}return e.prototype.getAll=function(e){var t=this,r=this.baseUrl+"/api/StorageAccounts/all";r=r.replace(/[?&]$/,"");var n={method:"GET",url:r,headers:{Accept:"application/json"},cancelToken:e};return this.instance.request(n).catch((function(e){if(H(e)&&e.response)return e.response;throw e})).then((function(e){return t.processGetAll(e)}))},e.prototype.processGetAll=function(e){var t=e.status,r={};if(e.headers&&"object"===Object(h["a"])(e.headers))for(var n in e.headers)e.headers.hasOwnProperty(n)&&(r[n]=e.headers[n]);if(200===t){var a=e.data,i=null,o=a;if(Array.isArray(o)){i=[];for(var s=0,c=o;s=500))return[3,9];c.label=2;case 2:return c.trys.push([2,8,,9]),this.loading=!0,n=this,[4,this.mediaResourceApi.search(e,void 0,1,50)];case 3:n.items=c.sent(),this.items&&(this.loading=!1),a=0,i=this.items,c.label=4;case 4:return a=0&&this.languages.splice(t,1,e)},t.prototype.languageRemoved=function(e){var t=this.languages.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.languages.splice(t,1)},t.prototype.newLanguage=function(){this.$router.push({path:"/languages/new"})},t.prototype.editLanguage=function(e){this.$router.push({path:"/languages/edit/"+e.id})},t.prototype.removeLanguage=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove the language "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.languagesApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.languageRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),It=Ct,Ot=It,Pt=r("8fea"),_t=Object(re["a"])(Ot,vt,ft,!1,null,null,null),St=_t.exports;ae()(_t,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var Vt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e.item.id?r("span",[e._v("\n Edit Language - "+e._s(this.item.name)+"\n ")]):r("span",[e._v("\n Add Language\n ")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{label:"code"},model:{value:e.item.code,callback:function(t){e.$set(e.item,"code",t)},expression:"item.code"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Ut=[],Et=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new _,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[4,this.api.put(this.item)]:[3,2];case 1:return e=t.sent(),this.emitUpdated(e),[3,4];case 2:return[4,this.api.post(this.item)];case 3:e=t.sent(),this.emitAdded(e),t.label=4;case 4:return this.showMessage(new W(this.item.name+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitAdded=function(e){return e},t.prototype.emitUpdated=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/languages")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemAdded")],t.prototype,"emitAdded",null),c["c"]([Object(p["b"])("itemUpdated")],t.prototype,"emitUpdated",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Dt=Et,Mt=Dt,Ft=Object(re["a"])(Mt,Vt,Ut,!1,null,null,null),Nt=Ft.exports;ae()(Ft,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Bt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"red py-4 title white--text"},[e._v("\n Remove Language\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{disabled:"",label:"code"},model:{value:e.item.code,callback:function(t){e.$set(e.item,"code",t)},expression:"item.code"}}),r("v-alert",{attrs:{value:!0,type:"error"}},[e._v("\n Are you sure you want to remove this item?\n ")])],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"error",dark:""},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Jt=[],$t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new _,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.api.delete(this.item)];case 1:return e=t.sent(),this.showMessage(new W(this.item.name+" has been removed.")),this.emitRemoved(e),this.shown=!1,[2]}}))}))},t.prototype.emitRemoved=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/languages")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemRemoved")],t.prototype,"emitRemoved",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Lt=$t,Gt=Lt,qt=r("0798"),zt=Object(re["a"])(Gt,Bt,Jt,!1,null,null,null),Ht=zt.exports;ae()(zt,{VAlert:qt["a"],VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Xt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-layout",{attrs:{row:""}},[r("v-flex",{attrs:{xs12:""}},[r("v-card",[r("v-toolbar",{attrs:{color:"primary",dark:""}},[r("v-toolbar-title",[e._v("Markets")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.newMarket(t)}}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.markets,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.name))]),r("td",[e._v(e._s(t.item.code))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editMarket(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1),r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeMarket(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),r("router-view",{on:{itemAdded:e.marketAdded,itemUpdated:e.marketUpdated,itemRemoved:e.marketRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},Yt=[],Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.markets=[],t.marketsApi=new A,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.markets.length},t.headers=[{text:"Name",value:"name",align:"left",sortable:!0},{text:"Code",value:"code",align:"left",sortable:!0},{text:"Actions",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=t.sent(),[2]}}))}))},t.prototype.marketAdded=function(e){this.markets.push(e)},t.prototype.marketUpdated=function(e){var t=this.markets.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.markets.splice(t,1,e)},t.prototype.marketRemoved=function(e){var t=this.markets.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.markets.splice(t,1)},t.prototype.newMarket=function(){this.$router.push({path:"/markets/new"})},t.prototype.editMarket=function(e){this.$router.push({path:"/markets/edit/"+e.id})},t.prototype.removeMarket=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.marketsApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.marketRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),Wt=Zt,Qt=Wt,Kt=Object(re["a"])(Qt,Xt,Yt,!1,null,null,null),er=Kt.exports;ae()(Kt,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var tr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e.item.id?r("span",[e._v("\n Edit Market - "+e._s(this.item.name)+"\n ")]):r("span",[e._v("\n Add Market\n ")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{label:"code"},model:{value:e.item.code,callback:function(t){e.$set(e.item,"code",t)},expression:"item.code"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},rr=[],nr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new A,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new S,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[4,this.api.put(this.item)]:[3,2];case 1:return e=t.sent(),this.emitUpdated(e),[3,4];case 2:return[4,this.api.post(this.item)];case 3:e=t.sent(),this.emitAdded(e),t.label=4;case 4:return this.showMessage(new W(this.item.name+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitAdded=function(e){return e},t.prototype.emitUpdated=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/markets")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemAdded")],t.prototype,"emitAdded",null),c["c"]([Object(p["b"])("itemUpdated")],t.prototype,"emitUpdated",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),ar=nr,ir=ar,or=Object(re["a"])(ir,tr,rr,!1,null,null,null),sr=or.exports;ae()(or,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var cr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"red py-4 title white--text"},[e._v("\n Remove Market\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{disabled:"",label:"code"},model:{value:e.item.code,callback:function(t){e.$set(e.item,"code",t)},expression:"item.code"}}),r("v-alert",{attrs:{value:!0,type:"error"}},[e._v("\n Are you sure you want to remove this item?\n ")])],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"error",dark:""},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},lr=[],ur=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new A,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new S,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.api.delete(this.item)];case 1:return e=t.sent(),this.showMessage(new W(this.item.name+" has been removed.")),this.emitRemoved(e),this.shown=!1,[2]}}))}))},t.prototype.emitRemoved=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/markets")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemRemoved")],t.prototype,"emitRemoved",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),dr=ur,pr=dr,hr=Object(re["a"])(pr,cr,lr,!1,null,null,null),mr=hr.exports;ae()(hr,{VAlert:qt["a"],VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var vr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-layout",{attrs:{row:""}},[r("v-flex",{attrs:{xs12:""}},[r("v-card",[r("v-toolbar",{attrs:{color:"primary",dark:""}},[r("v-toolbar-title",[e._v("Tags")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.newTag(t)}}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.tags,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.name))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editTag(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1),r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeTag(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),r("router-view",{on:{itemAdded:e.tagAdded,itemUpdated:e.tagUpdated,itemRemoved:e.tagRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},fr=[],br=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tags=[],t.tagsApi=new C,t.filteredTags=[],t.search="",t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.filteredTags.length},t.headers=[{text:"Name",value:"name",align:"left",sortable:!0},{text:"Actions",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.tagsApi.getAll()];case 1:return e.tags=t.sent(),[2]}}))}))},t.prototype.onSearchChanged=function(e,t){this.searchChanged(e)},t.prototype.searchChanged=function(e){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(t){return this.filteredTags=null!==e?this.tags.filter((function(t){return null!=t.name&&t.name.toLowerCase().includes(e.toLowerCase())})):this.tags,[2]}))}))},t.prototype.tagAdded=function(e){this.tags.push(e),this.searchChanged(this.search)},t.prototype.tagUpdated=function(e){var t=this.tags.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.tags.splice(t,1,e),this.searchChanged(this.search)},t.prototype.tagRemoved=function(e){var t=this.tags.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.tags.splice(t,1),this.searchChanged(this.search)},t.prototype.newTag=function(){this.$router.push({path:"/tags/new"})},t.prototype.editTag=function(e){this.$router.push({path:"/tags/edit/"+e.id})},t.prototype.removeTag=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.tagsApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.tagRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},c["c"]([Object(p["e"])("search")],t.prototype,"onSearchChanged",null),t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),Ar=br,gr=Ar,wr=Object(re["a"])(gr,vr,fr,!1,null,null,null),yr=wr.exports;ae()(wr,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var xr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e.item.id?r("span",[e._v("\n Edit Tag - "+e._s(this.item.name)+"\n ")]):r("span",[e._v("\n Add Tag\n ")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},jr=[],kr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new C,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new G,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[4,this.api.put(this.item)]:[3,2];case 1:return e=t.sent(),this.emitUpdated(e),[3,4];case 2:return[4,this.api.post(this.item)];case 3:e=t.sent(),this.emitAdded(e),t.label=4;case 4:return this.showMessage(new W(this.item.name+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitAdded=function(e){return e},t.prototype.emitUpdated=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/tags")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemAdded")],t.prototype,"emitAdded",null),c["c"]([Object(p["b"])("itemUpdated")],t.prototype,"emitUpdated",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Rr=kr,Tr=Rr,Cr=Object(re["a"])(Tr,xr,jr,!1,null,null,null),Ir=Cr.exports;ae()(Cr,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Or=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"red py-4 title white--text"},[e._v("\n Remove Tag\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-alert",{attrs:{value:!0,type:"error"}},[e._v("\n Are you sure you want to remove this item?\n ")])],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"error",dark:""},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Pr=[],_r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new C,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new G,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.api.delete(this.item)];case 1:return e=t.sent(),this.showMessage(new W(this.item.name+" has been removed.")),this.emitRemoved(e),this.shown=!1,[2]}}))}))},t.prototype.emitRemoved=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/tags")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemRemoved")],t.prototype,"emitRemoved",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Sr=_r,Vr=Sr,Ur=Object(re["a"])(Vr,Or,Pr,!1,null,null,null),Er=Ur.exports;ae()(Ur,{VAlert:qt["a"],VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Dr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-layout",{attrs:{row:""}},[r("v-flex",{attrs:{xs12:""}},[r("v-card",[r("v-toolbar",{attrs:{color:"primary",dark:""}},[r("v-toolbar-title",[e._v("Storage Accounts")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.newStorageAccount(t)}}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.storageAccounts,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.name))]),r("td",[e._v(e._s(t.item.endpointHostName))]),r("td",[e._v(e._s(t.item.purpose))]),r("td",[e._v(e._s(t.item.provider))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editStorageAccount(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1),r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeStorageAccount(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),r("router-view",{on:{itemAdded:e.storageAccountAdded,itemUpdated:e.storageAccountUpdated,itemRemoved:e.storageAccountRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},Mr=[],Fr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.storageAccounts=[],t.storageAccountsApi=new T,t.search="",t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.storageAccounts.length},t.headers=[{text:"Name",value:"name",align:"left",sortable:!0},{text:"Endpoint",value:"endpointHostName",align:"left",sortable:!0},{text:"Purpose",value:"purpose",align:"left",sortable:!0},{text:"Provider",value:"provider",align:"left",sortable:!0},{text:"Actions",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.storageAccountsApi.getAll()];case 1:return e.storageAccounts=t.sent(),[2]}}))}))},t.prototype.storageAccountAdded=function(e){this.storageAccounts.push(e)},t.prototype.storageAccountUpdated=function(e){var t=this.storageAccounts.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.storageAccounts.splice(t,1,e)},t.prototype.storageAccountRemoved=function(e){var t=this.storageAccounts.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.storageAccounts.splice(t,1)},t.prototype.newStorageAccount=function(){this.$router.push({path:"/storage/new"})},t.prototype.editStorageAccount=function(e){this.$router.push({path:"/storage/edit/"+e.id})},t.prototype.removeStorageAccount=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.storageAccountsApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.storageAccountRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),Nr=Fr,Br=Nr,Jr=Object(re["a"])(Br,Dr,Mr,!1,null,null,null),$r=Jr.exports;ae()(Jr,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var Lr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e.item.id?r("span",[e._v("\n Edit Storage Account - "+e._s(this.item.name)+"\n ")]):r("span",[e._v("\n Add Storage Account\n ")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{label:"container name"},model:{value:e.item.containerName,callback:function(t){e.$set(e.item,"containerName",t)},expression:"item.containerName"}}),r("v-text-field",{attrs:{label:"connection string"},model:{value:e.item.connectionString,callback:function(t){e.$set(e.item,"connectionString",t)},expression:"item.connectionString"}}),r("v-text-field",{attrs:{label:"endpoint hostname"},model:{value:e.item.endpointHostName,callback:function(t){e.$set(e.item,"endpointHostName",t)},expression:"item.endpointHostName"}}),r("v-select",{attrs:{items:e.purposes,label:"purpose"},model:{value:e.item.purpose,callback:function(t){e.$set(e.item,"purpose",t)},expression:"item.purpose"}}),r("v-select",{attrs:{items:e.providers,label:"provider"},model:{value:e.item.provider,callback:function(t){e.$set(e.item,"provider",t)},expression:"item.provider"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Gr=[],qr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.purposes=[],t.providers=[],t.shown=!0,t.item=null,t.api=new T,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:for(e in M)this.purposes.push(e);for(e in F)this.providers.push(e);return this.$route.params.id?(t=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return t.item=r.sent(),[3,3];case 2:this.item=new L,r.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[4,this.api.put(this.item)]:[3,2];case 1:return e=t.sent(),this.emitUpdated(e),[3,4];case 2:return[4,this.api.post(this.item)];case 3:e=t.sent(),this.emitAdded(e),t.label=4;case 4:return this.showMessage(new W(this.item.name+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitAdded=function(e){return e},t.prototype.emitUpdated=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/storage")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemAdded")],t.prototype,"emitAdded",null),c["c"]([Object(p["b"])("itemUpdated")],t.prototype,"emitUpdated",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),zr=qr,Hr=zr,Xr=r("b56d"),Yr=Object(re["a"])(Hr,Lr,Gr,!1,null,null,null),Zr=Yr.exports;ae()(Yr,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var Wr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"red py-4 title white--text"},[e._v("\n Remove Storage Account\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"name"},model:{value:e.item.name,callback:function(t){e.$set(e.item,"name",t)},expression:"item.name"}}),r("v-text-field",{attrs:{disabled:"",label:"container name"},model:{value:e.item.containerName,callback:function(t){e.$set(e.item,"containerName",t)},expression:"item.containerName"}}),r("v-text-field",{attrs:{disabled:"",label:"connection string"},model:{value:e.item.connectionString,callback:function(t){e.$set(e.item,"connectionString",t)},expression:"item.connectionString"}}),r("v-text-field",{attrs:{disabled:"",label:"purpose"},model:{value:e.item.purpose,callback:function(t){e.$set(e.item,"purpose",t)},expression:"item.purpose"}}),r("v-text-field",{attrs:{disabled:"",label:"provider"},model:{value:e.item.provider,callback:function(t){e.$set(e.item,"provider",t)},expression:"item.provider"}}),r("v-alert",{attrs:{value:!0,type:"error"}},[e._v("\n Are you sure you want to remove this item?\n ")])],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"error",dark:""},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Qr=[],Kr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.api=new T,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.api.get(this.$route.params.id)]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new L,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){var e=this;null!==this.item&&this.api.delete(this.item).then((function(t){null!==t&&(e.showMessage(new W(e.item.name+" has been removed.")),e.emitRemoved(t),e.shown=!1)})).catch((function(t){e.showMessage(new Q("An error occured: \r\n"+t))}))},t.prototype.emitRemoved=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/storage")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemRemoved")],t.prototype,"emitRemoved",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),en=Kr,tn=en,rn=Object(re["a"])(tn,Wr,Qr,!1,null,null,null),nn=rn.exports;ae()(rn,{VAlert:qt["a"],VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var an=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-content",[n("v-layout",{attrs:{row:""}},[n("v-flex",{attrs:{xs12:""}},[n("v-card",[n("v-toolbar",{attrs:{color:"primary",dark:""}},[n("v-toolbar-title",[e._v(e._s(e.$route.name))]),n("v-spacer"),n("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},on:{"click:append":e.onSearchChanged},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),n("v-spacer"),n("v-btn",{attrs:{icon:"",to:{path:"new"},append:""}},[n("v-icon",[e._v("add")])],1)],1),n("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.mediaResources,"rows-per-page-items":[5,10,25,100,200],pagination:e.pagination,"total-items":e.mediaResourceCount,loading:e.loading},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[n("td",[e.previewFileExtention.BlobId!==t.item.id?n("div",[t.item.thumbnailFileId&&t.item.thumbnailBlobUrl?n("img",{staticClass:"ma-3",attrs:{src:t.item.thumbnailBlobUrl,height:"128",width:"128"},on:{click:function(r){return r.stopPropagation(),e.previewFile(t.item.id)}}}):t.item.thumbnailFileId&&!t.item.thumbnailBlobUrl?n("img",{staticClass:"ma-3",attrs:{src:r("60b6"),height:"64",width:"64"},on:{click:function(r){return r.stopPropagation(),e.previewFile(t.item.id)}}}):n("img",{staticClass:"ma-3",attrs:{src:r("60b6"),height:"64",width:"64"},on:{click:function(r){return r.stopPropagation(),e.addFileDialog(t.item)}}})]):e._e(),"image/jpg"===e.previewFileExtention.BlobType?n("div",[e.previewFileExtention.BlobId===t.item.id?n("viewer",{attrs:{images:[e.previewFileExtention.BlobUrl]}},[e.previewFileExtention.previewLoading?n("v-progress-circular",{attrs:{indeterminate:"",color:"primary"}}):n("figure",{staticClass:"ma-3"},[n("img",{attrs:{src:e.previewFileExtention.BlobUrl,width:"128px",height:"128px"}}),n("figcaption",[e._v("click image to preview")])])],1):e._e()],1):e._e(),"video/mp4"===e.previewFileExtention.BlobType?n("div",[e.previewFileExtention.BlobId===t.item.id?n("div",[e.previewFileExtention.previewLoading?n("v-progress-circular",{attrs:{indeterminate:"",color:"primary"}}):n("video",{staticClass:"ma-3",attrs:{src:e.previewFileExtention.BlobUrl,controls:"",type:e.previewFileExtention.BlobType,width:"128px",height:"128px"}})],1):e._e()]):e._e(),"audio/mp3"===e.previewFileExtention.BlobType?n("div",[e.previewFileExtention.BlobId===t.item.id?n("div",[e.previewFileExtention.previewLoading?n("v-progress-circular",{attrs:{indeterminate:"",color:"primary"}}):n("audio",{staticClass:"ma-3",attrs:{src:e.previewFileExtention.BlobUrl,controls:"",type:e.previewFileExtention.BlobType,width:"128px",height:"128px"}})],1):e._e()]):e._e(),"application/pdf"===e.previewFileExtention.BlobType?n("div",[e.previewFileExtention.BlobId===t.item.id?n("div",[e.previewFileExtention.previewLoading?n("v-progress-circular",{attrs:{indeterminate:"",color:"primary"}}):n("a",{staticClass:"ma-3",attrs:{href:e.previewFileExtention.BlobUrl,target:"_blank"}},[e._v("Open link in new tab")])],1):e._e()]):e._e()]),n("td",[e._v(e._s(t.item.name))]),n("td",[e._v(e._s(t.item.description))]),n("td",[e._v(e._s(t.item.distributorId))]),n("td",[e._v(e._s(t.item.type))]),n("td",{staticClass:"text-xs-center"},[n("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editMediaResource(t.item)}}},[n("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1),n("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeMediaResource(t.item)}}},[n("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),n("router-view",{on:{added:e.resourceAdded,removed:e.resourceRemoved}}),n("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove Resource",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}}),n("v-dialog",{attrs:{persistent:"",width:"500"},model:{value:e.showAddFileDialog,callback:function(t){e.showAddFileDialog=t},expression:"showAddFileDialog"}},[n("v-card",[n("v-card-title",{staticClass:"primary headline white--text",attrs:{"primary-title":""}},[e._v("Add Media Resource File")]),n("v-card-text",[e._v(e._s(this.addFileMessage))]),n("v-divider"),n("v-card-actions",[n("v-spacer"),n("v-btn",{on:{click:function(t){t.stopPropagation(),e.showAddFileDialog=!e.showAddFileDialog}}},[e._v("Close")]),n("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.addFile(e.addItem)}}},[e._v("Confirm")])],1)],1)],1)],1)},on=[],sn=(r("4917"),function(){function e(){this.BlobUrl=void 0,this.BlobType=void 0}return e}()),cn=function(){function e(){this.mediaResourceFileApi=new y,this.previewFileData={BlobId:"",BlobUrl:"",BlobType:"",previewLoading:!1}}return e.prototype.getPreviewFile=function(e){return c["b"](this,void 0,void 0,(function(){var t,r=this;return c["e"](this,(function(n){return t=e,t&&t.id&&(t.name&&(t.name.match(/.mp4/i)||t.name.match(/.avi/i)||t.name.match(/.flv/i)||t.name.match(/.wmv/i)||t.name.match(/.mov/i)||t.name.match(/.wav/i))?this.previewFileData.BlobType="video/mp4":t.name&&(t.name.match(/.jpg/i)||t.name.match(/.png/i)||t.name.match(/.gif/i)||t.name.match(/.jpeg/i))?this.previewFileData.BlobType="image/jpg":t.name&&t.name.match(/.pdf/i)?this.previewFileData.BlobType="application/pdf":t.name&&(t.name.match(/.mp3/i)||t.name.match(/.wav/i)||t.name.match(/.m4a/i))&&(this.previewFileData.BlobType="audio/mp3"),this.mediaResourceFileApi.download(t.id).then((function(e){if(null!==e){var t=new Blob([e.data],{type:r.previewFileData.BlobType});return r.previewFileData.BlobUrl=window.URL.createObjectURL(t),r.previewFileData.previewLoading=!1,r.previewFileData}})).catch((function(e){console.log("error3",e)}))),[2,this.previewFileData]}))}))},e}(),ln=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mediaType=null,t.mediaTypes=[],t.mediaResources=[],t.mediaResourceApi=new x,t.mediaResourceCount=0,t.mediaResourceFileApi=new y,t.fileExtensionHeler=new cn,t.previewFileExtention=new sn,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.lastSearchUpdate=0,t.lastLoadUpdate=0,t.showAddFileDialog=!1,t.addFileMessage="",t.addItem=null,t.loading=!1,t.pagination={sortBy:"name",descending:!1,page:1,rowsPerPage:10},t.headers=[{text:"",value:"",sortable:!1},{text:"Name",value:"name",align:"left",sortable:!1},{text:"Description",value:"description",align:"left",sortable:!1},{text:"Distributor",value:"distributorId",align:"left",sortable:!1},{text:"Type",value:"type",align:"left",sortable:!1},{text:"Actions",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){return this.activeSearch&&this.activeSearch.mediaResources&&this.loadActiveSearch(),[2]}))}))},t.prototype.loadActiveSearch=function(){this.mediaResources=this.activeSearch.mediaResources,this.mediaResourceCount=this.activeSearch.mediaResourceCount,this.mediaType=this.activeSearch.mediaType,this.pagination.totalItems=this.activeSearch.mediaResourceCount,this.pagination.rowsPerPage=this.activeSearch.pageSize,this.pagination.page=this.activeSearch.page,this.search=this.activeSearch.term,this.lastLoadUpdate=(new Date).getTime()},t.prototype.previewFile=function(e){return c["b"](this,void 0,void 0,(function(){var t,r=this;return c["e"](this,(function(n){switch(n.label){case 0:return e?(this.previewFileExtention.BlobId=e,this.previewFileExtention.previewLoading=!0,[4,this.mediaResourceFileApi.getRecentFile(e).then((function(e){null!==e&&null!==e.id&&(r.mediaResourceFile=e)})).catch((function(e){console.log("error",e)}))]):[3,3];case 1:return n.sent(),t=this,[4,this.fileExtensionHeler.getPreviewFile(this.mediaResourceFile)];case 2:t.previewFileExtention=n.sent(),n.label=3;case 3:return[2]}}))}))},t.prototype.addFileDialog=function(e){this.addItem=e,this.addFileMessage="No file was found for "+e.name+". Do you want to add file ?",this.showAddFileDialog=!0},t.prototype.addFile=function(e){this.$router.push({path:"/media/"+e.id+"/files"})},t.prototype.onRouteChanged=function(e,t){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.loadResources()];case 1:return e.sent(),this.previewFileExtention.BlobType="",[2]}}))}))},t.prototype.onPaginationChanged=function(e,t){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.loadResources()];case 1:return e.sent(),[2]}}))}))},t.prototype.onSearchChanged=function(e,t){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return this.lastSearchUpdate=(new Date).getTime(),e=function(e){return new Promise((function(t){return setTimeout(t,e)}))},[4,e(500)];case 1:return r.sent(),t=(new Date).getTime(),t-this.lastSearchUpdate>=500?[4,this.loadResources()]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},Object.defineProperty(t.prototype,"pages",{get:function(){return null==this.pagination.rowsPerPage||null==this.pagination.totalItems?0:Math.ceil(this.pagination.totalItems/this.pagination.rowsPerPage)},enumerable:!0,configurable:!0}),t.prototype.loadResources=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r,n,a,o;return c["e"](this,(function(s){switch(s.label){case 0:return s.trys.push([0,8,,9]),e=(new Date).getTime(),e-this.lastLoadUpdate<=1e3?[2]:(this.loading=!0,"documents"===this.$route.name&&(this.mediaType=i.Document),"images"===this.$route.name&&(this.mediaType=i.Image),"video"===this.$route.name&&(this.mediaType=i.Video),"audio"===this.$route.name&&(this.mediaType=i.Audio),"copy"===this.$route.name&&(this.mediaType=i.Copy),this.mediaType?(t=this,[4,this.mediaResourceApi.count(this.search,this.mediaType,1,10)]):[3,3]);case 1:return t.mediaResourceCount=s.sent(),r=this,[4,this.mediaResourceApi.search(this.search,this.mediaType,this.pagination.page,-1==this.pagination.rowsPerPage?this.mediaResourceCount:this.pagination.rowsPerPage)];case 2:r.mediaResources=s.sent(),this.lastLoadUpdate=(new Date).getTime(),this.updateActiveSearch({mediaResources:this.mediaResources,mediaResourceCount:this.mediaResourceCount,mediaType:this.mediaType,term:this.search,page:this.pagination.page,pageSize:-1==this.pagination.rowsPerPage?this.mediaResourceCount:this.pagination.rowsPerPage}),s.label=3;case 3:this.loading=!1,n=0,a=this.mediaResources,s.label=4;case 4:return n=0&&(this.mediaResources[t]=e)},t.prototype.resourceRemoved=function(e){var t=this.mediaResources.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.mediaResources.splice(t,1)},t.prototype.newMediaResource=function(){this.$router.push({path:"/media/new"})},t.prototype.editMediaResource=function(e){this.$router.push({path:"/media/"+e.id+"/info"})},t.prototype.removeMediaResource=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove the resource "+this.removeItem.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.mediaResourceApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.resourceRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(d["a"])("loadThumbnail",{namespace:"thumbnail"})],t.prototype,"loadThumbnail",void 0),c["c"]([Object(d["a"])("updateActiveSearch",{namespace:"search"})],t.prototype,"updateActiveSearch",void 0),c["c"]([Object(d["b"])("getThumbnail",{namespace:"thumbnail"})],t.prototype,"getThumbnail",void 0),c["c"]([Object(d["b"])("activeSearch",{namespace:"search"})],t.prototype,"activeSearch",void 0),c["c"]([Object(p["e"])("$route")],t.prototype,"onRouteChanged",null),c["c"]([Object(p["e"])("pagination")],t.prototype,"onPaginationChanged",null),c["c"]([Object(p["e"])("search")],t.prototype,"onSearchChanged",null),t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),un=ln,dn=un,pn=r("490a"),hn=Object(re["a"])(dn,an,on,!1,null,null,null),mn=hn.exports;ae()(hn,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardText:se["b"],VCardTitle:xt["a"],VContent:le["a"],VDataTable:Pt["a"],VDialog:jt["a"],VDivider:kt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VProgressCircular:pn["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var vn=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("Add Media Resource")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{"prepend-icon":"storage",label:"Name"},model:{value:e.mediaResource.name,callback:function(t){e.$set(e.mediaResource,"name",t)},expression:"mediaResource.name"}}),r("v-text-field",{attrs:{"prepend-icon":"storage",label:"Description"},model:{value:e.mediaResource.description,callback:function(t){e.$set(e.mediaResource,"description",t)},expression:"mediaResource.description"}}),r("v-text-field",{attrs:{"prepend-icon":"storage",label:"DistributorId"},model:{value:e.mediaResource.distributorId,callback:function(t){e.$set(e.mediaResource,"distributorId",t)},expression:"mediaResource.distributorId"}}),r("v-select",{attrs:{"prepend-icon":"store",items:e.mediaTypes,label:"Media Type"},model:{value:e.mediaResource.type,callback:function(t){e.$set(e.mediaResource,"type",t)},expression:"mediaResource.type"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1)],1)},fn=[],bn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.mediaTypes=[],t.mediaResource=new D,t.mediaResourcesApi=new x,t}return c["d"](t,e),t.prototype.mounted=function(){for(var e in i)this.mediaTypes.push(e)},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return[4,this.mediaResourcesApi.post(this.mediaResource)];case 1:return e=t.sent(),this.emitAdded(e),this.showMessage(new W("MediaResource "+this.mediaResource.name+" has been saved.")),[2]}}))}))},t.prototype.onShownChanged=function(){this.$router.go(-1)},t.prototype.emitAdded=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitAdded",null),t=c["c"]([p["a"]],t),t}(n["a"]),An=bn,gn=An,wn=Object(re["a"])(gn,vn,fn,!1,null,null,null),yn=wn.exports;ae()(wn,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var xn=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v("Info")])],1),r("v-card-text",{staticClass:"pa-4"},[r("v-text-field",{attrs:{"pa-2":"",label:"Name"},model:{value:e.mediaResource.name,callback:function(t){e.$set(e.mediaResource,"name",t)},expression:"mediaResource.name"}}),r("v-textarea",{attrs:{"pa-2":"",rows:"2",label:"Description"},model:{value:e.mediaResource.description,callback:function(t){e.$set(e.mediaResource,"description",t)},expression:"mediaResource.description"}}),r("v-text-field",{attrs:{"pa-2":"",label:"Distributor"},model:{value:e.mediaResource.distributorId,callback:function(t){e.$set(e.mediaResource,"distributorId",t)},expression:"mediaResource.distributorId"}}),r("v-select",{attrs:{multiple:"",items:e.tags,"item-text":"name","item-value":"id",label:"Tags"},model:{value:e.mediaResource.tagIds,callback:function(t){e.$set(e.mediaResource,"tagIds",t)},expression:"mediaResource.tagIds"}}),r("v-switch",{attrs:{label:"Sync with Jixiti"},model:{value:e.mediaResource.enableJixitiIntegration,callback:function(t){e.$set(e.mediaResource,"enableJixitiIntegration",t)},expression:"mediaResource.enableJixitiIntegration"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){return t.stopPropagation(),e.reset(t)}}},[e._v("Reset")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1)},jn=[],kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tags=[],t.tagsApi=new C,t.mediaResource=new D,t.mediaResourceOriginal=new D,t.mediaResourcesApi=new x,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e=this;return c["e"](this,(function(t){switch(t.label){case 0:return[4,this.loadItem()];case 1:return t.sent(),this.tagsApi.getAll().then((function(t){null!==t&&(e.tags=t)})).catch((function(e){console.log(e)})),[2]}}))}))},t.prototype.onItemChanged=function(e,t){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(t){switch(t.label){case 0:return e?[4,this.loadItem()]:[2];case 1:return t.sent(),[2]}}))}))},t.prototype.loadItem=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=this,[4,this.mediaResourcesApi.get(this.$route.params.id)];case 1:return e.mediaResource=t.sent(),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.mediaResourcesApi.put(this.mediaResource)];case 1:return e.sent(),this.showMessage(new W("MediaResource "+this.mediaResource.name+" has been saved.")),[2]}}))}))},t.prototype.reset=function(){this.mediaResource=D.fromJS(c["a"]({},this.mediaResourceOriginal))},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("$route.params.id")],t.prototype,"onItemChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Rn=kn,Tn=Rn,Cn=r("b73d"),In=r("a844"),On=Object(re["a"])(Tn,xn,jn,!1,null,null,null),Pn=On.exports;ae()(On,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardText:se["b"],VSelect:Xr["a"],VSpacer:he["a"],VSwitch:Cn["a"],VTextField:me["a"],VTextarea:In["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var _n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"error white--text py-4 title"},[e._v("Remove MediaResource - "+e._s(this.mediaResource.name))]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{"prepend-icon":"storage",disabled:"",label:"Name"},model:{value:e.mediaResource.name,callback:function(t){e.$set(e.mediaResource,"name",t)},expression:"mediaResource.name"}}),r("v-text-field",{attrs:{"prepend-icon":"cloud_circle",disabled:"",label:"Description"},model:{value:e.mediaResource.description,callback:function(t){e.$set(e.mediaResource,"description",t)},expression:"mediaResource.description"}}),r("v-text-field",{attrs:{"prepend-icon":"info",disabled:"",label:"DistributorId"},model:{value:e.mediaResource.distributorId,callback:function(t){e.$set(e.mediaResource,"distributorId",t)},expression:"mediaResource.distributorId"}}),r("v-text-field",{attrs:{"prepend-icon":"store",disabled:"",label:"Media Type"},model:{value:e.mediaResource.type,callback:function(t){e.$set(e.mediaResource,"type",t)},expression:"mediaResource.type"}}),r("div",{staticClass:"text-xs-center"},[r("v-icon",{attrs:{color:"orange"}},[e._v("warning")]),r("div",{staticClass:"ml-3"},[e._v("\n Are you sure you want to remove this media resource?\n ")])],1)],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"error"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Remove")])],1)],1)],1)],1)},Sn=[],Vn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.mediaResource=new D,t.mediaResourcesApi=new x,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.mediaResourcesApi.get(this.$route.params.id)];case 1:return e.mediaResource=t.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return[4,this.mediaResourcesApi.delete(this.mediaResource)];case 1:return e=t.sent(),this.emitRemoveMediaResource(e),this.showMessage(new W("MediaResource "+this.mediaResource.name+" has been removed.")),[2]}}))}))},t.prototype.reset=function(){this.mediaResource=new D,this.shown=!1},t.prototype.onShownChanged=function(){this.$router.push("/media/"+this.$route.params.type)},t.prototype.emitRemoveMediaResource=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("remove-mediaResource")],t.prototype,"emitRemoveMediaResource",null),t=c["c"]([p["a"]],t),t}(n["a"]),Un=Vn,En=Un,Dn=Object(re["a"])(En,_n,Sn,!1,null,null,null),Mn=Dn.exports;ae()(Dn,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VContent:le["a"],VDialog:jt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Fn=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-flex",{attrs:{"xs-12":""}},[e.item?r("v-card",[r("v-card-title",{staticClass:"primary white--text py-4 title"},[r("v-spacer"),e._v("\n Media Resource: "+e._s(e.item.name)+"\n "),r("v-spacer")],1),r("v-tabs",{attrs:{color:"primary",grow:"",centered:"","slider-color":"green"}},[r("v-tab",{staticClass:"white--text",attrs:{to:{name:"info"},append:""}},[e._v("Info")]),r("v-tab",{staticClass:"white--text",attrs:{to:{name:"file-list"},append:""}},[e._v("Files")]),r("v-tab",{staticClass:"white--text",attrs:{to:{name:"link-list"},append:""}},[e._v("Links")]),r("v-tab",{staticClass:"white--text",attrs:{to:{name:"translation-list"}}},[e._v("Translations")]),r("v-tab",{staticClass:"white--text",attrs:{to:{name:"sharing-list"}}},[e._v("Sharing")])],1),r("router-view")],1):e._e()],1)],1)},Nn=[],Bn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=null,t.resourceApi=new x,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.loadItem()];case 1:return e.sent(),[2]}}))}))},t.prototype.onItemChanged=function(e,t){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(t){switch(t.label){case 0:return e?[4,this.loadItem()]:[2];case 1:return t.sent(),[2]}}))}))},t.prototype.loadItem=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=this,[4,this.resourceApi.get(this.$route.params.id)];case 1:return e.item=t.sent(),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},c["c"]([Object(p["e"])("$route.params.id")],t.prototype,"onItemChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Jn=Bn,$n=Jn,Ln=r("71a3"),Gn=r("fe57"),qn=Object(re["a"])($n,Fn,Nn,!1,null,null,null),zn=qn.exports;ae()(qn,{VCard:oe["a"],VCardTitle:xt["a"],VContent:le["a"],VFlex:ue["a"],VSpacer:he["a"],VTab:Ln["a"],VTabs:Gn["a"]});var Hn=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v("Files")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:"",to:{name:"file-new"},append:""}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.mediaResourceFiles,search:e.search,pagination:e.pagination},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[t.item.thumbnailUri?r("img",{staticClass:"ma-3",attrs:{src:t.item.thumbnailBlobUrl,width:"128px",height:"128px"}}):e._e()]),r("td",[e._v(e._s(t.item.name))]),r("td",[e._v(e._s(e._f("formatSize")(t.item.size)))]),r("td",{staticClass:"text-xs-center"},[e._v(e._s(t.item.version))]),r("td",[e._v(e._s(t.item.createdUtc?e.moment(t.item.createdUtc).local():"n/a"))]),r("td",[e._v(e._s(t.item.createdBy))]),r("td",[e._v(e._s(t.item.updatedUtc?e.moment(t.item.updatedUtc).local():"n/a"))]),r("td",[e._v(e._s(t.item.updatedBy))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"file-edit",params:{fileId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("note_add")])],1)],1),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"sharing-new-file",params:{fileId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("share")])],1)],1),r("td",{staticClass:"text-xs-center"},[e.previewFileExtention.BlobId!==t.item.id?r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.previewFile(t.item)}}},[r("v-icon",{attrs:{color:"success"}},[e._v("slideshow")])],1):e._e(),"image/jpg"===e.previewFileExtention.BlobType?r("div",[e.previewFileExtention.BlobId===t.item.id?r("viewer",{attrs:{images:[e.previewFileExtention.BlobUrl]}},[e.previewFileExtention.previewLoading?r("v-progress-circular",{attrs:{indeterminate:"",color:"green"}}):r("img",{attrs:{src:e.previewFileExtention.BlobUrl,width:"150px",height:"120px"}})],1):e._e()],1):e._e(),"video/mp4"===e.previewFileExtention.BlobType?r("div",[e.previewFileExtention.BlobId===t.item.id?r("div",[e.previewFileExtention.previewLoading?r("v-progress-circular",{attrs:{indeterminate:"",color:"green"}}):r("video",{attrs:{src:e.previewFileExtention.BlobUrl,controls:"",type:e.previewFileExtention.BlobType,width:"200px",height:"120px"}})],1):e._e()]):e._e(),"audio/mp3"===e.previewFileExtention.BlobType?r("div",[e.previewFileExtention.BlobId===t.item.id?r("div",[e.previewFileExtention.previewLoading?r("v-progress-circular",{attrs:{indeterminate:"",color:"green"}}):r("audio",{attrs:{src:e.previewFileExtention.BlobUrl,controls:"",type:e.previewFileExtention.BlobType,width:"200px",height:"120px"}})],1):e._e()]):e._e(),"application/pdf"===e.previewFileExtention.BlobType?r("div",[e.previewFileExtention.BlobId===t.item.id?r("a",{attrs:{href:e.previewFileExtention.BlobUrl,target:"_blank"}},[e._v("Open link in new tab ")]):e._e()]):e._e()],1),r("td",{staticClass:"text-xs-center"},[e.downloading&&e.downloadingId===t.item.id?r("v-progress-circular",{attrs:{indeterminate:"",color:"green"}}):r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.downloadFile(t.item)}}},[r("v-icon",{attrs:{color:"success"}},[e._v("cloud_download")])],1)],1),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeFile(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])}),r("router-view",{on:{added:e.fileAdded,removed:e.fileRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},Xn=[],Yn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mediaResourceFiles=[],t.mediaResourceFileApi=new y,t.imagesApi=new f,t.fileExtensionHeler=new cn,t.previewFileExtention=new sn,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.pdfShown=!1,t.loading=!1,t.downloading=!1,t.downloadingId="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.mediaResourceFiles.length},t.headers=[{text:"",value:""},{text:"Name",value:"name",align:"left",sortable:!0},{text:"Size",value:"name",align:"left",sortable:!0},{text:"Version",value:"version",align:"left",sortable:!0},{text:"created",value:"createdUtc",align:"left",sortable:!0},{text:"created by",value:"createdBy",align:"left",sortable:!0},{text:"updated",value:"updatedUtc",align:"left",sortable:!0},{text:"updated by",value:"updatedBy",align:"left",sortable:!0},{text:"revise",align:"center",sortable:!1},{text:"share",align:"center",sortable:!1},{text:"preview",align:"center",sortable:!1},{text:"download",align:"center",sortable:!1},{text:"remove",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r,n;return c["e"](this,(function(a){switch(a.label){case 0:return e=this,[4,this.mediaResourceFileApi.getAll(this.$route.params.id)];case 1:e.mediaResourceFiles=a.sent(),t=0,r=this.mediaResourceFiles,a.label=2;case 2:return t=0&&(this.mediaResourceFiles[t]=e)},t.prototype.fileRemoved=function(e){var t=this.mediaResourceFiles.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.mediaResourceFiles.splice(t,1)},t.prototype.previewFile=function(e){return c["b"](this,void 0,void 0,(function(){var t;return c["e"](this,(function(r){switch(r.label){case 0:return e&&e.id&&(this.previewFileExtention.BlobId=e.id),this.previewFileExtention.previewLoading=!0,t=this,[4,this.fileExtensionHeler.getPreviewFile(e)];case 1:return t.previewFileExtention=r.sent(),[2]}}))}))},t.prototype.downloadFile=function(e){var t=this;e&&e.id&&(this.downloading=!0,this.downloadingId=e.id,this.mediaResourceFileApi.download(e.id).then((function(r){if(null!==r){t.downloading=!1;var n=new Blob([r.data],{type:"application/octet-stream"}),a=window.URL.createObjectURL(n),i=document.createElement("a");e.name&&(i.download=e.name),i.href=a,i.click()}})).catch((function(e){console.log(e),t.downloading=!1})))},t.prototype.removeFile=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove the file "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.mediaResourceFileApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.fileRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},c["c"]([Object(d["a"])("loadThumbnail",{namespace:"thumbnail"})],t.prototype,"loadThumbnail",void 0),c["c"]([Object(d["b"])("getThumbnail",{namespace:"thumbnail"})],t.prototype,"getThumbnail",void 0),t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),Zn=Yn,Wn=Zn,Qn=Object(re["a"])(Wn,Hn,Xn,!1,null,null,null),Kn=Qn.exports;ae()(Qn,{VBtn:ie["a"],VCard:oe["a"],VDataTable:Pt["a"],VIcon:Ce["a"],VProgressCircular:pn["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var ea=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("Add File")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("ul",e._l(e.files,(function(t,n){return r("li",{key:t.id},[r("span",[e._v(e._s(t.name))]),r("span",[e._v(" ("+e._s(e._f("formatSize")(t.size))+")")])])})),0),r("upload-component",{ref:"upload",attrs:{drop:!0},model:{value:e.files,callback:function(t){e.files=t},expression:"files"}},[r("v-btn",[e._v("\n Select File\n "),r("v-icon",{attrs:{right:""}},[e._v("cloud_upload")])],1)],1),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.mediaResourceFile.marketId,callback:function(t){e.$set(e.mediaResourceFile,"marketId",t)},expression:"mediaResourceFile.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.mediaResourceFile.languageId,callback:function(t){e.$set(e.mediaResourceFile,"languageId",t)},expression:"mediaResourceFile.languageId"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary",loading:e.saving,disabled:e.saving},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("\n Save\n ")])],1)],1)],1)},ta=[],ra=r("8019"),na=r.n(ra),aa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mediaResourceFile=new E,t.markets=[],t.languages=[],t.files=[],t.shown=!0,t.saving=!1,t.mediaResourceFilesApi=new y,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=r.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=r.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return e={data:this.files[0].file,fileName:this.files[0].name},this.saving=!0,[4,this.mediaResourceFilesApi.post(null,this.$route.params.id,this.mediaResourceFile.marketId,this.mediaResourceFile.languageId,e)];case 1:return t=r.sent(),t&&(this.saving=!1),this.emitAdded(t),this.showMessage(new W("MediaResourceFile "+t.name+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitAdded=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitAdded",null),t=c["c"]([Object(p["a"])({components:{UploadComponent:na.a}})],t),t}(n["a"]),ia=aa,oa=ia,sa=Object(re["a"])(oa,ea,ta,!1,null,null,null),ca=sa.exports;ae()(sa,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSelect:Xr["a"],VSpacer:he["a"]});var la=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.mediaResourceFile?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("Revise File: "+e._s(this.mediaResourceFile.name)+"\n (v"+e._s(this.mediaResourceFile.version)+")\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("ul",e._l(e.files,(function(t,n){return r("li",{key:t.id},[r("span",[e._v(e._s(t.name))]),r("span",[e._v(" ("+e._s(e._f("formatSize")(t.size))+")")])])})),0),r("upload-component",{ref:"upload",attrs:{drop:!0},model:{value:e.files,callback:function(t){e.files=t},expression:"files"}},[r("v-btn",[e._v("\n Select File\n "),r("v-icon",{attrs:{right:""}},[e._v("cloud_upload")])],1)],1),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.mediaResourceFile.marketId,callback:function(t){e.$set(e.mediaResourceFile,"marketId",t)},expression:"mediaResourceFile.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.mediaResourceFile.languageId,callback:function(t){e.$set(e.mediaResourceFile,"languageId",t)},expression:"mediaResourceFile.languageId"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},ua=[],da=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mediaResourceFile=new E,t.markets=[],t.languages=[],t.files=[],t.shown=!0,t.fileApi=new y,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r;return c["e"](this,(function(n){switch(n.label){case 0:return e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=n.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=n.sent(),this.$route.params.id?(r=this,[4,this.fileApi.get(this.$route.params.fileId)]):[3,4];case 3:r.mediaResourceFile=n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return e={data:this.files[0].file,fileName:this.files[0].name},[4,this.fileApi.post(this.mediaResourceFile.id,this.mediaResourceFile.mediaResourceId,this.mediaResourceFile.marketId,this.mediaResourceFile.languageId,e)];case 1:return t=r.sent(),this.emitAdded(t),this.showMessage(new W("MediaResourceFile "+this.mediaResourceFile.name+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitAdded=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitAdded",null),t=c["c"]([Object(p["a"])({components:{UploadComponent:na.a}})],t),t}(n["a"]),pa=da,ha=pa,ma=Object(re["a"])(ha,la,ua,!1,null,null,null),va=ma.exports;ae()(ma,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VIcon:Ce["a"],VSelect:Xr["a"],VSpacer:he["a"]});var fa=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v("Links")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:"",to:{name:"link-new"},append:""}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.urls,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.name))]),r("td",[e._v(e._s(t.item.url))]),r("td",[e._v(e._s(t.item.version))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"link-edit",params:{urlId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("note_add")])],1)],1),r("td",[r("v-btn",{attrs:{icon:"",to:{name:"sharing-new-url",params:{urlId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("share")])],1)],1),r("td",[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.previewUrl(t.item)}}},[r("v-icon",{attrs:{color:"success"}},[e._v("slideshow")])],1)],1),r("td",[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeUrl(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])}),r("router-view",{on:{added:e.urlAdded,removed:e.urlRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},ba=[],Aa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.urls=[],t.urlApi=new k,t.search="",t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.urls.length},t.headers=[{text:"Name",value:"name",align:"left",sortable:!0},{text:"Url",value:"url",align:"left",sortable:!0},{text:"Version",value:"version",align:"left",sortable:!0},{text:"revise",align:"center",sortable:!1},{text:"share",align:"center",sortable:!1},{text:"preview",align:"center",sortable:!1},{text:"remove",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.urlApi.getAll(this.$route.params.id)];case 1:return e.urls=t.sent(),[2]}}))}))},t.prototype.urlAdded=function(e){this.urls.push(e)},t.prototype.urlUpdated=function(e){var t=this.urls.map((function(e){return e.id})).indexOf(e.id);t>=0&&(this.urls[t]=e)},t.prototype.urlRemoved=function(e){var t=this.urls.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.urls.splice(t,1)},t.prototype.previewUrl=function(e){},t.prototype.removeUrl=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove the link "+e.name+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.urlApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.urlRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),ga=Aa,wa=ga,ya=Object(re["a"])(wa,fa,ba,!1,null,null,null),xa=ya.exports;ae()(ya,{VBtn:ie["a"],VCard:oe["a"],VDataTable:Pt["a"],VIcon:Ce["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var ja=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("New Link")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-text-field",{attrs:{label:"url"},model:{value:e.item.url,callback:function(t){e.$set(e.item,"url",t)},expression:"item.url"}}),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.item.marketId,callback:function(t){e.$set(e.item,"marketId",t)},expression:"item.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.item.languageId,callback:function(t){e.$set(e.item,"languageId",t)},expression:"item.languageId"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1)],1)},ka=[],Ra=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=new B,t.markets=[],t.languages=[],t.shown=!0,t.urlApi=new k,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return this.item.mediaResourceId=this.$route.params.id,e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=r.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=r.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.urlApi.post(this.item)];case 1:return e=t.sent(),this.emitedAdded(e),this.showMessage(new W("Link "+this.item.name+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitedAdded=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitedAdded",null),t=c["c"]([p["a"]],t),t}(n["a"]),Ta=Ra,Ca=Ta,Ia=Object(re["a"])(Ca,ja,ka,!1,null,null,null),Oa=Ia.exports;ae()(Ia,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var Pa=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("Edit Link - "+e._s(this.item.name))]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-text-field",{attrs:{label:"url"},model:{value:e.item.url,callback:function(t){e.$set(e.item,"url",t)},expression:"item.url"}}),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.item.marketId,callback:function(t){e.$set(e.item,"marketId",t)},expression:"item.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.item.languageId,callback:function(t){e.$set(e.item,"languageId",t)},expression:"item.languageId"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},_a=[],Sa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=null,t.markets=[],t.languages=[],t.shown=!0,t.urlApi=new k,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r;return c["e"](this,(function(n){switch(n.label){case 0:return e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=n.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=n.sent(),r=this,[4,this.urlApi.get(this.$route.params.urlId)];case 3:return r.item=n.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.urlApi.post(this.item)];case 1:return e=t.sent(),this.emitAdded(e),this.showMessage(new W(this.item.name+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitAdded=function(e){return e},c["c"]([Object(p["c"])(String)],t.prototype,"id",void 0),c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitAdded",null),t=c["c"]([p["a"]],t),t}(n["a"]),Va=Sa,Ua=Va,Ea=Object(re["a"])(Ua,Pa,_a,!1,null,null,null),Da=Ea.exports;ae()(Ea,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var Ma=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("New Translation")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-text-field",{attrs:{label:"key"},model:{value:e.item.key,callback:function(t){e.$set(e.item,"key",t)},expression:"item.key"}}),r("v-text-field",{attrs:{label:"value"},model:{value:e.item.value,callback:function(t){e.$set(e.item,"value",t)},expression:"item.value"}}),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.item.marketId,callback:function(t){e.$set(e.item,"marketId",t)},expression:"item.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.item.languageId,callback:function(t){e.$set(e.item,"languageId",t)},expression:"item.languageId"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1)],1)},Fa=[],Na=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=new N,t.markets=[],t.languages=[],t.shown=!0,t.translationApi=new j,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:return this.item.mediaResourceId=this.$route.params.id,e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=r.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=r.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.translationApi.post(this.item)];case 1:return e=t.sent(),this.emitedAdded(e),this.showMessage(new W("Translation "+this.item.key+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitedAdded=function(e){return e},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitedAdded",null),t=c["c"]([p["a"]],t),t}(n["a"]),Ba=Na,Ja=Ba,$a=Object(re["a"])(Ja,Ma,Fa,!1,null,null,null),La=$a.exports;ae()($a,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var Ga=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[e._v("Edit Translation - "+e._s(this.item.key))]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-text-field",{attrs:{readonly:"",label:"key"},model:{value:e.item.key,callback:function(t){e.$set(e.item,"key",t)},expression:"item.key"}}),r("v-text-field",{attrs:{label:"value"},model:{value:e.item.value,callback:function(t){e.$set(e.item,"value",t)},expression:"item.value"}}),r("v-select",{attrs:{items:e.markets,"item-text":"name","item-value":"id",label:"Market"},model:{value:e.item.marketId,callback:function(t){e.$set(e.item,"marketId",t)},expression:"item.marketId"}}),r("v-select",{attrs:{items:e.languages,"item-text":"name","item-value":"id",label:"Language"},model:{value:e.item.languageId,callback:function(t){e.$set(e.item,"languageId",t)},expression:"item.languageId"}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},qa=[],za=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=null,t.markets=[],t.languages=[],t.shown=!0,t.translationApi=new j,t.marketsApi=new A,t.languagesApi=new b,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r;return c["e"](this,(function(n){switch(n.label){case 0:return e=this,[4,this.marketsApi.getAll()];case 1:return e.markets=n.sent(),t=this,[4,this.languagesApi.getAll()];case 2:return t.languages=n.sent(),r=this,[4,this.translationApi.get(this.$route.params.translationId)];case 3:return r.item=n.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:[4,this.translationApi.post(this.item)];case 1:return e=t.sent(),this.emitAdded(e),this.showMessage(new W(this.item.key+" has been saved.")),this.$router.go(-1),[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.go(-1)},t.prototype.emitAdded=function(e){return e},c["c"]([Object(p["c"])(String)],t.prototype,"id",void 0),c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),c["c"]([Object(p["b"])("added")],t.prototype,"emitAdded",null),t=c["c"]([p["a"]],t),t}(n["a"]),Ha=za,Xa=Ha,Ya=Object(re["a"])(Xa,Ga,qa,!1,null,null,null),Za=Ya.exports;ae()(Ya,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]});var Wa=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v("Translations")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:"",to:{name:"translation-new"},append:""}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.translations,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.key))]),r("td",[e._v(e._s(t.item.value))]),r("td",[e._v(e._s(t.item.version))]),r("td",[e._v(e._s(e.marketCode(t.item.marketId)))]),r("td",[e._v(e._s(e.languageCode(t.item.languageId)))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"translation-edit",params:{translationId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("note_add")])],1)],1),r("td",{staticClass:"test-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"sharing-new-translation",params:{translationId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("share")])],1)],1),r("td",{staticClass:"test-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeTranslation(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])}),r("router-view",{on:{added:e.translationAdded,removed:e.translationRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},Qa=[],Ka=(r("7514"),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.translations=[],t.translationApi=new j,t.marketsApi=new A,t.markets=[],t.languages=[],t.languagesApi=new b,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.translations.length},t.headers=[{text:"Key",value:"key",align:"left",sortable:!0},{text:"Value",value:"value",align:"left",sortable:!0},{text:"Version",value:"version",align:"left",sortable:!0},{text:"Market",value:"key",align:"left",sortable:!0},{text:"Language",value:"key",align:"left",sortable:!0},{text:"revise",align:"center",sortable:!1},{text:"share",align:"center",sortable:!1},{text:"remove",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r;return c["e"](this,(function(n){switch(n.label){case 0:return e=this,[4,this.translationApi.getAll(this.$route.params.id)];case 1:return e.translations=n.sent(),t=this,[4,this.marketsApi.getAll()];case 2:return t.markets=n.sent(),r=this,[4,this.languagesApi.getAll()];case 3:return r.languages=n.sent(),[2]}}))}))},t.prototype.translationAdded=function(e){this.translations.push(e)},t.prototype.translationUpdated=function(e){var t=this.translations.map((function(e){return e.id})).indexOf(e.id);t>=0&&(this.translations[t]=e)},t.prototype.translationRemoved=function(e){var t=this.translations.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.translations.splice(t,1)},t.prototype.previewTranslation=function(e){},t.prototype.marketCode=function(e){var t=this.markets.find((function(t){return t.id===e}));return t?t.code:""},t.prototype.languageCode=function(e){var t=this.languages.find((function(t){return t.id===e}));return t?t.code:""},t.prototype.removeTranslation=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove the translation "+e.key+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.translationApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.translationRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"])),ei=Ka,ti=ei,ri=Object(re["a"])(ti,Wa,Qa,!1,null,null,null),ni=ri.exports;ae()(ri,{VBtn:ie["a"],VCard:oe["a"],VDataTable:Pt["a"],VIcon:Ce["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var ai=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v(e._s(0==e.activeTab?"Public":"Private")+" Endpoints")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),r("v-tabs",{attrs:{color:"green",grow:"",centered:"","slider-color":"blue"},model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[r("v-tab",{staticClass:"white--text"},[e._v("Public")]),r("v-tab",{staticClass:"white--text"},[e._v("Private")]),r("v-tabs-items",[r("v-tab-item",[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.publicHeaders,items:e.publicEndpoints,search:e.search},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.itemName))]),r("td",[r("a",{attrs:{href:t.item.absoluteUri,target:"_blank"}},[e._v("\n "+e._s(e._f("truncate")(t.item.absoluteUri||"",30))+"\n ")])]),r("td",[e._v("\n "+e._s(t.item.startUtc?e.moment(t.item.startUtc).local():"n/a")+"\n ")]),r("td",[e._v("\n "+e._s(t.item.endUtc?e.moment(t.item.endUtc).local():"n/a")+"\n ")]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"sharing-edit",params:{endpointId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1)],1),r("td",[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeEndpoint(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1),r("v-tab-item",[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.privateHeaders,items:e.privateEndpoints,search:e.search},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.itemName))]),r("td",[r("a",{attrs:{href:t.item.absoluteUri,target:"_blank"}},[e._v("\n "+e._s(e._f("truncate")(t.item.absoluteUri,30))+"\n ")])]),r("td",[e._v(e._s(t.item.email))]),r("td",[e._v("\n "+e._s(t.item.startUtc?e.moment(t.item.startUtc).local():"n/a")+"\n ")]),r("td",[e._v("\n "+e._s(t.item.endUtc?e.moment(t.item.endUtc).local():"n/a")+"\n ")]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:"",to:{name:"sharing-edit",params:{endpointId:t.item.id}},append:""}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1)],1),r("td",[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.showHistory(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("history")])],1)],1),r("td",[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeEndpoint(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),r("endpoint-history-list",{attrs:{shown:e.showHistoryDialog,endpoint:e.historyItem},on:{closed:function(t){e.showHistoryDialog=!1}}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}}),r("router-view",{on:{added:e.endpointAdded,updated:e.endpointUpdated,removed:e.endpointRemoved}})],1)},ii=[],oi=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{persistent:"",width:"800"},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.emitClosed(t)}},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v("Endpoint History")]),r("v-spacer"),r("v-btn",{attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.emitClosed(t)}}},[r("v-icon",[e._v("close")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.endpointHistorys,pagination:e.pagination},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.visitedUtc))]),r("td",[e._v(e._s(t.item.ipAddress))]),r("td",[e._v(e._s(t.item.platform))])]}}])})],1)],1)},si=[],ci=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.endpointHistorys=[],t.endpointHistoryApi=new g,t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"name",totalItems:t.endpointHistorys.length},t.headers=[{text:"When",value:"visitedUtc",align:"left",sortable:!0},{text:"ip address",value:"ipAddress",align:"left",sortable:!0},{text:"user agent",value:"platform",align:"left",sortable:!0}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.loadHistory()];case 1:return e.sent(),[2]}}))}))},t.prototype.onEndpointChanged=function(){return c["b"](this,void 0,void 0,(function(){return c["e"](this,(function(e){switch(e.label){case 0:return[4,this.loadHistory()];case 1:return e.sent(),[2]}}))}))},t.prototype.loadHistory=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.endpoint&&this.endpoint.id?(e=this,[4,this.endpointHistoryApi.get(this.endpoint.id)]):[3,2];case 1:e.endpointHistorys=t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.emitClosed=function(){return!0},c["c"]([Object(p["c"])({default:!1})],t.prototype,"shown",void 0),c["c"]([Object(p["c"])({default:null})],t.prototype,"endpoint",void 0),c["c"]([Object(p["e"])("endpoint")],t.prototype,"onEndpointChanged",null),c["c"]([Object(p["b"])("closed")],t.prototype,"emitClosed",null),t=c["c"]([p["a"]],t),t}(n["a"]),li=ci,ui=li,di=Object(re["a"])(ui,oi,si,!1,null,null,null),pi=di.exports;ae()(di,{VBtn:ie["a"],VCard:oe["a"],VDataTable:Pt["a"],VDialog:jt["a"],VIcon:Ce["a"],VSpacer:he["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var hi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.endpoints=[],t.endpointApi=new w,t.privateEndpoints=[],t.publicEndpoints=[],t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.showHistoryDialog=!1,t.historyItem=null,t.search="",t.activeTab=0,t.privateHeaders=[{text:"Item",value:"itemName",align:"left",sortable:!0},{text:"Link",value:"itemName",align:"left",sortable:!0},{text:"Email",value:"email",align:"left",sortable:!0},{text:"Start",value:"itemName",align:"left",sortable:!0},{text:"End",value:"itemName",align:"left",sortable:!0},{text:"Edit",align:"center",sortable:!1},{text:"History",align:"center",sortable:!1},{text:"Remove",align:"center",sortable:!1}],t.publicHeaders=[{text:"Item",value:"itemName",align:"left",sortable:!0},{text:"Link",value:"itemName",align:"left",sortable:!0},{text:"Start",value:"itemName",align:"left",sortable:!0},{text:"End",value:"itemName",align:"left",sortable:!0},{text:"Edit",align:"center",sortable:!1},{text:"Remove",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=this,[4,this.endpointApi.getAll(this.$route.params.id)];case 1:return e.endpoints=t.sent(),this.filterEndpoints(),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))},t.prototype.endpointAdded=function(e){this.endpoints.push(e),this.filterEndpoints()},t.prototype.endpointUpdated=function(e){var t=this.endpoints.map((function(e){return e.id})).indexOf(e.id);t>=0&&(this.endpoints[t]=e),this.filterEndpoints()},t.prototype.endpointRemoved=function(e){var t=this.endpoints.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.endpoints.splice(t,1),this.filterEndpoints()},t.prototype.filterEndpoints=function(){this.endpoints&&this.endpoints.length>0&&(this.publicEndpoints=this.endpoints.filter((function(e){return e.isPublic}))||[],this.privateEndpoints=this.endpoints.filter((function(e){return!e.isPublic}))||[])},t.prototype.removeEndpoint=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove this endpoint for "+e.itemName+"?",this.showRemoveDialog=!0},t.prototype.showHistory=function(e){this.historyItem=e,this.showHistoryDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.endpointApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.endpointRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{EndpointHistoryList:pi,RemoveItemDialog:Tt}})],t),t}(n["a"]),mi=hi,vi=mi,fi=r("c671"),bi=r("aac8"),Ai=Object(re["a"])(vi,ai,ii,!1,null,null,null),gi=Ai.exports;ae()(Ai,{VBtn:ie["a"],VCard:oe["a"],VDataTable:Pt["a"],VIcon:Ce["a"],VSpacer:he["a"],VTab:Ln["a"],VTabItem:fi["a"],VTabs:Gn["a"],VTabsItems:bi["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var wi=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",[r("v-card-title",{staticClass:"white--text",class:e.isPublic?"warning py-4 title":"info py-4 title"},[e._v("\n New "+e._s(e.isPublic?"Public":"Private")+" Endpoint\n ")]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-card",{staticClass:"pa-2 mb-2",attrs:{flat:""}},[r("v-text-field",{attrs:{readonly:"","prepend-icon":e.itemIcon,label:e.itemLabel},model:{value:e.itemDescription,callback:function(t){e.itemDescription=t},expression:"itemDescription"}}),r("v-switch",{attrs:{label:"Available to public"},model:{value:e.isPublic,callback:function(t){e.isPublic=t},expression:"isPublic"}}),r("v-alert",{attrs:{value:e.isPublic,type:"warning"}},[e._v(" this "+e._s(e.itemLabel)+" will be openly available\n ")]),r("v-alert",{attrs:{value:!e.isPublic,type:"info"}},[e._v(" each receipient will receive a unique link to access the "+e._s(e.itemLabel)+"\n ")])],1),r("v-card",{staticClass:"pa-2 mb-2",attrs:{flat:""}},[e.isPublic?e._e():r("v-combobox",{attrs:{"prepend-icon":"alternate_email",label:"recipients",multiple:"",chips:"","deletable-chips":""},model:{value:e.recipients,callback:function(t){e.recipients=t},expression:"recipients"}})],1),r("v-card",{staticClass:"pa-2 mb-2",attrs:{flat:""}},[r("v-layout",{attrs:{row:""}},[r("v-flex",[r("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","min-width":"290px"},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[r("v-text-field",e._g({attrs:{clearable:"",label:"start date","prepend-icon":"event",readonly:"",placeholder:"available immediately if left blank"},model:{value:e.startDate,callback:function(t){e.startDate=t},expression:"startDate"}},n))]}}]),model:{value:e.startDateMenu,callback:function(t){e.startDateMenu=t},expression:"startDateMenu"}},[r("v-date-picker",{on:{input:function(t){e.startDateMenu=!1}},model:{value:e.startDate,callback:function(t){e.startDate=t},expression:"startDate"}})],1)],1),r("v-flex",[e.startDate?r("v-menu",{ref:"startTimeMenu",attrs:{"close-on-content-click":!1,"nudge-right":40,"return-value":e.startTime,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","max-width":"290px","min-width":"290px"},on:{"update:returnValue":function(t){e.startTime=t},"update:return-value":function(t){e.startTime=t}},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[r("v-text-field",e._g({attrs:{clearable:"",type:"time",label:"start time","prepend-icon":"access_time",readonly:""},model:{value:e.startTime,callback:function(t){e.startTime=t},expression:"startTime"}},n))]}}],null,!1,451228049),model:{value:e.startTimeMenu,callback:function(t){e.startTimeMenu=t},expression:"startTimeMenu"}},[e.startTimeMenu?r("v-time-picker",{attrs:{"full-width":""},model:{value:e.startTime,callback:function(t){e.startTime=t},expression:"startTime"}},[r("v-spacer"),r("v-btn",{attrs:{flat:"",color:"primary"},on:{click:function(t){e.startTimeMenu=!1}}},[e._v("Cancel")]),r("v-btn",{attrs:{flat:"",color:"primary"},on:{click:function(t){return e.$refs.startTimeMenu.save(e.startTime)}}},[e._v("OK")])],1):e._e()],1):e._e()],1)],1),r("v-layout",{attrs:{row:""}},[r("v-flex",[r("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","min-width":"290px"},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[r("v-text-field",e._g({attrs:{clearable:"",label:"end date","prepend-icon":"event",readonly:"",placeholder:"available immediately if left blank"},model:{value:e.endDate,callback:function(t){e.endDate=t},expression:"endDate"}},n))]}}]),model:{value:e.endDateMenu,callback:function(t){e.endDateMenu=t},expression:"endDateMenu"}},[r("v-date-picker",{on:{input:function(t){e.endDateMenu=!1}},model:{value:e.endDate,callback:function(t){e.endDate=t},expression:"endDate"}})],1)],1),r("v-flex",[e.endDate?r("v-menu",{ref:"endTimeMenu",attrs:{"close-on-content-click":!1,"nudge-right":40,"return-value":e.endTime,lazy:"",transition:"scale-transition","offset-y":"","full-width":"","max-width":"290px","min-width":"290px"},on:{"update:returnValue":function(t){e.endTime=t},"update:return-value":function(t){e.endTime=t}},scopedSlots:e._u([{key:"activator",fn:function(t){var n=t.on;return[r("v-text-field",e._g({attrs:{clearable:"",type:"time",label:"end time","prepend-icon":"access_time",readonly:""},model:{value:e.endTime,callback:function(t){e.endTime=t},expression:"endTime"}},n))]}}],null,!1,352935537),model:{value:e.endTimeMenu,callback:function(t){e.endTimeMenu=t},expression:"endTimeMenu"}},[e.endTimeMenu?r("v-time-picker",{attrs:{"full-width":""},model:{value:e.endTime,callback:function(t){e.endTime=t},expression:"endTime"}},[r("v-spacer"),r("v-btn",{attrs:{flat:"",color:"primary"},on:{click:function(t){e.endTimeMenu=!1}}},[e._v("Cancel")]),r("v-btn",{attrs:{flat:"",color:"primary"},on:{click:function(t){return e.$refs.endTimeMenu.save(e.endTime)}}},[e._v("OK")])],1):e._e()],1):e._e()],1)],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1)],1)},yi=[],xi=r("c1df"),ji=r.n(xi),ki=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.item=new U,t.itemDescription="none",t.itemLabel="media",t.itemIcon="insert_drive_file",t.shown=!0,t.isPublic=!1,t.recipients=[],t.startDate=null,t.startTime=null,t.startTimeMenu=!1,t.startDateMenu=!1,t.endDate=null,t.endTime=null,t.endTimeMenu=!1,t.endDateMenu=!1,t.file=null,t.url=null,t.translation=null,t.endpointApi=new w,t.fileApi=new y,t.urlApi=new k,t.translationApi=new j,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r,n,a,i;return c["e"](this,(function(o){switch(o.label){case 0:return e=this.$route.params.fileId,t=this.$route.params.urlId,r=this.$route.params.translationId,e?(this.item.mediaResourceFileId=e,n=this,[4,this.fileApi.get(e)]):[3,2];case 1:n.file=o.sent(),this.itemDescription=this.file.name+" (v"+this.file.version+")"||!1,this.itemLabel="file",this.itemIcon="insert_drive_file",o.label=2;case 2:return t?(this.item.mediaResourceUrlId=t,a=this,[4,this.urlApi.get(t)]):[3,4];case 3:a.url=o.sent(),this.itemDescription=this.url.name+" (v"+this.url.version+")"||!1,this.itemLabel="link",this.itemIcon="link",o.label=4;case 4:return r?(this.item.mediaResourceTranslationId=r,i=this,[4,this.translationApi.get(r)]):[3,6];case 5:i.translation=o.sent(),this.itemDescription=this.translation.key+" (v"+this.translation.version+")"||!1,this.itemLabel="translation",this.itemIcon="translate",o.label=6;case 6:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e,t,r,n,a,i,o,s,l,u;return c["e"](this,(function(c){switch(c.label){case 0:if(null===this.item)return[2];if(e=[],this.isPublic||null===this.recipients)this.isPublic&&(a=new U,null!==this.file&&(a.mediaResourceFileId=this.file.id),null!==this.url&&(a.mediaResourceUrlId=this.url.id),null!==this.translation&&(a.mediaResourceTranslationId=this.translation.id),a.isPublic=this.isPublic,this.startDate&&(a.startUtc=ji.a.utc(new Date(this.startDate+" "+this.startTime)).toDate()),this.endDate&&(a.endUtc=ji.a.utc(new Date(this.endDate+" "+this.endTime)).toDate()),e.push(a));else for(t=0,r=this.recipients;t=6||"Min 6 characters"},onechar:function(e){return/(?=.*[a-z])/.test(e)||/(?=.*[A-Z])/.test(e)||"At least one character"}},t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.email?(e=this,[4,this.usersApi.get("",this.$route.params.email)]):[3,2];case 1:e.item=t.sent(),this.item.passwordResetToken=decodeURIComponent(this.$route.params.passwordResetToken),t.label=2;case 2:return[2]}}))}))},t.prototype.passwordConfirmationRule=function(){return this.password===this.rePassword||"Password must match"},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e,t;return c["e"](this,(function(r){switch(r.label){case 0:if(null===this.item)return[2];if(!(this.item.email&&this.item.passwordResetToken&&this.password))return[3,4];this.item.password=this.password,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.userTokenApi.post(this.item)];case 2:return e=r.sent(),console.log("response",e),this.showMessage(new W(this.item.email+" password has been reset.")),this.logout(),localStorage.clear(),this.$router.push("/login"),location.reload(),[3,4];case 3:return t=r.sent(),console.log(t),this.showMessage(new Q("password reset failed.")),[3,4];case 4:return[2]}}))}))},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(d["a"])("loginWithToken",{namespace:"auth"})],t.prototype,"loginWithToken",void 0),c["c"]([Object(d["a"])("logout",{namespace:"auth"})],t.prototype,"logout",void 0),t=c["c"]([p["a"]],t),t}(n["a"]),Yi=Xi,Zi=Yi,Wi=Object(re["a"])(Zi,zi,Hi,!1,null,null,null),Qi=Wi.exports;ae()(Wi,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VContent:le["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Ki=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-layout",{attrs:{row:""}},[r("v-flex",{attrs:{xs12:""}},[r("v-card",[r("v-toolbar",{attrs:{color:"primary",dark:""}},[r("v-toolbar-title",[e._v("Users")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer"),r("v-btn",{attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.newUser(t)}}},[r("v-icon",[e._v("add")])],1)],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.users,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.email))]),r("td",[e._v(e._s(t.item.firstName))]),r("td",[e._v(e._s(t.item.lastName))]),r("td",[e._v(e._s(t.item.department))]),r("td",[e._v(e._s(t.item.phoneNumber))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editUser(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1),r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeUser(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}])})],1)],1)],1),r("router-view",{on:{itemAdded:e.userAdded,itemUpdated:e.userUpdated,itemRemoved:e.userRemoved}}),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1)},eo=[],to=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.users=[],t.usersApi=new I,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"email",totalItems:t.users.length},t.headers=[{text:"Eamil",value:"email",align:"left",sortable:!0},{text:"First Name",value:"firstName",align:"left",sortable:!0},{text:"Last Name",value:"lastName",align:"left",sortable:!0},{text:"Department",value:"department",align:"left",sortable:!0},{text:"Phone Number",value:"phoneNumber",align:"left",sortable:!0},{text:"Actions",value:"isDeActivated",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.usersApi.getAll()];case 1:return e.users=t.sent(),[2]}}))}))},t.prototype.userAdded=function(e){this.users.push(e)},t.prototype.userUpdated=function(e){var t=this.users.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.users.splice(t,1,e)},t.prototype.userRemoved=function(e){var t=this.users.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.users.splice(t,1)},t.prototype.newUser=function(){this.$router.push({path:"/users/new"})},t.prototype.editUser=function(e){this.$router.push({path:"/users/edit/"+e.id})},t.prototype.removeUser=function(e){this.removeItem=e,this.removeMessage="Are you sure you want to remove user "+e.email+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?(this.removeItem.isRemoved=!0,[4,this.usersApi.put(this.removeItem)]):[3,2];case 1:e=t.sent(),this.userRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),ro=to,no=ro,ao=Object(re["a"])(no,Ki,eo,!1,null,null,null),io=ao.exports;ae()(ao,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var oo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[r("span",[e._v("Add User")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("form",[r("v-text-field",{attrs:{label:"Login ID (email)",rules:e.emailRules},model:{value:e.item.email,callback:function(t){e.$set(e.item,"email",t)},expression:"item.email"}})],1),r("form",[r("v-text-field",{attrs:{autocomplete:"nope","append-icon":e.show?"visibility":"visibility_off",rules:[e.rules.required,e.rules.min],type:e.show?"text":"password",name:"password",label:"Enter Password",hint:"At least 6 characters",counter:""},on:{"click:append":function(t){e.show=!e.show}},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),r("form",[r("v-text-field",{attrs:{"append-icon":e.show1?"visibility":"visibility_off",rules:[e.rules.required,e.rules.min,e.passwordConfirmationRule],type:e.show1?"text":"password",name:"input-10-1",label:"Re-enter Password",hint:"At least 6 characters",counter:""},on:{"click:append":function(t){e.show1=!e.show1}},model:{value:e.rePassword,callback:function(t){e.rePassword=t},expression:"rePassword"}})],1),r("v-text-field",{attrs:{label:"First Name"},model:{value:e.item.firstName,callback:function(t){e.$set(e.item,"firstName",t)},expression:"item.firstName"}}),r("v-text-field",{attrs:{label:"Last Name"},model:{value:e.item.lastName,callback:function(t){e.$set(e.item,"lastName",t)},expression:"item.lastName"}}),r("v-text-field",{attrs:{label:"Department"},model:{value:e.item.department,callback:function(t){e.$set(e.item,"department",t)},expression:"item.department"}}),r("v-text-field",{attrs:{label:"Phone"},model:{value:e.item.phoneNumber,callback:function(t){e.$set(e.item,"phoneNumber",t)},expression:"item.phoneNumber"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},so=[],co=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.usersApi=new I,t.show=!1,t.show1=!1,t.password="",t.rePassword="",t.rules={required:function(e){return!!e||"Required."},min:function(e){return e.length>=6||"Min 6 characters"},emailMatch:function(){return"The email and password you entered don't match"}},t.emailRules=[function(e){return!!e||"E-mail is required"},function(e){return/.+@.+\..+/.test(e)||"E-mail must be valid"}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.usersApi.get(this.$route.params.id,"")]):[3,2];case 1:return e.item=t.sent(),console.log("mounted1",this.item),[3,3];case 2:this.item=new J,console.log(this.item),t.label=3;case 3:return[2]}}))}))},t.prototype.passwordConfirmationRule=function(){return this.password===this.rePassword||"Password must match"},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[3,2]:(this.item.password=this.password,[4,this.usersApi.post(this.item)]);case 1:e=t.sent(),this.emitAdded(e),t.label=2;case 2:return this.showMessage(new W(this.item.email+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitAdded=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/users")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemAdded")],t.prototype,"emitAdded",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),lo=co,uo=lo,po=Object(re["a"])(uo,oo,so,!1,null,null,null),ho=po.exports;ae()(po,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var mo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[r("v-card",{staticClass:"primary --text py-0 title"},[r("v-card-title",{staticClass:"grey lighten-4 py-3 title"},[r("span",[e._v("Edit User")])]),r("v-tabs",{attrs:{color:"primary",grow:"",centered:"","slider-color":"green"}},[r("v-tabs-slider"),r("v-tab",{staticClass:"white--text",on:{click:function(t){return t.stopPropagation(),e.getUserInfo()}}},[e._v("Info")]),r("v-tab",{staticClass:"white--text",on:{click:function(t){return t.stopPropagation(),e.getUserRoles()}}},[e._v("Roles")]),e.UserRolesArray?r("v-btn",{staticClass:"white--text",attrs:{icon:""},on:{click:function(t){return t.stopPropagation(),e.newRole(t)}}},[r("v-icon",[e._v("add")])],1):e._e()],1),r("router-view")],1),e.item&&!e.UserRolesArray?r("v-card",[r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"EMAIL"},model:{value:e.item.email,callback:function(t){e.$set(e.item,"email",t)},expression:"item.email"}}),r("v-text-field",{attrs:{label:"FIRST NAME"},model:{value:e.item.firstName,callback:function(t){e.$set(e.item,"firstName",t)},expression:"item.firstName"}}),r("v-text-field",{attrs:{label:"LAST NAME"},model:{value:e.item.lastName,callback:function(t){e.$set(e.item,"lastName",t)},expression:"item.lastName"}}),r("v-text-field",{attrs:{label:"Department"},model:{value:e.item.department,callback:function(t){e.$set(e.item,"department",t)},expression:"item.department"}}),r("v-text-field",{attrs:{label:"PHONE"},model:{value:e.item.phoneNumber,callback:function(t){e.$set(e.item,"phoneNumber",t)},expression:"item.phoneNumber"}})],1)],1),r("v-btn",{attrs:{text:"",small:"",color:"success"},on:{click:function(t){return t.stopPropagation(),e.resetPassword(t)}}},[e._v("Change password")])],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e(),e.item&&e.UserRolesArray?r("v-card",[r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.UserRolesArray,"hide-actions":""},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",{staticClass:"title"},[e._v(e._s(t.item))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.removeUserRole(t.item)}}},[r("v-icon",{attrs:{color:"red"}},[e._v("remove_circle")])],1)],1)]}}],null,!1,1975071730)})],1)],1),r("remove-item-dialog",{attrs:{shown:e.showRemoveDialog,color:"error",title:"Remove",message:e.removeMessage},on:{confirmed:e.confirmRemove,closed:function(t){e.showRemoveDialog=!1}}})],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.confirm(t)}}},[e._v("Confirm")])],1)],1):e._e()],1)},vo=[],fo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.usersApi=new I,t.rolesApi=new R,t.UserRolesArray=null,t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.userToRemove=null,t.headers=[{text:"Assigned Roles",value:"role",align:"left",width:"600px",sortable:!0},{text:"Actions",value:"",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.usersApi.get(this.$route.params.id,"")]):[3,2];case 1:e.item=t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.roleRemoved=function(e){var t=this.UserRolesArray.map((function(e){return e.id})).indexOf(e.id);t>=0&&this.UserRolesArray.splice(t,1)},t.prototype.getUserInfo=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.usersApi.get(this.$route.params.id,"")];case 1:return e.item=t.sent(),this.UserRolesArray=null,[2]}}))}))},t.prototype.getUserRoles=function(){return c["b"](this,void 0,void 0,(function(){var e=this;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?[4,this.usersApi.get(this.$route.params.id,"").then((function(t){null!=t&&(e.UserRolesArray=t.roles)})).catch((function(e){console.log(e)}))]:[2,null];case 1:return t.sent(),[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:this.item.id?[4,this.usersApi.put(this.item)]:[3,2];case 1:e=t.sent(),this.emitUpdated(e),t.label=2;case 2:return this.showMessage(new W(this.item.email+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.resetPassword=function(e){null!==this.item&&this.item.id&&this.$router.push({path:"/users/resetPassword/"+this.item.id})},t.prototype.newRole=function(){this.$router.push({path:"/users/edit/"+this.$route.params.id+"/newRole"})},t.prototype.confirm=function(){this.$router.push({path:"/roles"})},t.prototype.removeUserRole=function(e){this.item.role=e,this.removeItem=this.item,this.removeMessage="Are you sure you want to remove item "+this.item.email+"?",this.showRemoveDialog=!0},t.prototype.confirmRemove=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.removeItem?[4,this.rolesApi.delete(this.removeItem)]:[3,2];case 1:e=t.sent(),this.roleRemoved(e),this.showRemoveDialog=!1,t.label=2;case 2:return[2]}}))}))},t.prototype.emitUpdated=function(e){return e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/users")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemUpdated")],t.prototype,"emitUpdated",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),bo=fo,Ao=bo,go=r("9a96"),wo=Object(re["a"])(Ao,mo,vo,!1,null,null,null),yo=wo.exports;ae()(wo,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDataTable:Pt["a"],VDialog:jt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTab:Ln["a"],VTabs:Gn["a"],VTabsSlider:go["a"],VTextField:me["a"]});var xo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[r("span",[e._v("\n Password Reset Request\n ")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{label:"EMAIL"},model:{value:e.item.email,callback:function(t){e.$set(e.item,"email",t)},expression:"item.email"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary",loading:e.submit,disabled:e.submit},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Submit")])],1)],1):e._e()],1)},jo=[],ko=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.usersApi=new I,t.submit=!1,t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.usersApi.get(this.$route.params.id,"")]):[3,2];case 1:e.item=t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:(this.submit=!0,this.item.email?[4,this.usersApi.getPasswordResetToken(this.item.email)]:[3,2]);case 1:e=t.sent(),e&&(this.submit=!1),t.label=2;case 2:return this.showMessage(new W("password reset link was sent to "+this.item.email)),this.shown=!1,[2]}}))}))},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/users")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),Ro=ko,To=Ro,Co=Object(re["a"])(To,xo,jo,!1,null,null,null),Io=Co.exports;ae()(Co,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSpacer:he["a"],VTextField:me["a"]});var Oo=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-content",[r("v-layout",{attrs:{row:""}},[r("v-flex",{attrs:{xs12:""}},[r("v-spacer"),r("v-card",{staticClass:"primary white--text py-0 title"},[r("v-tabs",{attrs:{color:"primary",grow:"",centered:"","slider-color":"green"}},[r("v-tab",{staticClass:"white--text",on:{click:function(t){return t.stopPropagation(),e.getUsersInRoles(e.userRole="Administrators")}}},[e._v("Administrators")]),r("v-tab",{staticClass:"white--text",on:{click:function(t){return t.stopPropagation(),e.getUsersInRoles(e.userRole="Contributors")}}},[e._v("Contributors")]),r("v-tab",{staticClass:"white--text",on:{click:function(t){return t.stopPropagation(),e.getUsersNotInRoles()}}},[e._v("Not assigned")])],1)],1),r("v-card",[r("v-toolbar",{attrs:{color:"green",dark:""}},[r("v-toolbar-title",[e._v(e._s(e.roleName)+" Roles")]),r("v-spacer"),r("v-text-field",{attrs:{"append-icon":"search",label:"Search","hide-details":"",flat:"","solo-inverted":""},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),r("v-spacer")],1),r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.headers,items:e.users,pagination:e.pagination,search:e.search},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"items",fn:function(t){return[r("td",[e._v(e._s(t.item.firstName))]),r("td",[e._v(e._s(t.item.lastName))]),r("td",[e._v(e._s(t.item.email))]),r("td",{staticClass:"text-xs-center"},[r("v-btn",{attrs:{icon:""},on:{click:function(r){return r.stopPropagation(),e.editRole(t.item)}}},[r("v-icon",{attrs:{color:"primary"}},[e._v("edit")])],1)],1)]}}])})],1)],1)],1)],1)},Po=[],_o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.users=[],t.usersApi=new I,t.userRole=null,t.rolesApi=new R,t.roleName="",t.allUsers=[],t.adminUsers=[],t.contribUsers=[],t.notAssignedUsers=[],t.showRemoveDialog=!1,t.removeItem=null,t.removeMessage="",t.search="",t.pagination={descending:!1,page:1,rowsPerPage:-1,sortBy:"email",totalItems:t.users.length},t.headers=[{text:"First Name",value:"firstName",align:"left",sortable:!0},{text:"Last Name",value:"lastName",align:"left",sortable:!0},{text:"Eamil",value:"email",align:"left",sortable:!0},{text:"Action",value:"string",align:"center",sortable:!1}],t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.rolesApi.get("Administrators")];case 1:return e.users=t.sent(),this.roleName="Administrator",this.userRole="Administrators",[2]}}))}))},t.prototype.getUsersInRoles=function(e){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return e=this,[4,this.rolesApi.get(this.userRole)];case 1:return e.users=t.sent(),this.roleName="Administrators"==this.userRole?"Administrator":"Contributors"==this.userRole?"Contributor":"",[2]}}))}))},t.prototype.getUsersNotInRoles=function(e){return c["b"](this,void 0,void 0,(function(){var e,t,r,n=this;return c["e"](this,(function(a){switch(a.label){case 0:return e=this,[4,this.usersApi.getAll()];case 1:return e.allUsers=a.sent(),t=this,[4,this.rolesApi.get("Administrators")];case 2:return t.adminUsers=a.sent(),r=this,[4,this.rolesApi.get("Contributors")];case 3:return r.contribUsers=a.sent(),this.users=this.allUsers.filter((function(e){return!n.adminUsers.find((function(t){var r=t.id;return e.id===r}))&&!n.contribUsers.find((function(t){var r=t.id;return e.id===r}))})),this.roleName="Not Assigned",this.userRole="",[2]}}))}))},t.prototype.editRole=function(e){e.role=this.userRole,console.log(e.role),this.$router.push({path:"/users/edit/"+e.id})},t=c["c"]([Object(p["a"])({components:{RemoveItemDialog:Tt}})],t),t}(n["a"]),So=_o,Vo=So,Uo=Object(re["a"])(Vo,Oo,Po,!1,null,null,null),Eo=Uo.exports;ae()(Uo,{VBtn:ie["a"],VCard:oe["a"],VContent:le["a"],VDataTable:Pt["a"],VFlex:ue["a"],VIcon:Ce["a"],VLayout:pe["a"],VSpacer:he["a"],VTab:Ln["a"],VTabs:Gn["a"],VTextField:me["a"],VToolbar:ve["a"],VToolbarTitle:fe["a"]});var Do=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-dialog",{attrs:{width:"800px"},model:{value:e.shown,callback:function(t){e.shown=t},expression:"shown"}},[e.item?r("v-card",[r("v-card-title",{staticClass:"grey lighten-4 py-4 title"},[r("span",[e._v("Add Role")])]),r("v-container",{staticClass:"pa-4",attrs:{"grid-list-sm":""}},[r("v-layout",{attrs:{row:"",wrap:""}},[r("v-flex",{attrs:{xs12:"","align-center":"","justify-space-between":""}},[r("v-text-field",{attrs:{disabled:"",label:"Login ID (email)"},model:{value:e.item.email,callback:function(t){e.$set(e.item,"email",t)},expression:"item.email"}}),r("v-select",{attrs:{items:e.roles,label:"Select Role","return-object":""},model:{value:e.selectedItem,callback:function(t){e.selectedItem=t},expression:"selectedItem"}})],1)],1)],1),r("v-card-actions",[r("v-spacer"),r("v-btn",{on:{click:function(t){t.stopPropagation(),e.shown=!e.shown}}},[e._v("Cancel")]),r("v-btn",{attrs:{color:"primary"},on:{click:function(t){return t.stopPropagation(),e.save(t)}}},[e._v("Save")])],1)],1):e._e()],1)},Mo=[],Fo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.shown=!0,t.item=null,t.usersApi=new I,t.rolesApi=new R,t.roles=["Administrators","Contributors"],t.selectedItem="",t}return c["d"](t,e),t.prototype.mounted=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return this.$route.params.id?(e=this,[4,this.usersApi.get(this.$route.params.id,"")]):[3,2];case 1:return e.item=t.sent(),[3,3];case 2:this.item=new J,t.label=3;case 3:return[2]}}))}))},t.prototype.save=function(){return c["b"](this,void 0,void 0,(function(){var e;return c["e"](this,(function(t){switch(t.label){case 0:return null===this.item?[2]:null==this.selectedItem?[2]:(this.item.role=this.selectedItem,[4,this.rolesApi.post(this.item)]);case 1:return e=t.sent(),this.emitRemoved(e),this.showMessage(new W(this.selectedItem+" has been saved.")),this.shown=!1,[2]}}))}))},t.prototype.emitRemoved=function(e){return console.log("removed",e),e},t.prototype.onShownChanged=function(){this.shown||this.$router.push("/roles")},c["c"]([Object(d["a"])("showMessage",{namespace:"notification"})],t.prototype,"showMessage",void 0),c["c"]([Object(p["b"])("itemRemoved")],t.prototype,"emitRemoved",null),c["c"]([Object(p["e"])("shown")],t.prototype,"onShownChanged",null),t=c["c"]([p["a"]],t),t}(n["a"]),No=Fo,Bo=No,Jo=Object(re["a"])(Bo,Do,Mo,!1,null,null,null),$o=Jo.exports;ae()(Jo,{VBtn:ie["a"],VCard:oe["a"],VCardActions:se["a"],VCardTitle:xt["a"],VContainer:ce["a"],VDialog:jt["a"],VFlex:ue["a"],VLayout:pe["a"],VSelect:Xr["a"],VSpacer:he["a"],VTextField:me["a"]}),n["a"].use(st["a"]);var Lo,Go=new st["a"]({mode:"history",base:"/",routes:[{path:"/",name:"home",component:mt},{path:"/about",component:qi},{path:"/password/reset/:email/:passwordResetToken",component:Qi},{path:"/users",name:"users",component:io,children:[{name:"user-new",path:"new",component:ho},{name:"user-edit",path:"edit/:id",component:yo,children:[{name:"roles-new",path:"newRole",component:$o}]},{name:"reset-password",path:"resetPassword/:id",component:Io}]},{path:"/roles",name:"roles",component:Eo},{path:"/markets",name:"markets",component:er,children:[{path:"new",component:sr},{path:"edit/:id",component:sr},{path:"remove/:id",component:mr}]},{path:"/languages",name:"languages",component:St,children:[{path:"new",component:Nt},{path:"edit/:id",component:Nt},{path:"remove/:id",component:Ht}]},{path:"/tags",name:"tags",component:yr,children:[{path:"new",component:Ir},{path:"edit/:id",component:Ir},{path:"remove/:id",component:Er}]},{path:"/storage",name:"storage",component:$r,children:[{path:"new",component:Zr},{path:"edit/:id",component:Zr},{path:"remove/:id",component:nn}]},{path:"/documents",name:"documents",component:mn,children:[{path:"new",component:yn},{path:"remove/:id",component:Mn}]},{path:"/images",name:"images",component:mn,children:[{path:"new",component:yn},{path:"remove/:id",component:Mn}]},{path:"/video",name:"video",component:mn,children:[{path:"new",component:yn},{path:"remove/:id",component:Mn}]},{path:"/audio",name:"audio",component:mn,children:[{path:"new",component:yn},{path:"remove/:id",component:Mn}]},{path:"/copy",name:"copy",component:mn,children:[{path:"new",component:yn},{path:"remove/:id",component:Mn}]},{path:"/media/:id",component:zn,children:[{name:"info",path:"info",component:Pn},{name:"file-list",path:"files",component:Kn,children:[{name:"file-new",path:"new",component:ca},{name:"file-edit",path:":fileId/revise",component:va}]},{name:"link-list",path:"links",component:xa,children:[{name:"link-new",path:"upload",component:Oa},{name:"link-edit",path:":urlId/revise",component:Da}]},{name:"translation-list",path:"translations",component:ni,children:[{name:"translation-new",path:"upload",component:La},{name:"translation-edit",path:":translationId/revise",component:Za}]},{name:"sharing-list",path:"sharing",component:gi,children:[{name:"sharing-new",path:"new",component:_i},{name:"sharing-new-file",path:"new/:fileId",component:_i},{name:"sharing-new-url",path:"new/:urlId",component:_i},{name:"sharing-new-translation",path:"new/:translationId",component:_i},{name:"sharing-edit",path:":endpointId/revise",component:Fi}]}]}]}),qo=r("2f62"),zo=r("b383"),Ho=r.n(zo),Xo="asea.token",Yo={username:void 0,token:void 0,isAuthenticated:!1,isPasswordReset:!1},Zo={login:function(e,t){var r=t.username,n=t.password;return c["b"](this,void 0,void 0,(function(){var t,a,i,o;return c["e"](this,(function(s){switch(s.label){case 0:return[4,v.a.post("https://api.medialibrary.aseaglobal.com/token",Ho.a.stringify({username:r,password:n,grant_type:"password",scope:"openid"}))];case 1:return t=s.sent(),a=t.data.access_token,i=t.data.expires_in,o=new Date(Date.now()+1e3*i).getTime(),localStorage.setItem("asea.token.expiration",o.toString()),e.commit("loginSuccess",{username:r,token:a}),Go.push("/documents"),[2]}}))}))},loginWithToken:function(e,t){var r=t.username,n=t.token;e.commit("loginSuccess",{username:r,token:n});var a=window.location.href;a.includes("password/reset/")?Yo.isPasswordReset=!1:Go.push("/documents")},logout:function(e){e.commit("logout"),Go.push("/login")}},Wo={isAuthenticated:function(e){return!0===e.isAuthenticated},username:function(e){return e.username}},Qo={loginSuccess:function(e,t){e.username=t.username,e.token=t.token,e.isAuthenticated=!0,localStorage.setItem(Xo,t.token),localStorage.setItem("asea.user.name",t.username),v.a.defaults.headers.common.Authorization="Bearer "+t.token},logout:function(e){e.username=void 0,e.token=void 0,e.isAuthenticated=!1,e.isPasswordReset=!1,v.a.defaults.headers.common.Authorization=null}},Ko={namespaced:!0,state:Yo,getters:Wo,actions:Zo,mutations:Qo};(function(e){e[e["Success"]=0]="Success",e[e["Warning"]=1]="Warning",e[e["Error"]=2]="Error",e[e["Info"]=3]="Info"})(Lo||(Lo={}));var es={type:"success",message:""},ts={showMessage:function(e,t){e.commit("setMessage",t)}},rs={message:function(e){return e.message}},ns={setMessage:function(e,t){e.type=t.color,e.message=t.message}},as={namespaced:!0,state:es,getters:rs,actions:ts,mutations:ns},is={showNavigationBar:"true"===localStorage.getItem("asea.user.showNav")},os={toggleNavigationBar:function(e){e.commit("setShowNavigationBar")}},ss={showNavigationBar:function(e){return e.showNavigationBar}},cs={setShowNavigationBar:function(e){e.showNavigationBar=!e.showNavigationBar}},ls={namespaced:!0,state:is,getters:ss,actions:os,mutations:cs},us={thumbnails:new Map},ds={loadThumbnail:function(e,t){return c["b"](this,void 0,void 0,(function(){var r,n,a;return c["e"](this,(function(i){switch(i.label){case 0:return us.thumbnails.has(t)?[2]:(r=new f,[4,r.thumbnails(t)]);case 1:return n=i.sent(),n&&n.data&&(a=URL.createObjectURL(n.data),e.commit("setThumbnail",{id:t,objectUrl:a})),[2]}}))}))}},ps={thumbnails:function(e){return e.thumbnails},getThumbnail:function(e){return function(t){return e.thumbnails.get(t)}}},hs={setThumbnail:function(e,t){e.thumbnails.set(t.id,t.objectUrl)}},ms={namespaced:!0,state:us,getters:ps,actions:ds,mutations:hs},vs={mediaResources:null,mediaResourceCount:0,mediaType:null,term:null,page:void 0,pageSize:void 0},fs={updateActiveSearch:function(e,t){e.commit("setActiveSearch",t)}},bs={activeSearch:function(e){return{mediaResources:e.mediaResources,mediaResourceCount:e.mediaResourceCount,mediaType:e.mediaType,term:e.term,page:e.page,pageSize:e.pageSize}},mediaResources:function(e){return e.mediaResources},mediaType:function(e){return e.mediaType},term:function(e){return e.term},page:function(e){return e.page},pageSize:function(e){return e.pageSize}},As={setActiveSearch:function(e,t){e.mediaResources=t.mediaResources,e.mediaResourceCount=t.mediaResourceCount,e.mediaType=t.mediaType,e.term=t.term,e.page=t.page,e.pageSize=t.pageSize}},gs={namespaced:!0,state:vs,getters:bs,actions:fs,mutations:As};n["a"].use(qo["a"]);var ws={state:{version:"1.0.0"},modules:{auth:Ko,notification:as,app:ls,thumbnail:ms,search:gs}},ys=new qo["a"].Store(ws),xs=(r("0808"),r("6944")),js=r.n(xs);n["a"].use(js.a),n["a"].config.productionTip=!1,n["a"].filter("formatSize",(function(e){return e>1099511627776?(e/1024/1024/1024/1024).toFixed(2)+" TB":e>1073741824?(e/1024/1024/1024).toFixed(2)+" GB":e>1048576?(e/1024/1024).toFixed(2)+" MB":e>1024?(e/1024).toFixed(2)+" KB":e.toString()+" B"})),n["a"].use(r("ce04")),n["a"].prototype.moment=ji.a,n["a"].use(r("2ead"),{moment:r("7f45")}),v.a.interceptors.response.use((function(e){return e}),(function(e){return e.response.status,e}));new n["a"]({store:ys,router:Go,render:function(e){return e(ot)}}).$mount("#app")},cf05:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaIAAAB8CAMAAAAclkS2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMAUExURQAAAAZxuTV9vk+Iw2STx3aezIWn0ZOx1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/39Y8AAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAKi0lEQVR4Xu2c62LcKAxGN2mTvP8Td8fymRmwAV3A2Nv1+TWRQRrrAxk5af/5c3Nxbokuzy3R5bklujy3RJfnlujy3BJdnluiyxOW6PcXH25MfP3ig5uwRB8ffLgxEc9XVKKfj49vPt4YeOQrWnaiEn084OMRfP9eAiR8/XDlP8pyD3z00iPRQVn7+VycF/gM7tsv5kfBTReLn2C+ghJJFj/5YSg1fSCi0gUkWu+KH5wEJZKI4yvdo2Kr+E9GF5Cox1FMol9ryPA5soxFoAXv7j1fIp6ssbITk2iNOHgbKSUuxbc2zpcIRzFPIYle9/wbwwCsWwg8z6TTJfrGUazshCQi4AMM/WwP2SqOonG6RPh5gMFFRKJkwY9qXx1F7gVTdc6WKMlXpH2NSEQ4AVMnEYXsfcbZEqV3h8lDr0RD2lcOiDt+fT1olEBj8LMlwo0QyFdAomzJj2hfSyJsDyLlNNtu+GSJ8gWI0UFAImIBxh7w9KZ88HmdixJMGiUSDTyCmiE0YHTgl2hTlfrbVxy9aHjcP7O40CSR6IRfcm1qhL/s+CUi1AvMYTZlSLmFnUjYW5wrEZFfYLbjlmhX2HtrB25A9baNb1iVp0q0K8/usuOWiEAJXAiSp9yiN0Of6I+jUyUicAIXzHglKryn6WtfcbJi25FZsTMk/UyJCvnyfgevRITJ4FIMfAjWR2mikeVId6ZE+wOOO18jJAq0Yy+y8w42ndeNew/d0yUiboYzX06JSouiaxvhQXDkjxn8pHCiROX3Jlw04pSIGBu4GAEPAiYTngknSkTYDVw04pOo8jKt4y0QHhZcXpbHMB9VzpMoiZziy5dPIkLs4HIAHCz4SvRv+32eJxFRd3DZhkuiyqLoeAuUesQ0ntMkKpy4V1z5cklEAOEz04sBbv5uiQi6Es6XR6JsUfxkXyB66/8fifJ8ed6aeSTC/Uq0pcn5qyXKOpT8Xj03G5VoeevDRyHYvv7VEhFTWALzUXC8NXNItFkUmyO4DHGTvgfGNJ6TJNqlJ5gvh0T4FtZayg+CGPwwe6H/l4MVTpKIkMJ6b/wg2MuOXaLCGkj3VbB9ZbaAaTjnSJTW8K582SXCtfBc8PwoYHLCZOGobXSOREQUnnrwo4BJxyxRYVGMSHD2gAueOTROkSjrULDF8mWWCMfCa5MWv4eLvAE/RqNTJCLgCrZYvqwSbdrWJxiE2O0zGQ7R6HSJyvmytq9WiXC7gu1Bsfy52Lw8P+J5dIZEuw5lJZKviERp24VJiG0BJr8Y9Zf8b86QiHhCGhSTYLxTo0SVRTGifd1sowejq90JElXTEnhrZpQIn0J+mxgFTE6YnOJ5y6hzgkSEE/LajVGwrUWbRI29Mrh9fTGw3s2XqPHISVNpy5dNIlwK2wc6ZgGTk+yGEkapNF8ioglbHTALmNqYJGosirZ8Rkr/emVlSMWbLlGz/UnLjilfJolwKOw2Z3/72tLoEbD79DBdIoKtYHvhzpdFIsUpF4RoCrIQe/pKXq2QGsGLAyYK+wXGBcFSJSwSVU/cK80yaCYLUqCj5M2WSMlX9m8lsLWwSIQ3oVR1uCTEq5KeyKhKsyVinlAqK1wSDGXHIJHanaoDjGR+yoRWwGSJ1HQ421eDRPgSyqJzUcAUwyBSYCtNlohpQvnIxkVBX3S6RAbNB7SvTwzpdJ/s50qURcO2wVd2dInwJNSyw2UBUxx9Kzl30lyJmCXU1iuXBUx1VIlM5w8uC8H2NaX6/zq+cD2TpkpkantcZUeVCEdC1duI9nWDspc89XSqRExawbbDlS9NIqMzBgjDOvh2ahlk4DSJ6nudAYJWdjSJlDbsSZYFbCP4aWwmc7GbKZExX572VZMIL0IrJwwRXA8KnWqGrXESBx3vKGwQR2iVE4YIStlRJDIfD33nSC+7/19ixahRItGwIlzBnAZH+6pIhA+hfXsMEjANpbiXuKYwUSLCCO1nDIOE9lJrS+TQemD7WqNwFOdKm3kSZesIWwV72WlLhAdBO3gwTMA0nJ1IpmfLPImIImjrlGECpjJNiVzHd4YJA9rXCgR4gbnJNIlc+TKXnaZEOBDU4nVA+1pi8wtaS02dJhFBVrDVYZyAqYhZIv0XnwwUDkxFthRMi+EUifTTJgOFVtlpSVR4PBdgsOtZ2UWukaGmzpIoyxe23bavwOASLYmYrfBeLhgEa1sZIdcIY4NZEhFDeAfCoND4Yg2JGu9eUt5Pg2Pb1wRHL7AwSaLyt6p03TsYXqAhEXNVGP4Ag4DpGIgh6FmfJBEhhHczgEGlXnbqEmWPlhbvbWQ+R/aSfTdsdeZIVH4zujncNGDCnrpEzDTAhAcYBEzHQAwBU505EhFBeJ9hMBhgwp6qRHb5K1/ouPb1QbpfMdWZIlGWL2wPMBiolp2qREw0wZTq9xxPWukw1ZkiUbnI2/qWFabsGCLR+8YxCAcWlSwQljpTJCKAUO5DNGplpyaRR/4kS+nqPnQbEWIBS50ZEpUbDmPfAkzaUpOIWUbmt6+EWMBSZ4ZE+Bfe78owGKl8uYpE4S50VvtKhAUsdSZI5Gym3xjKTkUi5gi+22KScOA2IsICljoTJMK94Pv7CCYJ5XyVJTJoW8PfvoaEJMICljrHS+T5g54NetkpS8QMwdvfME3A1ORRI/jkIF1DmOocLxHeheH5KkrU1d4wTTB83aWK+18WXat17cqXWnaKEjFBcKfP933XL+j+8zaZBZjqHC6Rv7inMFHAlKFKhMkBEwUt98+bc6YuXQa6vIdLhHPB/2RlolAqOyWJ0kURkCh9TijTGfTAd2dMEjA1OFqizkZDKzsliRgtRI5bTBWaf/LAGMGTPOcB6miJ8C305qvwBQsSdXefRgfZ6nE9j5ghGGr/wRI5qkYZxUFBIsYKsVtistBYVox4Yn7QegvxwRLhWjgiX3uJuheF+YSTRVrArpApdL5EXSfulXbZ2UvESMHbhj1huoCpRJ7sB5Zix1Cw1P5jJcKzcEi+dhINWBT2r73TSE35dudhbjJPIkxummVnJxEDBX8bBmadGZLSEmlzwjDm5FCJjEVdAQcCphdNiTAFwIHQrF6MyahN2P9Jmq2wJBI5jo1GcCxgCoADYXtTW4nGLIq8HmErw5gN+1Rmv5F5wjWFbXH0gpsi3R3KSqvsbCVilGB5FNfAhdD+i30GFfj1tbJ/YgEeNDolMleBUfnaVOONRIMWhctRVQEN5qt0SoSXIvZqodBwtJGIMULf/9OHE0FZXsUapmNetH0SNZ93jBH6jiI4EfI7yyUatiicDzXGuWCqgT6JcFJkSIeyUi87uUSMEHoPP7gRMNVxbyTPUaZLomYgxgjRtvUJbgRMK5lEAxdFHtKQUN8TyVVUuiRqllPGCJjCVMtOJhEDhN5F4dfbLpJnCz3okggfRVzFXAVHAiahKhGmDnAk2AS3ieRORo9Eze3KGAFTBzgS0nylEo1dFHlmsGno2Qzs7h6JcFFkWIeyUis7qURcFXrasCe4Euwn+Na/PIwdYTokai4IxggH5isrdJfhO1ugK+PfgP5HuKZENwm3RJfnlujy3BJdnluiy3NLdHluiS7PLdHluSW6PLdEl+eW6OL8+fMv2pVbCfgbQR8AAAAASUVORK5CYII="}}); //# sourceMappingURL=app.57b445fd.js.map