2021-11-11 22:06:49 +01:00
/*! For license information please see converse.min.js.LICENSE.txt */
2023-12-29 14:11:55 +01:00
( ( ) => { var e , t , n , s , i = { 8487 : function ( e , t , n ) { ! function ( e , t ) { "use strict" ; function n ( e ) { return n . result ? n . result : e && "function" == typeof e . getSerializer ? ( n . result = e . getSerializer ( ) , n . result ) : Promise . reject ( new Error ( "localforage.getSerializer() was not available! localforage v1.4+ is required!" ) ) } function s ( e , t ) { return t && e . then ( ( function ( e ) { t ( null , e ) } ) , ( function ( e ) { t ( e ) } ) ) , e } function i ( e , t ) { var n = this . getItem ( e ) . then ( ( function ( t ) { return { key : e , value : t } } ) ) ; return s ( n , t ) , n } function r ( e ) { var t = this ; return new Promise ( ( function ( n , s ) { for ( var r = [ ] , o = 0 , a = e . length ; o < a ; o ++ ) r . push ( i . call ( t , e [ o ] ) ) ; Promise . all ( r ) . then ( ( function ( e ) { for ( var t = { } , s = 0 , i = e . length ; s < i ; s ++ ) { var r = e [ s ] ; t [ r . key ] = r . value } n ( t ) } ) ) . catch ( s ) } ) ) } function o ( ) { var e = { } ; return this . iterate ( ( function ( t , n ) { e [ n ] = t } ) ) . then ( ( function ( ) { return e } ) ) } function a ( ) { return "undefined" != typeof IDBKeyRange ? IDBKeyRange : "undefined" != typeof webkitIDBKeyRange ? webkitIDBKeyRange : "undefined" != typeof mozIDBKeyRange ? mozIDBKeyRange : void 0 } t = "default" in t ? t . default : t ; var c = a ( ) ; function l ( e ) { e = e . slice ( ) ; var t = this ; function n ( e , t ) { return e < t ? - 1 : e > t ? 1 : 0 } return new Promise ( ( function ( s , i ) { t . ready ( ) . then ( ( function ( ) { var r , o = t . _dbInfo , a = o . db . transaction ( o . storeName , "readonly" ) . objectStore ( o . storeName ) , l = e . sort ( n ) , d = c . bound ( e [ 0 ] , e [ e . length - 1 ] , ! 1 , ! 1 ) ; if ( "getAll" in a ) ( r = a . getAll ( d ) ) . onsuccess = function ( ) { var e = r . result ; void 0 === e && ( e = null ) , s ( e ) } ; else { r = a . openCursor ( d ) ; var u = { } , h = 0 ; r . onsuccess = function ( ) { var e = r . result ; if ( e ) { for ( var t = e . key ; t > l [ h ] ; ) if ( ++ h === l . length ) return void s ( u ) ; if ( t === l [ h ] ) { var n = e . value ; void 0 === n && ( n = null ) , u [ t ] = n , e . continue ( ) } else e . continue ( l [ h ] ) } else s ( u ) } } r . onerror = function ( ) { i ( r . error ) } } ) ) . catch ( i ) } ) ) } function d ( e ) { var t = this ; return new Promise ( ( function ( s , i ) { t . ready ( ) . then ( ( function ( ) { return n ( t ) } ) ) . then ( ( function ( n ) { var r = t . _dbInfo ; r . db . transaction ( ( function ( t ) { for ( var o = new Array ( e . length ) , a = 0 , c = e . length ; a < c ; a ++ ) o [ a ] = "?" ; t . executeSql ( "SELECT * FROM " + r . storeName + " WHERE (key IN (" + o . join ( "," ) + "))" , e , ( function ( e , t ) { for ( var i = { } , r = t . rows , o = 0 , a = r . length ; o < a ; o ++ ) { var c = r . item ( o ) , l = c . value ; l && ( l = n . deserialize ( l ) ) , i [ c . key ] = l } s ( i ) } ) , ( function ( e , t ) { i ( t ) } ) ) } ) ) } ) ) . catch ( i ) } ) ) } function u ( e , t ) { var n , i = this ; if ( arguments . length && null !== e ) { var a = i . driver ( ) ; n = a === i . INDEXEDDB ? l . apply ( i , arguments ) : a === i . WEBSQL ? d . apply ( i , arguments ) : r . apply ( i , arguments ) } else n = o . apply ( i ) ; return s ( n , t ) , n } function h ( e ) { var t = Object . getPrototypeOf ( e ) ; t && ( t . getItems = u , t . getItems . indexedDB = function ( ) { return l . apply ( this , arguments ) } , t . getItems . websql = function ( ) { return d . apply ( this , arguments ) } , t . getItems . generic = function ( ) { return r . apply ( this , arguments ) } ) } var m = h ( t ) ; e . localforageGetItems = u , e . extendPrototype = h , e . extendPrototypeResult = m , e . getItemsGeneric = r , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } ( t , n ( 5513 ) ) } , 7609 : ( e , t , n ) => { "use strict" ; const s = n ( 7776 ) , i = n ( 2350 ) ; e . exports = { atob : s , btoa : i } } , 7776 : e => { "use strict" ; const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ; function n ( e ) { const n = t . indexOf ( e ) ; return n < 0 ? void 0 : n } e . exports = function ( e ) { if ( 0 === arguments . length ) throw new TypeError ( "1 argument required, but only 0 present." ) ; if ( ( e = ( e = ` ${ e } ` ) . replace ( /[ \t\n\f\r]/g , "" ) ) . length % 4 == 0 && ( e = e . replace ( /==?$/ , "" ) ) , e . length % 4 == 1 || /[^+/0-9A-Za-z]/ . test ( e ) ) return null ; let t = "" , s = 0 , i = 0 ; for ( let r = 0 ; r < e . length ; r ++ ) s <<= 6 , s |= n ( e [ r ] ) , i += 6 , 24 === i && ( t += String . fromCharCode ( ( 16711680 & s ) >> 16 ) , t += String . fromCharCode ( ( 65280 & s ) >> 8 ) , t += String . fromCharCode ( 255 & s ) , s = i = 0 ) ; return 12 === i ? ( s >>= 4 , t += String . fromCharCode ( s ) ) : 18 === i && ( s >>= 2 , t += String . fromCharCode ( ( 65280 & s ) >> 8 ) , t += String . fromCharCode ( 255 & s ) ) , t } } , 2350 : e => { "use strict" ; const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ; function n ( e ) { if ( e >= 0 && e < 64 ) return t [ e ] } e . exports = function ( e ) { if ( 0 === arguments . length ) throw new TypeError ( "1 argument required, but only 0 present." ) ; let t ; for ( e = ` ${ e } ` , t = 0 ; t < e . length ; t ++ ) if ( e . charCodeAt ( t ) > 255 ) return null ; let s = "" ; for ( t = 0 ; t < e . length ; t += 3 ) { const i = [ void 0 , void 0 , void 0 , void 0 ] ; i [ 0 ] = e . charCodeAt ( t ) >> 2 , i [ 1 ] = ( 3 & e . charCodeAt ( t ) ) << 4 , e . length > t + 1 && ( i [ 1 ] |= e . charCodeAt ( t + 1 ) >> 4 , i [ 2 ] = ( 15 & e . charCodeAt ( t + 1 ) ) << 2 ) , e . length > t
< command sessionid = "${t}" node = "${n}" action = "${s}" xmlns = "${dp.NS.ADHOC}" >
$ { [ "cancel" , "prev" ] . includes ( s ) ? "" : mp `
< x xmlns = "${dp.NS.XFORM}" type = "submit" >
2023-02-17 12:24:37 +01:00
$ { i . reduce ( ( ( e , t ) => { let { name : n , value : s } = t ; return e + ` <field var=" ${ n } "><value> ${ s } </value></field> ` } ) , "" ) }
< / x > ` }
< / c o m m a n d >
2023-12-29 14:11:55 +01:00
< /iq>`,o=await Vl.sendIQ(r,null,!1);if(null===o){Yc.warn("A timeout occurred while trying to run an ad-hoc command");const{__:e}=bl;return{status:"error",note:e("A timeout occurred")}}hp.isErrorStanza(o)&&(Yc.error("Error while trying to execute an ad-hoc command"),Yc.error(o));const a=o.querySelector("command"),c=a?.getAttribute("status");return{status:c,..."executing"===c?lp(o):{},note:o.querySelector("note")?.textContent}}}},{Strophe:gp}=Ah.env;gp.addNamespace("ADHOC","http:/ / jabber . org / protocol / commands "),Ah.plugins.add(" converse - adhoc ",{dependencies:[" converse - disco "],initialize(){Object.assign(this._converse.api,fp)}});class pp extends Em{defaults(){return{bookmarked:!1,hidden:[" mobile "," fullscreen "].includes(Vl.settings.get(" view _mode ")),message_type:" headline ",num_unread:0,time_opened:this.get(" time _opened ")||(new Date).getTime(),type:bl.HEADLINES_TYPE}}async initialize(){this.set({box_id:`box-${this.get(" jid ")}`}),this.initUI(),this.initMessages(),await this.fetchMessages(),Vl.trigger(" headlinesFeedInitialized ",this)}}const vp={headlines:{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];async function s(e){let s=await Vl.chatboxes.get(e);return!s&&n?s=await Vl.chatboxes.create(e,t,bl.HeadlinesFeed):(s=s&&s.get(" type ")===bl.HEADLINES_TYPE?s:null,s&&Object.keys(t).length&&s.save(t)),s}if(void 0===e){return(await Vl.chatboxes.get()).filter((e=>e.get(" type ")===bl.HEADLINES_TYPE))}return" string "==typeof e?s(e):Promise.all(e.map((e=>s(e))))}}};Ah.plugins.add(" converse - headlines ",{dependencies:[" converse - chat "],overrides:{ChatBoxes:{model(e,t){const{_converse:n}=this.__super__;return e.type==n.HEADLINES_TYPE?new n.HeadlinesFeed(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){function e(){bl.connection.addHandler((e=>async function(e){if(mm(e)||fm(e)){const t=e.getAttribute(" from ");if(await Vl.waitUntil(" rosterInitialized "),t.includes(" @ ")&&!bl.roster.get(t)&&!Vl.settings.get(" allow _non _roster _messaging "))return;if(null===e.querySelector(" body "))return;const n=bl.chatboxes.create({id:t,jid:t,type:bl.HEADLINES_TYPE,from:t}),s=await _m(e);await n.createMessage(s),Vl.trigger(" message ",{chatbox:n,stanza:e,attrs:s})}}(e)||!0),null," message ")}bl.HeadlinesFeed=pp,Vl.listen.on(" connected ",e),Vl.listen.on(" reconnected ",e),Object.assign(Vl,vp)}});const yp=Ah.env.utils;class _p extends dr{defaults(){return{msgid:yp.getUniqueId(),is_ephemeral:!1}}}const{Strophe:bp,$build:wp}=Ah.env;bp.addNamespace(" RSM "," http : //jabber.org/protocol/rsm");const Sp=["after","before","index","max"],xp=e=>Number(e),Ep=e=>e.toString(),Ap={after:Ep,before:Ep,count:xp,first:Ep,index:xp,last:Ep,max:xp},Cp=e=>void 0===e,$p=Object.keys(Ap);class kp{static getQueryParameters(){return lr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Sp)}static parseXMLResult(e){const t={};for(var n=0;n<$p.length;n++){const s=$p[n],i=e.getElementsByTagName(s)[0];Cp(i)||null===i||(t[s]=Ap[s](bp.getText(i)),"first"==s&&(t.index=Ap.index(i.getAttribute("index"))))}return t}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.query=kp.getQueryParameters(e),this.result=e.xml?kp.parseXMLResult(e.xml):{}}toXML(){const e=wp("set",{xmlns:bp.NS.RSM});return Sp.reduce(((e,t)=>Cp(this.query[t])?e:e.c(t).t((this.query[t]||"").toString()).up()),e).tree()}next(e,t){const n=Object.assign({},this.query,{after:this.result.last,before:t,max:e});return new kp(n)}previous(e,t){const n=Object.assign({},this.query,{after:t,before:this.result.first,max:e});return new kp(n)}}bl.RSM_ATTRIBUTES=$p,bl.RSM=kp;const{Strophe:jp,$iq:Tp,dayjs:Ip}=Ah.env,{NS:Np}=jp,Op=Ah.env.utils,Mp={archive:{async query(e){if(!Vl.connection.connected())throw new Error("Can't call `api.archive.query` before having established an XMPP session");const t={type:"set"};if(e&&e.groupchat){if(!e.with)throw new Error('You need to specify a "with" value containing the chat room JID, when querying groupchat messages.');t.to=e.with}const n=t.to||bl.bare_jid;if(!await Vl.disco.supp
2023-06-25 15:59:31 +02:00
< div class = "form-group" >
2023-12-29 14:11:55 +01:00
$ { "hidden" !== e . type ? nh ` <label for=" ${ e . id } "> ${ e . label } </label> ` : "" }
2023-06-25 15:59:31 +02:00
<!-- This is a hack to prevent Chrome from auto - filling the username in
any of the other input fields in the MUC configuration form . -- >
2023-12-29 14:11:55 +01:00
$ { "password" === e . type && e . fixed _username ? nh `
2023-06-25 15:59:31 +02:00
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.fixed_username}" > < / i n p u t >
` :""}
< input
autocomplete = "${e.autocomplete||" "}"
class = "form-control"
id = "${e.id}"
name = "${e.name}"
placeholder = "${e.placeholder||" "}"
type = "${e.type}"
value = "${e.value||" "}"
? required = $ { e . required } / >
2023-12-29 14:11:55 +01:00
< / d i v > ` , v _ = e = > n h `
2023-06-25 15:59:31 +02:00
< div class = "form-group" >
< label for = "${e.id}" > $ { e . label } < / l a b e l >
< select class = "form-control" id = "${e.id}" name = "${e.name}" ? multiple = "${e.multiple}" >
2023-12-29 14:11:55 +01:00
$ { e . options ? . map ( ( e => ( e => nh ` <option value=" ${ e . value } " ?selected=" ${ e . selected } "> ${ e . label } </option> ` ) ( e ) ) ) }
2023-06-25 15:59:31 +02:00
< / s e l e c t >
2023-12-29 14:11:55 +01:00
< / d i v > ` , y _ = e = > n h `
2023-06-25 15:59:31 +02:00
< label > $ { e . label }
< a class = "form-url" target = "_blank" rel = "noopener" href = "${e.value}" > $ { e . value } < / a >
2023-12-29 14:11:55 +01:00
< / l a b e l > ` , _ _ = e = > n h `
2023-06-25 15:59:31 +02:00
< div class = "form-group" >
2023-12-29 14:11:55 +01:00
$ { e . label ? nh ` <label> ${ e . label } </label> ` : "" }
2023-06-25 15:59:31 +02:00
< div class = "input-group" >
< input name = "${e.name}"
class = "form-control"
type = "${e.type}"
value = "${e.value||" "}"
? required = "${e.required}" / >
< div class = "input-group-append" >
< div class = "input-group-text" title = "${e.domain}" > $ { e . domain } < / d i v >
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
< /div>`;function b_(e){e.preventDefault(),Vl.rooms.open(e.target.href)}const w_=(e,t)=>{let n=e.normalizePath().toString();return e._parts.protocol||t.startsWith("http:/ / ")||t.startsWith(" https : //")||(n="http://"+n),"xmpp"===e._parts.protocol&&"join"===e._parts.query?nh`
2023-06-25 15:59:31 +02:00
< a target = "_blank"
rel = "noopener"
2023-12-29 14:11:55 +01:00
@ click = $ { b _ }
href = "${n}" > $ { t } < / a > ` : n h ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { n } " > $ { t } < / a > ` } , S _ = ( e , t ) = > n h ` < v i d e o c o n t r o l s p r e l o a d = " m e t a d a t a " s r c = " $ { e } " > < / v i d e o > $ { t ? " " : n h ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { s i z z l e : x _ , S t r o p h e : E _ } = A h . e n v , A _ = [ " h t t p " , " h t t p s " , " x m p p " , " m a i l t o " ] ; f u n c t i o n C _ ( e , t ) { r e t u r n { " m u c # r o o m c o n f i g _ l a n g " : " l a n g u a g e " , " m u c # r o o m c o n f i g _ r o o m s e c r e t " : t ? . n e w _ p a s s w o r d ? " n e w - p a s s w o r d " : " c u r r e n t - p a s s w o r d " } [ e ] } c o n s t $ _ = { " t e x t - p r i v a t e " : " p a s s w o r d " , " t e x t - s i n g l e " : " t e x t " , f i x e d : " l a b e l " , b o o l e a n : " c h e c k b o x " , h i d d e n : " h i d d e n " , " j i d - m u l t i " : " t e x t a r e a " , " l i s t - s i n g l e " : " d r o p d o w n " , " l i s t - m u l t i " : " d r o p d o w n " } , k _ = { " x s : a n y U R I " : " u r l " , " x s : b y t e " : " n u m b e r " , " x s : d a t e " : " d a t e " , " x s : d a t e T i m e " : " d a t e t i m e " , " x s : i n t " : " n u m b e r " , " x s : i n t e g e r " : " n u m b e r " , " x s : t i m e " : " t i m e " } , j _ = / \ s * \ n \ s * / ; f u n c t i o n T _ ( e ) { l e t t ; e = e . t r e e ? . ( ) ? ? e ; c o n s t n = [ ] , s = d o c u m e n t . c r e a t e T r e e W a l k e r ( e , N o d e F i l t e r . S H O W _ T E X T , ( e = > " b o d y " = = = e . p a r e n t E l e m e n t . n o d e N a m e . t o L o w e r C a s e ( ) ? N o d e F i l t e r . F I L T E R _ R E J E C T : N o d e F i l t e r . F I L T E R _ A C C E P T ) ) ; f o r ( ; t = s . n e x t N o d e ( ) ; ) n . p u s h ( t ) ; r e t u r n n . f o r E a c h ( ( e = > j _ . t e s t ( e . d a t a ) & & e . p a r e n t E l e m e n t . r e m o v e C h i l d ( e ) ) ) , e } c o n s t I _ = n e w X M L S e r i a l i z e r ; f u n c t i o n N _ ( e ) { c o n s t t = e . g e t A t t r i b u t e ( " n a m e " ) ; i f ( ! t ) r e t u r n n u l l ; l e t n ; r e t u r n n = " c h e c k b o x " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? e . c h e c k e d ? 1 : 0 : " T E X T A R E A " = = e . t a g N a m e ? e . v a l u e . s p l i t ( " \ n " ) . f i l t e r ( ( e = > e . t r i m ( ) ) ) : " S E L E C T " = = e . t a g N a m e ? Z c . g e t S e l e c t V a l u e s ( e ) : e . v a l u e , { n a m e : t , v a l u e : n } } f u n c t i o n O _ ( e ) { c o n s t t = $ _ [ e . g e t A t t r i b u t e ( " t y p e " ) ] ; i f ( " t e x t " = = t ) { c o n s t n = e . g e t E l e m e n t s B y T a g N a m e N S ( " h t t p : / / j a b b e r . o r g / p r o t o c o l / x d a t a - v a l i d a t e " , " v a l i d a t e " ) ; i f ( 1 = = = n . l e n g t h ) { c o n s t e = n [ 0 ] . g e t A t t r i b u t e ( " d a t a t y p e " ) ; r e t u r n k _ [ e ] | | t } } r e t u r n t } f u n c t i o n M _ ( e ) { c o n s t t = L h ( e ) ; t r y { r e t u r n d e c o d e U R I ( t . f i l e n a m e ( ) ) } c a t c h ( e ) { r e t u r n Y c . d e b u g ( e ) , t . f i l e n a m e ( ) } } f u n c t i o n R _ ( e ) { c o n s t t = L h ( e ) ; r e t u r n n u l l = = = t ? e : J h ( t ) ? S _ ( e ) : V h ( t ) ? f _ ( e ) : ( Z h ( t ) , g _ ( t . t o S t r i n g ( ) , M _ ( t ) ) ) } f u n c t i o n D _ ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . c o n t a i n s ( e ) } f u n c t i o n z _ ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . a d d ( e ) , t } f u n c t i o n L _ ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . r e m o v e ( e ) , t } f u n c t i o n P _ ( e ) { r e t u r n e i n s t a n c e o f E l e m e n t & & e . p a r e n t N o d e & & e . p a r e n t N o d e . r e m o v e C h i l d ( e ) , e } f u n c t i o n F _ ( e , t ) { l e t n = e ; f o r ( ; n u l l ! = = n & & ! x _ . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p a r e n t E l e m e n t ; r e t u r n n } f u n c t i o n U _ ( e ) { c o n s t t = R e g E x p ( " ^ w { 3 } . " , " i g " ) . t e s t ( e ) ? ` h t t p : / / $ { e } ` : e , n = L h ( e ) ; r e t u r n n u l l = = = n | | ! f u n c t i o n ( e ) { t r y { r e t u r n ! ! n e w U R L ( e ) } c a t c h ( e ) { r e t u r n ! 1 } } ( t ) | | ! f u n c t i o n ( e ) { r e t u r n ! ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : A _ ) . i n c l u d e s ( e ) } ( n . _ p a r t s . p r o t o c o l ) & & n . _ p a r t s . p r o t o c o l ? e : w _ ( n , e ) } f u n c t i o n B _ ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : 2 0 0 ; r e t u r n n e w P r o m i s e ( ( ( n , s ) = > { i f ( ! e ) { c o n s t e = " A n e l e m e n t n e e d s t o b e p a s s e d i n t o s l i d e O u t " ; r e t u r n Y c . w a r n ( e ) , v o i d s ( n e w E r r o r ( e ) ) } c o n s t i = e . g e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) ; i & & ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , c a n c e l A n i m a t i o n F r a m e ( i ) ) ; c o n s t r = Z c . c a l c u l a t e E l e m e n t H e i g h t ( e ) ; i f ( w i n d o w . c o n v e r s e _ d i s a b l e _ e f f e c t s ) r e t u r n e . s t y l e . h e i g h t = r + " p x " , f u n c t i o n ( e ) { e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . c l a s s L i s t . r e m o v e ( " c o l l a p s e d " ) , e . s t y l e . o v e r f l o w = " " , e . s t y l e . h e i g h t = " " } ( e ) , v o i d n ( ) ; i f ( ! Z c . h a s C l a s s ( " c o l l a p s e d " , e ) & & ! Z c . h a s C l a s s ( " h i d d e n " , e ) ) r e t u r n v o i d n ( ) ; c o n s t o = t / 1 7 ; l e t a = 0 ; e . s t y l e . h e i g h t = " 0 " , e . s t y l e . o v e r f l o w = " h i d d e n " , e . c l a s s L i s t . r e m o v e ( " h i d d e n " ) , e . c l a s s L i s t . r e m o v e ( " c o l l a p s e d " ) , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , r e q u e s t A n i m a t i o n F r a m e ( ( f u n c t i o n t ( ) { a + = r / o , a < r ? ( e . s t y l e . h e i g h t = a + " p x " , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , r e q u e s t A n i m a t i o n F r a m e ( t ) . t o S t r i n g ( ) ) ) : ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . s t y l e . h e i g h t = Z c . c a l c u l a t e E l e m e n t H e i g h t ( e ) + " p x " , e . s t y l e . o v e r f l o w = " " , e . s t y l e . h e i g h t = " " , n ( ) ) } ) ) . t o S t r i n g ( ) ) } ) ) } f u n c t i o n q _ ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : 2 0 0 ; r e t u r n n e w P r o m i s e ( ( ( n , s ) = > { i f ( ! e ) { c o n s t e = " A n e l e m e n t n e e d s t o b e p a s s e d i n t o s l i d e I n " ; r e t u r n Y c . w a r n ( e ) , s ( n e w E r r o r ( e ) ) } i f ( Z c . h a s C l a s s ( " c o l l a p s e d " , e ) ) r e t u r n n ( e ) ; i f ( w i n d o w . c o n v e r s e _ d i s a b l e _ e f f e c t s ) r e t u r n e . c l a s s L i s t . a d d ( " c o l l a p s e d " ) , e . s t y l e . h e i g h t = " " , n ( e ) ; c o n s t i = e . g e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) ; i & & ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , c a n c e l A n i m a t i o n F r a m e ( i ) ) ; c o n s t r = e . o f f s e t H e i g h t , o = t / 1 7 ; l e t a = r ; e . s t y l e . o v e r f l o w = " h i d d e
2023-06-25 15:59:31 +02:00
< div class = "form-group" >
< label class = "label-ta" for = "${t}" > $ { e . label } < / l a b e l >
< textarea name = "${e.name}" id = "${t}" class = "form-control" > $ { e . value } < / t e x t a r e a >
< / d i v >
2023-12-29 14:11:55 +01:00
` })({name:e.getAttribute("var"),label:e.getAttribute("label")||"",value:e.querySelector("value")?.textContent,required:!!e.querySelector("required")});if("boolean"===e.getAttribute("type")){const t=e.querySelector("value")?.textContent;return(e=>nh `
2023-06-25 15:59:31 +02:00
< fieldset class = "form-group" >
< input id = "${e.id}" name = "${e.name}" type = "checkbox" ? checked = $ { e . checked } ? required = $ { e . required } / >
< label class = "form-check-label" for = "${e.id}" > $ { e . label } < / l a b e l >
2023-12-29 14:11:55 +01:00
< / f i e l d s e t > ` ) ( { i d : Z c . g e t U n i q u e I d ( ) , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , c h e c k e d : " 1 " = = = t | | " t r u e " = = = t ? ' c h e c k e d = " 1 " ' : " " } ) } i f ( " u r l " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n y _ ( { l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : e . q u e r y S e l e c t o r ( " v a l u e " ) ? . t e x t C o n t e n t } ) ; i f ( " u s e r n a m e " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n _ _ ( { d o m a i n : " @ " + n . d o m a i n , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , t y p e : O _ ( e ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : e . q u e r y S e l e c t o r ( " v a l u e " ) ? . t e x t C o n t e n t , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) ; i f ( " p a s s w o r d " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n p _ ( { n a m e : e . g e t A t t r i b u t e ( " v a r " ) , t y p e : " p a s s w o r d " , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : e . q u e r y S e l e c t o r ( " v a l u e " ) ? . t e x t C o n t e n t , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) ; i f ( " o c r " = = = e . g e t A t t r i b u t e ( " v a r " ) ) { c o n s t n = e . q u e r y S e l e c t o r ( " u r i " ) , s = x _ ( ' d a t a [ c i d = " ' + n . t e x t C o n t e n t . r e p l a c e ( / ^ c i d : / , " " ) + ' " ] ' , t ) [ 0 ] ; r e t u r n ( e = > n h `
2023-06-25 15:59:31 +02:00
< fieldset class = "form-group" >
2023-12-29 14:11:55 +01:00
$ { e . label ? nh ` <label> ${ e . label } </label> ` : "" }
2023-06-25 15:59:31 +02:00
< img src = "data:${e.type};base64,${e.data}" >
< input name = "${e.name}" type = "text" ? required = "${e.required}" / >
< / f i e l d s e t >
2023-12-29 14:11:55 +01:00
` )({label:e.getAttribute("label"),name:e.getAttribute("var"),data:s?.textContent,type:n.getAttribute("type"),required:!!e.querySelector("required")})}{const t=e.getAttribute("var");return p_({id:Zc.getUniqueId(),label:e.getAttribute("label")||"",name:t,fixed_username:n?.fixed_username,autocomplete:C_(t,n),placeholder:null,required:!!e.querySelector("required"),type:O_(e),value:e.querySelector("value")?.textContent})}},Object.assign(Zc,{hasClass:D_,addClass:z_,ancestor:F_,getOOBURLMarkup:R_,isEqualNode:function(e,t){if(!Zc.isElement(e))throw new Error("Element being compared must be an Element!");e=T_(e),t=T_(t);let n=e.isEqualNode(t);if(!n){const{xmlHtmlNode:s}=E_,i=I_.serializeToString(e),r=I_.serializeToString(t);n=i===r||s(i).isEqualNode(s(r))}return n},removeClass:L_,removeElement:P_,slideIn:q_,slideOut:B_});const G_=Zc;var W_=n(975),V_={};V_.styleTagTransform=i_(),V_.setAttributes=e_(),V_.insert=Yy().bind(null,"head"),V_.domAPI=Qy(),V_.insertStyleElement=n_();Jy()(W_.Z,V_);W_.Z&&W_.Z.locals&&W_.Z.locals;const J_=u_.extend({className:"modal",persistent:!1,events:{"click .nav-item .nav-link":"switchTab"},initialize(e){if(!this.id)throw new Error("Each modal class must have a unique id attribute");Object.assign(this,e),this.render(),this.el.setAttribute("tabindex","-1"),this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-hidden","true");const t=this.el.querySelector(".modal-title").getAttribute("id");t&&this.el.setAttribute("aria-labelledby",t),this.insertIntoDOM();const n=c_().Modal;this.modal=new n(this.el,{backdrop:!0,keyboard:!0}),this.el.addEventListener("hide.bs.modal",(()=>this.onHide()),!1)},onHide(){L_("selected",this.trigger_el),!this.persistent&&Vl.modal.remove(this)},insertIntoDOM(){document.querySelector("#converse-modals").insertAdjacentElement("beforeEnd",this.el)},switchTab(e){e.stopPropagation(),e.preventDefault(),Eo()(".nav-link.active",this.el).forEach((e=>{L_("active",this.el.querySelector(e.getAttribute("href"))),L_("active",e)})),z_("active",e.target),z_("active",this.el.querySelector(e.target.getAttribute("href")))},alert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"primary";const n=this.el.querySelector(".modal-alert");if(null===n)return void Yc.error("Could not find a .modal-alert element in the modal to show an alert message in!");bh(l_({type: ` alert - $ { t } ` ,message:e}),n);const s=n.firstElementChild;setTimeout((()=>{z_("fade-out",s),setTimeout((()=>P_(s)),600)}),5e3)},show(e){e&&(e.preventDefault(),this.trigger_el=e.target,!D_("chat-image",this.trigger_el)&&z_("selected",this.trigger_el)),this.modal.show()}}),Z_=J_,Q_=nh ` < button type = "button" class = "btn btn-secondary" data - dismiss = "modal" > $ { qy ( "Close" ) } < / b u t t o n > ` , K _ = n h ` < b u t t o n t y p e = " b u t t o n " c l a s s = " c l o s e " d a t a - d i s m i s s = " m o d a l " a r i a - l a b e l = " $ { q y ( " C l o s e " ) } " > < s p a n a r i a - h i d d e n = " t r u e " > × < / s p a n > < / b u t t o n > ` , Y _ = ( " u n d e f i n e d " ! = t y p e o f E l e m e n t & & E l e m e n t . p r o t o t y p e , / ^ ( \ S + ) \ s * ( . * ) $ / ) , X _ = [ " m o d e l " , " c o l l e c t i o n " , " e v e n t s " ] ; c l a s s e b e x t e n d s H T M L E l e m e n t { e v e n t s = { } ; c o n s t r u c t o r ( e ) { s u p e r ( ) , t h i s . c i d = j n ( " v i e w " ) , t h i s . _ d o m E v e n t s = [ ] , B e ( t h i s , l r ( e , X _ ) ) } c r e a t e R e n d e r R o o t ( ) { r e t u r n t h i s } c o n n e c t e d C a l l b a c k ( ) { t h i s . _ i n i t i a l i z e d | | ( t h i s . p r e i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t s ) , t h i s . i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t s ) , t h i s . _ i n i t i a l i z e d = ! 0 ) , t h i s . d e l e g a t e E v e n t s ( ) } d i s c o n n e c t e d C a l l b a c k ( ) { t h i s . u n d e l e g a t e E v e n t s ( ) , t h i s . s t o p L i s t e n i n g ( ) } p r e i n i t i a l i z e ( ) { } i n i t i a l i z e ( ) { } r e n d e r ( ) { r e t u r n _ ( t h i s . b e f o r e R e n d e r ) & & t h i s . b e f o r e R e n d e r ( ) , _ ( t h i s . t o H T M L ) & & b h ( t h i s . t o H T M L ( ) , t h i s ) , _ ( t h i s . a f t e r R e n d e r ) & & t h i s . a f t e r R e n d e r ( ) , t h i s } d e l e g a t e E v e n t s ( ) { i f ( ! t h i s . e v e n t s ) r e t u r n t h i s ; t h i s . u n d e l e g a t e E v e n t s ( ) ; f o r ( c o n s t e i n t h i s . e v e n t s ) { l e t t = t h i s . e v e n t s [ e ] ; i f ( _ ( t ) | | ( t = t h i s [ t ] ) , ! t ) c o n t i n u e ; c o n s t n = e . m a t c h ( Y _ ) ; t h i s . d e l e g a t e ( n [ 1 ] , n [ 2 ] , t . b i n d ( t h i s ) ) } r e t u r n t h i s } d e l e g a t e ( e , t , n ) { c o n s t s = t h i s ; i f ( ! s ) r e t u r n t h i s ; i f ( " f u n c t i o n " = = t y p e o f t & & ( n = t , t = n u l l ) , - 1 ! = = [ " f o c u s " , " b l u r " ] . i n d e x O f ( e ) ) { c o n s t s = t h i s . q u e r y S e l e c t o r A l l ( t ) ; f o r ( l e t t = 0 , i = s . l e n g t h ; t < i ; t + + ) { c o n s t i = s [ t ] ; i . a d d E v e n t L i s t e n e r ( e , n , ! 1 ) , t h i s . _ d o m E v e n t s . p u s h ( { e l : i , e v e n t N a m e : e , h a n d l e r : n } ) } r e t u r n n } c o n s t i = t ? f u n c t i o n ( e ) { l e t i = e . t a r g e t | | e . s r c E l e m e n t ; f o r ( ; i & & i ! = s ; i = i . p a r e n t N
2022-12-17 22:08:36 +01:00
< div class = "modal-dialog" role = "document" tabindex = "-1" role = "dialog" aria - hidden = "true" >
< div class = "modal-content" >
2023-01-07 22:34:35 +01:00
< div class = "modal-header ${n}" >
2022-12-17 22:08:36 +01:00
< h5 class = "modal-title" > $ { e . getModalTitle ( ) } < / h 5 >
2023-06-25 15:59:31 +02:00
$ { K _ }
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" >
2023-12-29 14:11:55 +01:00
$ { t ? l _ ( { type : ` alert- ${ t . type } ` , message : t . message } ) : "" }
2022-12-17 22:08:36 +01:00
< / s p a n >
2023-01-07 22:34:35 +01:00
$ { e . renderModal ? . ( ) ? ? "" }
2022-12-17 22:08:36 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . renderModalFooter ? . ( ) ? ? nh ` <div class="modal-footer"> ${ Q _ } </div> ` }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
` })(this)}getModalTitle(){return""}switchTab(e){e?.stopPropagation(),e?.preventDefault(),this.tab=e.target.getAttribute("data-name"),this.render()}onHide(){this.modal.hide()}insertIntoDOM(){document.querySelector("#converse-modals").insertAdjacentElement("beforeEnd",this)}alert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"primary";this.model.set("alert",{message:e,type:t}),setTimeout((()=>{this.model.set("alert",void 0)}),5e3)}async show(){await this.initialized,this.modal.show(),this.render()}};Vl.elements.define("converse-alert-modal",class extends tb{initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render())),this.addEventListener("hide.bs.modal",(()=>this.remove()),!1)}renderModal(){return(e=>nh `
2022-12-17 22:08:36 +01:00
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
2023-12-29 14:11:55 +01:00
$ { e . messages . map ( ( e => nh ` <p> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t h i s . m o d e l . t o J S O N ( ) ) } g e t M o d a l T i t l e ( ) { r e t u r n t h i s . m o d e l . g e t ( " t i t l e " ) } } ) ; c o n s t n b = e = > n h `
2022-12-17 22:08:36 +01:00
< form class = "converse-form converse-form--modal confirm" action = "#" @ submit = $ { t => e . onConfimation ( t ) } >
< div class = "form-group" >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "messages" ) ? . map ( ( e => nh ` <p> ${ e } </p> ` ) ) }
2022-12-17 22:08:36 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "fields" ) ? . map ( ( e => ( e => nh `
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label >
$ { e . label || "" }
< input type = "text"
name = "${e.name}"
class = "${e.challenge_failed?" error ":" "} form-control form-control--labeled"
? required = "${e.required}"
placeholder = "${e.placeholder}" / >
< / l a b e l >
< / d i v >
` )(e)))}
< div class = "form-group" >
2023-12-29 14:11:55 +01:00
< button type = "submit" class = "btn btn-primary" > $ { qy ( "OK" ) } < / b u t t o n >
< input type = "button" class = "btn btn-secondary" data - dismiss = "modal" value = "${qy(" Cancel ")}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< /form>`;class sb extends tb{constructor(e){super(e),this.confirmation=Ao()}initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render())),this.addEventListener("hide.bs.modal",(()=>{this.confirmation.isResolved||this.confirmation.reject()}),!1)}renderModal(){return nb(this)}getModalTitle(){return this.model.get("title")}onConfimation(e){e.preventDefault();const t=new FormData(e.target),n=(this.model.get("fields")||[]).map((e=>{const n=t.get(e.name).trim();return e.value=n,e.challenge&&(e.challenge_failed=n!==e.challenge),e}));if(n.filter((e=>e.challenge_failed)).length)return this.model.set("fields",n),void this.model.trigger("change");this.confirmation.resolve(n),this.modal.hide()}renderModalFooter(){return""}}Vl.elements.define("converse-confirm-modal",sb);let ib=[],rb={};const ob={modal:{show(e,t,n){let s;if("string"==typeof e)s=this.get(e)??this.create(e,t),Object.assign(s,t);else{const n=e,i=n.id??t.id;s=this.get(i)??this.create(n,t)}return s.show(n),s},get:e=>rb[e]??ib.filter((t=>t.id==e)).pop(),create(e,t){let n;if("string"==typeof e){const s=customElements.get(e);n=rb[e]=new s(t)}else{n=new e(t),ib.push(n)}return n},remove(e){let t;"string"==typeof e?(t=rb[e],delete rb[e]):(t=e,ib=ib.filter((e=>e!==t))),t?.remove()},removeAll(){ib.forEach((e=>e.remove())),ib=[],rb={}}},async confirm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"==typeof t&&(t=[t]);const n=new dr({title:e,messages:t,fields:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],type:"confirm"}),s=new sb({model:n});let i;s.show();try{i=await s.confirmation}catch(e){i=!1}return s.remove(),i},async prompt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"==typeof t&&(t=[t]);const n=new dr({title:e,messages:t,fields:[{name:"reason",placeholder:arguments.length>2&&void 0!==arguments[2]?arguments[2]:""}],type:"prompt"}),s=new sb({model:n});let i;s.show();try{i=(await s.confirmation).pop()?.value}catch(e){i=!1}return s.remove(),i},alert(e,t,n){let s;"string"==typeof n&&(n=[n]),"error"===e?s="alert-danger":"info"===e?s="alert-info":"warn"===e&&(s="alert-warning");const i=new dr({title:t,messages:n,level:s,type:"alert"});ob.modal.show("converse-alert-modal",{model:i})}},ab=ob;Ah.env.BootstrapModal=Z_,Ah.plugins.add("converse-modal",{initialize(){Vl.listen.on("disconnect",(()=>{const e=document.querySelector("#converse-modals");e&&(e.innerHTML="")})),Vl.listen.on("clearSession",(()=>Vl.modal.removeAll())),Object.assign(bl.api,ab)}});const cb=Ah.env.utils,lb={getElement:(e,t)=>"string"==typeof e?(t||document).querySelector(e):e||null,bind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.addEventListener(t,s)))}},unbind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.removeEventListener(t,s)))}},regExpEscape:e=>e.replace(/ [ - \ \ ^ $ * + ? . ( ) | [ \ ] { } ] / g , "\\$&" ) , isMention : ( e , t ) => t . includes ( e [ 0 ] ) || cb . isMentionBoundary ( e [ 0 ] ) && t . includes ( e [ 1 ] ) } , db = function ( e , t ) { return RegExp ( lb . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , ub = function ( e , t ) { return RegExp ( "^" + lb . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , hb = function ( e , t ) { const n = e . query . toLowerCase ( ) , s = e . label . toLowerCase ( ) . indexOf ( n ) , i = t . label . toLowerCase ( ) . indexOf ( n ) ; return s === i ? function ( e , t ) { return e . length !== t . length ? e . length - t . length : e < t ? - 1 : 1 } ( e , t ) : ( - 1 === s ? 1 / 0 : s ) < ( - 1 === i ? 1 / 0 : i ) ? - 1 : 1 } , mb = ( e , t ) => { t = t . trim ( ) ; const n = document . createElement ( "li" ) ; n . setAttribute ( "aria-selected" , "false" ) ; const s = new RegExp ( "(" + t + ")" , "ig" ) ; return ( t ? e . split ( s ) : [ e ] ) . forEach ( ( e => { if ( t && e . match ( s ) ) { const t = document . createElement ( "mark" ) ; t . textContent = e , n . appendChild ( t ) } else n . appendChild ( document . createTextNode ( e ) ) } ) ) , n } ; const fb = class extends String { constructor ( e , t ) { super ( ) ; const n = Array . isArray ( e ) ? { label : e [ 0 ] , value : e [ 1 ] } : "object" == typeof e && "label" in e && "value" in e ? e : { label : e , value : e } ; this . label = n . label || n . value , this . value = n . value , this . query = t } get lenth ( ) { return this . label . length } toString ( ) { return "" + this . label } valueOf ( ) { retur
2022-12-17 22:08:36 +01:00
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results ${e}" hidden = "" > < / u l >
< input
? autofocus = $ { this . autofocus }
? required = $ { this . required }
type = "text"
name = "${this.name}"
autocomplete = "off"
@ keydown = $ { this . onKeyDown }
@ keyup = $ { this . onKeyUp }
class = "form-control suggestion-box__input"
placeholder = "${this.placeholder}"
/ >
< span
class = "suggestion-box__additions visually-hidden"
role = "status"
aria - live = "assertive"
aria - relevant = "additions"
> < / s p a n >
< / d i v >
2023-12-29 14:11:55 +01:00
` }firstUpdated(){this.auto_complete=new vb(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?db:ub,include_triggers:[],list:this.list??(e=>this.getAutoCompleteList(e)),match_current_word:!0,max_items:this.max_items,min_chars:this.min_chars}),this.auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}onKeyDown(e){this.auto_complete.onKeyDown(e)}onKeyUp(e){this.auto_complete.evaluate(e)}});var yb=n(6022),_b={};_b.styleTagTransform=i_(),_b.setAttributes=e_(),_b.insert=Yy().bind(null,"head"),_b.domAPI=Qy(),_b.insertStyleElement=n_();Jy()(yb.Z,_b);yb.Z&&yb.Z.locals&&yb.Z.locals;bl.FILTER_CONTAINS=db,bl.FILTER_STARTSWITH=ub,bl.AutoComplete=vb;const bb={execute:qy("Execute"),prev:qy("Previous"),next:qy("Next"),complete:qy("Complete")},wb=(e,t)=>nh `
2022-12-17 22:08:36 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . toggleCommandForm ( t ) }
2022-12-17 22:08:36 +01:00
data - command - node = "${t.node}"
data - command - jid = "${t.jid}"
data - command - name = "${t.name}"
title = "${t.name}"
href = "#" > $ { t . name || t . jid } < / a >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { t . node === e . showform ? ( ( e , t ) => { const n = qy ( "Cancel" ) ; return nh `
2022-12-17 22:08:36 +01:00
< span > <!-- Don ' t remove this < span > ,
this is a workaround for a lit bug where a < form > cannot be removed
if it contains an < input > with name "remove" -- >
2023-02-17 12:24:37 +01:00
< form >
2023-12-29 14:11:55 +01:00
$ { t . alert ? nh ` <div class="alert alert- ${ t . alert _type } " role="alert"> ${ t . alert } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< fieldset class = "form-group" >
< input type = "hidden" name = "command_node" value = "${t.node}" / >
< input type = "hidden" name = "command_jid" value = "${t.jid}" / >
2023-02-17 12:24:37 +01:00
< p class = "form-instructions" > $ { t . instructions } < / p >
2022-12-17 22:08:36 +01:00
$ { t . fields }
< / f i e l d s e t >
< fieldset >
2023-12-29 14:11:55 +01:00
$ { t . actions . map ( ( t => nh ` <input data-action=" ${ t } "
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . executeAction ( t ) }
type = "button"
class = "btn btn-primary"
2023-06-25 15:59:31 +02:00
value = "${bb[t]}" > ` ))}<input type="button"
2023-02-17 12:24:37 +01:00
class = "btn btn-secondary button-cancel"
value = "${n}"
@ click = $ { t => e . cancel ( t ) } >
2022-12-17 22:08:36 +01:00
< / f i e l d s e t >
< / f o r m >
< / s p a n >
` })(e,t):""}
< / l i >
2023-12-29 14:11:55 +01:00
` ,Sb=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.classes?.includes("hor_centered")?nh ` < div class = "spinner__container" > < converse - icon size = "1em" class = "fa fa-spinner spinner centered ${e.classes||" "}" > < / c o n v e r s e - i c o n > < / d i v > ` : n h ` < c o n v e r s e - i c o n s i z e = " 1 e m " c l a s s = " f a f a - s p i n n e r s p i n n e r c e n t e r e d $ { e . c l a s s e s | | " " } " > < / c o n v e r s e - i c o n > ` } , x b = e = > { r e t u r n e . i m a g e ? n h `
2022-12-17 22:08:36 +01:00
< svg xmlns = "http://www.w3.org/2000/svg" class = "avatar ${e.classes}" width = "${e.width}" height = "${e.height}" >
< image width = "${e.width}" height = "${e.height}" preserveAspectRatio = "xMidYMid meet" href = "${t=e.image,n=e.image_type,t.startsWith(" data : ")?t:`data:${n};base64,${t}`}" / >
2023-12-29 14:11:55 +01:00
< / s v g > ` : " " ; v a r t , n } ; v a r E b = n ( 1 8 0 ) , A b = { } ; A b . s t y l e T a g T r a n s f o r m = i _ ( ) , A b . s e t A t t r i b u t e s = e _ ( ) , A b . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , A b . d o m A P I = Q y ( ) , A b . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( E b . Z , A b ) ; E b . Z & & E b . Z . l o c a l s & & E b . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - a v a t a r " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d a t a : { t y p e : O b j e c t } , w i d t h : { t y p e : S t r i n g } , h e i g h t : { t y p e : S t r i n g } , n o n c e : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . w i d t h = 3 6 , t h i s . h e i g h t = 3 6 } r e n d e r ( ) { c o n s t e = t h i s . d a t a ? . i m a g e _ t y p e | | b l . D E F A U L T _ I M A G E _ T Y P E ; l e t t ; i f ( t h i s . d a t a ? . d a t a _ u r i ) t = t h i s . d a t a ? . d a t a _ u r i ; e l s e { t = " d a t a : " + e + " ; b a s e 6 4 , " + ( t h i s . d a t a ? . i m a g e | | b l . D E F A U L T _ I M A G E ) } r e t u r n x b ( { c l a s s e s : t h i s . g e t A t t r i b u t e ( " c l a s s " ) , h e i g h t : t h i s . h e i g h t , w i d t h : t h i s . w i d t h , i m a g e : t , i m a g e _ t y p e : e } ) } } ) ; c o n s t { I : C b } = y h , $ b = ( ) = > d o c u m e n t . c r e a t e C o m m e n t ( " " ) , k b = ( e , t , n ) = > { v a r s ; c o n s t i = e . _ $ A A . p a r e n t N o d e , r = v o i d 0 = = = t ? e . _ $ A B : t . _ $ A A ; i f ( v o i d 0 = = = n ) { c o n s t t = i . i n s e r t B e f o r e ( $ b ( ) , r ) , s = i . i n s e r t B e f o r e ( $ b ( ) , r ) ; n = n e w C b ( t , s , e , e . o p t i o n s ) } e l s e { c o n s t t = n . _ $ A B . n e x t S i b l i n g , o = n . _ $ A M , a = o ! = = e ; i f ( a ) { l e t t ; n u l l = = = ( s = n . _ $ A Q ) | | v o i d 0 = = = s | | s . c a l l ( n , e ) , n . _ $ A M = e , v o i d 0 ! = = n . _ $ A P & & ( t = e . _ $ A U ) ! = = o . _ $ A U & & n . _ $ A P ( t ) } i f ( t ! = = r | | a ) { l e t e = n . _ $ A A ; f o r ( ; e ! = = t ; ) { c o n s t t = e . n e x t S i b l i n g ; i . i n s e r t B e f o r e ( e , r ) , e = t } } } r e t u r n n } , j b = f u n c t i o n ( e , t ) { l e t n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : e ; r e t u r n e . _ $ A I ( t , n ) , e } , T b = { } , I b = e = > { v a r t ; n u l l = = = ( t = e . _ $ A P ) | | v o i d 0 = = = t | | t . c a l l ( e , ! 1 , ! 0 ) ; l e t n = e . _ $ A A ; c o n s t s = e . _ $ A B . n e x t S i b l i n g ; f o r ( ; n ! = = s ; ) { c o n s t e = n . n e x t S i b l i n g ; n . r e m o v e ( ) , n = e } } , N b = 2 , O b = e = > f u n c t i o n ( ) { f o r ( v a r t = a r g u m e n t s . l e n g t h , n = n e w A r r a y ( t ) , s = 0 ; s < t ; s + + ) n [ s ] = a r g u m e n t s [ s ] ; r e t u r n { _ $ l i t D i r e c t i v e $ : e , v a l u e s : n } } ; c l a s s M b { c o n s t r u c t o r ( e ) { } g e t _ $ A U ( ) { r e t u r n t h i s . _ $ A M . _ $ A U } _ $ A T ( e , t , n ) { t h i s . _ $ C t = e , t h i s . _ $ A M = t , t h i s . _ $ C i = n } _ $ A S ( e , t ) { r e t u r n t h i s . u p d a t e ( e , t ) } u p d a t e ( e , t ) { r e t u r n t h i s . r e n d e r ( . . . t ) } } c o n s t R b = ( e , t ) = > { v a r n , s ; c o n s t i = e . _ $ A N ; i f ( v o i d 0 = = = i ) r e t u r n ! 1 ; f o r ( c o n s t e o f i ) n u l l = = = ( s = ( n = e ) . _ $ A O ) | | v o i d 0 = = = s | | s . c a l l ( n , t , ! 1 ) , R b ( e , t ) ; r e t u r n ! 0 } , D b = e = > { l e t t , n ; d o { i f ( v o i d 0 = = = ( t = e . _ $ A M ) ) b r e a k ; n = t . _ $ A N , n . d e l e t e ( e ) , e = t } w h i l e ( 0 = = = ( n u l l = = n ? v o i d 0 : n . s i z e ) ) } , z b = e = > { f o r ( l e t t ; t = e . _ $ A M ; e = t ) { l e t n = t . _ $ A N ; i f ( v o i d 0 = = = n ) t . _ $ A N = n = n e w S e t ; e l s e i f ( n . h a s ( e ) ) b r e a k ; n . a d d ( e ) , F b ( t ) } } ; f u n c t i o n L b ( e ) { v o i d 0 ! = = t h i s . _ $ A N ? ( D b ( t h i s ) , t h i s . _ $ A M = e , z b ( t h i s ) ) : t h i s . _ $ A M = e } f u n c t i o n P b ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] & & a r g u m e n t s [ 1 ] , n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : 0 ; c o n s t s = t h i s . _ $ A H , i = t h i s . _ $ A N ; i f ( v o i d 0 ! = = i & & 0 ! = = i . s i z e ) i f ( t ) i f ( A r r a y . i s A r r a y ( s ) ) f o r ( l e t e = n ; e < s . l e n g t h ; e + + ) R b ( s [ e ] , ! 1 ) , D b ( s [ e ] ) ; e l s e n u l l ! = s & & ( R b ( s , ! 1 ) , D b ( s ) ) ; e l s e R b ( t h i s , e ) } c o n s t F b = e = > { v a r t , n , s , i ; e . t y p e = = N b & & ( n u l l ! = = ( t = ( s = e ) . _ $ A P ) & & v o i d 0 ! = = t | | ( s . _ $ A P = P b ) , n u l l ! = = ( n = ( i = e ) . _ $ A Q ) & & v o i d 0 ! = = n | | ( i . _ $ A Q = L b ) ) } ; c l a s s U b e x t e n d s M b { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) , t h i s . _ $ A N = v o i d 0 } _ $ A T ( e , t , n ) { s u p e r . _ $ A T ( e , t , n ) , z b ( t h i s ) , t h i s . i s C o n n e c t e d = e . _ $ A U } _ $ A O ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; v a r n , s ; e ! = = t h i s . i s C o n n e c t e d & & ( t h i s . i s C o n n e c t e d = e , e ? n u l l = = = ( n = t h i s . r e c o n n e c t e d ) | | v o i d 0 = = = n | | n . c a l l ( t h i s ) : n u l l = = = ( s = t h i s . d i s c o n n e c t e d ) | | v o i d 0 = = = s | | s . c a l l ( t h i s ) ) , t & & ( R b ( t h i s , e ) , D b ( t h i s ) ) } s e t V a l u e ( e ) { i f ( ( e = > v o i d 0 = = = e . s t r i n g s ) ( t h i s . _ $ C t ) ) t h i s . _ $ C t . _ $ A I ( e , t h i s ) ; e l s e { c o n s t t = [ . . . t h i s . _ $ C t . _ $ A H ] ; t [ t h i s . _ $ C i ] = e , t h i s . _ $ C t . _ $ A I ( t , t h i s , 0 ) } } d i s c o n n e c t e d ( ) { } r e c o n n e c t e d ( ) { } } c l a s s B b { c o n s t r u c t o r ( e ) { t h i s . G = e } d i s c o n n e c t ( ) { t h i s . G = v o i d 0 } r e c o n n e c t ( e ) { t h i s . G = e } d e r e f ( ) { r e t u r n t h i s . G } } c l a s s q b { c o n s t r u c t o r ( ) { t h i s . Y = v o i d 0 , t h i s . Z = v o i d 0 } g e t ( ) { r e t u r n t h i s . Y } p a u s e ( ) { v a r e ; n u l l ! = = ( e = t h i s . Y ) & & v o i d 0 ! = = e | | ( t h i s . Y = n e w P r o m i s e ( ( e = > t h i s . Z = e ) ) ) } r e s u m e ( ) { v a r e ; n u l l = = = ( e = t h i s . Z ) | | v o i d 0 = = = e | | e . c a l l ( t h i s ) , t h i s . Y = t h i s . Z = v o i d 0 } } c o n s t H b = e = > ! ( e = > n u l l = = = e | | " o b j e c t " ! = t y p e o f e & & " f u n c t i o n " ! = t y p e o f e ) ( e ) & & " f u n c t i o n " = = t y p e o f e . t h e n , G b = 1 0 7 3 7 4 1 8 2 3 ; c o n s t W b = O b ( c l a s s e x t e n d s U b { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) , t h i s . _ $ C _ t = G b , t h i s . _ $ C w t = [ ] , t h i s . _ $ C q = n e w B b ( t h i s ) , t h i s . _ $ C K = n e w q b } r e n d e r ( ) { f o r ( v a r e , t = a r g u m e n t s . l e n g t h , n = n e w A r r a y ( t ) , s = 0 ; s < t ; s + + ) n [ s ] = a r g u m e n t s [ s ] ; r e t u r n n u l l ! = = ( e = n . f i n d ( ( e = > ! H b ( e ) ) ) ) & & v o i d 0 ! = = e ? e : s h } u p d a t e ( e , t ) { c o n s t n = t h i s . _ $ C w t ; l e t s = n . l e n g t h ; t h i s . _ $ C w t = t ; c o n s t i = t h i s . _ $ C q , r = t h i s . _ $ C K ; t h i s . i s C o n n e c t e d | | t h i s . d i s c o n n e c t e d ( ) ; f o r ( l e t e = 0 ; e
2022-12-17 22:08:36 +01:00
< div class = "row" >
< div class = "col-auto" >
< converse - avatar
class = "avatar modal-avatar"
2023-01-07 22:34:35 +01:00
. data = $ { s ? . attributes }
nonce = $ { s ? . get ( "vcard_updated" ) }
2022-12-17 22:08:36 +01:00
height = "120" width = "120" > < / c o n v e r s e - a v a t a r >
< / d i v >
< div class = "col" >
< ul class = "occupant-details" >
< li >
2023-12-29 14:11:55 +01:00
$ { i ? nh ` <div class="row"><strong> ${ qy ( "Nickname" ) } :</strong></div><div class="row"> ${ i } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-12-29 14:11:55 +01:00
$ { n ? nh ` <div class="row"><strong> ${ qy ( "XMPP Address" ) } :</strong></div><div class="row"> ${ n } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-12-29 14:11:55 +01:00
< div class = "row" > < strong > $ { qy ( "Affiliation" ) } : < / s t r o n g > < / d i v >
2023-06-25 15:59:31 +02:00
< div class = "row" > $ { a } & nbsp ;
2023-12-29 14:11:55 +01:00
$ { d ? nh `
2023-06-25 15:59:31 +02:00
< a href = "#"
data - form = "affiliation-form"
class = "toggle-form right"
color = "var(--subdued-color)"
@ click = $ { t => e . toggleForm ( t ) } > < converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2023-12-29 14:11:55 +01:00
$ { e . show _affiliation _form ? nh ` <converse-muc-affiliation-form jid= ${ n } .muc= ${ l } affiliation= ${ a } ></converse-muc-affiliation-form> ` : "" } ` :""}
2023-06-25 15:59:31 +02:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-12-29 14:11:55 +01:00
< div class = "row" > < strong > $ { qy ( "Role" ) } : < / s t r o n g > < / d i v >
2023-06-25 15:59:31 +02:00
< div class = "row" > $ { o } & nbsp ;
2023-12-29 14:11:55 +01:00
$ { d && o ? nh `
2023-06-25 15:59:31 +02:00
< a href = "#"
data - form = "row-form"
class = "toggle-form right"
color = "var(--subdued-color)"
@ click = $ { t => e . toggleForm ( t ) } > < converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2023-12-29 14:11:55 +01:00
$ { e . show _role _form ? nh ` <converse-muc-role-form jid= ${ n } .muc= ${ l } role= ${ o } ></converse-muc-role-form> ` : "" } ` :""}
2023-06-25 15:59:31 +02:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-12-29 14:11:55 +01:00
$ { c ? nh ` <div class="row"><strong> ${ qy ( "Hats" ) } :</strong></div><div class="row"> ${ c } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-12-29 14:11:55 +01:00
$ { r ? nh ` <div class="row"><strong> ${ qy ( "Occupant Id" ) } :</strong></div><div class="row"> ${ r } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
2023-12-29 14:11:55 +01:00
$ { Wb ( f , "" ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
` })(this)}getModalTitle(){const e=this.model??this.message;return e?.getDisplayName()}addToContacts(){const e=(this.model??this.message).get("jid");e&&Vl.modal.show("converse-add-contact-modal",{model:new dr({jid:e})})}toggleForm(e){"row-form"===Vb.ancestor(e.target,".toggle-form").getAttribute("data-form")?this.show_role_form=!this.show_role_form:this.show_affiliation_form=!this.show_affiliation_form,this.render()}});const Qb=(e,t)=>nh `
2023-06-25 15:59:31 +02:00
< li class = "list-group-item" data - nick = "${t.item.nick}" >
2022-12-17 22:08:36 +01:00
< ul class = "list-group" >
< li class = "list-group-item active" >
2023-06-25 15:59:31 +02:00
< div > < strong > JID : < / s t r o n g > $ { t . i t e m . j i d } < / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li class = "list-group-item" >
2023-06-25 15:59:31 +02:00
< div > < strong > Nickname : < / s t r o n g > $ { t . i t e m . n i c k } < / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li class = "list-group-item" >
2023-12-29 14:11:55 +01:00
< div > < strong > Role : < / s t r o n g > $ { t . i t e m . r o l e } $ { t . a s s i g n a b l e _ r o l e s . l e n g t h ? ( e = > n h `
2023-06-25 15:59:31 +02:00
< a href = "#" data - form = "converse-muc-role-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
2023-06-25 15:59:31 +02:00
< / a > ` ) ( t ) : " " } < / d i v >
2023-12-29 14:11:55 +01:00
$ { t . assignable _roles . length ? nh ` <converse-muc-role-form class="hidden" .muc= ${ e . muc } jid= ${ t . item . jid } role= ${ t . item . role } ></converse-muc-role-form> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< / u l >
< / l i >
2023-12-29 14:11:55 +01:00
` ,Kb=(e,t)=>nh `
2023-06-25 15:59:31 +02:00
< li class = "list-group-item" data - nick = "${t.item.nick}" >
2022-12-17 22:08:36 +01:00
< ul class = "list-group" >
< li class = "list-group-item active" >
2023-06-25 15:59:31 +02:00
< div > < strong > JID : < / s t r o n g > $ { t . i t e m . j i d } < / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li class = "list-group-item" >
2023-06-25 15:59:31 +02:00
< div > < strong > Nickname : < / s t r o n g > $ { t . i t e m . n i c k } < / d i v >
2022-12-17 22:08:36 +01:00
< / l i >
< li class = "list-group-item" >
2023-12-29 14:11:55 +01:00
< div > < strong > Affiliation : < / s t r o n g > $ { t . i t e m . a f f i l i a t i o n } $ { t . a s s i g n a b l e _ a f f i l i a t i o n s . l e n g t h ? ( e = > n h `
2023-06-25 15:59:31 +02:00
< a href = "#" data - form = "converse-muc-affiliation-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
2023-06-25 15:59:31 +02:00
< / a > ` ) ( t ) : " " } < / d i v >
2023-12-29 14:11:55 +01:00
$ { t . assignable _affiliations . length ? nh ` <converse-muc-affiliation-form class="hidden" .muc= ${ e . muc } jid= ${ t . item . jid } affiliation= ${ t . item . affiliation } ></converse-muc-affiliation-form> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< / u l >
< / l i >
2023-12-29 14:11:55 +01:00
` ,Yb=(e,t)=>{const n=qy("Affiliation"),s=qy("No users with that affiliation found."),i=qy("No users with that role found."),r=qy("Type here to filter the search results"),o=qy("Role"),a=qy("Show users"),c=qy("Roles are assigned to users to grant or deny them certain abilities in a multi-user chat. They're assigned either explicitly or implicitly as part of an affiliation. A role that's not due to an affiliation, is only valid for the duration of the user's session."),l=qy("An affiliation is a long-lived entitlement which typically implies a certain role and which grants privileges and responsibilities. For example admins and owners automatically have the moderator role."),d=t.queryable_roles.length&&t.queryable_affiliations.length;return nh `
$ { t . alert _message ? nh ` <div class="alert alert- ${ t . alert _type } " role="alert"> ${ t . alert _message } </div> ` : "" }
$ { d ? ( e => nh `
2022-12-17 22:08:36 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" affiliations "===e.tab?" active ":" "}"
id = "affiliations-tab"
href = "#affiliations-tabpanel"
aria - controls = "affiliations-tabpanel"
role = "tab"
data - name = "affiliations"
@ click = $ { e . switchTab } > Affiliations < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" roles "===e.tab?" active ":" "}"
id = "roles-tab"
href = "#roles-tabpanel"
aria - controls = "roles-tabpanel"
role = "tab"
data - name = "roles"
@ click = $ { e . switchTab } > Roles < / a >
< / l i >
< / u l >
2023-06-25 15:59:31 +02:00
` )(t):""}
2022-12-17 22:08:36 +01:00
< div class = "tab-content" >
2023-12-29 14:11:55 +01:00
$ { t . queryable _affiliations . length ? nh `
2023-06-25 15:59:31 +02:00
< div class = "tab-pane tab-pane--columns ${" affiliations "===t.tab?" active ":" "}" id = "affiliations-tabpanel" role = "tabpanel" aria - labelledby = "affiliations-tab" >
< form class = "converse-form query-affiliation" @ submit = $ { t . queryAffiliation } >
< p class = "helptext pb-3" > $ { l } < / p >
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label for = "affiliation" >
2023-06-25 15:59:31 +02:00
< strong > $ { n } : < / s t r o n g >
2022-12-17 22:08:36 +01:00
< / l a b e l >
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-affiliation" name = "affiliation" >
2023-12-29 14:11:55 +01:00
$ { t . queryable _affiliations . map ( ( e => ( e => nh `
2022-12-17 22:08:36 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . affiliation }
2023-06-25 15:59:31 +02:00
title = "${Zb(e.item)}" > $ { e . item } < / o p t i o n >
` )(Object.assign({item:e},t))))}
2022-12-17 22:08:36 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2023-06-25 15:59:31 +02:00
< input type = "submit" class = "btn btn-primary" name = "users_with_affiliation" value = "${a}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2023-12-29 14:11:55 +01:00
$ { Array . isArray ( t . users _with _affiliation ) && t . users _with _affiliation . length > 5 ? nh ` <input class="form-control" .value=" ${ t . affiliations _filter } " @keyup= ${ t . filterAffiliationResults } type="text" name="filter" placeholder=" ${ r } "/> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { Zb ( t . affiliation ) ? nh ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ Zb ( t . affiliation ) } </p></div></div> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2023-12-29 14:11:55 +01:00
$ { t . loading _users _with _affiliation ? nh ` <li class="list-group-item"> ${ Sb ( ) } </li> ` : "" }
$ { Array . isArray ( t . users _with _affiliation ) && 0 === t . users _with _affiliation . length ? nh ` <li class="list-group-item"> ${ s } </li> ` : "" }
2022-12-17 22:08:36 +01:00
2023-12-29 14:11:55 +01:00
$ { t . users _with _affiliation instanceof Error ? nh ` <li class="list-group-item"> ${ t . users _with _affiliation . message } </li> ` : ( t . users _with _affiliation || [ ] ) . map ( ( n => ( n . nick || n . jid ) . match ( new RegExp ( t . affiliations _filter , "i" ) ) ? Kb ( e , Object . assign ( { item : n } , t ) ) : "" ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v > ` : " " }
2023-12-29 14:11:55 +01:00
$ { t . queryable _roles . length ? nh `
2023-06-25 15:59:31 +02:00
< div class = "tab-pane tab-pane--columns ${" roles "===t.tab?" active ":" "}" id = "roles-tabpanel" role = "tabpanel" aria - labelledby = "roles-tab" >
< form class = "converse-form query-role" @ submit = $ { t . queryRole } >
< p class = "helptext pb-3" > $ { c } < / p >
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
2023-06-25 15:59:31 +02:00
< label for = "role" > < strong > $ { o } : < / s t r o n g > < / l a b e l >
2022-12-17 22:08:36 +01:00
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-role" name = "role" >
2023-12-29 14:11:55 +01:00
$ { t . queryable _roles . map ( ( e => ( e => nh `
2022-12-17 22:08:36 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . role }
2023-06-25 15:59:31 +02:00
title = "${Jb(e.item)}" > $ { e . item } < / o p t i o n >
` )(Object.assign({item:e},t))))}
2022-12-17 22:08:36 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2023-06-25 15:59:31 +02:00
< input type = "submit" class = "btn btn-primary" name = "users_with_role" value = "${a}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2023-12-29 14:11:55 +01:00
$ { Array . isArray ( t . users _with _role ) && t . users _with _role . length > 5 ? nh ` <input class="form-control" .value=" ${ t . roles _filter } " @keyup= ${ t . filterRoleResults } type="text" name="filter" placeholder=" ${ r } "/> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { Jb ( t . role ) ? nh ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ Jb ( t . role ) } </p></div></div> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2023-12-29 14:11:55 +01:00
$ { t . loading _users _with _role ? nh ` <li class="list-group-item"> ${ Sb ( ) } </li> ` : "" }
$ { t . users _with _role && 0 === t . users _with _role . length ? nh ` <li class="list-group-item"> ${ i } </li> ` : "" }
2023-06-25 15:59:31 +02:00
$ { ( t . users _with _role || [ ] ) . map ( ( n => n . nick . match ( t . roles _filter ) ? Qb ( e , Object . assign ( { item : n } , t ) ) : "" ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v > ` : " " }
2023-12-29 14:11:55 +01:00
< / d i v > ` } ; v a r X b = n ( 6 2 0 5 ) , e w = { } ; e w . s t y l e T a g T r a n s f o r m = i _ ( ) , e w . s e t A t t r i b u t e s = e _ ( ) , e w . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , e w . d o m A P I = Q y ( ) , e w . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( X b . Z , e w ) ; X b . Z & & X b . Z . l o c a l s & & X b . Z . l o c a l s ; c o n s t { u : t w } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m o d t o o l s " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { a f f i l i a t i o n : { t y p e : S t r i n g } , a f f i l i a t i o n s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ m e s s a g e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ t y p e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , j i d : { t y p e : S t r i n g } , m u c : { t y p e : O b j e c t , a t t r i b u t e : ! 1 } , r o l e : { t y p e : S t r i n g } , r o l e s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , t a b : { t y p e : S t r i n g } , u s e r s _ w i t h _ a f f i l i a t i o n : { t y p e : A r r a y , a t t r i b u t e : ! 1 } , u s e r s _ w i t h _ r o l e : { t y p e : A r r a y , a t t r i b u t e : ! 1 } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . t a b = " a f f i l i a t i o n s " , t h i s . a f f i l i a t i o n = " " , t h i s . a f f i l i a t i o n s _ f i l t e r = " " , t h i s . r o l e = " " , t h i s . r o l e s _ f i l t e r = " " , t h i s . a d d E v e n t L i s t e n e r ( " a f f i l i a t i o n C h a n g e d " , ( ( ) = > { t h i s . a l e r t ( q y ( " A f f i l i a t i o n c h a n g e d " ) , " p r i m a r y " ) , t h i s . o n S e a r c h A f f i l i a t i o n C h a n g e ( ) , t h i s . r e q u e s t U p d a t e ( ) } ) ) , t h i s . a d d E v e n t L i s t e n e r ( " r o l e C h a n g e d " , ( ( ) = > { t h i s . a l e r t ( q y ( " R o l e c h a n g e d " ) , " p r i m a r y " ) , t h i s . r e q u e s t U p d a t e ( ) } ) ) } u p d a t e d ( e ) { e . h a s ( " r o l e " ) & & t h i s . o n S e a r c h R o l e C h a n g e ( ) , e . h a s ( " a f f i l i a t i o n " ) & & t h i s . o n S e a r c h A f f i l i a t i o n C h a n g e ( ) , e . h a s ( " j i d " ) & & e . g e t ( " j i d " ) & & t h i s . i n i t i a l i z e ( ) } a s y n c i n i t i a l i z e ( ) { t h i s . i n i t i a l i z e d = A o ( ) ; c o n s t e = a w a i t V l . r o o m s . g e t ( t h i s . j i d ) ; a w a i t e . i n i t i a l i z e d , t h i s . m u c = e , t h i s . i n i t i a l i z e d . r e s o l v e ( ) } r e n d e r ( ) { i f ( t h i s . m u c ? . o c c u p a n t s ) { c o n s t e = t h i s . m u c . o c c u p a n t s . g e t O w n O c c u p a n t ( ) ; r e t u r n Y b ( t h i s , { a f f i l i a t i o n s _ f i l t e r : t h i s . a f f i l i a t i o n s _ f i l t e r , a l e r t _ m e s s a g e : t h i s . a l e r t _ m e s s a g e , a l e r t _ t y p e : t h i s . a l e r t _ t y p e , a s s i g n R o l e : e = > t h i s . a s s i g n R o l e ( e ) , a s s i g n a b l e _ a f f i l i a t i o n s : B f ( e ) , a s s i g n a b l e _ r o l e s : a g ( e ) , f i l t e r A f f i l i a t i o n R e s u l t s : e = > t h i s . f i l t e r A f f i l i a t i o n R e s u l t s ( e ) , f i l t e r R o l e R e s u l t s : e = > t h i s . f i l t e r R o l e R e s u l t s ( e ) , l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n , q u e r y A f f i l i a t i o n : e = > t h i s . q u e r y A f f i l i a t i o n ( e ) , q u e r y R o l e : e = > t h i s . q u e r y R o l e ( e ) , q u e r y a b l e _ a f f i l i a t i o n s : b f . f i l t e r ( ( e = > ! V l . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , q u e r y a b l e _ r o l e s : _ f . f i l t e r ( ( e = > ! V l . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , r o l e s _ f i l t e r : t h i s . r o l e s _ f i l t e r , s w i t c h T a b : e = > t h i s . s w i t c h T a b ( e ) , t a b : t h i s . t a b , t o g g l e F o r m : e = > t h i s . t o g g l e F o r m ( e ) , u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n , u s e r s _ w i t h _ r o l e : t h i s . u s e r s _ w i t h _ r o l e } ) } r e t u r n " " } s w i t c h T a b ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , t h i s . t a b = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - n a m e " ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c o n S e a r c h A f f i l i a t i o n C h a n g e ( ) { i f ( t h i s . a f f i l i a t i o n ) { i f ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 0 , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = n u l l , t h i s . s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) ) { c o n s t e = a w a i t U f ( t h i s . a f f i l i a t i o n , t h i s . j i d ) ; e i n s t a n c e o f E r r o r ? ( t h i s . a l e r t ( e . m e s s a g e , " d a n g e r " ) , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = [ ] ) : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = e } e l s e t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = t h i s . m u c . g e t O c c u p a n t s W i t h A f f i l i a t i o n ( t h i s . a f f i l i a t i o n ) ; t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 1 } } a s y n c o n S e a r c h R o l e C h a n g e ( ) { t h i s . r o l e & & ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . u s e r s _ w i t h _ r o l e = t h i s . m u c . g e t O c c u p a n t s W i t h R o l e ( t h i s . r o l e ) ) } s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) { c o n s t e = t h i s . a f f i l i a t i o n ; i f ( " n o n e " = = = e ) r e t u r n ! 1 ; r e t u r n ! o g ( ) . i n c l u d e s ( e ) } t o g g l e F o r m ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t w . a n c e s t o r ( e . t a r g e t , " . t o g g l e - f o r m " ) , n = t . g e t A t t r i b u t e ( " d a t a - f o r m " ) , s = t w . a n c e s t o r ( t , " . l i s t - g r o u p - i t e m " ) . q u e r y S e l e c t o r ( n ) ; t w . h a s C l a s s ( " h i d d e n " , s ) ? t w . r e m o v e C l a s s ( " h i d d e n " , s ) : t w . a d d C l a s s ( " h i d d e n " , s ) } f i l t e r R o l e R e s u l t s ( e ) { t h i s . r o l e s _ f i l t e r = e . t a r g e t . v a l u e , t h i s . r e n d e r ( ) } f i l t e r A f f i l i a t i o n R e s u l t s ( e ) { t h i s . a f f i l i a t i o n s _ f i l t e r = e . t a r g e t . v a l u e } q u e r y R o l e ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " r o l e " ) ; t h i s . r o l e = n u l l , t h i s . r o l e = t } q u e r y A f f i l i a t i o n ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " a f f i l i a t i o n " ) ; t h i s . a f f i l i a t i o n = n u l l , t h i s . a f f i l i a t i o n = t } a l e r t ( e , t ) { t h i s . a l e r t _ m e s s a g e = e , t h i s . a l e r t _ t y p e = t } c l e a r A l e r t ( ) { t h i s . a l e r t _ m e s s a g e = v o i d 0 , t h i s . a l e r t _ t y p e = v o i d 0 } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m o d t o o l s - m o d a l " , c l a s s e x t e n d s t b { c o n s t r u c t o r ( e ) { s u p e r ( e ) , t h i s . i d = " c o n v e r s e - m o d t o o l s - m o d a l " } r e n d e r M o d a l ( ) { r e t u r n n h ` < c o n v e r s e - m o d t o o l s j i d = $ { t h i s . j i d }
$ { i == s . PASSWORD _REQUIRED ? nh ` <converse-muc-password-form class="muc-form-container" jid=" ${ n } "></converse-muc-password-form> ` : "" }
$ { i == s . ENTERED ? nh ` <converse-muc-chatarea jid=" ${ n } "></converse-muc-chatarea> ` : "" }
2023-06-25 15:59:31 +02:00
$ { i == s . CONNECTING ? Sb ( ) : "" }
2023-12-29 14:11:55 +01:00
$ { i == s . NICKNAME _REQUIRED ? function ( e ) { const t = e . get ( "jid" ) ; return Vl . settings . get ( "muc_show_logs_before_join" ) ? nh ` <converse-muc-chatarea jid=" ${ t } "></converse-muc-chatarea> ` : nh ` <converse-muc-nickname-form jid=" ${ t } "></converse-muc-nickname-form> ` } ( e . model ) : "" }
$ { i == s . DISCONNECTED ? nh ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . BANNED ? nh ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . DESTROYED ? nh ` <converse-muc-destroyed jid=" ${ n } "></converse-muc-destroyed> ` : "" }
` }function lw(e,t){t=t.trim();const n=document.createElement("li");if(n.setAttribute("aria-selected","false"),Vl.settings.get("muc_mention_autocomplete_show_avatar")){const t=document.createElement("img");let s="data:"+bl.DEFAULT_IMAGE_TYPE+";base64,"+bl.DEFAULT_IMAGE;if(bl.vcards){const t=bl.vcards.findWhere({nickname:e});t&&(s="data:"+t.get("image_type")+";base64,"+t.get("image"))}t.setAttribute("src",s),t.setAttribute("width","22"),t.setAttribute("class","avatar avatar-autocomplete"),n.appendChild(t)}const s=new RegExp("("+t+")","ig");return(t?e.split(s):[e]).forEach((e=>{if(t&&e.match(s)){const t=document.createElement("mark");t.textContent=e,n.appendChild(t)}else n.appendChild(document.createTextNode(e))})),n}async function dw(){const e=[...await Vl.rooms.get(),...await Vl.contacts.get()],t=[...new Set(e.map((e=>nw.getDomainFromJid(e.get("jid")))))];return t}function uw(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const r=rw[t];if(!r)throw Error( ` ChatRoomView # setRole called with invalid command : $ { t } ` );if(!e.verifyAffiliations(s)||!e.verifyRoles(i))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const o=e.getNickOrJIDFromCommandArgs(n);if(!o)return!1;const a=n.split(o,2)[1].trim(),c=e.getOccupant(o);return e.setRole(c,r,a,void 0,(t=>e.onCommandError(t))),!0}function hw(e,t,n,s){const i=iw[t];if(!i)throw Error( ` verifyAffiliations called with invalid command : $ { t } ` );if(!e.verifyAffiliations(s))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const r=e.getNickOrJIDFromCommandArgs(n);if(!r)return!1;let o;const a=n.split(r,2)[1].trim(),c=e.getOccupant(r);if(c)o=c.get("jid");else{if(!sw.isValidJID(r)){const t=qy("Couldn't find a participant with that nickname. They might have left the groupchat.");return void e.createMessage({message:t,type:"error"})}o=r}const l={jid:o,reason:a};c&&Vl.settings.get("auto_register_muc_nickname")&&(l.nick=c.get("nick")),Hf(i,e.get("jid"),[l]).then((()=>e.occupants.fetchMembers())).catch((t=>e.onCommandError(t)))}function mw(e,t){if(!e.verifyRoles(["moderator"]))return;let n=Vl.modal.get("converse-modtools-modal");n?(n.affiliation=t,n.render()):n=Vl.modal.create("converse-modtools-modal",{affiliation:t,jid:e.get("jid")}),n.show()}function fw(e,t){const n=e.model;if(t||n.get("type")!==bl.CHATROOMS_TYPE||Vl.settings.get("muc_disable_slash_commands")&&!Array.isArray(Vl.settings.get("muc_disable_slash_commands")))return t;let s=e.text;s=s.replace(/^ \s */,"");const i=(s.match(/^ \/ ([a-zA-Z]*) ?/)||[""]).pop().toLowerCase();if(!i)return!1;const r=s.slice(("/"+i).length+1).trim(),o=n.getAllowedCommands()??[];if("admin"===i&&o.includes(i))return hw(n,i,r,["owner"]),!0;if("ban"===i&&o.includes(i))return hw(n,i,r,["admin","owner"]),!0;if("modtools"===i&&o.includes(i))return mw(n,r),!0;if("deop"===i&&o.includes(i))return uw(n,i,r,["admin","owner"]),!0;if("destroy"===i&&o.includes(i))return!n.verifyAffiliations(["owner"])||(aw(n).catch((e=>n.onCommandError(e))),!0);if("help"===i&&o.includes(i))return n.set({show_help_messages:!1},{silent:!0}),n.set({show_help_messages:!0}),!0;if("kick"===i&&o.includes(i))return uw(n,i,r,[],["moderator"]),!0;if("mute"===i&&o.includes(i))return uw(n,i,r,[],["moderator"]),!0;if("member"===i&&o.includes(i))return hw(n,i,r,["admin","owner"]),!0;if("nick"===i&&o.includes(i)){if(!n.verifyRoles(["visitor","participant","moderator"]))return!0;if(0===r.length){const e=qy('Your nickname is "%1 $ s"',n.get("nick"));n.createMessage({message:e,type:"error"})}else n.setNickname(r);return!0}return"owner"===i&&o.includes(i)?(hw(n,i,r,["owner"]),!0):"op"===i&&o.includes(i)?(uw(n,i,r,["admin","owner"]),!0):"register"===i&&o.includes(i)?(r.length>1?n.createMessage({message:qy("Error: invalid number of arguments"),type:"error"}):n.registerNickname().then((e=>{e&&n.createMessage({message:e,type:"error"})})),!0):"revoke"===i&&o.includes(i)?(hw(n,i,r,["admin","owner"]),!0):"topic"===i&&o.includes(i)||"subject"===i&&o.includes(i)?(n.setSubject(r),!0):!("voice"!==i||!o.inclu
$ { e . alert ? nh ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert } </div> ` : "" }
$ { e . note ? nh ` <p class="form-help"> ${ e . note } </p> ` : "" }
2023-02-17 12:24:37 +01:00
2022-12-17 22:08:36 +01:00
< form class = "converse-form" @ submit = $ { e . fetchCommands } >
< fieldset class = "form-group" >
< label >
2023-02-17 12:24:37 +01:00
$ { t }
< p class = "form-help" > $ { n } < / p >
2022-12-17 22:08:36 +01:00
< converse - autocomplete
2023-06-25 15:59:31 +02:00
. getAutoCompleteList = "${dw}"
2023-02-17 12:24:37 +01:00
required
placeholder = "${r}"
2022-12-17 22:08:36 +01:00
name = "jid" >
< / c o n v e r s e - a u t o c o m p l e t e >
< / l a b e l >
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-12-29 14:11:55 +01:00
$ { e . fetching ? Sb ( ) : nh ` <input type="submit" class="btn btn-primary" value=" ${ i } "> ` }
2022-12-17 22:08:36 +01:00
< / f i e l d s e t >
2023-12-29 14:11:55 +01:00
$ { "list-commands" === e . view ? nh `
2022-12-17 22:08:36 +01:00
< fieldset class = "form-group" >
< ul class = "list-group" >
2023-02-17 12:24:37 +01:00
< li class = "list-group-item active" > $ { e . commands . length ? s : o } : < / l i >
2023-06-25 15:59:31 +02:00
$ { e . commands . map ( ( t => wb ( e , t ) ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / f i e l d s e t > ` : " " }
< / f o r m >
2023-12-29 14:11:55 +01:00
` },{Strophe:pw,sizzle:vw}=Ah.env;Vl.elements.define("converse-adhoc-commands",class extends Gy{static get properties(){return{alert:{type:String},alert_type:{type:String},commands:{type:Array},fetching:{type:Boolean},showform:{type:String},view:{type:String}}}constructor(){super(),this.view="choose-service",this.fetching=!1,this.showform="",this.commands=[]}render(){return gw(this)}async fetchCommands(e){e.preventDefault(),delete this.alert_type,delete this.alert,this.fetching=!0;const t=new FormData(e.target).get("jid").trim();let n;try{n=await Vl.disco.supports(pw.NS.ADHOC,t)}catch(e){Yc.error(e)}finally{this.fetching=!1}if(n)try{this.commands=await Vl.adhoc.getCommands(t),this.view="list-commands"}catch(e){return Yc.error(e),this.alert_type="danger",this.alert=qy("Sorry, an error occurred while looking for commands on that entity."),this.commands=[],void Yc.error(e)}else this.alert_type="danger",this.alert=qy("The specified entity doesn't support ad-hoc commands")}async toggleCommandForm(e){e.preventDefault();const t=e.target.getAttribute("data-command-node"),n=this.commands.filter((e=>e.node===t))[0];if(this.showform===t)this.showform="",this.requestUpdate();else{const e=await Vl.adhoc.fetchCommandForm(n);n.sessionid=e.sessionid,n.instructions=e.instructions,n.fields=e.fields,n.actions=e.actions,this.showform=t}}executeAction(e){e.preventDefault();const t=e.target.getAttribute("data-action");["execute","next","prev","complete"].includes(t)?this.runCommand(e.target.form,t):Yc.error( ` Unknown action : $ { t } ` )}clearCommand(e){delete e.alert,delete e.instructions,delete e.sessionid,delete e.alert_type,e.fields=[],e.acions=[],this.showform=""}async runCommand(e,t){const n=new FormData(e),s=n.get("command_jid").trim(),i=n.get("command_node").trim(),r=this.commands.filter((e=>e.node===i))[0];delete r.alert,this.requestUpdate();const o="prev"===t?[]:vw(":input:not([type=button]):not([type=submit])",e).filter((e=>!["command_jid","command_node"].includes(e.getAttribute("name")))).map(N_).filter((e=>e)),a=await Vl.adhoc.runCommand(s,r.sessionid,r.node,t,o),{fields:c,status:l,note:d,instructions:u,actions:h}=a;if("error"===l)return r.alert_type="danger",r.alert=qy("Sorry, an error occurred while trying to execute the command. See the developer console for details"),this.requestUpdate();"executing"===l?(r.alert=qy("Executing"),r.fields=c,r.instructions=u,r.alert_type="primary",r.actions=h):"completed"===l?(this.alert_type="primary",this.alert=qy("Completed"),this.note=d,this.clearCommand(r)):(Yc.error( ` Unexpected status for ad - hoc command : $ { l } ` ),r.alert=qy("Completed"),r.alert_type="primary"),this.requestUpdate()}async cancel(e){e.preventDefault(),this.showform="",this.requestUpdate();const t=new FormData(e.target.form),n=t.get("command_jid").trim(),s=t.get("command_node").trim(),i=this.commands.filter((e=>e.node===s))[0];delete i.alert,this.requestUpdate();const{status:r}=await Vl.adhoc.runCommand(n,i.sessionid,i.node,"cancel",[]);"error"===r?(i.alert_type="danger",i.alert=qy("An error occurred while trying to cancel the command. See the developer console for details")):"canceled"===r?(this.alert_type="",this.alert="",this.clearCommand(i)):(Yc.error( ` Unexpected status for ad - hoc command : $ { r } ` ),i.alert=qy("Error: unexpected result"),i.alert_type="danger"),this.requestUpdate()}}),Ah.plugins.add("converse-adhoc-views",{dependencies:["converse-controlbox","converse-muc"],initialize(){Vl.settings.extend({allow_adhoc_commands:!0})}});const yw=function(e,t,n){t=Dt(t,e);var s=null==(e=Hi(e,t))?e:e[zt(Bi(t))];return null==s?void 0:ke(s,e,n)};var _w=Re((function(e,t,n){var s=-1,i="function"==typeof t,r=be(e)?Array(e.length):[];return sl(e,(function(e){r[++s]=i?ke(t,e,n):yw(e,t,n)})),r}));const bw=_w;function ww(e,t){if(Vl.settings.get("allow_bookmarks")&&e.model.get("type")===bl.CHATROOMS_TYPE){const n={i18n_title:qy("Bookmark this groupchat"),i18n_text:qy("Bookmark"),handler:t=>e.showBookmarkModal(t),a_class:"toggle-bookmark",icon_class:"fa-bookmark",name:"bookmark"},s=t.map((e=>e.name)).indexOf("details"),i=Dg().then((e=>e?n:null));
2022-12-17 22:08:36 +01:00
< div class = "list-item room-item available-chatroom d-flex flex-row" data - room - jid = "${t}" >
< a class = "list-item-link open-room w-100" data - room - jid = "${t}"
title = "${s}"
2023-02-17 12:24:37 +01:00
@ click = $ { Ew } > $ { e . getDisplayName ( ) } < / a >
2022-12-17 22:08:36 +01:00
< a class = "list-item-action remove-bookmark align-self-center ${e.get(" bookmarked ")?" button - on ":" "}"
data - room - jid = "${t}"
data - bookmark - name = "${e.getDisplayName()}"
title = "${n}"
2023-02-17 12:24:37 +01:00
@ click = $ { Sw } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-bookmark" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
< / d i v >
2023-12-29 14:11:55 +01:00
` };var Cw=n(5422), $ w={}; $ w.styleTagTransform=i_(), $ w.setAttributes=e_(), $ w.insert=Yy().bind(null,"head"), $ w.domAPI=Qy(), $ w.insertStyleElement=n_();Jy()(Cw.Z, $ w);Cw.Z&&Cw.Z.locals&&Cw.Z.locals;class kw extends Gy{async initialize(){await Vl.waitUntil("bookmarksInitialized");const{bookmarks:e,chatboxes:t}=bl;this.liveFilter=Il((e=>this.model.set({filter_text:e.target.value})),100),this.listenTo(e,"add",(()=>this.requestUpdate())),this.listenTo(e,"remove",(()=>this.requestUpdate())),this.listenTo(t,"add",(()=>this.requestUpdate())),this.listenTo(t,"remove",(()=>this.requestUpdate()));const n= ` converse . bookmarks - list - model - $ { bl . bare _jid } ` ;this.model=new dr({id:n}),vc(this.model,n),this.listenTo(this.model,"change",(()=>this.requestUpdate())),this.model.fetch({success:()=>this.requestUpdate(),error:()=>this.requestUpdate()})}render(){return bl.bookmarks&&this.model?(e=>{const t=qy("Filter"),n=e.model.get("filter_text"),{bookmarks:s}=bl,i=n?s.filter((e=>((e,t)=>e.get("name")?.includes(t)||e.get("jid")?.includes(t))(e,n))):s;return nh `
2022-12-17 22:08:36 +01:00
< form class = "converse-form bookmarks-filter" >
< div class = "btn-group w-100" >
< input
. value = $ { n ? ? "" }
@ keydown = "${t=>e.liveFilter(t)}"
class = "form-control"
placeholder = "${t}" / >
< converse - icon size = "1em" class = "fa fa-times clear-input ${n?" ":" hidden "}"
@ click = $ { e . clearFilter } >
< / c o n v e r s e - i c o n >
< / d i v >
< / f o r m >
< div class = "list-container list-container--bookmarks" >
< div class = "items-list bookmarks rooms-list" >
2023-02-17 12:24:37 +01:00
$ { i . map ( ( e => Aw ( e ) ) ) }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
` })(this):Sb()}clearFilter(e){e?.stopPropagation?.(),this.model.set("filter_text","")}}Vl.elements.define("converse-bookmarks",kw);Vl.elements.define("converse-bookmark-list-modal",class extends tb{renderModal(){return nh ` < converse - bookmarks > < / c o n v e r s e - b o o k m a r k s > ` } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " B o o k m a r k s " ) } } ) ; c l a s s j w e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } w i l l U p d a t e ( e ) { e . h a s ( " j i d " ) & & ( t h i s . m o d e l = b l . c h a t b o x e s . g e t ( t h i s . j i d ) , t h i s . b o o k m a r k = b l . b o o k m a r k s . g e t ( t h i s . j i d ) ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = e . m o d e l . g e t D i s p l a y N a m e ( ) , n = e . b o o k m a r k ? . g e t ( " n i c k " ) ? ? e . m o d e l . g e t ( " n i c k " ) , s = q y ( ' B o o k m a r k f o r " % 1 $ s " ' , t ) , i = q y ( " W o u l d y o u l i k e t h i s g r o u p c h a t t o b e a u t o m a t i c a l l y j o i n e d u p o n s t a r t u p ? " ) , r = q y ( " R e m o v e " ) , o = q y ( " T h e n a m e f o r t h i s b o o k m a r k : " ) , a = q y ( " W h a t s h o u l d y o u r n i c k n a m e f o r t h i s g r o u p c h a t b e ? " ) , c = e . b o o k m a r k ? q y ( " U p d a t e " ) : q y ( " S a v e " ) ; r e t u r n n h `
2023-02-17 12:24:37 +01:00
< form class = "converse-form chatroom-form" @ submit = $ { t => e . onBookmarkFormSubmitted ( t ) } >
2023-01-07 22:34:35 +01:00
< legend > $ { s } < / l e g e n d >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "converse_muc_bookmark_name" > $ { o } < / l a b e l >
< input class = "form-control" type = "text" value = "${t}" name = "name" required = "required" id = "converse_muc_bookmark_name" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "converse_muc_bookmark_nick" > $ { a } < / l a b e l >
< input class = "form-control" type = "text" name = "nick" value = "${n||" "}" id = "converse_muc_bookmark_nick" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group form-check" >
2023-06-25 15:59:31 +02:00
< input class = "form-check-input" id = "converse_muc_bookmark_autojoin" type = "checkbox" ? checked = $ { e . bookmark ? . get ( "autojoin" ) } name = "autojoin" / >
2023-01-07 22:34:35 +01:00
< label class = "form-check-label" for = "converse_muc_bookmark_autojoin" > $ { i } < / l a b e l >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< input class = "btn btn-primary" type = "submit" value = "${c}" >
2023-12-29 14:11:55 +01:00
$ { e . bookmark ? nh ` <input class="btn btn-secondary button-remove" type="button" value=" ${ r } " @click= ${ t => e . removeBookmark ( t ) } > ` : "" }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< / f o r m >
2023-12-29 14:11:55 +01:00
` })(this)}onBookmarkFormSubmitted(e){e.preventDefault(),bl.bookmarks.createBookmark({jid:this.jid,autojoin:e.target.querySelector('input[name="autojoin"]')?.checked||!1,name:e.target.querySelector("input[name=name]")?.value,nick:e.target.querySelector("input[name=nick]")?.value}),this.closeBookmarkForm(e)}removeBookmark(e){this.bookmark?.destroy(),this.closeBookmarkForm(e)}closeBookmarkForm(e){e.preventDefault();const t=document.createEvent("Event");t.initEvent("hide.bs.modal",!0,!0),this.dispatchEvent(t)}}Vl.elements.define("converse-muc-bookmark-form",jw);const Tw=jw;Vl.elements.define("converse-bookmark-form-modal",class extends tb{renderModal(){return nh `
2022-12-17 22:08:36 +01:00
< converse - muc - bookmark - form class = "muc-form-container" jid = "${this.jid}" >
2023-12-29 14:11:55 +01:00
< / c o n v e r s e - m u c - b o o k m a r k - f o r m > ` } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " B o o k m a r k " ) } } ) ; c o n s t { u : I w } = A h . e n v , N w = { s e t B o o k m a r k S t a t e ( ) { i f ( v o i d 0 ! = = b l . b o o k m a r k s ) { b l . b o o k m a r k s . w h e r e ( { j i d : t h i s . m o d e l . g e t ( " j i d " ) } ) . l e n g t h ? t h i s . m o d e l . s a v e ( " b o o k m a r k e d " , ! 0 ) : t h i s . m o d e l . s a v e ( " b o o k m a r k e d " , ! 1 ) } } , r e n d e r B o o k m a r k F o r m ( ) { i f ( ! t h i s . b o o k m a r k _ f o r m ) { t h i s . b o o k m a r k _ f o r m = n e w b l . M U C B o o k m a r k F o r m ( { m o d e l : t h i s . m o d e l , c h a t r o o m v i e w : t h i s } ) ; t h i s . q u e r y S e l e c t o r ( " . c h a t r o o m - b o d y " ) . i n s e r t A d j a c e n t E l e m e n t ( " b e f o r e e n d " , t h i s . b o o k m a r k _ f o r m . e l ) } I w . s h o w E l e m e n t ( t h i s . b o o k m a r k _ f o r m . e l ) } , s h o w B o o k m a r k M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . g e t ( " j i d " ) ; V l . m o d a l . s h o w ( " c o n v e r s e - b o o k m a r k - f o r m - m o d a l " , { j i d : t } , e ) } } ; A h . p l u g i n s . a d d ( " c o n v e r s e - b o o k m a r k - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - c h a t b o x e s " , " c o n v e r s e - m u c " , " c o n v e r s e - m u c - v i e w s " ] , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { h i d e _ o p e n _ b o o k m a r k s : ! 0 } ) , b l . r e m o v e B o o k m a r k V i a E v e n t = S w , b l . a d d B o o k m a r k V i a E v e n t = x w , O b j e c t . a s s i g n ( b l . C h a t R o o m V i e w . p r o t o t y p e , N w ) , b l . M U C B o o k m a r k F o r m = T w , b l . B o o k m a r k s V i e w = k w , V l . l i s t e n . o n ( " g e t H e a d i n g B u t t o n s " , w w ) , V l . l i s t e n . o n ( " c h a t R o o m V i e w I n i t i a l i z e d " , ( e = > e . s e t B o o k m a r k S t a t e ( ) ) ) } } ) ; c o n s t O w = ( e , t , n ) = > { c o n s t s = n e w M a p ; f o r ( l e t i = t ; i < = n ; i + + ) s . s e t ( e [ i ] , i ) ; r e t u r n s } , M w = O b ( c l a s s e x t e n d s M b { c o n s t r u c t o r ( e ) { i f ( s u p e r ( e ) , e . t y p e ! = = N b ) t h r o w E r r o r ( " r e p e a t ( ) c a n o n l y b e u s e d i n t e x t e x p r e s s i o n s " ) } d t ( e , t , n ) { l e t s ; v o i d 0 = = = n ? n = t : v o i d 0 ! = = t & & ( s = t ) ; c o n s t i = [ ] , r = [ ] ; l e t o = 0 ; f o r ( c o n s t t o f e ) i [ o ] = s ? s ( t , o ) : o , r [ o ] = n ( t , o ) , o + + ; r e t u r n { v a l u e s : r , k e y s : i } } r e n d e r ( e , t , n ) { r e t u r n t h i s . d t ( e , t , n ) . v a l u e s } u p d a t e ( e , t ) { l e t [ n , s , i ] = t ; v a r r ; c o n s t o = ( e = > e . _ $ A H ) ( e ) , { v a l u e s : a , k e y s : c } = t h i s . d t ( n , s , i ) ; i f ( ! A r r a y . i s A r r a y ( o ) ) r e t u r n t h i s . h t = c , a ; c o n s t l = n u l l ! = = ( r = t h i s . h t ) & & v o i d 0 ! = = r ? r : t h i s . h t = [ ] , d = [ ] ; l e t u , h , m = 0 , f = o . l e n g t h - 1 , g = 0 , p = a . l e n g t h - 1 ; f o r ( ; m < = f & & g < = p ; ) i f ( n u l l = = = o [ m ] ) m + + ; e l s e i f ( n u l l = = = o [ f ] ) f - - ; e l s e i f ( l [ m ] = = = c [ g ] ) d [ g ] = j b ( o [ m ] , a [ g ] ) , m + + , g + + ; e l s e i f ( l [ f ] = = = c [ p ] ) d [ p ] = j b ( o [ f ] , a [ p ] ) , f - - , p - - ; e l s e i f ( l [ m ] = = = c [ p ] ) d [ p ] = j b ( o [ m ] , a [ p ] ) , k b ( e , d [ p + 1 ] , o [ m ] ) , m + + , p - - ; e l s e i f ( l [ f ] = = = c [ g ] ) d [ g ] = j b ( o [ f ] , a [ g ] ) , k b ( e , o [ m ] , o [ f ] ) , f - - , g + + ; e l s e i f ( v o i d 0 = = = u & & ( u = O w ( c , g , p ) , h = O w ( l , m , f ) ) , u . h a s ( l [ m ] ) ) i f ( u . h a s ( l [ f ] ) ) { c o n s t t = h . g e t ( c [ g ] ) , n = v o i d 0 ! = = t ? o [ t ] : n u l l ; i f ( n u l l = = = n ) { c o n s t t = k b ( e , o [ m ] ) ; j b ( t , a [ g ] ) , d [ g ] = t } e l s e d [ g ] = j b ( n , a [ g ] ) , k b ( e , o [ m ] , n ) , o [ t ] = n u l l ; g + + } e l s e I b ( o [ f ] ) , f - - ; e l s e I b ( o [ m ] ) , m + + ; f o r ( ; g < = p ; ) { c o n s t t = k b ( e , d [ p + 1 ] ) ; j b ( t , a [ g ] ) , d [ g + + ] = t } f o r ( ; m < = f ; ) { c o n s t e = o [ m + + ] ; n u l l ! = = e & & I b ( e ) } r e t u r n t h i s . h t = c , f u n c t i o n ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : T b ; e . _ $ A H = t } ( e , d ) , s h } } ) ; f u n c t i o n R w ( e ) { c o n s t { C O N T R O L B O X _ T Y P E : t } = b l , n = " o v e r l a y e d " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & e . g e t ( " m i n i m i z e d " ) ; r e t u r n e . g e t ( " t y p e " ) = = = t | | ! ( e . g e t ( " h i d d e n " ) | | n ) } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t s " , c l a s s e x t e n d s G y { i n i t i a l i z e ( ) { t h i s . m o d e l = b l . c h a t b o x e s , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c l o s e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : j i d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : m i n i m i z e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " d e s t r o y " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " r e c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " d i s c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) ; c o n s t e = w c ( ) ; t h i s . l i s t e n T o ( e , " c h a n g e : v i e w _ m o d e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( e , " c h a n g e : s i n g l e t o n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) ; c o n s t t = d o c u m e n t . g e t E l e m e n t B y I d ( " c o n v e r s e j s - b g " ) ; t & & ! t . i n n e r H T M L . t r i m ( ) & & b h ( n h `
2021-11-11 22:06:49 +01:00
< div class = "inner-content converse-brand row" >
< div class = "converse-brand__padding" > < / d i v >
< div class = "converse-brand__heading" >
< svg height = "200px"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364"
version = "1.1" >
< title > Logo Converse < / t i t l e >
< defs >
< linearGradient id = "gradient" x1 = "92.14" y1 = "27.64" x2 = "267.65" y2 = "331.62" gradientUnits = "userSpaceOnUse" >
< stop offset = "0" stop - color = "#fff1d1" / >
< stop offset = "0.05" stop - color = "#fae8c1" / >
< stop offset = "0.15" stop - color = "#f0d5a1" / >
< stop offset = "0.27" stop - color = "#e7c687" / >
< stop offset = "0.4" stop - color = "#e1bb72" / >
< stop offset = "0.54" stop - color = "#dcb264" / >
< stop offset = "0.71" stop - color = "#daad5c" / >
< stop offset = "1" stop - color = "#d9ac59" / >
< / l i n e a r G r a d i e n t >
< filter id = "shadow" >
< feGaussianBlur in = "SourceAlpha" stdDeviation = "2.3" result = "blur1" / >
< feOffset in = "blur1" dx = "3" dy = "3" result = "blur2" / >
< feColorMatrix in = "blur2" type = "matrix" result = "blur3"
values = " 1 0 0 0 0.1
0 1 0 0 0.1
0 0 1 0 0.1
0 0 0 1 0 " / >
< feMerge >
< feMergeNode in = "blur3" / >
< feMergeNode in = "SourceGraphic" / >
< / f e M e r g e >
< / f i l t e r >
< / d e f s >
< g filter = "url(#shadow)" >
< path d = "M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z" fill = "#d9ac59" / >
< path d = "M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z" fill = "url(#gradient)" / >
< / g >
< / s v g >
< span class = "converse-brand__text" >
< span > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
< p class = "byline" > messaging freedom < / p >
< / s p a n >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { "overlayed" === Vl . settings . get ( "view_mode" ) ? nh ` <div class="converse-brand__padding"></div> ` : "" }
< / d i v > ` , t ) ; d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . c l a s s L i s t . a d d ( ` c o n v e r s e - $ { V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) } ` ) , V l . t r i g g e r ( " c h a t B o x V i e w s I n i t i a l i z e d " ) } r e n d e r ( ) { r e t u r n ( ( ) = > { c o n s t { c h a t b o x e s : e , C O N T R O L B O X _ T Y P E : t , C H A T R O O M S _ T Y P E : n , H E A D L I N E S _ T Y P E : s } = b l , i = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , r = b l ? . c o n n e c t i o n , o = ! r ? . c o n n e c t e d | | ! r ? . a u t h e n t i c a t e d | | r ? . d i s c o n n e c t i n g ; r e t u r n n h `
$ { o || "overlayed" !== i ? "" : nh ` <converse-minimized-chats></converse-minimized-chats> ` }
$ { Mw ( e . filter ( Rw ) , ( e => e . get ( "jid" ) ) , ( e => e . get ( "type" ) === t ? nh `
$ { "overlayed" === i ? nh ` <converse-controlbox-toggle class=" ${ e . get ( "closed" ) ? "" : "hidden" } "></converse-controlbox-toggle> ` : "" }
2021-11-11 22:06:49 +01:00
< converse - controlbox
id = "controlbox"
2022-12-17 22:08:36 +01:00
class = "chatbox ${" overlayed "===i&&e.get(" closed ")?" hidden ":" "} ${o?" logged - out ":" "}"
2021-11-11 22:06:49 +01:00
style = "${e.get(" width ")?`width: ${e.get(" width ")}`:" "}" > < / c o n v e r s e - c o n t r o l b o x >
2023-12-29 14:11:55 +01:00
` :e.get("type")===n?nh `
2021-11-11 22:06:49 +01:00
< converse - muc jid = "${e.get(" jid ")}" class = "chatbox chatroom" > < / c o n v e r s e - m u c >
2023-12-29 14:11:55 +01:00
` :e.get("type")===s?nh `
2021-11-11 22:06:49 +01:00
< converse - headlines jid = "${e.get(" jid ")}" class = "chatbox headlines" > < / c o n v e r s e - h e a d l i n e s >
2023-12-29 14:11:55 +01:00
` :nh `
2021-11-11 22:06:49 +01:00
< converse - chat jid = "${e.get(" jid ")}" class = "chatbox" > < / c o n v e r s e - c h a t >
` ))}
2023-12-29 14:11:55 +01:00
` })()}});const Dw=class{constructor(){this.views={}}add(e,t){this.views[e]=t}get(e){return this.views[e]}xget(e){return this.keys().filter((t=>t!==e)).reduce(((e,t)=>(e[t]=this.views[t],e)),{})}getAll(){return Object.values(this.views)}keys(){return Object.keys(this.views)}remove(e){delete this.views[e]}map(e){return Object.values(this.views).map(e)}forEach(e){return Object.values(this.views).forEach(e)}filter(e){return Object.values(this.views).filter(e)}closeAllChatBoxes(){return Promise.all(Object.values(this.views).map((e=>e.close({name:"closeAllChatBoxes"}))))}};function zw(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh", ` $ { e } px ` )}var Lw=n(9989),Pw={};Pw.styleTagTransform=i_(),Pw.setAttributes=e_(),Pw.insert=Yy().bind(null,"head"),Pw.domAPI=Qy(),Pw.insertStyleElement=n_();Jy()(Lw.Z,Pw);Lw.Z&&Lw.Z.locals&&Lw.Z.locals;Ah.plugins.add("converse-chatboxviews",{dependencies:["converse-chatboxes","converse-vcard"],initialize(){Vl.promises.add(["chatBoxViewsInitialized"]),Vl.settings.extend({animate:!0}),bl.chatboxviews=new Dw,Vl.listen.on("chatBoxesInitialized",(()=>{bl.chatboxes.on("destroy",(e=>bl.chatboxviews.remove(e.get("jid"))))})),Vl.listen.on("cleanup",(()=>delete bl.chatboxviews)),Vl.listen.on("clearSession",(()=>bl.chatboxviews.closeAllChatBoxes())),Vl.listen.on("chatBoxViewsInitialized",zw),window.addEventListener("resize",zw),Object.assign(Ah,{insertInto(e){const t=bl.chatboxviews?.el;if(t&&!e.contains(t))e.insertAdjacentElement("afterBegin",t);else if(!t)throw new Error("Cannot insert non-existing #conversejs element into the DOM")}})}});var Fw=n(4912),Uw={};Uw.styleTagTransform=i_(),Uw.setAttributes=e_(),Uw.insert=Yy().bind(null,"head"),Uw.domAPI=Qy(),Uw.insertStyleElement=n_();Jy()(Fw.Z,Uw);Fw.Z&&Fw.Z.locals&&Fw.Z.locals;const{Strophe:Bw,u:qw}=Ah.env;class Hw extends Gy{static get properties(){return{is_retracted:{type:Boolean},model:{type:Object}}}initialize(){const e=wc();this.listenTo(e,"change:allowed_audio_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:allowed_image_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:allowed_video_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:render_media",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate()))}render(){return nh ` $ { Wb ( this . renderActions ( ) , "" ) } ` }async renderActions(){const e=this.model.collection.length>2&&this.model===this.model.collection.last(),t=(await this.getActionButtons()).map((e=>Hw.getActionsDropdownItem(e)));return t.length?nh ` < converse - dropdown
2021-11-11 22:06:49 +01:00
class = "chat-msg__actions ${e?" dropup dropup -- left ":" dropleft "}"
. items = $ { t }
2023-12-29 14:11:55 +01:00
> < / c o n v e r s e - d r o p d o w n > ` : " " } s t a t i c g e t A c t i o n s D r o p d o w n I t e m ( e ) { r e t u r n n h `
2021-11-11 22:06:49 +01:00
< button class = "chat-msg__action ${e.button_class}" @ click = $ { e . handler } >
< converse - icon
class = "${e.icon_class}"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { e . i18n _text }
< / b u t t o n >
2023-12-29 14:11:55 +01:00
` }async onMessageEditButtonClicked(e){e.preventDefault();const t=this.model.collection.findWhere("correcting"),n=qw.ancestor(this,".chatbox")?.querySelector(".chat-textarea")?.value;if(n&&(!t||t.getMessageText()!==n)){if(!await Vl.confirm(qy("You have an unsent message which will be lost if you continue. Are you sure?")))return}t!==this.model?(t?.save("correcting",!1),this.model.save("correcting",!0)):this.model.save("correcting",!1)}async onDirectMessageRetractButtonClicked(){if("me"!==this.model.get("sender"))return Yc.error("onMessageRetractButtonClicked called for someone else's message!");const e=qy("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[qy("Are you sure you want to retract this message?")];Vl.settings.get("show_retraction_warning")&&(t[1]=e);if(await Vl.confirm(qy("Confirm"),t)){this.model.collection.chatbox.retractOwnMessage(this.model)}}async retractOtherMessage(e){const t=this.model.collection.chatbox,n=await t.retractOtherMessage(this.model,e);if(null===n){const e=qy("A timeout occurred while trying to retract the message");Vl.alert("error",qy("Error"),e),Yc(e,Bw.LogLevel.WARN)}else if(qw.isErrorStanza(n)){const e=qy("Sorry, you're not allowed to retract this message.");Vl.alert("error",qy("Error"),e),Yc(e,Bw.LogLevel.WARN),Yc(n,Bw.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=qy("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere.");if(this.model.mayBeRetracted()){const t=[qy("Are you sure you want to retract this message?")];if(Vl.settings.get("show_retraction_warning")&&(t[1]=e),await Vl.confirm(qy("Confirm"),t)){this.model.collection.chatbox.retractOwnMessage(this.model)}}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[qy("Are you sure you want to retract this message?")];Vl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await Vl.confirm(qy("Confirm"),t)&&this.retractOtherMessage()}else{let t=[qy("You are about to retract this message."),qy("You may optionally include a message, explaining the reason for the retraction.")];Vl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await Vl.prompt(qy("Message Retraction"),t,qy("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=qy("Sorry, you're not allowed to retract this message");Vl.alert("error",qy("Error"),e)}}onMessageRetractButtonClicked(e){e?.preventDefault?.();this.model.collection.chatbox.get("type")===bl.CHATROOMS_TYPE?this.onMUCMessageRetractButtonClicked():this.onDirectMessageRetractButtonClicked()}onMediaToggleClicked(e){if(e?.preventDefault?.(),this.hasHiddenMedia(this.getMediaURLs()))this.model.save({hide_url_previews:!1,url_preview_transition:"fade-in"});else{(this.model.get("ogp_metadata")||[]).length?this.model.set("url_preview_transition","fade-out"):this.model.save({hide_url_previews:!0,url_preview_transition:"fade-in"})}}hasHiddenMedia(e){if("boolean"==typeof this.model.get("hide_url_previews"))return this.model.get("hide_url_previews");const t=Vl.settings.get("render_media");return Array.isArray(t)?e.reduce(((e,n)=>e||!Fh(t,n)),!1):!t}getMediaURLs(){const e=(this.model.get("ogp_metadata")||[]).map((e=>({url:e["og:image"],is_image:!0}))).filter((e=>Hh(e))),t=Th(this.model.get("media_urls")||[],this.model.get("body")).filter((e=>Hh(e)));return[...new Set([...t.map((e=>e.url)),...e.map((e=>e.url))])]}addMediaRenderingToggle(e){const t=this.getMediaURLs();if(t.length){const n=this.hasHiddenMedia(t);e.push({i18n_text:qy(n?"Show media":"Hide media"),handler:e=>this.onMediaToggleClicked(e),button_class:"chat-msg__action-hide-previews",icon_class:n?"fas fa-eye":"fas fa-eye-slash",name:"hide"})}}async getActionButtons(){const e=[];this.model.get("editable")&&e.push({i18n_text:this.model.get("correcting")?qy("Cancel Editing"):qy("Edit"),handler:e=>this.onMessageEditButtonClicked(e),button_class:"chat-msg__action-edit",icon_class:"fa fa-pencil-alt",name:
2021-11-11 22:06:49 +01:00
@ mouseover = $ { ( ) => this . setHover ( ) }
@ mouseleave = $ { ( ) => this . unsetHover ( ) }
2023-12-29 14:11:55 +01:00
@ click = $ { e => this . onControlsClicked ( e ) } > < img class = "gif" src = "${this.src}" > < / a > < / c a n v a s > ` } r e n d e r E r r o r F a l l b a c k ( ) { r e t u r n " u r l " = = = t h i s . f a l l b a c k ? U _ ( t h i s . s r c ) : " e m p t y " = = = t h i s . f a l l b a c k ? " " : v o i d 0 } s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 0 , t h i s . h o v e r _ t i m e o u t & & c l e a r T i m e o u t ( t h i s . h o v e r _ t i m e o u t ) , t h i s . h o v e r _ t i m e o u t = s e t T i m e o u t ( ( ( ) = > t h i s . u n s e t H o v e r ( ) ) , 2 e 3 ) ) } u n s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 1 ) } o n C o n t r o l s C l i c k e d ( e ) { e . p r e v e n t D e f a u l t ( ) , t h i s . s u p e r g i f . p l a y i n g ? t h i s . s u p e r g i f . p a u s e ( ) : t h i s . s u p e r g i f . f r a m e s . l e n g t h > 0 & & ( t h i s . s u p e r g i f . o p t i o n s . l o o p = ! 0 , t h i s . s u p e r g i f . p l a y ( ) ) } } ) ; c o n s t K w = ( e , t ) = > n h ` < c o n v e r s e - g i f a u t o p l a y n o l o o p f a l l b a c k = ' e m p t y ' s r c = $ { e } > < / c o n v e r s e - g i f > $ { t ? " " : n h ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { U R I : Y w } = A h . e n v ; c o n s t X w = O b ( c l a s s e x t e n d s U b { r e n d e r ( e , t , n , s ) { r e t u r n t ? n h ` < a h r e f = " $ { t } " c l a s s = " c h a t - i m a g e _ _ l i n k " t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " > $ { t h i s . r e n d e r I m a g e ( e , t , n , s ) } < / a > ` : t h i s . r e n d e r I m a g e ( e , t , n , s ) } r e n d e r I m a g e ( e , t , n , s ) { r e t u r n n h ` < i m g c l a s s = " c h a t - i m a g e i m g - t h u m b n a i l "
2022-05-05 23:06:17 +02:00
loading = "lazy"
2021-11-11 22:06:49 +01:00
src = "${e}"
2022-05-05 23:06:17 +02:00
@ click = $ { s }
@ error = $ { ( ) => this . onError ( e , t , n , s ) }
2023-12-29 14:11:55 +01:00
@ load = $ { n } / > < / a > ` } o n E r r o r ( e , t , n , s ) { i f ( G h ( e ) ) t & & t h i s . s e t V a l u e ( U _ ( t ) ) ; e l s e { c o n s t i = n e w Y w ( e ) , r = i . f i l e n a m e ( ) ; i . f i l e n a m e ( ` $ { r } . p n g ` ) , t h i s . s e t V a l u e ( X w ( i . t o S t r i n g ( ) , t , n , s ) ) } } } ) , e S = e = > n h ` $ { X w ( e . s r c | | e . u r l , e . h r e f , e . o n L o a d , e . o n C l i c k ) } ` ; c o n s t t S = O b ( c l a s s e x t e n d s M b { r e n d e r ( e , t , n ) { c o n s t s = n e w S S ( e , t , O b j e c t . a s s i g n ( n , { s h o w _ i m a g e s : ! 1 , e m b e d _ v i d e o s : ! 1 , e m b e d _ a u d i o : ! 1 } ) ) ; r e t u r n n h ` $ { W b ( a s y n c f u n c t i o n ( e ) { t r y { a w a i t e . a d d T e m p l a t e s ( ) } c a t c h ( e ) { Y c . e r r o r ( e ) } r e t u r n e . p a y l o a d } ( s ) , n h ` $ { s } ` ) } ` } } ) , n S = [ " * " , " _ " , " ~ " , " ` " ] , s S = [ . . . n S , " ` ` ` " , " > " ] , i S = { " * " : { n a m e : " s t r o n g " , t y p e : " s p a n " } , _ : { n a m e : " e m p h a s i s " , t y p e : " s p a n " } , " ~ " : { n a m e : " s t r i k e " , t y p e : " s p a n " } , " ` " : { n a m e : " p r e f o r m a t t e d " , t y p e : " s p a n " } , " ` ` ` " : { n a m e : " p r e f o r m a t t e d _ b l o c k " , t y p e : " b l o c k " } , " > " : { n a m e : " q u o t e " , t y p e : " b l o c k " } } , r S = [ " _ " , " > " , " ` " , " ~ " ] , o S = { e m p h a s i s : ( e , t , n ) = > n h ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > < i > $ { t S ( e , t , n ) } < / i > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > ` , p r e f o r m a t t e d : e = > n h ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > < c o d e > $ { e } < / c o d e > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > ` , p r e f o r m a t t e d _ b l o c k : e = > n h ` < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > < c o d e c l a s s = " b l o c k " > $ { e } < / c o d e > < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > ` , q u o t e : ( e , t , n ) = > n h ` < b l o c k q u o t e > $ { t S ( e , t , n ) } < / b l o c k q u o t e > ` , s t r i k e : ( e , t , n ) = > n h ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > < d e l > $ { t S ( e , t , n ) } < / d e l > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > ` , s t r o n g : ( e , t , n ) = > n h ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > < b > $ { t S ( e , t , n ) } < / b > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > ` } ; f u n c t i o n a S ( e , t ) { l e t n , s = ! ( a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ) | | a r g u m e n t s [ 2 ] ; i f ( / ( ^ ` ` ` [ \ s , \ u 2 0 0 B ] * \ n ) | ( ^ ` ` ` [ \ s , \ u 2 0 0 B ] * $ ) / . t e s t ( e . s l i c e ( t ) ) & & ( 0 = = = t | | " > " = = = e [ t - 1 ] | | / \ n \ u 2 0 0 B { 0 , 2 } $ / . t e s t ( e . s l i c e ( 0 , t ) ) ) ) n = e . s l i c e ( t , t + 3 ) ; e l s e { i f ( ! s S . i n c l u d e s ( e . s l i c e ( t , t + 1 ) ) ) r e t u r n n u l l ; i f ( n = e . s l i c e ( t , t + 1 ) , ! f u n c t i o n ( e , t , n , s ) { i f ( s ) { c o n s t s = R e g E x p ( r S . i n c l u d e s ( e ) ? ` ^ ( \ \ p { L } | \ \ p { N } ) $ { e } ` : ` ^ ( \ \ p { L } | \ \ p { N } ) \ \ $ { e } ` , " u " ) ; i f ( n > 1 & & s . t e s t ( t . s l i c e ( n - 1 ) ) ) r e t u r n ! 1 ; i f ( l S ( e ) & & n > 0 & & " \ n " ! = = t [ n - 1 ] ) r e t u r n ! 1 ; i f ( n S . i n c l u d e s ( e ) & & t [ n + 1 ] = = = e ) r e t u r n ! 1 } e l s e { c o n s t s = R e g E x p ( r S . i n c l u d e s ( e ) ? ` ^ $ { e } ( \ \ p { L } | \ \ p { N } ) ` : ` ^ \ \ $ { e } ( \ \ p { L } | \ \ p { N } ) ` , " u " ) ; i f ( n < t . l e n g t h - 1 & & s . t e s t ( t . s l i c e ( n ) ) ) r e t u r n ! 1 ; i f ( n S . i n c l u d e s ( e ) & & t [ n - 1 ] = = = e ) r e t u r n ! 1 } r e t u r n ! 0 } ( n , e , t , s ) ) r e t u r n n u l l } r e t u r n n } f u n c t i o n c S ( e , t ) { c o n s t n = a S ( e , t ) , s = n ? f u n c t i o n ( e , t , n ) { i f ( ! e ) r e t u r n 0 ; c o n s t s = n ; i f ( n + = e . l e n g t h , l S ( e ) ) r e t u r n ( n + = t . s l i c e ( n ) . s p l i t ( / \ n [ ^ > ] / ) . s h i f t ( ) . l e n g t h ) - s ; i f ( " s p a n " = = = i S [ e ] . t y p e ) { c o n s t s = t . s l i c e ( n ) . s p l i t ( " \ n " ) . s h i f t ( ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( a S ( t , n + r , ! 1 ) = = = e ) r e t u r n r + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } { c o n s t s = t . s l i c e ( n + 1 ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( a S ( t , n + 1 + r , ! 1 ) = = = e ) r e t u r n r + 1 + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } } ( n , e , t ) : 0 ; r e t u r n s > 0 ? { d : n , l e n g t h : s } : { } } c o n s t l S = e = > [ " > " , " & g t ; " ] . i n c l u d e s ( e ) ; f u n c t i o n d S ( e , t , n , s ) { c o n s t i = o S [ i S [ e ] . n a m e ] ; i f ( l S ( e ) ) { r e t u r n i ( t . r e p l a c e ( / \ n > \ s / g , " \ n " ) . r e p l a c e ( / \ n > / g , " \ n " ) . r e p l a c e ( / \ n $ / , " " ) , n , s ) } r e t u r n i ( t , n , s ) } c o n s t { d a y j s : u S , u : h S } = A h . e n v ; f u n c t i o n m S ( e ) { r e t u r n e . t h e n ( ( e = > e . f i l t e r ( ( e = > e . s t a n d a l o n e ) ) . m a p ( ( e = > a s y n c f u n c t i o n ( e ) { c o n s t t = a w a i t e ; r e t u r n n h `
2022-12-17 22:08:36 +01:00
< a
href = "#"
class = "chatbox-btn ${t.a_class}"
@ click = $ { t . handler }
title = "${t.i18n_title}"
>
< converse - icon
size = "1em"
class = "fa ${t.icon_class}"
> < / c o n v e r s e - i c o n >
< / a >
2023-12-29 14:11:55 +01:00
` }(e))).reverse().map((e=>Wb(e,"")))))}function fS(e){return e.then((e=>{const t=e.filter((e=>!e.standalone)).map((e=>async function(e){const t=await e;return t?nh `
2022-12-17 22:08:36 +01:00
< a href = "#" class = "dropdown-item ${t.a_class}" @ click = $ { t . handler } title = "${t.i18n_title}" >
< converse - icon
size = "1em"
class = "fa ${t.icon_class}"
> < / c o n v e r s e - i c o n >
$ { t . i18n _text }
< / a >
2023-12-29 14:11:55 +01:00
` :""}(e)));return t.length?nh ` < converse - dropdown class = "chatbox-btn dropleft" . items = $ { t } > < / c o n v e r s e - d r o p d o w n > ` : " " } ) ) } f u n c t i o n g S ( e ) { i f ( ! e . i s H i d d e n ( ) & & V l . s e t t i n g s . g e t ( " a l l o w _ u r l _ h i s t o r y _ c h a n g e " ) ) { c o n s t t = w i n d o w . l o c a t i o n . h a s h ; t & & e . m e s s a g e s . g e t ( t . s l i c e ( 1 ) ) & & b l . r o u t e r . h i s t o r y . n a v i g a t e ( ) } } c o n s t p S = I l ( ( e = > f u n c t i o n ( e ) { c o n s t t = e . t a r g e t ; i f ( " c o n v e r s e - c h a t - c o n t e n t " ! = = t . n o d e N a m e . t o L o w e r C a s e ( ) ) r e t u r n ; l e t n = ! 0 ; c o n s t s = 0 = = = M a t h . f l o o r ( t . s c r o l l T o p ) , i = M a t h . c e i l ( t . c l i e n t H e i g h t - t . s c r o l l T o p ) > = t . s c r o l l H e i g h t - M a t h . c e i l ( t . s c r o l l H e i g h t / 2 0 ) ; s ? ( n = ! 1 , g S ( t . m o d e l ) ) : i & & V l . t r i g g e r ( " c h a t B o x S c r o l l e d U p " , t ) , t . m o d e l . g e t ( " s c o l l e d " ) ! = = n & & t . m o d e l . u i . s e t ( { s c r o l l e d : n } ) } ( e ) ) , 5 0 ) ; f u n c t i o n v S ( e ) { c o n s t t = e . c o l l e c t i o n ? . m o d e l s ; i f ( ! t ) r e t u r n ; c o n s t n = t . i n d e x O f ( e ) , s = t [ n - 1 ] ; i f ( ! s | | u S ( e . g e t ( " t i m e " ) ) . i s A f t e r ( u S ( s . g e t ( " t i m e " ) ) , " d a y " ) ) { c o n s t t = u S ( e . g e t ( " t i m e " ) ) . s t a r t O f ( " d a y " ) ; r e t u r n ( e = > n h `
2023-06-25 15:59:31 +02:00
< div class = "message date-separator" data - isodate = "${e.time}" >
< hr class = "separator" / >
< time class = "separator-text" datetime = "${e.time}" > < span > $ { e . datestring } < / s p a n > < / t i m e >
< / d i v >
2023-12-29 14:11:55 +01:00
` )({type:"date",time:t.toISOString(),datestring:t.format("dddd MMM Do YYYY")})}}function yS(e){if("groupchat"===e.get("type")){const t=Vl.settings.get("muc_hats").filter((e=>e)).map((e=>e.toLowerCase()));let n=[];t.includes("vcard_roles")&&(n=e.vcard?e.vcard.get("role"):null,n=n?n.split(",").filter((e=>e)).map((e=>({title:e}))):[]);const s=[...e.occupant?[e.occupant.get("role")]:[],...e.occupant?[e.occupant.get("affiliation")]:[]].filter((e=>e)).filter((e=>t.includes(e.toLowerCase()))).map((e=>({title:e})));return[...t.includes("xep317")&&e.occupant?.get("hats")||[],...n,...s]}return[]}function _S(){var e;return Ah.emojis.toned||(Ah.emojis.toned=(e=Object.values(Ah.emojis.json.people).filter((e=>e.sn.includes("_tone"))).map((e=>e.sn.replace(/_tone[1-5]/,""))),[...new Set(e)])),Ah.emojis.toned}function bS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{unicode_only:!1,add_title_wrapper:!1};const n=e.emoji,s=e.shortname;if(n){if(t.unicode_only)return n;if(Vl.settings.get("use_system_emojis"))return t.add_title_wrapper&&s?nh ` < span title = "${s}" > $ { n } < / s p a n > ` : n ; { c o n s t t = V l . s e t t i n g s . g e t ( " e m o j i _ i m a g e _ p a t h " ) ; r e t u r n n h ` < i m g c l a s s = " e m o j i "
2022-05-05 23:06:17 +02:00
loading = "lazy"
draggable = "false"
title = "${s}"
alt = "${n}"
2023-12-29 14:11:55 +01:00
src = "${t}/72x72/${e.cp}.png" / > ` }}return t.unicode_only?s:nh ` < img class = "emoji"
2022-05-05 23:06:17 +02:00
loading = "lazy"
draggable = "false"
title = "${s}"
alt = "${s}"
2023-12-29 14:11:55 +01:00
src = "${Ah.emojis.by_sn[s].url}" > ` }Object.assign(hS,{shortnamesToEmojis:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{unicode_only:!1,add_title_wrapper:!1};return function(e,t){let n=[e];return[...lf(e),...df(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=bS(e,t);n="string"==typeof i?[s.slice(0,e.begin)+i+s.slice(e.end),...n]:[s.slice(0,e.begin),i,s.slice(e.end),...n]})),n}(e=cf(e),t)}});const wS=e=>"string"==typeof e;class SS extends String{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e),this.embed_audio=n?.embed_audio,this.embed_videos=n?.embed_videos,this.mentions=n?.mentions||[],this.media_urls=n?.media_urls,this.nick=n?.nick,this.offset=t,this.onImgClick=n?.onImgClick,this.onImgLoad=n?.onImgLoad,this.options=n,this.payload=[],this.references=[],this.render_styling=n?.render_styling,this.show_images=n?.show_images,this.hide_media_urls=n?.hide_media_urls}shouldRenderMedia(e,t){let n;return"image"===t?n=this.show_images:"audio"===t?n=this.embed_audio:"video"===t&&(n=this.embed_videos),"boolean"==typeof n?n:Uh(e,t)}addHyperlinks(e,t){const n=t+this.offset;Th(this.media_urls||nm(e,t).media_urls||[],e,n).filter((e=>!e.is_encrypted)).forEach((e=>{const n=e.url,s=Bh(n);let i;i=Wh(n)&&this.shouldRenderMedia(n,"image")?Kw(s,this.hide_media_urls):Zh(n)&&this.shouldRenderMedia(n,"image")?eS({src:s,href:this.hide_media_urls?null:s,onClick:this.onImgClick,onLoad:this.onImgLoad}):Jh(n)&&this.shouldRenderMedia(n,"video")?S_(s,this.hide_media_urls):Vh(n)&&this.shouldRenderMedia(n,"audio")?f_(s,this.hide_media_urls):U_(s),this.addTemplateResult(e.start+t,e.end+t,i)}))}addMapURLs(e,t){const n=/geo:([ \- 0-9.]+),([ \- 0-9.]+)(?:,([ \- 0-9.]+))?(?: \? (.*))?/g,s=e.matchAll(n);for(const e of s)this.addTemplateResult(e.index+t,e.index+e[0].length+t,U_(e[0].replace(n,Vl.settings.get("geouri_replacement"))))}addEmojis(e,t){[...lf(e.toString()),...df(e.toString())].forEach((e=>{this.addTemplateResult(e.begin+t,e.end+t,bS(e,{add_title_wrapper:!0}))}))}addMentions(e,t){const n=t+this.offset;this.mentions?.forEach((s=>{const i=Number(s.begin)-n;if(i<0||i>=n+e.length)return;const r=Number(s.end)-n,o=e.slice(i,r);o===this.nick?this.addTemplateResult(i+t,r+t,(e=>nh ` < span class = "mention mention--self badge badge-info" data - uri = "${e.uri}" > $ { e . mention } < / s p a n > ` ) ( { . . . s , m e n t i o n : o } ) ) : t h i s . a d d T e m p l a t e R e s u l t ( i + t , r + t , ( e = > n h ` < s p a n c l a s s = " m e n t i o n " d a t a - u r i = " $ { e . u r i } " > $ { e . m e n t i o n } < / s p a n > ` ) ( { . . . s , m e n t i o n : o } ) ) } ) ) } a d d S t y l i n g ( ) { i f ( ! f u n c t i o n ( e ) { f o r ( l e t t = 0 ; t < s S . l e n g t h ; t + + ) i f ( e . i n c l u d e s ( s S [ t ] ) ) r e t u r n ! 0 } ( t h i s ) ) r e t u r n ; c o n s t e = [ ] , t = t h i s . m e n t i o n s . m a p ( ( e = > A r r a y . f r o m ( { l e n g t h : N u m b e r ( e . e n d ) } , ( ( t , n ) = > N u m b e r ( e . b e g i n ) + n ) ) ) ) ; l e t n = 0 ; f o r ( ; n < t h i s . l e n g t h ; ) { i f ( t . f i l t e r ( ( e = > e . i n c l u d e s ( n ) ) ) . l e n g t h ) { n + + ; c o n t i n u e } c o n s t { d : s , l e n g t h : i } = c S ( t h i s , n ) ; i f ( s & & i ) { c o n s t t = l S ( s ) , r = n + i , o = t ? r : r - s . l e n g t h ; l e t a = " ` ` ` " = = = s ? n + s . l e n g t h + 1 : n + s . l e n g t h ; t & & " " = = = t h i s [ a ] & & ( a + = 1 ) ; c o n s t c = a , l = t h i s . s l i c e ( a , o ) ; e . p u s h ( { b e g i n : n , t e m p l a t e : d S ( s , l , c , t h i s . o p t i o n s ) , e n d : r } ) , n = r } n + + } e . f o r E a c h ( ( e = > t h i s . a d d T e m p l a t e R e s u l t ( e . b e g i n , e . e n d , e . t e m p l a t e ) ) ) } t r i m M e M e s s a g e ( ) { 0 = = = t h i s . o f f s e t & & t h i s . i s M e C o m m a n d ( ) & & ( t h i s . p a y l o a d [ 0 ] = t h i s . p a y l o a d [ 0 ] . s u b s t r i n g ( 4 ) ) } a d d A n n o t a t i o n s ( e ) { c o n s t t = t h i s . m a r s h a l l ( ) ; l e t n = 0 ; f o r ( c o n s t s o f t ) s & & ( w S ( s ) ? ( e . c a l l ( t h i s , s , n ) , n + = s . l e n g t h ) : n = s . e n d ) } a s y n c a d d T e m p l a t e s ( ) { a w a i t V l . t r i g g e r ( " b e f o r e M e s s a g e B o d y T r a n s f o r m e d " , t h i s , { S y n c h r o n o u s : ! 0 } ) , t h i s . r e n d e r _ s t y l i n g & & t h i s . a d d S t y l i n g ( ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d M e n t i o n s ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d H y p e r l i n k s ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d M a p U R L s ) , a w a i t V l . e m o j i s . i n i t i a l i z e ( ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d E m o j i s ) , a w a i t V l . t r i g g e r ( " a f t e r M e s s a g e B o d y T r a n s f o r m e d " , t h i s , { S y n c h r o n o u s : ! 0 } ) , t h i s . p a y l o a d = t h i s . m a r s h a l l ( ) , t h i s . o p t i o n s . s h o w _ m e _ m e s s a g e & & t h i s . t r i m M e M e s s a g e ( ) , t h i s . p a y l o a d = t h i s . p a y l o a d . m a p ( ( e = > w S ( e ) ? e : e . t e m p l a t e ) ) } a d d T e m p l a t e R e s u l t ( e , t , n ) { t h i s . r e f e r e n c e s . p u s h ( { b e g i n : e , e n d : t , t e m p l a t e : n } ) } i s M e C o m m a n d ( ) { c o n s t e = t h i s . t o S t r i n g ( ) ; r e t u r n ! ! e & & e . s t a r t s W i t h ( " / m e " ) } m a r s h a l l ( ) { l e t e = [ t h i s . t o S t r i n g ( ) ] ; r e t u r n t h i s . r e f e r e n c e s . s o r t ( ( ( e , t ) = >
2021-11-11 22:06:49 +01:00
< button type = "button" class = "btn btn--transparent btn--standalone" data - toggle = "dropdown" aria - haspopup = "true" aria - expanded = "false" >
2022-12-17 22:08:36 +01:00
< converse - icon size = "1em" class = "${this.icon_classes}" >
2021-03-19 19:26:15 +01:00
< / b u t t o n >
2021-11-11 22:06:49 +01:00
< div class = "dropdown-menu" >
2023-06-25 15:59:31 +02:00
$ { this . items . map ( ( e => Wb ( e , "" ) ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
` }firstUpdated(){super.firstUpdated(),this.initArrowNavigation()}connectedCallback(){super.connectedCallback(),this.hideOnEscape=e=>e.keyCode===vo.ESCAPE&&this.hideMenu(),document.addEventListener("keydown",this.hideOnEscape)}disconnectedCallback(){document.removeEventListener("keydown",this.hideOnEscape),super.disconnectedCallback()}hideMenu(){super.hideMenu(),this.navigator?.disable()}initArrowNavigation(){if(!this.navigator){const e={selector:".dropdown-item",onSelected:e=>e.focus()};this.navigator=new MS(this.menu,e)}}enableArrowNavigation(e){e&&(e.preventDefault(),e.stopPropagation()),this.navigator.enable(),this.navigator.select(this.menu.firstElementChild)}handleKeyUp(e){super.handleKeyUp(e),e.keyCode!==vo.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}}Vl.elements.define("converse-dropdown",PS);var FS=n(8211),US={};US.styleTagTransform=i_(),US.setAttributes=e_(),US.insert=Yy().bind(null,"head"),US.domAPI=Qy(),US.insertStyleElement=n_();Jy()(FS.Z,US);FS.Z&&FS.Z.locals&&FS.Z.locals;const{dayjs:BS}=Ah.env;Vl.elements.define("converse-message-versions",class extends Gy{static get properties(){return{model:{type:Object}}}constructor(){super(),this.model=null}render(){const e=this.model.get("older_versions"),t=Object.keys(e);return nh `
$ { t . length ? nh ` <h4> ${ qy ( "Older versions" ) } </h4> ${ t . map ( ( t => ( ( e , t ) => nh ` <p class="older-msg"><time> ${ BS ( e ) . format ( "MMM D, YYYY, HH:mm:ss" ) } </time>: ${ t [ e ] } </p> ` ) ( t , e ) ) ) } ` : nh ` <h4> ${ qy ( "No older versions found" ) } </h4> ` }
2021-11-11 22:06:49 +01:00
< hr / >
2023-12-29 14:11:55 +01:00
< h4 > $ { qy ( "Current version" ) } < / h 4 >
< p > < time > $ { BS ( this . model . get ( "time" ) ) . format ( "MMM D, YYYY, HH:mm:ss" ) } < / t i m e > : $ { t h i s . m o d e l . g e t M e s s a g e T e x t ( ) } < / p > ` } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - v e r s i o n s - m o d a l " , c l a s s e x t e n d s t b { r e n d e r M o d a l ( ) { r e t u r n n h ` < c o n v e r s e - m e s s a g e - v e r s i o n s . m o d e l = $ { t h i s . m o d e l } > < / c o n v e r s e - m e s s a g e - v e r s i o n s > ` } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " M e s s a g e v e r s i o n s " ) } } ) ; c o n s t q S = e = > { c o n s t t = v o i d 0 ! = = e . m o d e l . c o n t a c t , n = q y ( " R e f r e s h " ) , s = V l . s e t t i n g s . g e t ( " a l l o w _ c o n t a c t _ r e m o v a l " ) ; r e t u r n n h `
2022-12-17 22:08:36 +01:00
< div class = "modal-footer" >
2023-06-25 15:59:31 +02:00
$ { Q _ }
2022-12-17 22:08:36 +01:00
< button type = "button" class = "btn btn-info refresh-contact" @ click = $ { t => e . refreshContact ( t ) } >
< converse - icon
class = "fa fa-refresh"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { n } < / b u t t o n >
2023-12-29 14:11:55 +01:00
$ { s && t ? ( e => { const t = qy ( "Remove as contact" ) ; return nh `
2022-12-17 22:08:36 +01:00
< button type = "button" @ click = "${t=>e.removeContact(t)}" class = "btn btn-danger remove-contact" >
2022-04-02 21:20:14 +02:00
< converse - icon
class = "fas fa-trash-alt"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { t }
2021-11-11 22:06:49 +01:00
< / b u t t o n >
` })(e):""}
2022-12-17 22:08:36 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
` };function HS(e){bl.roster?.get(e.get("jid"))?.trigger("highlight")}function GS(e,t){const n=bl.roster_filter,s=n.get("filter_type"),i="state"===s?n.get("chat_state").toLowerCase():n.get("filter_text").toLowerCase();if(!i)return!1;if("state"===s){return![bl.HEADER_REQUESTING_CONTACTS,bl.HEADER_UNREAD].includes(t)&&("unread_messages"===i?0===e.get("num_unread"):"online"===i?["offline","unavailable"].includes(e.presence.get("show")):!e.presence.get("show").includes(i))}return"contacts"===s?!e.getFilterCriteria().includes(i):void 0}function WS(e){const t=bl.roster_filter;if("groups"===t.get("filter_type")){const n=t.get("filter_text")?.toLowerCase();if(!n)return!0;if(!e.toLowerCase().includes(n))return!1}return!0}const VS=Ah.env.utils;Vl.elements.define("converse-user-details-modal",class extends tb{initialize(){super.initialize(),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),Vl.trigger("userDetailsModalInitialized",this.model)}renderModal(){return(e=>{const t=e.model?.vcard,n=t?t.toJSON():{},s={...e.model.toJSON(),...n},i=qy("XMPP Address"),r=qy("Email"),o=qy("Full Name"),a=qy("Nickname"),c=qy("The User's Profile Image"),l=qy("Role"),d=qy("URL"),u={alt_text:c,extra_classes:"mb-3",height:"120",width:"120"};return nh `
2022-12-17 22:08:36 +01:00
< div class = "modal-body" >
2023-12-29 14:11:55 +01:00
$ { s . image ? nh ` <div class="mb-4"> ${ xb ( Object . assign ( s , u ) ) } </div> ` : "" }
$ { s . fullname ? nh ` <p><label> ${ o } :</label> ${ s . fullname } </p> ` : "" }
2023-01-07 22:34:35 +01:00
< p > < label > $ { i } : < / l a b e l > < a h r e f = " x m p p : $ { s . j i d } " > $ { s . j i d } < / a > < / p >
2023-12-29 14:11:55 +01:00
$ { s . nickname ? nh ` <p><label> ${ a } :</label> ${ s . nickname } </p> ` : "" }
$ { s . url ? nh ` <p><label> ${ d } :</label> <a target="_blank" rel="noopener" href=" ${ s . url } "> ${ s . url } </a></p> ` : "" }
$ { s . email ? nh ` <p><label> ${ r } :</label> <a href="mailto: ${ s . email } "> ${ s . email } </a></p> ` : "" }
$ { s . role ? nh ` <p><label> ${ l } :</label> ${ s . role } </p> ` : "" }
2021-03-19 19:26:15 +01:00
2023-01-07 22:34:35 +01:00
< converse - omemo - fingerprints jid = $ { s . jid } > < / c o n v e r s e - o m e m o - f i n g e r p r i n t s >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
` })(this)}renderModalFooter(){return qS(this)}getModalTitle(){return this.model.getDisplayName()}registerContactEventHandlers(){void 0!==this.model.contact&&(this.listenTo(this.model.contact,"change",this.render),this.listenTo(this.model.contact.vcard,"change",this.render),this.model.contact.on("destroy",(()=>{delete this.model.contact,this.render()})))}async refreshContact(e){e&&e.preventDefault&&e.preventDefault();const t=this.el.querySelector(".fa-refresh");VS.addClass("fa-spin",t);try{await Vl.vcard.update(this.model.contact.vcard,!0)}catch(e){Yc.fatal(e),this.alert(qy("Sorry, something went wrong while trying to refresh"),"danger")}VS.removeClass("fa-spin",t)}async removeContact(e){if(e?.preventDefault?.(),!Vl.settings.get("allow_contact_removal"))return;await Vl.confirm(qy("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&Yc.error(t),Vl.alert("error",qy("Error"),[qy("Sorry, there was an error while trying to remove %1 $ s as a contact.",e.getDisplayName())])}))}(this.model.contact)),1),this.modal.hide())}});const{filesize:JS}=Ah.env,{dayjs:ZS}=Ah.env,{dayjs:QS}=Ah.env;function KS(e){return!!Lh(e).host()}Vl.elements.define("converse-image",class extends Gy{static get properties(){return{src:{type:String},onImgLoad:{type:Function},href:{type:String}}}constructor(){super(),this.src=null,this.href=null,this.onImgClick=null,this.onImgLoad=null}render(){return Wh(this.src)&&Uh(this.src,"image")?Kw(Bh(this.src),!0):eS({src:Bh(this.src),href:this.href,onClick:this.onImgClick,onLoad:this.onImgLoad})}});const YS=e=>{const t=(n=e.image)&&qh(n,"allowed_image_domains")&&KS(n);var n;const s=e.title||e.description||e.url;return t||s?nh ` < div class = "card card--unfurl" >
$ { t ? ( e => nh ` <converse-image class="card-img-top hor_centered" href=" ${ e . url } " src=" ${ e . image } " .onImgLoad= ${ e . onload } ></converse-image> ` ) ( e ) : "" }
$ { s ? nh ` <div class="card-body">
$ { e . title ? ( ( e , t ) => e . url && KS ( e . url ) && ! Wh ( e . image ) ? nh ` <a href=" ${ e . url } " target="_blank" rel="noopener"> ${ t ( e ) } </a> ` : t ( e ) ) ( e , ( e => nh ` <h5 class="card-title"> ${ e . title } </h5> ` ) ) : "" }
$ { e . description ? nh ` <p class="card-text">
2022-01-03 11:54:10 +01:00
< converse - rich - text text = $ { e . description } > < / c o n v e r s e - r i c h - t e x t >
< / p > ` : " " }
2023-12-29 14:11:55 +01:00
$ { e . url ? nh ` <p class="card-text">
< a href = "${e.url}" target = "_blank" rel = "noopener" > $ { Lh ( e . url ) . domain ( ) } < / a >
2022-01-03 11:54:10 +01:00
< / p > ` : " " }
< / d i v > ` : " " }
2023-12-29 14:11:55 +01:00
< / d i v > ` : " " } ; v a r X S = n ( 1 1 6 5 ) , e x = { } ; e x . s t y l e T a g T r a n s f o r m = i _ ( ) , e x . s e t A t t r i b u t e s = e _ ( ) , e x . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , e x . d o m A P I = Q y ( ) , e x . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( X S . Z , e x ) ; X S . Z & & X S . Z . l o c a l s & & X S . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - u n f u r l " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d e s c r i p t i o n : { t y p e : S t r i n g } , i m a g e : { t y p e : S t r i n g } , j i d : { t y p e : S t r i n g } , t i t l e : { t y p e : S t r i n g } , u r l : { t y p e : S t r i n g } } } i n i t i a l i z e ( ) { c o n s t e = w c ( ) ; t h i s . l i s t e n T o ( e , " c h a n g e : a l l o w e d _ i m a g e _ d o m a i n s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( e , " c h a n g e : r e n d e r _ m e d i a " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { r e t u r n Y S ( O b j e c t . a s s i g n ( { o n l o a d : ( ) = > t h i s . o n I m a g e L o a d ( ) } , { d e s c r i p t i o n : t h i s . d e s c r i p t i o n | | " " , i m a g e : t h i s . i m a g e | | " " , t i t l e : t h i s . t i t l e | | " " , u r l : t h i s . u r l | | " " } ) ) } o n I m a g e L o a d ( ) { t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " i m a g e L o a d e d " , { d e t a i l : t h i s , b u b b l e s : ! 0 } ) ) } } ) ; c o n s t t x = e = > { c o n s t t = q y ( " S h o w m o r e " ) , n = " g r o u p c h a t " = = = e . m o d e l . g e t ( " t y p e " ) , s = q y ( " S h o w l e s s " ) , i = n h `
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__spoiler-hint" >
< span class = "spoiler-hint" > $ { e . model . get ( "spoiler_hint" ) } < / s p a n >
< a class = "badge badge-info spoiler-toggle" href = "#" @ click = $ { e . toggleSpoilerMessage } >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" color = "var(--background)" class = "fa ${e.model.get(" is _spoiler _visible ")?" fa - eye - slash ":" fa - eye "}" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
$ { e . model . get ( "is_spoiler_visible" ) ? s : t }
2022-01-03 11:54:10 +01:00
< / a >
< / d i v >
2023-12-29 14:11:55 +01:00
` ,r=e.model.get("is_spoiler")?"spoiler "+(e.model.get("is_spoiler_visible")?"":"hidden"):"",o=e.model.getMessageText(),a=e.model.get("oob_url")&&o!==e.model.get("oob_url");return nh `
2022-05-05 23:06:17 +02:00
$ { e . model . get ( "is_spoiler" ) ? i : "" }
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "subject" ) ? nh ` <div class="chat-msg__subject"> ${ e . model . get ( "subject" ) } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< span class = "chat-msg__body--wrapper" >
2022-01-03 11:54:10 +01:00
< converse - chat - message - body
2022-12-17 22:08:36 +01:00
class = "chat-msg__text ${e.model.get(" is _only _emojis ")?" chat - msg _ _text -- larger ":" "} ${r}"
2022-01-03 11:54:10 +01:00
. model = "${e.model}"
hide _url _previews = $ { e . model . get ( "hide_url_previews" ) }
? is _me _message = $ { e . model . isMeCommand ( ) }
2022-12-17 22:08:36 +01:00
text = "${o}" > < / c o n v e r s e - c h a t - m e s s a g e - b o d y >
2023-12-29 14:11:55 +01:00
$ { ! e . model . get ( "received" ) || e . model . isMeCommand ( ) || n ? "" : nh ` <converse-icon size="1em" color="var(--chat-color)" class="fa fa-check chat-msg__receipt"></converse-icon> ` }
$ { e . model . get ( "edited" ) ? ( e => { const t = qy ( "This message has been edited" ) ; return nh ` <converse-icon title=" ${ t } " class="fa fa-edit chat-msg__edit-modal" @click= ${ e . showMessageVersionsModal } size="1em"></converse-icon> ` } ) ( e ) : "" }
2022-01-03 11:54:10 +01:00
< / s p a n >
2023-12-29 14:11:55 +01:00
$ { a ? nh ` <div class="chat-msg__media"> ${ R _ ( e . model . get ( "oob_url" ) ) } </div> ` : "" }
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__error" > $ { e . model . get ( "error_text" ) || e . model . get ( "error" ) } < / d i v >
2023-12-29 14:11:55 +01:00
` };var nx=n(563),sx={};sx.styleTagTransform=i_(),sx.setAttributes=e_(),sx.insert=Yy().bind(null,"head"),sx.domAPI=Qy(),sx.insertStyleElement=n_();Jy()(nx.Z,sx);nx.Z&&nx.Z.locals&&nx.Z.locals;const{Strophe:ix,dayjs:rx}=Ah.env;Vl.elements.define("converse-chat-message",class extends Gy{static get properties(){return{jid:{type:String},mid:{type:String}}}async initialize(){if(await this.setModels(),!this.model)return void Yc.error("Could not find module for converse-chat-message");const e=wc();this.listenTo(e,"change:render_media",(()=>{this.model.save("hide_url_previews",void 0),this.requestUpdate()})),this.listenTo(this.chatbox,"change:first_unread_id",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate())),this.model.vcard&&this.listenTo(this.model.vcard,"change",(()=>this.requestUpdate())),"groupchat"===this.model.get("type")&&(this.model.occupant?this.listenTo(this.model.occupant,"change",(()=>this.requestUpdate())):this.listenTo(this.model,"occupantAdded",(()=>{this.requestUpdate(),this.listenTo(this.model.occupant,"change",(()=>this.requestUpdate()))})))}async setModels(){this.chatbox=await Vl.chatboxes.get(this.jid),await this.chatbox.initialized,await this.chatbox.messages.fetched,this.model=this.chatbox.messages.get(this.mid),this.model&&this.requestUpdate()}render(){return this.model?this.show_spinner?Sb():this.model.get("file")&&this.model.get("upload")!==bl.SUCCESS?this.renderFileProgress():["mep"].includes(this.model.get("type"))?this.renderMEPMessage():["error","info"].includes(this.model.get("type"))?this.renderInfoMessage():this.renderChatMessage():""}getProps(){return Object.assign(this.model.toJSON(),this.getDerivedMessageProps())}renderRetraction(){return(e=>{const t=e.isRetracted()?e.getRetractionText():null;return nh `
2022-05-05 23:06:17 +02:00
< div class = "retraction" > $ { t } < / d i v >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "moderation_reason" ) ? nh ` <q class="chat-msg--retracted__reason"> ${ e . model . get ( "moderation_reason" ) } </q> ` : "" } ` })(this)}renderMessageText(){return tx(this)}renderMEPMessage(){return(e=>{const t=QS(e.model.get("time")).toISOString();return nh `
2022-01-03 11:54:10 +01:00
< div class = "message chat-info message--mep ${e.getExtraMessageClasses()}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-msg__content" >
< div class = "chat-msg__body chat-msg__body--${e.model.get(" type ")} ${e.model.get(" is _delayed ")?" chat - msg _ _body -- delayed ":" "}" >
< div class = "chat-info__message" >
2023-12-29 14:11:55 +01:00
$ { e . isRetracted ( ) ? e . renderRetraction ( ) : nh `
2022-01-03 11:54:10 +01:00
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "reason" ) ? nh ` <q class="reason"><converse-rich-text text= ${ e . model . get ( "reason" ) } ></converse-rich-text></q> ` : "" }
2022-01-03 11:54:10 +01:00
` }
< / d i v >
< converse - message - actions
? is _retracted = $ { e . isRetracted ( ) }
. model = $ { e . model } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ) ( t h i s ) } r e n d e r I n f o M e s s a g e ( ) { r e t u r n ( e = > { c o n s t t = Z S ( e . m o d e l . g e t ( " t i m e " ) ) . t o I S O S t r i n g ( ) , n = q y ( " R e t r y " ) ; r e t u r n n h `
2021-11-11 22:06:49 +01:00
< div class = "message chat-info chat-${e.model.get(" type ")}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-info__message" >
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "reason" ) ? nh ` <q class="reason"> ${ e . model . get ( "reason" ) } </q> ` : "" }
$ { e . model . get ( "error_text" ) ? nh ` <q class="reason"> ${ e . model . get ( "error_text" ) } </q> ` : "" }
$ { e . model . get ( "retry_event_id" ) ? nh ` <a class="retry" @click= ${ e . onRetryClicked } > ${ n } </a> ` : "" }
< / d i v > ` } ) ( t h i s ) } r e n d e r F i l e P r o g r e s s ( ) { r e t u r n t h i s . m o d e l . f i l e ? ( e = > { c o n s t t = q y ( " U p l o a d i n g f i l e : " ) , n = e . m o d e l . f i l e . n a m e , s = J S ( e . m o d e l . f i l e . s i z e ) ; r e t u r n n h `
2022-01-03 11:54:10 +01:00
< div class = "message chat-msg" >
2023-12-29 14:11:55 +01:00
$ { e . shouldShowAvatar ( ) ? nh ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
2022-01-03 11:54:10 +01:00
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
< div class = "chat-msg__content" >
2023-01-07 22:34:35 +01:00
< span class = "chat-msg__text" > $ { t } < strong > $ { n } < / s t r o n g > , $ { s } < / s p a n >
2022-01-03 11:54:10 +01:00
< progress value = "${e.model.get(" progress ")}" / >
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ) ( t h i s ) : " " } r e n d e r C h a t M e s s a g e ( ) { r e t u r n ( ( e , t ) = > { c o n s t n = q y ( " N e w m e s s a g e s " ) , s = e . m o d e l . i s F o l l o w u p ( ) ; r e t u r n n h `
$ { t . is _first _unread ? nh ` <div class="message separator"><hr class="separator"><span class="separator-text"> ${ n } </span></div> ` : "" }
2021-03-19 19:26:15 +01:00
< div class = "message chat-msg ${e.getExtraMessageClasses()}"
2021-11-11 22:06:49 +01:00
data - isodate = "${t.time}"
data - msgid = "${t.msgid}"
data - from = "${t.from}"
data - encrypted = "${t.is_encrypted}" >
2021-03-19 19:26:15 +01:00
<!-- Anchor to allow us to scroll the message into view -- >
2021-11-11 22:06:49 +01:00
< a id = "${t.msgid}" > < / a >
2021-03-19 19:26:15 +01:00
2023-12-29 14:11:55 +01:00
$ { t . should _show _avatar && ! s ? nh ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__content chat-msg__content--${t.sender} ${t.is_me_message?" chat - msg _ _content -- action ":" "}" >
2023-12-29 14:11:55 +01:00
$ { t . is _me _message || s ? "" : nh `
2021-03-19 19:26:15 +01:00
< span class = "chat-msg__heading" >
2021-11-11 22:06:49 +01:00
< span class = "chat-msg__author" > < a class = "show-msg-author-modal" @ click = $ { e . showUserModal } > $ { t . username } < / a > < / s p a n >
2023-12-29 14:11:55 +01:00
$ { t . hats . map ( ( e => nh ` <span class="badge badge-secondary"> ${ e . title } </span> ` ) ) }
2021-11-11 22:06:49 +01:00
< time timestamp = "${e.model.get(" edited ")||e.model.get(" time ")}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e >
2023-12-29 14:11:55 +01:00
$ { t . is _encrypted ? nh ` <converse-icon class="fa fa-lock" size="1.1em"></converse-icon> ` : "" }
2021-03-19 19:26:15 +01:00
< / s p a n > ` }
2022-01-03 11:54:10 +01:00
2021-11-11 22:06:49 +01:00
< div class = "chat-msg__body chat-msg__body--${t.message_type} ${t.received?" chat - msg _ _body -- received ":" "} ${t.is_delayed?" chat - msg _ _body -- delayed ":" "}" >
2021-03-19 19:26:15 +01:00
< div class = "chat-msg__message" >
2023-12-29 14:11:55 +01:00
$ { t . is _me _message ? nh `
2021-11-11 22:06:49 +01:00
< time timestamp = "${t.edited||t.time}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e > & n b s p ;
< span class = "chat-msg__author" > $ { t . is _me _message ? "**" : "" } $ { t . username } < / s p a n > & n b s p ; ` : " " }
$ { t . is _retracted ? e . renderRetraction ( ) : e . renderMessageText ( ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< converse - message - actions
. model = $ { e . model }
2022-01-03 11:54:10 +01:00
? is _retracted = $ { t . is _retracted } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "ogp_metadata" ) ? . map ( ( t => ! 0 === e . model . get ( "hide_url_previews" ) ? "" : Uh ( t [ "og:image" ] , "image" ) ? nh ` <converse-message-unfurl
2021-11-11 22:06:49 +01:00
@ animationend = "${e.onUnfurlAnimationEnd}"
class = "${e.model.get(" url _preview _transition ")}"
2023-01-07 22:34:35 +01:00
jid = "${e.chatbox?.get(" jid ")}"
2021-11-11 22:06:49 +01:00
description = "${t[" og : description "]||" "}"
title = "${t[" og : title "]||" "}"
image = "${t[" og : image "]||" "}"
2023-01-07 22:34:35 +01:00
url = "${t[" og : url "]||" "}" > < / c o n v e r s e - m e s s a g e - u n f u r l > ` : " " ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ) ( t h i s , t h i s . g e t P r o p s ( ) ) } s h o u l d S h o w A v a t a r ( ) { r e t u r n V l . s e t t i n g s . g e t ( " s h o w _ m e s s a g e _ a v a t a r " ) & & ! t h i s . m o d e l . i s M e C o m m a n d ( ) & & [ " c h a t " , " g r o u p c h a t " , " n o r m a l " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) } o n U n f u r l A n i m a t i o n E n d ( ) { " f a d e - o u t " = = = t h i s . m o d e l . g e t ( " u r l _ p r e v i e w _ t r a n s i t i o n " ) & & t h i s . m o d e l . s a v e ( { h i d e _ u r l _ p r e v i e w s : ! 0 , u r l _ p r e v i e w _ t r a n s i t i o n : " f a d e - i n " } ) } a s y n c o n R e t r y C l i c k e d ( ) { t h i s . s h o w _ s p i n n e r = ! 0 , t h i s . r e q u e s t U p d a t e ( ) , a w a i t V l . t r i g g e r ( t h i s . m o d e l . g e t ( " r e t r y _ e v e n t _ i d " ) , { s y n c h r o n o u s : ! 0 } ) , t h i s . m o d e l . d e s t r o y ( ) , t h i s . p a r e n t E l e m e n t . r e m o v e C h i l d ( t h i s ) } i s R e t r a c t e d ( ) { r e t u r n t h i s . m o d e l . g e t ( " r e t r a c t e d " ) | | " r e t r a c t e d " = = = t h i s . m o d e l . g e t ( " m o d e r a t e d " ) } h a s M e n t i o n s ( ) { r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . c h a t b o x . i s U s e r M e n t i o n e d ( t h i s . m o d e l ) } g e t O c c u p a n t A f f i l i a t i o n ( ) { r e t u r n t h i s . m o d e l . o c c u p a n t ? . g e t ( " a f f i l i a t i o n " ) } g e t O c c u p a n t R o l e ( ) { r e t u r n t h i s . m o d e l . o c c u p a n t ? . g e t ( " r o l e " ) } g e t E x t r a M e s s a g e C l a s s e s ( ) { c o n s t e = [ t h i s . m o d e l . i s F o l l o w u p ( ) ? " c h a t - m s g - - f o l l o w u p " : n u l l , t h i s . m o d e l . g e t ( " i s _ d e l a y e d " ) ? " d e l a y e d " : n u l l , t h i s . m o d e l . i s M e C o m m a n d ( ) ? " c h a t - m s g - - a c t i o n " : n u l l , t h i s . i s R e t r a c t e d ( ) ? " c h a t - m s g - - r e t r a c t e d " : n u l l , t h i s . m o d e l . g e t ( " t y p e " ) , t h i s . s h o u l d S h o w A v a t a r ( ) ? " c h a t - m s g - - w i t h - a v a t a r " : n u l l ] . m a p ( ( e = > e ) ) ; r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & ( e . p u s h ( t h i s . g e t O c c u p a n t R o l e ( ) ? ? " " ) , e . p u s h ( t h i s . g e t O c c u p a n t A f f i l i a t i o n ( ) ? ? " " ) , " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . h a s M e n t i o n s ( ) & & e . p u s h ( " m e n t i o n e d " ) ) , t h i s . m o d e l . g e t ( " c o r r e c t i n g " ) & & e . p u s h ( " c o r r e c t i n g " ) , e . f i l t e r ( ( e = > e ) ) . j o i n ( " " ) } g e t D e r i v e d M e s s a g e P r o p s ( ) { c o n s t e = V l . s e t t i n g s . g e t ( " t i m e _ f o r m a t " ) ; r e t u r n { p r e t t y _ t i m e : r x ( t h i s . m o d e l . g e t ( " e d i t e d " ) | | t h i s . m o d e l . g e t ( " t i m e " ) ) . f o r m a t ( e ) , h a s _ m e n t i o n s : t h i s . h a s M e n t i o n s ( ) , h a t s : y S ( t h i s . m o d e l ) , i s _ f i r s t _ u n r e a d : t h i s . c h a t b o x . g e t ( " f i r s t _ u n r e a d _ i d " ) = = = t h i s . m o d e l . g e t ( " i d " ) , i s _ m e _ m e s s a g e : t h i s . m o d e l . i s M e C o m m a n d ( ) , i s _ r e t r a c t e d : t h i s . i s R e t r a c t e d ( ) , u s e r n a m e : t h i s . m o d e l . g e t D i s p l a y N a m e ( ) , s h o u l d _ s h o w _ a v a t a r : t h i s . s h o u l d S h o w A v a t a r ( ) } } g e t R e t r a c t i o n T e x t ( ) { i f ( [ " g r o u p c h a t " , " m e p " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) & & t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) ) { c o n s t e = t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) , t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; t h i s . m o d e l . m o d | | ( t h i s . m o d e l . m o d = t . o c c u p a n t s . f i n d O c c u p a n t ( { j i d : e } ) | | t . o c c u p a n t s . f i n d O c c u p a n t ( { n i c k : i x . g e t R e s o u r c e F r o m J i d ( e ) } ) ) ; c o n s t n = t h i s . m o d e l . m o d ? t h i s . m o d e l . m o d . g e t D i s p l a y N a m e ( ) : " A m o d e r a t o r " ; r e t u r n q y ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , n ) } r e t u r n q y ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ) } s h o w U s e r M o d a l ( e ) { i f ( " m e " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) ) V l . m o d a l . s h o w ( " c o n v e r s e - p r o f i l e - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) ; e l s e i f ( " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) ) e . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - m u c - o c c u p a n t - m o d a l " , { m o d e l : t h i s . m o d e l . g e t O c c u p a n t ( ) , m e s s a g e : t h i s . m o d e l } , e ) ; e l s e { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; V l . m o d a l . s h o w ( " c o n v e r s e - u s e r - d e t a i l s - m o d a l " , { m o d e l : t } , e ) } } s h o w M e s s a g e V e r s i o n s M o d a l ( e ) { e . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - m e s s a g e - v e r s i o n s - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } t o g g l e S p o i l e r M e s s a g e ( e ) { e ? . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { i s _ s p o i l e r _ v i s i b l e : ! t h i s . m o d e l . g e t ( " i s _ s p o i l e r _ v i s i b l e " ) } ) } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - h i s t o r y " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , m e s s a g e s : { t y p e : A r r a y } } } r e n d e r ( ) { c o n s t e = t h i s . m e s s a g e s ; r e t u r n e . l e n g t h ? M w ( e , ( e = > e . g e t ( " i d " ) ) , ( e = > n h ` $ { t h i s . r e n d e r M e s s a g e ( e ) } ` ) ) : " " } r e n d e r M e s s a g e ( e ) { i f ( e . g e t ( " d a n g l i n g _ r e t r a c t i o n " ) | | e . g e t ( " i s _ o n l y _ k e y " ) ) r e t u r n " " ; c o n s t t = e . g e t ( " t e m p l a t e _ h o o k " ) ; i f ( " s t r i n g " = = t y p e o f t ) { c o n s t n = V l . h o o k ( t , e , " " ) ; r e t u r n W b ( n , " " ) } { c o n s t t = n h ` < c o n v e r s e - c h a t - m e s s a g e
2021-11-11 22:06:49 +01:00
jid = "${this.model.get(" jid ")}"
2023-12-29 14:11:55 +01:00
mid = "${e.get(" id ")}" > < / c o n v e r s e - c h a t - m e s s a g e > ` , n = v S ( e ) ; r e t u r n n ? [ n , t ] : t } } } ) ; v a r o x = n ( 4 6 5 9 ) , a x = { } ; a x . s t y l e T a g T r a n s f o r m = i _ ( ) , a x . s e t A t t r i b u t e s = e _ ( ) , a x . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , a x . d o m A P I = Q y ( ) , a x . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( o x . Z , a x ) ; o x . Z & & o x . Z . l o c a l s & & o x . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t - c o n t e n t " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } d i s c o n n e c t e d C a l l b a c k ( ) { s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) , t h i s . r e m o v e E v e n t L i s t e n e r ( " s c r o l l " , p S ) } a s y n c i n i t i a l i z e ( ) { a w a i t t h i s . s e t M o d e l s ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n _ o c c u p a n t s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e n d e r e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . n o t i f i c a t i o n s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . u i , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . u i , " c h a n g e : s c r o l l e d " , t h i s . s c r o l l D o w n ) , t h i s . m o d e l . o c c u p a n t s & & t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . a d d E v e n t L i s t e n e r ( " s c r o l l " , p S ) } a s y n c s e t M o d e l s ( ) { t h i s . m o d e l = a w a i t V l . c h a t b o x e s . g e t ( t h i s . j i d ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? n h `
2021-11-11 22:06:49 +01:00
< div class = "chat-content__notifications" > $ { this . model . getNotificationsText ( ) } < / d i v >
2021-03-19 19:26:15 +01:00
< converse - message - history
2021-11-11 22:06:49 +01:00
. model = $ { this . model }
. messages = $ { [ ... this . model . messages . models ] } >
2021-03-19 19:26:15 +01:00
< / c o n v e r s e - m e s s a g e - h i s t o r y >
2023-06-25 15:59:31 +02:00
$ { this . model . ui ? . get ( "chat-content-spinner-top" ) ? Sb ( ) : "" }
2023-12-29 14:11:55 +01:00
` :""}scrollDown(){if(!this.model.ui.get("scrolled")){if(this.scrollTo){const e=this.scrollTop?"smooth":"auto";this.scrollTo({top:0,behavior:e})}else this.scrollTop=0;Vl.trigger("chatBoxScrolledDown",{chatbox:this.model})}}});class cx extends Mb{constructor(e){if(super(e),this.et=ih,e.type!==Nb)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ih||null==e)return this.ft=void 0,this.et=e;if(e===sh)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;const t=[e];return t.raw=t,this.ft={_ $ litType $ :this.constructor.resultType,strings:t,values:[]}}}cx.directiveName="unsafeHTML",cx.resultType=1;const lx=Ob(cx);Vl.elements.define("converse-chat-help",class extends Gy{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[nh ` < converse - icon class = "fas fa-times close-chat-help"
2021-03-19 19:26:15 +01:00
@ click = $ { this . close }
2023-12-29 14:11:55 +01:00
path - prefix = "${Vl.settings.get(" assets _path ")}"
size = "1em" > < / c o n v e r s e - i c o n > ` , . . . t h i s . m e s s a g e s . m a p ( ( t = > t h i s . r e n d e r H e l p M e s s a g e ( { i s o d a t e : e , m a r k u p : w o ( ) . s a n i t i z e ( t , { A L L O W E D _ T A G S : [ " s t r o n g " ] } ) } ) ) ) ] } c l o s e ( ) { t h i s . m o d e l . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 1 } ) } r e n d e r H e l p M e s s a g e ( e ) { r e t u r n n h ` < d i v c l a s s = " m e s s a g e c h a t - $ { t h i s . t y p e } " d a t a - i s o d a t e = " $ { e . i s o d a t e } " > $ { l x ( e . m a r k u p ) } < / d i v > ` } } ) ; c o n s t d x = A h . e n v . u t i l s , u x = e = > { c o n s t t = V l . s e t t i n g s . g e t ( " e m o j i _ c a t e g o r i e s " ) ; r e t u r n n h ` < u l > $ { O b j e c t . k e y s ( t ) . m a p ( ( n = > t [ n ] ? ( e = > n h `
2021-11-11 22:06:49 +01:00
< li data - category = "${e.category}"
class = "emoji-category ${e.category} ${e.current_category===e.category?" picked ":" "}"
2023-12-29 14:11:55 +01:00
title = "${qy(Vl.settings.get(" emoji _category _labels ")[e.category])}" >
2021-11-11 22:06:49 +01:00
< a class = "pick-category"
@ click = $ { e . onCategoryPicked }
href = "#emoji-picker-${e.category}"
data - category = "${e.category}" > $ { e . emoji } < / a >
< / l i >
2023-12-29 14:11:55 +01:00
` )(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):""))}</ul> ` } , hx = e => nh `
2022-05-05 23:06:17 +02:00
< li class = "emoji insert-emoji ${e.shouldBeHidden(e.emoji.sn)?" hidden ":" "}" data - emoji = "${e.emoji.sn}" title = "${e.emoji.sn}" >
2023-12-29 14:11:55 +01:00
< a href = "#" @ click = $ { e . insertEmoji } data - emoji = "${e.emoji.sn}" > $ { dx . shortnamesToEmojis ( e . emoji . sn ) } < / a >
2022-05-05 23:06:17 +02:00
< / l i >
2023-12-29 14:11:55 +01:00
` ,mx=e=>{const t=Vl.settings.get("emoji_categories");return nh `
2022-05-05 23:06:17 +02:00
< span ? hidden = $ { e . query } class = "emoji-lists__container emoji-lists__container--browse" >
2023-12-29 14:11:55 +01:00
$ { Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => nh `
< a id = "emoji-picker-${e.category}" class = "emoji-category__heading" data - category = "${e.category}" > $ { qy ( Vl . settings . get ( "emoji_category_labels" ) [ e . category ] ) } < / a >
2022-05-05 23:06:17 +02:00
< ul class = "emoji-picker" data - category = "${e.category}" >
2023-12-29 14:11:55 +01:00
$ { Object . values ( Ah . emojis . json [ e . category ] ) . map ( ( t => hx ( Object . assign ( { emoji : t } , e ) ) ) ) }
2022-05-05 23:06:17 +02:00
< / u l > ` ) ( O b j e c t . a s s i g n ( { c a t e g o r y : n } , e ) ) : " " ) ) }
2023-12-29 14:11:55 +01:00
< / s p a n > ` } , f x = e = > { c o n s t t = q y ( " S e a r c h " ) ; r e t u r n n h `
2022-05-05 23:06:17 +02:00
< div class = "emoji-picker__header" >
< input class = "form-control emoji-search" name = "emoji-search" placeholder = "${t}"
. value = $ { e . query || "" }
@ keydown = $ { e . onSearchInputKeyDown }
@ blur = $ { e . onSearchInputBlurred }
@ focus = $ { e . onSearchInputFocus } >
2023-12-29 14:11:55 +01:00
$ { e . query ? "" : ux ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . render _emojis ? nh ` <converse-emoji-picker-content
2021-03-19 19:26:15 +01:00
. chatview = $ { e . chatview }
. model = $ { e . model }
. search _results = "${e.search_results}"
current _skintone = "${e.current_skintone}"
query = "${e.query}" > < / c o n v e r s e - e m o j i - p i c k e r - c o n t e n t > ` : " " }
< div class = "emoji-skintone-picker" >
2023-12-29 14:11:55 +01:00
< ul > $ { [ "tone1" , "tone2" , "tone3" , "tone4" , "tone5" ] . map ( ( t => ( e => nh `
2021-03-19 19:26:15 +01:00
< li data - skintone = "${e.skintone}" class = "emoji-skintone ${e.current_skintone===e.skintone?" picked ":" "}" >
2023-12-29 14:11:55 +01:00
< a class = "pick-skintone" href = "#" data - skintone = "${e.skintone}" @ click = $ { e . onSkintonePicked } > $ { dx . shortnamesToEmojis ( ":" + e . skintone + ":" ) } < / a >
2021-11-11 22:06:49 +01:00
< / l i > ` ) ( O b j e c t . a s s i g n ( { s k i n t o n e : t } , e ) ) ) ) } < / u l >
2023-12-29 14:11:55 +01:00
< / d i v > ` } , { s i z z l e : g x } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r - c o n t e n t " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , s e a r c h _ r e s u l t s : { t y p e : A r r a y } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g } } } r e n d e r ( ) { c o n s t e = { c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , i n s e r t E m o j i : e = > t h i s . i n s e r t E m o j i ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , s h o u l d B e H i d d e n : e = > t h i s . s h o u l d B e H i d d e n ( e ) } ; r e t u r n n h `
2021-03-19 19:26:15 +01:00
< div class = "emoji-picker__lists" >
2023-12-29 14:11:55 +01:00
$ { ( e => { const t = qy ( "Search results" ) ; return nh `
2021-03-19 19:26:15 +01:00
< span ? hidden = $ { ! e . query } class = "emoji-lists__container emojis-lists__container--search" >
< a id = "emoji-picker-search-results" class = "emoji-category__heading" > $ { t } < / a >
< ul class = "emoji-picker" >
2023-12-29 14:11:55 +01:00
$ { e . search _results . map ( ( t => hx ( Object . assign ( { emoji : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / u l >
< / s p a n >
` })(e)}
2023-12-29 14:11:55 +01:00
$ { mx ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
` }firstUpdated(){this.initIntersectionObserver()}initIntersectionObserver(){if(window.IntersectionObserver){if(this.observer)this.observer.disconnect();else{const e={root:this.querySelector(".emoji-picker__lists"),threshold:[.1]},t=e=>this.setCategoryOnVisibilityChange(e);this.observer=new IntersectionObserver(t,e)}gx(".emoji-picker",this).forEach((e=>this.observer.observe(e)))}}setCategoryOnVisibilityChange(e){const t=this.parentElement.navigator.selected,n=e.filter((e=>e.target.contains(t))).pop();let s;if(s=n||e.reduce(((e,t)=>t.intersectionRatio>=(e?.intersectionRatio||0)?t:e),null),s&&s.isIntersecting){const e=s.target.getAttribute("data-category");e!==this.model.get("current_category")&&(this.parentElement.preserve_scroll=!0,this.model.save({current_category:e}))}}insertEmoji(e){e.preventDefault(),e.stopPropagation();const t="IMG"===e.target.nodeName?e.target.parentElement:e.target;this.parentElement.insertIntoTextArea(t.getAttribute("data-emoji"))}shouldBeHidden(e){if(e.includes("_tone")){if(!this.current_skintone||!e.includes(this.current_skintone))return!0}else if(this.current_skintone&&_S().includes(e))return!0;return!(!this.query||bl.FILTER_CONTAINS(e,this.query))}});const px=Ah.env.utils;Vl.elements.define("converse-emoji-dropdown",class extends PS{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await Vl.emojis.initialize();const e= ` converse . emoji - $ { bl . bare _jid } - $ { this . chatview . model . get ( "jid" ) } ` ;this.model=new bl.EmojiPicker({id:e}),vc(this.model,e),await new Promise((e=>this.model.fetch({success:e,error:e}))),this.model.set({autocompleting:null,ac_position:null})})()),this.init_promise}render(){const e=this.chatview.model.get("type")===bl.CHATROOMS_TYPE?"--muc-toolbar-btn-color":"--chat-toolbar-btn-color";return nh `
2021-03-19 19:26:15 +01:00
< div class = "dropup" >
< button class = "toggle-emojis"
2023-12-29 14:11:55 +01:00
title = "${qy(" Insert emojis ")}"
2021-03-19 19:26:15 +01:00
data - toggle = "dropdown"
aria - haspopup = "true"
aria - expanded = "false" >
< converse - icon
2022-04-02 21:20:14 +02:00
color = "var(${e})"
2021-03-19 19:26:15 +01:00
class = "fa fa-smile "
2023-12-29 14:11:55 +01:00
path - prefix = "${Vl.settings.get(" assets _path ")}"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
< div class = "dropdown-menu" >
2023-12-29 14:11:55 +01:00
$ { Wb ( this . initModel ( ) . then ( ( ( ) => nh `
2021-03-19 19:26:15 +01:00
< converse - emoji - picker
. chatview = $ { this . chatview }
. model = $ { this . model }
2022-04-02 21:20:14 +02:00
@ emojiSelected = $ { ( ) => this . hideMenu ( ) }
2021-03-19 19:26:15 +01:00
? render _emojis = $ { this . render _emojis }
current _category = "${this.model.get(" current _category ")||" "}"
current _skintone = "${this.model.get(" current _skintone ")||" "}"
query = "${this.model.get(" query ")||" "}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - e m o j i - p i c k e r > ` ) ) , " " ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e n d e r _ e m o j i s = ! 1 } t o g g l e M e n u ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , p x . h a s C l a s s ( " s h o w " , t h i s . m e n u ) ? p x . a n c e s t o r ( e . t a r g e t , " . t o g g l e - e m o j i s " ) & & t h i s . h i d e M e n u ( ) : t h i s . s h o w M e n u ( ) } a s y n c s h o w M e n u ( ) { a w a i t t h i s . i n i t M o d e l ( ) , t h i s . r e n d e r _ e m o j i s | | ( t h i s . r e n d e r _ e m o j i s = ! 0 , t h i s . r e q u e s t U p d a t e ( ) , a w a i t t h i s . u p d a t e C o m p l e t e ) , s u p e r . s h o w M e n u ( ) , s e t T i m e o u t ( ( ( ) = > t h i s . q u e r y S e l e c t o r ( " . e m o j i - s e a r c h " ) ? . f o c u s ( ) ) ) } } ) ; v a r v x = n ( 4 3 1 1 ) , y x = { } ; y x . s t y l e T a g T r a n s f o r m = i _ ( ) , y x . s e t A t t r i b u t e s = e _ ( ) , y x . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , y x . d o m A P I = Q y ( ) , y x . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( v x . Z , y x ) ; v x . Z & & v x . Z . l o c a l s & & v x . Z . l o c a l s ; c o n s t _ x = A h . e n v . u t i l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , c u r r e n t _ c a t e g o r y : { t y p e : S t r i n g , r e f l e c t : ! 0 } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g , r e f l e c t : ! 0 } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g , r e f l e c t : ! 0 } , r e n d e r _ e m o j i s : { t y p e : B o o l e a n } } } f i r s t U p d a t e d ( ) { s u p e r . f i r s t U p d a t e d ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( e = > t h i s . o n M o d e l C h a n g e d ( e . c h a n g e d ) ) ) , t h i s . i n i t A r r o w N a v i g a t i o n ( ) } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . q u e r y = " " , t h i s . _ s e a r c h _ r e s u l t s = [ ] , t h i s . d e b o u n c e d F i l t e r = I l ( ( e = > t h i s . m o d e l . s e t ( { q u e r y : e . v a l u e } ) ) , 2 5 0 ) } g e t s e a r c h _ r e s u l t s ( ) { r e t u r n t h i s . _ s e a r c h _ r e s u l t s } s e t s e a r c h _ r e s u l t s ( e ) { t h i s . _ s e a r c h _ r e s u l t s = e , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n f x ( { c h a t v i e w : t h i s . c h a t v i e w , c u r r e n t _ c a t e g o r y : t h i s . c u r r e n t _ c a t e g o r y , c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , m o d e l : t h i s . m o d e l , o n C a t e g o r y P i c k e d : e = > t h i s . c h o o s e C a t e g o r y ( e ) , o n S e a r c h I n p u t B l u r r e d : e = > t h i s . c h a t v i e w . e m i t F o c u s e d ( e ) , o n S e a r c h I n p u t F o c u s : e = > t h i s . o n S e a r c h I n p u t F o c u s ( e ) , o n S e a r c h I n p u t K e y D o w n : e = > t h i s . o n S e a r c h I n p u t K e y D o w n ( e ) , o n S k i n t o n e P i c k e d : e = > t h i s . c h o o s e S k i n T o n e ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , r e n d e r _ e m o j i s : t h i s . r e n d e r _ e m o j i s , s n 2 E m o j i : e = > _ x . s h o r t n a m e s T o E m o j i s ( t h i s . g e t T o n e d S h o r t n a m e ( e ) ) } ) } u p d a t e d ( e ) { e . h a s ( " q u e r y " ) & & t h i s . u p d a t e S e a r c h R e s u l t s ( e ) , e . h a s ( " c u r r e n t _ c a t e g o r y " ) & & t h i s . s e t S c r o l l P o s i t i o n ( ) } o n M o d e l C h a n g e d ( e ) { " c u r r e n t _ c a t e g o r y " i n e & & ( t h i s . c u r r e n t _ c a t e g o r y = e . c u r r e n t _ c a t e g o r y ) , " c u r r e n t _ s k i n t o n e " i n e & & ( t h i s . c u r r e n t _ s k i n t o n e = e . c u r r e n t _ s k i n t o n e ) , " q u e r y " i n e & & ( t h i s . q u e r y = e . q u e r y ) } s e t S c r o l l P o s i t i o n ( ) { i f ( t h i s . p r e s e r v e _ s c r o l l ) r e t u r n v o i d ( t h i s . p r e s e r v e _ s c r o l l = ! 1 ) ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . e m o j i - l i s t s _ _ c o n t a i n e r - - b r o w s e " ) , t = t h i s . q u e r y S e l e c t o r ( ` # e m o j i - p i c k e r - $ { t h i s . c u r r e n t _ c a t e g o r y } ` ) ; t & & ( e . s c r o l l T o p = t . o f f s e t T o p - 3 * t . o f f s e t H e i g h t + 4 ) } u p d a t e S e a r c h R e s u l t s ( e ) { c o n s t t = e . g e t ( " q u e r y " ) , n = b l . F I L T E R _ C O N T A I N S ; i f ( t h i s . q u e r y ) { i f ( t h i s . q u e r y = = = t ) r e t u r n t h i s . s e a r c h _ r e s u l t s ; t & & t h i s . q u e r y . i n c l u d e s ( t ) ? t h i s . s e a r c h _ r e s u l t s = t h i s . s e a r c h _ r e s u l t s . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) : t h i s . s e a r c h _ r e s u l t s = A h . e m o j i s . l i s t . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) } e l s e t h i s . s e a r c h _ r e s u l t s . l e n g t h & & ( t h i s . s e a r c h _ r e s u l t s = [ ] ) } r e g i s t e r E v e n t s ( ) { t h i s . o n G l o b a l K e y D o w n = e = > t h i s . _ o n G l o b a l K e y D o w n ( e ) ; d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . a d d E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e g i s t e r E v e n t s ( ) } d i s c o n n e c t e d C a l l b a c k ( ) { d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . r e m o v e E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) , t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) , s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) } _ o n G l o b a l K e y D o w n ( e ) { t h i s . n a v i g a t o r & & ( e . k e y C o d e = = = v o . E N T E R & & _ x . i s V i s i b l e ( t h i s ) ? t h i s . o n E n t e r P r e s s e d ( e ) : e . k e y C o d e = = = v o . D O W N _ A R R O W & & ! t h i s . n a v i g a t o r . e n a b l e d & & _ x . i s V i s i b l e ( t h i s ) ? t h i s . e n a b l e A r r o w N a v i g a t i o n ( e ) : e . k e y C o d e = = = v o . E S C A P E & & ( t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) , s e t T i m e o u t ( ( ( ) = > t h i s . c h a t v i e w . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) . f o c u s ( ) ) , 5 0 ) ) ) } s e t C a t e g o r y F o r E l e m e n t ( e ) { c o n s t t = t h i s . c u r r e n t _ c a t e g o r y , n = e ? . g e t A t t r i b u t e ( " d a t a - c a t e g o r y " ) | | t ; t ! = = n & & t h i s . m o d e l . s a v e ( { c u r r e n t _ c a t e g o r y : n } ) } i n s e r t I n t o T e x t A r e a ( e ) { c o n s t t = t h i s . m o d e l . g e t ( " a u t o c o m p l e t i n g " ) , n = t h i s . m o d e l . g e t ( " a c _ p o s i t i o n " ) ; t h i s . m o d e l . s e t ( { a u t o c o m p l e t i n g : n u l l , q u e r y : " " , a c _ p o s i t i o n : n u l l } ) , t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) ; c o n s t s = { b u b b l e s : ! 0 , d e t a i l : { v a l u e : e , a u t o c o m p l e t i n g : t , a c _ p o s i t i o n : n , j i d : t h i s . c h a t v i e w . m o d e l . g e t ( " j i d " ) } } ; t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " e m o j i S e l e c t e d " , s ) ) } c h o o s e S k i n T o n e ( e ) { e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) ; c o n s t t = ( " I M G " = = = e . t a r g e t . n o d e N a m e ? e . t a r g e t . p a r e n t E l e m e n t : e . t a r g e t ) . g e t A t t r i b u t e ( " d a t a - s k i n t o n
2023-06-25 15:59:31 +02:00
< span class = "toolbar-buttons" > $ { Wb ( e . getButtons ( ) , "" ) } < / s p a n >
2023-12-29 14:11:55 +01:00
$ { e . show _send _button ? function ( ) { const e = qy ( "Send the message" ) ; return nh ` <button type="submit" class="btn send-button" title=" ${ e } ">
2022-05-05 23:06:17 +02:00
< converse - icon color = "var(--toolbar-btn-text-color)" class = "fa fa-paper-plane" size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n > ` } ( ) : " " }
2023-12-29 14:11:55 +01:00
` ;var wx=n(8899),Sx={};Sx.styleTagTransform=i_(),Sx.setAttributes=e_(),Sx.insert=Yy().bind(null,"head"),Sx.domAPI=Qy(),Sx.insertStyleElement=n_();Jy()(wx.Z,Sx);wx.Z&&wx.Z.locals&&wx.Z.locals;const xx=Ah.env.Strophe;Vl.elements.define("converse-chat-toolbar",class extends Gy{static get properties(){return{hidden_occupants:{type:Boolean},is_groupchat:{type:Boolean},message_limit:{type:Number},model:{type:Object},show_call_button:{type:Boolean},show_emoji_button:{type:Boolean},show_send_button:{type:Boolean},show_spoiler_button:{type:Boolean}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:composing_spoiler",(()=>this.requestUpdate()))}render(){return bx(this)}firstUpdated(){Vl.trigger("renderToolbar",this)}getButtons(){const e=[];if(this.show_emoji_button){const t=bl.chatboxviews.get(this.model.get("jid"));e.push(nh ` < converse - emoji - dropdown . chatview = $ { t } > < / c o n v e r s e - e m o j i - d r o p d o w n > ` ) } i f ( t h i s . s h o w _ c a l l _ b u t t o n ) { c o n s t t = t h i s . i s _ g r o u p c h a t ? " - - m u c - t o o l b a r - b t n - c o l o r " : " - - c h a t - t o o l b a r - b t n - c o l o r " , n = q y ( " S t a r t a c a l l " ) ; e . p u s h ( n h `
2022-04-02 21:20:14 +02:00
< button class = "toggle-call" @ click = $ { this . toggleCall } title = "${n}" >
2023-01-07 22:34:35 +01:00
< converse - icon color = "var(${t})" class = "fa fa-phone" size = "1em" > < / c o n v e r s e - i c o n >
2023-12-29 14:11:55 +01:00
< / b u t t o n > ` ) } V l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & e . p u s h ( n h `
2021-11-11 22:06:49 +01:00
< converse - message - limit - indicator . model = $ { this . model } class = "right" >
2023-12-29 14:11:55 +01:00
< / c o n v e r s e - m e s s a g e - l i m i t - i n d i c a t o r > ` ) , t h i s . s h o w _ s p o i l e r _ b u t t o n & & e . p u s h ( t h i s . g e t S p o i l e r B u t t o n ( ) ) ; c o n s t t = V l . d i s c o . s u p p o r t s ( x x . N S . H T T P U P L O A D , b l . d o m a i n ) ; i f ( e . p u s h ( n h ` $ { W b ( t . t h e n ( ( e = > t h i s . g e t H T T P U p l o a d B u t t o n ( e ) ) ) , " " ) } ` ) , t h i s . i s _ g r o u p c h a t & & V l . s e t t i n g s . g e t ( " v i s i b l e _ t o o l b a r _ b u t t o n s " ) ? . t o g g l e _ o c c u p a n t s ) { c o n s t t = q y ( " H i d e p a r t i c i p a n t s " ) , n = q y ( " S h o w p a r t i c i p a n t s " ) ; e . p u s h ( n h `
2021-03-19 19:26:15 +01:00
< button class = "toggle_occupants right"
2023-01-07 22:34:35 +01:00
title = "${this.hidden_occupants?n:t}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleOccupants } >
2022-04-02 21:20:14 +02:00
< converse - icon
color = "var(--muc-toolbar-btn-color)"
class = "fa ${this.hidden_occupants?" fa - angle - double - left ":" fa - angle - double - right "}"
size = "1em" > < / c o n v e r s e - i c o n >
2023-12-29 14:11:55 +01:00
< / b u t t o n > ` ) } r e t u r n b l . a p i . h o o k ( " g e t T o o l b a r B u t t o n s " , t h i s , e ) } g e t H T T P U p l o a d B u t t o n ( e ) { i f ( e ) { c o n s t e = q y ( " C h o o s e a f i l e t o s e n d " ) , t = t h i s . i s _ g r o u p c h a t ? " - - m u c - t o o l b a r - b t n - c o l o r " : " - - c h a t - t o o l b a r - b t n - c o l o r " ; r e t u r n n h `
2021-03-19 19:26:15 +01:00
< button title = "${e}" @ click = $ { this . toggleFileUpload } >
2022-04-02 21:20:14 +02:00
< converse - icon
color = "var(${t})"
class = "fa fa-paperclip"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
2023-12-29 14:11:55 +01:00
< input type = "file" @ change = $ { this . onFileSelection } class = "fileupload" multiple = "" style = "display:none" / > ` }return""}getSpoilerButton(){const e=this.model;if(!this.is_groupchat&&!e.presence?.resources.length)return;let t;t=e.get("composing_spoiler")?qy("Click to write as a normal (non-spoiler) message"):qy("Click to write your message as a spoiler");const n=this.is_groupchat?"--muc-toolbar-btn-color":"--chat-toolbar-btn-color",s=nh `
2021-03-19 19:26:15 +01:00
< button class = "toggle-compose-spoiler"
2023-01-07 22:34:35 +01:00
title = "${t}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleComposeSpoilerMessage } >
2022-04-02 21:20:14 +02:00
< converse - icon
2023-01-07 22:34:35 +01:00
color = "var(${n})"
class = "fa ${e.get(" composing _spoiler ")?" fa - eye - slash ":" fa - eye "}"
2022-04-02 21:20:14 +02:00
size = "1em" > < / c o n v e r s e - i c o n >
2023-12-29 14:11:55 +01:00
< /button>`;if(this.is_groupchat)return s;{const t=e.get("jid"),n=Promise.all(e.presence.resources.map((e=>Vl.disco.supports(xx.NS.SPOILER,`${t}/ $ { e . get ( "name" ) } ` )))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return nh ` $ { Wb ( n . then ( ( ( ) => s ) ) , "" ) } ` }}toggleFileUpload(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.querySelector(".fileupload").click()}onFileSelection(e){this.model.sendFiles(e.target.files)}toggleComposeSpoilerMessage(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.set("composing_spoiler",!this.model.get("composing_spoiler"))}toggleOccupants(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.save({hidden_occupants:!this.model.get("hidden_occupants")})}toggleCall(e){e?.preventDefault?.(),e?.stopPropagation?.(),Vl.trigger("callButtonClicked",{connection:bl.connection,model:this.model})}});var Ex=n(3584),Ax={};Ax.styleTagTransform=i_(),Ax.setAttributes=e_(),Ax.insert=Yy().bind(null,"head"),Ax.domAPI=Qy(),Ax.insertStyleElement=n_();Jy()(Ex.Z,Ax);Ex.Z&&Ex.Z.locals&&Ex.Z.locals;async function Cx(e){await Vl.confirm(qy("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function $ x(e){if(e.target.value){const t=e.target.scrollHeight+"px";e.target.style.height!=t&&(e.target.style.height="auto",e.target.style.height=t)}else e.target.style=""}Vl.elements.define("converse-chat-heading",class extends Gy{static get properties(){return{jid:{type:String}}}initialize(){this.model=bl.chatboxes.get(this.jid),this.listenTo(this.model,"change:status",(()=>this.requestUpdate())),this.listenTo(this.model,"vcard:add",(()=>this.requestUpdate())),this.listenTo(this.model,"vcard:change",(()=>this.requestUpdate())),this.model.contact&&this.listenTo(this.model.contact,"destroy",(()=>this.requestUpdate())),this.model.rosterContactAdded?.then((()=>{this.listenTo(this.model.contact,"change:nickname",(()=>this.requestUpdate())),this.requestUpdate()}))}render(){return(e=>{const t=qy("The User's Profile Image"),n=nh ` < span title = "${t}" >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar chat-msg__avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2023-12-29 14:11:55 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r > < / s p a n > ` , s = e . m o d e l . g e t D i s p l a y N a m e ( ) ; r e t u r n n h `
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2023-12-29 14:11:55 +01:00
$ { bl . api . settings . get ( "singleton" ) ? "" : nh ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
$ { e . type !== bl . HEADLINES _TYPE ? nh ` <a class="show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ n } </a> ` : "" }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" >
2023-12-29 14:11:55 +01:00
$ { e . type !== bl . HEADLINES _TYPE ? nh ` <a class="user show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ s } </a> ` : s }
2021-11-11 22:06:49 +01:00
< / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__buttons row no-gutters" >
2023-12-29 14:11:55 +01:00
$ { Wb ( fS ( e . heading _buttons _promise ) , "" ) }
$ { Wb ( mS ( e . heading _buttons _promise ) , "" ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . status ? nh ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` })(Object.assign(this.model.toJSON(),{heading_buttons_promise:this.getHeadingButtons(),model:this.model,showUserDetailsModal:e=>this.showUserDetailsModal(e)}))}showUserDetailsModal(e){e.preventDefault(),Vl.modal.show("converse-user-details-modal",{model:this.model},e)}close(e){e.preventDefault(),this.model.close()}getHeadingButtons(){const e=[{a_class:"show-user-details-modal",handler:e=>this.showUserDetailsModal(e),i18n_text:qy("Details"),i18n_title:qy("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===Vl.settings.get("view_mode")}];Vl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:qy("Close"),i18n_title:qy("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Vl.settings.get("view_mode")});const t=bl.chatboxviews.get(this.getAttribute("jid"));return t?bl.api.hook("getHeadingButtons",t,e):e}});const{u:kx}=Ah.env;class jx extends eb{async connectedCallback(){super.connectedCallback(),this.model=bl.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model.messages,"change:correcting",this.onMessageCorrecting),this.listenTo(this.model,"change:composing_spoiler",(()=>this.render())),this.handleEmojiSelection=e=>{let{detail:t}=e;this.model.get("jid")===t.jid&&this.insertIntoTextArea(t.value,t.autocompleting,!1,t.ac_position)},document.addEventListener("emojiSelected",this.handleEmojiSelection),this.render()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("emojiSelected",this.handleEmojiSelection)}toHTML(){return(e=>{const t=e.composing_spoiler?qy("Hidden message"):qy("Message"),n=qy("Optional hint"),s=Vl.settings.get("show_send_button");return nh `
2021-11-11 22:06:49 +01:00
< form class = "sendXMPPMessage" >
2022-05-05 23:06:17 +02:00
< input type = "text"
enterkeyhint = "send"
placeholder = "${n||" "}" i
value = "${e.hint_value||" "}"
class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
2021-11-11 22:06:49 +01:00
< textarea
autofocus
type = "text"
2022-05-05 23:06:17 +02:00
enterkeyhint = "send"
2021-11-11 22:06:49 +01:00
@ drop = $ { e . onDrop }
2023-12-29 14:11:55 +01:00
@ input = $ { $x }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea
2022-05-05 23:06:17 +02:00
$ { s ? "chat-textarea-send-button" : "" }
2021-11-11 22:06:49 +01:00
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
2023-12-29 14:11:55 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { o n D r o p : e = > t h i s . o n D r o p ( e ) , h i n t _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . s p o i l e r - h i n t " ) ? . v a l u e , m e s s a g e _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ? . v a l u e , o n C h a n g e : e = > t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) , o n K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n K e y U p : e = > t h i s . o n K e y U p ( e ) , o n P a s t e : e = > t h i s . o n P a s t e ( e ) , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) ) } i n s e r t I n t o T e x t A r e a ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] & & a r g u m e n t s [ 1 ] , n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] & & a r g u m e n t s [ 2 ] , s = a r g u m e n t s . l e n g t h > 3 ? a r g u m e n t s [ 3 ] : v o i d 0 ; c o n s t i = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( n ? k x . a d d C l a s s ( " c o r r e c t i n g " , i ) : k x . r e m o v e C l a s s ( " c o r r e c t i n g " , i ) , t ) i . v a l u e = s & & " s t r i n g " = = t y p e o f t ? i . v a l u e . r e p l a c e ( n e w R e g E x p ( t , " g " ) , ( ( n , i ) = > i = = s - t . l e n g t h ? e + " " : n ) ) : e ; e l s e { l e t t = i . v a l u e ; t & & " " ! = = t [ t . l e n g t h - 1 ] & & ( t + = " " ) , i . v a l u e = t + e + " " } c o n s t r = d o c u m e n t . c r e a t e E v e n t ( " H T M L E v e n t s " ) ; r . i n i t E v e n t ( " c h a n g e " , ! 1 , ! 0 ) , i . d i s p a t c h E v e n t ( r ) , k x . p l a c e C a r e t A t E n d ( i ) } o n M e s s a g e C o r r e c t i n g ( e ) { i f ( e . g e t ( " c o r r e c t i n g " ) ) t h i s . i n s e r t I n t o T e x t A r e a ( z c ( e ) , ! 0 , ! 0 ) ; e l s e { c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d W h e r e ( " c o r r e c t i n g " ) ; t & & t ! = = e ? t h i s . i n s e r t I n t o T e x t A r e a ( z c ( e ) , ! 0 , ! 0 ) : t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) } } o n E s c a p e P r e s s e d ( e ) { c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d L a s t I n d e x ( " c o r r e c t i n g " ) , n = t > = 0 ? t h i s . m o d e l . m e s s a g e s . a t ( t ) : n u l l ; n & & ( e . p r e v e n t D e f a u l t ( ) , n . s a v e ( " c o r r e c t i n g " , ! 1 ) , t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) ) } o n P a s t e ( e ) { i f ( e . s t o p P r o p a g a t i o n ( ) , 0 ! = = e . c l i p b o a r d D a t a . f i l e s . l e n g t h ) r e t u r n e . p r e v e n t D e f a u l t ( ) , v o i d t h i s . m o d e l . s e n d F i l e s ( A r r a y . f r o m ( e . c l i p b o a r d D a t a . f i l e s ) ) ; t h i s . m o d e l . s e t ( { d r a f t : e . c l i p b o a r d D a t a . g e t D a t a ( " t e x t / p l a i n " ) } ) } o n K e y U p ( e ) { t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) } o n K e y D o w n ( e ) { i f ( ! e . c t r l K e y ) { i f ( ! e . s h i f t K e y & & ! e . a l t K e y & & ! e . m e t a K e y ) i f ( e . k e y C o d e = = = A h . k e y c o d e s . T A B ) { c o n s t t = k x . g e t C u r r e n t W o r d ( e . t a r g e t , n u l l , / ( : . * ? : ) / g ) ; t . s t a r t s W i t h ( " : " ) & & ( e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) , t h i s . m o d e l . t r i g g e r ( " e m o j i - p i c k e r - a u t o c o m p l e t e " , e . t a r g e t , t ) ) } e l s e { i f ( e . k e y C o d e = = = A h . k e y c o d e s . F O R W A R D _ S L A S H ) r e t u r n ; i f ( e . k e y C o d e = = = A h . k e y c o d e s . E S C A P E ) r e t u r n t h i s . o n E s c a p e P r e s s e d ( e , t h i s ) ; i f ( e . k e y C o d e = = = A h . k e y c o d e s . E N T E R ) r e t u r n t h i s . o n F o r m S u b m i t t e d ( e ) ; i f ( e . k e y C o d e ! = = A h . k e y c o d e s . U P _ A R R O W | | e . t a r g e t . s e l e c t i o n E n d ) { i f ( e . k e y C o d e = = = A h . k e y c o d e s . D O W N _ A R R O W & & e . t a r g e t . s e l e c t i o n E n d = = = e . t a r g e t . v a l u e . l e n g t h & & k x . h a s C l a s s ( " c o r r e c t i n g " , t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ) ) r e t u r n t h i s . m o d e l . e d i t L a t e r M e s s a g e ( ) } e l s e { c o n s t e = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( ! e . v a l u e | | k x . h a s C l a s s ( " c o r r e c t i n g " , e ) ) r e t u r n t h i s . m o d e l . e d i t E a r l i e r M e s s a g e ( ) } } [ A h . k e y c o d e s . S H I F T , A h . k e y c o d e s . M E T A , A h . k e y c o d e s . M E T A _ R I G H T , A h . k e y c o d e s . E S C A P E , A h . k e y c o d e s . A L T ] . i n c l u d e s ( e . k e y C o d e ) | | t h i s . m o d e l . g e t ( " c h a t _ s t a t e " ) ! = = b l . C O M P O S I N G & & t h i s . m o d e l . s e t C h a t S t a t e ( b l . C O M P O S I N G ) } } a s y n c o n F o r m S u b m i t t e d ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) , n = t . v a l u e . t r i m ( ) ; i f ( V l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & n . l e n g t h > V l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) | | ! n . r e p l a c e ( / \ s / g , " " ) . l e n g t h ) r e t u r n ; i f ( ! b l . c o n n e c t i o n . a u t h e n t i c a t e d ) { c o n s t e = q y ( " S o r r y , t h e c o n n e c t i o n h a s b e e n l o s t , a n d y o u r m e s s a g e c o u l d n o t b e s e n t " ) ; r e t u r n V l . a l e r t ( " e r r o r " , q y ( " E r r o r " ) , e ) , v o i d V l . c o n n e c t i o n . r e c o n n e c t ( ) } l e t s , i = { } ; t h i s . m o d e l . g e t ( " c o m p o s i n g _ s p o i l e r " ) & & ( i = t h i s . q u e r y S e l e c t o r ( " f o r m . s e n d X M P P M e s s a g e i n p u t . s p o i l e r - h i n t " ) , s = i . v a l u e ) , k x . a d d C l a s s ( " d i s a b l e d " , t ) , t . s e t A t t r i b u t e ( " d i s a b l e d " , " d i s a b l e d " ) , t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - e m o j i - d r o p d o w n " ) ? . h i d e M e n u ( ) ; c o n s t r = a w a i t a s y n c f u n c t i o n ( e , t ) { c o n s t n = t . r e p l a c e ( / ^ \ s * / , " " ) . m a t c h ( / ^ \ / ( . * ) \ s * $ / ) ; i f ( n ) { l e t s = ! 1 ; i f ( s = a w a i t V l . h o o k ( " p a r s e M e s s a g e F o r C o m m a n d s " , { m o d e l : e , t e x t : t } , s ) , s ) r e t u r n ! 0 ; i f ( " c l e a r " = = = n [ 1 ] ) r e t u r n C x ( e ) , ! 0 ; i f ( " c l o s e " = = = n [ 1 ] ) r e t u r n b l . c h a t b o x v i e w s . g e t ( e . g e t ( " j i d " ) ) ? . c l o s e ( ) , ! 0 ; i f ( " h e l p " = = = n [ 1 ] ) r e t u r n e . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 1 } , { s i l e n t : ! 0 } ) , e . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 0 } ) , ! 0 } r e t u r n ! 1 } ( t h i s . m o d e l , n ) , o = r ? n u l l : a w a i t t h i s . m o d e l . s e n d M e s s a g e ( { b o d y : n , s p o i l e r _ h i n t : s } ) ; i f ( ( r | | o ) & & ( i . v a l u e = " " , t . v a l u e = " " , k x . r e m o v e C l a s s ( " c o r r e c t i n g " , t ) , t . s t y l e . h e i g h t = " a u t o " , t h i s . m o d e l . s e t ( { d r a f t : " " } ) ) , " o v e r l a y e d " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ) { b l . c h a t b o x v i e w s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) . q u e r y S e l e c t o r ( " . c h a t - c o n t e n t _ _ m e s s a g e s " ) . p a r e n t E l e m e n t . s t y l e . d i s p l a y = " n o n e " } i f ( t . r e m o v e A t t r i b u t e (
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? nh ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { Vl . settings . get ( "show_toolbar" ) ? nh `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
2022-05-05 23:06:17 +02:00
? show _call _button = "${s}"
? show _emoji _button = "${i}"
2022-12-17 22:08:36 +01:00
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
2021-11-11 22:06:49 +01:00
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
< converse - message - form jid = "${e.model.get(" jid ")}" > < / c o n v e r s e - m e s s a g e - f o r m >
2023-12-29 14:11:55 +01:00
` })({model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}sendButtonClicked(e){this.querySelector("converse-message-form")?.onFormSubmitted(e)}viewUnreadMessages(e){e?.preventDefault?.(),this.model.ui.set({scrolled:!1})}emitFocused(e){bl.chatboxviews.get(this.getAttribute("jid"))?.emitFocused(e)}emitBlurred(e){bl.chatboxviews.get(this.getAttribute("jid"))?.emitBlurred(e)}onDrop(e){0!=e.dataTransfer.files.length&&(e.preventDefault(),this.model.sendFiles(e.dataTransfer.files))}onDragOver(e){e.preventDefault()}clearMessages(e){e?.preventDefault?.(),Cx(this.model)}async autocompleteInPicker(e,t){await Vl.emojis.initialize();const n=this.querySelector("converse-emoji-picker");if(n){n.model.set({ac_position:e.selectionStart,autocompleting:t,query:t});const s=this.querySelector("converse-emoji-dropdown");s?.showMenu()}}}Vl.elements.define("converse-chat-bottom-panel",Nx);class Ox extends Gy{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),bl.chatboxviews.remove(this.jid,this)}updated(){this.model&&this.jid!==this.model.get("jid")&&(this.stopListening(),bl.chatboxviews.remove(this.model.get("jid"),this),delete this.model,this.requestUpdate(),this.initialize())}close(e){return e?.preventDefault?.(),this.model.close(e)}maybeFocus(){Vl.settings.get("auto_focus")&&this.focus()}focus(){const e=this.getElementsByClassName("chat-textarea")[0];return e&&document.activeElement!==e&&e.focus(),this}emitBlurred(e){this.contains(document.activeElement)||this.contains(e.relatedTarget)||Vl.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||Vl.trigger("chatBoxFocused",this,e)}getBottomPanel(){return this.model.get("type")===bl.CHATROOMS_TYPE?this.querySelector("converse-muc-bottom-panel"):this.querySelector("converse-chat-bottom-panel")}getMessageForm(){return this.model.get("type")===bl.CHATROOMS_TYPE?this.querySelector("converse-muc-message-form"):this.querySelector("converse-message-form")}scrollDown(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.ui.get("scrolled")&&this.model.ui.set({scrolled:!1}),gS(this.model)}onWindowStateChanged(e){"visible"===e.state?this.model.isHidden()||this.model.clearUnreadMsgCounter():"hidden"===e.state&&(this.model.setChatState(bl.INACTIVE,{silent:!0}),this.model.sendChatState())}}class Mx extends Ox{length=200;async initialize(){bl.chatboxviews.add(this.jid,this),this.model=bl.chatboxes.get(this.jid),this.listenTo(bl,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>!this.model.get("hidden")&&this.afterShown())),this.listenTo(this.model,"change:show_help_messages",(()=>this.requestUpdate())),await this.model.messages.fetched,!this.model.get("hidden")&&this.afterShown(),Vl.trigger("chatBoxViewInitialized",this)}render(){return(e=>nh `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-12-29 14:11:55 +01:00
$ { e . model ? nh `
2021-11-11 22:06:49 +01:00
< converse - chat - heading jid = "${e.jid}" class = "chat-head chat-head-chatbox row no-gutters" > < / c o n v e r s e - c h a t - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2021-03-19 19:26:15 +01:00
2023-12-29 14:11:55 +01:00
$ { e . show _help _messages ? nh ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . help _messages }
? hidden = $ { ! e . show _help _messages }
type = "info"
2023-12-29 14:11:55 +01:00
chat _type = "${bl.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< converse - chat - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - c h a t - b o t t o m - p a n e l >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` :""}
< / d i v >
2023-12-29 14:11:55 +01:00
` )(Object.assign({model:this.model,help_messages:this.getHelpMessages(),show_help_messages:this.model.get("show_help_messages")},this.model.toJSON()))}getHelpMessages(){return[ ` < strong > / c l e a r < / s t r o n g > : $ { q y ( " R e m o v e m e s s a g e s " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { q y ( " C l o s e t h i s c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { q y ( " W r i t e i n t h e t h i r d p e r s o n " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { q y ( " S h o w t h i s m e n u " ) } ` ] } a f t e r S h o w n ( ) { t h i s . m o d e l . s e t C h a t S t a t e ( b l . A C T I V E ) , t h i s . m o d e l . c l e a r U n r e a d M s g C o u n t e r ( ) , t h i s . m a y b e F o c u s ( ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t " , M x ) ; v a r R x = n ( 2 ) , D x = { } ; D x . s t y l e T a g T r a n s f o r m = i _ ( ) , D x . s e t A t t r i b u t e s = e _ ( ) , D x . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , D x . d o m A P I = Q y ( ) , D x . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( R x . Z , D x ) ; R x . Z & & R x . Z . l o c a l s & & R x . Z . l o c a l s ; c o n s t { S t r o p h e : z x } = A h . e n v ; A h . p l u g i n s . a d d ( " c o n v e r s e - c h a t v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - c h a t b o x v i e w s " , " c o n v e r s e - c h a t " , " c o n v e r s e - d i s c o " , " c o n v e r s e - m o d a l " ] , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { a l l o w e d _ a u d i o _ d o m a i n s : n u l l , a l l o w e d _ i m a g e _ d o m a i n s : n u l l , a l l o w e d _ v i d e o _ d o m a i n s : n u l l , a u t o _ f o c u s : ! 0 , d e b o u n c e d _ c o n t e n t _ r e n d e r i n g : ! 0 , f i l t e r _ u r l _ q u e r y _ p a r a m s : n u l l , i m a g e _ u r l s _ r e g e x : n u l l , m e s s a g e _ l i m i t : 0 , m u c _ h a t s : [ " x e p 3 1 7 " ] , r e n d e r _ m e d i a : ! 0 , s h o w _ m e s s a g e _ a v a t a r : ! 0 , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , s h o w _ s e n d _ b u t t o n : ! 0 , s h o w _ t o o l b a r : ! 0 , t i m e _ f o r m a t : " H H : m m " , u s e _ s y s t e m _ e m o j i s : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { c a l l : ! 1 , c l e a r : ! 0 , e m o j i : ! 0 , s p o i l e r : ! 0 } } ) , b l . C h a t B o x V i e w = M x , V l . l i s t e n . o n ( " c o n n e c t e d " , ( ( ) = > V l . d i s c o . o w n . f e a t u r e s . a d d ( z x . N S . S P O I L E R ) ) ) , V l . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( e = > { r e t u r n t = e . g e t ( " j i d " ) , v o i d ( b l . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / c h a t ? j i d = $ { t } ` & & b l . r o u t e r . n a v i g a t e ( " " ) ) ; v a r t } ) ) } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - b r a n d - b y l i n e " , c l a s s e x t e n d s G y { r e n d e r ( ) { c o n s t e = " f u l l s c r e e n " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ; r e t u r n n h `
$ { e ? nh `
< p class = "brand-subtitle" > $ { bl . VERSION _NAME } < / p >
2021-11-11 22:06:49 +01:00
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://conversejs.org" > Open Source < / a > X M P P c h a t c l i e n t
brought to you by < a target = "_blank" rel = "nofollow" href = "https://opkode.com" > Opkode < / a >
< / p >
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://hosted.weblate.org/projects/conversejs/#languages"
> Translate < / a
>
it into your own language
< / p >
` :""}
2023-12-29 14:11:55 +01:00
` }});Vl.elements.define("converse-brand-logo",class extends Gy{render(){const e="fullscreen"===Vl.settings.get("view_mode");return nh `
2021-11-11 22:06:49 +01:00
< a class = "brand-heading" href = "https://conversejs.org" target = "_blank" rel = "noopener" >
< span class = "brand-name-wrapper ${e?" brand - name - wrapper -- fullscreen ":" "}" >
< svg
class = "converse-svg-logo"
xmlns : svg = "http://www.w3.org/2000/svg"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364" >
2021-03-19 19:26:15 +01:00
2021-11-11 22:06:49 +01:00
< title > Converse < / t i t l e >
< g class = "cls-1" id = "g904" >
< g data - name = "Layer 2" >
< g data - name = "Layer 7" >
< path
class = "cls-3"
d = "M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z"
/ >
< path
class = "cls-4"
d = "M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z"
/ >
< / g >
2021-03-19 19:26:15 +01:00
< / g >
< / g >
2021-11-11 22:06:49 +01:00
< / s v g >
< span class = "brand-name" >
< span class = "brand-name__text" > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
2023-12-29 14:11:55 +01:00
$ { e ? nh `
2021-11-11 22:06:49 +01:00
< p class = "byline" > messaging freedom < / p >
` :""}
< / s p a n >
2021-03-19 19:26:15 +01:00
< / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2023-12-29 14:11:55 +01:00
` }});Vl.elements.define("converse-brand-heading",class extends Gy{render(){return nh `
2021-11-11 22:06:49 +01:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
< converse - brand - byline > < / c o n v e r s e - b r a n d - b y l i n e >
2023-12-29 14:11:55 +01:00
` }});const{Strophe:Lx}=Ah.env,Px=[Lx.Status.ERROR,Lx.Status.CONNECTING,Lx.Status.CONNFAIL,Lx.Status.AUTHENTICATING,Lx.Status.AUTHFAIL,Lx.Status.DISCONNECTING,Lx.Status.RECONNECTING],Fx=Object.fromEntries([[Lx.Status.ERROR,"Error"],[Lx.Status.CONNECTING,"Connecting"],[Lx.Status.CONNFAIL,"Connection failure"],[Lx.Status.AUTHENTICATING,"Authenticating"],[Lx.Status.AUTHFAIL,"Authentication failure"],[Lx.Status.CONNECTED,"Connected"],[Lx.Status.DISCONNECTED,"Disconnected"],[Lx.Status.DISCONNECTING,"Disconnecting"],[Lx.Status.ATTACHED,"Attached"],[Lx.Status.REDIRECT,"Redirect"],[Lx.Status.CONNTIMEOUT,"Connection timeout"],[Lx.Status.RECONNECTING,"Reconnecting"]]),Ux=Object.fromEntries([[Lx.Status.ERROR,"error"],[Lx.Status.CONNECTING,"info"],[Lx.Status.CONNFAIL,"error"],[Lx.Status.AUTHENTICATING,"info"],[Lx.Status.AUTHFAIL,"error"],[Lx.Status.CONNECTED,"info"],[Lx.Status.DISCONNECTED,"error"],[Lx.Status.DISCONNECTING,"warn"],[Lx.Status.ATTACHED,"info"],[Lx.Status.REDIRECT,"info"],[Lx.Status.RECONNECTING,"warn"]]),Bx=e=>{const t=Vl.settings.get("authentication"),n=qy("Log in"),s=qy("XMPP Address"),i=Vl.settings.get("locked_domain"),r=Vl.settings.get("default_domain"),o=(i||r)&&qy("Username")||qy("user@domain"),a=Vl.settings.get("allow_user_trust_override");return nh `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
2022-05-05 23:06:17 +02:00
< label for = "converse-login-jid" > $ { s } : < / l a b e l >
2023-06-25 15:59:31 +02:00
< input
id = "converse-login-jid"
2023-12-29 14:11:55 +01:00
? autofocus = $ { ! ! Vl . settings . get ( "auto_focus" ) }
2022-04-02 21:20:14 +02:00
@ changed = $ { e . validate }
2023-12-29 14:11:55 +01:00
value = "${Vl.settings.get(" jid ")??" "}"
2021-03-19 19:26:15 +01:00
required
class = "form-control"
type = "text"
name = "jid"
2023-06-25 15:59:31 +02:00
placeholder = "${o}"
/ >
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { t !== lo ? ( ( ) => { const e = qy ( "Password" ) ; return nh `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-password" > $ { e } < / l a b e l >
2023-06-25 15:59:31 +02:00
< input
id = "converse-login-password"
2022-04-02 21:20:14 +02:00
class = "form-control"
required = "required"
2023-12-29 14:11:55 +01:00
value = "${Vl.settings.get(" password ")??" "}"
2022-04-02 21:20:14 +02:00
type = "password"
name = "password"
2023-06-25 15:59:31 +02:00
placeholder = "${e}"
/ >
2021-03-19 19:26:15 +01:00
< / d i v >
` })():""}
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "show_connection_url_input" ) ? ( ( ) => { const e = qy ( "Connection URL" ) , t = qy ( "HTTP or websocket URL that is used to connect to your XMPP server" ) , n = qy ( "e.g. wss://example.org/xmpp-websocket" ) ; return nh `
2022-04-02 21:20:14 +02:00
< div class = "form-group fade-in" >
< label for = "converse-conn-url" > $ { e } < / l a b e l >
< p class = "form-help instructions" > $ { t } < / p >
2023-06-25 15:59:31 +02:00
< input
id = "converse-conn-url"
class = "form-control"
type = "url"
name = "connection-url"
placeholder = "${n}"
/ >
2022-04-02 21:20:14 +02:00
< / d i v >
` })():""}
2023-12-29 14:11:55 +01:00
$ { a ? ( e => { const t = qy ( "To improve performance, we cache your data in this browser. Uncheck this box if this is a public computer or if you want your data to be deleted when you log out. It's important that you explicitly log out, otherwise not all cached data might be deleted. Please note, when using an untrusted device, OMEMO encryption is NOT available." ) , n = qy ( "This is a trusted device" ) ; return nh `
2021-03-19 19:26:15 +01:00
< div class = "form-group form-check login-trusted" >
2023-06-25 15:59:31 +02:00
< input
id = "converse-login-trusted"
type = "checkbox"
class = "form-check-input"
name = "trusted"
? checked = $ { e }
/ >
2021-03-19 19:26:15 +01:00
< label for = "converse-login-trusted" class = "form-check-label login-trusted__desc" > $ { n } < / l a b e l >
2022-12-17 22:08:36 +01:00
2023-06-25 15:59:31 +02:00
< converse - icon
class = "fa fa-info-circle"
data - toggle = "popover"
2021-03-19 19:26:15 +01:00
data - title = "Trusted device?"
2022-12-17 22:08:36 +01:00
data - content = "${t}"
size = "1.2em"
2023-06-25 15:59:31 +02:00
title = "${t}"
> < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-04-02 21:20:14 +02:00
` })("off"!==a):""}
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
2023-06-25 15:59:31 +02:00
< input class = "btn btn-primary" type = "submit" value = "${n}" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "allow_registration" ) && ! Vl . settings . get ( "auto_login" ) && bl . pluggable . plugins [ "converse-register" ] . enabled ( bl ) ? ( ( ) => { const e = qy ( "Create an account" ) , t = qy ( "Don't have a chat account?" ) ; return nh `
2021-03-19 19:26:15 +01:00
< fieldset class = "switch-form" >
< p > $ { t } < / p >
2023-06-25 15:59:31 +02:00
< p >
< a class = "register-account toggle-register-login" href = "#converse/register" > $ { e } < / a >
< / p >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
` })():""}
2023-12-29 14:11:55 +01:00
` },qx=e=>{const t=bl.connfeedback.get("connection_status");let n,s;Px.includes(t)&&(s=Fx[t],n=Ux[t]);const i=bl.connfeedback.get("message");return nh ` < converse - brand - heading > < / c o n v e r s e - b r a n d - h e a d i n g >
2022-05-05 23:06:17 +02:00
< form id = "converse-login" class = "converse-form" method = "post" @ submit = $ { e . onLoginFormSubmitted } >
< div class = "conn-feedback fade-in ${s?n:" hidden "}" >
< p class = "feedback-subject" > $ { s } < / p >
< p class = "feedback-message ${i?" ":" hidden "}" > $ { i } < / p >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { "CONNECTING" === fo [ t ] ? Sb ( { classes : "hor_centered" } ) : ( e => { const t = Vl . settings . get ( "authentication" ) , n = qy ( "Disconnected" ) , s = qy ( "Click here to log in anonymously" ) ; return nh `
$ { t == uo || t == lo ? Bx ( e ) : "" }
$ { t == co ? nh ` <input class="btn btn-primary login-anon" type="submit" value=" ${ s } " /> ` : "" }
$ { t == mo ? nh ` <p> ${ n } </p> ` : "" }
2021-03-19 19:26:15 +01:00
` })(e)}
2023-12-29 14:11:55 +01:00
< / f o r m > ` } , { S t r o p h e : H x , u : G x } = A h . e n v ; f u n c t i o n W x ( ) { c o n s t e = b l . c h a t b o x e s . a d d ( n e w b l . C o n t r o l B o x ( { i d : " c o n t r o l b o x " } ) ) ; r e t u r n b l . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ? . s e t M o d e l ( ) , e } f u n c t i o n V x ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = b l . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | W x ( ) ; G x . s a f e S a v e ( t , { c l o s e d : ! 1 } ) } f u n c t i o n J x ( ) { c o n s t e = b l . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ; r e t u r n e . m o d e l . s e t ( { c o n n e c t e d : ! 1 } ) , e } f u n c t i o n Z x ( ) { c o n s t e = b l ? . c h a t b o x v i e w s , t = e & & e . g e t ( " c o n t r o l b o x " ) ; t & & ( G x . s a f e S a v e ( t . m o d e l , { c o n n e c t e d : ! 1 } ) , t ? . c o n t r o l b o x _ p a n e & & ( t . c o n t r o l b o x _ p a n e . r e m o v e ( ) , d e l e t e t . c o n t r o l b o x _ p a n e ) ) } f u n c t i o n Q x ( ) { ( b l . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | W x ( ) ) . s a v e ( { c o n n e c t e d : ! 0 } ) } c o n s t { S t r o p h e : K x , u : Y x } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - l o g i n - f o r m " , c l a s s e x t e n d s G y { i n i t i a l i z e ( ) { t h i s . l i s t e n T o ( b l . c o n n f e e d b a c k , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . h a n d l e r = ( ) = > t h i s . r e q u e s t U p d a t e ( ) } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , V l . s e t t i n g s . l i s t e n . o n ( " c h a n g e " , t h i s . h a n d l e r ) } d i s c o n n e c t e d C a l l b a c k ( ) { s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) , V l . s e t t i n g s . l i s t e n . n o t ( " c h a n g e " , t h i s . h a n d l e r ) } r e n d e r ( ) { r e t u r n q x ( t h i s ) } f i r s t U p d a t e d ( ) { t h i s . i n i t P o p o v e r s ( ) } a s y n c o n L o g i n F o r m S u b m i t t e d ( e ) { i f ( e ? . p r e v e n t D e f a u l t ( ) , V l . s e t t i n g s . g e t ( " a u t h e n t i c a t i o n " ) = = = c o ) r e t u r n t h i s . c o n n e c t ( b l . j i d ) ; ( f u n c t i o n ( e ) { c o n s t t = e . q u e r y S e l e c t o r ( " i n p u t [ n a m e = j i d ] " ) ; r e t u r n ! t . v a l u e | | V l . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) | | V l . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) | | G x . i s V a l i d J I D ( t . v a l u e ) ? ( t . s e t C u s t o m V a l i d i t y ( " " ) , ! 0 ) : ( t . s e t C u s t o m V a l i d i t y ( q y ( " P l e a s e e n t e r a v a l i d X M P P a d d r e s s " ) ) , ! 1 ) } ) ( e . t a r g e t ) & & ( ! f u n c t i o n ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : { } ; c o n s t n = n e w F o r m D a t a ( e ) , s = n . g e t ( " c o n n e c t i o n - u r l " ) ; s ? . s t a r t s W i t h ( " w s " ) ? t . w e b s o c k e t _ u r l = s : s ? . s t a r t s W i t h ( " h t t p " ) & & ( t . b o s h _ s e r v i c e _ u r l = s ) ; l e t i = n . g e t ( " j i d " ) ; i f ( V l . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) ) { c o n s t e = " @ " + V l . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) ; i . e n d s W i t h ( e ) & & ( i = i . s u b s t r ( 0 , i . l e n g t h - e . l e n g t h ) ) , i = H x . e s c a p e N o d e ( i ) + e } e l s e V l . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) & & ! i . i n c l u d e s ( " @ " ) & & ( i = i + " @ " + V l . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) ) ; t . j i d = i , t . p a s s w o r d = n . g e t ( " p a s s w o r d " ) , V l . s e t t i n g s . s e t ( t ) , b l . c o n f i g . s a v e ( { t r u s t e d : ! ! n . g e t ( " t r u s t e d " ) } ) } ( e . t a r g e t ) , V l . s e t t i n g s . g e t ( " b o s h _ s e r v i c e _ u r l " ) | | V l . s e t t i n g s . g e t ( " w e b s o c k e t _ u r l " ) | | a w a i t t h i s . d i s c o v e r C o n n e c t i o n M e t h o d s ( e ) , V l . s e t t i n g s . g e t ( " b o s h _ s e r v i c e _ u r l " ) | | V l . s e t t i n g s . g e t ( " w e b s o c k e t _ u r l " ) ? t h i s . c o n n e c t ( ) : V l . s e t t i n g s . s e t ( " s h o w _ c o n n e c t i o n _ u r l _ i n p u t " , ! 0 ) ) } d i s c o v e r C o n n e c t i o n M e t h o d s ( e ) { i f ( ! V l . s e t t i n g s . g e t ( " d i s c o v e r _ c o n n e c t i o n _ m e t h o d s " ) ) r e t u r n ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " j i d " ) , n = K x . g e t D o m a i n F r o m J i d ( t ) ; r e t u r n ( ! b l . c o n n e c t i o n ? . j i d | | t & & ! Y x . i s S a m e D o m a i n ( b l . c o n n e c t i o n . j i d , t ) ) & & L l ( ) , b l . c o n n e c t i o n . d i s c o v e r C o n n e c t i o n M e t h o d s ( n ) } i n i t P o p o v e r s ( ) { A r r a y . f r o m ( t h i s . q u e r y S e l e c t o r A l l ( " [ d a t a - t i t l e ] " ) ) . f o r E a c h ( ( e = > { n e w ( c _ ( ) . P o p o v e r ) ( e , { t r i g g e r : " m o b i l e " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ? " c l i c k " : " h o v e r " , d i s m i s s i b l e : " m o b i l e " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , c o n t a i n e r : t h i s . p a r e n t E l e m e n t . p a r e n t E l e m e n t . p a r e n t E l e m e n t } ) } ) ) } c o n n e c t ( e ) { [ " c o n v e r s e / l o g i n " , " c o n v e r s e / r e g i s t e r " ] . i n c l u d e s ( b l . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) ) & & b l . r o u t e r . n a v i g a t e ( " " , { r e p l a c e : ! 0 } ) , b l . c o n n e c t i o n ? . r e s e t ( ) , V l . u s e r . l o g i n ( e ) } } ) ; c o n s t X x = e = > n h ` < c o n v e r s e - i c o n s i z e = " 1 e m " c l a s s = " f a f a - a r r o w - l e f t " @ c l i c k = $ { ( ) = > f u n c t i o n ( e ) { V x ( ) ; c o n s t t = b l . c h a t b o x e s . g e t ( e ) ; G x . s a f e S a v e ( t , { h i d d e n : ! 0 } ) } ( e ) } > < / c o n v e r s e - i c o n > ` ; c l a s s e E e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } r e n d e r ( ) { r e t u r n X x ( t h i s . j i d ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c o n t r o l b o x - n a v b a c k " , e E ) ; c o n s t { d a y j s : t E } = A h . e n v , n E = d r . e x t e n d ( { d e f a u l t s : ( ) = > ( { b o o k m a r k e d : ! 1 , b o x _ i d : " c o n t r o l b o x " , c h a t _ s t a t e : v o i d 0 , c l o s e d : ! V l . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) , n u m _ u n r e a d : 0 , t i m e _ o p e n e d : t E ( 0 ) . v a l u e O f ( ) , t y p e : b l . C O N T R O L B O X _ T Y P E , u r l : " " } ) , v a l i d a t e ( e ) { r e t u r n e . t y p e = = = b l . C O N T R O L B O X _ T Y P E ? " e m b e d d e d " = = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & V l . s e t t i n g s . g e t ( " s i n g l e t o n " ) ? " C o n t r o l b o x n o t r e l e v a n t i n e m b e d d e d v i e w m o d e " : v o i d 0 : b l . C h a t B o x . p r o t o t y p e . v a l i d a t e . c a l l ( t h i s , e ) } , m a y b e S h o w ( e ) { r e t u r n e | | " c o n t r o l b o x " ! = = t h i s . g e t ( " i d " ) ? b l . C h a t B o x . p r o t o t y p e . m a y b e S h o w . c a l l ( t h i s , e ) : t h i s } , o n R e c o n n e c t i o n ( ) { t h i s . s a v e ( " c o n n e c t e d " , ! 0 ) } } ) ; c l a s s s E e x t e n d s G y { a s y n c c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , a w a i t V l . w a i t U n t i l ( " i n i t i a l i z e d " ) , t h i s . m o d e l = b l . c h a t b o x e
2022-05-05 23:06:17 +02:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
< div class = "chat-head controlbox-head" >
2023-12-29 14:11:55 +01:00
$ { n ? "" : nh `
2022-12-17 22:08:36 +01:00
< a class = "chatbox-btn close-chatbox-button" @ click = $ { t => e . close ( t ) } >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2022-05-05 23:06:17 +02:00
` }
2021-11-11 22:06:49 +01:00
< / d i v >
2022-05-05 23:06:17 +02:00
< div class = "controlbox-panes" >
< div class = "controlbox-pane" >
2023-12-29 14:11:55 +01:00
$ { t . connected ? nh `
2022-05-05 23:06:17 +02:00
< converse - user - profile > < / c o n v e r s e - u s e r - p r o f i l e >
2022-12-17 22:08:36 +01:00
< converse - headlines - feeds - list class = "controlbox-section" > < / c o n v e r s e - h e a d l i n e s - f e e d s - l i s t >
< div id = "chatrooms" class = "controlbox-section" > < converse - rooms - list > < / c o n v e r s e - r o o m s - l i s t > < / d i v >
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "authentication" ) === bl . ANONYMOUS ? "" : nh ` <div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div> ` } ` :function(e){const t=bl.connfeedback.get("connection_status");return[rE.Status.RECONNECTING,rE.Status.CONNECTING].includes(t)?Sb():"register"===e["active-form"]?nh ` < converse - register - panel > < / c o n v e r s e - r e g i s t e r - p a n e l > ` : n h ` < c o n v e r s e - l o g i n - f o r m i d = " c o n v e r s e - l o g i n - p a n e l " c l a s s = " c o n t r o l b o x - p a n e f a d e - i n r o w n o - g u t t e r s " > < / c o n v e r s e - l o g i n - f o r m > ` } ( t ) }
2022-05-05 23:06:17 +02:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } , a E = A h . e n v . u t i l s ; c l a s s c E e x t e n d s G y { i n i t i a l i z e ( ) { t h i s . s e t M o d e l ( ) , b l . c h a t b o x v i e w s . a d d ( " c o n t r o l b o x " , t h i s ) , t h i s . m o d e l . g e t ( " c o n n e c t e d " ) & & v o i d 0 = = = t h i s . m o d e l . g e t ( " c l o s e d " ) & & t h i s . m o d e l . s e t ( " c l o s e d " , ! V l . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) ) , t h i s . r e q u e s t U p d a t e ( ) , V l . t r i g g e r ( " c o n t r o l B o x I n i t i a l i z e d " , t h i s ) } s e t M o d e l ( ) { t h i s . m o d e l = b l . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) , t h i s . l i s t e n T o ( b l . c o n n f e e d b a c k , " c h a n g e : c o n n e c t i o n _ s t a t u s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : a c t i v e - f o r m " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c l o s e d " , ( ( ) = > ! t h i s . m o d e l . g e t ( " c l o s e d " ) & & t h i s . a f t e r S h o w n ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? o E ( t h i s ) : " " } c l o s e ( e ) { i f ( e ? . p r e v e n t D e f a u l t ? . ( ) , ( " c l o s e A l l C h a t B o x e s " ! = = e ? . n a m e | | b l . d i s c o n n e c t i o n _ c a u s e = = = h o & & ! V l . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) ) & & ! V l . s e t t i n g s . g e t ( " s t i c k y _ c o n t r o l b o x " ) ) r e t u r n a E . s a f e S a v e ( t h i s . m o d e l , { c l o s e d : ! 0 } ) , V l . t r i g g e r ( " c o n t r o l B o x C l o s e d " , t h i s ) , t h i s } a f t e r S h o w n ( ) { r e t u r n V l . t r i g g e r ( " c o n t r o l B o x O p e n e d " , t h i s ) , t h i s } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c o n t r o l b o x " , c E ) ; c o n s t l E = c E , { u : d E } = A h . e n v , u E = { c o n t r o l b o x : { a s y n c o p e n ( ) { a w a i t V l . w a i t U n t i l ( " c h a t B o x e s F e t c h e d " ) ; c o n s t e = a w a i t V l . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | V l . c h a t b o x e s . c r e a t e ( " c o n t r o l b o x " , { } , b l . C o n t r o l b o x ) ; r e t u r n d E . s a f e S a v e ( e , { c l o s e d : ! 1 } ) , e } , g e t : ( ) = > b l . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) } } ; v a r h E = n ( 9 8 7 0 ) , m E = { } ; m E . s t y l e T a g T r a n s f o r m = i _ ( ) , m E . s e t A t t r i b u t e s = e _ ( ) , m E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , m E . d o m A P I = Q y ( ) , m E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( h E . Z , m E ) ; h E . Z & & h E . Z . l o c a l s & & h E . Z . l o c a l s ; v a r f E = n ( 4 9 3 7 ) , g E = { } ; g E . s t y l e T a g T r a n s f o r m = i _ ( ) , g E . s e t A t t r i b u t e s = e _ ( ) , g E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , g E . d o m A P I = Q y ( ) , g E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( f E . Z , g E ) ; f E . Z & & f E . Z . l o c a l s & & f E . Z . l o c a l s ; A h . p l u g i n s . a d d ( " c o n v e r s e - c o n t r o l b o x " , { d e p e n d e n c i e s : [ " c o n v e r s e - m o d a l " , " c o n v e r s e - c h a t b o x e s " , " c o n v e r s e - c h a t " , " c o n v e r s e - r o s t e r v i e w " , " c o n v e r s e - c h a t v i e w " ] , e n a b l e d : e = > ! e . a p i . s e t t i n g s . g e t ( " s i n g l e t o n " ) , o v e r r i d e s : { C h a t B o x e s : { m o d e l ( e , t ) { r e t u r n e & & " c o n t r o l b o x " = = e . i d ? n e w n E ( e , t ) : t h i s . _ _ s u p e r _ _ . m o d e l . a p p l y ( t h i s , a r g u m e n t s ) } } } , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { a l l o w _ l o g o u t : ! 0 , a l l o w _ u s e r _ t r u s t _ o v e r r i d e : ! 0 , d e f a u l t _ d o m a i n : v o i d 0 , l o c k e d _ d o m a i n : v o i d 0 , s h o w _ c o n n e c t i o n _ u r l _ i n p u t : ! 1 , s h o w _ c o n t r o l b o x _ b y _ d e f a u l t : ! 1 , s t i c k y _ c o n t r o l b o x : ! 1 } ) , V l . p r o m i s e s . a d d ( " c o n t r o l B o x I n i t i a l i z e d " , ! 1 ) , O b j e c t . a s s i g n ( V l , u E ) , b l . C o n t r o l B o x V i e w = l E , b l . C o n t r o l B o x = n E , b l . C o n t r o l B o x T o g g l e = i E , V l . l i s t e n . o n ( " c h a t B o x e s F e t c h e d " , Q x ) , V l . l i s t e n . o n ( " c l e a r S e s s i o n " , Z x ) , V l . l i s t e n . o n ( " w i l l - r e c o n n e c t " , J x ) , V l . w a i t U n t i l ( " c h a t B o x V i e w s I n i t i a l i z e d " ) . t h e n ( W x ) . c a t c h ( ( e = > Y c . f a t a l ( e ) ) ) } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - h e a d l i n e s - h e a d i n g " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = b l . c h a t b o x e s . g e t ( t h i s . j i d ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n ( e = > n h `
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2023-12-29 14:11:55 +01:00
$ { bl . api . settings . get ( "singleton" ) ? "" : nh ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" > $ { e . display _name } < / d i v >
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2023-12-29 14:11:55 +01:00
$ { Wb ( fS ( e . heading _buttons _promise ) , "" ) }
$ { Wb ( mS ( e . heading _buttons _promise ) , "" ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . status ? nh ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` )({...this.model.toJSON(),display_name:this.model.getDisplayName(),heading_buttons_promise:this.getHeadingButtons()})}getHeadingButtons(){const e=[];return Vl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:qy("Close"),i18n_title:qy("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Vl.settings.get("view_mode")}),bl.api.hook("getHeadingButtons",this,e)}close(e){e.preventDefault(),this.model.close()}});Vl.elements.define("converse-headlines",class extends Ox{async initialize(){bl.chatboxviews.add(this.jid,this),this.model=bl.chatboxes.get(this.jid),this.model.disable_mam=!0,this.listenTo(bl,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>this.afterShown())),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model.messages,"add",(()=>this.requestUpdate())),this.listenTo(this.model.messages,"remove",(()=>this.requestUpdate())),this.listenTo(this.model.messages,"reset",(()=>this.requestUpdate())),await this.model.messages.fetched,this.model.maybeShow(),Vl.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>nh `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-12-29 14:11:55 +01:00
$ { e ? nh `
2021-11-11 22:06:49 +01:00
< converse - headlines - heading jid = "${e.get(" jid ")}" class = "chat-head chat-head-chatbox row no-gutters" >
< / c o n v e r s e - h e a d l i n e s - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.get(" jid ")}" > < / c o n v e r s e - c h a t - c o n t e n t >
< / d i v >
< / d i v > ` : " " }
< / d i v >
2023-12-29 14:11:55 +01:00
` )(this.model)}async close(e){return e?.preventDefault?.(),bl.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&bl.router.navigate(""),await this.model.close(e),this}getNotifications(){return[]}afterShown(){this.model.clearUnreadMsgCounter()}});const pE=e=>{const t=e.model.filter((e=>e.get("type")===bl.HEADLINES_TYPE)),n=qy("Announcements");return nh `
2022-12-17 22:08:36 +01:00
< div class = "controlbox-section" id = "headline" >
< div class = "d-flex controlbox-padded ${t.length?" ":" hidden "}" >
< span class = "w-100 controlbox-heading controlbox-heading--headline" > $ { n } < / s p a n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-05-05 23:06:17 +02:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "list-container list-container--headline ${t.length?" ":" hidden "}" >
< div class = "items-list rooms-list headline-list" >
2023-12-29 14:11:55 +01:00
$ { t . map ( ( t => function ( e , t ) { const n = qy ( "Click to open this server message" ) ; return nh `
2022-12-17 22:08:36 +01:00
< div class = "list-item controlbox-padded d-flex flex-row"
data - headline - jid = "${t.get(" jid ")}" >
< a class = "list-item-link open-headline available-room w-100"
data - headline - jid = "${t.get(" jid ")}"
title = "${n}"
@ click = $ { t => e . openHeadline ( t ) }
href = "#" > $ { t . get ( "jid" ) } < / a >
< / d i v >
2023-02-17 12:24:37 +01:00
` }(e,t)))}
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ; c l a s s v E e x t e n d s G y { i n i t i a l i z e ( ) { t h i s . m o d e l = b l . c h a t b o x e s , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " r e m o v e " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " d e s t r o y " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n p E ( t h i s ) } r e n d e r I f H e a d l i n e ( e ) { r e t u r n e ? . g e t ( " t y p e " ) = = = b l . H E A D L I N E S _ T Y P E & & t h i s . r e q u e s t U p d a t e ( ) } a s y n c o p e n H e a d l i n e ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - h e a d l i n e - j i d " ) ; ( a w a i t V l . h e a d l i n e s . g e t ( t ) ) . m a y b e S h o w ( ! 0 ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - h e a d l i n e s - f e e d s - l i s t " , v E ) ; v a r y E = n ( 2 8 4 6 ) , _ E = { } ; _ E . s t y l e T a g T r a n s f o r m = i _ ( ) , _ E . s e t A t t r i b u t e s = e _ ( ) , _ E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , _ E . d o m A P I = Q y ( ) , _ E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( y E . Z , _ E ) ; y E . Z & & y E . Z . l o c a l s & & y E . Z . l o c a l s ; v a r b E = n ( 3 8 0 6 ) , w E = { } ; w E . s t y l e T a g T r a n s f o r m = i _ ( ) , w E . s e t A t t r i b u t e s = e _ ( ) , w E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , w E . d o m A P I = Q y ( ) , w E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( b E . Z , w E ) ; b E . Z & & b E . Z . l o c a l s & & b E . Z . l o c a l s ; A h . p l u g i n s . a d d ( " c o n v e r s e - h e a d l i n e s - v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - h e a d l i n e s " , " c o n v e r s e - c h a t v i e w " ] , i n i t i a l i z e ( ) { b l . H e a d l i n e s F e e d s L i s t = v E , b l . H e a d l i n e s P a n e l = v E } } ) ; v a r S E = n ( 7 0 3 8 ) , x E = { } ; x E . s t y l e T a g T r a n s f o r m = i _ ( ) , x E . s e t A t t r i b u t e s = e _ ( ) , x E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , x E . d o m A P I = Q y ( ) , x E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( S E . Z , x E ) ; S E . Z & & S E . Z . l o c a l s & & S E . Z . l o c a l s ; f u n c t i o n E E ( e , t ) { r e t u r n e i n s t a n c e o f _ p ? n h ` < c o n v e r s e - m a m - p l a c e h o l d e r . m o d e l = $ { e } > < / c o n v e r s e - m a m - p l a c e h o l d e r > ` : t } a s y n c f u n c t i o n A E ( e ) { i f ( ! e . m o d e l . u i . g e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " ) & & e . m o d e l . m e s s a g e s . l e n g t h ) { c o n s t t = e . m o d e l . g e t ( " t y p e " ) = = = b l . C H A T R O O M S _ T Y P E , n = e . m o d e l . g e t O l d e s t M e s s a g e ( ) ; i f ( n ) { c o n s t s = t ? e . m o d e l . g e t ( " j i d " ) : b l . b a r e _ j i d , i = n & & n . g e t ( ` s t a n z a _ i d $ { s } ` ) ; e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 0 ) ; t r y { i ? a w a i t H p ( e . m o d e l , { b e f o r e : i } ) : a w a i t H p ( e . m o d e l , { e n d : n . g e t ( " t i m e " ) } ) } c a t c h ( t ) { r e t u r n Y c . e r r o r ( t ) , v o i d e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) } V l . s e t t i n g s . g e t ( " a l l o w _ u r l _ h i s t o r y _ c h a n g e " ) & & b l . r o u t e r . h i s t o r y . n a v i g a t e ( ` # $ { n . g e t ( " m s g i d " ) } ` ) , s e t T i m e o u t ( ( ( ) = > e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) ) , 2 5 0 ) } } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m a m - p l a c e h o l d e r " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } } } r e n d e r ( ) { r e t u r n ( e = t h i s ) . m o d e l . g e t ( " f e t c h i n g " ) ? S b ( { c l a s s e s : " h o r _ c e n t e r e d " } ) : n h ` < a @ c l i c k = " $ { t = > e . f e t c h M i s s i n g M e s s a g e s ( t ) } " t i t l e = " $ { q y ( " C l i c k t o l o a d m i s s i n g m e s s a g e s " ) } " >
2022-12-17 22:08:36 +01:00
< div class = "message mam-placeholder" > < / d i v >
2023-12-29 14:11:55 +01:00
< / a > ` ; v a r e } a s y n c f e t c h M i s s i n g M e s s a g e s ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , t h i s . m o d e l . s e t ( " f e t c h i n g " , ! 0 ) ; c o n s t t = { b e f o r e : t h i s . m o d e l . g e t ( " b e f o r e " ) , s t a r t : t h i s . m o d e l . g e t ( " s t a r t " ) } ; a w a i t H p ( t h i s . m o d e l . c o l l e c t i o n . c h a t b o x , t ) , t h i s . m o d e l . d e s t r o y ( ) } } ) , A h . p l u g i n s . a d d ( " c o n v e r s e - m a m - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m a m " , " c o n v e r s e - c h a t v i e w " , " c o n v e r s e - m u c - v i e w s " ] , i n i t i a l i z e ( ) { V l . l i s t e n . o n ( " c h a t B o x S c r o l l e d U p " , A E ) , V l . l i s t e n . o n ( " g e t M e s s a g e T e m p l a t e " , E E ) } } ) ; c o n s t { S t r o p h e : C E , s i z z l e : $ E } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - a f f i l i a t i o n - f o r m " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m u c : { t y p e : O b j e c t } , j i d : { t y p e : S t r i n g } , a f f i l i a t i o n : { t y p e : S t r i n g } , a l e r t _ m e s s a g e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ t y p e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } } } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = q y ( " C h a n g e a f f i l i a t i o n " ) , n = q y ( " N e w a f f i l i a t i o n " ) , s = q y ( " R e a s o n " ) , i = B f ( e . m u c . g e t O w n O c c u p a n t ( ) ) ; r e t u r n n h `
2023-06-25 15:59:31 +02:00
< form class = "affiliation-form" @ submit = $ { t => e . assignAffiliation ( t ) } >
2023-12-29 14:11:55 +01:00
$ { e . alert _message ? nh ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
2023-06-25 15:59:31 +02:00
< div class = "form-group" >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
< select class = "custom-select select-affiliation" name = "affiliation" >
2023-12-29 14:11:55 +01:00
$ { i . map ( ( t => nh ` <option value=" ${ t } " ?selected= ${ t === e . affiliation } > ${ t } </option> ` ) ) }
2023-06-25 15:59:31 +02:00
< / s e l e c t >
< / d i v >
< div class = "col" >
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "change" value = "${t}" / >
< / d i v >
< / d i v >
< / f o r m >
2023-12-29 14:11:55 +01:00
` })(this)}alert(e,t){this.alert_message=e,this.alert_type=t}async assignAffiliation(e){e.stopPropagation(),e.preventDefault(),this.alert();const t=new FormData(e.target),n=t.get("affiliation"),s={jid:this.jid,reason:t.get("reason")},i=this.muc.get("jid");try{await Hf(n,i,[s])}catch(e){return null===e?this.alert(qy("Timeout error while trying to set the affiliation"),"danger"): $ E( ` not - allowed [ xmlns = "${CE.NS.STANZAS}" ] ` ,e).length?this.alert(qy("Sorry, you're not allowed to make that change"),"danger"):this.alert(qy("Sorry, something went wrong while trying to set the affiliation"),"danger"),void Yc.error(e)}await this.muc.occupants.fetchMembers();const r=new CustomEvent("affiliationChanged",{bubbles:!0});this.dispatchEvent(r)}});const{Strophe:kE,sizzle:jE}=Ah.env;Vl.elements.define("converse-muc-role-form",class extends Gy{static get properties(){return{muc:{type:Object},jid:{type:String},role:{type:String},alert_message:{type:String,attribute:!1},alert_type:{type:String,attribute:!1}}}render(){return(e=>{const t=qy("Change role"),n=qy("New Role"),s=qy("Reason"),i=ag(e.muc.getOwnOccupant());return nh `
2023-06-25 15:59:31 +02:00
< form class = "role-form" @ submit = $ { e . assignRole } >
< div class = "form-group" >
< input type = "hidden" name = "jid" value = "${e.jid}" / >
< input type = "hidden" name = "nick" value = "${e.nick}" / >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
< select class = "custom-select select-role" name = "role" >
2023-12-29 14:11:55 +01:00
$ { i . map ( ( t => nh ` <option value=" ${ t } " ?selected= ${ t === e . role } > ${ t } </option> ` ) ) }
2023-06-25 15:59:31 +02:00
< / s e l e c t >
< / d i v >
< div class = "col" >
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
< div class = "col" >
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
< / d i v >
< / d i v >
< / f o r m >
2023-12-29 14:11:55 +01:00
` })(this)}alert(e,t){this.alert_message=e,this.alert_type=t}assignRole(e){e.stopPropagation(),e.preventDefault(),this.alert();const t=new FormData(e.target),n=this.muc.getOccupant(t.get("jid")||t.get("nick")),s=t.get("role"),i=t.get("reason");this.muc.setRole(n,s,i,(()=>{const e=new CustomEvent("roleChanged",{bubbles:!0});this.dispatchEvent(e)}),(e=>{jE( ` not - allowed [ xmlns = "${kE.NS.STANZAS}" ] ` ,e).length?this.alert(qy("You're not allowed to make that change"),"danger"):(this.alert(qy("Sorry, something went wrong while trying to set the role"),"danger"),Pc(e)&&Yc.error(e))}))}});Vl.elements.define("converse-muc-message-form",class extends jx{async connectedCallback(){super.connectedCallback(),await this.model.initialized}toHTML(){return(e=>{const t=e.composing_spoiler?qy("Hidden message"):qy("Message"),n=qy("Optional hint"),s=Vl.settings.get("show_send_button");return nh `
2021-11-11 22:06:49 +01:00
< form class = "setNicknameButtonForm hidden" >
< input type = "submit" class = "btn btn-primary" name = "join" value = "Join" / >
< / f o r m >
< form class = "sendXMPPMessage" >
< input type = "text" placeholder = "${n||" "}" value = "${e.hint_value||" "}" class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
< div class = "suggestion-box" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< textarea
autofocus
type = "text"
@ drop = $ { e . onDrop }
2023-12-29 14:11:55 +01:00
@ input = $ { $x }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea suggestion - box _ _input
2022-05-05 23:06:17 +02:00
$ { s ? "chat-textarea-send-button" : "" }
2021-11-11 22:06:49 +01:00
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
2023-12-29 14:11:55 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { h i n t _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . s p o i l e r - h i n t " ) ? . v a l u e , m e s s a g e _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ? . v a l u e , o n C h a n g e : e = > t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) , o n D r o p : e = > t h i s . o n D r o p ( e ) , o n K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n K e y U p : e = > t h i s . o n K e y U p ( e ) , o n P a s t e : e = > t h i s . o n P a s t e ( e ) , s c r o l l e d : t h i s . m o d e l . u i . g e t ( " s c r o l l e d " ) , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) ) } a f t e r R e n d e r ( ) { c o n s t e = t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = A h . R O O M S T A T U S . E N T E R E D , t = e & & ! ( t h i s . m o d e l . f e a t u r e s . g e t ( " m o d e r a t e d " ) & & " v i s i t o r " = = = t h i s . m o d e l . g e t O w n R o l e ( ) ) ; e & & t & & t h i s . i n i t M e n t i o n A u t o C o m p l e t e ( ) } i n i t M e n t i o n A u t o C o m p l e t e ( ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e = n e w b l . A u t o C o m p l e t e ( t h i s , { a u t o _ f i r s t : ! 0 , a u t o _ e v a l u a t e : ! 1 , m i n _ c h a r s : V l . s e t t i n g s . g e t ( " m u c _ m e n t i o n _ a u t o c o m p l e t e _ m i n _ c h a r s " ) , m a t c h _ c u r r e n t _ w o r d : ! 0 , l i s t : ( ) = > t h i s . g e t A u t o C o m p l e t e L i s t ( ) , f i l t e r : " c o n t a i n s " = = V l . s e t t i n g s . g e t ( " m u c _ m e n t i o n _ a u t o c o m p l e t e _ f i l t e r " ) ? b l . F I L T E R _ C O N T A I N S : b l . F I L T E R _ S T A R T S W I T H , a c _ t r i g g e r s : [ " T a b " , " @ " ] , i n c l u d e _ t r i g g e r s : [ ] , i t e m : l w } ) , t h i s . m e n t i o n _ a u t o _ c o m p l e t e . o n ( " s u g g e s t i o n - b o x - s e l e c t c o m p l e t e " , ( ( ) = > t h i s . a u t o _ c o m p l e t i n g = ! 1 ) ) } g e t A u t o C o m p l e t e L i s t ( ) { r e t u r n t h i s . m o d e l . g e t A l l K n o w n N i c k n a m e s ( ) . m a p ( ( e = > ( { l a b e l : e , v a l u e : ` @ $ { e } ` } ) ) ) } o n K e y D o w n ( e ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e . o n K e y D o w n ( e ) | | s u p e r . o n K e y D o w n ( e ) } o n K e y U p ( e ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e . e v a l u a t e ( e ) , s u p e r . o n K e y U p ( e ) } } ) ; v a r T E = n ( 9 5 9 2 ) , I E = { } ; I E . s t y l e T a g T r a n s f o r m = i _ ( ) , I E . s e t A t t r i b u t e s = e _ ( ) , I E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , I E . d o m A P I = Q y ( ) , I E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( T E . Z , I E ) ; T E . Z & & T E . Z . l o c a l s & & T E . Z . l o c a l s ; c l a s s N E e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . m o d e l = b l . c h a t b o x e s . g e t ( t h i s . j i d ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = q y ( " N i c k n a m e " ) , n = e . m o d e l ? . i s E n t e r e d ( ) ? q y ( " C h a n g e n i c k n a m e " ) : q y ( " E n t e r g r o u p c h a t " ) , s = V l . s e t t i n g s . g e t ( " m u c _ s h o w _ l o g s _ b e f o r e _ j o i n " ) ? q y ( " C h o o s e a n i c k n a m e t o e n t e r " ) : q y ( " P l e a s e c h o o s e y o u r n i c k n a m e " ) , i = e . m o d e l ? . g e t ( " n i c k n a m e _ v a l i d a t i o n _ m e s s a g e " ) ; r e t u r n n h `
2022-12-17 22:08:36 +01:00
< div class = "chatroom-form-container muc-nickname-form" >
< form class = "converse-form chatroom-form converse-centered-form"
@ submit = $ { t => e . submitNickname ( t ) } >
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label > $ { s } < / l a b e l >
< p class = "validation-message" > $ { i } < / p >
2021-11-11 22:06:49 +01:00
< input type = "text"
required = "required"
name = "nick"
2023-01-07 22:34:35 +01:00
value = "${e.model?.get(" nick ")||" "}"
class = "form-control ${i?" error ":" "}"
placeholder = "${t}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2022-12-17 22:08:36 +01:00
< input type = "submit"
class = "btn btn-primary"
name = "join"
2023-01-07 22:34:35 +01:00
value = "${n}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< / f o r m >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ) ( t h i s ) } s u b m i t N i c k n a m e ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . n i c k . v a l u e . t r i m ( ) ; t & & ( t h i s . m o d e l . i s E n t e r e d ( ) ? ( t h i s . m o d e l . s e t N i c k n a m e ( t ) , t h i s . c l o s e M o d a l ( ) ) : t h i s . m o d e l . j o i n ( t ) ) } c l o s e M o d a l ( ) { c o n s t e = d o c u m e n t . c r e a t e E v e n t ( " E v e n t " ) ; e . i n i t E v e n t ( " h i d e . b s . m o d a l " , ! 0 , ! 0 ) , t h i s . d i s p a t c h E v e n t ( e ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - n i c k n a m e - f o r m " , N E ) ; c o n s t O E = e = > { c o n s t t = q y ( " Y o u h a v e u n r e a d m e s s a g e s " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) , s = q y ( " Y o u ' r e n o t a l l o w e d t o s e n d m e s s a g e s i n t h i s r o o m " ) ; r e t u r n n = = = A h . R O O M S T A T U S . E N T E R E D ? n h `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread_general" ) ? nh ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { e . can _edit ? ( e => { const t = qy ( "You have unread messages" ) , n = Vl . settings . get ( "message_limit" ) , s = Vl . settings . get ( "visible_toolbar_buttons" ) . call , i = Vl . settings . get ( "visible_toolbar_buttons" ) . emoji , r = Vl . settings . get ( "show_send_button" ) , o = Vl . settings . get ( "visible_toolbar_buttons" ) . spoiler , a = Vl . settings . get ( "show_toolbar" ) ; return nh `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? nh ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { a ? nh `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? hidden _occupants = "${e.model.get(" hidden _occupants ")}"
? is _groupchat = "${e.is_groupchat}"
2022-05-05 23:06:17 +02:00
? show _call _button = "${s}"
? show _emoji _button = "${i}"
2022-12-17 22:08:36 +01:00
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
2021-11-11 22:06:49 +01:00
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
2023-12-29 14:11:55 +01:00
< converse - muc - message - form jid = $ { e . model . get ( "jid" ) } > < / c o n v e r s e - m u c - m e s s a g e - f o r m > ` } ) ( e ) : n h ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - m u t e d " > $ { s } < / s p a n > ` } ` : n ! = A h . R O O M S T A T U S . N I C K N A M E _ R E Q U I R E D ? " " : V l . s e t t i n g s . g e t ( " m u c _ s h o w _ l o g s _ b e f o r e _ j o i n " ) ? n h ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - n i c k n a m e " >
2022-04-02 21:20:14 +02:00
< converse - muc - nickname - form jid = "${e.model.get(" jid ")}" > < / c o n v e r s e - m u c - n i c k n a m e - f o r m >
2023-12-29 14:11:55 +01:00
< / s p a n > ` : v o i d 0 } ; v a r M E = n ( 3 7 7 4 ) , R E = { } ; R E . s t y l e T a g T r a n s f o r m = i _ ( ) , R E . s e t A t t r i b u t e s = e _ ( ) , R E . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , R E . d o m A P I = Q y ( ) , R E . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( M E . Z , R E ) ; M E . Z & & M E . Z . l o c a l s & & M E . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - b o t t o m - p a n e l " , c l a s s e x t e n d s N x { e v e n t s = { " c l i c k . h i d e - o c c u p a n t s " : " h i d e O c c u p a n t s " , " c l i c k . s e n d - b u t t o n " : " s e n d B u t t o n C l i c k e d " } ; a s y n c i n i t i a l i z e ( ) { a w a i t s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n _ o c c u p a n t s " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d _ g e n e r a l " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : m o d e r a t e d " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " a d d " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e : r o l e " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n n e c t i o n _ s t a t u s " , t h i s . d e b o u n c e d R e n d e r ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = A h . R O O M S T A T U S . E N T E R E D , t = e & & ! ( t h i s . m o d e l . f e a t u r e s . g e t ( " m o d e r a t e d " ) & & " v i s i t o r " = = = t h i s . m o d e l . g e t O w n R o l e ( ) ) ; b h ( O E ( { c a n _ e d i t : t , e n t e r e d : e , m o d e l : t h i s . m o d e l , i s _ g r o u p c h a t : ! 0 , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) , t h i s ) } r e n d e r I f O w n O c c u p a n t ( e ) { e . g e t ( " j i d " ) = = = b l . b a r e _ j i d & & t h i s . d e b o u n c e d R e n d e r ( ) } s e n d B u t t o n C l i c k e d ( e ) { t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - m e s s a g e - f o r m " ) ? . o n F o r m S u b m i t t e d ( e ) } h i d e O c c u p a n t s ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , e ? . s t o p P r o p a g a t i o n ? . ( ) , t h i s . m o d e l . s a v e ( { h i d d e n _ o c c u p a n t s : ! 0 } ) } } ) ; c o n s t D E = { o f f l i n e : " O f f l i n e " , u n a v a i l a b l e : " U n a v a i l a b l e " , x a : " E x t e n d e d A w a y " , a w a y : " A w a y " , d n d : " D o n o t d i s t u r b " , c h a t : " C h a t t t y " , o n l i n e : " O n l i n e " } , z E = e = > { c o n s t t = e . g e t ( " r o l e " ) , n = ( e = > q y ( " C l i c k t o m e n t i o n % 1 $ s i n y o u r m e s s a g e . " , e . g e t ( " n i c k " ) ) ) ( e ) , s = q y ( " T h i s u s e r i s a m o d e r a t o r . " ) , i = q y ( " T h i s u s e r c a n s e n d m e s s a g e s i n t h i s g r o u p c h a t . " ) , r = q y ( " T h i s u s e r c a n N O T s e n d m e s s a g e s i n t h i s g r o u p c h a t . " ) , o = e . g e t ( " j i d " ) ? ` $ { e . g e t ( " j i d " ) } ` : " " ; r e t u r n " m o d e r a t o r " = = = t ? ` $ { o } $ { s } $ { n } ` : " p a r t i c i p a n t " = = = t ? ` $ { o } $ { i } $ { n } ` : " v i s i t o r " = = = t ? ` $ { o } $ { r } $ { n } ` : [ " v i s i t o r " , " p a r t i c i p a n t " , " m o d e r a t o r " ] . i n c l u d e s ( t ) ? v o i d 0 : ` $ { o } $ { n } ` } , L E = ( e , t ) = > { c o n s t n = e . g e t ( " a f f i l i a t i o n " ) , s = D E [ e . g e t ( " s h o w " ) ] , i = q y ( " A d m i n " ) , r = q y ( " M e m b e r " ) , o = q y ( " M o d e r a t o r " ) , a = q y ( " O w n e r " ) , c = q y ( " V i s i t o r " ) , l = e . g e t ( " r o l e " ) , d = e . g e t ( " s h o w " ) ; l e t u , h ; r e t u r n [ u , h ] = " o n l i n e " = = = d ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = d ? [ " f a f a - m i n u s - c i r c l e " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = d ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e " , " s u b d u e d - c o l o r " ] , n h `
< li class = "occupant" id = "${e.id}" title = "${zE(e)}" >
2021-11-11 22:06:49 +01:00
< div class = "row no-gutters" >
< div class = "col-auto" >
2023-12-29 14:11:55 +01:00
< a class = "show-msg-author-modal" @ click = $ { t => function ( e , t ) { Vl . modal . show ( "converse-muc-occupant-modal" , { model : t } , e ) } ( t , e ) } >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar chat-msg__avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . vcard ? . attributes }
nonce = $ { e . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
2023-01-07 22:34:35 +01:00
title = "${s}"
color = "var(--${h})"
2022-01-03 11:54:10 +01:00
style = "margin-top: -0.1em"
size = "0.82em"
2023-01-07 22:34:35 +01:00
class = "${u} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< / a >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "col occupant-nick-badge" >
2022-01-03 11:54:10 +01:00
< span class = "occupant-nick" @ click = $ { t . onOccupantClicked } > $ { e . getDisplayName ( ) } < / s p a n >
2021-11-11 22:06:49 +01:00
< span class = "occupant-badges" >
2023-12-29 14:11:55 +01:00
$ { "owner" === n ? nh ` <span class="badge badge-groupchat"> ${ a } </span> ` : "" }
$ { "admin" === n ? nh ` <span class="badge badge-info"> ${ i } </span> ` : "" }
$ { "member" === n ? nh ` <span class="badge badge-info"> ${ r } </span> ` : "" }
$ { "moderator" === l ? nh ` <span class="badge badge-info"> ${ o } </span> ` : "" }
$ { "visitor" === l ? nh ` <span class="badge badge-secondary"> ${ c } </span> ` : "" }
2021-11-11 22:06:49 +01:00
< / s p a n >
< / d i v >
< / d i v >
< / l i >
2023-12-29 14:11:55 +01:00
` };var PE=n(6305),FE={};FE.styleTagTransform=i_(),FE.setAttributes=e_(),FE.insert=Yy().bind(null,"head"),FE.domAPI=Qy(),FE.insertStyleElement=n_();Jy()(PE.Z,FE);PE.Z&&PE.Z.locals&&PE.Z.locals;var UE=n(3284),BE={};BE.styleTagTransform=i_(),BE.setAttributes=e_(),BE.insert=Yy().bind(null,"head"),BE.domAPI=Qy(),BE.insertStyleElement=n_();Jy()(UE.Z,BE);UE.Z&&UE.Z.locals&&UE.Z.locals;const{u:qE}=Ah.env;Vl.elements.define("converse-muc-sidebar",class extends Gy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=bl.chatboxes.get(this.jid),this.listenTo(this.model.occupants,"add",(()=>this.requestUpdate())),this.listenTo(this.model.occupants,"remove",(()=>this.requestUpdate())),this.listenTo(this.model.occupants,"change",(()=>this.requestUpdate())),this.listenTo(this.model.occupants,"vcard:change",(()=>this.requestUpdate())),this.listenTo(this.model.occupants,"vcard:add",(()=>this.requestUpdate())),this.model.initialized.then((()=>this.requestUpdate()))}render(){const e=(e=>{const t=1===e.occupants.length?qy("Participant"):qy("Participants");return nh `
2021-11-11 22:06:49 +01:00
< div class = "occupants-header" >
< div class = "occupants-header--title" >
2022-05-05 23:06:17 +02:00
< span class = "occupants-heading" > $ { e . occupants . length } $ { t } < / s p a n >
2022-04-02 21:20:14 +02:00
< i class = "hide-occupants" @ click = $ { e . closeSidebar } >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
< / i >
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
< div class = "dragresize dragresize-occupants-left" > < / d i v >
2023-12-29 14:11:55 +01:00
< ul class = "occupant-list" > $ { Mw ( e . occupants , ( e => e . get ( "jid" ) ) , ( t => LE ( t , e ) ) ) } < / u l >
` })(Object.assign(this.model.toJSON(),{occupants:[...this.model.occupants.models],closeSidebar:e=>this.closeSidebar(e),onOccupantClicked:e=>this.onOccupantClicked(e)}));return e}closeSidebar(e){e?.preventDefault?.(),e?.stopPropagation?.(),qE.safeSave(this.model,{hidden_occupants:!0})}onOccupantClicked(e){e?.preventDefault?.();const t=bl.chatboxviews.get(this.getAttribute("jid"));t?.getMessageForm().insertIntoTextArea( ` @ $ { e . target . textContent } ` )}});const{u:HE}=Ah.env;Vl.elements.define("converse-muc-chatarea",class extends Gy{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}async initialize(){this.model=await Vl.rooms.get(this.jid),this.listenTo(this.model,"change:show_help_messages",(()=>this.requestUpdate())),this.listenTo(this.model,"change:hidden_occupants",(()=>this.requestUpdate())),this.listenTo(this.model.session,"change:connection_status",(()=>this.requestUpdate())),this.onMouseMove=this._onMouseMove.bind(this),this.onMouseUp=this._onMouseUp.bind(this),this.requestUpdate()}render(){return(e=>nh `
2021-11-11 22:06:49 +01:00
< div class = "chat-area" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2023-12-29 14:11:55 +01:00
$ { e . model ? . get ( "show_help_messages" ) ? nh ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . getHelpMessages ( ) }
type = "info"
2023-12-29 14:11:55 +01:00
chat _type = "${bl.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
< / d i v >
< converse - muc - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - m u c - b o t t o m - p a n e l >
< / d i v >
< div class = "disconnect-container hidden" > < / d i v >
2023-12-29 14:11:55 +01:00
$ { e . model ? nh `
2021-11-11 22:06:49 +01:00
< converse - muc - sidebar
class = "occupants col-md-3 col-4 ${e.shouldShowSidebar()?" ":" hidden "}"
style = "flex: 0 0 ${e.model.get(" occupants _width ")}px"
jid = $ { e . jid }
@ mousedown = $ { e . onMousedown } > < / c o n v e r s e - m u c - s i d e b a r > ` : " " }
2023-12-29 14:11:55 +01:00
` )({getHelpMessages:()=>this.getHelpMessages(),jid:this.jid,model:this.model,onMousedown:e=>this.onMousedown(e),show_send_button:Vl.settings.get("show_send_button"),shouldShowSidebar:()=>this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")===Ah.ROOMSTATUS.ENTERED}getHelpMessages(){const e=Vl.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return[ ` < strong > / a d m i n < / s t r o n g > : $ { q y ( " C h a n g e u s e r ' s a f f i l i a t i o n t o a d m i n " ) } ` , ` < s t r o n g > / b a n < / s t r o n g > : $ { q y ( " B a n u s e r b y c h a n g i n g t h e i r a f f i l i a t i o n t o o u t c a s t " ) } ` , ` < s t r o n g > / c l e a r < / s t r o n g > : $ { q y ( " C l e a r t h e c h a t a r e a " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { q y ( " C l o s e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / d e o p < / s t r o n g > : $ { q y ( " C h a n g e u s e r r o l e t o p a r t i c i p a n t " ) } ` , ` < s t r o n g > / d e s t r o y < / s t r o n g > : $ { q y ( " R e m o v e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { q y ( " S h o w t h i s m e n u " ) } ` , ` < s t r o n g > / k i c k < / s t r o n g > : $ { q y ( " K i c k u s e r f r o m g r o u p c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { q y ( " W r i t e i n 3 r d p e r s o n " ) } ` , ` < s t r o n g > / m e m b e r < / s t r o n g > : $ { q y ( " G r a n t m e m b e r s h i p t o a u s e r " ) } ` , ` < s t r o n g > / m o d t o o l s < / s t r o n g > : $ { q y ( " O p e n s u p t h e m o d e r a t o r t o o l s G U I " ) } ` , ` < s t r o n g > / m u t e < / s t r o n g > : $ { q y ( " R e m o v e u s e r ' s a b i l i t y t o p o s t m e s s a g e s " ) } ` , ` < s t r o n g > / n i c k < / s t r o n g > : $ { q y ( " C h a n g e y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / o p < / s t r o n g > : $ { q y ( " G r a n t m o d e r a t o r r o l e t o u s e r " ) } ` , ` < s t r o n g > / o w n e r < / s t r o n g > : $ { q y ( " G r a n t o w n e r s h i p o f t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / r e g i s t e r < / s t r o n g > : $ { q y ( " R e g i s t e r y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / r e v o k e < / s t r o n g > : $ { q y ( " R e v o k e t h e u s e r ' s c u r r e n t a f f i l i a t i o n " ) } ` , ` < s t r o n g > / s u b j e c t < / s t r o n g > : $ { q y ( " S e t g r o u p c h a t s u b j e c t " ) } ` , ` < s t r o n g > / t o p i c < / s t r o n g > : $ { q y ( " S e t g r o u p c h a t s u b j e c t ( a l i a s f o r / s u b j e c t ) " ) } ` , ` < s t r o n g > / v o i c e < / s t r o n g > : $ { q y ( " A l l o w m u t e d u s e r t o p o s t m e s s a g e s " ) } ` ] . f i l t e r ( ( e = > t . e v e r y ( ( t = > ! e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) . f i l t e r ( ( e = > t h i s . m o d e l . g e t A l l o w e d C o m m a n d s ( ) . s o m e ( ( t = > e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) } o n M o u s e d o w n ( e ) { H E . h a s C l a s s ( " d r a g r e s i z e - o c c u p a n t s - l e f t " , e . t a r g e t ) & & t h i s . o n S t a r t R e s i z e O c c u p a n t s ( e ) } o n S t a r t R e s i z e O c c u p a n t s ( e ) { t h i s . r e s i z i n g = ! 0 , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , n = w i n d o w . g e t C o m p u t e d S t y l e ( t ) ; t h i s . w i d t h = p a r s e I n t ( n . w i d t h . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , t h i s . p r e v _ p a g e X = e . p a g e X } _ o n M o u s e M o v e ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . p r e v _ p a g e X - e . p a g e X ; t h i s . r e s i z e S i d e b a r V i e w ( t , e . p a g e X ) , t h i s . p r e v _ p a g e X = e . p a g e X } } _ o n M o u s e U p ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) , t h i s . r e s i z i n g = ! 1 , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) . g e t B o u n d i n g C l i e n t R e c t ( ) , n = t h i s . c a l c u l a t e S i d e b a r W i d t h ( t , 0 ) ; H E . s a f e S a v e ( t h i s . m o d e l , { o c c u p a n t s _ w i d t h : n } ) } } c a l c u l a t e S i d e b a r W i d t h ( e , t ) { l e t n = e . w i d t h + t ; c o n s t s = t h i s . c l i e n t W i d t h ; r e t u r n n < . 2 * s ? ( n = . 2 * s , t h i s . i s _ m i n i m u m = ! 0 ) : n > . 7 5 * s ? ( n = . 7 5 * s , t h i s . i s _ m a x i m u m = ! 0 ) : s - n < 2 5 0 ? ( n = s - 2 5 0 , t h i s . i s _ m a x i m u m = ! 0 ) : ( t h i s . i s _ m a x i m u m = ! 1 , t h i s . i s _ m i n i m u m = ! 1 ) , n } r e s i z e S i d e b a r V i e w ( e , t ) { c o n s t n = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , s = n . g e t B o u n d i n g C l i e n t R e c t ( ) ; i f ( t h i s . i s _ m i n i m u m ) t h i s . i s _ m i n i m u m = s . l e f t < t ; e l s e i f ( t h i s . i s _ m a x i m u m ) t h i s . i s _ m a x i m u m = s . l e f t > t ; e l s e { c o n s t t = t h i s . c a l c u l a t e S i d e b a r W i d t h ( s , e ) ; n . s t y l e . f l e x = " 0 0 " + t + " p x " } } } ) ; c o n s t { s i z z l e : G E } = A h . e n v , W E = A h . e n v . u t i l s , { s i z z l e : V E } = A h . e n v , J E = A h . e n v . u t i l s ; c l a s s Z E e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . m o d e l = b l . c h a t b o x e s . g e t ( t h i s . j i d ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : p a s s w o r d p r o t e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n f i g _ s t a n z a " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . g e t C o n f i g ( ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = V l . s e t t i n g s . g e t ( " r o o m c o n f i g _ w h i t e l i s t " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n f i g _ s t a n z a " ) ; l e t s , i = [ ] , r = " " ; i f ( n ) { c o n s t o = W E . t o S t a n z a ( n ) ; i = G E ( " f i e l d " , o ) , t . l e n g t h & & ( i = i . f i l t e r ( ( e = > t . i n c l u d e s ( e . g e t A t t r i b u t e ( " v a r " ) ) ) ) ) ; c o n s t a = { n e w _ p a s s w o r d : ! e . m o d e l . f e a t u r e s . g e t ( " p a s s w o r d p r o t e c t e d " ) , f i x e d _ u s e r n a m e : e . m o d e l . g e t ( " j i d " ) } ; i = i . m a p ( ( e = > W E . x F o r m 2 T e m p l a t e R e s u l t ( e , o , a ) ) ) , r = o . q u e r y S e l e c t o r ( " i n s t r u c t i o n s " ) ? . t e x t C o n t
2022-05-05 23:06:17 +02:00
< form class = "converse-form chatroom-form ${i.length?" ":" converse - form -- spinner "}"
2021-11-11 22:06:49 +01:00
autocomplete = "off"
@ submit = $ { e . submitConfigForm } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2022-05-05 23:06:17 +02:00
< legend class = "centered" > $ { s } < / l e g e n d >
2023-12-29 14:11:55 +01:00
$ { s !== r ? nh ` <p class="form-help"> ${ r } </p> ` : "" }
2023-06-25 15:59:31 +02:00
$ { i . length ? i : Sb ( { classes : "hor_centered" } ) }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2023-12-29 14:11:55 +01:00
$ { i . length ? nh `
2021-11-11 22:06:49 +01:00
< fieldset >
2023-01-07 22:34:35 +01:00
< input type = "submit" class = "btn btn-primary" value = "${o}" >
< input type = "button" class = "btn btn-secondary button-cancel" value = "${a}" @ click = $ { e . closeConfigForm } >
2022-12-17 22:08:36 +01:00
< / f i e l d s e t > ` : " " }
< / f o r m >
2023-12-29 14:11:55 +01:00
` })({model:this.model,closeConfigForm:e=>this.closeForm(e),submitConfigForm:e=>this.submitConfigForm(e)})}async getConfig(){const e=await this.model.fetchRoomConfiguration();this.model.session.set("config_stanza",e.outerHTML)}async submitConfigForm(e){e.preventDefault();const t=VE(":input:not([type=button]):not([type=submit])",e.target).map(JE.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){Yc.error(e);const t=qy("Sorry, an error occurred while trying to submit the config form.")+" "+qy("Check your browser's developer console for details.");Vl.alert("error",qy("Error"),t)}await this.model.refreshDiscoInfo(),this.closeForm()}closeForm(e){e?.preventDefault?.(),this.model.session.set("view",null)}}Vl.elements.define("converse-muc-config-form",ZE);const QE=e=>{const t=qy("This groupchat no longer exists"),n=qy('The following reason was given: "%1 $ s"',e.reason||"");return nh `
2022-12-17 22:08:36 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { t } < / h 3 >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . reason ? nh ` <p class="destroyed-reason"> ${ n } </p> ` : "" }
$ { e . moved _jid ? ( e => { const t = qy ( "The conversation has moved to a new address. Click the link below to enter." ) ; return nh `
2022-12-17 22:08:36 +01:00
< p class = "moved-label" > $ { t } < / p >
< p class = "moved-link" >
< a class = "switch-chat" @ click = $ { t => e . onSwitch ( t ) } > $ { e . moved _jid } < / a >
< / p > ` } ) ( e ) : " " }
2023-12-29 14:11:55 +01:00
` };Vl.elements.define("converse-muc-destroyed",class extends Gy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=bl.chatboxes.get(this.jid)}render(){const e=this.model.get("destroyed_reason"),t=this.model.get("moved_jid");return QE({moved_jid:t,reason:e,onSwitch:e=>this.onSwitch(e)})}async onSwitch(e){e.preventDefault();const t=this.model.get("moved_jid");(await Vl.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}});Vl.elements.define("converse-muc-disconnected",class extends Gy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=bl.chatboxes.get(this.jid)}render(){const e=this.model.session.get("disconnection_message");if(!e)return;const t=[e],n=this.model.session.get("disconnection_actor");n&&t.push(qy("This action was done by %1 $ s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(qy('The reason given is: "%1 $ s".',s)),(e=>nh `
2022-12-17 22:08:36 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { e [ 0 ] } < / h 3 >
2023-12-29 14:11:55 +01:00
$ { e . slice ( 1 ) . map ( ( e => nh ` <p class="disconnect-msg"> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t ) } } ) ; c o n s t K E = e = > { c o n s t t = e . t o J S O N ( ) , n = e . c o n f i g . t o J S O N ( ) , s = e . f e a t u r e s . t o J S O N ( ) , i = e . o c c u p a n t s . f i l t e r ( ( e = > " o f f l i n e " ! = = e . g e t ( " s h o w " ) ) ) . l e n g t h , r = q y ( " X M P P a d d r e s s " ) , o = q y ( " M e s s a g e a r c h i v i n g " ) , a = q y ( " M e s s a g e s a r e a r c h i v e d o n t h e s e r v e r " ) , c = q y ( " D e s c r i p t i o n " ) , l = q y ( " F e a t u r e s " ) , d = q y ( " H i d d e n " ) , u = q y ( " T h i s g r o u p c h a t i s n o t p u b l i c l y s e a r c h a b l e " ) , h = q y ( " T h i s g r o u p c h a t i s r e s t r i c t e d t o m e m b e r s o n l y " ) , m = q y ( " M e m b e r s o n l y " ) , f = q y ( " M o d e r a t e d " ) , g = q y ( " P a r t i c i p a n t s e n t e r i n g t h i s g r o u p c h a t n e e d t o r e q u e s t p e r m i s s i o n t o w r i t e " ) , p = q y ( " N a m e " ) , v = q y ( " T h i s g r o u p c h a t d o e s n o t r e q u i r e a p a s s w o r d u p o n e n t r y " ) , y = q y ( " N o p a s s w o r d r e q u i r e d " ) , _ = q y ( " N o t a n o n y m o u s " ) , b = q y ( " A l l o t h e r g r o u p c h a t p a r t i c i p a n t s c a n s e e y o u r X M P P a d d r e s s " ) , w = q y ( " N o t m o d e r a t e d " ) , S = q y ( " P a r t i c i p a n t s e n t e r i n g t h i s g r o u p c h a t c a n w r i t e r i g h t a w a y " ) , x = q y ( " O n l i n e u s e r s " ) , E = q y ( " O p e n " ) , A = q y ( " A n y o n e c a n j o i n t h i s g r o u p c h a t " ) , C = q y ( " T h i s g r o u p c h a t r e q u i r e s a p a s s w o r d b e f o r e e n t r y " ) , $ = q y ( " P a s s w o r d p r o t e c t e d " ) , k = q y ( " P e r s i s t e n t " ) , j = q y ( " T h i s g r o u p c h a t p e r s i s t s e v e n i f i t ' s u n o c c u p i e d " ) , T = q y ( " P u b l i c " ) , I = q y ( " S e m i - a n o n y m o u s " ) , N = q y ( " O n l y m o d e r a t o r s c a n s e e y o u r X M P P a d d r e s s " ) , O = q y ( " T e m p o r a r y " ) , M = q y ( " T h i s g r o u p c h a t w i l l d i s a p p e a r o n c e t h e l a s t p e r s o n l e a v e s " ) ; r e t u r n n h `
2022-12-17 22:08:36 +01:00
< div class = "room-info" >
< p class = "room-info" > < strong > $ { p } < / s t r o n g > : $ { t . n a m e } < / p >
< p class = "room-info" > < strong > $ { r } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = " x m p p : $ { t . j i d } ? j o i n " > < / c o n v e r s e - r i c h - t e x t > < / p >
< p class = "room-info" > < strong > $ { c } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = " $ { n . d e s c r i p t i o n } " r e n d e r _ s t y l i n g > < / c o n v e r s e - r i c h - t e x t > < / p >
2023-12-29 14:11:55 +01:00
$ { t . subject ? ( e => { const t = qy ( "Topic" ) , n = qy ( "Topic author" ) ; return nh `
2022-04-02 21:20:14 +02:00
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = $ { e . s u b j e c t . t e x t } r e n d e r _ s t y l i n g > < / c o n v e r s e - r i c h - t e x t > < / p >
2021-11-11 22:06:49 +01:00
< p class = "room-info" > < strong > $ { n } < / s t r o n g > : $ { e . s u b j e c t & & e . s u b j e c t . a u t h o r } < / p >
2022-04-02 21:20:14 +02:00
` })(t):""}
2022-12-17 22:08:36 +01:00
< p class = "room-info" > < strong > $ { x } < / s t r o n g > : $ { i } < / p >
< p class = "room-info" > < strong > $ { l } < / s t r o n g > :
< div class = "chatroom-features" >
< ul class = "features-list" >
2023-12-29 14:11:55 +01:00
$ { s . passwordprotected ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-lock"></converse-icon> ${ $ } - <em> ${ C } </em></li> ` : "" }
$ { s . unsecured ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-unlock"></converse-icon> ${ y } - <em> ${ v } </em></li> ` : "" }
$ { s . hidden ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-eye-slash"></converse-icon> ${ d } - <em> ${ u } </em></li> ` : "" }
$ { s . public _room ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-eye"></converse-icon> ${ T } - <em> ${ t . _ _ ( "This groupchat is publicly searchable" ) } </em></li> ` : "" }
$ { s . membersonly ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-address-book"></converse-icon> ${ m } - <em> ${ h } </em></li> ` : "" }
$ { s . open ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-globe"></converse-icon> ${ E } - <em> ${ A } </em></li> ` : "" }
$ { s . persistent ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-save"></converse-icon> ${ k } - <em> ${ j } </em></li> ` : "" }
$ { s . temporary ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-snowflake"></converse-icon> ${ O } - <em> ${ M } </em></li> ` : "" }
$ { s . nonanonymous ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-id-card"></converse-icon> ${ _ } - <em> ${ b } </em></li> ` : "" }
$ { s . semianonymous ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-user-secret"></converse-icon> ${ I } - <em> ${ N } </em></li> ` : "" }
$ { s . moderated ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-gavel"></converse-icon> ${ f } - <em> ${ g } </em></li> ` : "" }
$ { s . unmoderated ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-info-circle"></converse-icon> ${ w } - <em> ${ S } </em></li> ` : "" }
$ { s . mam _enabled ? nh ` <li class="feature" ><converse-icon size="1em" class="fa fa-database"></converse-icon> ${ o } - <em> ${ a } </em></li> ` : "" }
2022-12-17 22:08:36 +01:00
< / u l >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / p >
2023-12-29 14:11:55 +01:00
` };var YE=n(2430),XE={};XE.styleTagTransform=i_(),XE.setAttributes=e_(),XE.insert=Yy().bind(null,"head"),XE.domAPI=Qy(),XE.insertStyleElement=n_();Jy()(YE.Z,XE);YE.Z&&YE.Z.locals&&YE.Z.locals;Vl.elements.define("converse-muc-details-modal",class extends tb{initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render())),this.listenTo(this.model.features,"change",(()=>this.render())),this.listenTo(this.model.occupants,"add",(()=>this.render())),this.listenTo(this.model.occupants,"change",(()=>this.render()))}renderModal(){return KE(this.model)}getModalTitle(){return qy("Groupchat info for %1 $ s",this.model.getDisplayName())}});const eA=Ah.env.utils;Vl.elements.define("converse-muc-invite-modal",class extends tb{initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render()))}renderModal(){return(e=>{const t=qy("Invite"),n=qy("user@example.org"),s=qy("Please enter a valid XMPP address"),i=qy("XMPP Address"),r=qy("Optional reason for the invitation");return nh `
2022-12-17 22:08:36 +01:00
< form class = "converse-form" @ submit = $ { t => e . submitInviteForm ( t ) } >
< div class = "form-group" >
< label class = "clearfix" for = "invitee_jids" > $ { i } : < / l a b e l >
2023-12-29 14:11:55 +01:00
$ { e . model . get ( "invalid_invite_jid" ) ? nh ` <div class="error error-feedback"> ${ s } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< converse - autocomplete
. getAutoCompleteList = $ { ( ) => e . getAutoCompleteList ( ) }
? autofocus = $ { ! 0 }
min _chars = "1"
position = "below"
required = "required"
name = "invitee_jids"
id = "invitee_jids"
placeholder = "${n}" >
< / c o n v e r s e - a u t o c o m p l e t e >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label > $ { r } : < / l a b e l >
< textarea class = "form-control" name = "reason" > < / t e x t a r e a >
< / d i v >
< div class = "form-group" >
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
< / d i v >
< / f o r m >
2023-12-29 14:11:55 +01:00
` })(this)}getModalTitle(){return qy("Invite someone to this groupchat")}getAutoCompleteList(){return bl.roster.map((e=>({label:e.getDisplayName(),value:e.get("jid")})))}submitInviteForm(e){e.preventDefault();const t=new FormData(e.target),n=t.get("invitee_jids")?.trim(),s=t.get("reason");eA.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}});Vl.elements.define("converse-muc-nickname-modal",class extends tb{renderModal(){return nh ` < converse - muc - nickname - form jid = "${this.model.get(" jid ")}" > < / c o n v e r s e - m u c - n i c k n a m e - f o r m > ` } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " C h a n g e y o u r n i c k n a m e " ) } } ) ; v a r t A = n ( 9 5 7 5 ) , n A = { } ; n A . s t y l e T a g T r a n s f o r m = i _ ( ) , n A . s e t A t t r i b u t e s = e _ ( ) , n A . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , n A . d o m A P I = Q y ( ) , n A . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( t A . Z , n A ) ; t A . Z & & t A . Z . l o c a l s & & t A . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r i c h - t e x t " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { e m b e d _ a u d i o : { t y p e : B o o l e a n } , e m b e d _ v i d e o s : { t y p e : B o o l e a n } , m e n t i o n s : { t y p e : A r r a y } , n i c k : { t y p e : S t r i n g } , o f f s e t : { t y p e : N u m b e r } , o n I m g C l i c k : { t y p e : F u n c t i o n } , o n I m g L o a d : { t y p e : F u n c t i o n } , r e n d e r _ s t y l i n g : { t y p e : B o o l e a n } , s h o w _ i m a g e s : { t y p e : B o o l e a n } , h i d e _ m e d i a _ u r l s : { t y p e : B o o l e a n } , s h o w _ m e _ m e s s a g e : { t y p e : B o o l e a n } , t e x t : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . e m b e d _ a u d i o = ! 1 , t h i s . e m b e d _ v i d e o s = ! 1 , t h i s . h i d e _ m e d i a _ u r l s = ! 1 , t h i s . m e n t i o n s = [ ] , t h i s . o f f s e t = 0 , t h i s . r e n d e r _ s t y l i n g = ! 1 , t h i s . s h o w _ i m a g e _ u r l s = ! 0 , t h i s . s h o w _ i m a g e s = ! 1 , t h i s . s h o w _ m e _ m e s s a g e = ! 1 } r e n d e r ( ) { c o n s t e = { e m b e d _ a u d i o : t h i s . e m b e d _ a u d i o , e m b e d _ v i d e o s : t h i s . e m b e d _ v i d e o s , h i d e _ m e d i a _ u r l s : t h i s . h i d e _ m e d i a _ u r l s , m e n t i o n s : t h i s . m e n t i o n s , n i c k : t h i s . n i c k , o n I m g C l i c k : t h i s . o n I m g C l i c k , o n I m g L o a d : t h i s . o n I m g L o a d , r e n d e r _ s t y l i n g : t h i s . r e n d e r _ s t y l i n g , s h o w _ i m a g e s : t h i s . s h o w _ i m a g e s , s h o w _ m e _ m e s s a g e : t h i s . s h o w _ m e _ m e s s a g e } ; r e t u r n A S ( t h i s . t e x t , t h i s . o f f s e t , e ) } } ) ; v a r s A = n ( 2 3 3 9 ) , i A = { } ; i A . s t y l e T a g T r a n s f o r m = i _ ( ) , i A . s e t A t t r i b u t e s = e _ ( ) , i A . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , i A . d o m A P I = Q y ( ) , i A . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( s A . Z , i A ) ; s A . Z & & s A . Z . l o c a l s & & s A . Z . l o c a l s ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - h e a d i n g " , c l a s s e x t e n d s G y { a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = b l . c h a t b o x e s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . u s e r _ s e t t i n g s = a w a i t b l . a p i . u s e r . s e t t i n g s . g e t M o d e l ( ) , t h i s . l i s t e n T o ( t h i s . u s e r _ s e t t i n g s , " c h a n g e : m u c s _ w i t h _ h i d d e n _ s u b j e c t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : o p e n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . m o d e l . o c c u p a n t s . f o r E a c h ( ( e = > t h i s . o n O c c u p a n t A d d e d ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " a d d " , t h i s . o n O c c u p a n t A d d e d ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e : a f f i l i a t i o n " , t h i s . o n O c c u p a n t A f f i l i a t i o n C h a n g e d ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l & & t h i s . u s e r _ s e t t i n g s ? ( e = > { c o n s t t = e . m o d e l . t o J S O N ( ) , n = e . u s e r _ s e t t i n g s ? . g e t ( " m u c s _ w i t h _ h i d d e n _ s u b j e c t " , [ ] ) ? . i n c l u d e s ( e . m o d e l . g e t ( " j i d " ) ) , s = e . g e t H e a d i n g B u t t o n s ( n ) , i = q y ( " H i d e t h e g r o u p c h a t t o p i c " ) , r = q y ( " T h i s g r o u p c h a t i s b o o k m a r k e d " ) , o = t . s u b j e c t ? t . s u b j e c t . t e x t : " " , a = o & & ! n , c = e . m o d e l . v c a r d ? . g e t ( " i m a g e " ) ; r e t u r n n h `
2023-01-07 22:34:35 +01:00
< div class = "chatbox-title ${a?" ":" chatbox - title -- no - desc "}" >
2022-05-05 23:06:17 +02:00
2023-12-29 14:11:55 +01:00
$ { c && c !== bl . DEFAULT _IMAGE ? nh `
2022-05-05 23:06:17 +02:00
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-05-05 23:06:17 +02:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r > ` : " " }
2022-04-02 21:20:14 +02:00
< div class = "chatbox-title--row" >
2023-12-29 14:11:55 +01:00
$ { bl . api . settings . get ( "singleton" ) ? "" : nh ` <converse-controlbox-navback jid=" ${ t . jid } "></converse-controlbox-navback> ` }
< div class = "chatbox-title__text" title = "${" hidden "!==Vl.settings.get(" locked _muc _domain ")?t.jid:" "}" > $ { e . model . getDisplayName ( ) }
$ { t . bookmarked ? nh ` <converse-icon
2022-12-17 22:08:36 +01:00
class = "fa fa-bookmark chatbox-title__text--bookmarked"
size = "1em"
color = "var(--chatroom-head-color)"
2023-01-07 22:34:35 +01:00
title = "${r}" >
2022-12-17 22:08:36 +01:00
< / c o n v e r s e - i c o n > ` : " " }
2022-04-02 21:20:14 +02:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2023-12-29 14:11:55 +01:00
$ { Wb ( mS ( s ) , "" ) }
$ { Wb ( fS ( s ) , "" ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2023-12-29 14:11:55 +01:00
$ { a ? nh ` <p class="chat-head__desc" title=" ${ i } ">
2023-01-07 22:34:35 +01:00
< converse - rich - text text = $ { o } render _styling > < / c o n v e r s e - r i c h - t e x t >
2021-11-11 22:06:49 +01:00
< / p > ` : " " }
2023-12-29 14:11:55 +01:00
` })(this):""}onOccupantAdded(e){e.get("jid")===bl.bare_jid&&this.requestUpdate()}onOccupantAffiliationChanged(e){e.get("jid")===bl.bare_jid&&this.requestUpdate()}showRoomDetailsModal(e){e.preventDefault(),Vl.modal.show("converse-muc-details-modal",{model:this.model},e)}showInviteModal(e){e.preventDefault(),Vl.modal.show("converse-muc-invite-modal",{model:new dr,chatroomview:this},e)}toggleTopic(e){e?.preventDefault?.(),this.model.toggleSubjectHiddenState()}getAndRenderConfigurationForm(){this.model.session.set("view",Ah.MUC.VIEWS.CONFIG)}close(e){e.preventDefault(),this.model.close()}destroy(e){e.preventDefault(),aw(this.model)}getHeadingButtons(e){const t=[];t.push({i18n_text:qy("Details"),i18n_title:qy("Show more information about this groupchat"),handler:e=>this.showRoomDetailsModal(e),a_class:"show-muc-details-modal",icon_class:"fa-info-circle",name:"details"}),"owner"===this.model.getOwnAffiliation()&&t.push({i18n_text:qy("Configure"),i18n_title:qy("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),t.push({i18n_text:qy("Nickname"),i18n_title:qy("Change the nickname you're using in this groupchat"),handler:e=>Vl.modal.show("converse-muc-nickname-modal",{model:this.model},e),a_class:"open-nickname-modal",icon_class:"fa-smile",name:"nickname"}),this.model.invitesAllowed()&&t.push({i18n_text:qy("Invite"),i18n_title:qy("Invite someone to join this groupchat"),handler:e=>this.showInviteModal(e),a_class:"open-invite-modal",icon_class:"fa-user-plus",name:"invite"});const n=this.model.get("subject");n&&n.text&&t.push({i18n_text:qy(e?"Show topic":"Hide topic"),i18n_title:qy(e?"Show the topic message in the heading":"Hide the topic in the heading"),handler:e=>this.toggleTopic(e),a_class:"hide-topic",icon_class:"fa-minus-square",name:"toggle-topic"});if(this.model.session.get("connection_status")===Ah.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push({i18n_text:qy("Moderate"),i18n_title:qy("Moderate this groupchat"),handler:()=>mw(this.model),a_class:"moderate-chatroom-button",icon_class:"fa-user-cog",name:"moderate"}),e.includes("destroy")&&t.push({i18n_text:qy("Destroy"),i18n_title:qy("Remove this groupchat"),handler:e=>this.destroy(e),a_class:"destroy-chatroom-button",icon_class:"fa-trash",name:"destroy"})}Vl.settings.get("singleton")||t.push({i18n_text:qy("Leave"),i18n_title:qy("Leave and close this groupchat"),handler:async e=>{e.stopPropagation();const t=[qy("Are you sure you want to leave this groupchat?")];await Vl.confirm(qy("Confirm"),t)&&this.close(e)},a_class:"close-chatbox-button",standalone:"overlayed"===Vl.settings.get("view_mode"),icon_class:"fa-sign-out-alt",name:"signout"});const s=bl.chatboxviews.get(this.getAttribute("jid"));return s?bl.api.hook("getHeadingButtons",s,t):Promise.resolve(t)}});class rA extends Gy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=bl.chatboxes.get(this.jid),this.listenTo(this.model,"change:password_validation_message",this.render),this.render()}render(){return(e=>{const t=qy("This groupchat requires a password"),n=qy("Password: "),s=qy("Submit");return nh `
2021-11-11 22:06:49 +01:00
< form class = "converse-form chatroom-form converse-centered-form" @ submit = $ { e . submitPassword } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label > $ { t } < / l a b e l >
< p class = "validation-message" > $ { e . validation _message } < / p >
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.jid}" > < / i n p u t >
< input type = "password"
name = "password"
required = "required"
class = "form-control ${e.validation_message?" error ":" "}"
placeholder = "${n}" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2022-05-05 23:06:17 +02:00
< input class = "btn btn-primary" type = "submit" value = "${s}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
2021-03-19 19:26:15 +01:00
< / f o r m >
2023-12-29 14:11:55 +01:00
` })({jid:this.model.get("jid"),submitPassword:e=>this.submitPassword(e),validation_message:this.model.get("password_validation_message")})}submitPassword(e){e.preventDefault();const t=this.querySelector("input[type=password]").value;this.model.join(this.model.get("nick"),t),this.model.set("password_validation_message",null)}}Vl.elements.define("converse-muc-password-form",rA);class oA extends Ox{length=300;is_chatroom=!0;async initialize(){this.model=await Vl.rooms.get(this.jid),bl.chatboxviews.add(this.jid,this),this.setAttribute("id",this.model.get("box_id")),this.listenTo(bl,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdateMessageForm),this.listenTo(this.model.session,"change:connection_status",this.onConnectionStatusChanged),this.listenTo(this.model.session,"change:view",(()=>this.requestUpdate())),this.onConnectionStatusChanged(),this.model.maybeShow(),Vl.trigger("chatRoomViewInitialized",this)}render(){return(e=>nh `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-12-29 14:11:55 +01:00
$ { e . model ? nh `
2021-11-11 22:06:49 +01:00
< converse - muc - heading jid = "${e.model.get(" jid ")}" class = "chat-head chat-head-chatroom row no-gutters" >
< / c o n v e r s e - m u c - h e a d i n g >
2023-06-25 15:59:31 +02:00
< div class = "chat-body chatroom-body row no-gutters" > $ { cw ( e ) } < / d i v >
2021-11-11 22:06:49 +01:00
` :""}
2023-12-29 14:11:55 +01:00
< / d i v > ` ) ( { m o d e l : t h i s . m o d e l } ) } o n C o n n e c t i o n S t a t u s C h a n g e d ( ) { t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = A h . R O O M S T A T U S . C O N N E C T I N G & & ( t h i s . m o d e l . s e s s i o n . s a v e ( { d i s c o n n e c t i o n _ a c t o r : v o i d 0 , d i s c o n n e c t i o n _ m e s s a g e : v o i d 0 , d i s c o n n e c t i o n _ r e a s o n : v o i d 0 } ) , t h i s . m o d e l . s a v e ( { m o v e d _ j i d : v o i d 0 , p a s s w o r d _ v a l i d a t i o n _ m e s s a g e : v o i d 0 , r e a s o n : v o i d 0 } ) ) , t h i s . r e q u e s t U p d a t e ( ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c " , o A ) ; v a r a A = n ( 1 6 9 3 ) , c A = { } ; c A . s t y l e T a g T r a n s f o r m = i _ ( ) , c A . s e t A t t r i b u t e s = e _ ( ) , c A . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , c A . d o m A P I = Q y ( ) , c A . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( a A . Z , c A ) ; a A . Z & & a A . Z . l o c a l s & & a A . Z . l o c a l s ; c o n s t { S t r o p h e : l A } = A h . e n v ; A h . M U C . V I E W S = { C O N F I G : " c o n f i g - f o r m " } , A h . p l u g i n s . a d d ( " c o n v e r s e - m u c - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m o d a l " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - c h a t v i e w " ] , i n i t i a l i z e ( ) { c o n s t { _ c o n v e r s e : e } = t h i s ; V l . s e t t i n g s . e x t e n d ( { a u t o _ l i s t _ r o o m s : ! 1 , c a c h e _ m u c _ m e s s a g e s : ! 0 , l o c k e d _ m u c _ n i c k n a m e : ! 1 , m o d t o o l s _ d i s a b l e _ q u e r y : [ ] , m u c _ d i s a b l e _ s l a s h _ c o m m a n d s : ! 1 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ f i l t e r : " c o n t a i n s " , m u c _ m e n t i o n _ a u t o c o m p l e t e _ m i n _ c h a r s : 0 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ s h o w _ a v a t a r : ! 0 , m u c _ r o o m i d _ p o l i c y : n u l l , m u c _ r o o m i d _ p o l i c y _ h i n t : n u l l , r o o m c o n f i g _ w h i t e l i s t : [ ] , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { t o g g l e _ o c c u p a n t s : ! 0 } } ) , e . C h a t R o o m V i e w = o A , V l . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) | | V l . l i s t e n . o n ( " s e r v i c e D i s c o v e r e d " , ( a s y n c e = > { i f ( e ? . g e t ( " v a r " ) = = = l A . N S . M U C ) { i f ( e . e n t i t y . g e t ( " j i d " ) . i n c l u d e s ( " @ " ) ) r e t u r n ; a w a i t e . e n t i t y . g e t I d e n t i t y ( " c o n f e r e n c e " , " t e x t " ) & & V l . s e t t i n g s . s e t ( " m u c _ d o m a i n " , l A . g e t D o m a i n F r o m J i d ( e . g e t ( " f r o m " ) ) ) } } ) ) , V l . l i s t e n . o n ( " c l e a r s e s s i o n " , ( ( ) = > { c o n s t t = e . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ; t & & t . r o o m s p a n e l & & ( t . r o o m s p a n e l . m o d e l . d e s t r o y ( ) , t . r o o m s p a n e l . r e m o v e ( ) , d e l e t e t . r o o m s p a n e l ) } ) ) , V l . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( t = > { v a r n ; t . g e t ( " t y p e " ) = = = e . C H A T R O O M S _ T Y P E & & ( n = t . g e t ( " j i d " ) , b l . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / r o o m ? j i d = $ { n } ` & & b l . r o u t e r . n a v i g a t e ( " " ) ) } ) ) , V l . l i s t e n . o n ( " p a r s e M e s s a g e F o r C o m m a n d s " , f w ) , V l . l i s t e n . o n ( " c o n f i r m D i r e c t M U C I n v i t a t i o n " , o w ) } } ) ; c o n s t d A = d r . e x t e n d ( { d e f a u l t s : { c o l l a p s e d : ! 1 } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t s " , c l a s s e x t e n d s G y { a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = b l . c h a t b o x e s , a w a i t t h i s . i n i t T o g g l e ( ) , t h i s . l i s t e n T o ( t h i s . m i n c h a t s , " c h a n g e : c o l l a p s e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : f u l l n a m e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : j i d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : m i n i m i z e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n a m e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " r e c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l , " d i s c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . w h e r e ( { m i n i m i z e d : ! 0 } ) , t = e . r e d u c e ( ( ( e , t ) = > e + t . g e t ( " n u m _ u n r e a d " ) ) , 0 ) , n = e . r e d u c e ( ( ( e , t ) = > e + ( t . g e t ( " m i n i m i z e d " ) ? 1 : 0 ) ) , 0 ) , s = { c h a t s : e , n u m _ u n r e a d : t , n u m _ m i n i m i z e d : n , c o l l a p s e d : t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ; r e t u r n s . t o g g l e = e = > t h i s . t o g g l e ( e ) , ( e = > n h ` < d i v i d = " m i n i m i z e d - c h a t s " c l a s s = " $ { e . c h a t s . l e n g t h ? " " : " h i d d e n " } " >
2022-12-17 22:08:36 +01:00
< a id = "toggle-minimized-chats" class = "row no-gutters" @ click = $ { e . toggle } >
2023-12-29 14:11:55 +01:00
$ { e . num _minimized } $ { qy ( "Minimized" ) }
2022-12-17 22:08:36 +01:00
< span class = "unread-message-count ${e.num_unread?" ":" unread - message - count - hidden "}" href = "#" > $ { e . num _unread } < / s p a n >
< / a >
< div class = "flyout minimized-chats-flyout row no-gutters ${e.collapsed?" hidden ":" "}" >
2023-12-29 14:11:55 +01:00
$ { e . chats . map ( ( e => nh ` <converse-minimized-chat
2022-12-17 22:08:36 +01:00
. model = $ { e }
title = $ { e . getDisplayName ( ) }
type = $ { e . get ( "type" ) }
num _unread = $ { e . get ( "num_unread" ) } > < / c o n v e r s e - m i n i m i z e d - c h a t > ` ) ) }
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` ) ( s ) } a s y n c i n i t T o g g l e ( ) { c o n s t e = ` c o n v e r s e . m i n c h a t s t o g g l e - $ { b l . b a r e _ j i d } ` ; t h i s . m i n c h a t s = n e w d A ( { i d : e } ) , v c ( t h i s . m i n c h a t s , e , " s e s s i o n " ) , a w a i t n e w P r o m i s e ( ( e = > t h i s . m i n c h a t s . f e t c h ( { s u c c e s s : e , e r r o r : e } ) ) ) } t o g g l e ( e ) { e ? . p r e v e n t D e f a u l t ( ) , t h i s . m i n c h a t s . s a v e ( { c o l l a p s e d : ! t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ) } } ) ; c o n s t { d a y j s : u A , u : h A } = A h . e n v ; f u n c t i o n m A ( e ) { i f ( " c o n t r o l b o x " = = = e . m o d e l . g e t ( " i d " ) ) { i f ( h A . i s V i s i b l e ( e ) ) r e t u r n h A . g e t O u t e r W i d t h ( e , ! 0 ) ; { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - c o n t r o l b o x - t o g g l e " ) ; r e t u r n e ? h A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } } r e t u r n ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & h A . i s V i s i b l e ( e ) ? h A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n f A ( ) { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ; r e t u r n b l . c h a t b o x e s . p l u c k ( " m i n i m i z e d " ) . i n c l u d e s ( ! 0 ) ? h A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n g A ( e ) { c o n s t t = e ? e . m o d e l . g e t ( " i d " ) : n u l l , n = e ? h A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 ; r e t u r n O b j e c t . v a l u e s ( b l . c h a t b o x v i e w s . x g e t ( t ) ) . r e d u c e ( ( ( e , t ) = > e + m A ( t ) ) , n ) } f u n c t i o n p A ( e ) { i f ( b l . i s T e s t E n v ( ) | | V l . s e t t i n g s . g e t ( " n o _ t r i m m i n g " ) | | " o v e r l a y e d " ! = = V l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ) r e t u r n ; c o n s t t = b l . c h a t b o x v i e w s . f i l t e r ( ( e = > ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & ! e . m o d e l . g e t ( " c l o s e d " ) & & h A . i s V i s i b l e ( e ) ) ) ; i f ( t . l e n g t h < = 1 ) r e t u r n ; c o n s t n = h A . g e t O u t e r W i d t h ( d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) , ! 0 ) ; i f ( m A ( t [ 0 ] ) = = = n ) r e t u r n ; i f ( d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ) f o r ( ; f A ( ) + g A ( e ) > n ; ) { c o n s t t = v A ( [ e ? e . m o d e l . g e t ( " i d " ) : n u l l ] ) ; i f ( ! t ) b r e a k ; { c o n s t e = b l . c h a t b o x e s . g e t ( t . g e t ( " i d " ) ) ; e ? . s a v e ( " h i d d e n " , ! 0 ) , _ A ( t ) } } } f u n c t i o n v A ( e ) { e . p u s h ( " c o n t r o l b o x " ) ; l e t t = 0 , n = b l . c h a t b o x e s . s o r t ( ) . a t ( t ) ; f o r ( ; e . i n c l u d e s ( n . g e t ( " i d " ) ) | | ! 0 = = = n . g e t ( " m i n i m i z e d " ) ; ) i f ( t + + , n = b l . c h a t b o x e s . a t ( t ) , ! n ) r e t u r n n u l l ; r e t u r n n } f u n c t i o n y A ( e , t ) { e ? . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , h A . s a f e S a v e ( t , { h i d d e n : ! 1 , m i n i m i z e d : ! 1 , t i m e _ o p e n e d : ( n e w D a t e ) . g e t T i m e ( ) } ) } f u n c t i o n _ A ( e , t ) { e ? . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , t . s e t C h a t S t a t e ( b l . I N A C T I V E ) , h A . s a f e S a v e ( t , { h i d d e n : ! 0 , m i n i m i z e d : ! 0 , t i m e _ m i n i m i z e d : ( n e w D a t e ) . t o I S O S t r i n g ( ) } ) } f u n c t i o n b A ( e ) { e . g e t ( " m i n i m i z e d " ) ? f u n c t i o n ( e ) { V l . t r i g g e r ( " c h a t B o x M i n i m i z e d " , e ) } ( e ) : f u n c t i o n ( e ) { e . i s S c r o l l e d U p ( ) | | e . c l e a r U n r e a d M s g C o u n t e r ( ) , e . s e t C h a t S t a t e ( b l . A C T I V E ) , V l . t r i g g e r ( " c h a t B o x M a x i m i z e d " , e ) } ( e ) } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , t i t l e : { t y p e : S t r i n g } , t y p e : { t y p e : S t r i n g } , n u m _ u n r e a d : { t y p e : N u m b e r } } } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = q y ( " C l i c k t o r e s t o r e t h i s c h a t " ) ; l e t n ; r e t u r n n = " c h a t r o o m " = = = e . t y p e ? " v a r ( - - c h a t r o o m - h e a d - c o l o r ) " : " h e a d l i n e " = = = e . t y p e ? " v a r ( - - h e a d l i n e s - h e a d - t e x t - c o l o r ) " : " v a r ( - - c h a t - h e a d - t e x t - c o l o r ) " , n h `
2022-12-17 22:08:36 +01:00
< div class = "chat-head-${e.type} chat-head row no-gutters" >
< a class = "restore-chat w-100 align-self-center" title = "${t}" @ click = $ { e . restore } >
2023-12-29 14:11:55 +01:00
$ { e . num _unread ? nh ` <span class="message-count badge badge-light"> ${ e . num _unread } </span> ` : "" }
2022-12-17 22:08:36 +01:00
$ { e . title }
< / a >
< a class = "chatbox-btn close-chatbox-button" @ click = $ { e . close } >
< converse - icon color = $ { n } class = "fas fa-times" @ click = $ { e . close } size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2023-12-29 14:11:55 +01:00
< /div>`})({close:e=>this.close(e),num_unread:this.num_unread,restore:e=>this.restore(e),title:this.title,type:this.type})}close(e){e?.preventDefault(),this.model.close()}restore(e){e?.preventDefault(),yA(this.model)}});var wA=n(5784),SA={};SA.styleTagTransform=i_(),SA.setAttributes=e_(),SA.insert=Yy().bind(null,"head"),SA.domAPI=Qy(),SA.insertStyleElement=n_();Jy()(wA.Z,SA);wA.Z&&wA.Z.locals&&wA.Z.locals;Ah.plugins.add("converse-minimize",{dependencies:["converse-chatview","converse-controlbox","converse-muc-views","converse-headlines-view","converse-dragresize"],enabled:e=>"overlayed"===e.api.settings.get("view_mode"),overrides:{ChatBox:{maybeShow(e){return!e&&this.get("minimized")?this:this.__super__.maybeShow.apply(this,arguments)},isHidden(){return this.__super__.isHidden.call(this)||this.get("minimized")}},ChatBoxView:{isNewMessageHidden(){return this.model.get("minimized")||this.__super__.isNewMessageHidden.apply(this,arguments)},setChatBoxHeight(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxHeight.call(this,e)},setChatBoxWidth(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxWidth.call(this,e)}}},initialize(){function e(e){!function(e){e.on("change:hidden",(t=>!t.get("hidden")&&yA(e)),e),"controlbox"!==e.get("id")&&e.save({minimized:e.get("minimized")||!1,time_minimized:e.get("time_minimized")||uA()})}(e),e.on("change:minimized",(()=>bA(e)))}Vl.settings.extend({no_trimming:!1}),Vl.promises.add("minimizedChatsInitialized"),bl.MinimizedChatsToggle=dA,bl.minimize={trimChats:pA,minimize:_A,maximize:yA},Vl.listen.on("chatBoxViewInitialized",(e=>bl.minimize.trimChats(e))),Vl.listen.on("chatRoomViewInitialized",(e=>bl.minimize.trimChats(e))),Vl.listen.on("controlBoxOpened",(e=>bl.minimize.trimChats(e))),Vl.listen.on("chatBoxInitialized",e),Vl.listen.on("chatRoomInitialized",e),Vl.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===bl.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>_A(t,e.model),i18n_text:qy("Minimize"),i18n_title:qy("Minimize this groupchat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===bl.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("signout");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t):function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>_A(t,e.model),i18n_text:qy("Minimize"),i18n_title:qy("Minimize this chat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===bl.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("close");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t)));const t=Il((()=>bl.minimize.trimChats()),250);Vl.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),Vl.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});var xA=n(3243),EA=n.n(xA);const{Strophe:AA}=Ah.env,CA="Notification"in window;let $A;function kA(e){return bl.isTestEnv()||(bl.chatboxes.get(e.from)?.isHidden()??!1)}function jA(){return bl.isTestEnv()||CA&&Vl.settings.get("show_desktop_notifications")&&"granted"===Notification.permission}function TA(){$A=null,navigator.clearAppBadge?.().catch((e=>Yc.error("Could not clear unread count in app badge "+e)))}function IA(){if(Vl.settings.get("show_tab_notifications")){$A=$A??new Ah.env.Favico({type:"circle",animation:"pop"});const e=bl.chatboxes.models.reduce(((e,t)=>e+(t.get("num_unread")||0)),0);$A.badge(e),navigator.setAppBadge?.(e).catch((e=>Yc.error("Could set unread count in app badge - "+e)))}}function NA(e,t,n){return e.reduce(((e,s)=>e||(e=>[bl.bare_jid,`${t}/${n}`].includes(e.uri.replace(/ ^ xmpp : / , " " ) ) ) ( s ) ) , ! 1 ) } f u n c t i o n O A ( e ) { c o n s t { a t t r s : t } = e ; i f ( ! t | | t . i s _ f o r w a r d e d ) r e t u r n ! 1 ; i f ( " g r o u p c h a t " = = = t . t y p e ) r e t u r n a s y n c f u n c t i o n ( e ) { i f ( ! e ? . b o d y & & ! e ? . m e s s a g e ) r e t u r n ! 1 ; c o n s t t = e . f r o m , n = e . f r o m _ m u c , s = V l . s e t t i n g s . g e t ( " n o t i f y _ a l l _ r o o m _ m e s s a g e s " ) , i = b l . c h a t b o x e s . g e t ( n ) , r = A A . g e t R e s o u r c e F r o m J i d ( t ) , o = r & & A A . u n e s c a p e N o d e ( r ) | | " " ; l e t a = ! 1 ; c o n s t c = i . g e t ( " n i c k " ) ; V l . s e t t i n g s . g e t ( " n o t i f y _ n i c k n a m e s _ w i t h o u t _ r e f e r e n c e s " ) & & ( a = n e w R e g E x p ( ` \ \ b $ { c } \ \ b ` ) . t e s t ( e . b o d
2022-12-17 22:08:36 +01:00
< form class = "converse-form set-xmpp-status" id = "set-xmpp-status" @ submit = $ { t => e . onFormSubmitted ( t ) } >
< div class = "form-group" >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "online" === a }
type = "radio" id = "radio-online" value = "online" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-online" >
< converse - icon size = "1em" class = "fa fa-circle chat-status chat-status--online" > < / c o n v e r s e - i c o n > $ { s } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "busy" === a }
type = "radio" id = "radio-busy" value = "dnd" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-busy" >
< converse - icon size = "1em" class = "fa fa-minus-circle chat-status chat-status--busy" > < / c o n v e r s e - i c o n > $ { n } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "away" === a }
type = "radio" id = "radio-away" value = "away" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-away" >
< converse - icon size = "1em" class = "fa fa-circle chat-status chat-status--away" > < / c o n v e r s e - i c o n > $ { t } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "xa" === a }
type = "radio" id = "radio-xa" value = "xa" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-xa" >
< converse - icon size = "1em" class = "far fa-circle chat-status chat-status--xa" > < / c o n v e r s e - i c o n > $ { r } < / l a b e l >
< / d i v >
< / d i v >
< div class = "form-group" >
< div class = "btn-group w-100" >
< input name = "status_message" type = "text" class = "form-control" autofocus
value = "${c||" "}" placeholder = "${o}" / >
< converse - icon size = "1em" class = "fa fa-times clear-input ${c?" ":" hidden "}" @ click = $ { t => e . clearStatusMessage ( t ) } > < / c o n v e r s e - i c o n >
< / d i v >
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { i } < / b u t t o n >
2023-12-29 14:11:55 +01:00
< / f o r m > ` } ) ( t h i s ) } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " C h a n g e c h a t s t a t u s " ) } c l e a r S t a t u s M e s s a g e ( e ) { e & & e . p r e v e n t D e f a u l t & & ( e . p r e v e n t D e f a u l t ( ) , P A . h i d e E l e m e n t ( t h i s . q u e r y S e l e c t o r ( " . c l e a r - i n p u t " ) ) ) ; t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " s t a t u s _ m e s s a g e " ] ' ) . v a l u e = " " } o n F o r m S u b m i t t e d ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) ; t h i s . m o d e l . s a v e ( { s t a t u s _ m e s s a g e : t . g e t ( " s t a t u s _ m e s s a g e " ) , s t a t u s : t . g e t ( " c h a t _ s t a t u s " ) } ) , t h i s . m o d a l . h i d e ( ) } } b l . C h a t S t a t u s M o d a l = F A , V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t - s t a t u s - m o d a l " , F A ) ; c o n s t U A = q y ( " Y o u r p r o f i l e p i c t u r e " ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - i m a g e - p i c k e r " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { h e i g h t : { t y p e : N u m b e r } , d a t a : { t y p e : O b j e c t } , w i d t h : { t y p e : N u m b e r } } } r e n d e r ( ) { r e t u r n n h `
< a class = "change-avatar" @ click = $ { this . openFileSelection } title = "${UA}" >
2022-12-17 22:08:36 +01:00
< converse - avatar class = "avatar" . data = $ { this . data } height = "${this.height}" width = "${this.width}" > < / c o n v e r s e - a v a t a r >
< / a >
< input @ change = $ { this . updateFilePreview } class = "hidden" name = "image" type = "file" / >
2023-12-29 14:11:55 +01:00
` }openFileSelection(e){e.preventDefault(),this.querySelector('input[type="file"]').click()}updateFilePreview(e){const t=e.target.files[0],n=new FileReader;n.onloadend=()=>{this.data={data_uri:n.result,image_type:t.type}},n.readAsDataURL(t)}});const BA=e=>{const t={...e.model.toJSON(),...e.model.vcard.toJSON()},n=qy("Email"),s=qy("Full Name"),i=qy("XMPP Address"),r=qy("Nickname"),o=qy("Role"),a=qy("Save and close"),c=qy("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),l=qy("URL"),d=qy("OMEMO"),u=qy("Profile"),h=qy("Reset Password"),m=[nh ` < li role = "presentation" class = "nav-item" >
2022-12-17 22:08:36 +01:00
< a class = "nav-link ${" profile "===e.tab?" active ":" "}"
id = "profile-tab"
href = "#profile-tabpanel"
2023-01-07 22:34:35 +01:00
aria - controls = "profile-tabpanel"
role = "tab"
2022-12-17 22:08:36 +01:00
@ click = $ { t => e . switchTab ( t ) }
data - name = "profile"
2023-01-07 22:34:35 +01:00
data - toggle = "tab" > $ { u } < / a >
2023-12-29 14:11:55 +01:00
< / l i > ` ] ; r e t u r n m . p u s h ( n h ` < l i r o l e = " p r e s e n t a t i o n " c l a s s = " n a v - i t e m " >
2023-01-07 22:34:35 +01:00
< a class = "nav-link ${" passwordreset "===e.tab?" active ":" "}"
id = "passwordreset-tab"
href = "#passwordreset-tabpanel"
aria - controls = "passwordreset-tabpanel"
role = "tab"
@ click = $ { t => e . switchTab ( t ) }
data - name = "passwordreset"
data - toggle = "tab" > $ { h } < / a >
2023-12-29 14:11:55 +01:00
< / l i > ` ) , b l . p l u g g a b l e . p l u g i n s [ " c o n v e r s e - o m e m o " ] ? . e n a b l e d ( b l ) & & m . p u s h ( n h ` < l i r o l e = " p r e s e n t a t i o n " c l a s s = " n a v - i t e m " >
2023-01-07 22:34:35 +01:00
< a class = "nav-link ${" omemo "===e.tab?" active ":" "}"
id = "omemo-tab"
href = "#omemo-tabpanel"
aria - controls = "omemo-tabpanel"
role = "tab"
@ click = $ { t => e . switchTab ( t ) }
data - name = "omemo"
data - toggle = "tab" > $ { d } < / a >
2023-12-29 14:11:55 +01:00
< / l i > ` ) , n h `
2023-01-07 22:34:35 +01:00
< ul class = "nav nav-pills justify-content-center" > $ { m } < / u l >
2022-12-17 22:08:36 +01:00
< div class = "tab-content" >
< div class = "tab-pane ${" profile "===e.tab?" active ":" "}" id = "profile-tabpanel" role = "tabpanel" aria - labelledby = "profile-tab" >
< form class = "converse-form converse-form--modal profile-form" action = "#" @ submit = $ { t => e . onFormSubmitted ( t ) } >
< div class = "row" >
< div class = "col-auto" >
2023-01-07 22:34:35 +01:00
< converse - image - picker . data = "${{image:t.image,image_type:t.image_type}}" width = "128" height = "128" > < / c o n v e r s e - i m a g e - p i c k e r >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "col" >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label class = "col-form-label" > $ { i } : < / l a b e l >
< div > $ { t . jid } < / d i v >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-fullname" class = "col-form-label" > $ { s } : < / l a b e l >
< input id = "vcard-fullname" type = "text" class = "form-control" name = "fn" value = "${t.fullname||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-nickname" class = "col-form-label" > $ { r } : < / l a b e l >
< input id = "vcard-nickname" type = "text" class = "form-control" name = "nickname" value = "${t.nickname||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-url" class = "col-form-label" > $ { l } : < / l a b e l >
< input id = "vcard-url" type = "url" class = "form-control" name = "url" value = "${t.url||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-email" class = "col-form-label" > $ { n } : < / l a b e l >
< input id = "vcard-email" type = "email" class = "form-control" name = "email" value = "${t.email||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-role" class = "col-form-label" > $ { o } : < / l a b e l >
< input id = "vcard-role" type = "text" class = "form-control" name = "role" value = "${t.role||" "}" aria - describedby = "vcard-role-help" / >
< small id = "vcard-role-help" class = "form-text text-muted" > $ { c } < / s m a l l >
2022-12-17 22:08:36 +01:00
< / d i v >
< hr / >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< button type = "submit" class = "save-form btn btn-primary" > $ { a } < / b u t t o n >
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< / d i v >
2023-01-07 22:34:35 +01:00
< div class = "tab-pane ${" passwordreset "===e.tab?" active ":" "}" id = "passwordreset-tabpanel" role = "tabpanel" aria - labelledby = "passwordreset-tab" >
2023-12-29 14:11:55 +01:00
$ { "passwordreset" === e . tab ? nh ` <converse-change-password-form></converse-change-password-form> ` : "" }
2023-01-07 22:34:35 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { bl . pluggable . plugins [ "converse-omemo" ] ? . enabled ( bl ) ? ( e => nh `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane ${" omemo "===e.tab?" active ":" "}" id = "omemo-tabpanel" role = "tabpanel" aria - labelledby = "omemo-tab" >
2023-12-29 14:11:55 +01:00
$ { "omemo" === e . tab ? nh ` <converse-omemo-profile></converse-omemo-profile> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v > ` ) ( e ) : " " }
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ; v a r q A = n ( 4 9 2 3 ) , H A = n . n ( q A ) ; c o n s t { S t r o p h e : G A , $ i q : W A , s i z z l e : V A , u : J A } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a n g e - p a s s w o r d - f o r m " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { p a s s w o r d s _ m i s m a t c h e d : { t y p e : B o o l e a n } , a l e r t _ m e s s a g e : { t y p e : S t r i n g } } } i n i t i a l i z e ( ) { t h i s . p a s s w o r d s _ m i s m a t c h e d = ! 1 , t h i s . a l e r t _ m e s s a g e = " " } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = q y ( " S u b m i t " ) , n = q y ( " T h e n e w p a s s w o r d s m u s t m a t c h " ) , s = q y ( " N e w p a s s w o r d " ) , i = q y ( " C o n f i r m n e w p a s s w o r d " ) ; r e t u r n n h ` < f o r m c l a s s = " c o n v e r s e - f o r m p a s s w o r d r e s e t - f o r m " m e t h o d = " P O S T " @ s u b m i t = $ { t = > e . o n S u b m i t ( t ) } >
$ { e . alert _message ? nh ` <div class="alert alert-danger" role="alert"> ${ e . alert _message } </div> ` : "" }
2023-01-07 22:34:35 +01:00
< div class = "form-group" >
< label for = "converse_password_reset_new" > $ { s } < / l a b e l >
< input
class = "form-control ${e.passwords_mismatched?" error ":" "}"
type = "password"
value = ""
name = "password"
required = "required"
id = "converse_password_reset_new"
autocomplete = "new-password"
minlength = "8"
? disabled = "${e.alert_message}"
/ >
< / d i v >
< div class = "form-group" >
< label for = "converse_password_reset_check" > $ { i } < / l a b e l >
< input
class = "form-control ${e.passwords_mismatched?" error ":" "}"
type = "password"
value = ""
name = "password_check"
required = "required"
id = "converse_password_reset_check"
autocomplete = "new-password"
minlength = "8"
? disabled = "${e.alert_message}"
@ input = $ { t => e . checkPasswordsMatch ( t ) }
/ >
2023-12-29 14:11:55 +01:00
$ { e . passwords _mismatched ? nh ` <span class="error"> ${ n } </span> ` : "" }
2023-01-07 22:34:35 +01:00
< / d i v >
< input class = "save-form btn btn-primary"
type = "submit"
value = $ { t }
? disabled = "${e.alert_message}" / >
2023-12-29 14:11:55 +01:00
< /form>`})(this)}checkPasswordsMatch(e){const t=new FormData(e.target.form??e.target),n=t.get("password"),s=t.get("password_check");return this.passwords_mismatched=n&&n!==s,this.passwords_mismatched}async onSubmit(e){if(e.preventDefault(),this.checkPasswordsMatch(e))return;const t=WA({type:"get",to:bl.domain}).c("query",{xmlns:GA.NS.REGISTER}),n=await Vl.sendIQ(t);if(null===n)return void(this.alert_message=qy("Timeout error"));if(VA(`error service-unavailable[xmlns="${GA.NS.STANZAS}"]`,n).length)return void(this.alert_message=qy("Your server does not support in-band password reset"));if(JA.isErrorStanza(n))return this.alert_message=qy("Your server responded with an unknown error, check the console for details"),Yc.error("Could not set password"),void Yc.error(n);const s=n.querySelector("username").textContent,i=new FormData(e.target).get("password"),r=WA({type:"set",to:bl.domain}).c("query",{xmlns:GA.NS.REGISTER}).c("username",{},s).c("password",{},i),o=await Vl.sendIQ(r);null===o?this.alert_message=qy("Timeout error while trying to set your password"):VA(`error not-allowed[xmlns="${GA.NS.STANZAS}"]`,o).length?this.alert_message=qy("Your server does not allow in-band password reset"):VA(`error forbidden[xmlns="${GA.NS.STANZAS}"]`,o).length||JA.isErrorStanza(o)?this.alert_message=qy("You are not allowed to change your password"):Vl.alert("info",qy("Success"),[qy("Your new password has been set")])}});const ZA=new(HA())({targetSize:.1,quality:.75,maxWidth:256,maxHeight:256});Vl.elements.define("converse-profile-modal",class extends tb{constructor(e){super(e),this.tab="profile"}initialize(){super.initialize(),this.listenTo(this.model,"change",this.render),Vl.trigger("profileModalInitialized",this.model)}renderModal(){return BA(this)}getModalTitle(){return qy("Your Profile")}async setVCard(e){try{await Vl.vcard.set(bl.bare_jid,e)}catch(e){return Yc.fatal(e),void this.alert([qy("Sorry, an error happened while trying to save your profile data."),qy("You can check your browser's developer console for any error output.")].join(" "))}this.modal.hide()}onFormSubmitted(e){e.preventDefault();const t=new FileReader,n=new FormData(e.target),s=n.get("image"),i={fn:n.get("fn"),nickname:n.get("nickname"),role:n.get("role"),email:n.get("email"),url:n.get("url")};if(s.size){const e=[s];ZA.compress(e).then((e=>{const{photo:n}=e[0];t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:s.type}),this.setVCard(i)},t.readAsBinaryString(n.data)}))}else Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i)}});const QA=e=>{const t=qy("%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s",'<a target="_blank" rel="nofollow" href="https:/ / conversejs . org ">'," < /a>",'<a target="_blank" rel="nofollow" href="https:/ / opkode . com ">'),n=qy(" % 1 $s Translate % 2 $s it into your own language ",'<a target=" _blank " rel=" nofollow " href=" https : //hosted.weblate.org/projects/conversejs/#languages">',"</a>"),s=Vl.settings.get("show_client_info"),i=Vl.settings.get("allow_adhoc_commands");return nh`
$ { s && i ? ( e => { const t = qy ( "About" ) , n = qy ( "Commands" ) ; return nh `
2022-12-17 22:08:36 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" about "===e.tab?" active ":" "}"
id = "about-tab"
href = "#about-tabpanel"
aria - controls = "about-tabpanel"
role = "tab"
data - toggle = "tab"
data - name = "about"
@ click = $ { t => e . switchTab ( t ) } > $ { t } < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" commands "===e.tab?" active ":" "}"
id = "commands-tab"
href = "#commands-tabpanel"
aria - controls = "commands-tabpanel"
role = "tab"
data - toggle = "tab"
data - name = "commands"
@ click = $ { t => e . switchTab ( t ) } > $ { n } < / a >
< / l i >
< / u l >
` })(e):""}
< div class = "tab-content" >
2023-12-29 14:11:55 +01:00
$ { s ? nh `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" about "===e.tab?" active ":" "}"
id = "about-tabpanel" role = "tabpanel" aria - labelledby = "about-tab" >
< span class = "modal-alert" > < / s p a n >
< br / >
< div class = "container" >
< h6 class = "brand-heading" > Converse < / h 6 >
2023-12-29 14:11:55 +01:00
< p class = "brand-subtitle" > $ { bl . VERSION _NAME } < / p >
< p class = "brand-subtitle" > $ { lx ( wo ( ) . sanitize ( t ) ) } < / p >
< p class = "brand-subtitle" > $ { lx ( wo ( ) . sanitize ( n ) ) } < / p >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v > ` : " " }
2023-12-29 14:11:55 +01:00
$ { i ? nh `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" commands "===e.tab?" active ":" "}"
id = "commands-tabpanel"
role = "tabpanel"
aria - labelledby = "commands-tab" >
< converse - adhoc - commands / >
< / d i v > ` : " " }
< / d i v >
2023-12-29 14:11:55 +01:00
` };Vl.elements.define("converse-user-settings-modal",class extends tb{constructor(e){super(e);const t=Vl.settings.get("show_client_info"),n=Vl.settings.get("allow_adhoc_commands");t&&n||t?this.tab="about":n&&(this.tab="commands")}renderModal(){return QA(this)}getModalTitle(){return qy("Settings")}});const{Strophe:KA, $ iq:YA,sizzle:XA,u:eC}=Ah.env;async function tC(e){e?.preventDefault();await Vl.confirm(qy("Are you sure you want to log out?"))&&Vl.user.logout()}function nC(){const e=qy("Log out");return nh ` < a class = "controlbox-heading__btn logout align-self-center" title = "${e}" @ click = $ { tC } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-sign-out-alt" size = "1em" > < / c o n v e r s e - i c o n >
2023-12-29 14:11:55 +01:00
< / a > ` } c o n s t s C = e = > { c o n s t t = e . m o d e l . g e t ( " s t a t u s " ) | | " o f f l i n e " , n = e . m o d e l . g e t ( " s t a t u s _ m e s s a g e " ) | | q y ( " I a m % 1 $ s " , " c h a t " = = = ( s = t ) ? q y ( " o n l i n e " ) : " d n d " = = = s ? q y ( " b u s y " ) : " x a " = = = s ? q y ( " a w a y f o r l o n g " ) : " a w a y " = = = s ? q y ( " a w a y " ) : " o f f l i n e " = = = s ? q y ( " o f f l i n e " ) : q y ( s ) | | q y ( " o n l i n e " ) ) ; v a r s ; c o n s t i = q y ( " C l i c k t o c h a n g e y o u r c h a t s t a t u s " ) , r = V l . s e t t i n g s . g e t ( " s h o w _ c l i e n t _ i n f o " ) | | V l . s e t t i n g s . g e t ( " a l l o w _ a d h o c _ c o m m a n d s " ) ; l e t o , a ; r e t u r n [ o , a ] = " o n l i n e " = = = t ? [ " f a f a - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = t ? [ " f a f a - m i n u s - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = t ? [ " f a f a - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e c h a t - s t a t u s " , " s u b d u e d - c o l o r " ] , n h `
2022-12-17 22:08:36 +01:00
< div class = "userinfo controlbox-padded" >
< div class = "controlbox-section profile d-flex" >
< a class = "show-profile" href = "#" @ click = $ { e . showProfileModal } >
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-12-17 22:08:36 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a >
2023-06-25 15:59:31 +02:00
< span class = "username w-100 align-self-center" > $ { e . model . getDisplayName ( ) } < / s p a n >
2023-12-29 14:11:55 +01:00
$ { r ? function ( e ) { const t = qy ( "Show details about this chat client" ) ; return nh ` <a class="controlbox-heading__btn show-client-info align-self-center" title=" ${ t } " @click= ${ e . showUserSettingsModal } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-cog" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` } ( e ) : " " }
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "allow_logout" ) ? nC ( ) : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "d-flex xmpp-status" >
2023-06-25 15:59:31 +02:00
< a class = "change-status" title = "${i}" data - toggle = "modal" data - target = "#changeStatusModal" @ click = $ { e . showStatusChangeModal } >
2023-01-07 22:34:35 +01:00
< span class = "${t} w-100 align-self-center" data - value = "${t}" >
2023-06-25 15:59:31 +02:00
< converse - icon color = "var(--${a})" style = "margin-top: -0.1em" size = "0.82em" class = "${o}" > < / c o n v e r s e - i c o n > $ { n } < / s p a n >
2022-12-17 22:08:36 +01:00
< / a >
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - u s e r - p r o f i l e " , c l a s s e x t e n d s G y { i n i t i a l i z e ( ) { t h i s . m o d e l = b l . x m p p s t a t u s , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { r e t u r n s C ( t h i s ) } s h o w P r o f i l e M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - p r o f i l e - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } s h o w S t a t u s C h a n g e M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - c h a t - s t a t u s - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } s h o w U s e r S e t t i n g s M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - u s e r - s e t t i n g s - m o d a l " , { m o d e l : t h i s . m o d e l , _ c o n v e r s e : b l } , e ) } } ) , A h . p l u g i n s . a d d ( " c o n v e r s e - p r o f i l e " , { d e p e n d e n c i e s : [ " c o n v e r s e - s t a t u s " , " c o n v e r s e - m o d a l " , " c o n v e r s e - v c a r d " , " c o n v e r s e - c h a t b o x v i e w s " , " c o n v e r s e - a d h o c - v i e w s " ] , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { s h o w _ c l i e n t _ i n f o : ! 0 } ) } } ) ; c o n s t i C = f u n c t i o n ( ) { v a r e = a r g u m e n t s . l e n g t h ; i f ( ! e ) r e t u r n [ ] ; f o r ( v a r t = A r r a y ( e - 1 ) , n = a r g u m e n t s [ 0 ] , s = e ; s - - ; ) t [ s - 1 ] = a r g u m e n t s [ s ] ; r e t u r n c s ( J ( n ) ? t s ( n ) : [ n ] , t r ( t , 1 ) ) } , r C = { n a m e : " A E S - G C M " , l e n g t h : 1 2 8 } , o C = { a a c : " a u d i o / a a c " , a b w : " a p p l i c a t i o n / x - a b i w o r d " , a r c : " a p p l i c a t i o n / x - f r e e a r c " , a v i : " v i d e o / x - m s v i d e o " , a z w : " a p p l i c a t i o n / v n d . a m a z o n . e b o o k " , b i n : " a p p l i c a t i o n / o c t e t - s t r e a m " , b m p : " i m a g e / b m p " , b z : " a p p l i c a t i o n / x - b z i p " , b z 2 : " a p p l i c a t i o n / x - b z i p 2 " , c d a : " a p p l i c a t i o n / x - c d f " , c s h : " a p p l i c a t i o n / x - c s h " , c s s : " t e x t / c s s " , c s v : " t e x t / c s v " , d o c : " a p p l i c a t i o n / m s w o r d " , d o c x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . w o r d p r o c e s s i n g m l . d o c u m e n t " , e o t : " a p p l i c a t i o n / v n d . m s - f o n t o b j e c t " , e p u b : " a p p l i c a t i o n / e p u b + z i p " , g i f : " i m a g e / g i f " , g z : " a p p l i c a t i o n / g z i p " , h t m : " t e x t / h t m l " , h t m l : " t e x t / h t m l " , i c o : " i m a g e / v n d . m i c r o s o f t . i c o n " , i c s : " t e x t / c a l e n d a r " , j a r : " a p p l i c a t i o n / j a v a - a r c h i v e " , j p e g : " i m a g e / j p e g " , j p g : " i m a g e / j p e g " , j s : " t e x t / j a v a s c r i p t " , j s o n : " a p p l i c a t i o n / j s o n " , j s o n l d : " a p p l i c a t i o n / l d + j s o n " , m 4 a : " a u d i o / m p 4 " , m i d : " a u d i o / m i d i " , m i d i : " a u d i o / m i d i " , m j s : " t e x t / j a v a s c r i p t " , m p 3 : " a u d i o / m p e g " , m p 4 : " v i d e o / m p 4 " , m p e g : " v i d e o / m p e g " , m p k g : " a p p l i c a t i o n / v n d . a p p l e . i n s t a l l e r + x m l " , o d p : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . p r e s e n t a t i o n " , o d s : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . s p r e a d s h e e t " , o d t : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . t e x t " , o g a : " a u d i o / o g g " , o g v : " v i d e o / o g g " , o g x : " a p p l i c a t i o n / o g g " , o p u s : " a u d i o / o p u s " , o t f : " f o n t / o t f " , p n g : " i m a g e / p n g " , p d f : " a p p l i c a t i o n / p d f " , p h p : " a p p l i c a t i o n / x - h t t p d - p h p " , p p t : " a p p l i c a t i o n / v n d . m s - p o w e r p o i n t " , p p t x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . p r e s e n t a t i o n m l . p r e s e n t a t i o n " , r a r : " a p p l i c a t i o n / v n d . r a r " , r t f : " a p p l i c a t i o n / r t f " , s h : " a p p l i c a t i o n / x - s h " , s v g : " i m a g e / s v g + x m l " , s w f : " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h " , t a r : " a p p l i c a t i o n / x - t a r " , t i f : " i m a g e / t i f f " , t i f f : " i m a g e / t i f f " , t s : " v i d e o / m p 2 t " , t t f : " f o n t / t t f " , t x t : " t e x t / p l a i n " , v s d : " a p p l i c a t i o n / v n d . v i s i o " , w a v : " a u d i o / w a v " , w e b a : " a u d i o / w e b m " , w e b m : " v i d e o / w e b m " , w e b p : " i m a g e / w e b p " , w o f f : " f o n t / w o f f " , w o f f 2 : " f o n t / w o f f 2 " , x h t m l : " a p p l i c a t i o n / x h t m l + x m l " , x l s : " a p p l i c a t i o n / v n d . m s - e x c e l " , x l s x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . s p r e a d s h e e t m l . s h e e t " , x m l : " t e x t / x m l " , x u l : " a p p l i c a t i o n / v n d . m o z i l l a . x u l + x m l " , z i p : " a p p l i c a t i o n / z i p " , " 3 g p " : " v i d e o / 3 g p p " , " 3 g 2 " : " v i d e o / 3 g p p 2 " , " 7 z " : " a p p l i c a t i o n / x - 7 z - c o m p r e s s e d " } , { S t r o p h e : a C , U R I : c C , s i z z l e : l C , u : d C } = A h . e n v ; f u n c t i o n u C ( e ) { e = e . r e p l a c e ( / ^ 0 5 / , " " ) ; f o r ( l e t t = 1 ; t < 8 ; t + + ) { c o n s t n = 8 * t + t - 1 ; e = e . s l i c e ( 0 , n ) + " " + e . s l i c e ( n ) } r e t u r n e } f u n c t i o n h C ( e , t ) { r e t u r n e . g e t ( " o m e m o _ a c t i v e " ) & & t . b o d y & & ( t . i s _ e n c r y p t e d = ! 0 , t . p l a i n t e x t = t . b o d y , t . b o d y = q y ( " T h i s i s a n O M E M O e n c r y p t e d m e s s a g e w h i c h y o u r c l i e n t d o e s n ’ t s e e m t o s u p p o r t . F i n d m o r e i n f o r m a t i o n o n h t t p s : / / c o n v e r s a t i o n s . i m / o m e m o " ) ) , t } a s y n c f u n c t i o n m C ( e ) { c o n s t t = " l o c a l h o s t " = = = w i n d o w . l o c a t i o n . h o s t n a m e & & " l o c a l h o s t " = = = e . d o m a i n ( ) ? " h t t p " : " h t t p s " , n = e . t o S t r i n g ( ) . r e p l a c e ( / ^ a e s g c m / , t ) , s = a w a i t a s y n c f u n c t i o n ( e ) { l e t t ; t r y { t = a w a i t f e t c h ( e ) } c a t c h ( t ) { r e t u r n Y c . e r r o r ( ` $ { t . n a m e } : F a i l e d t o d o w n l o a d e n c r y p t e d m e d i a : $ { e } ` ) , Y c . e r r o r ( t ) , n u l l } i f ( t . s t a t u s > = 2 0 0 & & t . s t a t u s < 4 0 0 ) r e t u r n t . a r r a y B u f f e r ( ) } ( n ) ; i f ( n u l l = = = s ) r e t u r n Y c . e r r o r ( ` C o u l d n o t d e c r y p t a r e c e i v e d e n c r y p t e d f i l e $ { e . t o S t r i n g ( ) } s i n c e i t c o u l d n o t b e d o w n l o a d e d ` ) , n e w E r r o r ( q y ( " E r r o r : c o u l d n o t d e c r y p t a r e c e i v e d e n c r y p t e d f i l e , b e c a u s e i t c o u l d n o t b e d o w n l o a d e d " ) ) ; c o n s t i = e . h a s h ( ) . s l i c e ( 1 ) , r = i . s u b s t r i n g ( i . l e n g t h - 6 4 ) , o = i . r e p l a c
< button class = "toggle-omemo" title = "${i}" data - disabled = $ { ! n . get ( "omemo_supported" ) } @ click = $ { IC } >
2022-01-03 11:54:10 +01:00
< converse - icon
class = "fa ${n.get(" omemo _active ")?" fa - lock ":" fa - unlock "}"
2023-12-29 14:11:55 +01:00
path - prefix = "${Vl.settings.get(" assets _path ")}"
2022-01-03 11:54:10 +01:00
size = "1em"
2022-12-17 22:08:36 +01:00
color = "${r}"
2022-01-03 11:54:10 +01:00
> < / c o n v e r s e - i c o n >
< / b u t t o n >
2023-12-29 14:11:55 +01:00
` ),t}async function OC(e,t){let{stanza:n}=t;const{message:s}=t;if(!s.get("is_encrypted"))return t;if(!s.get("body"))throw new Error("No message body to encrypt!");const i=await async function(e){const t=qy("Sorry, no devices found to which we can send an OMEMO encrypted message.");let n;if(e.get("type")===bl.CHATROOMS_TYPE){const t=await Promise.all(e.occupants.map((e=>AC(e.get("jid")))));n=t.reduce(((e,t)=>iC(e,t.models)),[])}else if(e.get("type")===bl.PRIVATE_CHAT_TYPE){const s=await AC(e.get("jid"));if(0===s.length){const e=new Error(t);throw e.user_facing=!0,e}const i=(await Vl.omemo.devicelists.get(bl.bare_jid)).devices;n=[...i.models,...s.models]}const s=bl.omemo_store.get("device_id");n=n.filter((e=>e.get("id")!==s)),await Promise.all(n.map((e=>e.getBundle())));const i=n.filter((e=>e)).map((e=>CC(e)));if(await Promise.all(i),i.includes(null)&&(n=n.filter((e=>i[n.indexOf(e)])),0===n.length)){const e=new Error(t);throw e.user_facing=!0,e}return n}(e);n.c("encrypted",{xmlns:aC.NS.OMEMO}).c("header",{sid:bl.omemo_store.get("device_id")});const{key_and_tag:r,iv:o,payload:a}=await MC.encryptMessage(s.get("plaintext")),c=await Promise.all(i.filter((e=>-1!=e.get("trusted")&&e.get("active"))).map((e=>function(e,t){return _C(t.get("jid"),t.get("id")).encrypt(e).then((e=>({payload:e,device:t})))}(r,e))));return n=await function(e,t,n){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s].payload,r=t[s].device,o=3==parseInt(i.type,10);e.c("key",{rid:r.get("id")}).t(btoa(i.body)),o&&e.attrs({prekey:o}),e.up(),s==t.length-1&&e.c("iv").t(n).up().up()}return Promise.resolve(e)}(n,c,o),n.c("payload").t(a).up().up(),n.c("store",{xmlns:aC.NS.HINTS}).up(),n.c("encryption",{xmlns:aC.NS.EME,namespace:aC.NS.OMEMO}),{message:s,stanza:n}}const MC={decryptMessage:async function(e){const t=await crypto.subtle.importKey("raw",e.key,rC,!0,["encrypt","decrypt"]),n=Bg(Vg(e.payload),e.tag),s={name:"AES-GCM",iv:Vg(e.iv),tagLength:128};return Hg(await crypto.subtle.decrypt(s,t,n))},encryptMessage:async function(e){const t=crypto.getRandomValues(new window.Uint8Array(12)),n=await crypto.subtle.generateKey(rC,!0,["encrypt","decrypt"]),s={name:"AES-GCM",iv:t,tagLength:128},i=await crypto.subtle.encrypt(s,n,Gg(e)),r=i.byteLength-16,o=i.slice(0,r),a=i.slice(r),c=await crypto.subtle.exportKey("raw",n);return{key:c,tag:a,key_and_tag:Bg(c,a),payload:Wg(o),iv:Wg(t)}},formatFingerprint:uC},RC=e=>{const t=qy("OMEMO Fingerprints"),n=qy("No OMEMO-enabled devices found"),s=e.devicelist.devices;return nh `
2022-01-03 11:54:10 +01:00
< hr / >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { t } < / l i >
2023-12-29 14:11:55 +01:00
$ { s . length ? s . map ( ( t => ( ( e , t ) => { const n = qy ( "Trusted" ) , s = qy ( "Untrusted" ) ; return t . get ( "bundle" ) && t . get ( "bundle" ) . fingerprint ? nh `
2022-01-03 11:54:10 +01:00
< li class = "list-group-item" >
< form class = "fingerprint-trust" >
< div class = "btn-group btn-group-toggle" >
< label class = "btn btn--small ${1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "1"
? checked = $ { - 1 !== t . get ( "trusted" ) } > $ { n }
< / l a b e l >
< label class = "btn btn--small ${-1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "-1"
2022-05-05 23:06:17 +02:00
? checked = $ { - 1 === t . get ( "trusted" ) } > $ { s }
2022-01-03 11:54:10 +01:00
< / l a b e l >
< / d i v >
2023-12-29 14:11:55 +01:00
< code class = "fingerprint" > $ { uC ( t . get ( "bundle" ) . fingerprint ) } < / c o d e >
2022-01-03 11:54:10 +01:00
< / f o r m >
< / l i >
2023-12-29 14:11:55 +01:00
` :""})(e,t))):nh ` < li class = "list-group-item" > $ { n } < / l i > ` }
2022-01-03 11:54:10 +01:00
< / u l >
2023-12-29 14:11:55 +01:00
` };Vl.elements.define("converse-omemo-fingerprints",class extends Gy{static get properties(){return{jid:{type:String}}}async initialize(){this.devicelist=await Vl.omemo.devicelists.get(this.jid,!0),this.listenTo(this.devicelist.devices,"change:bundle",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"change:trusted",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"remove",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"add",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"reset",(()=>this.requestUpdate())),this.requestUpdate()}render(){return this.devicelist?RC(this):""}toggleDeviceTrust(e){const t=e.target;this.devicelist.devices.get(t.getAttribute("name")).save("trusted",parseInt(t.value,10))}});const DC=e=>nh `
$ { e . device . get ( "bundle" ) && e . device . get ( "bundle" ) . fingerprint ? ( e => { const t = qy ( "Checkbox for selecting the following fingerprint" ) ; return nh `
2022-12-17 22:08:36 +01:00
< li class = "fingerprint-removal-item list-group-item" >
2022-01-03 11:54:10 +01:00
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${t}" / >
2023-12-29 14:11:55 +01:00
< span class = "fingerprint" > $ { uC ( e . device . get ( "bundle" ) . fingerprint ) } < / s p a n >
2022-01-03 11:54:10 +01:00
< / l a b e l >
< / l i >
2023-12-29 14:11:55 +01:00
` })(e):(e=>{const t=qy("Device without a fingerprint"),n=qy("Checkbox for selecting the following device");return nh `
2022-12-17 22:08:36 +01:00
< li class = "fingerprint-removal-item list-group-item" >
2022-01-03 11:54:10 +01:00
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${n}" / >
< span > $ { t } < / s p a n >
< / l a b e l >
< / l i >
` })(e)}
2023-12-29 14:11:55 +01:00
` ,zC=e=>{const t=qy("This device's OMEMO fingerprint"),n=qy("Generate new keys and fingerprint");return nh `
2022-05-05 23:06:17 +02:00
< form class = "converse-form fingerprint-removal" @ submit = $ { e . removeSelectedFingerprints } >
< ul class = "list-group fingerprints" >
2023-01-07 22:34:35 +01:00
< li class = "list-group-item active" > $ { t } < / l i >
2022-05-05 23:06:17 +02:00
< li class = "list-group-item" >
2023-12-29 14:11:55 +01:00
$ { e . current _device && e . current _device . get ( "bundle" ) && e . current _device . get ( "bundle" ) . fingerprint ? ( e => nh `
< span class = "fingerprint" > $ { uC ( e . current _device . get ( "bundle" ) . fingerprint ) } < / s p a n > ` ) ( e ) : S b ( ) }
2022-05-05 23:06:17 +02:00
< / l i >
< / u l >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< button type = "button" class = "generate-bundle btn btn-danger" @ click = $ { e . generateOMEMODeviceBundle } > $ { n } < / b u t t o n >
2022-05-05 23:06:17 +02:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { e . other _devices ? . length ? ( e => { const t = qy ( "Other OMEMO-enabled devices" ) , n = qy ( "Checkbox to select fingerprints of all other OMEMO devices" ) , s = qy ( "Remove checked devices and close" ) , i = qy ( "Select all" ) ; return nh `
2022-05-05 23:06:17 +02:00
< ul class = "list-group fingerprints" >
2022-12-17 22:08:36 +01:00
< li class = "list-group-item active" >
2022-05-05 23:06:17 +02:00
< label >
2023-01-07 22:34:35 +01:00
< input type = "checkbox" class = "select-all" @ change = $ { e . selectAll } title = "${i}" aria - label = "${n}" / >
$ { t }
2022-05-05 23:06:17 +02:00
< / l a b e l >
< / l i >
2023-12-29 14:11:55 +01:00
$ { e . other _devices ? . map ( ( t => DC ( Object . assign ( { device : t } , e ) ) ) ) }
2022-01-03 11:54:10 +01:00
< / u l >
2023-01-07 22:34:35 +01:00
< div class = "form-group" > < button type = "submit" class = "save-form btn btn-primary" > $ { s } < / b u t t o n > < / d i v >
2022-01-03 11:54:10 +01:00
` })(e):""}
2023-12-29 14:11:55 +01:00
< / f o r m > ` } , { S t r o p h e : L C , s i z z l e : P C , u : F C } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - o m e m o - p r o f i l e " , c l a s s e x t e n d s G y { a s y n c i n i t i a l i z e ( ) { t h i s . d e v i c e l i s t = a w a i t V l . o m e m o . d e v i c e l i s t s . g e t ( b l . b a r e _ j i d , ! 0 ) , a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " c h a n g e : b u n d l e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c s e t A t t r i b u t e s ( ) { t h i s . d e v i c e _ i d = a w a i t V l . o m e m o . g e t D e v i c e I D ( ) , t h i s . c u r r e n t _ d e v i c e = t h i s . d e v i c e l i s t . d e v i c e s . g e t ( t h i s . d e v i c e _ i d ) , t h i s . o t h e r _ d e v i c e s = t h i s . d e v i c e l i s t . d e v i c e s . f i l t e r ( ( e = > e . g e t ( " i d " ) ! = = t h i s . d e v i c e _ i d ) ) } r e n d e r ( ) { r e t u r n t h i s . d e v i c e l i s t ? z C ( t h i s ) : S b ( ) } s e l e c t A l l ( e ) { l e t t = F C . a n c e s t o r ( e . t a r g e t , " l i " ) ; f o r ( ; t ; ) t . q u e r y S e l e c t o r ( ' i n p u t [ t y p e = " c h e c k b o x " ] ' ) . c h e c k e d = e . t a r g e t . c h e c k e d , t = t . n e x t E l e m e n t S i b l i n g } a s y n c r e m o v e S e l e c t e d F i n g e r p r i n t s ( e ) { e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) , e . t a r g e t . q u e r y S e l e c t o r ( " . s e l e c t - a l l " ) . c h e c k e d = ! 1 ; c o n s t t = P C ( ' . f i n g e r p r i n t - r e m o v a l - i t e m i n p u t [ t y p e = " c h e c k b o x " ] : c h e c k e d ' , e . t a r g e t ) . m a p ( ( e = > e . v a l u e ) ) ; t r y { a w a i t t h i s . d e v i c e l i s t . r e m o v e O w n D e v i c e s ( t ) } c a t c h ( e ) { Y c . e r r o r ( e ) , b l . a p i . a l e r t ( L C . L o g L e v e l . E R R O R , q y ( " E r r o r " ) , [ q y ( " S o r r y , a n e r r o r o c c u r r e d w h i l e t r y i n g t o r e m o v e t h e d e v i c e s . " ) ] ) } a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c g e n e r a t e O M E M O D e v i c e B u n d l e ( e ) { e . p r e v e n t D e f a u l t ( ) ; a w a i t V l . c o n f i r m ( q y ( " A r e y o u s u r e y o u w a n t t o g e n e r a t e n e w O M E M O k e y s ? T h i s w i l l r e m o v e y o u r o l d k e y s a n d a l l p r e v i o u s l y e n c r y p t e d m e s s a g e s w i l l n o l o n g e r b e d e c r y p t a b l e o n t h i s d e v i c e . " ) ) & & ( a w a i t V l . o m e m o . b u n d l e . g e n e r a t e ( ) , a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . r e q u e s t U p d a t e ( ) ) } } ) ; c o n s t U C = { a s y n c g e n e r a t e F i n g e r p r i n t s ( e ) { c o n s t t = a w a i t A C ( e ) ; r e t u r n P r o m i s e . a l l ( t . m a p ( ( e = > E C ( e ) ) ) ) } , g e t D e v i c e F o r C o n t a c t : ( e , t ) = > A C ( e ) . t h e n ( ( e = > e . g e t ( t ) ) ) , c o n t a c t H a s O M E M O S u p p o r t : a s y n c e = > ( a w a i t A C ( e ) ) . l e n g t h > 0 } , B C = U C ; c l a s s q C e x t e n d s E r r o r { c o n s t r u c t o r ( e , t ) { s u p e r ( e , t ) , t h i s . n a m e = " I Q E r r o r " , t h i s . i q = t } } c o n s t { S t r o p h e : H C , s i z z l e : G C , $ i q : W C } = A h . e n v , V C = d r . e x t e n d ( { d e f a u l t s : { t r u s t e d : 0 , a c t i v e : ! 0 } , g e t R a n d o m P r e K e y ( ) { c o n s t e = t h i s . g e t ( " b u n d l e " ) ; r e t u r n e . p r e k e y s [ U c ( e . p r e k e y s . l e n g t h ) ] } , a s y n c f e t c h B u n d l e F r o m S e r v e r ( ) { c o n s t e = W C ( { t y p e : " g e t " , f r o m : b l . b a r e _ j i d , t o : t h i s . g e t ( " j i d " ) } ) . c ( " p u b s u b " , { x m l n s : H C . N S . P U B S U B } ) . c ( " i t e m s " , { n o d e : ` $ { H C . N S . O M E M O _ B U N D L E S } : $ { t h i s . g e t ( " i d " ) } ` } ) ; l e t t ; t r y { t = a w a i t V l . s e n d I Q ( e ) } c a t c h ( t ) { r e t u r n Y c . e r r o r ( ` C o u l d n o t f e t c h b u n d l e f o r d e v i c e $ { t h i s . g e t ( " i d " ) } f r o m $ { t h i s . g e t ( " j i d " ) } ` ) , Y c . e r r o r ( t ) , n u l l } i f ( t . q u e r y S e l e c t o r ( " e r r o r " ) ) t h r o w n e w q C ( " C o u l d n o t f e t c h b u n d l e " , t ) ; c o n s t n = G C ( ` i t e m s [ n o d e = " $ { H C . N S . O M E M O _ B U N D L E S } : $ { t h i s . g e t ( " i d " ) } " ] ` , t ) . p o p ( ) , s = x C ( G C ( ` b u n d l e [ x m l n s = " $ { H C . N S . O M E M O } " ] ` , n ) . p o p ( ) ) ; r e t u r n t h i s . s a v e ( " b u n d l e " , s ) , s } , g e t B u n d l e ( ) { r e t u r n t h i s . g e t ( " b u n d l e " ) ? P r o m i s e . r e s o l v e ( t h i s . g e t ( " b u n d l e " ) , t h i s ) : t h i s . f e t c h B u n d l e F r o m S e r v e r ( ) } } ) , { S t r o p h e : J C , $ b u i l d : Z C , $ i q : Q C , s i z z l e : K C } = A h . e n v , Y C = d r . e x t e n d ( { i d A t t r i b u t e : " j i d " , a s y n c i n i t i a l i z e ( ) { t h i s . i n i t i a l i z e d = A o ( ) , a w a i t t h i s . i n i t D e v i c e s ( ) , t h i s . i n i t i a l i z e d . r e s o l v e ( ) } , i n i t D e v i c e s ( ) { t h i s . d e v i c e s = n e w b l . D e v i c e s ; c o n s t e = ` c o n v e r s e . d e v i c e l i s t - $ { b l . b a r e _ j i d } - $ { t h i s . g e t ( " j i d " ) } ` ; r e t u r n v c ( t h i s . d e v i c e s , e ) , t h i s . f e t c h D e v i c e s ( ) } , a s y n c o n D e v i c e s F o u n d ( e ) { i f ( 0 = = = e . l e n g t h ) { l e t e = [ ] ; t r y { e = a w a i t t h i s . f e t c h D e v i c e s F r o m S e r v e r ( ) } c a t c h ( e ) { n u l l = = = e ? Y c . e r r o r ( ` T i m e o u t e r r o r w h i l e f e t c h i n g d e v i c e s f o r $ { t h i s . g e t ( " j i d " ) } ` ) : ( Y c . e r r o r ( ` C o u l d n o t f e t c h d e v i c e s f o r $ { t h i s . g e t ( " j i d " ) } ` ) , Y c . e r r o r ( e ) ) , t h i s . d e s t r o y ( ) } t h i s . g e t ( " j i d " ) = = = b l . b a r e _ j i d & & t h i s . p u b l i s h C u r r e n t D e v i c e ( e ) } } , f e t c h D e v i c e s ( ) { r e t u r n v o i d 0 = = = t h i s . _ d e v i c e s _ p r o m i s e & & ( t h i s . _ d e v i c e s _ p r o m i s e = n e w P r o m i s e ( ( e = > { t h i s . d e v i c e s . f e t c h ( { s u c c e s s : t = > e ( t h i s . o n D e v i c e s F o u n d ( t ) ) , e r r o r : ( t , n ) = > { Y c . e r r o r ( n ) , e ( ) } } ) } ) ) ) , t h i s . _ d e v i c e s _ p r o m i s e } , a s y n c g e t O w n D e v i c e I d ( ) { l e t e = b l . o m e m o _ s t o r e . g e t ( " d e v i c e _ i d " ) ; r e t u r n t h i s . d e v i c e s . g e t ( e ) | | ( a w a i t b l . o m e m o _ s t o r e . g e n e r a t e B u n d l e ( ) , e = b l . o m e m o _ s t o r e . g e t ( " d e v i c e _ i d " ) ) , e } , a s y n c p u b l i s h C u r r e n t D e v i c e ( e ) { i f ( t h i s . g e t ( " j i d " ) = = = b l . b a r e _ j i d ) { i f ( a w a i t k C ( ) , b l . o m e m o _ s t o r e ) r e t u r n e . i n c l u d e
2023-02-17 12:24:37 +01:00
< div class = "switch-form" >
< p > $ { e } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { t } < / a > < / p >
2023-12-29 14:11:55 +01:00
< / d i v > ` } , _ $ = e = > { c o n s t t = V l . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) , n = q y ( " C r e a t e y o u r a c c o u n t " ) , s = q y ( " P l e a s e e n t e r t h e X M P P p r o v i d e r t o r e g i s t e r w i t h : " ) , i = ! t & & e . s t a t u s = = = b $ ; r e t u r n n h `
2023-02-17 12:24:37 +01:00
< form id = "converse-register" class = "converse-form" @ submit = $ { t => e . onFormSubmission ( t ) } >
< legend class = "col-form-label" > $ { n } < / l e g e n d >
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
2023-02-17 12:24:37 +01:00
< label > $ { s } < / l a b e l >
2023-12-29 14:11:55 +01:00
$ { t || ( ( ) => { const e = Vl . settings . get ( "domain_placeholder" ) , t = qy ( "Tip: A list of public XMPP providers is available" ) , n = qy ( "here" ) , s = Vl . settings . get ( "providers_link" ) ; return nh `
2021-11-11 22:06:49 +01:00
< input class = "form-control" required = "required" type = "text" name = "domain" placeholder = "${e}" / >
< p class = "form-text text-muted" >
$ { t }
2022-05-05 23:06:17 +02:00
< a href = "${s}" class = "url" target = "_blank" rel = "noopener" > $ { n } < / a > .
2021-11-11 22:06:49 +01:00
< / p >
` })()}
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { i ? ( ( ) => { const e = qy ( "Fetch registration form" ) , t = qy ( "Already have a chat account?" ) , n = qy ( "Log in here" ) ; return nh `
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
< input class = "btn btn-primary" type = "submit" value = "${e}" / >
< / f i e l d s e t >
< div class = "switch-form" >
< p > $ { t } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { n } < / a > < / p >
< / d i v >
2023-02-17 12:24:37 +01:00
` })():""}
2021-11-11 22:06:49 +01:00
< / f o r m >
2023-12-29 14:11:55 +01:00
` },b $ =0,w $ =e=>nh `
2022-05-05 23:06:17 +02:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
2023-12-29 14:11:55 +01:00
$ { e . alert _message ? nh ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
$ { e . status === b$ ? _$ ( e ) : "" }
$ { 1 === e . status ? ( e => { const t = Vl . settings . get ( "registration_domain" ) , n = qy ( "Cancel" ) ; return nh `
2023-02-17 12:24:37 +01:00
< form id = "converse-register" class = "converse-form no-scrolling" @ submit = $ { t => e . onFormSubmission ( t ) } >
2023-06-25 15:59:31 +02:00
$ { Sb ( { classes : "hor_centered" } ) }
2023-12-29 14:11:55 +01:00
$ { t ? "" : nh `
2023-02-17 12:24:37 +01:00
< button class = "btn btn-secondary button-cancel hor_centered"
@ click = $ { t => e . renderProviderChoiceForm ( t ) } > $ { n } < / b u t t o n >
2021-11-11 22:06:49 +01:00
` }
< / f o r m >
2023-02-17 12:24:37 +01:00
` })(e):""}
2023-12-29 14:11:55 +01:00
$ { 2 === e . status ? ( e => { const t = qy ( "Choose a different provider" ) , n = qy ( "Account Registration:" ) , s = qy ( "Register" ) , i = Vl . settings . get ( "registration_domain" ) ; return nh `
2023-02-17 12:24:37 +01:00
< form id = "converse-register" class = "converse-form" @ submit = $ { t => e . onFormSubmission ( t ) } >
< legend class = "col-form-label" > $ { n } $ { e . domain } < / l e g e n d >
2021-11-11 22:06:49 +01:00
< p class = "title" > $ { e . title } < / p >
< p class = "form-help instructions" > $ { e . instructions } < / p >
< div class = "form-errors hidden" > < / d i v >
$ { e . form _fields }
< fieldset class = "buttons form-group" >
2023-12-29 14:11:55 +01:00
$ { e . fields ? nh `
2023-02-17 12:24:37 +01:00
< input type = "submit" class = "btn btn-primary" value = "${s}" / >
2021-11-11 22:06:49 +01:00
` :""}
2023-12-29 14:11:55 +01:00
$ { i ? "" : nh `
2021-11-11 22:06:49 +01:00
< input
type = "button"
class = "btn btn-secondary button-cancel"
value = "${t}"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . renderProviderChoiceForm ( t ) }
2021-11-11 22:06:49 +01:00
/ >
` }
2023-12-29 14:11:55 +01:00
$ { y$ ( ) }
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< / f o r m >
` })(e):""}
2023-12-29 14:11:55 +01:00
$ { 3 === e . status ? y$ ( ) : "" }
` ;async function S $ (e){await Vl.waitUntil("controlBoxInitialized");bl.chatboxes.get("controlbox").set({"active-form":e})}const x $ =e=> ` < value > $ { e } < / v a l u e > ` ; f u n c t i o n E $ ( e ) { c o n s t t = e . g e t A t t r i b u t e ( " n a m e " ) ; i f ( ! t ) r e t u r n n u l l ; l e t n ; r e t u r n n = " c h e c k b o x " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? e . c h e c k e d ? 1 : 0 : " T E X T A R E A " = = e . t a g N a m e ? e . v a l u e . s p l i t ( " \ n " ) . f i l t e r ( ( e = > e . t r i m ( ) ) ) : " S E L E C T " = = e . t a g N a m e ? Z c . g e t S e l e c t V a l u e s ( e ) : e . v a l u e , Z c . t o S t a n z a ( ( ( e , t ) = > ` < f i e l d v a r = " $ { e } " > $ { t } < / f i e l d > ` ) ( t , A r r a y . i s A r r a y ( n ) ? n . m a p ( x $ ) : x $ ( n ) ) ) } Z c . w e b F o r m 2 x F o r m = E $ ; v a r A $ = n ( 3 5 4 ) , C $ = { } ; C $ . s t y l e T a g T r a n s f o r m = i _ ( ) , C $ . s e t A t t r i b u t e s = e _ ( ) , C $ . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , C $ . d o m A P I = Q y ( ) , C $ . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( A $ . Z , C $ ) ; A $ . Z & & A $ . Z . l o c a l s & & A $ . Z . l o c a l s ; c o n s t { S t r o p h e : $ $ , s i z z l e : k $ , $ i q : j $ } = A h . e n v , T $ = A h . e n v . u t i l s , I $ = 1 , N $ = 2 ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r e g i s t e r - p a n e l " , c l a s s e x t e n d s G y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { s t a t u s : { t y p e : S t r i n g } , a l e r t _ m e s s a g e : { t y p e : S t r i n g } , a l e r t _ t y p e : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . a l e r t _ t y p e = " i n f o " , t h i s . s e t E r r o r M e s s a g e = e = > t h i s . s e t M e s s a g e ( e , " d a n g e r " ) , t h i s . s e t F e e d b a c k M e s s a g e = e = > t h i s . s e t M e s s a g e ( e , " i n f o " ) } i n i t i a l i z e ( ) { t h i s . r e s e t ( ) , t h i s . l i s t e n T o ( b l , " c o n n e c t i o n I n i t i a l i z e d " , ( ( ) = > t h i s . r e g i s t e r H o o k s ( ) ) ) ; c o n s t e = V l . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) ; e ? t h i s . f e t c h R e g i s t r a t i o n F o r m ( e ) : t h i s . s t a t u s = 0 } r e n d e r ( ) { r e t u r n w $ ( t h i s ) } s e t M e s s a g e ( e , t ) { t h i s . a l e r t _ t y p e = t , t h i s . a l e r t _ m e s s a g e = e } r e g i s t e r H o o k s ( ) { c o n s t e = b l . c o n n e c t i o n , t = e . _ c o n n e c t _ c b . b i n d ( e ) ; e . _ c o n n e c t _ c b = ( e , n , s ) = > { t h i s . _ r e g i s t e r i n g ? t h i s . g e t R e g i s t r a t i o n F i e l d s ( e , n ) & & ( t h i s . _ r e g i s t e r i n g = ! 1 ) : t ( e , n , s ) } } g e t R e g i s t r a t i o n F i e l d s ( e , t ) { c o n s t n = b l . c o n n e c t i o n ; n . c o n n e c t e d = ! 0 ; c o n s t s = n . _ p r o t o . _ r e q T o D a t a ( e ) ; i f ( ! s ) r e t u r n ; i f ( n . _ p r o t o . _ c o n n e c t _ c b ( s ) = = = $ $ . S t a t u s . C O N N F A I L ) r e t u r n t h i s . s t a t u s = 0 , t h i s . s e t E r r o r M e s s a g e ( q y ( " S o r r y , w e ' r e u n a b l e t o c o n n e c t t o y o u r c h o s e n p r o v i d e r . " ) ) , ! 1 ; c o n s t i = s . g e t E l e m e n t s B y T a g N a m e ( " r e g i s t e r " ) , r = s . g e t E l e m e n t s B y T a g N a m e ( " m e c h a n i s m " ) ; i f ( 0 = = = i . l e n g t h & & 0 = = = r . l e n g t h ) r e t u r n n . _ p r o t o . _ n o _ a u t h _ r e c e i v e d ( t ) , ! 1 ; i f ( 0 = = = i . l e n g t h ) r e t u r n n . _ c h a n g e C o n n e c t S t a t u s ( $ $ . S t a t u s . R E G I F A I L ) , t h i s . a l e r t _ t y p e = " d a n g e r " , t h i s . s e t E r r o r M e s s a g e ( q y ( " S o r r y , t h e g i v e n p r o v i d e r d o e s n o t s u p p o r t i n b a n d a c c o u n t r e g i s t r a t i o n . P l e a s e t r y w i t h a d i f f e r e n t p r o v i d e r . " ) ) , ! 0 ; n . _ a d d S y s H a n d l e r ( ( e = > t h i s . o n R e g i s t r a t i o n F i e l d s ( e ) ) , n u l l , " i q " , n u l l , n u l l ) ; c o n s t o = j $ ( { t y p e : " g e t " } ) . c ( " q u e r y " , { x m l n s : $ $ . N S . R E G I S T E R } ) . t r e e ( ) ; r e t u r n o . s e t A t t r i b u t e ( " i d " , n . g e t U n i q u e I d ( " s e n d I Q " ) ) , n . s e n d ( o ) , n . c o n n e c t e d = ! 1 , ! 0 } o n R e g i s t r a t i o n F i e l d s ( e ) { r e t u r n " e r r o r " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? ( t h i s . r e p o r t E r r o r s ( e ) , V l . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) ? t h i s . s t a t u s = 3 : t h i s . s t a t u s = 0 , ! 1 ) : ( t h i s . s e t F i e l d s ( e ) , t h i s . s t a t u s = = = I $ & & t h i s . r e n d e r R e g i s t r a t i o n F o r m ( e ) , ! 1 ) } r e s e t ( e ) { O b j e c t . a s s i g n ( t h i s , { f i e l d s : { } , u r l s : [ ] , t i t l e : " " , i n s t r u c t i o n s : " " , r e g i s t e r e d : ! 1 , _ r e g i s t e r i n g : ! 1 , d o m a i n : n u l l , f o r m _ t y p e : n u l l } ) , e & & O b j e c t . a s s i g n ( t h i s , e ) } o n F o r m S u b m i s s i o n ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , n u l l = = = e . t a r g e t . q u e r y S e l e c t o r ( " i n p u t [ n a m e = d o m a i n ] " ) ? t h i s . s u b m i t R e g i s t r a t i o n F o r m ( e . t a r g e t ) : t h i s . o n P r o v i d e r C h o s e n ( e . t a r g e t ) } o n P r o v i d e r C h o s e n ( e ) { c o n s t t = e . q u e r y S e l e c t o r ( " i n p u t [ n a m e = d o m a i n ] " ) ? . v a l u e ; t & & t h i s . f e t c h R e g i s t r a t i o n F o r m ( t . t r i m ( ) ) } f e t c h R e g i s t r a t i o n F o r m ( e ) { r e t u r n t h i s . s t a t u s = I $ , t h i s . r e s e t ( { d o m a i n : $ $ . g e t D o m a i n F r o m J i d ( e ) , _ r e g i s t e r i n g : ! 0 } ) , L l ( t h i s . d o m a i n ) , b l . c o n n e c t i o n ? . c o n n e c t ( t h i s . d o m a i n , " " , ( e = > t h i s . o n C o n n e c t S t a t u s C h a n g e d ( e ) ) ) , ! 1 } o n C o n n e c t S t a t u s C h a n g e d ( e ) { Y c . d e b u g ( " c o n v e r s e - r e g i s t e r : o n C o n n e c t S t a t u s C h a n g e d " ) , [ $ $ . S t a t u s . D I S C O N N E C T E D , $ $ . S t a t u s . C O N N F A I L , $ $ . S t a t u s . R E G I F A I L , $ $ . S t a t u s . N O T A C C E P T A B L E , $ $ . S t a t u s . C O N F L I C T ] . i n c l u d e s ( e ) ? ( Y c . e r r o r ( ` P r o b l e m d u r i n g r e g i s t r a t i o n : S t r o p h e . S t a t u s i s $ { f o [ e ] } ` ) , t h i s . a b o r t R e g i s t r a t i o n ( ) ) : e = = = $ $ . S t a t u s . R E G I S T E R E D & & ( Y c . d e b u g ( " R e g i s t e r e d s u c c e s s f u l l y . " ) , b l . c o n n e c t i o n . r e s e t ( ) , [ " c o n v e r s e / l o g i n " , " c o n v e r s e / r e g i s t e r " ] . i n c l u d e s ( b l . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) ) & & b l . r o u t e r . n a v i g a t e ( " " , { r e p l a c e : ! 0 } ) , S $ ( " l o g i n " ) , t h i s . f i e l d s . p a s s w o r d & & t h i s . f i e l d s . u s e r n a m e ? ( b l . c o n n e c t i o n . c o n n e c t ( t h i s . f i e l d s . u s e r n a m e . t o L o w e r C a s e ( ) + " @ " + t h i s . d o m a i n . t o L o w e r C a s e ( ) , t h i s . f i e l d s . p a s s w o r d , b l . o n C o n n e c t S t a t u s C h a n g e d ) , t h i s . s e t F e e d b a c k M e s s a g e ( q y ( " N o w l o g g i n g y o u i n " ) ) ) : t h i s . s e t F e e d b a c k M e s s a g e ( q y ( " R e g i s t e r e d s u c c e s s f u l l y " ) ) , t h i s . r e s e t ( ) ) } g e t L e g a c y F o r m F i e l d s ( ) { c o n s t e = O b j e
2022-12-17 22:08:36 +01:00
< form class = "converse-form add-chatroom" @ submit = $ { t => e . openChatRoom ( t ) } >
< div class = "form-group" >
< label for = "chatroom" > $ { i } : < / l a b e l >
2023-12-29 14:11:55 +01:00
$ { r ? nh ` <label class="roomid-policy-error"> ${ r } </label> ` : "" }
2022-12-17 22:08:36 +01:00
< converse - autocomplete
2023-12-29 14:11:55 +01:00
. getAutoCompleteList = $ { U$ }
2022-12-17 22:08:36 +01:00
? autofocus = $ { ! 0 }
min _chars = "3"
position = "below"
placeholder = "${s}"
class = "add-muc-autocomplete"
name = "chatroom" >
< / c o n v e r s e - a u t o c o m p l e t e >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
$ { o ? nh ` <div class="form-group"> ${ lx ( wo ( ) . sanitize ( o , { ALLOWED _TAGS : [ "b" , "br" , "em" ] } ))}</div> ` : "" }
$ { Vl . settings . get ( "locked_muc_nickname" ) ? "" : ( e => { const t = qy ( "Nickname" ) , n = qy ( "This field is required" ) ; return nh `
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label for = "nickname" > $ { t } : < / l a b e l >
< input type = "text"
title = "${n}"
required = "required"
name = "nickname"
value = "${e.model.get(" nick ")||" "}"
class = "form-control" / >
< / d i v >
` })(e)}
< input type = "submit" class = "btn btn-primary" name = "join" value = "${t||" "}" ? disabled = $ { r } / >
< / f o r m >
2023-12-29 14:11:55 +01:00
` };var q $ =n(1602),H $ ={};H $ .styleTagTransform=i_(),H $ .setAttributes=e_(),H $ .insert=Yy().bind(null,"head"),H $ .domAPI=Qy(),H $ .insertStyleElement=n_();Jy()(q $ .Z,H $ );q $ .Z&&q $ .Z.locals&&q $ .Z.locals;const G $ =Ah.env.utils,{Strophe:W $ }=Ah.env;Vl.elements.define("converse-add-muc-modal",class extends tb{initialize(){super.initialize(),this.listenTo(this.model,"change:muc_domain",(()=>this.render())),this.muc_roomid_policy_error_msg=null,this.render(),this.addEventListener("shown.bs.modal",(()=>{this.querySelector('input[name="chatroom"]').focus()}),!1)}renderModal(){return B $ (this)}getModalTitle(){return qy("Enter a new Groupchat")}parseRoomDataFromEvent(e){const t=new FormData(e),n=t.get("chatroom")?.trim();let s;if(Vl.settings.get("locked_muc_nickname")){if(s=bl.getDefaultMUCNickname(),!s)throw new Error("Using locked_muc_nickname but no nickname found!")}else s=t.get("nickname").trim();return{jid:n,nick:s}}openChatRoom(e){if(e.preventDefault(),this.checkRoomidPolicy())return;const t=this.parseRoomDataFromEvent(e.target);let n;""===t.nick&&(t.nick=void 0),Vl.settings.get("locked_muc_domain")||Vl.settings.get("muc_domain")&&!G $ .isValidJID(t.jid)?n= ` $ { W$ . escapeNode ( t . jid ) } @ $ { Vl . settings . get ( "muc_domain" ) } ` :(n=t.jid,this.model.setDomain(n)),Vl.rooms.open(n,Object.assign(t,{jid:n}),!0),e.target.reset(),this.modal.hide()}checkRoomidPolicy(){if(Vl.settings.get("muc_roomid_policy")&&Vl.settings.get("muc_domain")){let e=this.querySelector("converse-autocomplete input").value;!Vl.settings.get("locked_muc_domain")&&G $ .isValidJID(e)||(e= ` $ { W$ . escapeNode ( e ) } @ $ { Vl . settings . get ( "muc_domain" ) } ` );const t=W $ .getNodeFromJid(e),n=W $ .getDomainFromJid(e);if(Vl.settings.get("muc_domain")===n&&!Vl.settings.get("muc_roomid_policy").test(t))return this.muc_roomid_policy_error_msg=qy("Groupchat id is invalid."),!0;this.muc_roomid_policy_error_msg=null,this.render()}}});const V $ =function(e){return e&&e.length?e[0]:void 0},J $ =e=>{const t=qy("Description:"),n=qy("Groupchat XMPP Address:"),s=qy("Participants:"),i=qy("Features:"),r=qy("Requires authentication"),o=qy("Hidden"),a=qy("Requires an invitation"),c=qy("Moderated"),l=qy("Non-anonymous"),d=qy("Open"),u=qy("Permanent"),h=qy("Public"),m=qy("Semi-anonymous"),f=qy("Temporary"),g=qy("Unmoderated");return nh `
2023-02-17 12:24:37 +01:00
< div class = "room-info" >
< p class = "room-info" > < strong > $ { n } < / s t r o n g > $ { e . j i d } < / p >
< p class = "room-info" > < strong > $ { t } < / s t r o n g > $ { e . d e s c } < / p >
< p class = "room-info" > < strong > $ { s } < / s t r o n g > $ { e . o c c } < / p >
< p class = "room-info" > < strong > $ { i } < / s t r o n g >
< ul >
2023-12-29 14:11:55 +01:00
$ { e . passwordprotected ? nh ` <li class="room-info locked"> ${ r } </li> ` : "" }
$ { e . hidden ? nh ` <li class="room-info"> ${ o } </li> ` : "" }
$ { e . membersonly ? nh ` <li class="room-info"> ${ a } </li> ` : "" }
$ { e . moderated ? nh ` <li class="room-info"> ${ c } </li> ` : "" }
$ { e . nonanonymous ? nh ` <li class="room-info"> ${ l } </li> ` : "" }
$ { e . open ? nh ` <li class="room-info"> ${ d } </li> ` : "" }
$ { e . persistent ? nh ` <li class="room-info"> ${ u } </li> ` : "" }
$ { e . publicroom ? nh ` <li class="room-info"> ${ h } </li> ` : "" }
$ { e . semianonymous ? nh ` <li class="room-info"> ${ m } </li> ` : "" }
$ { e . temporary ? nh ` <li class="room-info"> ${ f } </li> ` : "" }
$ { e . unmoderated ? nh ` <li class="room-info"> ${ g } </li> ` : "" }
2023-02-17 12:24:37 +01:00
< / u l >
< / p >
< / d i v >
2023-12-29 14:11:55 +01:00
` },Z $ =e=>nh `
$ { e . show _form ? ( e => { const t = qy ( "Show groupchats" ) , n = qy ( "Server address" ) ; return nh `
2021-11-11 22:06:49 +01:00
< form class = "converse-form list-chatrooms"
@ submit = $ { e . submitForm } >
< div class = "form-group" >
< label for = "chatroom" > $ { n } : < / l a b e l >
< input type = "text"
2022-12-17 22:08:36 +01:00
autofocus
2021-11-11 22:06:49 +01:00
@ change = $ { e . setDomainFromEvent }
value = "${e.muc_domain||" "}"
required = "required"
name = "server"
class = "form-control"
placeholder = "${e.server_placeholder}" / >
< / d i v >
< input type = "submit" class = "btn btn-primary" name = "list" value = "${t}" / >
< / f o r m >
` })(e):""}
2022-12-17 22:08:36 +01:00
< ul class = "available-chatrooms list-group" >
2023-12-29 14:11:55 +01:00
$ { e . loading _items ? nh ` <li class="list-group-item"> ${ Sb ( ) } </li> ` : "" }
$ { e . feedback _text ? nh ` <li class="list-group-item active"> ${ e . feedback _text } </li> ` : "" }
$ { Mw ( e . items , ( e => e . jid ) , ( t => ( ( e , t ) => { const n = qy ( "Show more information on this groupchat" ) , s = qy ( "Click to open this groupchat" ) ; return nh `
2021-11-11 22:06:49 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
2022-12-17 22:08:36 +01:00
@ click = $ { e . openRoom }
data - room - jid = "${t.jid}"
data - room - name = "${t.name}"
title = "${s}"
href = "#" > $ { t . name || t . jid } < / a >
< a class = "right room-info icon-room-info"
@ click = $ { e . toggleRoomInfo }
data - room - jid = "${t.jid}"
title = "${n}"
href = "#" > < / a >
2021-11-11 22:06:49 +01:00
< / d i v >
< / l i >
` })(e,t)))}
2022-12-17 22:08:36 +01:00
< / u l >
2023-12-29 14:11:55 +01:00
` ,{Strophe:Q $ , $ iq:K $ ,sizzle:Y $ }=Ah.env,X $ =Ah.env.utils;function ek(e){const t=X $ .ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(X $ .slideIn(n).then(X $ .removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",X $ .getElementFromTemplateResult(Sb())),Vl.disco.info(e.target.getAttribute("data-room-jid"),null).then((e=>function(e,t){e.querySelector("span.spinner").remove(),e.querySelector("a.room-info").classList.add("selected"),e.insertAdjacentHTML("beforeEnd",X $ .getElementFromTemplateResult(J $ ({jid:t.getAttribute("from"),desc:V $ (Y $ ('field[var="muc#roominfo_description"] value',t))?.textContent,occ:V $ (Y $ ('field[var="muc#roominfo_occupants"] value',t))?.textContent,hidden:Y $ ('feature[var="muc_hidden"]',t).length,membersonly:Y $ ('feature[var="muc_membersonly"]',t).length,moderated:Y $ ('feature[var="muc_moderated"]',t).length,nonanonymous:Y $ ('feature[var="muc_nonanonymous"]',t).length,open:Y $ ('feature[var="muc_open"]',t).length,passwordprotected:Y $ ('feature[var="muc_passwordprotected"]',t).length,persistent:Y $ ('feature[var="muc_persistent"]',t).length,publicroom:Y $ ('feature[var="muc_publicroom"]',t).length,semianonymous:Y $ ('feature[var="muc_semianonymous"]',t).length,temporary:Y $ ('feature[var="muc_temporary"]',t).length,unmoderated:Y $ ('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>Yc.error(e))))}function tk(e){return Oc()&&!e.get("hidden")}Vl.elements.define("converse-muc-list-modal",class extends tb{constructor(e){super(e),this.items=[],this.loading_items=!1}initialize(){super.initialize(),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.listenTo(this.model,"change:feedback_text",(()=>this.render())),this.addEventListener("shown.bs.modal",(()=>Vl.settings.get("locked_muc_domain")&&this.updateRoomsList())),this.model.save("feedback_text","")}renderModal(){return Z $ (Object.assign(this.model.toJSON(),{show_form:!Vl.settings.get("locked_muc_domain"),server_placeholder:this.model.get("muc_domain")||qy("conference.example.org"),items:this.items,loading_items:this.loading_items,openRoom:e=>this.openRoom(e),setDomainFromEvent:e=>this.setDomainFromEvent(e),submitForm:e=>this.showRooms(e),toggleRoomInfo:e=>this.toggleRoomInfo(e)}))}getModalTitle(){return qy("Query for Groupchats")}openRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid"),n=e.target.getAttribute("data-room-name");this.modal.hide(),Vl.rooms.open(t,{name:n},!0)}toggleRoomInfo(e){e.preventDefault(),ek(e)}onDomainChange(){Vl.settings.get("auto_list_rooms")&&this.updateRoomsList()}onRoomsFound(e){this.loading_items=!1;const t=e?Y $ ("query item",e):[];return t.length?(this.model.set({feedback_text:qy("Groupchats found")},{silent:!0}),this.items=t.map(pm)):(this.items=[],this.model.set({feedback_text:qy("No groupchats found")},{silent:!0})),this.render(),!0}updateRoomsList(){const e=K $ ({to:this.model.get("muc_domain"),from:bl.connection.jid,type:"get"}).c("query",{xmlns:Q $ .NS.DISCO_ITEMS});Vl.sendIQ(e).then((e=>this.onRoomsFound(e))).catch((()=>this.onRoomsFound()))}showRooms(e){e.preventDefault(),this.loading_items=!0,this.render();const t=new FormData(e.target);this.model.setDomain(t.get("server")),this.updateRoomsList()}setDomainFromEvent(e){this.model.setDomain(e.target.value)}setNick(e){this.model.save({nick:e.target.value})}});function nk(e,t){const n=qy("Leave this groupchat"),s=t.get("num_unread_general")||t.get("has_activity");return nh `
< div class = "list-item controlbox-padded available-chatroom d-flex flex-row ${tk(t)?" open ":" "} ${s?" unread - msgs ":" "}"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}" >
2021-03-19 19:26:15 +01:00
2023-12-29 14:11:55 +01:00
$ { t . get ( "num_unread" ) ? ( e => nh ` <span class="list-item-badge badge badge--muc msgs-indicator"> ${ e . get ( "num_unread" ) } </span> ` ) ( t ) : t . get ( "has_activity" ) ? nh ` <span class="list-item-badge badge badge--muc msgs-indicator"></span> ` : "" }
2021-11-11 22:06:49 +01:00
2021-03-19 19:26:15 +01:00
< a class = "list-item-link open-room available-room w-100"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
2023-12-29 14:11:55 +01:00
title = "${qy(" Click to open this groupchat ")}"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . openRoom ( t ) } > $ { t . getDisplayName ( ) } < / a >
2022-12-17 22:08:36 +01:00
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "allow_bookmarks" ) ? function ( e ) { const t = e . get ( "bookmarked" ) ? ? ! 1 , n = qy ( "Bookmark" ) ; return nh `
2023-02-17 12:24:37 +01:00
< a class = "list-item-action add-bookmark"
data - room - jid = "${e.get(" jid ")}"
data - bookmark - name = "${e.getDisplayName()}"
@ click = $ { e => xw ( e ) }
title = "${n}" >
2022-12-17 22:08:36 +01:00
2023-02-17 12:24:37 +01:00
< converse - icon class = "fa ${t?" fa - bookmark ":" fa - bookmark - empty "}"
size = "1.2em"
2023-12-29 14:11:55 +01:00
color = "${tk(e)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< / a > ` } ( t ) : " " }
2021-03-19 19:26:15 +01:00
2022-12-17 22:08:36 +01:00
< a class = "list-item-action room-info"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
2023-12-29 14:11:55 +01:00
title = "${qy(" Show more information on this groupchat ")}"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . showRoomDetailsModal ( t ) } >
2021-03-19 19:26:15 +01:00
2023-12-29 14:11:55 +01:00
< converse - icon class = "fa fa-info-circle" size = "1.2em" color = "${tk(t)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
2022-12-17 22:08:36 +01:00
< / a >
< a class = "list-item-action close-room"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
data - room - name = "${t.getDisplayName()}"
title = "${n}"
@ click = $ { t => e . closeRoom ( t ) } >
2023-12-29 14:11:55 +01:00
< converse - icon class = "fa fa-sign-out-alt" size = "1.2em" color = "${tk(t)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
2022-12-17 22:08:36 +01:00
< / a >
2023-12-29 14:11:55 +01:00
< / d i v > ` } c o n s t { S t r o p h e : s k , u : i k } = A h . e n v ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o o m s - l i s t " , c l a s s e x t e n d s G y { i n i t i a l i z e ( ) { c o n s t e = ` c o n v e r s e . r o o m s p a n e l $ { b l . b a r e _ j i d } ` ; t h i s . m o d e l = n e w D $ ( { i d : e } ) , v c ( t h i s . m o d e l , e ) , t h i s . m o d e l . f e t c h ( ) , t h i s . l i s t e n T o ( b l . c h a t b o x e s , " a d d " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( b l . c h a t b o x e s , " r e m o v e " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( b l . c h a t b o x e s , " d e s t r o y " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( b l . c h a t b o x e s , " c h a n g e " , t h i s . r e n d e r I f R e l e v a n t C h a n g e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t { c h a t b o x e s : t , C H A T R O O M S _ T Y P E : n , C L O S E D : s } = b l , i = t . f i l t e r ( ( e = > e . g e t ( " t y p e " ) = = = n ) ) ; i . s o r t ( ( ( e , t ) = > e . g e t D i s p l a y N a m e ( ) . t o L o w e r C a s e ( ) < = t . g e t D i s p l a y N a m e ( ) . t o L o w e r C a s e ( ) ? - 1 : 1 ) ) ; c o n s t r = q y ( " C l i c k t o t o g g l e t h e l i s t o f o p e n g r o u p c h a t s " ) , o = q y ( " G r o u p c h a t s " ) , a = q y ( " Q u e r y f o r g r o u p c h a t s " ) , c = q y ( " A d d a n e w g r o u p c h a t " ) , l = q y ( " S h o w b o o k m a r k e d g r o u p c h a t s " ) , d = e . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = s ; r e t u r n n h `
2022-05-05 23:06:17 +02:00
< div class = "d-flex controlbox-padded" >
2022-12-17 22:08:36 +01:00
< span class = "w-100 controlbox-heading controlbox-heading--groupchats" >
2023-02-17 12:24:37 +01:00
< a class = "list-toggle open-rooms-toggle" title = "${r}" @ click = $ { t => e . toggleRoomsList ( t ) } >
2022-12-17 22:08:36 +01:00
< converse - icon
2023-02-17 12:24:37 +01:00
class = "fa ${d?" fa - caret - right ":" fa - caret - down "}"
2022-12-17 22:08:36 +01:00
size = "1em"
color = "var(--muc-color)" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
$ { o }
2022-12-17 22:08:36 +01:00
< / a >
< / s p a n >
< a class = "controlbox-heading__btn show-bookmark-list-modal"
2023-12-29 14:11:55 +01:00
@ click = $ { t => Vl . modal . show ( "converse-bookmark-list-modal" , { model : e . model } , t ) }
2023-02-17 12:24:37 +01:00
title = "${l}"
2022-12-17 22:08:36 +01:00
data - toggle = "modal" >
< converse - icon class = "fa fa-bookmark right" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2022-05-05 23:06:17 +02:00
< a class = "controlbox-heading__btn show-list-muc-modal"
2023-12-29 14:11:55 +01:00
@ click = $ { t => Vl . modal . show ( "converse-muc-list-modal" , { model : e . model } , t ) }
2023-02-17 12:24:37 +01:00
title = "${a}" data - toggle = "modal" data - target = "#muc-list-modal" >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-list-ul right" size = "1em" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< / a >
< a class = "controlbox-heading__btn show-add-muc-modal"
2023-12-29 14:11:55 +01:00
@ click = $ { t => Vl . modal . show ( "converse-add-muc-modal" , { model : e . model } , t ) }
2023-02-17 12:24:37 +01:00
title = "${c}" data - toggle = "modal" data - target = "#add-chatrooms-modal" >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-plus right" size = "1em" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< / a >
< / d i v >
2023-02-17 12:24:37 +01:00
< div class = "list-container list-container--openrooms ${i.length?" ":" hidden "}" >
< div class = "items-list rooms-list open-rooms-list ${d?" collapsed ":" "}" >
2023-12-29 14:11:55 +01:00
$ { i . map ( ( t => nk ( e , t ) ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< / d i v > ` } ) ( t h i s ) } r e n d e r I f C h a t R o o m ( e ) { i k . i s C h a t R o o m ( e ) & & t h i s . r e q u e s t U p d a t e ( ) } r e n d e r I f R e l e v a n t C h a n g e ( e ) { c o n s t t = [ " b o o k m a r k e d " , " h i d d e n " , " n a m e " , " n u m _ u n r e a d " , " n u m _ u n r e a d _ g e n e r a l " , " h a s _ a c t i v i t y " ] , n = e . c h a n g e d | | { } ; i k . i s C h a t R o o m ( e ) & & O b j e c t . k e y s ( n ) . f i l t e r ( ( e = > t . i n c l u d e s ( e ) ) ) . l e n g t h & & t h i s . r e q u e s t U p d a t e ( ) } s h o w R o o m D e t a i l s M o d a l ( e ) { c o n s t t = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , n = b l . c h a t b o x e s . g e t ( t ) ; e . p r e v e n t D e f a u l t ( ) , V l . m o d a l . s h o w ( " c o n v e r s e - m u c - d e t a i l s - m o d a l " , { m o d e l : n } , e ) } a s y n c o p e n R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . t e x t C o n t e n t , n = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , s = { n a m e : t | | s k . u n e s c a p e N o d e ( s k . g e t N o d e F r o m J i d ( n ) ) | | n } ; a w a i t V l . r o o m s . o p e n ( n , s , ! 0 ) } a s y n c c l o s e R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - n a m e " ) , n = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) ; i f ( a w a i t V l . c o n f i r m ( q y ( " A r e y o u s u r e y o u w a n t t o l e a v e t h e g r o u p c h a t % 1 $ s ? " , t ) ) ) { ( a w a i t V l . r o o m s . g e t ( n ) ) . c l o s e ( ) } } t o g g l e R o o m s L i s t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " . o p e n - r o o m s - l i s t " ) ; t h i s . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = b l . C L O S E D ? i k . s l i d e O u t ( t ) . t h e n ( ( ( ) = > t h i s . m o d e l . s a v e ( { t o g g l e _ s t a t e : b l . O P E N E D } ) ) ) : i k . s l i d e I n ( t ) . t h e n ( ( ( ) = > t h i s . m o d e l . s a v e ( { t o g g l e _ s t a t e : b l . C L O S E D } ) ) ) } } ) , A h . p l u g i n s . a d d ( " c o n v e r s e - r o o m s l i s t " , { d e p e n d e n c i e s : [ " c o n v e r s e - s i n g l e t o n " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - m u c " , " c o n v e r s e - b o o k m a r k s " ] , i n i t i a l i z e ( ) { } } ) ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - f o n t a w e s o m e " , c l a s s e x t e n d s G y { r e n d e r ( ) { r e t u r n n h `
2021-11-11 22:06:49 +01:00
< ? xml version = "1.0" encoding = "UTF-8" ? >
<!--
Font Awesome Free 5.13 . 0 by @ fontawesome - https : //fontawesome.com
License - https : //fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
-- >
< svg xmlns = "http://www.w3.org/2000/svg" style = "display: none;" >
< symbol id = "icon-address-book" viewBox = "0 0 448 512" >
< path d = "M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-down" viewBox = "0 0 320 512" >
< path d = "M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-left" viewBox = "0 0 448 512" >
< path d = "M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-right" viewBox = "0 0 448 512" >
< path d = "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-up" viewBox = "0 0 320 512" >
< path d = "M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-down" viewBox = "0 0 320 512" >
< path d = "M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-left" viewBox = "0 0 256 512" >
< path d = "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-right" viewBox = "0 0 256 512" >
< path d = "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-up" viewBox = "0 0 320 512" >
< path d = "M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-down" viewBox = "0 0 512 512" >
< path d = "M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zM212 140v116h-70.9c-10.7 0-16.1 13-8.5 20.5l114.9 114.3c4.7 4.7 12.2 4.7 16.9 0l114.9-114.3c7.6-7.6 2.2-20.5-8.5-20.5H300V140c0-6.6-5.4-12-12-12h-64c-6.6 0-12 5.4-12 12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-left" viewBox = "0 0 512 512" >
< path d = "M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm116-292H256v-70.9c0-10.7-13-16.1-20.5-8.5L121.2 247.5c-4.7 4.7-4.7 12.2 0 16.9l114.3 114.9c7.6 7.6 20.5 2.2 20.5-8.5V300h116c6.6 0 12-5.4 12-12v-64c0-6.6-5.4-12-12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-right" viewBox = "0 0 512 512" >
< path d = "M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zM140 300h116v70.9c0 10.7 13 16.1 20.5 8.5l114.3-114.9c4.7-4.7 4.7-12.2 0-16.9l-114.3-115c-7.6-7.6-20.5-2.2-20.5 8.5V212H140c-6.6 0-12 5.4-12 12v64c0 6.6 5.4 12 12 12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-up" viewBox = "0 0 512 512" >
< path d = "M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm292 116V256h70.9c10.7 0 16.1-13 8.5-20.5L264.5 121.2c-4.7-4.7-12.2-4.7-16.9 0l-115 114.3c-7.6 7.6-2.2 20.5 8.5 20.5H212v116c0 6.6 5.4 12 12 12h64c6.6 0 12-5.4 12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-down" viewBox = "0 0 512 512" >
< path d = "M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-left" viewBox = "0 0 512 512" >
< path d = "M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm28.9-143.6L209.4 288H392c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24H209.4l75.5-72.4c9.7-9.3 9.9-24.8.4-34.3l-11-10.9c-9.4-9.4-24.6-9.4-33.9 0L107.7 239c-9.4 9.4-9.4 24.6 0 33.9l132.7 132.7c9.4 9.4 24.6 9.4 33.9 0l11-10.9c9.5-9.5 9.3-25-.4-34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-right" viewBox = "0 0 512 512" >
< path d = "M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-up" viewBox = "0 0 512 512" >
< path d = "M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm143.6 28.9l72.4-75.5V392c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V209.4l72.4 75.5c9.3 9.7 24.8 9.9 34.3.4l10.9-11c9.4-9.4 9.4-24.6 0-33.9L273 107.7c-9.4-9.4-24.6-9.4-33.9 0L106.3 240.4c-9.4 9.4-9.4 24.6 0 33.9l10.9 11c9.6 9.5 25.1 9.3 34.4-.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-down" viewBox = "0 0 448 512" >
< path d = "M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-left" viewBox = "0 0 448 512" >
< path d = "M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-right" viewBox = "0 0 448 512" >
< path d = "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-up" viewBox = "0 0 448 512" >
< path d = "M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt" viewBox = "0 0 512 512" >
< path d = "M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-h" viewBox = "0 0 512 512" >
< path d = "M377.941 169.941V216H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.568 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296h243.882v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.568 0-33.941l-86.059-86.059c-15.119-15.12-40.971-4.412-40.971 16.97z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-v" viewBox = "0 0 256 512" >
< path d = "M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bars" viewBox = "0 0 448 512" >
< path d = "M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bookmark" viewBox = "0 0 384 512" >
< path d = "M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z" > < / p a t h >
< / s y m b o l >
2023-02-17 12:24:37 +01:00
< symbol id = "icon-bookmark-empty" viewBox = "0 0 384 512" >
< path d = "M0 48C0 21.5 21.5 0 48 0l0 48V441.4l130.1-92.9c8.3-6 19.6-6 27.9 0L336 441.4V48H48V0H336c26.5 0 48 21.5 48 48V488c0 9-5 17.2-13 21.3s-17.6 3.4-24.9-1.8L192 397.5 37.9 507.5c-7.3 5.2-16.9 5.9-24.9 1.8S0 497 0 488V48z" / >
< / s y m b o l >
2021-11-11 22:06:49 +01:00
< symbol id = "icon-caret-down" viewBox = "0 0 320 512" >
< path d = "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-caret-right" viewBox = "0 0 192 512" >
< path d = "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-check" viewBox = "0 0 512 512" >
< path d = "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-cog" viewBox = "0 0 512 512" >
< path d = "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-database" viewBox = "0 0 448 512" >
< path d = "M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-edit" viewBox = "0 0 576 512" >
< path d = "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye" viewBox = "0 0 576 512" >
< path d = "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye-slash" viewBox = "0 0 640 512" >
< path d = "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-gavel" viewBox = "0 0 512 512" >
< path d = "M504.971 199.362l-22.627-22.627c-9.373-9.373-24.569-9.373-33.941 0l-5.657 5.657L329.608 69.255l5.657-5.657c9.373-9.373 9.373-24.569 0-33.941L312.638 7.029c-9.373-9.373-24.569-9.373-33.941 0L154.246 131.48c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l5.657-5.657 39.598 39.598-81.04 81.04-5.657-5.657c-12.497-12.497-32.758-12.497-45.255 0L9.373 412.118c-12.497 12.497-12.497 32.758 0 45.255l45.255 45.255c12.497 12.497 32.758 12.497 45.255 0l114.745-114.745c12.497-12.497 12.497-32.758 0-45.255l-5.657-5.657 81.04-81.04 39.598 39.598-5.657 5.657c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l124.451-124.451c9.372-9.372 9.372-24.568 0-33.941z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-globe" viewBox = "0 0 496 512" >
< path d = "M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card" viewBox = "0 0 576 512" >
< path d = "M528 32H48C21.5 32 0 53.5 0 80v16h576V80c0-26.5-21.5-48-48-48zM0 432c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V128H0v304zm352-232c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zM176 192c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zM67.1 396.2C75.5 370.5 99.6 352 128 352h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.9-5.2 19.8-15.6 19.8H82.7c-10.4 0-18.8-10-15.6-19.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card-alt" viewBox = "0 0 576 512" >
< path d = "M528 64H384v96H192V64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM288 224c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm93.3 224H194.7c-10.4 0-18.8-10-15.6-19.8 8.3-25.6 32.4-44.2 60.9-44.2h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.8-5.2 19.8-15.6 19.8zM352 32c0-17.7-14.3-32-32-32h-64c-17.7 0-32 14.3-32 32v96h128V32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info" viewBox = "0 0 192 512" >
< path d = "M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-list-ul" viewBox = "0 0 512 512" >
< path d = "M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock" viewBox = "0 0 448 512" >
< path d = "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock-open" viewBox = "0 0 576 512" >
< path d = "M423.5 0C339.5.3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus" viewBox = "0 0 448 512" >
< path d = "M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-square" viewBox = "0 0 448 512" >
< path d = "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paper-plane" viewBox = "0 0 512 512" >
< path d = "M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paperclip" viewBox = "0 0 448 512" >
< path d = "M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-pencil-alt" viewBox = "0 0 512 512" >
< path d = "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-phone" viewBox = "0 0 512 512" >
< path d = "M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus" viewBox = "0 0 448 512" >
< path d = "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-square" viewBox = "0 0 448 512" >
< path d = "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-save" viewBox = "0 0 448 512" >
< path d = "M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sign-out-alt" viewBox = "0 0 512 512" >
< path d = "M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-smile" viewBox = "0 0 496 512" >
< path d = "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-snowflake" viewBox = "0 0 448 512" >
< path d = "M440.3 345.2l-33.8-19.5 26-7c8.2-2.2 13.1-10.7 10.9-18.9l-4-14.9c-2.2-8.2-10.7-13.1-18.9-10.9l-70.8 19-63.9-37 63.8-36.9 70.8 19c8.2 2.2 16.7-2.7 18.9-10.9l4-14.9c2.2-8.2-2.7-16.7-10.9-18.9l-26-7 33.8-19.5c7.4-4.3 9.9-13.7 5.7-21.1L430.4 119c-4.3-7.4-13.7-9.9-21.1-5.7l-33.8 19.5 7-26c2.2-8.2-2.7-16.7-10.9-18.9l-14.9-4c-8.2-2.2-16.7 2.7-18.9 10.9l-19 70.8-62.8 36.2v-77.5l53.7-53.7c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0L256 56.4V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v40.4l-19.7-19.7c-6.2-6.2-16.4-6.2-22.6 0L138.3 48c-6.3 6.2-6.3 16.4 0 22.6l53.7 53.7v77.5l-62.8-36.2-19-70.8c-2.2-8.2-10.7-13.1-18.9-10.9l-14.9 4c-8.2 2.2-13.1 10.7-10.9 18.9l7 26-33.8-19.5c-7.4-4.3-16.8-1.7-21.1 5.7L2.1 145.7c-4.3 7.4-1.7 16.8 5.7 21.1l33.8 19.5-26 7c-8.3 2.2-13.2 10.7-11 19l4 14.9c2.2 8.2 10.7 13.1 18.9 10.9l70.8-19 63.8 36.9-63.8 36.9-70.8-19c-8.2-2.2-16.7 2.7-18.9 10.9l-4 14.9c-2.2 8.2 2.7 16.7 10.9 18.9l26 7-33.8 19.6c-7.4 4.3-9.9 13.7-5.7 21.1l15.5 26.8c4.3 7.4 13.7 9.9 21.1 5.7l33.8-19.5-7 26c-2.2 8.2 2.7 16.7 10.9 18.9l14.9 4c8.2 2.2 16.7-2.7 18.9-10.9l19-70.8 62.8-36.2v77.5l-53.7 53.7c-6.3 6.2-6.3 16.4 0 22.6l11.3 11.3c6.2 6.2 16.4 6.2 22.6 0l19.7-19.7V496c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-40.4l19.7 19.7c6.2 6.2 16.4 6.2 22.6 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6L256 387.7v-77.5l62.8 36.2 19 70.8c2.2 8.2 10.7 13.1 18.9 10.9l14.9-4c8.2-2.2 13.1-10.7 10.9-18.9l-7-26 33.8 19.5c7.4 4.3 16.8 1.7 21.1-5.7l15.5-26.8c4.3-7.3 1.8-16.8-5.6-21z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-spinner" viewBox = "0 0 512 512" >
< path d = "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sync" viewBox = "0 0 512 512" >
< path d = "M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times" viewBox = "0 0 352 512" >
< path d = "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash" viewBox = "0 0 448 512" >
< path d = "M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash-alt" viewBox = "0 0 448 512" >
< path d = "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-unlock" viewBox = "0 0 448 512" >
< path d = "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user" viewBox = "0 0 448 512" >
< path d = "M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-cog" viewBox = "0 0 640 512" >
< path d = "M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-plus" viewBox = "0 0 640 512" >
< path d = "M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-secret" viewBox = "0 0 448 512" >
< path d = "M383.9 308.3l23.9-62.6c4-10.5-3.7-21.7-15-21.7h-58.5c11-18.9 17.8-40.6 17.8-64v-.3c39.2-7.8 64-19.1 64-31.7 0-13.3-27.3-25.1-70.1-33-9.2-32.8-27-65.8-40.6-82.8-9.5-11.9-25.9-15.6-39.5-8.8l-27.6 13.8c-9 4.5-19.6 4.5-28.6 0L182.1 3.4c-13.6-6.8-30-3.1-39.5 8.8-13.5 17-31.4 50-40.6 82.8-42.7 7.9-70 19.7-70 33 0 12.6 24.8 23.9 64 31.7v.3c0 23.4 6.8 45.1 17.8 64H56.3c-11.5 0-19.2 11.7-14.7 22.3l25.8 60.2C27.3 329.8 0 372.7 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-48.4-25.8-90.4-64.1-114.1zM176 480l-41.6-192 49.6 32 24 40-32 120zm96 0l-32-120 24-40 49.6-32L272 480zm41.7-298.5c-3.9 11.9-7 24.6-16.5 33.4-10.1 9.3-48 22.4-64-25-2.8-8.4-15.4-8.4-18.3 0-17 50.2-56 32.4-64 25-9.5-8.8-12.7-21.5-16.5-33.4-.8-2.5-6.3-5.7-6.3-5.8v-10.8c28.3 3.6 61 5.8 96 5.8s67.7-2.1 96-5.8v10.8c-.1.1-5.6 3.2-6.4 5.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-users" viewBox = "0 0 640 512" >
< path d = "M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-wrench" viewBox = "0 0 512 512" >
< path d = "M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z" > < / p a t h >
< / s y m b o l >
2022-04-02 21:20:14 +02:00
< symbol id = "icon-refresh" viewBox = "0 0 512 512" >
< path d = "M464 16c-17.67 0-32 14.31-32 32v74.09C392.1 66.52 327.4 32 256 32C161.5 32 78.59 92.34 49.58 182.2c-5.438 16.81 3.797 34.88 20.61 40.28c16.89 5.5 34.88-3.812 40.3-20.59C130.9 138.5 189.4 96 256 96c50.5 0 96.26 24.55 124.4 64H336c-17.67 0-32 14.31-32 32s14.33 32 32 32h128c17.67 0 32-14.31 32-32V48C496 30.31 481.7 16 464 16zM441.8 289.6c-16.92-5.438-34.88 3.812-40.3 20.59C381.1 373.5 322.6 416 256 416c-50.5 0-96.25-24.55-124.4-64H176c17.67 0 32-14.31 32-32s-14.33-32-32-32h-128c-17.67 0-32 14.31-32 32v144c0 17.69 14.33 32 32 32s32-14.31 32-32v-74.09C119.9 445.5 184.6 480 255.1 480c94.45 0 177.4-60.34 206.4-150.2C467.9 313 458.6 294.1 441.8 289.6z" > < / p a t h >
< / s y m b o l >
2021-11-11 22:06:49 +01:00
< / s v g >
2023-12-29 14:11:55 +01:00
` }});function rk(){if(!Vl.settings.get("auto_insert"))return;const e=Vl.settings.get("root");if(!e.querySelector("converse-root")){const t=document.createElement("converse-root"),n=e.querySelector("body");n?n.appendChild(t):e.appendChild(t)}}var ok=n(4412),ak={};ak.styleTagTransform=i_(),ak.setAttributes=e_(),ak.insert=Yy().bind(null,"head"),ak.domAPI=Qy(),ak.insertStyleElement=n_();Jy()(ok.Z,ak);ok.Z&&ok.Z.locals&&ok.Z.locals;class ck extends Gy{render(){return(()=>{const e=Vl.settings.get("singleton")?["converse-singleton"]:[];return e.push( ` converse - $ { Vl . settings . get ( "view_mode" ) } ` ),nh `
2022-01-03 11:54:10 +01:00
< converse - chats class = "converse-chatboxes row no-gutters ${e.join(" ")}" > < / c o n v e r s e - c h a t s >
2021-11-11 22:06:49 +01:00
< div id = "converse-modals" class = "modals" > < / d i v >
< converse - fontawesome > < / c o n v e r s e - f o n t a w e s o m e >
2023-12-29 14:11:55 +01:00
` })()}initialize(){this.setAttribute("id","conversejs"),this.setClasses();const e=wc();this.listenTo(e,"change:view_mode",(()=>this.setClasses())),this.listenTo(e,"change:singleton",(()=>this.setClasses())),window.matchMedia("(prefers-color-scheme: dark)").addListener((()=>this.setClasses())),window.matchMedia("(prefers-color-scheme: light)").addListener((()=>this.setClasses()))}setClasses(){this.className="",this.classList.add("conversejs"),this.classList.add( ` converse - $ { Vl . settings . get ( "view_mode" ) } ` ),this.classList.add( ` theme - $ { window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ? Vl . settings . get ( "dark_theme" ) : Vl . settings . get ( "theme" ) } ` ),this.requestUpdate()}}Ah.plugins.add("converse-rootview",{initialize(){Vl.settings.extend({auto_insert:!0,theme:"classic",dark_theme:"dracula"}),Vl.listen.on("chatBoxesInitialized",rk),Vl.elements.define("converse-root",ck)}});const lk=e=>{const t=qy("Add"),n=qy("name@example.org"),s=qy("Please enter a valid XMPP address"),i=qy("Group"),r=qy("Name"),o=qy("XMPP Address");return nh `
2022-12-17 22:08:36 +01:00
< form class = "converse-form add-xmpp-contact" @ submit = $ { t => e . addContactFromForm ( t ) } >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "form-group add-xmpp-contact__jid" >
< label class = "clearfix" for = "jid" > $ { o } : < / l a b e l >
< div class = "suggestion-box suggestion-box__jid" >
< ul class = "suggestion-box__results suggestion-box__results--below" hidden = "" > < / u l >
2023-12-29 14:11:55 +01:00
< input type = "text" name = "jid" ? required = $ { ! Vl . settings . get ( "xhr_user_search_url" ) }
2022-12-17 22:08:36 +01:00
value = "${e.model.get(" jid ")||" "}"
class = "form-control suggestion-box__input"
placeholder = "${n}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "form-group add-xmpp-contact__name" >
< label class = "clearfix" for = "name" > $ { r } : < / l a b e l >
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< input type = "text" name = "name" value = "${e.model.get(" nickname ")||" "}"
class = "form-control suggestion-box__input" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group add-xmpp-contact__group" >
< label class = "clearfix" for = "name" > $ { i } : < / l a b e l >
2023-12-29 14:11:55 +01:00
< converse - autocomplete . list = $ { function ( ) { const { roster : e } = bl , t = e . reduce ( ( ( e , t ) => e . concat ( t . get ( "groups" ) ) ) , [ ] ) ; return [ ... new Set ( t . filter ( ( e => e ) ) ) ] } ( ) } name = "group" > < / c o n v e r s e - a u t o c o m p l e t e >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" > < div class = "invalid-feedback" > $ { s } < / d i v > < / d i v >
< button type = "submit" class = "btn btn-primary" > $ { t } < / b u t t o n >
2021-03-19 19:26:15 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
< / f o r m > ` } ; V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - a d d - c o n t a c t - m o d a l " , c l a s s e x t e n d s t b { i n i t i a l i z e ( ) { s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e n d e r ( ) ) ) , t h i s . r e n d e r ( ) , t h i s . a d d E v e n t L i s t e n e r ( " s h o w n . b s . m o d a l " , ( ( ) = > t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) ? . f o c u s ( ) ) , ! 1 ) } r e n d e r M o d a l ( ) { r e t u r n l k ( t h i s ) } g e t M o d a l T i t l e ( ) { r e t u r n q y ( " A d d a C o n t a c t " ) } a f t e r R e n d e r ( ) { " s t r i n g " = = t y p e o f V l . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) ? t h i s . i n i t X H R A u t o C o m p l e t e ( ) : t h i s . i n i t J I D A u t o C o m p l e t e ( ) } i n i t J I D A u t o C o m p l e t e ( ) { i f ( ! V l . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ j i d " ) . p a r e n t E l e m e n t ; t h i s . j i d _ a u t o _ c o m p l e t e = n e w b l . A u t o C o m p l e t e ( e , { d a t a : ( e , t ) = > ` $ { t . s l i c e ( 0 , t . i n d e x O f ( " @ " ) ) } @ $ { e } ` , f i l t e r : b l . F I L T E R _ S T A R T S W I T H , l i s t : [ . . . n e w S e t ( b l . r o s t e r . m a p ( ( e = > s o . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } ) } i n i t G r o u p A u t o C o m p l e t e ( ) { i f ( ! V l . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ j i d " ) . p a r e n t E l e m e n t ; t h i s . j i d _ a u t o _ c o m p l e t e = n e w b l . A u t o C o m p l e t e ( e , { d a t a : ( e , t ) = > ` $ { t . s l i c e ( 0 , t . i n d e x O f ( " @ " ) ) } @ $ { e } ` , f i l t e r : b l . F I L T E R _ S T A R T S W I T H , l i s t : [ . . . n e w S e t ( b l . r o s t e r . m a p ( ( e = > s o . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } ) } i n i t X H R A u t o C o m p l e t e ( ) { i f ( ! V l . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n t h i s . i n i t X H R F e t c h ( ) ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ n a m e " ) . p a r e n t E l e m e n t ; t h i s . n a m e _ a u t o _ c o m p l e t e = n e w b l . A u t o C o m p l e t e ( e , { a u t o _ e v a l u a t e : ! 1 , f i l t e r : b l . F I L T E R _ S T A R T S W I T H , l i s t : [ ] } ) ; c o n s t t = n e w w i n d o w . X M L H t t p R e q u e s t ; t . o n l o a d = ( ) = > { i f ( t . r e s p o n s e T e x t ) { c o n s t e = t . r e s p o n s e T e x t ; t h i s . n a m e _ a u t o _ c o m p l e t e . l i s t = J S O N . p a r s e ( e ) . m a p ( ( e = > ( { l a b e l : e . f u l l n a m e | | e . j i d , v a l u e : e . j i d } ) ) ) , t h i s . n a m e _ a u t o _ c o m p l e t e . a u t o _ c o m p l e t i n g = ! 0 , t h i s . n a m e _ a u t o _ c o m p l e t e . e v a l u a t e ( ) } } ; c o n s t n = t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) ; n . a d d E v e n t L i s t e n e r ( " i n p u t " , I l ( ( ( ) = > { t . o p e n ( " G E T " , ` $ { V l . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) } q = $ { e n c o d e U R I C o m p o n e n t ( n . v a l u e ) } ` , ! 0 ) , t . s e n d ( ) } ) , 3 0 0 ) ) , t h i s . n a m e _ a u t o _ c o m p l e t e . o n ( " s u g g e s t i o n - b o x - s e l e c t c o m p l e t e " , ( e = > { t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) . v a l u e = e . t e x t . l a b e l , t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) . v a l u e = e . t e x t . v a l u e } ) ) } i n i t X H R F e t c h ( ) { t h i s . x h r = n e w w i n d o w . X M L H t t p R e q u e s t , t h i s . x h r . o n l o a d = ( ) = > { i f ( t h i s . x h r . r e s p o n s e T e x t ) { c o n s t e = t h i s . x h r . r e s p o n s e T e x t , t = J S O N . p a r s e ( e ) . m a p ( ( e = > ( { l a b e l : e . f u l l n a m e | | e . j i d , v a l u e : e . j i d } ) ) ) ; i f ( 1 ! = = t . l e n g t h ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( " . i n v a l i d - f e e d b a c k " ) ; r e t u r n e . t e x t C o n t e n t = q y ( " S o r r y , c o u l d n o t f i n d a c o n t a c t w i t h t h a t n a m e " ) , v o i d z _ ( " d - b l o c k " , e ) } c o n s t n = t [ 0 ] . v a l u e ; i f ( t h i s . v a l i d a t e S u b m i s s i o n ( n ) ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( " f o r m " ) , s = t [ 0 ] . l a b e l ; t h i s . a f t e r S u b m i s s i o n ( e , n , s ) } } } } v a l i d a t e S u b m i s s i o n ( e ) { c o n s t t = t h i s . q u e r y S e l e c t o r ( " . i n v a l i d - f e e d b a c k " ) ; r e t u r n ! e | | S o ( e . s p l i t ( " @ " ) ) . l e n g t h < 2 ? ( z _ ( " i s - i n v a l i d " , t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) ) , z _ ( " d - b l o c k " , t ) , ! 1 ) : b l . r o s t e r . g e t ( s o . g e t B a r e J i d F r o m J i d ( e ) ) ? ( t . t e x t C o n t e n t = q y ( " T h i s c o n t a c t h a s a l r e a d y b e e n a d d e d " ) , z _ ( " d - b l o c k " , t ) , ! 1 ) : ( L _ ( " d - b l o c k " , t ) , ! 0 ) } a f t e r S u b m i s s i o n ( e , t , n , s ) { s & & ! A r r a y . i s A r r a y ( s ) & & ( s = [ s ] ) , b l . r o s t e r . a d d A n d S u b s c r i b e ( t , n , s ) , t h i s . m o d e l . c l e a r ( ) , t h i s . m o d a l . h i d e ( ) } a d d C o n t a c t F r o m F o r m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) , n = ( t . g e t ( " j i d " ) | | " " ) . t r i m ( ) ; i f ( ! n & & " s t r i n g " = = t y p e o f V l . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) ; r e t u r n t h i s . x h r . o p e n ( " G E T " , ` $ { V l . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) } q = $ { e n c o d e U R I C o m p o n e n t ( e . v a l u e ) } ` , ! 0 ) , v o i d t h i s . x h r . s e n d ( ) } t h i s . v a l i d a t e S u b m i s s i o n ( n ) & & t h i s . a f t e r S u b m i s s i o n ( e . t a r g e t , n , t . g e t ( " n a m e " ) , t . g e t ( " g r o u p " ) ) } } ) ; c o n s t { u : d k } = A h . e n v ; f u n c t i o n u k ( e ) { c o n s t t = e . g e t ( " j i d " ) , n = [ ] ; i f ( O c ( ) ) { c o n s t e = b l . c h a t b o x e s . g e t ( t ) ; e & & ! e . g e t ( " h i d d e n " ) & & n . p u s h ( " o p e n " ) } c o n s t s = e . g e t ( " a s k " ) , i = e . g e t ( " r e q u e s t i n g " ) , r = e . g e t ( " s u b s c r i p t i o n " ) ; r e t u r n " s u b s c r i b e " = = = s | | " f r o m " = = = r ? n . p u s h ( " p e n d i n g - x m p p - c o n t a c t " ) : ! 0 = = = i ? n . p u s h ( " r e q u e s t i n g - x m p p - c o n t a c t " ) : ( " b o t h " = = = r | | " t o " = = = r | | d k . i s S a m e B a r e J I D ( t , b l . c o n n e c t i o n . j i d ) ) & & ( n . p u s h ( " c u r r e n t - x m p p - c o n t a c t " ) , n . p u s h ( r ) , n . p u s h ( e . p r e s e n c e . g e t ( " s h o w " ) ) ) , n h `
2021-11-11 22:06:49 +01:00
< li class = "list-item d-flex controlbox-padded ${n.join(" ")}" data - status = "${e.presence.get(" show ")}" >
< converse - roster - contact . model = $ { e } > < / c o n v e r s e - r o s t e r - c o n t a c t >
2023-12-29 14:11:55 +01:00
< / l i > ` } c o n s t h k = e = > { c o n s t t = q y ( " C l i c k t o h i d e t h e s e c o n t a c t s " ) , n = b l . r o s t e r . s t a t e . g e t ( " c o l l a p s e d _ g r o u p s " ) ; r e t u r n n h `
2022-05-05 23:06:17 +02:00
< div class = "roster-group" data - group = "${e.name}" >
2023-12-29 14:11:55 +01:00
< a href = "#" class = "list-toggle group-toggle controlbox-padded" title = "${t}" @ click = $ { t => function ( e , t ) { e ? . preventDefault ? . ( ) ; const n = bl . roster . state . get ( "collapsed_groups" ) ; n . includes ( t ) ? bl . roster . state . save ( "collapsed_groups" , n . filter ( ( e => e !== t ) ) ) : bl . roster . state . save ( "collapsed_groups" , [ ... n , t ] ) } ( t , e . name ) } >
2022-05-05 23:06:17 +02:00
< converse - icon color = "var(--chat-head-color-dark)" size = "1em" class = "fa ${n.includes(e.name)?" fa - caret - right ":" fa - caret - down "}" > < / c o n v e r s e - i c o n > $ { e . n a m e }
< / a >
< ul class = "items-list roster-group-contacts ${n.includes(e.name)?" collapsed ":" "}" data - group = "${e.name}" >
2023-12-29 14:11:55 +01:00
$ { Mw ( e . contacts , ( e => e . get ( "jid" ) ) , uk ) }
2022-05-05 23:06:17 +02:00
< / u l >
2023-12-29 14:11:55 +01:00
< / d i v > ` } , m k = e = > { c o n s t t = q y ( " C o n t a c t s " ) , n = q y ( " C l i c k t o t o g g l e c o n t a c t s " ) , s = q y ( " A d d a c o n t a c t " ) , i = q y ( " R e - s y n c y o u r c o n t a c t s " ) , r = ( b l . r o s t e r | | [ ] ) . r e d u c e ( ( ( e , t ) = > f u n c t i o n ( e , t ) { i f ( t . g e t ( " r e q u e s t i n g " ) ) { c o n s t n = b l . H E A D E R _ R E Q U E S T I N G _ C O N T A C T S ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } e l s e { l e t n ; V l . s e t t i n g s . g e t ( " r o s t e r _ g r o u p s " ) ? ( n = t . g e t ( " g r o u p s " ) , n = 0 = = = n . l e n g t h ? [ b l . H E A D E R _ U N G R O U P E D ] : n ) : n = " s u b s c r i b e " = = = t . g e t ( " a s k " ) ? [ b l . H E A D E R _ P E N D I N G _ C O N T A C T S ] : [ b l . H E A D E R _ C U R R E N T _ C O N T A C T S ] ; f o r ( c o n s t s o f n ) e [ s ] ? e [ s ] . p u s h ( t ) : e [ s ] = [ t ] } i f ( t . g e t ( " n u m _ u n r e a d " ) ) { c o n s t n = b l . H E A D E R _ U N R E A D ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } r e t u r n e } ( e , t ) ) , { } ) , o = O b j e c t . k e y s ( r ) . f i l t e r ( W S ) , a = e . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = b l . C L O S E D ; r e t u r n o . s o r t ( L v ) , n h `
2021-11-11 22:06:49 +01:00
< div class = "d-flex controlbox-padded" >
2022-12-17 22:08:36 +01:00
< span class = "w-100 controlbox-heading controlbox-heading--contacts" >
< a class = "list-toggle open-contacts-toggle" title = "${n}" @ click = $ { e . toggleRoster } >
< converse - icon
class = "fa ${a?" fa - caret - right ":" fa - caret - down "}"
size = "1em"
color = "var(--chat-color)" > < / c o n v e r s e - i c o n >
$ { t }
< / a >
< / s p a n >
< a class = "controlbox-heading__btn sync-contacts"
@ click = $ { t => e . syncContacts ( t ) }
title = "${i}" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-sync right ${e.syncing_contacts?" fa - spin ":" "}" size = "1em" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / a >
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "allow_contact_requests" ) ? nh `
2021-11-11 22:06:49 +01:00
< a class = "controlbox-heading__btn add-contact"
@ click = $ { t => e . showAddContactModal ( t ) }
2022-12-17 22:08:36 +01:00
title = "${s}"
2021-11-11 22:06:49 +01:00
data - toggle = "modal"
data - target = "#add-contact-modal" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-user-plus right" size = "1.25em" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-01-07 22:34:35 +01:00
2022-12-17 22:08:36 +01:00
< div class = "list-container roster-contacts ${a?" hidden ":" "}" >
< converse - roster - filter @ update = $ { ( ) => e . requestUpdate ( ) } > < / c o n v e r s e - r o s t e r - f i l t e r >
2023-12-29 14:11:55 +01:00
$ { Mw ( o , ( e => e ) , ( e => { const t = r [ e ] . filter ( ( t => function ( e , t ) { const n = e . presence . get ( "show" ) ; return Vl . settings . get ( "hide_offline_users" ) && "offline" === n ? ( "subscribe" === e . get ( "ask" ) || "from" === e . get ( "subscription" ) || ! 0 === e . get ( "requesting" ) ) && ! GS ( e , t ) : ! GS ( e , t ) } ( t , e ) ) ) ; return t . sort ( zv ) , t . length ? hk ( { contacts : t , name : e } ) : "" } ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
2023-12-29 14:11:55 +01:00
` };Vl.elements.define("converse-roster",class extends Gy{async initialize(){const e= ` converse . contacts - panel$ { bl . bare _jid } ` ;this.model=new dr({id:e}),vc(this.model,e),this.model.fetch(),await Vl.waitUntil("rosterInitialized");const{chatboxes:t,presences:n,roster:s}=bl;this.listenTo(bl,"rosterContactsFetched",(()=>this.requestUpdate())),this.listenTo(n,"change:show",(()=>this.requestUpdate())),this.listenTo(t,"change:hidden",(()=>this.requestUpdate())),this.listenTo(s,"add",(()=>this.requestUpdate())),this.listenTo(s,"destroy",(()=>this.requestUpdate())),this.listenTo(s,"remove",(()=>this.requestUpdate())),this.listenTo(s,"change",(()=>this.requestUpdate())),this.listenTo(s.state,"change",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate())),Vl.trigger("rosterViewInitialized")}render(){return mk(this)}showAddContactModal(e){Vl.modal.show("converse-add-contact-modal",{model:new dr},e)}async syncContacts(e){e.preventDefault();const{roster:t}=bl;this.syncing_contacts=!0,this.requestUpdate(),t.data.save("version",null),await t.fetchFromServer(),Vl.user.presence.send(),this.syncing_contacts=!1,this.requestUpdate()}toggleRoster(e){e?.preventDefault?.();const t=this.querySelector(".list-container.roster-contacts");this.model.get("toggle_state")===bl.CLOSED?B_(t).then((()=>this.model.save({toggle_state:bl.OPENED}))):q_(t).then((()=>this.model.save({toggle_state:bl.CLOSED})))}});const fk={dnd:qy("This contact is busy"),online:qy("This contact is online"),offline:qy("This contact is offline"),unavailable:qy("This contact is unavailable"),xa:qy("This contact is away for an extended period"),away:qy("This contact is away")},gk=(e,t)=>{const n=t.presence.get("show")||"offline";let s,i;[s,i]="online"===n?["fa fa-circle","chat-status-online"]:"dnd"===n?["fa fa-minus-circle","chat-status-busy"]:"away"===n?["fa fa-circle","chat-status-away"]:["fa fa-circle","subdued-color"];const r=fk[n],o=t.get("num_unread")||0,a=t.getDisplayName(),c=qy("Click to chat with %1 $ s (XMPP address: %2 $ s)",a,e.model.get("jid"));return nh `
2023-01-07 22:34:35 +01:00
< a class = "list-item-link cbox-list-item open-chat ${o?" unread - msgs ":" "}" title = "${c}" href = "#" @ click = $ { e . openChat } >
2022-01-03 11:54:10 +01:00
< span >
< converse - avatar
class = "avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
2023-01-07 22:34:35 +01:00
title = "${r}"
color = "var(--${i})"
2022-01-03 11:54:10 +01:00
size = "1em"
2023-01-07 22:34:35 +01:00
class = "${s} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< / s p a n >
2023-12-29 14:11:55 +01:00
$ { o ? nh ` <span class="msgs-indicator"> ${ o } </span> ` : "" }
2023-01-07 22:34:35 +01:00
< span class = "contact-name contact-name--${e.show} ${o?" unread - msgs ":" "}" > $ { a } < / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2023-12-29 14:11:55 +01:00
$ { Vl . settings . get ( "allow_contact_removal" ) ? ( ( e , t ) => { const n = t . getDisplayName ( ) , s = qy ( "Click to remove %1$s as a contact" , n ) ; return nh `
2022-05-05 23:06:17 +02:00
< a class = "list-item-action remove-xmpp-contact" @ click = $ { e . removeContact } title = "${s}" href = "#" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-trash-alt" size = "1.5em" > < / c o n v e r s e - i c o n >
< / a >
2023-12-29 14:11:55 +01:00
` })(e,t):""} ` } ; class pk extends Gy { static get properties ( ) { return { model : { type : Object } } } initialize ( ) { this . listenTo ( this . model , "change" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "highlight" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "vcard:add" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "vcard:change" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "presenceChanged" , ( ( ) => this . requestUpdate ( ) ) ) } render ( ) { if ( ! 0 === this . model . get ( "requesting" ) ) { const e = this . model . getDisplayName ( ) ; return ( e => nh `
2022-12-17 22:08:36 +01:00
< a class = "open-chat w-100" href = "#" @ click = $ { e . openChat } >
< span class = "req-contact-name w-100" title = "JID: ${e.jid}" > $ { e . display _name } < / s p a n >
< / a >
< a class = "accept-xmpp-request list-item-action list-item-action--visible"
2022-05-05 23:06:17 +02:00
@ click = $ { e . acceptRequest }
2022-12-17 22:08:36 +01:00
aria - label = "${e.desc_accept}" title = "${e.desc_accept}" href = "#" >
< converse - icon class = "fa fa-check" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
< a class = "decline-xmpp-request list-item-action list-item-action--visible"
2022-05-05 23:06:17 +02:00
@ click = $ { e . declineRequest }
2022-12-17 22:08:36 +01:00
aria - label = "${e.desc_decline}" title = "${e.desc_decline}" href = "#" >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
2023-12-29 14:11:55 +01:00
< / a > ` ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { d i s p l a y _ n a m e : e , o p e n C h a t : e = > t h i s . o p e n C h a t ( e ) , a c c e p t R e q u e s t : e = > t h i s . a c c e p t R e q u e s t ( e ) , d e c l i n e R e q u e s t : e = > t h i s . d e c l i n e R e q u e s t ( e ) , d e s c _ a c c e p t : q y ( " C l i c k t o a c c e p t t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) , d e s c _ d e c l i n e : q y ( " C l i c k t o d e c l i n e t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) } ) ) } r e t u r n g k ( t h i s , t h i s . m o d e l ) } o p e n C h a t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , t h i s . m o d e l . o p e n C h a t ( ) } a s y n c r e m o v e C o n t a c t ( e ) { i f ( e ? . p r e v e n t D e f a u l t ? . ( ) , ! V l . s e t t i n g s . g e t ( " a l l o w _ c o n t a c t _ r e m o v a l " ) ) r e t u r n ; i f ( a w a i t V l . c o n f i r m ( q y ( " A r e y o u s u r e y o u w a n t t o r e m o v e t h i s c o n t a c t ? " ) ) ) t r y { t h i s . m o d e l . r e m o v e F r o m R o s t e r ( ) , t h i s . m o d e l . c o l l e c t i o n & & t h i s . m o d e l . d e s t r o y ( ) } c a t c h ( e ) { Y c . e r r o r ( e ) , V l . a l e r t ( " e r r o r " , q y ( " E r r o r " ) , [ q y ( " S o r r y , t h e r e w a s a n e r r o r w h i l e t r y i n g t o r e m o v e % 1 $ s a s a c o n t a c t . " , t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ) ] ) } } a s y n c a c c e p t R e q u e s t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , a w a i t b l . r o s t e r . s e n d C o n t a c t A d d I Q ( t h i s . m o d e l . g e t ( " j i d " ) , t h i s . m o d e l . g e t F u l l n a m e ( ) , [ ] ) , t h i s . m o d e l . a u t h o r i z e ( ) . s u b s c r i b e ( ) } a s y n c d e c l i n e R e q u e s t ( e ) { e & & e . p r e v e n t D e f a u l t & & e . p r e v e n t D e f a u l t ( ) ; r e t u r n a w a i t V l . c o n f i r m ( q y ( " A r e y o u s u r e y o u w a n t t o d e c l i n e t h i s c o n t a c t r e q u e s t ? " ) ) & & t h i s . m o d e l . u n a u t h o r i z e ( ) . d e s t r o y ( ) , t h i s } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o s t e r - c o n t a c t " , p k ) ; c l a s s v k e x t e n d s G y { a s y n c i n i t i a l i z e ( ) { a w a i t V l . w a i t U n t i l ( " r o s t e r I n i t i a l i z e d " ) , t h i s . m o d e l = b l . r o s t e r _ f i l t e r , t h i s . l i v e F i l t e r = I l ( ( ( ) = > { t h i s . m o d e l . s a v e ( { f i l t e r _ t e x t : t h i s . q u e r y S e l e c t o r ( " . r o s t e r - f i l t e r " ) . v a l u e } ) } ) , 2 5 0 ) , t h i s . l i s t e n T o ( b l , " r o s t e r C o n t a c t s F e t c h e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l . p r e s e n c e s , " c h a n g e : s h o w " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l . r o s t e r , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l . r o s t e r , " d e s t r o y " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( b l . r o s t e r , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , t h i s . d i s p a t c h U p d a t e E v e n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? ( e = > { c o n s t t = q y ( " F i l t e r " ) , n = q y ( " F i l t e r b y c o n t a c t n a m e " ) , s = q y ( " F i l t e r b y g r o u p n a m e " ) , i = q y ( " F i l t e r b y s t a t u s " ) , r = q y ( " A n y " ) , o = q y ( " U n r e a d " ) , a = q y ( " O n l i n e " ) , c = q y ( " C h a t t y " ) , l = q y ( " B u s y " ) , d = q y ( " A w a y " ) , u = q y ( " E x t e n d e d A w a y " ) , h = q y ( " O f f l i n e " ) ; r e t u r n n h `
2021-11-11 22:06:49 +01:00
< form class = "controlbox-padded roster-filter-form input-button-group ${e.visible?" fade - in ":" hidden "}"
@ submit = $ { e . submitFilter } >
< div class = "form-inline flex-nowrap" >
< div class = "filter-by d-flex flex-nowrap" >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-user clickable ${" contacts "===e.filter_type?" selected ":" "}" data - type = "contacts" title = "${n}" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-users clickable ${" groups "===e.filter_type?" selected ":" "}" data - type = "groups" title = "${s}" > < / c o n v e r s e - i c o n >
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-circle clickable ${" state "===e.filter_type?" selected ":" "}" data - type = "state" title = "${i}" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "btn-group" >
< input . value = "${e.filter_text||" "}"
@ keydown = $ { e . liveFilter }
class = "roster-filter form-control ${" state "===e.filter_type?" hidden ":" "}"
placeholder = "${t}" / >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" class = "fa fa-times clear-input ${e.filter_text&&" state "!==e.filter_type?" ":" hidden "}"
2021-11-11 22:06:49 +01:00
@ click = $ { e . clearFilter } >
2022-04-02 21:20:14 +02:00
< / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / d i v >
< select class = "form-control state-type ${" state "!==e.filter_type?" hidden ":" "}"
@ change = $ { e . changeChatStateFilter } >
2022-12-17 22:08:36 +01:00
< option value = "" > $ { r } < / o p t i o n >
< option ? selected = $ { "unread_messages" === e . chat _state } value = "unread_messages" > $ { o } < / o p t i o n >
2021-11-11 22:06:49 +01:00
< option ? selected = $ { "online" === e . chat _state } value = "online" > $ { a } < / o p t i o n >
< option ? selected = $ { "chat" === e . chat _state } value = "chat" > $ { c } < / o p t i o n >
< option ? selected = $ { "dnd" === e . chat _state } value = "dnd" > $ { l } < / o p t i o n >
< option ? selected = $ { "away" === e . chat _state } value = "away" > $ { d } < / o p t i o n >
< option ? selected = $ { "xa" === e . chat _state } value = "xa" > $ { u } < / o p t i o n >
< option ? selected = $ { "offline" === e . chat _state } value = "offline" > $ { h } < / o p t i o n >
< / s e l e c t >
< / d i v >
2023-12-29 14:11:55 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { v i s i b l e : t h i s . s h o u l d B e V i s i b l e ( ) , c h a n g e C h a t S t a t e F i l t e r : e = > t h i s . c h a n g e C h a t S t a t e F i l t e r ( e ) , c h a n g e T y p e F i l t e r : e = > t h i s . c h a n g e T y p e F i l t e r ( e ) , c l e a r F i l t e r : e = > t h i s . c l e a r F i l t e r ( e ) , l i v e F i l t e r : e = > t h i s . l i v e F i l t e r ( e ) , s u b m i t F i l t e r : e = > t h i s . s u b m i t F i l t e r ( e ) } ) ) : " " } d i s p a t c h U p d a t e E v e n t ( ) { t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " u p d a t e " , { d e t a i l : t h i s . m o d e l . c h a n g e d } ) ) } c h a n g e C h a t S t a t e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) } c h a n g e T y p e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) ; c o n s t t = F _ ( e . t a r g e t , " c o n v e r s e - i c o n " ) ? . d a t a s e t . t y p e | | " c o n t a c t s " ; " s t a t e " = = = t ? t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) : t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , f i l t e r _ t e x t : t h i s . q u e r y S e l e c t o r ( " . r o s t e r - f i l t e r " ) . v a l u e } ) } s u b m i t F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . l i v e F i l t e r ( ) } i s A c t i v e ( ) { r e t u r n " s t a t e " = = = t h i s . m o d e l . g e t ( " f i l t e r _ t y p e " ) | | t h i s . m o d e l . g e t ( " f i l t e r _ t e x t " ) } s h o u l d B e V i s i b l e ( ) { r e t u r n b l . r o s t e r ? . l e n g t h > = 5 | | t h i s . i s A c t i v e ( ) } c l e a r F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { f i l t e r _ t e x t : " " } ) } } V l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o s t e r - f i l t e r " , v k ) ; v a r y k = n ( 9 1 0 7 ) , _ k = { } ; _ k . s t y l e T a g T r a n s f o r m = i _ ( ) , _ k . s e t A t t r i b u t e s = e _ ( ) , _ k . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , _ k . d o m A P I = Q y ( ) , _ k . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( y k . Z , _ k ) ; y k . Z & & y k . Z . l o c a l s & & y k . Z . l o c a l s ; A h . p l u g i n s . a d d ( " c o n v e r s e - r o s t e r v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - r o s t e r " , " c o n v e r s e - m o d a l " , " c o n v e r s e - c h a t b o x v i e w s " ] , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { a u t o c o m p l e t e _ a d d _ c o n t a c t : ! 0 , a l l o w _ c o n t a c t _ r e m o v a l : ! 0 , h i d e _ o f f l i n e _ u s e r s : ! 1 , r o s t e r _ g r o u p s : ! 0 , x h r _ u s e r _ s e a r c h _ u r l : n u l l } ) , V l . p r o m i s e s . a d d ( " r o s t e r V i e w I n i t i a l i z e d " ) , b l . R o s t e r F i l t e r = C v , b l . R o s t e r F i l t e r V i e w = v k , b l . R o s t e r C o n t a c t V i e w = p k , V l . l i s t e n . o n ( " c h a t B o x e s I n i t i a l i z e d " , ( ( ) = > { b l . c h a t b o x e s . o n ( " d e s t r o y " , ( e = > H S ( e ) ) ) , b l . c h a t b o x e s . o n ( " c h a n g e : h i d d e n " , ( e = > H S ( e ) ) ) } ) ) , V l . l i s t e n . o n ( " a f t e r T e a r D o w n " , ( ( ) = > b l . r o t e r g r o u p s ? . o f f ( ) . r e s e t ( ) ) ) } } ) ; v a r b k = n ( 2 8 8 6 ) , w k = { } ; w k . s t y l e T a g T r a n s f o r m = i _ ( ) , w k . s e t A t t r i b u t e s = e _ ( ) , w k . i n s e r t = Y y ( ) . b i n d ( n u l l , " h e a d " ) , w k . d o m A P I = Q y ( ) , w k . i n s e r t S t y l e E l e m e n t = n _ ( ) ; J y ( ) ( b k . Z , w k ) ; b k . Z & & b k . Z . l o c a l s & & b k . Z . l o c a l s ; A h . p l u g i n s . a d d ( " c o n v e r s e - s i n g l e t o n " , { e n a b l e d : e = > e . a p i . s e t t i n g s . g e t ( " s i n g l e t o n " ) , i n i t i a l i z e ( ) { V l . s e t t i n g s . e x t e n d ( { a l l o w _ l o g o u t : ! 1 , a l l o w _ m u c _ i n v i t a t i o n s : ! 1 , h i d e _ m u c _ s e r v e r : ! 0 } ) ; c o n s t e = V l . s e t t i n g s . g e t ( " a u t o _ j o i n _ r o o m s " ) , t = V l . s e t t i n g s . g e t ( " a u t o _ j o i n _ p r i v a t e _ c h a t s " ) ; i f ( ! A r r a y . i s A r r a y ( e ) & & ! A r r a y . i s A r r a y ( t ) ) t h r o w n e w E r r o r ( " c o n v e r s e - s i n g l e t o n : a u t o _ j o i n _ r o o m s m u s t b e a n A r r a y " ) ; i f ( 0 = = = e . l e n g t h & & 0 = = = t . l e n g t h ) t h r o w n e w E r r o r ( " I f y o u s e t s i n g l e t o n s e t t o t r u e , y o u n e e d t o s p e c i f y a u t o _ j o i n _ r o o m s o r a u t o _ j o i n _ p r i v a t e _ c h a t s " ) ; i f ( e . l e n g t h > 0 & & t . l e n g t h > 0 ) t h r o w n e w E r r o r ( " I t d o e s n ' t m a k e s e n s e t o h a v e s i n g l e t o n s e t t o t r u e a n d a u t o _ j o i n _ r o o m s o r a u t o _ j o i n _ p r i v a t e _ c h a t s s e t t o m o r e t h e n o n e , s i n c e o n l y o n e c h a t r o o m m a y b e o p e n a t a n y t i m e . " ) } } ) ; c o n s t { u : S k } = A h . e n v ; f u n c t i o n x k ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; i f ( ! V l . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t n = S k . a n c e s t o r ( e . t a r g e t , " . b o x - f l y o u t " ) , s = w i n d o w . g e t C o m p u t e d S t y l e ( n ) , i = n . p a r e n t E l e m e n t ; i . h e i g h t = p a r s e I n t ( s . h e i g h t . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , b l . r e s i z i n g = { c h a t b o x : i , d i r e c t i o n : " t o p " } , i . p r e v _ p a g e Y = e . p a g e Y , t & & V l . t r i g g e r ( " s t a r t V e r t i c a l R e s i z e " , i ) } f u n c t i o n E k ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; i f ( ! V l . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t n = S k . a n c e s t o r ( e . t a r g e t , " . b o x - f l y o u t " ) , s = w i n d o w . g e t C o m p u t e d S t y l e ( n ) , i = n . p a r e n t E l e m e n t ; i . w i d t h = p a r s e I n t ( s . w i d t h . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , b l . r e s i z i n g = { c h a t b o x : i , d i r e c t i o n : " l e f t " } , i . p r e v _ p a g e X = e . p a g e X , t & & V l . t r i g g e r ( " s t a r t H o r i z o n t a l R e s i z e " , i ) } f u n c t i o n A k ( e ) { E k ( e , ! 1 ) , x k ( e , ! 1 ) , b l . r e s i z i n g . d i r e c t i o n = " t o p l e f t " , V l . t r i g g e r ( " s t a r t D i a g o n a l R e s i z e " , t h i s ) } f u n c t i o n C k ( e , t ) { i f ( v o i d 0 = = = e ) r e t u r n ; i f ( v o i d 0 = = = t ) r e t u r n e ; r e t u r n e ! = = t & & M a t h . a b s ( e - t ) < 1 0 ? t : e } f u n c t i o n $ k ( e ) { i f ( ! b l . r e s i z i n g | | ! V l . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) , b l . r e s i z i n g . c h a t b o x . r e s i z e C h a t B o x ( e ) } f u n c t i o n k k ( e ) { i f ( ! b l . r e s i z i n g | | ! V l . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t t = C k ( b l . r e s i z i n g . c h a t b o x . h e i g h t , b l . r e s i z i n g . c h a t b o x .
< div class = "dragresize dragresize-top" @ mousedown = "${xk}" > < / d i v >
< div class = "dragresize dragresize-topleft" @ mousedown = "${Ak}" > < / d i v >
< div class = "dragresize dragresize-left" @ mousedown = "${Ek}" > < / d i v >
` ;Vl.elements.define("converse-dragresize",class extends Gy{render(){return jk()}});const Tk={initDragResize(){const e=this,t=Il((()=>e.setDimensions()));window.addEventListener("resize",e.debouncedSetDimensions),this.listenTo(this.model,"destroy",(()=>window.removeEventListener("resize",t)));const n=this.querySelector(".box-flyout"),s=window.getComputedStyle(n);if(void 0===this.model.get("height")){const e=parseInt(s.height.replace(/px $ /,""),10),t=parseInt(s.width.replace(/px $ /,""),10);this.model.set("height",e),this.model.set("default_height",e),this.model.set("width",t),this.model.set("default_width",t)}const i=s["min-width"],r=s["min-height"];return this.model.set("min_width",i.endsWith("px")?Number(i.replace(/px $ /,"")):0),this.model.set("min_height",r.endsWith("px")?Number(r.replace(/px $ /,"")):0),this.prev_pageY=0,this.prev_pageX=0,bl.connection?.connected&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},resizeChatBox(e){let t;0===bl.resizing.direction.indexOf("top")&&(t=e.pageY-this.prev_pageY,t&&(this.height=this.height-t>(this.model.get("min_height")||0)?this.height-t:this.model.get("min_height"),this.prev_pageY=e.pageY,this.setChatBoxHeight(this.height))),bl.resizing.direction.includes("left")&&(t=this.prev_pageX-e.pageX,t&&(this.width=this.width+t>(this.model.get("min_width")||0)?this.width+t:this.model.get("min_width"),this.prev_pageX=e.pageX,this.setChatBoxWidth(this.width)))},setDimensions(){this.adjustToViewport(),this.setChatBoxHeight(this.model.get("height")),this.setChatBoxWidth(this.model.get("width"))},setChatBoxHeight(e){e=e?Ck(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?Ck(e,this.model.get("default_width"))+"px":"",this.style.width=e;const t=this.querySelector(".box-flyout");null!==t&&(t.style.width=e)},adjustToViewport(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);e<=480?(this.model.set("height",void 0),this.model.set("width",void 0)):e<=this.model.get("width")?this.model.set("width",void 0):t<=this.model.get("height")&&this.model.set("height",void 0)}};Ah.plugins.add("converse-dragresize",{dependencies:["converse-chatview","converse-headlines-view","converse-muc-views"],enabled:e=>"overlayed"==e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){const e=this.__super__.initialize.apply(this,arguments),t=this.get("height"),n=this.get("width"),s="controlbox"===this.get("id")?e=>this.set(e):e=>this.save(e);return s({height:Ck(t,this.get("default_height")),width:Ck(n,this.get("default_width"))}),e}}},initialize(){function e(e){const t=document.getElementsByTagName("iframe");for(let n of t)e.addEventListener("mousedown",(()=>{n.style.pointerEvents="none"}),{once:!0}),e.addEventListener("mouseup",(()=>{n.style.pointerEvents="initial"}),{once:!0})}Vl.settings.extend({allow_dragresize:!0}),Object.assign(bl.ChatBoxView.prototype,Tk),Object.assign(bl.ChatRoomView.prototype,Tk),bl.ControlBoxView&&Object.assign(bl.ControlBoxView.prototype,Tk),Vl.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove", $ k),document.addEventListener("mouseup",kk)})),Vl.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove", $ k),document.removeEventListener("mouseup",kk)})),Vl.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions())),Vl.listen.on("startDiagonalResize",e),Vl.listen.on("startHorizontalResize",e),Vl.listen.on("startVerticalResize",e)}});var Ik=n(567),Nk={};Nk.styleTagTransform=i_(),Nk.setAttributes=e_(),Nk.insert=Yy().bind(null,"head"),Nk.domAPI=Qy(),Nk.insertStyleElement=n_();Jy()(Ik.Z,Nk);Ik.Z&&Ik.Z.locals&&Ik.Z.locals;Ah.plugins.add("converse-fullscreen",{enabled:()=>Oc(),initialize(){Vl.settings.extend({chatview_avatar_height:50,chatview_avatar_width:50,hide_open_bookmarks:!0,show_controlbox_by_default:!0,sticky_controlbox:!0})}}),bl.CustomElement=Gy;const Ok=Ah.initialize;Ah.initia
2021-01-29 23:34:36 +01:00
//# sourceMappingURL=converse.min.js.map