1import{a as Q}from"./chunk-KIOCXVOY.js";import{c as K}from"./chunk-OKW6A376.js";import{Za as H,eb as J,vb as W}from"./chunk-KUO5X3JT.js";import{a as G}from"./chunk-JWIE767S.js";import{a as j,d as q}from"./chunk-WPBLXIKM.js";import{$ as B,R as A,X as $,Z as V,aa as z,ea as R,ia as U,z as F}from"./chunk-GSIVSSTW.js";import{g as E}from"./chunk-O6CGIT4T.js";import{Bc as l,Cc as C,Dc as N,Ob as d,Qb as p,Sb as L,Sc as k,Tb as T,Ub as D,Vb as m,Wb as a,Xb as s,Yb as x,_c as b,ad as I,eb as n,fa as u,fc as y,id as M,kc as P,la as h,ma as w,mc as c,md as g,ub as S,xa as O}from"./chunk-KMSAVGVC.js";var X=t=>({color:t});function Y(t,r){if(t&1&&x(0,"app-user-avatar",4),t&2){let e=c().$implicit;m("user",e.user)}}function Z(t,r){if(t&1&&(a(0,"div",5),x(1,"app-user-avatar",14)(2,"app-icon",15)(3,"app-user-avatar",16),s()),t&2){let e=c().$implicit;n(),m("user",e.sender),n(2),m("user",e.recipient)}}function ee(t,r){if(t&1&&(a(0,"span"),l(1),s()),t&2){let e=c().$implicit;n(),C(e.message)}}function te(t,r){if(t&1&&(a(0,"span"),l(1),b(2,"truncate"),s()),t&2){let e=c().$implicit;n(),C(I(2,1,e.message,50))}}function ne(t,r){t&1&&x(0,"div",12)}function ie(t,r){t&1&&(a(0,"ion-text",13),l(1," Not seen "),s())}function oe(t,r){if(t&1){let e=y();a(0,"ion-item",3),P("click",function(){let o=h(e),_=o.$implicit,f=o.$index,v=c();return w(v.viewConversation(_,f))}),d(1,Y,1,1,"app-user-avatar",4),d(2,Z,4,2,"div",5),a(3,"ion-row",6)(4,"ion-col",7)(5,"p",8)(6,"span"),l(7),s()(),a(8,"ion-note",9),d(9,ee,2,1,"span"),d(10,te,3,4,"span"),s()(),a(11,"ion-col",10)(12,"p",11),l(13),b(14,"campertunityDate"),s(),d(15,ne,1,0,"div",12),d(16,ie,2,0,"ion-text",13),s()()()}if(t&2){let e=r.$implicit,i=c();m("color",e.seen===0&&e.sender.id!==i.userId()?"light":""),n(),p(i.isAdmin()?-1:1),n(),p(i.isAdmin()&&e.recipient?2:-1),n(5),C(e.user.firstName),n(),m("ngStyle",k(13,X,e.seen===0&&e.sender.id!==i.userId()?"var(--ion-color-secondary)":"var(--ion-color-enabled)")),n(),p(i.truncateMessages()?-1:9),n(),p(i.truncateMessages()?10:-1),n(3),N(" ",I(14,10,e.dateTime,"MMM d")," "),n(2),p(!e.seen&&e.sender.id!==i.userId()?15:-1),n(),p(!e.seen&&e.sender.id===i.userId()?16:-1)}}function ae(t,r){t&1&&(a(0,"ion-item",2)(1,"span",17),l(2," no messages"),s()())}function se(t,r){if(t&1){let e=y();a(0,"ion-item")(1,"app-button",18),P("clicked",function(){h(e);let o=c();return w(o.loadMore())}),l(2," Load more "),s()()}}var ve=(()=>{class t{messages=g([]);truncateMessages=g();isAdmin=g();recipientId=g();enableLoadMore=g();maxMessages=O(15);userId=M(()=>this.userService.getUser()?.id);displayedMessages=M(()=>{let e=this.messages()??[];return this.enableLoadMore()?e.slice(0,this.maxMessages()):e});hasMoreMessages=M(()=>{let e=this.messages();return e?e.length>this.maxMessages():!1});navCtrl=u(F);userService=u(W);messageService=u(J);popoverController=u(U);loadMore(){this.maxMessages.update(e=>e+10)}async viewConversation(e,i){let o=this.isAdmin(),_=o?e.user.id:this.userId();!o&&!e.seen&&e?.sender?.id!==_&&this.messageService.setMessageSeen(e);let f=o?_===e.recipient?.id?e.sender?.id:e.recipient?.id:e.user.id;this.navCtrl.navigateForward(G.conversation.create(_,f));try{await this.popoverController.getTop()&&this.popoverController.dismiss()}catch{}}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=S({type:t,selectors:[["app-message-list"]],inputs:{messages:[1,"messages"],truncateMessages:[1,"truncateMessages"],isAdmin:[1,"isAdmin"],recipientId:[1,"recipientId"],enableLoadMore:[1,"enableLoadMore"]},decls:5,vars:2,consts:[[1,"ion-no-padding"],[2,"cursor","pointer",3,"color"],["lines","none",2,"color","var(--ion-color-enabled)","font-size","14px"],[2,"cursor","pointer",3,"click","color"],["slot","start",1,"ion-margin-end","ion-margin-top",3,"user"],[2,"display","flex","align-items","center"],[2,"width","100%","display","flex","align-items","flex-start"],[2,"flex","1","min-width","0","padding-right","8px"],[2,"margin-bottom","4px"],[3,"ngStyle"],[2,"flex","0 0 auto","text-align","end","min-width","60px","padding-left","4px"],[1,"campertunity-pale","ion-no-padding",2,"font-size","13px","margin-bottom","4px","white-space","nowrap"],[2,"width","8px","height","8px","background","var(--ion-color-secondary)","border-radius","50%","margin-left","auto"],["color","medium",2,"font-size","12px","font-style","
1italic","white-space","nowrap"],["slot","start",1,"ion-margin-end","ion-margin-top",2,"margin-top","16px","margin-left","12px","min-width","50px",3,"user"],["slot","start","name","arrow-forward-outline"],["slot","start",1,"ion-margin-end",2,"margin-top","16px","margin-left","12px","min-width","50px",3,"user"],[2,"width","100%","text-align","center"],["fill","clear","slot","end",2,"margin","0 auto","width","100%","height","50px",3,"clicked"]],template:function(i,o){i&1&&(a(0,"ion-list",0),T(1,oe,17,15,"ion-item",1,L),d(3,ae,3,0,"ion-item",2),d(4,se,3,0,"ion-item"),s()),i&2&&(n(),D(o.displayedMessages()),n(2),p(o.messages()&&o.messages().length===0?3:-1),n(),p(o.enableLoadMore()&&o.hasMoreMessages()?4:-1))},dependencies:[j,A,q,$,V,B,z,R,K,E,H,Q],styles:["ion-item[_ngcontent-%COMP%]{min-height:80px;height:80px;--min-height: 80px;align-items:center;--inner-padding-end: 8px;--padding-start: 8px}ion-item[_ngcontent-%COMP%] app-user-avatar[_ngcontent-%COMP%]{align-self:center;flex-shrink:0}ion-item[_ngcontent-%COMP%] ion-row[_ngcontent-%COMP%]{display:flex!important;align-items:flex-start!important;height:100%;width:100%;margin:0;padding:0}ion-item[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%]{padding:4px 0}ion-item[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 4px;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}ion-item[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap!important}ion-item[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%]:first-child{flex:1;min-width:0;overflow:hidden}ion-item[_ngcontent-%COMP%] ion-col[_ngcontent-%COMP%]:last-child{flex:0 0 auto;min-width:60px;max-width:80px}ion-item[_ngcontent-%COMP%] ion-note[_ngcontent-%COMP%]{display:block!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;line-height:1.4;width:100%}ion-item[_ngcontent-%COMP%] ion-note[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%;vertical-align:bottom}ion-item[_ngcontent-%COMP%] ion-text[_ngcontent-%COMP%]{display:block}"],changeDetection:0})}return t})();export{ve as a};
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.