1import{i as l,a as r,m as _,l as o}from"./vendor-CHCIo3bd.js";import{n,h as d,k as c,T as u,M as m,l as h}from"./app-B5OwpsGF.js";import"./vendor-filepond-C-Be2LEg.js";/* empty css */const f={components:{icon:l},data(){return{page:1,isExpandAll:!0}},props:{results:{type:Array},items:{type:Number,default:25},count:{type:Number}},watch:{results(){this.isExpandAll=!0}},computed:{currentPage(){let i=this.page*this.items;return i>this.count&&(i=this.count),{number:parseInt(this.page),start:(this.page-1)*this.items+1,end:i}},numPages(){return Math.ceil(this.count/this.items)}},created(){this.page=this.$route.params.page},methods:{extractSourceLinks:d,formatDateTitle(i){return r(i).format("DD/MM/YYYY")},formatComment(i){return i=(i==null?void 0:i.replace(/(?:^|[^"'])(https?:\/\/[^\s]+)/gm,' <a href="$1">$1</a>'))??"",this.$options.filters.nl2br(i)},goPrev(){this.$router.push(`/dashboard/daybook/${parseInt(this.page)-1}`),this.$emit("changePage")},goNext(){this.$router.push(`/dashboard/daybook/${parseInt(this.page)+1}`),this.$emit("changePage")},toggleExpandAll(){this.isExpandAll=!this.isExpandAll}}};var p=function(){var t=this,e=t._self._c;return t.currentPage.number<=t.numPages&&t.results?e("div",{staticClass:"dashboard-list dashboard-list--generic dashboard-list--daybook"},[t.currentPage.number<=t.numPages?e("div",{staticClass:"dashboard-list__list dashboard-list--generic-list no-list-style"},[e("div",{staticClass:"daybook-list-header"},[e("div",{staticClass:"daybook-list-header__left"},[e("a",{staticClass:"link hidden-print",attrs:{href:"#"},on:{click:function(s){return s.preventDefault(),t.toggleExpandAll()}}},[t.isExpandAll?e("span",[t._v("Collapse all")]):e("span",[t._v("Expand all")])])]),t._v(" "),e("div",{staticClass:"daybook-list-header__right"},[e("a",{staticClass:"button button--blue hidden-print d-inline-block",attrs:{href:"#",role:"button",title:"Print"},on:{click:function(s){return s.preventDefault(),t.$emit("print")}}},[e("span",{staticClass:"sr-only"},[t._v("Print")]),t._v(" "),e("icon",{attrs:{name:"print","aria-hidden":"true"}})],1)])]),t._v(" "),t._m(0),t._v(" "),t._l(t.results,function(s){return e("div",{key:s.code,staticClass:"dashboard-list__row-wrapper"},[e("div",{staticClass:"dashboard__interview-list__row dashboard-list__row read-only"},[e("div",{staticClass:"dashboard-list__item list__item--generic-150 list__item--generic-first list__item-daybook-code"},[t._v(` 2 `+t._s(s.code)+` 3 `)]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-150 list__item-daybook-time"},[e("time",{attrs:{datetime:s.date,title:t.formatDateTitle(s.date)}},[t._v(` 4 `+t._s(t.formatDateTitle(s.date))+` 5 `)])]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-150 list__item-daybook-time"},[s.follow_up_date?e("time",{attrs:{datetime:s.follow_up_date,title:t.formatDateTitle(s.follow_up_date)}},[t._v(` 6 `+t._s(t.formatDateTitle(s.follow_up_date))+` 7 `)]):t._e()]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-150 list__item-daybook-status"},[t._v(` 8 `+t._s(s.status.name)+` 9 `)])]),t._v(" "),e("div",{class:{"daybook-row-extra":!0,"daybook-row-extra--expanded":t.isExpandAll}},[s.enquiry?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title daybook-row-extra__title--first"},[t._v(` 10 Client Interview 11 `)]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(s.enquiry))}})]):t._e(),t._v(" "),s.options_offered?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Information discussed with client")]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(s.options_offered))}})]):t._e(),t._v(" "),s.source_of_information?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Source of Information")]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(t.extractSourceLinks(s.source_of_information)))}})]):t._e(),t._v(" "),s.comments?[s.comments.peer_review&&s.comments.peer_review.length?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Comments from reviewer")]),t._v(" "),t._l(s.comments.peer_review,function(a){return e("div",{key:a.id,staticClass:"daybook-row-extra__content daybook-comment"},[e("span",{staticClass:"daybook-comment__header-date"},[t._v(` 12 `+t._s(t._f("formatDate")(a.created,"D MMM hh:mma"))+` 13 `)]),t._v(" "),e("div",{domProps:{innerHTML:t._s(t.formatComment(a.message))}})])})],2):t._e(),t._v(" "),s.comments.outcome&&s.comments.outcome.length?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Outcome comments")]),t._v(" "),t._l(s.comments.outcome,function(a){return e("div",{key:a.id,staticClass:"daybook-row-extra__content daybook-comment"},[e("span",{staticClass:"daybook-comment__header-date"},[t._v(` 14 `+t._s(t._f("formatDate")(a.created,"D MMM hh:mma"))+` 15 `)]),t._v(" "),e("div",{domProps:{innerHTML:t._s(t.formatComment(a.message))}})])})],2):t._e(),t._v(" "),s.comments.follow_up&&s.comments.follow_up.length?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Follow up comments")]),t._v(" "),t._l(s.comments.follow_up,function(a){return e("div",{key:a.id,staticClass:"daybook-row-extra__content daybook-comment"},[e("span",{staticClass:"daybook-comment__header-date"},[t._v(` 16 `+t._s(t._f("formatDate")(a.created,"D MMM hh:mma"))+` 17 `)]),t._v(" "),e("div",{domProps:{innerHTML:t._s(t.formatComment(a.message))}})])})],2):t._e()]:t._e()],2)])})],2):t._e(),t._v(" "),e("div",{staticClass:"dashboard__interview-list__pagination dashboard-list__pagination"},[t.currentPage.number>1?e("a",{staticClass:"dashboard-list__pagination__prev",attrs:{href:"/dashboard/daybook/"+(t.currentPage.number-1)},on:{click:function(s){return s.preventDefault(),t.goPrev.apply(null,arguments)}}},[e("icon",{attrs:{name:"chevron-left"}}),t._v(" "),e("span",[t._v("Previous")])],1):e("div",{staticClass:"dashboard-list__pagination__prev dashboard-list__pagination__prev--disabled"},[e("icon",{attrs:{name:"chevron-left"}})],1),t._v(" "),e("div",{staticClass:"dashboard-list__pagination__page"},[t._v(` 18 `+t._s(t.currentPage.start)+" - "+t._s(t.currentPage.end)+" of "+t._s(t.count)+` 19 `)]),t._v(" "),t.currentPage.number<t.numPages?e("a",{staticClass:"dashboard-list__pagination__next",attrs:{href:"/dashboard/daybook/"+(t.currentPage.number+1)},on:{click:function(s){return s.preventDefault(),t.goNext.apply(null,arguments)}}},[e("span",[t._v("Next")]),t._v(" "),e("icon",{attrs:{name:"chevron-right"}})],1):e("div",{staticClass:"dashboard-list__pagination__next dashboard-list__pagination__next--disabled"},[e("icon",{attrs:{name:"chevron-right"}})],1)])]):e("div",{staticClass:"p-3"},[e("h1",{staticClass:"h1 font-avenir-medium"},[t._v("No results found.")])])},v=[function(){var i=this,t=i._self._c;return t("div",[t("div",{staticClass:"dashboard-list__row dashboard-list__row--header read-only hidden-print"},[t("div",{staticClass:"dashboard-list__item list__item--generic-150 list__item--generic-first"},[i._v(` 20 Code 21 `)]),i._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-150"},[i._v("Interview Date")]),i._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-150"},[i._v("Follow-up Date")]),i._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-150"},[i._v("Status")])])])}],b=n(f,p,v,!1,null,null);const g=b.exports,k={name:"daybook",components:{DatePicker:h,MultiSelect:m,TextField:u,DaybookResults:g,icon:l},props:{items:{type:Number,default:25}},mixins:[c],data(){const i={filters:{date:null,users:[],tags:[],timeTaken:[],status:["CLOSED","SUBMITTED"],search:null,commentType:null},filterOptions:{status:[],users:[],tags:[],timeTaken:[],commentType:[]}};let t;return this.$store.state.filters[this.$options.name]?t=o.cloneDeep(this.$store.state.filters[this.$options.name]):t=o.cloneDeep(i.filters),{emptyFilters:i,filters:t,useDefault:!0,currentInterviews:null,previousInterviews:[],nextInterviews:[],sort:{Date:"desc"},count:0,filterOptions:[],showFilters:!0,notifications:[]}},computed:{..._({currentUserRole:i=>i.currentUserRole})},methods:{fetchData(i){const t=(this.$route.params.page-1)*this.items,e={sort:Object.keys(this.sort).map(s=>`${s},${this.sort[s]}`),limit:this.items,offset:t,addFollowUps:!0};i&&(e.limit=-1,delete e.offset),this.filters.date&&this.filters.date.length&&(e.date=`${r(this.filters.date[0]).format("YYYY-MM-DD")},${r(this.filters.date[1]).format("YYYY-MM-DD")}`),this.filters.status&&this.filters.status.length&&(e.status=this.filters.status),this.useDefault&&(e.status=["CLOSED","SUBMITTED"]),this.filters.users&&this.filters.users.length&&(e.submitter=this.filters.users),this.filters.tags&&this.filters.tags.length&&(e.tag=this.filters.tags),this.filters.commentType&&this.filters.commentType.length&&(e.commentType=this.filters.commentType),this.filters.timeTaken&&this.filters.timeTaken.length&&(e.timeTaken=[this.filters.timeTaken,this.filterOptions.timeTaken.slice(-1)[0].value]),e.service=["Client Interview"],e.extraFields=["comments","options_offered","source_of_information","enquiry"],this.filters.search&&this.filters.search.length>=3&&(e.query=this.filters.search),this.$axios.get("/api/v1/interview/search",{params:e}).then(s=>{this.currentInterviews=s.data.results,this.count=s.data.meta.total,this.filterOptions.status=s.data.filters.status,this.filterOptions.users=s.data.filters.users,this.filterOptions.tags=s.data.filters.tags,this.filterOptions.commentType=s.data.filters.comment_type,this.filterOptions.timeTaken=[{text:"None",value:-1},...s.data.filters.time_taken],this.$store.dispatch("updateFilters",{section:this.$options.name,filters:this.filters,filterOptions:this.filterOptions}),this.useDefault&&(this.$set(this.filters,"status",["CLOSED","SUBMITTED"]),this.useDefault=!1),i&&this.$nextTick(()=>{window.print(),this.currentInterviews=this.currentInterviews.slice(0,this.items)})})},resize(){window.matchMedia("(min-width: 576px)").matches&&(this.show
21Filters=!0)},toggleFilters(){this.showFilters=!this.showFilters},openInNewTab(i){window.open(i,"_blank")},print(){this.currentInterviews=null,this.fetchData(!0)}},created(){window.addEventListener("resize",this.resize)},mounted(){this.fetchData(),this.showFilters=!0}};var y=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dashboard__interview-list dashboard-list"},[e("h3",[t._v("Daybook")]),t._v(" "),e("div",{staticClass:"dashboard__interview-filters hidden-print"},[e("h4",[t._v("Filters")]),t._v(" "),e("div",{class:{"dashboard__interview-filters__toggle":!0,"dashboard__interview-filters__toggle--open":!t.showFilters,"dashboard__interview-filters__toggle--close":t.showFilters},attrs:{tabindex:"0"},on:{click:t.toggleFilters}},[t._v(` 22 Â 23 `)]),t._v(" "),e("div",{class:{"dashboard__interview-filters__row":!0,"dashboard__interview-filters__row--daybook":!0,"dashboard__interview-filters__row--open":t.showFilters,"dashboard__interview-filters__row--close":!t.showFilters}},[e("div",{staticClass:"dashboard__interview-filters__date"},[e("DatePicker",{attrs:{placeholder:"Date"},on:{input:t.filter},model:{value:t.filters.date,callback:function(s){t.$set(t.filters,"date",s)},expression:"filters.date"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__status"},[e("MultiSelect",{attrs:{placeholder:"Select status",multiple:!0,options:t.filterOptions.status},on:{input:t.filter,change:t.filter},model:{value:t.filters.status,callback:function(s){t.$set(t.filters,"status",s)},expression:"filters.status"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__tags"},[e("MultiSelect",{attrs:{placeholder:"Category",searchable:!0,multiple:!0,options:t.filterOptions.tags},on:{input:t.filter},model:{value:t.filters.tags,callback:function(s){t.$set(t.filters,"tags",s)},expression:"filters.tags"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__comment-type"},[e("MultiSelect",{attrs:{placeholder:"Comments",searchable:!1,multiple:!0,options:t.filterOptions.commentType},on:{input:t.filter},model:{value:t.filters.commentType,callback:function(s){t.$set(t.filters,"commentType",s)},expression:"filters.commentType"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__time-taken"},[e("MultiSelect",{attrs:{placeholder:"Time taken",searchable:!0,multiple:!1,options:t.filterOptions.timeTaken},on:{input:t.filter},model:{value:t.filters.timeTaken,callback:function(s){t.$set(t.filters,"timeTaken",s)},expression:"filters.timeTaken"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__users"},[e("MultiSelect",{attrs:{placeholder:"Select users",searchable:!0,multiple:!0,options:t.filterOptions.users},on:{input:t.filter},model:{value:t.filters.users,callback:function(s){t.$set(t.filters,"users",s)},expression:"filters.users"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__search"},[e("TextField",{attrs:{placeholder:"Search",type:"search"},on:{input:t.filter},model:{value:t.filters.search,callback:function(s){t.$set(t.filters,"search",s)},expression:"filters.search"}})],1)])]),t._v(" "),t.currentInterviews?e("daybook-results",{key:t.$route.params.page,attrs:{results:t.currentInterviews,readOnly:!0,count:t.count,items:t.items},on:{changePage:function(s){return t.fetchData()},print:function(s){return t.print()}}}):e("div",{staticClass:"m-5 text-center text--gray"},[e("icon",{attrs:{name:"spinner",scale:"4",pulse:""}})],1)],1)},C=[],w=n(k,y,C,!1,null,null);const M=w.exports;export{M as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.