(function(e){function t(t){for(var a,r,o=t[0],l=t[1],c=t[2],u=0,m=[];u-1},filterOption:function(e,t){return t.data.attrs.item.toUpperCase().indexOf(e.toUpperCase())>=0}},mounted:function(){"users"==this.type?this.placeholder="Søg efter brugere":"documents"==this.type?this.placeholder="Søg efter dokumenter":this.folders?this.placeholder="Søg efter mappe":"tasks"==this.type&&(this.placeholder="Søg efter sager"),this.data&&this.data.length&&(this.results=this.data)},watch:{data:function(){this.data.length&&(this.results=this.data)}}}),C=T,S=(s("2023"),Object(f["a"])(C,x,j,!1,null,null,null)),z=S.exports,D={components:{Searcher:z},data:function(){return{collapsed:!1}},computed:{currentpage:function(){return this.$store.state.currentpage}},methods:{logout:function(){this.$store.dispatch("user/logout")},selectSearch:function(e){this.$router.push({name:"SubDocuments",params:{id:e.id}})}}},I=D,U=(s("fc00"),Object(f["a"])(I,w,$,!1,null,null,null)),O=U.exports,F=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"wrapper"},[a("img",{staticClass:"background",attrs:{src:s("c747"),alt:""}}),a("div",{staticClass:"inner"},[a("a-row",{attrs:{type:"flex",justify:"center"}},[a("a-col",{attrs:{xs:20,md:10,lg:8,xl:6}},[a("a-card",{attrs:{title:"Login"}},[a("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[a("a-form-item",{attrs:{label:"Email"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:"Indtast venligst en email",type:"email"}]}],expression:"[\n 'email',\n { rules: [{ required: true, message: 'Indtast venligst en email', type: 'email' }] }\n ]"}],attrs:{placeholder:"Indtast din email"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"mail"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Kodeord"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"Indtast venligst et kodeord"}]}],expression:"[\n 'password',\n { rules: [{ required: true, message: 'Indtast venligst et kodeord' }] }\n ]"}],attrs:{type:"password",placeholder:"Indtast din kode"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),a("a-form-item",[a("a-button",{attrs:{type:"primary",block:"",icon:"login",htmlType:"submit",loading:e.loading}},[e._v("Log in")]),a("a-row",{attrs:{type:"flex",justify:"space-between"}},[a("a-col",[a("router-link",{attrs:{to:{name:"CreateAccount"}}},[e._v("\n Tilmeld din virksomhed\n ")])],1),a("a-col",[a("router-link",{attrs:{to:{name:"ForgotPassword"}}},[e._v("Glemt password?")])],1)],1)],1)],1)],1)],1)],1)],1)])},E=[],A={name:"Login",beforeCreate:function(){this.form=this.$form.createForm(this)},methods:{handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||t.checkCreds()})},checkCreds:function(){var e=this;this.$store.commit("setLoading",!0),this.$axios.post("/auth/login",{email:this.form.getFieldValue("email"),password:this.form.getFieldValue("password")}).then(function(t){if(t.data){var s=t.data;s.token&&(e.$store.dispatch("user/setToken",s.token),e.$axios.defaults.headers.common={Authorization:"bearer ".concat(s.token)},e.$axios.get("/auth/user").then(function(t){var s=t.data.data;e.$store.dispatch("user/setUser",s),e.$notification["success"]({message:"Du er logget ind",description:"Du er klar til at bruge administrationen nu, kontakt endelig supporten hvis du har spørgsmål! :)"}),e.$store.commit("setLoading",!1),e.$router.push("/")}))}}).catch(function(){e.$store.commit("setLoading",!1),e.$notification["error"]({message:"Fejl ved login",description:"Du har indtastet en forkert email eller adgangskode, prøv venligst igen"})})}},computed:{loading:function(){return this.$store.state.loading}}},q=A,N=(s("969c"),Object(f["a"])(q,F,E,!1,null,"94e392f0",null)),M=N.exports,P=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"wrapper"},[a("img",{staticClass:"background",attrs:{src:s("c747"),alt:""}}),a("div",{staticClass:"inner"},[a("a-row",{attrs:{type:"flex",justify:"center"}},[a("a-col",{attrs:{xs:20,md:10,lg:8,xl:6}},[a("a-card",{attrs:{title:"Glemt kodeord"}},[a("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[a("a-form-item",{attrs:{label:"Email"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:"Indtast venligst en email",type:"email"}]}],expression:"[\n 'email',\n { rules: [{ required: true, message: 'Indtast venligst en email', type: 'email' }] }\n ]"}],attrs:{placeholder:"Indtast din email"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),a("p",[e._v("Indtast din email, så sender vi et link hvor du kan lave et nyt kodeord")]),a("a-form-item",[a("a-button",{attrs:{type:"primary",block:"",icon:"login",htmlType:"submit",loading:e.loading}},[e._v("Send")])],1)],1)],1)],1)],1)],1)])},R=[],L={name:"Login",data:function(){return{loading:!1}},beforeCreate:function(){this.form=this.$form.createForm(this)},methods:{handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||t.sendPasswordReset()})},sendPasswordReset:function(){var e=this;this.loading=!0,this.$axios.post("/password/forgot",{email:this.form.getFieldValue("email")}).then(function(){e.$notification["success"]({message:"Email sendt",description:"Vi har sendt en mail til "+e.form.getFieldValue("email")+" med et link til at resette dit password."}),e.loading=!1,e.$router.push({name:"Login"})}).catch(function(){e.loading=!1,e.$notification["error"]({message:"Email blev ikke fundet",description:"Vi kunne ikke finde en bruger med den angivne email"})})}}},V=L,K=(s("4ab8"),Object(f["a"])(V,P,R,!1,null,"b259ffb6",null)),B=K.exports,G=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"wrapper"},[a("img",{staticClass:"background",attrs:{src:s("c747"),alt:""}}),a("div",{staticClass:"inner"},[a("a-row",{attrs:{type:"flex",justify:"center"}},[a("a-col",{attrs:{xs:20,md:10,lg:8,xl:6}},[a("a-card",{attrs:{title:"Opret en ny konto"}},[a("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[a("a-form-item",{attrs:{label:"Firmanavn"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["companyName",{rules:[{required:!0,message:"Indtast venligst et firmanavn"}]}],expression:"[\n 'companyName',\n { rules: [{ required: true, message: 'Indtast venligst et firmanavn' }] }\n ]"}],attrs:{placeholder:"Indtast et firmanavn"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Dit navn"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["userName",{rules:[{required:!0,message:"Indtast venligst dit navn"}]}],expression:"[\n 'userName',\n { rules: [{ required: true, message: 'Indtast venligst dit navn' }] }\n ]"}],attrs:{placeholder:"Indtast dit navn"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Email"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:"Indtast venligst en email",type:"email"}]}],expression:"[\n 'email',\n { rules: [{ required: true, message: 'Indtast venligst en email', type: 'email' }] }\n ]"}],attrs:{placeholder:"Indtast din email"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"mail"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Kodeord"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"Indtast venligst et kodeord på mindst 8 karakterer",type:"string",min:8}]}],expression:"[\n 'password',\n { rules: [{ required: true, message: 'Indtast venligst et kodeord på mindst 8 karakterer', type: 'string', min: 8 }] }\n ]"}],attrs:{type:"password",placeholder:"Indtast din kode"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),a("a-form-item",[a("a-button",{attrs:{type:"primary",block:"",icon:"login",htmlType:"submit",loading:e.loading}},[e._v("Opret")]),a("div",{staticClass:"text-center"},[a("router-link",{attrs:{to:{name:"Login"}}},[e._v("Jeg er allerede oprettet")])],1)],1)],1)],1)],1)],1)],1)])},H=[],J=s("a4bb"),Y=s.n(J),Q={name:"CreateAccount",data:function(){return{email:"",password:"",companyName:"",userName:"",loading:!1}},beforeCreate:function(){this.form=this.$form.createForm(this)},methods:{handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||t.createAccount()})},createAccount:function(){var e=this;this.loading=!0,this.$axios.post("/newOrganization",{email:this.form.getFieldValue("email"),companyName:this.form.getFieldValue("companyName"),userName:this.form.getFieldValue("userName"),password:this.form.getFieldValue("password")}).then(function(){e.$notification["success"]({message:"Success! Du er nu oprettet",description:"Vi har sendt en mail til "+e.email+" med en bekræftelse, du kan logge ind med det samme."}),e.loading=!1,fbq("track","CompleteRegistration"),ga("send","event","SignUp","Create",e.companyName+" oprettet"),e.$router.push({name:"Login"})}).catch(function(t){if(t.response){var s=Y()(t.response.data)[0];e.$notification["error"]({message:s.charAt(0).toUpperCase()+s.slice(1),description:t.response.data[s]})}e.loading=!1})}}},W=Q,X=(s("632a"),Object(f["a"])(W,G,H,!1,null,"18d4067c",null)),Z=X.exports,ee=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{staticClass:"wrapper"},[a("img",{staticClass:"background",attrs:{src:s("c747"),alt:""}}),a("div",{staticClass:"inner"},[a("a-row",{attrs:{type:"flex",justify:"center"}},[a("a-col",{attrs:{xs:20,md:10,lg:8,xl:6}},[a("a-card",{attrs:{title:"Nyt kodeord"}},[a("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[a("a-form-item",{attrs:{label:"Email"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:"Indtast venligst en email",type:"email"}]}],expression:"[\n 'email',\n { rules: [{ required: true, message: 'Indtast venligst en email', type: 'email' }] }\n ]"}],attrs:{placeholder:"Indtast din email"},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Kodeord"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"Indtast venligst et kodeord på mindst 8 karakterer",type:"string",min:8}]}],expression:"[\n 'password',\n { rules: [{ required: true, message: 'Indtast venligst et kodeord på mindst 8 karakterer', type: 'string', min: 8 }] }\n ]"}],attrs:{type:"password",placeholder:"Indtast et nyt kodeord"},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),a("a-form-item",{attrs:{label:"Gentag kodeord"}},[a("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["resetPassword",{rules:[{required:!0,message:"Dine kodeord skal matche"},{validator:e.compareToFirstPassword}]}],expression:"[\n 'resetPassword',\n {\n rules: [{\n required: true, message: 'Dine kodeord skal matche',\n }, {\n validator: compareToFirstPassword,\n }],\n }\n ]"}],attrs:{type:"password",placeholder:"Gentag kodeord"},model:{value:e.resetPassword,callback:function(t){e.resetPassword=t},expression:"resetPassword"}},[a("a-icon",{staticStyle:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),a("a-form-item",[a("a-button",{attrs:{type:"primary",block:"",icon:"login",htmlType:"submit",loading:e.loading}},[e._v("Anvend nyt kodeord")])],1)],1)],1)],1)],1)],1)])},te=[],se={name:"ResetPassword",data:function(){return{email:"",password:"",resetPassword:"",loading:!1}},beforeCreate:function(){this.form=this.$form.createForm(this)},methods:{handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||t.sendPasswordReset()})},compareToFirstPassword:function(e,t,s){var a=this.form;t&&t!==a.getFieldValue("password")?s("De to passwords mathcer ikke"):s()},sendPasswordReset:function(){var e=this;this.loading=!0,this.$axios.post("/password/reset/"+this.$route.params.token,{email:this.email,password:this.password,password_confirmation:this.resetPassword}).then(function(){e.$notification["success"]({message:"Dit kodeord er ændret!",description:"Du kan nu logge ind med det nye kodeord"}),e.loading=!1,e.$router.push({name:"Login"})}).catch(function(t){e.loading=!1,e.$notification["error"]({message:"Der skete en fejl :(",description:t.response.data.data.message})})}}},ae=se,ne=(s("958c"),Object(f["a"])(ae,ee,te,!1,null,"5f7d3891",null)),ie=ne.exports,re=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container"},[a("img",{staticClass:"logo",attrs:{src:s("cf05"),alt:""}}),a("h1",[e._v("Denne side blev ikke fundet!")]),a("router-link",{attrs:{to:"/"}},[e._v("Gå til administrationen")])],1)},oe=[],le={name:"NotFound"},ce=le,de=(s("812f"),Object(f["a"])(ce,re,oe,!1,null,"799a5a53",null)),ue=de.exports,me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("a-layout",{attrs:{id:"layout"}},[a("a-layout-header",{staticClass:"header hidden-print"},[a("a-row",{attrs:{type:"flex",justify:"space-between"}},[a("a-col",[a("img",{staticClass:"logo",attrs:{src:s("cf05"),alt:""}})])],1)],1),a("a-layout",[a("a-layout-content",{staticClass:"content"},[e.document?a("div",["folder"==e.document.type?a("Folder",{ref:"folderComponent",attrs:{folder:e.document,shared:""}}):e._e(),"file"==e.document.type?a("File",{attrs:{file:e.document,shared:""}}):e._e(),"document"==e.document.type?a("Document",{attrs:{document:e.document,shared:""}}):e._e()],1):a("div",[a("Loading",{attrs:{text:"Henter dokumenter..."}})],1)])],1)],1)],1)},pe=[],fe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"spacing--bottom"},[s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[e.document.parent_folder_id?s("router-link",{attrs:{to:{name:e.shared?"SharedFolder":"SubDocuments",params:{id:e.document.parent_folder_id}}}},[s("a-button",[s("a-icon",{attrs:{type:"left"}}),e._v("\n Tilbage\n ")],1)],1):e._e()],1),e.shared?e._e():s("a-col",[!e.isEditingText&&e.$store.state.user.details.is_admin?s("a-button",{staticClass:"spacing--sm-left",attrs:{type:"primary",icon:"edit"},on:{click:function(t){e.setEditingText(!0)}}},[e._v("\n Rediger dokument\n ")]):e._e(),e.isEditingText&&e.$store.state.user.details.is_admin?s("a-button",{attrs:{type:"primary",icon:"save"},on:{click:e.saveDocumentEdit}},[e._v("\n Gem\n ")]):e._e()],1)],1)],1),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.isEditingText&&e.document.html_content,expression:"!isEditingText && document.html_content"}]},[s("div",{staticClass:"document",domProps:{innerHTML:e._s(e.document.html_content)}})]),s("a-alert",{directives:[{name:"show",rawName:"v-show",value:!e.document.html_content&&!e.isEditingText,expression:"!document.html_content && !isEditingText"}],staticClass:"spacing--bottom",attrs:{type:"info",showIcon:""}},[s("span",{attrs:{slot:"message"},slot:"message"},[e._v("Dette dokument er tomt, rediger for at tilføje indhold")])]),e.$store.state.user.details.is_admin?s("div",{directives:[{name:"show",rawName:"v-show",value:e.isEditingText,expression:"isEditingText"}]},[s("vue-editor",{staticClass:"editor",model:{value:e.editText,callback:function(t){e.editText=t},expression:"editText"}})],1):e._e()],1)},ge=[],he=s("b3e9"),ve={name:"Document",props:{document:{type:Object,required:!0},shared:{type:Boolean,default:!1}},components:{VueEditor:he["VueEditor"]},data:function(){return{fileEntry:{},fileUrl:"",editText:"",isEditingText:!1,config:{}}},mounted:function(){this.$route.query.edit&&(this.isEditingText=!0)},methods:{setEditingText:function(e){this.isEditingText=e,this.isEditingText&&(this.editText=this.document.html_content)},saveDocumentEdit:function(){var e=this;this.editText!=this.document.html_content?this.$axios.patch("/documents/"+this.document.id,{html_content:this.editText}).then(function(){e.document.html_content=e.editText,e.isEditingText=!1}):this.isEditingText=!1}}},_e=ve,be=(s("de8c"),Object(f["a"])(_e,fe,ge,!1,null,"3b7fd4d0",null)),ke=be.exports,ye=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.shared?s("div",[s("Loading",{attrs:{text:"Vent et øjeblik, imens vi indlæser din fil..."}})],1):s("div",[s("div",{staticClass:"spacing--bottom"},[s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[e.file.parent_folder_id?s("router-link",{attrs:{to:{name:e.shared?"SharedFolder":"SubDocuments",params:{id:e.file.parent_folder_id}}}},[s("a-button",[s("a-icon",{attrs:{type:"left"}}),e._v("\n Tilbage\n ")],1)],1):e._e()],1),s("a-col",[s("a-button",{attrs:{type:"primary"},on:{click:function(t){e.downloadFile()}}},[s("a-icon",{attrs:{type:"download"}}),e._v("\n Download\n ")],1)],1)],1)],1),"application/pdf"!=e.file.file_entry.mime?s("div",[s("img",{staticStyle:{"max-width":"100%"},attrs:{src:e.file.file_entry.url}})]):e._e(),"application/pdf"==e.file.file_entry.mime?s("div",[s("embed",{staticStyle:{width:"100%",height:"800px"},attrs:{src:e.file.file_entry.url,type:"application/pdf"}})]):e._e()])])},we=[],$e=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"loading"},[s("a-icon",{staticClass:"loading__icon",attrs:{type:"loading"}}),e.text?s("div",[e._v("\n "+e._s(e.text)+"\n ")]):e._e()],1)},xe=[],je={name:"Loading",props:{text:{type:String,default:null}}},Te=je,Ce=(s("d956"),Object(f["a"])(Te,$e,xe,!1,null,"55e25b54",null)),Se=Ce.exports,ze={name:"File",components:{Loading:Se},props:{file:{type:Object,required:!0},shared:{type:Boolean,default:!1}},data:function(){return{apiUrl:"",loading:!1}},methods:{getFile:function(){this.shared&&window.location.replace(this.file.file_entry.url)},downloadFile:function(){window.open(this.apiUrl+"/fileEntries/"+this.file.file_entry_id+"/getImage?token="+this.$store.state.user.token)}},mounted:function(){this.apiUrl="https://api.timero.dk/api",this.getFile()}},De=ze,Ie=Object(f["a"])(De,ye,we,!1,null,null,null),Ue=Ie.exports,Oe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"spacing--bottom"},e._l(e.invitations,function(t){return s("div",{key:t.id,staticClass:"invite"},[s("div",[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Ved at acceptere denne invitation, vil du og dine medarbejdere få adgang til mappen")]),s("a-button",{staticClass:"invite__icon",attrs:{type:"primary",shape:"circle",size:"small",icon:"exclamation"}})],2),e._v("\n "+e._s(t.from_user.name)+" ("+e._s(t.from_user.email)+") ønsker at dele mappen\n "),s("strong",[e._v(e._s(t.folder.name))])],1),s("a-button-group",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Afvis")]),s("a-button",{attrs:{icon:"close",type:"danger"},on:{click:function(s){e.declineInvitation(t.id)}}})],2),s("a-tooltip",[s("template",{slot:"title"},[e._v("Accepter")]),s("a-button",{attrs:{icon:"check",type:"primary"},on:{click:function(s){e.acceptInvitation(t.id)}}})],2)],1)],1)}),0),s("a-row",{staticClass:"spacing--bottom",attrs:{justify:"space-between",type:"flex"}},[s("a-col",[e.hasBackButton?s("router-link",{attrs:{to:{name:e.shared?"SharedFolder":"SubDocuments",params:{id:e.folder.parent_folder_id}}}},[s("a-button",{attrs:{icon:"left"}},[e._v("Tilbage")])],1):e._e(),e.shared||e.folder.is_root||e.selectedRows.length||e.$store.state.user.details.organization.id!=e.folder.organization_id?e._e():s("a-button",{staticClass:"spacing--sm-left",attrs:{icon:"share-alt"},on:{click:function(t){e.$refs.shareFolder.showModal()}}},[e._v("Del mappe")])],1),e.$store.state.user.details.is_admin&&!e.shared?s("a-col",[e.selectedRows.length?s("div",[s("a-popconfirm",{attrs:{placement:"right",okText:"Ja",cancelText:"Nej"},on:{confirm:function(t){e.deleteRows()}}},[s("template",{slot:"title"},[e._v("Vil du virkelig slette "+e._s(e.selectedRows.length)+" elementer? Denne handling kan ikke fortrydes")]),s("a-button",[s("a-icon",{attrs:{type:"delete"}}),e._v("\n Slet ("+e._s(e.selectedRows.length)+")\n ")],1)],2),s("a-button",{staticClass:"spacing--sm-left",on:{click:function(t){e.$refs.moveContent.showModal()}}},[s("a-icon",{attrs:{type:"enter"}}),e._v("\n Flyt ("+e._s(e.selectedRows.length)+")\n ")],1)],1):s("div",[e.$store.state.user.details.organization.id==e.folder.organization_id?s("div",[s("a-button",{attrs:{type:"primary"},on:{click:function(t){e.$refs.newFolder.showModal()}}},[s("a-icon",{attrs:{type:"plus"}}),e._v("Ny mappe\n ")],1),s("a-button",{staticClass:"spacing--sm-left",attrs:{type:"primary"},on:{click:function(t){e.$refs.newDocument.showModal()}}},[s("a-icon",{attrs:{type:"plus"}}),e._v("Nyt dokument\n ")],1),s("a-button",{staticClass:"spacing--sm-left",attrs:{type:"primary"},on:{click:function(t){e.$refs.uploadContent.showModal()}}},[s("a-icon",{attrs:{type:"upload"}}),e._v("Upload fil\n ")],1)],1):e._e()])]):e._e()],1),e.$store.state.user.details.is_admin&&!e.shared&&e.$store.state.user.details.organization.id==e.folder.organization_id?s("div",[s("create-content",{ref:"newFolder",attrs:{title:"Ny mappe",type:"folder","parent-id":e.folder.id}}),s("create-content",{ref:"newDocument",attrs:{title:"Nyt dokument",type:"document","parent-id":e.folder.id}}),s("upload-content",{ref:"uploadContent",attrs:{"parent-id":e.folder.id}}),s("share-folder",{ref:"shareFolder",attrs:{folder:e.folder},on:{shared:e.setShared}}),s("move-content",{ref:"moveContent",attrs:{items:e.selectedRows}}),e.folder.is_shared&&!e.folder.shared_with.length?s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",type:"info",message:"Denne mappe er delt offentlig"}}):e._e(),e.folder.shared_with.length&&!e.folder.is_shared?s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",type:"info",message:"Denne mappe er delt med virksomheder"}}):e._e(),e.folder.shared_with.length&&e.folder.is_shared?s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",type:"info",message:"Denne mappe er delt offentligt og med virksomheder"}}):e._e()],1):e._e(),e.sortedContent.length?s("a-table",{attrs:{size:"small",pagination:e.pagination,columns:e.columns,rowKey:"id",dataSource:e.sortedContent,loading:e.loading,rowSelection:e.shared?null:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{},[s("router-link",{attrs:{to:{name:e.shared?"SharedFolder":"SubDocuments",params:{id:t.id}}}},[s("div",{staticClass:"folder-icon"},["folder"==t.type?s("a-icon",{attrs:{type:"folder"}}):e._e(),"file"==t.type?s("a-icon",{attrs:{type:"file"}}):e._e(),"document"==t.type?s("a-icon",{attrs:{type:"file-text"}}):e._e()],1),"folder"==t.type?s("strong",[e._v(e._s(t.name))]):e._e(),"folder"!=t.type?s("span",[e._v(e._s(t.name))]):e._e()])],1)}},{key:"created_at",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t.created_at)))])}},{key:"content",fn:function(t){return e.shared?e._e():s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",["folder"==t.type?s("div",[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal mapper i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"folder"}}),e._v("\n "+e._s(t.folders_count)+"\n ")],1)],2),s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal filer i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"file"}}),e._v("\n "+e._s(t.files_count)+"\n ")],1)],2),s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal dokumenter i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"file-text"}}),e._v("\n "+e._s(t.documents_count)+"\n ")],1)],2)],1):e._e()])],1)],1)}}])}):s("a-alert",{attrs:{showIcon:"",message:"Der er intet indhold i denne mappe",type:"info"}}),e.folder.parent_folder_id?e._e():s("div",[s("h2",{staticClass:"subtitle spacing--top"},[e._v("\n Mapper delt med dig\n ")]),e.sortedSharedContent.length?s("a-table",{attrs:{size:"small",pagination:e.pagination,columns:e.columns,rowKey:"id",dataSource:e.sortedSharedContent,loading:e.loading,rowSelection:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{},[s("router-link",{attrs:{to:{name:"SubDocuments",params:{id:t.id}}}},[s("div",{staticClass:"folder-icon"},["folder"==t.type?s("a-icon",{attrs:{type:"folder"}}):e._e(),"file"==t.type?s("a-icon",{attrs:{type:"file"}}):e._e(),"document"==t.type?s("a-icon",{attrs:{type:"file-text"}}):e._e()],1),"folder"==t.type?s("strong",[e._v(e._s(t.name))]):e._e(),"folder"!=t.type?s("span",[e._v(e._s(t.name))]):e._e()])],1)}},{key:"created_at",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t.created_at)))])}},{key:"content",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",["folder"==t.type?s("div",[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal mapper i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"folder"}}),e._v("\n "+e._s(t.folders_count)+"\n ")],1)],2),s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal filer i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"file"}}),e._v("\n "+e._s(t.files_count)+"\n ")],1)],2),s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Antal dokumenter i denne mappe")])]),s("a-tag",[s("a-icon",{attrs:{type:"file-text"}}),e._v("\n "+e._s(t.documents_count)+"\n ")],1)],2)],1):e._e()])],1)],1)}}])}):s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",message:"Du har intet delt indhold",type:"info"}})],1)],1)},Fe=[],Ee=(s("55dd"),s("7f7f"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:e.title,footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Navn"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"Indtast venligst et navn"}]}],expression:"['name', { rules: [{ required: true, message: 'Indtast venligst et navn' }] }]"}],attrs:{"auto-focus":"",placeholder:"Indtast navn"}})],1),s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Opret")])],1)],1)],1)}),Ae=[],qe={name:"CreateContent",data:function(){return{loading:!1,visible:!1}},props:{title:{type:String,required:!0},parentId:{type:Number,required:!0},type:{type:String,required:!0}},methods:{showModal:function(){var e=this;this.visible=!0,setTimeout(function(){e.form.setFieldsValue({name:e.itemName})})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||(t.loading=!0,t.$axios.post("/documents",{name:t.form.getFieldValue("name"),parent_folder_id:t.parentId,type:t.type}).then(function(e){t.visible=!1,"folder"==t.type?t.$parent.$parent.getContent():"document"==t.type&&t.$router.push({name:"Documents",params:{id:e.data.document.id},query:{edit:!0}}),t.$notification["success"]({message:"Success!",description:t.form.getFieldValue("name")+" er nu opdateret!"}),t.loading=!1}))})}},beforeCreate:function(){this.form=this.$form.createForm(this)}},Ne=qe,Me=Object(f["a"])(Ne,Ee,Ae,!1,null,null,null),Pe=Me.exports,Re=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Upload filer",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-upload-dragger",{attrs:{name:"file",multiple:!0,accept:".jpg, .jpeg, .png, .pdf",fileList:e.fileList,remove:e.handleRemove,beforeUpload:e.beforeUpload}},[s("p",{staticClass:"ant-upload-drag-icon"},[s("a-icon",{attrs:{type:"inbox"}})],1),s("p",{staticClass:"ant-upload-text"},[e._v("Klik eller træk filer her, for at tilføje til upload")]),s("p",{staticClass:"ant-upload-hint"},[e._v("Filerne må max være 8MB pr. stk.")]),s("p",{staticClass:"ant-upload-hint"},[e._v("De tillade filtyper er: JPEG, JPG, PNG og PDF.")])]),s("div",{staticClass:"spacing--top"},[s("a-button",{attrs:{disabled:!e.fileList.length,type:"primary",loading:e.uploading},on:{click:e.handleUpload}},[e._v(e._s(e.uploading?"Uploader":"Start Upload"))])],1)],1)],1)},Le=[],Ve=(s("ac6a"),s("75fc")),Ke={name:"UploadContent",data:function(){return{name:"",visible:!1,fileList:[],uploading:!1}},props:{parentId:{type:Number,required:!0}},methods:{showModal:function(){this.fileList=[],this.visible=!0},hideModal:function(){this.visible=!1},handleRemove:function(e){var t=this.fileList.indexOf(e),s=this.fileList.slice();s.splice(t,1),this.fileList=s},beforeUpload:function(e){return this.fileList=[].concat(Object(Ve["a"])(this.fileList),[e]),!1},handleUpload:function(){var e=this,t=new FormData;t.append("parent_folder_id",this.parentId),this.fileList.forEach(function(e,s){t.append("file["+s+"]",e)}),this.uploading=!0,this.$axios.post("/fileEntries",t).then(function(){e.fileList=[],e.$notification["success"]({message:"Success!",description:e.name+" er nu opdateret!"}),e.uploading=!1,e.visible=!1,e.$parent.$parent.getContent()})},handleSubmit:function(){var e=this;this.$axios.post("/documents",{name:this.name,parent_folder_id:this.$route.params.id,type:this.type}).then(function(){e.visible=!1,e.$notification["success"]({message:"Success!",description:e.name+" er nu opdateret!"})})}}},Be=Ke,Ge=Object(f["a"])(Be,Re,Le,!1,null,null,null),He=Ge.exports,Je=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Del mappe",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-tabs",{attrs:{defaultActiveKey:"1"}},[s("a-tab-pane",{key:"1",attrs:{tab:"Offentligt"}},[e.folder.is_shared?s("div",[s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{type:"info",message:"Denne mappe er delt offentligt, alle med QR koden eller linket'et kan tilgå mappen",showIcon:""}}),s("a-row",{staticClass:"spacing--sm-bottom",attrs:{type:"flex",gutter:16}},[s("a-col",{attrs:{span:8}},[s("img",{staticClass:"img-responsive spacing--sm-bottom",attrs:{src:"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data="+e.shareLink,alt:"QR Kode til deling"}})]),s("a-col",{attrs:{span:16}},[s("a",{attrs:{href:e.downloadLink,download:""}},[s("a-button",{staticClass:"spacing--sm-bottom",attrs:{icon:"download"}},[e._v("Download QR kode")])],1)])],1),s("a-row",{staticClass:"spacing--sm-bottom",attrs:{type:"flex"}},[s("a-col",{attrs:{span:18}},[s("a-input",{attrs:{addonBefore:"Link",defaultValue:e.shareLink,readOnly:"",size:"large"}})],1),s("a-col",{attrs:{span:6}},[s("a-button",{attrs:{size:"large",block:"",icon:"download"},on:{click:function(t){e.copy(e.shareLink)}}},[e._v("Kopier")])],1)],1),s("a-row",{staticClass:"spacing--bottom",attrs:{type:"flex"}},[s("a-col",{attrs:{span:18}},[s("a-input",{attrs:{addonBefore:"Adgangskode",defaultValue:e.password,readOnly:"",size:"large"}})],1),s("a-col",{attrs:{span:6}},[s("a-button",{attrs:{size:"large",block:"",icon:"download"},on:{click:function(t){e.copy(e.password)}}},[e._v("Kopier")])],1)],1),s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col"),s("a-col",[s("a-popconfirm",{attrs:{placement:"top",okText:"Ja",cancelText:"Nej"},on:{confirm:e.removeAccess}},[s("template",{slot:"title"},[e._v("\n Vil du fjerne offentlig adgang?\n ")]),s("a-button",{attrs:{icon:"close"}},[e._v("Fjern offentlig adgang")])],2)],1)],1)],1):s("div",[s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{type:"info",message:"Denne mappe er ikke delt offentligt",description:"Del denne mappe ved at angive en adgangskode, og generer et link",banner:""}}),s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Adgangskode"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:"Angiv en kode"},{min:4,message:"Koden skal være mindst 4 karakterer"}]}],expression:"['password', { rules: [{ required: true, message: 'Angiv en kode' }, { min: 4, message: 'Koden skal være mindst 4 karakterer'}] }]"}],attrs:{"auto-focus":"",placeholder:"Indtast en adgangskode"}})],1),s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Generer link til deling")])],1)],1)]),s("a-tab-pane",{key:"2",attrs:{tab:"Virksomhed"}},[s("a-form",{staticClass:"spacing--bottom",attrs:{form:e.formOrganization},on:{submit:function(t){return t.preventDefault(),e.handleSubmitOrganization(t)}}},[s("a-form-item",{attrs:{label:"Email"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["email",{rules:[{required:!0,message:"Angiv en email"},{type:"email",message:"Indtast en gyldig email"}]}],expression:"['email', { rules: [{ required: true, message: 'Angiv en email' }, { type: 'email', message: 'Indtast en gyldig email'}] }]"}],attrs:{"auto-focus":"",type:"email",placeholder:"Indtast en email"}})],1),s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Send invitation")])],1),s("h3",[e._v("Mappen er delt med:")]),s("Loading",{directives:[{name:"show",rawName:"v-show",value:e.loadingOrganizations,expression:"loadingOrganizations"}],attrs:{text:"Indlæser..."}}),e.folder.shared_with.length&&!e.loadingOrganizations?s("a-list",{staticClass:"spacing--bottom",attrs:{bordered:"",size:"small"}},e._l(e.folder.shared_with,function(t){return s("a-list-item",{key:t.id},[s("a-row",{staticClass:"full-width",attrs:{type:"flex",justify:"space-between"}},[s("a-col",[e._v("\n "+e._s(t.name)+"\n ")]),s("a-col",[s("div",{staticClass:"remove-access"},[s("a-popconfirm",{attrs:{placement:"top",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.removeOrganizationAccess(t.id,t.name)}}},[s("template",{slot:"title"},[e._v("\n Vil du fjerne denne adgang?\n ")]),e._v("\n Fjern\n "),s("a-icon",{attrs:{type:"close"}})],2)],1)])],1)],1)}),1):s("a-alert",{attrs:{type:"info",message:"Denne mappe er ikke delt med virksomheder",description:"Del denne mappe ved at sende en invitation",banner:""}})],1)],1)],1)],1)},Ye=[],Qe={name:"ShareFolder",components:{Loading:Se},data:function(){return{loading:!1,loadingOrganizations:!1,newPassword:null,visible:!1,apiUrl:null,qrCode:s("5996")}},props:{folder:{type:Object,required:!0}},methods:{showModal:function(){this.visible=!0},copy:function(e){var t=this;navigator.clipboard.writeText(e).then(function(){t.$message.success("Kopieret til udklipsholderen")},function(){t.$message.error("Der skete en fejl ved kopiering")})},removeAccess:function(){var e=this;this.password=null,this.$axios.delete("/sharing/documents/"+this.$route.params.id).then(function(){e.$emit("shared",!1),e.visible=!1})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||(t.loading=!0,t.$axios.post("/sharing/documents",{password:t.form.getFieldValue("password"),folderId:t.$route.params.id}).then(function(){t.newPassword=t.form.getFieldValue("password"),t.$emit("shared",!0),t.loading=!1}))})},removeOrganizationAccess:function(e,t){var s=this;this.loadingOrganizations=!0,this.$axios.delete("/share-invitations",{params:{folder_id:this.$route.params.id,organization_id:e}}).then(function(){s.$message.success(t+" er fjernet"),s.folder.shared_with=s.folder.shared_with.filter(function(t){return t.id!=e}),s.loadingOrganizations=!1})},handleSubmitOrganization:function(e){var t=this;e.preventDefault(),this.formOrganization.validateFields(function(e){e||(t.loading=!0,t.$axios.post("/share-invitations",{email:t.formOrganization.getFieldValue("email"),folder_id:t.$route.params.id}).then(function(){t.$message.success("Invitation sendt til "+t.formOrganization.getFieldValue("email")),t.visible=!1,t.loading=!1,t.formOrganization.resetFields()}).catch(function(){t.loading=!1,t.$message.error("Der skete en fejl")}))})}},computed:{password:function(){return this.folder.sharing?this.folder.sharing.password:this.newPassword},shareLink:function(){return window.location.origin+"/share/"+this.$route.params.id+"/login"},downloadLink:function(){return this.apiUrl+"/sharing/"+this.$route.params.id+"/pdf?token="+this.$store.state.user.token}},mounted:function(){this.apiUrl="https://api.timero.dk/api"},beforeCreate:function(){this.form=this.$form.createForm(this),this.formOrganization=this.$form.createForm(this)}},We=Qe,Xe=(s("a9e5"),Object(f["a"])(We,Je,Ye,!1,null,"f3f6f466",null)),Ze=Xe.exports,et=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Rediger",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("h3",[e._v("Du er ved at flytte:")]),e.items.length?s("ul",e._l(e.items,function(t){return s("li",{key:t.id},[e._v("\n "+e._s(t.name)+"\n ")])}),0):e._e(),s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Hvor skal indholdet flyttes til?"}},[s("searcher",{attrs:{single:"",remote:"",folders:"",value:e.newParentId,type:"documents"},on:{select:e.selectSearch}})],1),s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",disabled:null===e.newParentId,loading:e.loading}},[s("a-icon",{attrs:{type:"enter"}}),e._v(" Flyt\n ")],1)],1)],1)],1)},tt=[],st={name:"EditContent",data:function(){return{loading:!1,visible:!1,parent:null,newParent:void 0,newParentId:void 0}},components:{Searcher:z},props:{items:{type:Array,required:!0}},methods:{showModal:function(){this.visible=!0},selectSearch:function(e){this.newParent=e,this.newParentId=e.id},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||(t.loading=!0,t.items.map(function(e){t.$axios.patch("/documents/"+e.id,{parent_folder_id:t.newParentId})}),t.$nextTick(function(){t.$router.push({path:"/documents/".concat(t.newParentId)}),t.visible=!1,t.loading=!1,t.$message.success("Indhold blev flyttet")},100))})}},beforeCreate:function(){this.form=this.$form.createForm(this)}},at=st,nt=Object(f["a"])(at,et,tt,!1,null,null,null),it=nt.exports,rt={name:"Folder",components:{CreateContent:Pe,UploadContent:He,ShareFolder:Ze,MoveContent:it},data:function(){var e=this;return{columns:[{title:"Navn",key:"name",sorter:function(e,t){return e.name>t.name},scopedSlots:{customRender:"name"}},{title:"Oprettet",key:"created_at",sorter:function(t,s){return e.$moment(t.created_at)>e.$moment(s.created_at)},scopedSlots:{customRender:"created_at"}},{title:"",key:"content",scopedSlots:{customRender:"content"}}],pagination:{pageSize:20},selectedRowKeys:[],selectedRows:[],invitations:[],loadingInvites:!1}},props:{folder:{type:Object,required:!0},shared:{type:Boolean,default:!1}},methods:{clearSelection:function(){this.selectedRows=[],this.selectedRowKeys=[]},onSelectChange:function(e,t){this.selectedRows=t,this.selectedRowKeys=e},deleteRows:function(){var e=this;this.$store.commit("setLoading",!0),this.selectedRows.map(function(t){e.$axios.delete("/documents/"+t.id)}),this.$store.commit("user/decreaseDocuments",this.selectedRows.length),setTimeout(function(){e.$parent.getContent(),e.clearSelection()},200)},setShared:function(e){this.$emit("shared",e)},getInvitations:function(){var e=this;this.loadingInvites=!0,this.$axios.get("/share-invitations").then(function(t){e.invitations=t.data.data,e.loadingInvites=!1})},acceptInvitation:function(e){var t=this;this.removeInvitation(e),this.$axios.post("/share-invitations/accept",{id:e}).then(function(){t.$parent.getContent()})},declineInvitation:function(e){this.removeInvitation(e),this.$axios.post("/share-invitations/decline",{id:e})},removeInvitation:function(e){this.invitations=this.invitations.filter(function(t){return t.id!=e})}},computed:{loading:function(){return this.$store.state.loading},sortedContent:function(){var e=this.folder.folder_content.slice();function t(e,t){return e.type>t.type?-1:e.typet.type?-1:e.type10?s("div",[s("pro-feature",{attrs:{text:"Du har mere end 10 brugere, men har ikke PRO adgang"}})],1):s("div",[s("h1",{staticClass:"title"},[s("span",[e._v("\n Sager\n "),s("a",{staticClass:"title__help-button",attrs:{href:"https://timero.dk/supportcenter/timeregistrering/kom-igang-med-timeregistrering",target:"blank"}},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Få hjælp til sager")]),s("a-button",{attrs:{type:"dashed",size:"small",shape:"circle",icon:"question"}})],2)],1)]),e.$store.state.user.details.is_admin?s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.createTask.showModal()}}},[e._v("Ny sag")]):e._e()],1),s("create-task",{ref:"createTask"}),e.openTasks&&e.openTasks.length?s("div",[s("h2",[e._v("Aktive sager")]),s("a-table",{attrs:{columns:e.openTasksColumns,dataSource:e.openTasks,loading:e.loading,rowKey:function(e){return e.id},pagination:e.pagination,size:"small"},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{},[s("router-link",{attrs:{to:{name:"TaskSingleGeneral",params:{id:t.id}}}},[e._v(e._s(t.name))])],1)}},{key:"total",fn:function(t){return s("span",{},[e._v(e._s(t.hours?t.hours:0)+" timer")])}},{key:"users",fn:function(t){return s("span",{},[e._v(e._s(t.users_count)+" brugere")])}},{key:"actions",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Luk sag")]),s("a-button",{attrs:{shape:"circle",icon:"close"},on:{click:function(s){e.closeTask(t)}}})],2)],1)],1)],1)}}])})],1):e._e(),e.loading||e.openTasks.length||e.closedTasks.length?e._e():s("a-alert",{attrs:{showIcon:"",message:"Du har ingen aktive sager",description:"For at komme igang med timeregistrering, skal du have oprettet sager til at registrere tid på. Tryk på knappen Ny sag for at komme igang",type:"info"}}),!e.loading&&e.closedTasks&&e.closedTasks.length?s("div",[s("h2",{staticClass:"spacing--top"},[e._v("Lukkede sager")]),s("a-alert",{staticClass:"spacing--bottom",attrs:{type:"info",showIcon:""}},[s("span",{attrs:{slot:"message"},slot:"message"},[e._v("Lukkede sager kan ikke redigeres, du skal åbne en sag for at ændre i den")])]),s("a-table",{attrs:{columns:e.closedTasksColumns,dataSource:e.closedTasks,rowKey:function(e){return e.id},loading:e.loadingClosed,pagination:e.pagination,size:"small"},scopedSlots:e._u([{key:"total",fn:function(t){return s("span",{},[e._v(e._s(t.hours_count?t.hours_count:0)+" timer")])}},{key:"users",fn:function(t){return s("span",{},[e._v(e._s(t.users_count)+" brugere")])}},{key:"actions",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Genåbn sag")]),s("a-button",{attrs:{shape:"circle",icon:"check"},on:{click:function(s){e.openTask(t)}}})],2)],1)],1)],1)}}])})],1):e._e(),s("loading",{directives:[{name:"show",rawName:"v-show",value:e.loading||e.loadingClosed,expression:"loading || loadingClosed"}],attrs:{text:"Indlæser sager"}})],1)])},bs=[],ks=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"pro spacing--bottom"},[s("a-icon",{staticClass:"pro__icon",attrs:{type:"warning"}}),s("h2",[e.text?s("span",[e._v(e._s(e.text))]):s("span",[e._v("Dette er en Pro Feature")])]),s("router-link",{attrs:{to:{name:"Subscription"}}},[s("a-button",{attrs:{type:"primary",size:"large"}},[e._v("Opgrader til Pro")])],1)],1)},ys=[],ws={name:"ProFeature",props:{text:{type:String,default:null}}},$s=ws,xs=(s("fa99"),Object(f["a"])($s,ks,ys,!1,null,"33b8a6d8",null)),js=xs.exports,Ts={name:"Tasks",components:{CreateTask:qt,Loading:Se,ProFeature:js},data:function(){return{openTasks:[],closedTasks:[],openTasksColumns:[{title:"Sag",key:"name",sorter:function(e,t){return e.name>t.name},scopedSlots:{customRender:"name"}},{title:"Total tidsforbrug",key:"total",sorter:function(e,t){return e.hours-t.hours},scopedSlots:{customRender:"total"}},{title:"Brugere allokeret",key:"users",sorter:function(e,t){return e.users_count-t.users_count},scopedSlots:{customRender:"users"}},{title:"",key:"actions",scopedSlots:{customRender:"actions"}}],closedTasksColumns:[{title:"Sag",key:"name",dataIndex:"name",sorter:function(e,t){return e.name>t.name}},{title:"Total tidsforbrug",key:"total",sorter:function(e,t){return e.hours-t.hours},scopedSlots:{customRender:"total"}},{title:"Brugere allokeret",key:"users",sorter:function(e,t){return e.users_count-t.users_count},scopedSlots:{customRender:"users"}},{title:"",key:"actions",scopedSlots:{customRender:"actions"}}],pagination:{pageSize:20},loading:!1,loadingClosed:!1}},methods:{openTask:function(e){var t=this;this.$axios.patch("/timesheetTasks/"+e.id,{is_open:!0}).then(function(){t.closedTasks=t.closedTasks.filter(function(t){return t.id!=e.id}),t.openTasks.push(e)})},closeTask:function(e){var t=this;this.$axios.patch("/timesheetTasks/"+e.id,{is_open:!1}).then(function(){t.openTasks=t.openTasks.filter(function(t){return t.id!=e.id}),t.closedTasks.push(e)})},getTasks:function(){var e=this;this.loading=!0,this.loadingClosed=!0,this.$axios.get("/getOpenTimesheetTasks").then(function(t){e.openTasks=t.data.timesheet_tasks,void 0===e.openTasks&&(e.openTasks=[]),e.loading=!1}),this.$axios.get("/getClosedTimesheetTasks").then(function(t){e.closedTasks=t.data.timesheet_tasks,void 0===e.closedTasks&&(e.closedTasks=[]),e.loadingClosed=!1})}},mounted:function(){this.$store.commit("setCurrentPage","tasks"),this.getTasks()}},Cs=Ts,Ss=Object(f["a"])(Cs,_s,bs,!1,null,null,null),zs=Ss.exports,Ds=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.$store.state.task.currentTask?s("div",[s("a-menu",{staticClass:"spacing--bottom",attrs:{mode:"horizontal"},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}},[s("a-menu-item",{key:"TaskSingleGeneral"},[s("router-link",{attrs:{to:{name:"TaskSingleGeneral"}}},[e._v("Generelt")])],1),s("a-menu-item",{key:"TaskSingleTime"},[s("router-link",{attrs:{to:{name:"TaskSingleTime"}}},[e._v("Tidsregistreringer")])],1),s("a-menu-item",{key:"TaskSingleQa"},[s("router-link",{attrs:{to:{name:"TaskSingleQa"}}},[e._v("Kvalitetssikring")])],1)],1),e.$store.state.task.currentTask.parent_task_id?s("router-link",{attrs:{to:{name:"TaskSingleGeneral",params:{id:e.$store.state.task.currentTask.parent_task_id}}}},[s("a-button",[s("a-icon",{attrs:{type:"left"}}),e._v("Tilbage til hovedsag\n ")],1)],1):e._e(),e.$store.state.task.currentTask?s("h1",{staticClass:"title"},[e._v("\n "+e._s(e.$store.state.task.currentTask.name)+"\n "),e.$store.state.user.details.is_admin?s("a-button",{attrs:{shape:"circle",icon:"edit"},on:{click:function(t){e.$refs.editTask.showModal()}}}):e._e()],1):e._e(),e.$store.state.user.details.is_admin&&e.$store.state.task.currentTask?s("edit-task",{ref:"editTask"}):e._e(),s("router-view")],1):e._e()},Is=[],Us=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Rediger",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Navn"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"Indtast venligst et navn"}]}],expression:"['name', { rules: [{ required: true, message: 'Indtast venligst et navn' }] }]"}],attrs:{"auto-focus":"",placeholder:"Indtast navn"}})],1),s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Gem")])],1),s("a-col",[e.$store.state.task.currentTask.timesheet_entries.data.length||e.$store.state.task.currentTask.users.length?s("div",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Du kan ikke slette en sag der har allokerede brugere eller angivet tid")]),s("a-button",{attrs:{disabled:""}},[s("a-icon",{attrs:{type:"delete"}}),e._v("Slet\n ")],1)],2)],1):s("div",[s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(t){e.deleteTask(e.$store.state.task.currentTask.id)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil slette denne sag? Handlingen kan ikke fortrydes-")])]),s("a-button",[s("a-icon",{attrs:{type:"delete"}}),e._v("Slet\n ")],1)],2)],1)])],1)],1)],1)],1)},Os=[],Fs={name:"EditContent",data:function(){return{loading:!1,visible:!1}},methods:{showModal:function(){var e=this;this.visible=!0,setTimeout(function(){e.form.setFieldsValue({name:e.$store.state.task.currentTask.name})})},deleteTask:function(e){var t=this;this.$axios.delete("/timesheetTasks/"+e).then(function(){t.$router.push({name:"Tasks"}),t.visible=!1,t.$message.success("Sagen blev slettet")})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||t.$axios.patch("/timesheetTasks/"+t.$store.state.task.currentTask.id,{name:t.form.getFieldValue("name")}).then(function(){t.$store.commit("task/setCurrentTaskName",t.form.getFieldValue("name")),t.visible=!1})})}},beforeCreate:function(){this.form=this.$form.createForm(this)}},Es=Fs,As=Object(f["a"])(Es,Us,Os,!1,null,null,null),qs=As.exports,Ns={name:"Task",components:{EditTask:qs},data:function(){return{current:[]}},methods:{setMenu:function(e){this.current=[e]}},mounted:function(){this.$store.commit("setCurrentPage","tasks"),this.$store.dispatch("task/getTask",this.$route.params.id)},watch:{$route:function(e,t){e.params.id!=t.params.id&&this.$store.dispatch("task/getTask",this.$route.params.id)}}},Ms=Ns,Ps=Object(f["a"])(Ms,Ds,Is,!1,null,null,null),Rs=Ps.exports,Ls=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$store.state.task.currentTask?s("div",[s("a-row",{staticClass:"spacing--sm-bottom",attrs:{type:"flex",justify:"space-between",align:"middle"}},[s("a-col",[s("searcher",{staticClass:"spacing--sm-bottom",attrs:{single:"",type:"users",data:e.$store.state.user.users,value:e.selectedUser?e.selectedUser.id:void 0,showArrow:"",allowClear:""},on:{select:e.handleChange}})],1),s("a-col",[s("a-range-picker",{staticClass:"spacing--sm-bottom",attrs:{format:e.dateFormat},on:{change:e.handleTimeChange},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),s("a-col",[s("div",{staticClass:"spacing--sm-bottom spacing--sm-left spacing--sm-right"},[e._v("\n Ialt\n "),s("strong",[e._v(e._s(e.totalHours))]),e._v(" timer, fordelt på\n "),s("strong",[e._v(e._s(e.$store.state.task.currentTask.timesheet_entries.total))]),e._v(" registreringer\n ")])]),s("a-col",[s("a-checkbox",{staticClass:"spacing--sm-bottom",on:{change:e.changeRegistrationDisabled},model:{value:e.registrationDisabled,callback:function(t){e.registrationDisabled=t},expression:"registrationDisabled"}},[e._v("Deaktiver timeregistrering")])],1),s("a-col",[e.$store.state.task.currentTask.is_open?s("div",{staticClass:"spacing--sm-bottom"},[s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.newTimeEntry.showModal()}}},[e._v("Tilføj registrering")]),s("new-time-entry",{ref:"newTimeEntry",attrs:{"specified-task":e.$store.state.task.currentTask},on:{done:function(t){e.getTimeEntries(e.pagination.current)}}})],1):s("div",{staticClass:"spacing--sm-bottom"},[s("a-tooltip",[s("template",{slot:"title"},[e._v("Du kan ikke tilføje registrering på en lukket sag")]),s("a-button",{attrs:{disabled:"",icon:"plus"}},[e._v("Tilføj registrering")])],2)],1)])],1),s("a-table",{attrs:{columns:e.columns,dataSource:this.$store.state.task.currentTask.timesheet_entries.data,rowKey:function(e){return e.id},size:"small",pagination:e.pagination,loading:e.loading},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{},[s("strong",[e._v(e._s(t.user.name))]),s("br"),e._v("\n "+e._s(t.comment)+"\n ")])}},{key:"hours",fn:function(t){return s("span",{},[e._v(e._s(t.duration)+" timer")])}},{key:"mileage",fn:function(t){return e.$store.state.user.details.organization.has_mileage_registration?s("span",{},[e._v(e._s(t.mileage)+" km")]):e._e()}},{key:"date",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDate")(t.date)))])}},{key:"actions",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.removeEntry(t)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil fjerne denne registrering?")])]),s("a-button",{attrs:{shape:"circle",icon:"delete"}})],2)],1)],1)],1)}}])})],1):s("Loading",{attrs:{text:"Indlæser..."}})],1)},Vs=[],Ks=s("cebc"),Bs=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Ny registrering",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[e.specifiedTask?e._e():s("a-form-item",{attrs:{label:"Vælg sag"}},[e.openTasks.length?s("searcher",{attrs:{single:"",allowClear:"",type:"tasks",value:e.task?e.task.id:void 0,data:e.openTasks,showArrow:""},on:{select:e.selectTask}}):s("a-alert",{attrs:{message:"Denne bruger er ikke allokeret til nogle sager",showIcon:""}})],1),e.specifiedUser?e._e():s("a-form-item",{attrs:{label:"Vælg bruger"}},[s("searcher",{attrs:{single:"",allowClear:"",type:"users",data:e.$store.state.user.users,value:e.user?e.user.id:void 0,showArrow:""},on:{select:e.selectUser}})],1),s("a-row",{attrs:{type:"flex"}},[s("a-col",{attrs:{span:6}},[s("a-form-item",{attrs:{label:"Tidsforbrug"}},[s("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["hours",{rules:[{required:!0,message:"Angiv tidsforbrug"}]}],expression:"['hours', { rules: [{ required: true, message: 'Angiv tidsforbrug' }] }]"}],attrs:{"auto-focus":"",min:0,step:.25,max:24,size:"large",placeholder:"Vælg tidsforbrug"}})],1)],1),s("a-col",{attrs:{span:12}},[s("a-form-item",{attrs:{label:"Dato"}},[s("a-date-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["date",{rules:[{required:!0,message:"Vælg en dato"}]}],expression:"['date', { rules: [{ required: true, message: 'Vælg en dato' }] }]"}],attrs:{size:"large",format:"DD-MM-YYYY",placeholder:"Vælg dato"}})],1)],1),e.$store.state.user.details.organization.has_mileage_registration?s("a-col",{attrs:{span:6}},[s("a-form-item",{attrs:{label:"Kilometer"}},[s("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["mileage"],expression:"['mileage']"}],attrs:{"auto-focus":"",min:0,step:.5,size:"large",placeholder:"Angiv kilometer"}})],1)],1):e._e()],1),s("a-form-item",{attrs:{label:"Kommentar"}},[s("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["comment"],expression:"['comment']"}],attrs:{placeholder:"Din kommentar"}})],1),s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[s("a-button",{key:"submit",attrs:{disabled:!e.user,type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Gem")])],1)],1)],1)],1)],1)},Gs=[],Hs={name:"NewMessage",components:{Searcher:z},props:{specifiedUser:{type:Object},specifiedTask:{type:Object}},data:function(){return{comment:"",user:null,loading:!1,visible:!1,task:null,openTasks:[]}},methods:{showModal:function(){this.visible=!0,this.specifiedUser?this.user=this.specifiedUser:this.user=this.$store.state.user.details,this.specifiedTask?this.task=this.specifiedTask:this.task=null,this.getTasks()},selectUser:function(e){this.user=e},selectTask:function(e){this.task=e},removeUser:function(){this.user=null},getTasks:function(){var e=this;this.$axios.get("/getUsersTasks/"+this.user.id).then(function(t){e.openTasks=t.data.timesheet_tasks})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){if(!e){t.loading=!0;var s={comment:t.form.getFieldValue("comment"),date:t.$moment(t.form.getFieldValue("date")).format("Y-MM-DD"),mileage:t.form.getFieldValue("mileage"),duration:t.form.getFieldValue("hours"),timesheet_task_id:t.task.id,userId:t.user.id};t.$axios.post("/timesheetEntries",s).then(function(e){var s=e.data.timesheet_entry;s.user=t.user,t.form.resetFields(),t.visible=!1,t.$emit("done"),t.$notification["success"]({message:"Success!",description:"Din registrering er oprettet!"}),t.loading=!1})}})}},mounted:function(){this.$store.dispatch("user/getUsers"),this.specifiedTask&&(this.task=this.specifiedTask)},beforeCreate:function(){this.form=this.$form.createForm(this)}},Js=Hs,Ys=Object(f["a"])(Js,Bs,Gs,!1,null,null,null),Qs=Ys.exports,Ws={name:"Timesheets",components:{NewTimeEntry:Qs,Loading:Se,Searcher:z},data:function(){return{task:null,loading:!1,dateRange:null,selectedUser:null,totalHours:0,registrationDisabled:!1,dateFormat:"DD/MM/YYYY",sortedInfo:null,pagination:{pageSize:50}}},computed:{columns:function(){var e=this.sortedInfo;e=e||{};var t=[{title:"Navn",key:"name",scopedSlots:{customRender:"name"}},{title:"Tidsforbrug",key:"hours",sorter:!0,sortOrder:"hours"===e.columnKey?e.order:null,scopedSlots:{customRender:"hours"}},{title:"Kørsel",key:"mileage",sorter:!0,sortOrder:"mileage"===e.columnKey?e.order:null,scopedSlots:{customRender:"mileage"}},{title:"Dato",key:"date",sorter:!0,sortOrder:"date"===e.columnKey?e.order:null,scopedSlots:{customRender:"date"}},{title:"",key:"actions",scopedSlots:{customRender:"actions"}}];return t}},methods:{removeEntry:function(e){this.$store.dispatch("task/removeEntry",e.id)},handleChange:function(e){this.selectedUser=e,this.getTimeEntries(this.pagination.current)},handleTimeChange:function(){this.getTimeEntries(this.pagination.current)},changeRegistrationDisabled:function(){this.$axios.patch("/timesheetTasks/"+this.$store.state.task.currentTask.id,{registration_disabled:this.registrationDisabled})},handleTableChange:function(e,t,s){this.sortedInfo=s,this.getTimeEntries(e.current)},getTimeEntries:function(e){var t=this,s={page:e};this.dateRange&&this.dateRange.length&&(s.from=this.$moment(this.dateRange[0]).startOf("day").format("Y-MM-DD"),s.to=this.$moment(this.dateRange[1]).startOf("day").format("Y-MM-DD")),this.selectedUser&&(s.userId=this.selectedUser.id),null!=this.sortedInfo&&(s.sortKey=this.sortedInfo.columnKey,s.sortDirection=this.sortedInfo.order),this.loading=!0,this.$axios.get("/getPagedTimesheetEntriesByTaskId/"+this.$store.state.task.currentTask.id,{params:s}).then(function(e){t.loading=!1,t.$store.commit("task/setTimeEntries",e.data.data),t.totalHours=e.data.hours_count,t.setPagination()})},setPagination:function(){if(this.$store.state.task.currentTask){var e=Object(Ks["a"])({},this.pagination);e.total=this.$store.state.task.currentTask.timesheet_entries.total,this.pagination=e}}},created:function(){var e=this;this.$store.watch(function(){return e.$store.state.task.currentTask},function(t){t&&(e.setPagination(),e.totalHours=e.$store.state.task.currentTask.hours_count)})},mounted:function(){this.setPagination(),this.totalHours=this.$store.state.task.currentTask.hours_count,this.$store.commit("setCurrentPage","tasks"),this.$parent.setMenu("TaskSingleTime"),this.registrationDisabled=Boolean(Number(this.$store.state.task.currentTask.registration_disabled))}},Xs=Ws,Zs=Object(f["a"])(Xs,Ls,Vs,!1,null,null,null),ea=Zs.exports,ta=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$store.state.user.details.organization.is_on_trial?s("a-alert",{staticClass:"spacing--bottom",attrs:{showIcon:"",message:"Dette er en PRO feature",description:"Du har "+e.$moment(e.$store.state.user.details.organization.created_at).add(30,"days").diff(e.$moment(),"days")+" dage tilbage af din prøveperiode",type:"info"}}):e._e(),e.$store.state.task.currentTask&&!e.loading?s("div",[s("a-row",{attrs:{type:"flex",justify:"space-between",gutter:12}},[s("a-col",[s("h2",[e._v("Kvalitetssikring")]),null!=e.qaItems&&e.qaItems.length?s("p",[e._v("\n Udført\n "),s("strong",[e._v(e._s(e.completed))]),e._v(" /\n "),s("strong",[e._v(e._s(e.qaItems.length))]),e._v(" opgaver\n ")]):e._e()]),s("a-col",[e.$store.state.task.currentTask.is_open?s("div",[s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.createQa.showModal()}}},[e._v("Tilføj opgave")]),s("create-qa",{ref:"createQa",on:{"new-qa":e.addQa}})],1):s("div",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Du kan ikke tilføje opgaver på en lukket sag")]),s("a-button",{attrs:{disabled:"",icon:"plus"}},[e._v("Tilføj opgave")])],2)],1)])],1),null!=e.qaItems&&e.qaItems.length?s("div",[s("a-collapse",e._l(e.qaItems,function(t){return s("a-collapse-panel",{key:t.id},[s("template",{slot:"header"},[s("a-row",{attrs:{type:"flex",justify:"space-between",gutter:12}},[s("a-col",[e._v(e._s(t.title))]),s("a-col",[t.entries?s("span",[e._v(e._s(t.entries.length))]):s("span",[e._v("0")]),e._v("\n / "+e._s(t.min_entries)+"\n "),t.entries&&t.entries.length>=t.min_entries?s("a-icon",{staticClass:"qa-task__check",attrs:{type:"check-circle"}}):s("a-icon",{staticClass:"qa-task__warning",attrs:{type:"warning"}})],1)],1)],1),s("a-row",{staticClass:"spacing--sm-bottom",attrs:{type:"flex",justify:"end"}},[s("a-col",[s("a-popconfirm",{attrs:{title:"Er du sikker på at du vil slette?",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.deleteTask(t.id)}}},[s("a-button",{attrs:{icon:"delete"}},[e._v("Slet opgave")])],1)],1)],1),s("a-row",{attrs:{type:"flex",gutter:12}},e._l(t.entries,function(a){return s("a-col",{key:a.id,staticClass:"spacing--bottom",attrs:{span:6}},[s("a-card",[s("a",{attrs:{slot:"cover",href:a.img_url,target:"blank",alt:""},slot:"cover"},[s("img",{staticClass:"img-responsive",attrs:{alt:"",src:a.preview_url}})]),s("a-card-meta",[s("template",{slot:"description"},[s("div",[s("strong",[s("a-icon",{attrs:{type:"user"}}),e._v("\n "+e._s(a.user.name)+"\n ")],1)]),e._v("\n "+e._s(a.description)+"\n ")])],2),s("template",{staticClass:"ant-card-actions",slot:"actions"},[s("a-popconfirm",{attrs:{title:"Er du sikker på at du vil slette?",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.deleteEntry(a.id,t.id)}}},[s("a-icon",{attrs:{type:"delete"}})],1)],1)],2)],1)}),1)],2)}),1)],1):e._e(),null!=e.qaItems&&e.qaItems.length||e.loading?e._e():s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",message:"Der er endnu ikke oprettet kvalitetssikring for denne sag",type:"info"}})],1):s("div",[e._v("Indlæser...")])],1)},sa=[],aa=(s("cadf"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Opret kvalitetssikringsopgave",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Titel"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:"Indtast venligst en titel"}]}],expression:"['title', { rules: [{ required: true, message: 'Indtast venligst en titel' }] }]"}],attrs:{"auto-focus":"",placeholder:"Indtast titel"}})],1),s("a-form-item",{attrs:{label:"Minimum antal billeder"}},[s("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["minEntries",{rules:[{required:!0,message:"Angiv minimum"}]}],expression:"['minEntries', { rules: [{ required: true, message: 'Angiv minimum' }] }]"}],attrs:{min:1}})],1),s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Tilføj")])],1)],1)],1)}),na=[],ia={name:"CreateQa",data:function(){return{loading:!1,visible:!1}},methods:{showModal:function(){var e=this;this.visible=!0,setTimeout(function(){e.form.setFieldsValue({minEntries:1})})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||(t.loading=!0,t.$axios.post("/qaItems",{title:t.form.getFieldValue("title"),min_entries:t.form.getFieldValue("minEntries"),timesheet_task_id:t.$route.params.id}).then(function(e){t.visible=!1,t.$emit("new-qa",e.data.qa_item),t.$notification["success"]({message:"Success!",description:t.form.getFieldValue("title")+" er nu oprettet!"}),t.form.resetFields(),t.loading=!1}))})}},beforeCreate:function(){this.form=this.$form.createForm(this)}},ra=ia,oa=Object(f["a"])(ra,aa,na,!1,null,null,null),la=oa.exports,ca={name:"Timesheets",components:{CreateQa:la},data:function(){return{qaItems:null,loading:!1}},methods:{getQas:function(){var e=this;this.loading=!0,this.$axios.get("/qaItems/getByTaskId/"+this.$route.params.id).then(function(t){e.qaItems=t.data.qa_items,e.loading=!1})},addQa:function(e){this.qaItems.push(e)},deleteEntry:function(e,t){var s=this;this.$axios.delete("/qaEntries/"+e).then(function(){s.qaItems.map(function(s){s.id==t&&(s.entries=s.entries.filter(function(t){return t.id!==e}))}),s.$message.success("Dokumentation blev slettet")})},deleteTask:function(e){var t=this;this.$axios.delete("/qaItems/"+e).then(function(){t.getQas(),t.$message.success("Opgave blev slettet")})}},mounted:function(){this.$parent.setMenu("TaskSingleQa"),this.getQas()},computed:{completed:function(){var e=[];return null!=this.qaItems?(e=this.qaItems.filter(function(e){return!!e.entries&&e.entries.length>=e.min_entries}),e.length):0}}},da=ca,ua=(s("3857"),Object(f["a"])(da,ta,sa,!1,null,null,null)),ma=ua.exports,pa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.$store.state.task.currentTask?s("div",[e.$store.state.task.currentTask.id?s("add-users",{directives:[{name:"show",rawName:"v-show",value:e.$store.state.user.details.is_admin,expression:"$store.state.user.details.is_admin"}],ref:"addUsers",attrs:{currentId:e.$store.state.task.currentTask.id,parentId:e.$store.state.task.parent_task_id,currentUsers:e.$store.state.task.currentTask.users}}):e._e(),s("create-task",{ref:"createTask",attrs:{"parent-id":e.$store.state.task.currentTask.id}}),s("a-row",{attrs:{type:"flex",gutter:24}},[s("a-col",{attrs:{span:24}},[s("h2",{staticClass:"subtitle"},[e._v("\n Allokerede brugere\n "),e.$store.state.user.details.is_admin?s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.addUsers.showModal()}}},[e._v("Tilføj brugere")]):e._e()],1),s("a-table",{attrs:{columns:e.columns,dataSource:e.$store.state.task.currentTask.users,pagination:e.pagination,rowKey:function(e){return e.id},size:"small"},scopedSlots:e._u([{key:"action",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[e.$store.state.user.details.is_admin?s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.removeUser(t)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil fjerne brugeren fra denne sag?")])]),s("a-tooltip",[s("template",{slot:"title"},[e._v("Fjern allokering")]),s("a-button",{attrs:{shape:"circle",icon:"close",loading:e.removing}})],2)],2):e._e()],1)],1)],1)}}])})],1)],1),e.$store.state.task.currentTask.parent_task_id?e._e():s("div",[s("h2",{staticClass:"subtitle spacing--top"},[e._v("\n Undersag\n "),e.$store.state.user.details.is_admin?s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.createTask.showModal()}}},[e._v("Ny undersag")]):e._e()],1),s("a-table",{attrs:{columns:e.subTaskColumns,dataSource:e.$store.state.task.currentTask.subtasks,pagination:e.pagination,rowKey:function(e){return e.id},size:"small"},scopedSlots:e._u([{key:"name",fn:function(t){return s("span",{},[s("router-link",{attrs:{to:{name:"TaskSingleGeneral",params:{id:t.id}}}},[e._v(e._s(t.name))])],1)}},{key:"action",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[s("a-tooltip",[s("template",{slot:"title"},[t.is_open?s("span",[e._v("Luk sag")]):s("span",[e._v("Genåbn sag")])]),t.is_open?s("a-button",{attrs:{shape:"circle",icon:"close"},on:{click:function(s){e.toggleSubtask(t)}}}):s("a-button",{attrs:{shape:"circle",icon:"check"},on:{click:function(s){e.toggleSubtask(t)}}})],2)],1)],1)],1)}}])})],1)],1):e._e()},fa=[],ha={name:"Users",components:{AddUsers:Vt,CreateTask:qt},data:function(){return{pagination:{pageSize:20},removing:!1,subtasks:[],columns:[{title:"Navn",dataIndex:"name",sorter:function(e,t){return e.name>t.name},key:"name"},{title:"Email",dataIndex:"email",sorter:function(e,t){return e.email>t.email},key:"email"},{title:"",key:"action",scopedSlots:{customRender:"action"}}],subTaskColumns:[{title:"Sag",key:"name",sorter:function(e,t){return e.name>t.name},scopedSlots:{customRender:"name"}},{title:"",key:"action",scopedSlots:{customRender:"action"}}]}},methods:{removeUser:function(e){this.$store.dispatch("task/removeUser",e.id)},toggleSubtask:function(e){var t=this;this.$axios.patch("/timesheetTasks/"+e.id,{is_open:!e.is_open}).then(function(){t.$store.dispatch("task/getTask",t.$store.state.task.currentTask.id)})}},mounted:function(){this.$parent.setMenu("TaskSingleGeneral")}},va=ha,_a=(s("34eb"),Object(f["a"])(va,pa,fa,!1,null,null,null)),ba=_a.exports,ka=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-menu",{staticClass:"spacing--bottom",attrs:{mode:"horizontal"},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}},[s("a-menu-item",{key:"Subscription"},[s("router-link",{attrs:{to:{name:"Subscription"}}},[e._v("\n Abonnement\n ")])],1),s("a-menu-item",{key:"OrderHistory"},[s("router-link",{attrs:{to:{name:"OrderHistory"}}},[e._v("\n Ordrehistorik\n ")])],1)],1),s("router-view")],1)},ya=[],wa={name:"Orders",data:function(){return{current:[]}},methods:{setMenu:function(e){this.current=[e]}},mounted:function(){this.$store.commit("setCurrentPage","orders")}},$a=wa,xa=Object(f["a"])($a,ka,ya,!1,null,null,null),ja=xa.exports,Ta=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$store.state.user.details.organization.is_on_trial?s("a-alert",{staticClass:"spacing--bottom",attrs:{showIcon:"",message:"Du er igang med din prøveperiode",description:"Din prøveperiode udløber om "+e.$moment(e.$store.state.user.details.organization.created_at).add(30,"days").diff(e.$moment(),"days")+" dage, herefter skal du opgradere til pro, for at have adgang til alle PRO funktionerne.",type:"info"}}):e._e(),s("a-row",{staticClass:"spacing--bottom",attrs:{type:"flex",gutter:24}},[s("a-col",{attrs:{span:12}},[e.$store.state.user?s("a-card",{staticClass:"spacing--bottom",attrs:{title:"Dit nuværende abonnement"}},[s("a-list",[s("a-list-item",[s("div",{staticClass:"product-line"},[s("a-icon",{attrs:{type:"check"}}),e._v("\n "+e._s(e.$store.state.user.details.organization.user_count)+" brugere\n ")],1)]),e._l(e.activeAddons,function(t){return s("a-list-item",{key:t.id},[s("div",{staticClass:"product-line"},[s("a-icon",{attrs:{type:"check"}}),e._v("\n "+e._s(t.name)+"\n ")],1)])}),s("div",{attrs:{slot:"footer"},slot:"footer"},[e.$store.state.user.details.organization.is_pro&&!e.expirationDate?s("div",[s("div",{staticClass:"spacing--sm-top"},[e._v("Pris for indeværende måned:")]),s("div",{staticClass:"price"},[null!=e.subscription?s("div",[e._v("\n "+e._s(e._f("formatPrice")(100*e.subscription.price))+"\n "),s("div",{staticClass:"price__specs"},[e._v("eks. moms")])]):e._e()])]):e._e(),e.expirationDate?s("div",[e._v("Abonnement forudbetalt til "+e._s(e._f("formatDate")(e.expirationDate)))]):e._e(),e.$store.state.user.details.organization.has_pro_access?e._e():s("div",[e._v("Du har Timero FREE ‐ Det er gratis")]),e.$store.state.user.details.organization.is_on_trial?s("div",[e._v("Din prøveperiode udløber om "+e._s(this.$moment(this.$store.state.user.details.organization.created_at).add(30,"days").diff(this.$moment(),"days"))+" dage")]):e._e()])],2)],1):e._e(),s("a-row",{attrs:{gutter:16}},e._l(e.addons,function(t){return s("a-col",{key:t.id,attrs:{span:12}},[s("a-card",{staticClass:"full-height addon",attrs:{title:"Tilkøb: "+t.name}},[t.has_addon&&!t.pending_cancellation?s("div",{staticClass:"addon__bought"},[e._v("Allerede tilkøbt")]):e._e(),s("p",[e._v(e._s(t.description))]),s("a",{attrs:{href:t.link}},[e._v("Læs mere om "+e._s(t.name.toLowerCase()))]),t.has_addon?e._e():s("div",{staticClass:"price spacing--sm-bottom"},[s("div",[e._v("\n DKK "+e._s(t.price/100)+" pr. bruger/md.\n "),s("div",{staticClass:"price__specs"},[e._v("eks. moms")])])]),t.has_addon||"active"!==e.subscriptionStatus?e._e():s("a-popconfirm",{attrs:{title:"Ønsker du at tilkøbe dette addon? Du binder dig for 1 måned af gangen",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.buyAddon(t.id)}}},[s("a-button",{attrs:{type:"primary",size:"large"}},[e._v("Køb nu")])],1),"active"!==e.subscriptionStatus?s("a-tooltip",[s("template",{slot:"title"},[e._v("Du skal være PRO for at kunne lave tilkøb")]),s("a-button",{attrs:{type:"primary",size:"large",disabled:!0}},[e._v("Køb nu")])],2):e._e(),t.has_addon&&!t.pending_cancellation?s("div",{staticClass:"spacing--sm-top"},[s("a-popconfirm",{attrs:{title:"Ønsker du at opsige dette addon? Det vil forsvinde ved udgangen af måneden",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.cancelAddon(t.id)}}},[s("a-button",{attrs:{size:"small"}},[e._v("Opsig")])],1)],1):e._e(),t.pending_cancellation?s("div",{staticClass:"spacing--xs-top"},[s("a-tooltip",[s("template",{slot:"title"},[e._v("Dette addon vil blive fjernet i slutningen af måneden")]),s("a-tag",{staticClass:"spacing--sm-bottom"},[e._v("Afventer fjernelse")])],2),s("a-button",{attrs:{type:"primary",size:"large"},on:{click:function(s){e.buyAddon(t.id)}}},[e._v("Fortryd fjernelse")])],1):e._e()],1)],1)}),1)],1),s("a-col",{attrs:{span:12}},["active"===e.subscriptionStatus?s("a-card",{attrs:{title:"Administrer abonnement"}},[s("div",[s("p",[e._v("\n Du har haft et aktivt abonnement siden\n "),s("strong",[e._v(e._s(e._f("formatDate")(e.$store.state.user.details.organization.subscribed_at)))])]),s("a-button",{staticClass:"spacing--sm-right",attrs:{size:"small"},on:{click:e.openUpdateGuide}},[e._v("Angiv nyt betalingskort")]),s("a-popconfirm",{attrs:{title:"Er du sikker?",okText:"Ja",cancelText:"Nej"},on:{confirm:e.cancelSubscription}},[s("a-button",{attrs:{size:"small"}},[e._v("Opsig abonnement")])],1)],1)]):e._e(),"pending_cancellation"===e.subscriptionStatus?s("a-card",{attrs:{title:"Administrer abonnement"}},[s("div",[s("p",[e._v("Du har opsagt dit abonnement, det udløber den sidste dag i måneden.")]),s("a-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.upgrade}},[e._v("Genoptag abonnement")])],1)]):e._e(),s("a-modal",{attrs:{title:"Opdater betalingskort"},on:{ok:e.closeUpdateGuide},model:{value:e.showUpdateGuide,callback:function(t){e.showUpdateGuide=t},expression:"showUpdateGuide"}},[s("p",[e._v("For at bruge et andet betalingskort, skal du opsige abonnementet, og tilknytte et betalingskort på ny.")])]),"none"===e.subscriptionStatus?s("a-card",{attrs:{title:"Opgrader til Pro"}},[s("p",[e._v("For at opgradere til Timero Pro, skal du acceptere vores betingelser, og tilknytte et betalingskort.")]),e.hasDetails?s("div",[s("div",[e._v("\n Navn:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.name))])]),s("div",[e._v("\n Adresse:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.address))])]),s("div",[e._v("\n Postnummer:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.zip_code))])]),s("div",[e._v("\n Telefon:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.phone))])]),s("div",[e._v("\n City:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.city))])]),s("div",[e._v("\n Email:\n "),s("strong",[e._v(e._s(e.$store.state.user.details.organization.email))])]),e.confirmDetails?e._e():s("a-button",{staticClass:"spacing--sm-top spacing--sm-bottom",attrs:{type:"primary"},on:{click:function(t){e.$refs.editorganization.showModal()}}},[e._v("Opdater oplysninger")]),s("div",{staticClass:"confirm-checks"},[s("a-checkbox",{model:{value:e.confirmDetails,callback:function(t){e.confirmDetails=t},expression:"confirmDetails"}},[e._v("Ovenstående er korrekte oplysninger")])],1),s("div",[s("a-checkbox",{model:{value:e.confirmConditions,callback:function(t){e.confirmConditions=t},expression:"confirmConditions"}},[e._v("\n Jeg bekræfter\n "),s("a",{attrs:{href:"http://timero.dk/handelsbetingelser",target:"blank"}},[e._v("handelsbetingelserne")])])],1),s("div",[s("a-checkbox",{model:{value:e.confirmSubscription,callback:function(t){e.confirmSubscription=t},expression:"confirmSubscription"}},[e._v("\n Jeg bekræfter\n "),s("a",{attrs:{href:"http://timero.dk/abonnementsbetingelser",target:"blank"}},[e._v("abonnementsbetingelserne")])])],1)],1):s("div",[s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{showIcon:"",type:"warning",message:"Vi mangler nogle oplysninger, før du kan opgradere"}}),s("a-button",{attrs:{type:"primary"},on:{click:function(t){e.$refs.editorganization.showModal()}}},[e._v("Opdater oplysninger")])],1),s("a-button",{staticClass:"spacing--sm-top",attrs:{type:"primary",size:"large",loading:e.loading,disabled:!e.confirmDetails||!e.confirmConditions||!e.confirmSubscription},on:{click:e.upgrade}},[e._v("Tilknyt betalingskort")])],1):e._e(),s("div",{staticClass:"cards"},[s("img",{staticClass:"card",attrs:{src:"https://timero.dk/Images/visa.svg",alt:"Visa"}}),s("img",{staticClass:"card",attrs:{src:"https://timero.dk/Images/maestro.svg",alt:"Maestro"}}),s("img",{staticClass:"card",attrs:{src:"https://timero.dk/Images/mastercard.svg",alt:"Mastercard"}})])],1)],1),s("a-card",{attrs:{title:"Prisberegner"}},[s("h4",[e._v("Antal brugere")]),s("a-row",{attrs:{type:"flex",gutter:16}},[s("a-col",{attrs:{span:3}},[s("a-input-number",{staticClass:"spacing--sm-top",staticStyle:{width:"100%"},attrs:{min:1},model:{value:e.priceCalculatedUsers,callback:function(t){e.priceCalculatedUsers=t},expression:"priceCalculatedUsers"}})],1),s("a-col",{attrs:{span:21}},[s("a-slider",{attrs:{min:1,tipFormatter:e.formatter,marks:e.marks},model:{value:e.priceCalculatedUsers,callback:function(t){e.priceCalculatedUsers=t},expression:"priceCalculatedUsers"}})],1)],1),s("a-row",{attrs:{type:"flex",gutter:16}},[s("a-col",{attrs:{span:10}},[s("h2",{staticStyle:{"margin-bottom":"0"}},[e._v("Total DKK "+e._s(e.priceCalculatedMonth)+" pr. måned")]),s("div",[s("a-tag",[e._v("DKK "+e._s(e.priceCalculatedUser)+" pr. bruger for "+e._s(e.priceCalculatedUsers)+" brugere")])],1),s("div",[s("i",[e._v("Priser eks. moms")])])]),s("a-col",{attrs:{span:14}},[s("h4",[e._v("Tracking")]),s("a-switch",{model:{value:e.priceCalculatedTracking,callback:function(t){e.priceCalculatedTracking=t},expression:"priceCalculatedTracking"}}),e._v("+30 /bruger\n ")],1)],1)],1),s("a-alert",{staticClass:"spacing--top",attrs:{message:"Er du i tvivl om noget?",description:"Kontakt os på chatten, support@timero.dk eller 93 87 10 87 og få svar på dine spørgsmål",type:"info",showIcon:""}}),s("edit-organization",{ref:"editorganization",on:{update:e.checkDetails}})],1)},Ca=[],Sa=(s("6762"),s("2fdb"),{name:"Subscription",components:{EditOrganization:os},data:function(){return{confirmDetails:!1,confirmConditions:!1,confirmSubscription:!1,confirmModalVisible:!1,priceCalculatedUsers:1,priceCalculatedTracking:!1,showUpdateGuide:!1,hasDetails:!1,subscription:null,subscriptionStatus:null,addons:[],loading:!1,marks:{0:"1",5:"5",15:"15",30:"30",100:"100+"},prices:{0:"70",5:"60",15:"50",30:"40",100:"30"}}},mounted:function(){this.priceCalculatedUsers=this.$store.state.user.details.organization.user_count,this.priceCalculatedTracking=this.$store.state.user.details.organization.addons.includes("tracking"),this.$parent.setMenu("Subscription"),this.currentprice=this.$store.state.user.details.organization.monthly_price,this.getAddons(),this.checkDetails(),this.$store.state.user.details.organization.is_pro&&this.getSubscription(),"activated"===this.$route.query.subscription?(this.getSubscription(),this.$store.commit("user/setOrganizationState",{subscription_status:"active"}),this.$message.success("Du har nu Timero Pro"),this.$router.replace(Object(Ks["a"])({},this.$router.currentRoute,{query:{subscription:void 0}}))):"cancelled"===this.$route.query.subscription&&(this.getSubscription(),this.$message.error("Din oprettelse blev afbrudt"),this.$router.replace(Object(Ks["a"])({},this.$router.currentRoute,{query:{subscription:void 0}}))),this.subscriptionStatus=this.$store.state.user.details.organization.subscription_status},computed:{expirationDate:function(){return this.$store.state.user.details.organization.expiration_date&&this.$moment(this.$store.state.user.details.organization.expiration_date)>this.$moment()?this.$store.state.user.details.organization.expiration_date:null},priceCalculatedUser:function(){var e=this,t=null;Y()(this.marks).map(function(s){se.$moment(s.created_at)},scopedSlots:{customRender:"created"}},{title:"Download",key:"action",align:"right",scopedSlots:{customRender:"action"}}],pagination:{pageSize:20},loading:!1,gettingPaymentLink:0}},mounted:function(){this.$parent.setMenu("OrderHistory"),this.getOrders()},methods:{downloadPDF:function(e){this.$axios.get("/getOrderPDF/"+e,{responseType:"arraybuffer"}).then(function(e){var t=new Blob([e.data],{type:"application/pdf"}),s=document.createElement("a");s.href=URL.createObjectURL(t),s.download="Faktura",document.body.append(s),s.click(),s.remove()})},getPaymentLink:function(e){this.gettingPaymentLink=e,this.$axios.post("/payment-link/"+e).then(function(e){window.location.href=e.data.url})},getOrders:function(){var e=this;this.loading=!0,this.$axios.get("/orders").then(function(t){e.orders=t.data.orders,e.loading=!1})}}},Ea=Fa,Aa=Object(f["a"])(Ea,Ua,Oa,!1,null,null,null),qa=Aa.exports,Na=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"timesheets"},[!e.$store.state.user.details.organization.has_pro_access&&e.$store.state.user.details.organization.user_count>10?s("div",[s("pro-feature",{attrs:{text:"Du har mere end 10 brugere, men har ikke PRO adgang"}})],1):s("div",[s("h1",{staticClass:"title hidden-print"},[s("span",[e._v("\n Timeregistrering\n "),s("a",{staticClass:"title__help-button",attrs:{href:"https://timero.dk/supportcenter/timeregistrering/",target:"blank"}},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Få hjælp til timeregistrering")]),s("a-button",{attrs:{type:"dashed",size:"small",shape:"circle",icon:"question"}})],2)],1)])]),s("new-time-entry",{ref:"newTimeEntry",attrs:{"specified-user":e.selectedUser},on:{done:e.getTimesheet}}),s("timesheet-entry-locations",{ref:"timesheetEntryLocations"}),s("div",[s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[s("a-button",{staticClass:"hidden-print",attrs:{size:"small",icon:"left"},on:{click:function(t){e.navigateTimesheet(e.timesheet.prev_year,e.timesheet.prev_week,e.selectedUser.id)}}})],1),s("a-col",[s("strong",[e._v("\n Uge\n "),s("a-select",{staticClass:"spacing--sm-right",staticStyle:{width:"60px"},attrs:{size:"small"},on:{change:e.changeDate},model:{value:e.timesheet.current_week,callback:function(t){e.$set(e.timesheet,"current_week",t)},expression:"timesheet.current_week"}},e._l(53,function(t){return s("a-select-option",{key:t,attrs:{value:t}},[e._v(e._s(t))])}),1),e._v("År\n "),s("a-select",{staticStyle:{width:"80px"},attrs:{size:"small"},on:{change:e.changeDate},model:{value:e.timesheet.current_year,callback:function(t){e.$set(e.timesheet,"current_year",t)},expression:"timesheet.current_year"}},e._l(e.years,function(t){return s("a-select-option",{key:t,attrs:{value:t}},[e._v(e._s(t))])}),1)],1),e.timesheet.timesheet?s("span",{staticClass:"spacing--sm-left"},[s("strong",[e._v("Dato:")]),e._v("\n "+e._s(e._f("formatDate")(e.timesheet.timesheet[0].date))+" -\n "+e._s(e._f("formatDate")(e.timesheet.timesheet[6].date))+"\n ")]):e._e(),e.$moment().week()!=e.timesheet.current_week||e.$moment().year()!=e.timesheet.current_year?s("a-button",{staticClass:"hidden-print spacing--sm-left",attrs:{size:"small"},on:{click:function(t){e.navigateTimesheet(e.$moment().year(),e.$moment().week(),e.selectedUser.id)}}},[e._v("Nuværende uge")]):e._e()],1),s("a-col",[s("a-button",{staticClass:"hidden-print",attrs:{size:"small",icon:"right"},on:{click:function(t){e.navigateTimesheet(e.timesheet.next_year,e.timesheet.next_week,e.selectedUser.id)}}})],1)],1)],1),s("div",{staticClass:"spacing--top"},[s("a-card",{attrs:{loading:e.loading}},[s("div",{staticClass:"hidden-print",attrs:{slot:"extra"},slot:"extra"},[s("a-checkbox",{attrs:{disabled:!e.$store.state.user.details.is_admin},on:{change:e.toggleWeek},model:{value:e.week_closed,callback:function(t){e.week_closed=t},expression:"week_closed"}},[e._v("Luk uge")]),s("a-button",{attrs:{shape:"circle",icon:"printer"},on:{click:e.print}}),s("a-button",{staticClass:"spacing--sm-left",attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.newTimeEntry.showModal()}}},[e._v("Tilføj registrering")])],1),s("div",{attrs:{slot:"title"},slot:"title"},[e.$store.state.user.details.is_admin&&e.$store.state.user.users?s("searcher",{attrs:{single:"",type:"users",data:e.$store.state.user.users,value:e.selectedUser.id,showArrow:""},on:{select:e.handleChange}}):e._e(),e.$store.state.user.details.is_admin?e._e():s("span",[e._v(e._s(e.$store.state.user.details.name))])],1),s("div",[e.loading?e._e():s("div",[e._l(e.timesheet.timesheet,function(t){return s("div",{key:t.date,staticClass:"spacing--sm-bottom"},[s("h3",{staticClass:"timesheet-entry__header"},[s("span",[e._v(e._s(t.weekday)+" ("+e._s(e._f("formatDate")(t.date))+")")]),t.entries.length?s("span",[e._v("I alt for "+e._s(t.weekday.toLowerCase())+":\n "+e._s(t.total_day_hours)+" timer")]):e._e()]),t.entries.length?s("div",[s("a-list",{attrs:{bordered:"",dataSource:t.entries,size:"small"},scopedSlots:e._u([{key:"renderItem",fn:function(t){return s("a-list-item",{},[s("div",{staticClass:"timesheet-entry"},[s("div",[s("div",[s("strong",[e._v(e._s(t.timesheet_task.name))])]),t.comment?s("div",[e._v(e._s(t.comment))]):s("div",{staticClass:"timesheet-entry__no-comment"},[e._v("\n Ingen kommentar\n ")])]),s("div",{staticClass:"timesheet-entry__actions"},[t.mileage&&0!=t.mileage?s("div",{staticClass:"timesheet-entry__duration spacing--right"},[s("a-icon",{attrs:{type:"car"}}),e._v("\n "+e._s(t.mileage)+" km\n ")],1):e._e(),s("div",{staticClass:"timesheet-entry__duration spacing--left"},[e._v("\n "+e._s(parseFloat(t.hours).toFixed(2))+" timer\n "),e.$store.state.user.details.organization.has_stopwatch?s("span",[0==t.status?s("a-tooltip",[s("template",{slot:"title"},[e._v("Dette er en manuel indtastet\n registrering")]),s("div",{staticClass:"timesheet-entry__manuel hidden-print"},[e._v("\n Manuel\n ")])],2):e._e(),e.isSus(t)?s("a-tooltip",[s("template",{slot:"title"},[e._v("Denne indtastning har mistænkelige\n tidsangivelser")]),s("div",{staticClass:"timesheet-entry__manuel hidden-print"},[e._v("\n Mistænksom\n ")])],2):e._e(),2==t.status?s("a-tooltip",[s("template",{slot:"title"},[e._v("GPS lokation er forsøgt, men kunne ikke\n bestemmes, pga. dårligt signal")]),s("div",{staticClass:"timesheet-entry__manuel hidden-print"},[e._v("\n Ingen GPS\n ")])],2):e._e()],1):e._e()]),e.$store.state.user.details.organization.addons.includes("tracking")?s("div",{staticClass:"spacing--sm-right hidden-print"},[t.tracking_checkpoints.length?s("div",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Se lokationer for denne\n registrering")]),s("a-button",{attrs:{shape:"circle",icon:"environment"},on:{click:function(s){e.$refs.timesheetEntryLocations.showModal(t.tracking_checkpoints)}}})],2)],1):s("div",[s("a-tooltip",[s("template",{slot:"title"},[e._v("Der er ikke registreret nogen\n lokationer")]),s("a-button",{attrs:{disabled:"",shape:"circle",icon:"stop"}})],2)],1)]):e._e(),s("div",{staticClass:"hidden-print"},[s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.removeEntry(t)}}},[s("template",{slot:"title"},[s("p",[e._v("\n Er du sikker på at du vil fjerne denne\n registrering?\n ")])]),s("a-button",{attrs:{shape:"circle",icon:"delete"}})],2)],1)])])])}}])})],1):e._e(),t.entries.length?e._e():s("div",{staticClass:"timesheet-entry__no-comment"},[e._v("\n Ingen sager\n ")])])}),e.timesheet?s("a-row",{attrs:{type:"flex",justify:"end"}},[s("a-col",[s("div",{staticClass:"timesheet-entry__total"},[s("strong",[e._v("Total:")]),s("div",[s("a-icon",{attrs:{type:"clock-circle"}}),e._v("Tid:\n "),s("strong",[e._v(e._s(e.timesheet.total_week_hours)+" timer")])],1),e.timesheet.total_week_mileage?s("div",[s("a-icon",{attrs:{type:"car"}}),e._v("Kørsel\n "),s("strong",[e._v(e._s(e.timesheet.total_week_mileage)+" km")])],1):e._e()])])],1):e._e()],2)])])],1)],1)])},Ma=[],Pa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Lokationer",width:"800px",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[e.tracking.length?s("div",[s("a-alert",{staticClass:"spacing--sm-bottom",attrs:{type:"info",message:"Klik på markørerne, for at se tidspunkt, eller klik på et tidspunkt for at se markør",showIcon:""}}),s("GmapMap",{ref:"map",staticStyle:{width:"100%",height:"500px"},attrs:{center:e.center,zoom:e.zoom,"map-type-id":"terrain"}},[e._l(e.tracking,function(t,a){return s("GmapMarker",{key:t.id,attrs:{position:e.position(t),clickable:!0,opacity:e.activeLocation===a?1:.3},on:{click:function(t){e.setActiveLocation(a)}}})}),e.path.length>0?s("GmapPolyline",{ref:"polyline",attrs:{path:e.path}}):e._e()],2),s("a-timeline",{staticClass:"spacing--top"},e._l(e.tracking,function(t,a){return s("a-timeline-item",{key:t.id,staticClass:"pointer",class:{active:e.activeLocation===a},on:{click:function(t){e.setActiveLocation(a)}}},[s("a-icon",{attrs:{type:"clock-circle"}}),e._v("\n "+e._s(e._f("formatTime")(t.datetime))+"\n Registrering\n "),"stop"===t.type?s("span",[e._v("stoppet")]):s("span",[e._v("startet")]),e.difference(t.datetime,t.created_at)>.25?s("a-alert",{staticClass:"sus",attrs:{message:"Registrering oprettet "+e.difference(t.datetime,t.created_at)+" timer før enhedes angivne tidspunkt",banner:""}}):e._e()],1)}),1)],1):e._e()])],1)},Ra=[],La={name:"TimesheetEntryLocations",data:function(){return{loading:!1,visible:!1,tracking:[],center:{lat:56.2778103,lng:10.2639133},zoom:10,path:[],activeLocation:null}},methods:{difference:function(e,t){return this.$moment(e).diff(this.$moment(t),"hours",!0).toFixed(2)},showModal:function(e){this.tracking=e,this.visible=!0,this.drawPath(),this.setActiveLocation(0)},position:function(e){return{lat:n()(e.lat),lng:n()(e.lng)}},setActiveLocation:function(e){var t=this;this.activeLocation=e,this.$nextTick(function(){t.$refs.map.$mapPromise.then(function(s){s.panTo(t.position(t.tracking[e]))})})},drawPath:function(){var e=this;this.path=[],this.tracking.map(function(t){e.path.push(e.position(t))})}}},Va=La,Ka=(s("d2de"),Object(f["a"])(Va,Pa,Ra,!1,null,"9a1a1906",null)),Ba=Ka.exports,Ga={name:"Timesheets",components:{Searcher:z,NewTimeEntry:Qs,TimesheetEntryLocations:Ba,ProFeature:js},data:function(){return{loading:!1,timesheet:{timesheet:null,current_week:null,current_year:null,next_week:null,next_year:null,prev_week:null,prev_year:null},years:[],week_closed:!1,selectedUser:this.$store.state.user.details}},methods:{getTimesheet:function(){var e=this;this.loading=!0;var t="timesheetEntries";this.$route.params.year&&this.$route.params.week&&this.$route.params.user&&(t="timesheetEntries/"+this.$route.params.year+"/"+this.$route.params.week+"/"+this.$route.params.user),this.$axios.get(t).then(function(t){e.timesheet=t.data,e.week_closed=t.data.week_closed,e.loading=!1})},isSus:function(e){var t=this;return!!e.tracking_checkpoints.length&&e.tracking_checkpoints.find(function(e){return t.$moment(e.datetime).diff(t.$moment(e.created_at),"hours",!0).toFixed(2)>.25})},navigateTimesheet:function(e,t,s){this.$router.push({name:"Timesheets",params:{year:e,week:t,user:s}}),this.getTimesheet()},handleChange:function(e){this.selectedUser=e,this.navigateTimesheet(this.timesheet.current_year,this.timesheet.current_week,this.selectedUser.id)},removeEntry:function(e){this.$store.dispatch("task/removeEntry",e.id),this.getTimesheet()},changeDate:function(){this.navigateTimesheet(this.timesheet.current_year,this.timesheet.current_week,this.selectedUser.id)},toggleWeek:function(){var e="open";this.week_closed&&(e="close"),this.$axios.post("/week/"+this.$route.params.year+"/"+this.$route.params.week+"/"+e)},print:function(){window.print()},populateYears:function(){for(var e=this.$moment(this.$store.state.user.details.organization.created_at).year();e<=this.$moment().year();e++)this.years.push(e)}},mounted:function(){this.$store.commit("setCurrentPage","timesheets"),this.$store.state.user.details.is_admin&&this.$store.dispatch("user/getUsers"),this.populateYears(),this.getTimesheet()}},Ha=Ga,Ja=(s("a419"),Object(f["a"])(Ha,Na,Ma,!1,null,null,null)),Ya=Ja.exports,Qa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$store.state.user.details.organization.is_on_trial?s("a-alert",{staticClass:"spacing--bottom",attrs:{showIcon:"",message:"Dette er en PRO feature",description:"Du har "+e.$moment(e.$store.state.user.details.organization.created_at).add(30,"days").diff(e.$moment(),"days")+" dage tilbage af din prøveperiode",type:"info"}}):e._e(),e.document?s("div",[s("h1",{staticClass:"title"},[s("span",[e._v("\n "+e._s(e.document.name)+"\n "),s("a",{staticClass:"title__help-button",attrs:{href:"https://timero.dk/supportcenter/filer-og-dokumenter/",target:"blank"}},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Få hjælp til dokumenthåndtering")]),s("a-button",{attrs:{type:"dashed",size:"small",shape:"circle",icon:"question"}})],2)],1)]),e.$store.state.user.details.is_admin&&!e.document.is_root?s("a-button",{attrs:{shape:"circle",icon:"edit"},on:{click:function(t){e.$refs.editContent.showModal()}}}):e._e()],1),e.$store.state.user.details.is_admin&&!e.document.is_root?s("edit-content",{ref:"editContent",attrs:{item:e.document},on:{"update-name":e.updateName}}):e._e(),s("a-breadcrumb",{staticClass:"spacing--bottom"},[s("a-breadcrumb-item",[e._v("Du er her:")]),e._l(e.document.breadcrumbs,function(t){return s("a-breadcrumb-item",{key:t.id,staticClass:"breadcrumb-item"},[t.id?s("router-link",{attrs:{to:"/documents/"+t.id}},[e._v(e._s(t.name))]):s("span",[e._v(e._s(t.name))])],1)})],2),"folder"==e.document.type?s("Folder",{ref:"folderComponent",attrs:{folder:e.document},on:{shared:e.setShared}}):e._e(),"file"==e.document.type?s("File",{attrs:{file:e.document}}):e._e(),"document"==e.document.type?s("Document",{attrs:{document:e.document}}):e._e()],1):s("Loading",{attrs:{text:"Indlæser dokumenter..."}})],1)},Wa=[],Xa=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Rediger",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",{attrs:{label:"Navn"}},[s("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"Indtast venligst et navn"}]}],expression:"['name', { rules: [{ required: true, message: 'Indtast venligst et navn' }] }]"}],attrs:{"auto-focus":"",placeholder:"Indtast navn"}})],1),s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Gem")])],1),s("a-col",[s("a-button",{attrs:{loading:e.loading},on:{click:e.deleteContent}},[s("a-icon",{attrs:{type:"delete"}}),e._v("Slet\n ")],1)],1)],1)],1)],1)],1)},Za=[],en={name:"EditContent",data:function(){return{loading:!1,visible:!1}},props:{item:{type:Object,required:!0}},methods:{showModal:function(){var e=this;this.visible=!0,setTimeout(function(){e.form.setFieldsValue({name:e.item.name})})},deleteContent:function(){var e=this;this.loading=!0,this.$axios.delete("/documents/"+this.item.id).then(function(){e.$router.push({path:"/documents/".concat(e.item.parent_folder_id)}),e.visible=!1,e.$notification["success"]({message:"Success!",description:e.form.getFieldValue("name")+" blev slettet"}),e.loading=!1})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){e||(t.loading=!0,t.$axios.patch("/documents/"+t.item.id,{name:t.form.getFieldValue("name")}).then(function(){t.$emit("update-name",t.form.getFieldValue("name")),t.visible=!1,t.loading=!1}))})}},beforeCreate:function(){this.form=this.$form.createForm(this)}},tn=en,sn=Object(f["a"])(tn,Xa,Za,!1,null,null,null),an=sn.exports,nn={name:"Documents",components:{EditContent:an,Document:ke,File:Ue,Folder:ct,Loading:Se},data:function(){return{document:null}},methods:{updateName:function(e){this.document.name=e},setShared:function(e){this.document.is_shared=e},getContent:function(){var e=this;this.$store.commit("setLoading",!0),this.$route.params.id?this.$axios.get("/documents/"+this.$route.params.id).then(function(t){e.document=t.data.document,e.$store.commit("setLoading",!1)}):this.$axios.get("/documentsRoot").then(function(t){e.document=t.data.document,e.$store.commit("setLoading",!1)})}},watch:{$route:function(){this.getContent()}},mounted:function(){this.$store.commit("setCurrentPage","documents"),this.getContent()}},rn=nn,on=Object(f["a"])(rn,Qa,Wa,!1,null,null,null),ln=on.exports,cn=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e.$store.state.user.details.organization.is_on_trial?s("a-alert",{staticClass:"spacing--bottom",attrs:{showIcon:"",message:"Dette er en PRO feature",description:"Du har "+e.$moment(e.$store.state.user.details.organization.created_at).add(30,"days").diff(e.$moment(),"days")+" dage tilbage af din prøveperiode",type:"info"}}):e._e(),s("h1",{staticClass:"title"},[s("span",[e._v("\n Beskeder\n "),s("a",{staticClass:"title__help-button",attrs:{href:"https://timero.dk/supportcenter/firmabeskeder/",target:"blank"}},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Få hjælp til beskeder")]),s("a-button",{attrs:{type:"dashed",size:"small",shape:"circle",icon:"question"}})],2)],1)]),e.$store.state.user.details.is_admin?s("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.$refs.newMessage.showModal()}}},[e._v("Ny besked")]):e._e()],1),e.$store.state.user.details.is_admin?s("new-message",{ref:"newMessage",on:{"new-message":e.pushMessage}}):e._e(),e.notSentMessages.length||e.sentMessages.length?s("div",[e.$store.state.user.details.is_admin?s("div",[s("h2",[e._v("Afventer afsendelse")]),s("a-table",{attrs:{columns:e.notSentColumns,rowKey:function(e){return e.id},dataSource:e.notSentMessages.reverse(),size:"small",pagination:e.pagination,loading:e.loading},scopedSlots:e._u([{key:"document",fn:function(t){return s("span",{},[t.document?s("div",[s("router-link",{attrs:{to:{name:"SubDocuments",params:{id:t.document.id}}}},[e._v(e._s(t.document.name))])],1):e._e()])}},{key:"scheduling",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"created",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"actions",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[e.$store.state.user.details.is_admin?s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.deleteMessage(t.id)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil slette denne besked?")])]),s("a-button",{attrs:{shape:"circle",icon:"delete",loading:e.removing}})],2):e._e()],1)],1)],1)}}])}),s("h2",{staticClass:"spacing--top"},[e._v("Sendte beskeder")])],1):e._e(),s("a-table",{attrs:{columns:e.sentColumns,rowKey:function(e){return e.id},dataSource:e.sentMessages.reverse(),size:"small",pagination:e.pagination,loading:e.loading},scopedSlots:e._u([{key:"document",fn:function(t){return s("span",{},[t.document?s("div",[s("router-link",{attrs:{to:{name:"SubDocuments",params:{id:t.document.id}}}},[e._v(e._s(t.document.name))])],1):e._e()])}},{key:"sent",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"actions",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[e.$store.state.user.details.is_admin?s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.resendMessage(t.id)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil sende denne besked igen?")])]),s("a-button",{attrs:{shape:"circle",icon:"reload",loading:e.sending}})],2):e._e()],1)],1)],1)}}])})],1):e._e(),e.loading||e.notSentMessages.length||e.sentMessages.length?e._e():s("a-alert",{attrs:{showIcon:"",message:"Du har endnu ikke sendt nogle beskeder",description:"Tryk på ny besked for at komme igang",type:"info"}}),s("Loading",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],attrs:{text:"Indlæser beskeder..."}})],1)},dn=[],un=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-modal",{attrs:{title:"Ny besked",footer:null},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("a-form",{attrs:{form:e.form},on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},[s("a-form-item",[s("a-switch",{model:{value:e.isPlanned,callback:function(t){e.isPlanned=t},expression:"isPlanned"}}),s("span",{staticClass:"spacing--xs-left"},[e._v("Planlæg beskeden til senere udsendelse")]),e.isPlanned?s("div",[s("a-date-picker",{attrs:{showTime:{format:"HH:mm"},format:"DD-MM-YYYY HH:mm",placeholder:"Vælg tidspunkt"},model:{value:e.schedule,callback:function(t){e.schedule=t},expression:"schedule"}})],1):e._e()],1),s("a-form-item",[s("a-switch",{model:{value:e.isUserSpecific,callback:function(t){e.isUserSpecific=t},expression:"isUserSpecific"}}),s("span",{staticClass:"spacing--xs-left"},[e._v("Udvælg brugere, ellers sendes beskeden til alle i firmaet")]),e.isUserSpecific?s("div",[s("searcher",{attrs:{multiple:"",identifier:"id",data:e.$store.state.user.users,type:"users",selectedArray:e.selectedUsers},on:{select:e.selectUser}}),e.selectedUsers&&e.selectedUsers.length?s("div",e._l(e.selectedUsers,function(t){return s("div",{key:t.id},[e._v("\n "+e._s(t.name)+"\n "),s("a-icon",{attrs:{type:"close"},on:{click:function(s){e.removeUser(t.id)}}})],1)}),0):e._e()],1):e._e()],1),s("a-form-item",{attrs:{label:"Besked"}},[s("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["body",{rules:[{required:!0,message:"Indtast venligst en besked"}]}],expression:"['body', { rules: [{ required: true, message: 'Indtast venligst en besked' }] }]"}],attrs:{"auto-focus":"",placeholder:"Din besked"}})],1),s("a-form-item",{attrs:{label:"Vedhæftet indhold"}},[s("searcher",{attrs:{single:"",remote:"",type:"documents",value:e.attachmentId},on:{select:e.selectDocument}})],1),s("a-row",{attrs:{type:"flex",justify:"space-between"}},[s("a-col",[s("a-button",{key:"submit",attrs:{type:"primary",htmlType:"submit",loading:e.loading}},[e._v("Send")])],1)],1)],1)],1)],1)},mn=[],pn={name:"NewMessage",components:{Searcher:z},data:function(){return{attachmentId:void 0,attachment:void 0,selectedUsers:[],loading:!1,visible:!1,isPlanned:!1,isUserSpecific:!1,schedule:null}},computed:{selectedUserIds:function(){var e=[];return this.selectedUsers.map(function(t){e.push(t.id)}),e}},methods:{showModal:function(){this.visible=!0},removeAttachment:function(){this.attachment=null},selectDocument:function(e){this.attachment=e,this.attachmentId=e?e.id:void 0},selectUser:function(e){this.selectedUsers.filter(function(t){return t.id==e.id}).length?this.$message.info("Brugeren er allerede valgt"):this.selectedUsers.push(e)},removeUser:function(e){this.selectedUsers=this.selectedUsers.filter(function(t){return t.id!=e})},handleSubmit:function(e){var t=this;e.preventDefault(),this.form.validateFields(function(e){if(!e){t.loading=!0;var s={body:t.form.getFieldValue("body"),document_id:null,is_scheduling:t.isPlanned,is_user_selection:t.isUserSpecific,scheduling_datetime:t.$moment(t.schedule).set({second:0}).format("Y-MM-DD HH:mm:ss"),userIds:null};t.attachment&&(s.document_id=t.attachment.id),t.isPlanned||(s.scheduling_datetime=null),t.isUserSpecific&&(s.userIds=t.selectedUserIds),t.$axios.post("/messages",s).then(function(e){t.$emit("new-message",e.data.message),t.visible=!1,t.body="",t.attachment=null,t.attachmentId=null,t.selectedUsers=[],t.loading=!1,t.visible=!1,t.isPlanned=!1,t.isUserSpecific=!1,t.schedule=null,t.form.resetFields(),t.$notification["success"]({message:"Success!",description:"Din besked er sendt!"}),t.loading=!1})}})}},mounted:function(){this.$store.dispatch("user/getUsers")},beforeCreate:function(){this.form=this.$form.createForm(this)}},fn=pn,gn=Object(f["a"])(fn,un,mn,!1,null,null,null),hn=gn.exports,vn={name:"Messages",components:{NewMessage:hn,Loading:Se},data:function(){var e=this;return{pagination:{pageSize:20},messages:[],loading:!1,removing:!1,sending:!1,notSentColumns:[{title:"Indhold",key:"body",sorter:function(e,t){return e.body>t.body},dataIndex:"body"},{title:"Dokument",key:"document",scopedSlots:{customRender:"document"}},{title:"Planlagt til",dataIndex:"scheduling_datetime",sorter:function(t,s){return e.$moment(t.scheduling_datetime)>e.$moment(s.scheduling_datetime)},scopedSlots:{customRender:"scheduling"},key:"scheduling"},{title:"",key:"actions",scopedSlots:{customRender:"actions"}}],sentColumns:[{title:"Indhold",key:"body",dataIndex:"body"},{title:"Dokument",key:"document",scopedSlots:{customRender:"document"}},{title:"Afsendt",dataIndex:"sent_at",scopedSlots:{customRender:"sent"},key:"sent"},{title:"",key:"actions",scopedSlots:{customRender:"actions"}}]}},methods:{getMessages:function(){var e=this;this.loading=!0;var t=this.$store.state.user.details.is_admin?"/messages":"/getMessagesForUser";this.$axios.get(t).then(function(t){e.messages=t.data.messages?t.data.messages:[],e.loading=!1})},removeMessage:function(e){var t=this.messages.filter(function(t){return t.id!==e});this.messages=t},pushMessage:function(e){this.messages.push(e)},deleteMessage:function(e){var t=this;this.removing=!0,this.$axios.delete("/messages/"+e).then(function(){t.removeMessage(e),t.$notification["success"]({message:"Beskeden er nu slettet",description:"Beskeden er nu permanent fjernet"}),t.removing=!1})},resendMessage:function(e){var t=this;this.sending=!0,this.$axios.get("/sendMessageAgain/"+e).then(function(e){t.pushMessage(e.data.message),t.$notification["success"]({message:"Beskeden er nu gensendt",description:"Beskeden er nu blevet sendt til de udvalgte medarbejdere"}),t.sending=!1})}},computed:{notSentMessages:function(){return this.messages.filter(function(e){return!e.is_sent})},sentMessages:function(){return this.messages.filter(function(e){return e.is_sent})}},mounted:function(){this.$store.commit("setCurrentPage","messages"),this.getMessages()}},_n=vn,bn=Object(f["a"])(_n,cn,dn,!1,null,null,null),kn=bn.exports,yn=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.$store.state.task.currentTask?s("div",[s("a-menu",{staticClass:"spacing--bottom",attrs:{mode:"horizontal"},model:{value:e.current,callback:function(t){e.current=t},expression:"current"}},[s("a-menu-item",{key:"UsersActive"},[s("router-link",{attrs:{to:{name:"UsersActive"}}},[e._v("Brugere")])],1),s("a-menu-item",{key:"UsersDeactivated"},[s("router-link",{attrs:{to:{name:"UsersDeactivated"}}},[e._v("Deativerede brugere")])],1)],1),s("router-view")],1):e._e()},wn=[],$n={name:"Task",data:function(){return{current:[]}},methods:{setMenu:function(e){this.current=[e]}},mounted:function(){this.$store.commit("setCurrentPage","users")}},xn=$n,jn=Object(f["a"])(xn,yn,wn,!1,null,null,null),Tn=jn.exports,Cn=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h1",{staticClass:"title"},[s("span",[e._v("\n Brugere\n "),s("a",{staticClass:"title__help-button",attrs:{href:"https://timero.dk/supportcenter/brugere/",target:"blank"}},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[e._v("Få hjælp til brugerhåndtering")]),s("a-button",{attrs:{type:"dashed",size:"small",shape:"circle",icon:"question"}})],2)],1)]),s("div",{staticClass:"title__text"},[s("a-button",{staticClass:"spacing--sm-left",attrs:{type:"primary",disabled:!e.$store.state.user.details.organization.is_pro&&e.$store.state.user.details.organization.user_count>=10},on:{click:function(t){e.$refs.create.showModal()}}},[s("a-icon",{attrs:{type:"plus"}}),e._v("Ny bruger\n ")],1)],1)]),s("create-user",{ref:"create",on:{"push-user":e.pushUser}}),!e.$store.state.user.details.organization.is_pro&&e.$store.state.user.details.organization.user_count>=10?s("pro-feature",{attrs:{text:"Du har ikke plads til flere brugere"}}):e._e(),s("div",{staticClass:"spacing--sm-bottom"},[e._v("\n Du har\n "),s("strong",[e._v(e._s(e.users.length))]),e._v(" brugere\n ")]),s("a-table",{attrs:{rowKey:function(e){return e.id},columns:e.columns,dataSource:e.users,pagination:e.pagination,size:"small",loading:e.loading},scopedSlots:e._u([{key:"admin",fn:function(t){return s("span",{},[t.is_admin?s("span",{staticClass:"spacing--sm-right"},[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Er administrator")])]),s("a-icon",{attrs:{type:"crown"}})],2)],1):e._e(),t.is_allocated_to_all_tasks?s("span",[s("a-tooltip",{attrs:{placement:"top"}},[s("template",{slot:"title"},[s("span",[e._v("Er allokeret alle opgaver")])]),s("a-icon",{attrs:{type:"star"}})],2)],1):e._e()])}},{key:"created",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"action",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[s("a-tooltip",{attrs:{placement:"left"}},[s("template",{slot:"title"},[e._v("Rediger bruger")]),e.$store.state.user.details.is_admin?s("a-button",{attrs:{shape:"circle",icon:"edit"},on:{click:function(s){e.$refs["edit"+t.id].showModal()}}}):e._e()],2)],1),s("a-col",[e.$store.state.user.details.is_admin?s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.deactivateUser(t.id)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil deaktivere denne bruger? (Brugerdata bliver ikke slettet)")])]),s("a-tooltip",{attrs:{placement:"left"}},[s("template",{slot:"title"},[e._v("Deaktiver bruger")]),s("a-button",{attrs:{shape:"circle",icon:"close",loading:e.removing}})],2)],2):e._e()],1)],1),s("edit-user",{ref:"edit"+t.id,attrs:{user:t}})],1)}}])})],1)},Sn=[],zn={name:"Users",components:{EditUser:ps,ProFeature:js,CreateUser:It},data:function(){var e=this;return{user:null,loading:!1,users:[],removing:!1,pagination:{pageSize:20},columns:[{title:"Navn",dataIndex:"name",sorter:function(e,t){return e.name>t.name},key:"name"},{title:"Admin",key:"admin",sorter:function(e,t){return e.is_admin===t.is_admin?0:e.is_admin?-1:1},scopedSlots:{customRender:"admin"}},{title:"Email",dataIndex:"email",sorter:function(e,t){return e.email>t.email},key:"email"},{title:"Telefon",dataIndex:"phone",sorter:function(e,t){return e.phone>t.phone},key:"phone"},{title:"Oprettet",dataIndex:"created_at",sorter:function(t,s){return e.$moment(t.created_at)>e.$moment(s.created_at)},key:"created",scopedSlots:{customRender:"created"}},{title:"",key:"action",scopedSlots:{customRender:"action"}}]}},methods:{pushUser:function(e){this.users.push(e)},removeUser:function(e){var t=this.users.filter(function(t){return t.id!==e});this.users=t},deactivateUser:function(e){var t=this;this.removing=!0,this.$axios.delete("/users/"+e).then(function(){t.removeUser(e),t.$message.success("Brugeren er nu deaktiveret"),t.$store.commit("user/decreaseUsers",1),t.removing=!1})}},mounted:function(){var e=this;this.$parent.setMenu("UsersActive"),this.user=this.$store.state.user.details,this.loading=!0,this.$axios.get("/users").then(function(t){e.users=t.data.users,e.loading=!1})}},Dn=zn,In=Object(f["a"])(Dn,Cn,Sn,!1,null,null,null),Un=In.exports,On=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("h1",{staticClass:"title"},[e._v("Slettede brugere")]),s("a-table",{attrs:{rowKey:function(e){return e.id},columns:e.columns,dataSource:e.users,pagination:e.pagination,size:"small",loading:e.loading},scopedSlots:e._u([{key:"created",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"deleted",fn:function(t){return s("span",{},[e._v(e._s(e._f("formatDateTime")(t)))])}},{key:"action",fn:function(t){return s("span",{},[s("a-row",{attrs:{type:"flex",justify:"end",gutter:12}},[s("a-col",[e.$store.state.user.details.is_admin?s("a-popconfirm",{attrs:{placement:"topLeft",okText:"Ja",cancelText:"Nej"},on:{confirm:function(s){e.activateUser(t.id)}}},[s("template",{slot:"title"},[s("p",[e._v("Er du sikker på at du vil aktivere denne bruger?")])]),s("a-tooltip",{attrs:{placement:"left"}},[s("template",{slot:"title"},[e._v("Genaktiver bruger")]),s("a-button",{attrs:{shape:"circle",icon:"check",loading:e.activating}})],2)],2):e._e()],1)],1)],1)}}])})],1)},Fn=[],En={name:"Users",data:function(){var e=this;return{user:null,loading:!1,users:[],activating:!1,pagination:{pageSize:20},columns:[{title:"Navn",dataIndex:"name",sorter:function(e,t){return e.name>t.name},key:"name"},{title:"Email",dataIndex:"email",sorter:function(e,t){return e.email>t.email},key:"email"},{title:"Telefon",dataIndex:"phone",sorter:function(e,t){return e.phone>t.phone},key:"phone"},{title:"Slettet",dataIndex:"deleted_at",sorter:function(t,s){return e.$moment(t.created_at)>e.$moment(s.deleted_at)},key:"deleted",scopedSlots:{customRender:"deleted"}},{title:"Oprettet",dataIndex:"created_at",sorter:function(t,s){return e.$moment(t.created_at)>e.$moment(s.created_at)},key:"created",scopedSlots:{customRender:"created"}},{title:"",key:"action",scopedSlots:{customRender:"action"}}]}},methods:{removeUser:function(e){var t=this.users.filter(function(t){return t.id!==e});this.users=t},activateUser:function(e){var t=this;this.$axios.post("/trashed-users/"+e+"/restore").then(function(){t.removeUser(e),t.$message.success("Brugeren er nu aktiveret"),t.$store.commit("user/increaseUsers",1),t.activating=!1})}},mounted:function(){var e=this;this.$parent.setMenu("UsersDeactivated"),this.loading=!0,this.$axios.get("/trashed-users").then(function(t){e.users=t.data.trashed_users,e.loading=!1})}},An=En,qn=Object(f["a"])(An,On,Fn,!1,null,null,null),Nn=qn.exports,Mn=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[e._v("Test")])},Pn=[],Rn={name:"Test",components:{},data:function(){return{}},methods:{}},Ln=Rn,Vn=Object(f["a"])(Ln,Mn,Pn,!1,null,null,null),Kn=Vn.exports,Bn=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("pro-feature",{attrs:{text:"Dette er en Pro feature"}})],1)},Gn=[],Hn={name:"Pro",components:{ProFeature:js},data:function(){return{}},methods:{}},Jn=Hn,Yn=Object(f["a"])(Jn,Bn,Gn,!1,null,null,null),Qn=Yn.exports,Wn=[{name:"Test",path:"/test",component:Kn},{name:"SharedFolder",path:"/share/:id",meta:{title:"Delt mappe",disableUnauthRedirect:!0},component:pt},{name:"SharedFolderLogin",path:"/share/:id/login",meta:{title:"Log ind i delt mappe",disableUnauthRedirect:!0},component:bt},{name:"ForgotPassword",path:"/forgot",meta:{title:"Glemt kodeord"},component:B},{name:"CreateAccount",path:"/create",meta:{title:"Opret konto"},component:Z},{name:"ResetPassword",path:"/password-reset/:token",meta:{title:"Nyt kodeord"},component:ie},{path:"/login",name:"Login",meta:{title:"Login"},component:M},{path:"/",meta:{title:"Overblik",description:"General dashview",requiresAuth:!0},component:O,auth:!0,children:[{name:"Dashboard",path:"",meta:{title:"Overblik",requiresAdmin:!0},component:Wt,description:"Overview of environment"},{path:"pro",meta:{title:"Kræver PRO abonnement"},component:Qn,name:"Pro",description:"Pro page"},{path:"settings",meta:{title:"Indstillinger",requiresAdmin:!0},component:vs,name:"Settings",description:"Settings page"},{path:"tasks",meta:{title:"Sager",requiresAdmin:!0},component:zs,name:"Tasks",description:"Overview of tasks"},{name:"",path:"tasks/:id",component:Rs,description:"Single task view",children:[{path:"",meta:{title:"Sag brugere",requiresAdmin:!0},component:ba,name:"TaskSingleGeneral",description:"Showing user data for task"},{path:"time",meta:{title:"Sag tidsforbrug"},component:ea,name:"TaskSingleTime",description:"Showing time entries for specific task"},{path:"qa",meta:{title:"Kvalitetssikring",requiresProAccess:!0},component:ma,name:"TaskSingleQa",description:"Showing quality assurance for specifik task"}]},{name:"Timesheets",path:"timesheets/:year?/:week?/:user?",meta:{title:"Tidsregistrering"},component:Ya,description:"Timesheets managing"},{name:"Documents",path:"documents",meta:{title:"Dokumenter",requiresProAccess:!0},component:ln,description:"Documents overview"},{name:"SubDocuments",path:"documents/:id",meta:{title:"Dokument",requiresProAccess:!0},component:ln,description:"Documents overview"},{name:"Messages",path:"messages",meta:{title:"Beskeder",requiresProAccess:!0},component:kn,description:"Messages page"},{name:"",path:"users",component:Tn,description:"Users layout",children:[{path:"",meta:{title:"Brugere",requiresAdmin:!0},component:Un,name:"UsersActive",description:"Showing user data for task"},{path:"deactivated",meta:{title:"Slettede brugere",requiresAdmin:!0},component:Nn,name:"UsersDeactivated",description:"Deleted users"}]},{path:"orders",meta:{title:"Ordrer",requiresAdmin:!0},component:ja,name:"",description:"Account orders page",children:[{name:"Subscription",path:"",meta:{title:"Ny ordre"},component:Ia,description:"Page for placing new orders"},{name:"OrderHistory",path:"history",meta:{title:"Historik"},component:qa,description:"Page for showing the order history"}]}]},{path:"*",component:ue}],Xn=Wn,Zn=s("2f62"),ei=s("5176"),ti=s.n(ei),si={details:{is_admin:!1},token:null,users:null},ai={},ni={getUsers:function(e){var t=e.commit;yi.get("/users").then(function(e){t("setUsersState",e.data.users)})},getUser:function(e){var t=e.dispatch;yi.get("/auth/user").then(function(e){t("setUser",e.data.data)})},setUser:function(e,t){var s=e.commit,a=e.state,n=t;null!=a.details&&(n=ti()(a.details,t)),s("setUserState",n),window.localStorage&&window.localStorage.setItem("user",as()(n))},setOrganization:function(e,t){var s=e.commit,a=e.state;s("setOrganizationState",t),window.localStorage&&window.localStorage.setItem("user",as()(a.details))},setToken:function(e,t){var s=e.commit;s("setTokenState",t),window.localStorage&&window.localStorage.setItem("token",t)},logout:function(e){var t=e.commit;t("setTokenState",null),t("setUserState",null),window.localStorage&&(window.localStorage.setItem("user",null),window.localStorage.setItem("token",null)),wi.push("/login")}},ii={setUserState:function(e,t){e.details=t},setUsersState:function(e,t){e.users=t},setUsersShowGuide:function(e,t){e.details.show_guide=t},setOrganizationState:function(e,t){e.details.organization=Object(Ks["a"])({},e.details.organization,t)},setTokenState:function(e,t){e.token=t},increaseUsers:function(e,t){e.details.organization.user_count=e.details.organization.user_count+t},decreaseUsers:function(e,t){e.details.organization.user_count=e.details.organization.user_count-t}},ri={namespaced:!0,state:si,getters:ai,actions:ni,mutations:ii},oi={currentTask:{users:[],timesheet_entries:{data:[]}},loading:!1},li={},ci={getTask:function(e,t){var s=e.commit;s("setLoading",!0),s("setCurrentTask",null),yi.get("/timesheetTasks/"+t).then(function(e){s("setCurrentTask",e.data.timesheet_task),s("setLoading",!1)})},addEntry:function(e,t){var s=e.commit,a=e.state,n=Object(Ve["a"])(a.currentTask.timesheet_entries.data);n.push(t),s("setTimeEntriesData",n)},removeEntry:function(e,t){var s=e.commit,a=e.state;yi.delete("/timesheetEntries/"+t).then(function(){if(a.currentTask){var e=a.currentTask.timesheet_entries.data.filter(function(e){return e.id!=t});s("setTimeEntriesData",e)}})},setAllocatedUsers:function(e,t){var s=e.commit,a=e.state,n=[];t.map(function(e){return n.push(e.id)}),yi.patch("/timesheetTasks/"+a.currentTask.id+"/setAllocatedUsers",{allocatedUsersIds:n}).then(function(){s("setAllocatedUsers",t)})},addUsers:function(e,t){var s=e.dispatch,a=e.state,n=a.currentTask.users;t.map(function(e){var t=n.filter(function(t){return t.id==e.id}).length;t||n.push(e)}),s("setAllocatedUsers",n)},removeUser:function(e,t){var s=e.dispatch,a=e.state,n=a.currentTask.users.filter(function(e){return e.id!=t});s("setAllocatedUsers",n)}},di={setCurrentTask:function(e,t){e.currentTask=t},setCurrentTaskName:function(e,t){e.currentTask.name=t},setTimeEntries:function(e,t){e.currentTask.timesheet_entries=t},setTimeEntriesData:function(e,t){e.currentTask.timesheet_entries.data=t},setAllocatedUsers:function(e,t){e.currentTask.users=t},setLoading:function(e,t){e.loading=t}},ui={namespaced:!0,state:oi,getters:li,actions:ci,mutations:di};o["a"].use(Zn["a"]);var mi={currentpage:"",loading:!1,searching:""},pi={setLoading:function(e,t){e.loading=t},setCurrentPage:function(e,t){e.currentpage=t}},fi=new Zn["a"].Store({modules:{user:ri,task:ui},state:mi,mutations:pi}),gi=s("bc3a"),hi=s.n(gi),vi=s("c1df"),_i=s.n(vi),bi=(s("3d99"),s("f23d"));s.d(t,"router",function(){return wi}),s.d(t,"axiosInstance",function(){return yi}),o["a"].use(bi["a"]),o["a"].use(v["a"]),o["a"].prototype.$moment=_i.a;var ki={baseURL:"https://api.timero.dk/api"},yi=hi.a.create(ki);yi.interceptors.request.use(function(e){var t=window.localStorage.getItem("token");return t&&(yi.defaults.headers.common={Authorization:"bearer ".concat(t)}),e},function(e){return r.a.reject(e)}),o["a"].prototype.$axios=yi,o["a"].filter("formatDate",function(e){if(e)return _i()(String(e)).format("DD/MM/YYYY")}),o["a"].filter("formatTime",function(e){if(e)return _i()(String(e)).format("HH:mm")}),o["a"].filter("formatDateTime",function(e){if(e)return _i()(String(e)).format("DD/MM/YYYY HH:mm")}),o["a"].filter("formatPrice",function(e){if(e)return"DKK "+(Math.round(n()(e))/100).toString().replace(".",",")}),o["a"].config.productionTip=!1;var wi=new v["a"]({routes:Xn,mode:"history"}),$i=!1,xi=[];function ji(e){xi=xi.filter(function(t){return t(e)})}function Ti(e){xi.push(e)}function Ci(){return yi.patch("auth/refresh").then(function(e){var t=e.data.data.token;return wi.app.$store.dispatch("user/setToken",t),wi.app.$axios.defaults.headers.common={Authorization:"bearer ".concat(t)},t})}if(yi.interceptors.response.use(function(e){return e},function(e){var t=e.config,s=e.response.status,a=e.response,n=t;if(e.response)if("Token has expired and can no longer be refreshed"===a.data.message)fi.dispatch("user/logout"),o["a"].prototype.$message.error("Uautoriseret adgang");else{if(401===s&&"Token has expired"==a.data.message){$i||($i=!0,Ci().then(function(e){$i=!1,ji(e)}));var i=new r.a(function(e){Ti(function(t){n.headers.Authorization="Bearer "+t,e(hi()(n))})});return i}401===s?fi.dispatch("user/logout"):o["a"].prototype.$message.error("Der skete en fejl (Kode "+e.response.status+": "+e.response.data.message+")")}else o["a"].prototype.$message.error("Der skete en fejl");return r.a.reject(e)}),wi.beforeEach(function(e,t,s){if(document.title=e.meta.title,e.matched.some(function(e){return e.meta.requiresAuth})){var a=null;wi.app.$store.dispatch("user/getUser"),e.matched.some(function(e){return e.meta.requiresAdmin})&&!wi.app.$store.state.user.details.is_admin&&(a="/timesheets"),e.matched.some(function(e){return e.meta.requiresProAccess})&&!wi.app.$store.state.user.details.organization.has_pro_access&&(a="/pro"),a?s({path:a}):s()}else s()}),Object(y["sync"])(fi,wi),window.localStorage){fi.dispatch("user/setToken",window.localStorage.getItem("token")),fi.dispatch("user/setUser",JSON.parse(window.localStorage.getItem("user")));var Si="Bearer "+window.localStorage.getItem("token");hi.a.defaults.headers.common={Authorization:Si}}o["a"].use(b.a,{id:"UA-136397549-1",router:wi}),o["a"].use(k,{load:{key:"AIzaSyDH0DqajjXyeA5vgSz49CJK6VbrH0ZC4_I",libraries:"drawing"}}),new o["a"]({el:"#root",router:wi,store:fi,render:function(e){return e(h)}})},"592c":function(e,t,s){},5996:function(e,t,s){e.exports=s.p+"img/frame.75eb6da0.png"},"632a":function(e,t,s){"use strict";var a=s("7dff"),n=s.n(a);n.a},"65d0":function(e,t,s){},"720b":function(e,t,s){},"7dff":function(e,t,s){},"7fc0":function(e,t,s){},"812f":function(e,t,s){"use strict";var a=s("039e"),n=s.n(a);n.a},"841d":function(e,t,s){"use strict";var a=s("96da"),n=s.n(a);n.a},8553:function(e,t,s){},9247:function(e,t,s){"use strict";var a=s("a062"),n=s.n(a);n.a},"958c":function(e,t,s){"use strict";var a=s("d7d2"),n=s.n(a);n.a},"969c":function(e,t,s){"use strict";var a=s("e773"),n=s.n(a);n.a},"96da":function(e,t,s){},"9d8e":function(e,t,s){},a062:function(e,t,s){},a3b7:function(e,t,s){"use strict";var a=s("fa13"),n=s.n(a);n.a},a419:function(e,t,s){"use strict";var a=s("f323"),n=s.n(a);n.a},a9e5:function(e,t,s){"use strict";var a=s("b32c"),n=s.n(a);n.a},b32c:function(e,t,s){},c747:function(e,t,s){e.exports=s.p+"img/login-screen.83462947.jpg"},cf05:function(e,t,s){e.exports=s.p+"img/logo.705dab0c.png"},d2de:function(e,t,s){"use strict";var a=s("50b9"),n=s.n(a);n.a},d32b:function(e,t,s){},d7d2:function(e,t,s){},d956:function(e,t,s){"use strict";var a=s("0f28"),n=s.n(a);n.a},de8c:function(e,t,s){"use strict";var a=s("65d0"),n=s.n(a);n.a},e090:function(e,t,s){},e773:function(e,t,s){},f323:function(e,t,s){},fa13:function(e,t,s){},fa99:function(e,t,s){"use strict";var a=s("720b"),n=s.n(a);n.a},fc00:function(e,t,s){"use strict";var a=s("e090"),n=s.n(a);n.a}}); //# sourceMappingURL=app.8f5beef3.js.map