!function(e){var t={};function f(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,f),n.l=!0,n.exports}f.m=e,f.c=t,f.d=function(e,t,a){f.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},f.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="",f(f.s=292)}([function(e,t,f){(function(e){e.exports=function(){"use strict";var t,a;function n(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function r(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var f,a=[];for(f=0;f>>0,a=0;a0)for(f=0;f=0;return(o?f?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+a}var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},q={};function U(e,t,f,a){var n=a;"string"==typeof a&&(n=function(){return this[a]()}),e&&(q[e]=n),t&&(q[t[0]]=function(){return P(n.apply(this,arguments),t[1],t[2])}),f&&(q[f]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function W(e,t){return e.isValid()?(t=J(t,e.localeData()),B[t]=B[t]||function(e){var t,f,a,n=e.match(z);for(t=0,f=n.length;t=0&&F.test(e);)e=e.replace(F,a),F.lastIndex=0,f-=1;return e}var $=/\d/,V=/\d\d/,G=/\d{3}/,Q=/\d{4}/,X=/[+-]?\d{6}/,K=/\d\d?/,Z=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,fe=/\d{1,4}/,ae=/[+-]?\d{1,6}/,ne=/\d+/,oe=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,ce=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ie={};function ue(e,t,f){ie[e]=j(t)?t:function(e,a){return e&&f?f:t}}function _e(e,t){return _(ie,e)?ie[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,f,a,n){return t||f||a||n})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var le={};function he(e,t){var f,a=t;for("string"==typeof e&&(e=[e]),c(t)&&(a=function(e,f){f[t]=M(e)}),f=0;f68?1900:2e3)};var De,Ye=je("FullYear",!0);function je(e,t){return function(f){return null!=f?(Ce(this,e,f),n.updateOffset(this,t),this):Ae(this,e)}}function Ae(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ce(e,t,f){e.isValid()&&!isNaN(f)&&("FullYear"===t&&Te(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](f,e.month(),Ee(f,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](f))}function Ee(e,t){if(isNaN(e)||isNaN(t))return NaN;var f,a=(t%(f=12)+f)%f;return e+=(t-a)/12,1===a?Te(e)?29:28:31-a%7%2}De=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function qe(e,t,f){var a=7+t-f,n=(7+Be(e,0,a).getUTCDay()-t)%7;return-n+a-1}function Ue(e,t,f,a,n){var o,r,s=(7+f-a)%7,c=qe(e,a,n),i=1+7*(t-1)+s+c;return i<=0?r=Se(o=e-1)+i:i>Se(e)?(o=e+1,r=i-Se(e)):(o=e,r=i),{year:o,dayOfYear:r}}function We(e,t,f){var a,n,o=qe(e.year(),t,f),r=Math.floor((e.dayOfYear()-o-1)/7)+1;return r<1?(n=e.year()-1,a=r+Je(n,t,f)):r>Je(e.year(),t,f)?(a=r-Je(e.year(),t,f),n=e.year()+1):(n=e.year(),a=r),{week:a,year:n}}function Je(e,t,f){var a=qe(e,t,f),n=qe(e+1,t,f);return(Se(e)-a+n)/7}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),I("week",5),I("isoWeek",5),ue("w",K),ue("ww",K,V),ue("W",K),ue("WW",K,V),me(["w","ww","W","WW"],function(e,t,f,a){t[a.substr(0,1)]=M(e)}),U("d",0,"do","day"),U("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),U("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),U("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),I("day",11),I("weekday",11),I("isoWeekday",11),ue("d",K),ue("e",K),ue("E",K),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),me(["dd","ddd","dddd"],function(e,t,f,a){var n=f._locale.weekdaysParse(e,a,f._strict);null!=n?t.d=n:h(f).invalidWeekday=e}),me(["d","e","E"],function(e,t,f,a){t[a]=M(e)});var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ve="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ge="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Qe=ce,Xe=ce,Ke=ce;function Ze(){function e(e,t){return t.length-e.length}var t,f,a,n,o,r=[],s=[],c=[],i=[];for(t=0;t<7;t++)f=l([2e3,1]).day(t),a=this.weekdaysMin(f,""),n=this.weekdaysShort(f,""),o=this.weekdays(f,""),r.push(a),s.push(n),c.push(o),i.push(a),i.push(n),i.push(o);for(r.sort(e),s.sort(e),c.sort(e),i.sort(e),t=0;t<7;t++)s[t]=de(s[t]),c[t]=de(c[t]),i[t]=de(i[t]);this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function et(){return this.hours()%12||12}function tt(e,t){U(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ft(e,t){return t._meridiemParse}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,et),U("k",["kk",2],0,function(){return this.hours()||24}),U("hmm",0,0,function(){return""+et.apply(this)+P(this.minutes(),2)}),U("hmmss",0,0,function(){return""+et.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),tt("a",!0),tt("A",!1),H("hour","h"),I("hour",13),ue("a",ft),ue("A",ft),ue("H",K),ue("h",K),ue("k",K),ue("HH",K,V),ue("hh",K,V),ue("kk",K,V),ue("hmm",Z),ue("hmmss",ee),ue("Hmm",Z),ue("Hmmss",ee),he(["H","HH"],ve),he(["k","kk"],function(e,t,f){var a=M(e);t[ve]=24===a?0:a}),he(["a","A"],function(e,t,f){f._isPm=f._locale.isPM(e),f._meridiem=e}),he(["h","hh"],function(e,t,f){t[ve]=M(e),h(f).bigHour=!0}),he("hmm",function(e,t,f){var a=e.length-2;t[ve]=M(e.substr(0,a)),t[we]=M(e.substr(a)),h(f).bigHour=!0}),he("hmmss",function(e,t,f){var a=e.length-4,n=e.length-2;t[ve]=M(e.substr(0,a)),t[we]=M(e.substr(a,2)),t[ke]=M(e.substr(n)),h(f).bigHour=!0}),he("Hmm",function(e,t,f){var a=e.length-2;t[ve]=M(e.substr(0,a)),t[we]=M(e.substr(a))}),he("Hmmss",function(e,t,f){var a=e.length-4,n=e.length-2;t[ve]=M(e.substr(0,a)),t[we]=M(e.substr(a,2)),t[ke]=M(e.substr(n))});var at,nt=je("Hours",!0),ot={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ne,monthsShort:Oe,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:Ge,weekdaysShort:Ve,meridiemParse:/[ap]\.?m?\.?/i},rt={},st={};function ct(e){return e?e.toLowerCase().replace("_","-"):e}function it(t){var a=null;if(!rt[t]&&void 0!==e&&e&&e.exports)try{a=at._abbr,f(286)("./"+t),ut(a)}catch(e){}return rt[t]}function ut(e,t){var f;return e&&(f=s(t)?dt(e):_t(e,t))&&(at=f),at._abbr}function _t(e,t){if(null!==t){var f=ot;if(t.abbr=e,null!=rt[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),f=rt[e]._config;else if(null!=t.parentLocale){if(null==rt[t.parentLocale])return st[t.parentLocale]||(st[t.parentLocale]=[]),st[t.parentLocale].push({name:e,config:t}),null;f=rt[t.parentLocale]._config}return rt[e]=new C(A(f,t)),st[e]&&st[e].forEach(function(e){_t(e.name,e.config)}),ut(e),rt[e]}return delete rt[e],null}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return at;if(!o(e)){if(t=it(e))return t;e=[e]}return function(e){for(var t,f,a,n,o=0;o0;){if(a=it(n.slice(0,t).join("-")))return a;if(f&&f.length>=t&&L(n,f,!0)>=t-1)break;t--}o++}return null}(e)}function lt(e){var t,f=e._a;return f&&-2===h(e).overflow&&(t=f[be]<0||f[be]>11?be:f[ye]<1||f[ye]>Ee(f[pe],f[be])?ye:f[ve]<0||f[ve]>24||24===f[ve]&&(0!==f[we]||0!==f[ke]||0!==f[Me])?ve:f[we]<0||f[we]>59?we:f[ke]<0||f[ke]>59?ke:f[Me]<0||f[Me]>999?Me:-1,h(e)._overflowDayOfYear&&(tye)&&(t=ye),h(e)._overflowWeeks&&-1===t&&(t=Le),h(e)._overflowWeekday&&-1===t&&(t=xe),h(e).overflow=t),e}function ht(e,t,f){return null!=e?e:null!=t?t:f}function mt(e){var t,f,a,o,r,s=[];if(!e._d){for(a=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ye]&&null==e._a[be]&&function(e){var t,f,a,n,o,r,s,c;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)o=1,r=4,f=ht(t.GG,e._a[pe],We(jt(),1,4).year),a=ht(t.W,1),((n=ht(t.E,1))<1||n>7)&&(c=!0);else{o=e._locale._week.dow,r=e._locale._week.doy;var i=We(jt(),o,r);f=ht(t.gg,e._a[pe],i.year),a=ht(t.w,i.week),null!=t.d?((n=t.d)<0||n>6)&&(c=!0):null!=t.e?(n=t.e+o,(t.e<0||t.e>6)&&(c=!0)):n=o}a<1||a>Je(f,o,r)?h(e)._overflowWeeks=!0:null!=c?h(e)._overflowWeekday=!0:(s=Ue(f,a,n,o,r),e._a[pe]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[pe],a[pe]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),f=Be(r,0,e._dayOfYear),e._a[be]=f.getUTCMonth(),e._a[ye]=f.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[Me]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Be:function(e,t,f,a,n,o,r){var s=new Date(e,t,f,a,n,o,r);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(h(e).weekdayMismatch=!0)}}var gt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bt=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wt=/^\/?Date\((\-?\d+)/i;function kt(e){var t,f,a,n,o,r,s=e._i,c=gt.exec(s)||pt.exec(s);if(c){for(h(e).iso=!0,t=0,f=yt.length;t0&&h(e).unusedInput.push(r),s=s.slice(s.indexOf(f)+f.length),i+=f.length),q[o]?(f?h(e).empty=!1:h(e).unusedTokens.push(o),ge(o,f,e)):e._strict&&!f&&h(e).unusedTokens.push(o);h(e).charsLeftOver=c-i,s.length>0&&h(e).unusedInput.push(s),e._a[ve]<=12&&!0===h(e).bigHour&&e._a[ve]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ve]=(u=e._locale,_=e._a[ve],null==(d=e._meridiem)?_:null!=u.meridiemHour?u.meridiemHour(_,d):null!=u.isPM?((l=u.isPM(d))&&_<12&&(_+=12),l||12!==_||(_=0),_):_),mt(e),lt(e)}else St(e);else kt(e);var u,_,d,l}function Dt(e){var t=e._i,f=e._f;return e._locale=e._locale||dt(e._l),null===t||void 0===f&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new v(lt(t)):(i(t)?e._d=t:o(f)?function(e){var t,f,a,n,o;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;nthis?this:e:g()});function Et(e,t){var f,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return jt();for(f=t[0],a=1;ao&&(t=o),function(e,t,f,a,n){var o=Ue(e,t,f,a,n),r=Be(o.year,0,o.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}.call(this,e,t,f,a,n))}U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),af("gggg","weekYear"),af("ggggg","weekYear"),af("GGGG","isoWeekYear"),af("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),I("weekYear",1),I("isoWeekYear",1),ue("G",oe),ue("g",oe),ue("GG",K,V),ue("gg",K,V),ue("GGGG",fe,Q),ue("gggg",fe,Q),ue("GGGGG",ae,X),ue("ggggg",ae,X),me(["gggg","ggggg","GGGG","GGGGG"],function(e,t,f,a){t[a.substr(0,2)]=M(e)}),me(["gg","GG"],function(e,t,f,a){t[a]=n.parseTwoDigitYear(e)}),U("Q",0,"Qo","quarter"),H("quarter","Q"),I("quarter",7),ue("Q",$),he("Q",function(e,t){t[be]=3*(M(e)-1)}),U("D",["DD",2],"Do","date"),H("date","D"),I("date",9),ue("D",K),ue("DD",K,V),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),he(["D","DD"],ye),he("Do",function(e,t){t[ye]=M(e.match(K)[0])});var of=je("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),I("dayOfYear",4),ue("DDD",te),ue("DDDD",G),he(["DDD","DDDD"],function(e,t,f){f._dayOfYear=M(e)}),U("m",["mm",2],0,"minute"),H("minute","m"),I("minute",14),ue("m",K),ue("mm",K,V),he(["m","mm"],we);var rf=je("Minutes",!1);U("s",["ss",2],0,"second"),H("second","s"),I("second",15),ue("s",K),ue("ss",K,V),he(["s","ss"],ke);var sf,cf=je("Seconds",!1);for(U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),I("millisecond",16),ue("S",te,$),ue("SS",te,V),ue("SSS",te,G),sf="SSSS";sf.length<=9;sf+="S")ue(sf,ne);function uf(e,t){t[Me]=M(1e3*("0."+e))}for(sf="S";sf.length<=9;sf+="S")he(sf,uf);var _f=je("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var df=v.prototype;function lf(e){return e}df.add=Xt,df.calendar=function(e,t){var f=e||jt(),a=Ft(f,this).startOf("day"),o=n.calendarFormat(this,a)||"sameElse",r=t&&(j(t[o])?t[o].call(this,f):t[o]);return this.format(r||this.localeData().calendar(o,this,jt(f)))},df.clone=function(){return new v(this)},df.diff=function(e,t,f){var a,n,o;if(!this.isValid())return NaN;if(!(a=Ft(e,this)).isValid())return NaN;switch(n=6e4*(a.utcOffset()-this.utcOffset()),t=N(t)){case"year":o=Zt(this,a)/12;break;case"month":o=Zt(this,a);break;case"quarter":o=Zt(this,a)/3;break;case"second":o=(this-a)/1e3;break;case"minute":o=(this-a)/6e4;break;case"hour":o=(this-a)/36e5;break;case"day":o=(this-a-n)/864e5;break;case"week":o=(this-a-n)/6048e5;break;default:o=this-a}return f?o:k(o)},df.endOf=function(e){return void 0===(e=N(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},df.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)},df.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||jt(e).isValid())?Jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},df.fromNow=function(e){return this.from(jt(),e)},df.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||jt(e).isValid())?Jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},df.toNow=function(e){return this.to(jt(),e)},df.get=function(e){return j(this[e=N(e)])?this[e]():this},df.invalidAt=function(){return h(this).overflow},df.isAfter=function(e,t){var f=w(e)?e:jt(e);return!(!this.isValid()||!f.isValid())&&("millisecond"===(t=N(s(t)?"millisecond":t))?this.valueOf()>f.valueOf():f.valueOf()9999?W(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):j(Date.prototype.toISOString)?this.toDate().toISOString():W(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},df.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var f="["+e+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=t+'[")]';return this.format(f+a+"-MM-DD[T]HH:mm:ss.SSS"+n)},df.toJSON=function(){return this.isValid()?this.toISOString():null},df.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},df.unix=function(){return Math.floor(this.valueOf()/1e3)},df.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},df.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},df.year=Ye,df.isLeapYear=function(){return Te(this.year())},df.weekYear=function(e){return nf.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},df.isoWeekYear=function(e){return nf.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},df.quarter=df.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},df.month=Ie,df.daysInMonth=function(){return Ee(this.year(),this.month())},df.week=df.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},df.isoWeek=df.isoWeeks=function(e){var t=We(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},df.weeksInYear=function(){var e=this.localeData()._week;return Je(this.year(),e.dow,e.doy)},df.isoWeeksInYear=function(){return Je(this.year(),1,4)},df.date=of,df.day=df.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},df.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},df.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},df.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},df.hour=df.hours=nt,df.minute=df.minutes=rf,df.second=df.seconds=cf,df.millisecond=df.milliseconds=_f,df.utcOffset=function(e,t,f){var a,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=zt(se,e)))return this}else Math.abs(e)<16&&!f&&(e*=60);return!this._isUTC&&t&&(a=Bt(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),o!==e&&(!t||this._changeInProgress?Qt(this,Jt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Bt(this)},df.utc=function(e){return this.utcOffset(0,e)},df.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Bt(this),"m")),this},df.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=zt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},df.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?jt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},df.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},df.isLocal=function(){return!!this.isValid()&&!this._isUTC},df.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},df.isUtc=qt,df.isUTC=qt,df.zoneAbbr=function(){return this._isUTC?"UTC":""},df.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},df.dates=S("dates accessor is deprecated. Use date instead.",of),df.months=S("months accessor is deprecated. Use month instead",Ie),df.years=S("years accessor is deprecated. Use year instead",Ye),df.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),df.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(b(e,this),(e=Dt(e))._a){var t=e._isUTC?l(e._a):jt(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var hf=C.prototype;function mf(e,t,f,a){var n=dt(),o=l().set(a,t);return n[f](o,e)}function gf(e,t,f){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return mf(e,t,f,"month");var a,n=[];for(a=0;a<12;a++)n[a]=mf(e,a,f,"month");return n}function pf(e,t,f,a){"boolean"==typeof e?(c(t)&&(f=t,t=void 0),t=t||""):(f=t=e,e=!1,c(t)&&(f=t,t=void 0),t=t||"");var n,o=dt(),r=e?o._week.dow:0;if(null!=f)return mf(t,(f+r)%7,a,"day");var s=[];for(n=0;n<7;n++)s[n]=mf(t,(n+r)%7,a,"day");return s}hf.calendar=function(e,t,f){var a=this._calendar[e]||this._calendar.sameElse;return j(a)?a.call(t,f):a},hf.longDateFormat=function(e){var t=this._longDateFormat[e],f=this._longDateFormat[e.toUpperCase()];return t||!f?t:(this._longDateFormat[e]=f.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hf.invalidDate=function(){return this._invalidDate},hf.ordinal=function(e){return this._ordinal.replace("%d",e)},hf.preparse=lf,hf.postformat=lf,hf.relativeTime=function(e,t,f,a){var n=this._relativeTime[f];return j(n)?n(e,t,f,a):n.replace(/%d/i,e)},hf.pastFuture=function(e,t){var f=this._relativeTime[e>0?"future":"past"];return j(f)?f(t):f.replace(/%s/i,t)},hf.set=function(e){var t,f;for(f in e)j(t=e[f])?this[f]=t:this["_"+f]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},hf.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||He).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hf.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[He.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hf.monthsParse=function(e,t,f){var a,n,o;if(this._monthsParseExact)return function(e,t,f){var a,n,o,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;a<12;++a)o=l([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(o,"").toLocaleLowerCase();return f?"MMM"===t?-1!==(n=De.call(this._shortMonthsParse,r))?n:null:-1!==(n=De.call(this._longMonthsParse,r))?n:null:"MMM"===t?-1!==(n=De.call(this._shortMonthsParse,r))?n:-1!==(n=De.call(this._longMonthsParse,r))?n:null:-1!==(n=De.call(this._longMonthsParse,r))?n:-1!==(n=De.call(this._shortMonthsParse,r))?n:null}.call(this,e,t,f);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;a<12;a++){if(n=l([2e3,a]),f&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),f||this._monthsParse[a]||(o="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[a]=new RegExp(o.replace(".",""),"i")),f&&"MMMM"===t&&this._longMonthsParse[a].test(e))return a;if(f&&"MMM"===t&&this._shortMonthsParse[a].test(e))return a;if(!f&&this._monthsParse[a].test(e))return a}},hf.monthsRegex=function(e){return this._monthsParseExact?(_(this,"_monthsRegex")||Fe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(_(this,"_monthsRegex")||(this._monthsRegex=ze),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hf.monthsShortRegex=function(e){return this._monthsParseExact?(_(this,"_monthsRegex")||Fe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(_(this,"_monthsShortRegex")||(this._monthsShortRegex=Pe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hf.week=function(e){return We(e,this._week.dow,this._week.doy).week},hf.firstDayOfYear=function(){return this._week.doy},hf.firstDayOfWeek=function(){return this._week.dow},hf.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hf.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hf.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hf.weekdaysParse=function(e,t,f){var a,n,o;if(this._weekdaysParseExact)return function(e,t,f){var a,n,o,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)o=l([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(o,"").toLocaleLowerCase();return f?"dddd"===t?-1!==(n=De.call(this._weekdaysParse,r))?n:null:"ddd"===t?-1!==(n=De.call(this._shortWeekdaysParse,r))?n:null:-1!==(n=De.call(this._minWeekdaysParse,r))?n:null:"dddd"===t?-1!==(n=De.call(this._weekdaysParse,r))?n:-1!==(n=De.call(this._shortWeekdaysParse,r))?n:-1!==(n=De.call(this._minWeekdaysParse,r))?n:null:"ddd"===t?-1!==(n=De.call(this._shortWeekdaysParse,r))?n:-1!==(n=De.call(this._weekdaysParse,r))?n:-1!==(n=De.call(this._minWeekdaysParse,r))?n:null:-1!==(n=De.call(this._minWeekdaysParse,r))?n:-1!==(n=De.call(this._weekdaysParse,r))?n:-1!==(n=De.call(this._shortWeekdaysParse,r))?n:null}.call(this,e,t,f);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(n=l([2e3,1]).day(a),f&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(n,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(n,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(n,"").replace(".",".?")+"$","i")),this._weekdaysParse[a]||(o="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[a]=new RegExp(o.replace(".",""),"i")),f&&"dddd"===t&&this._fullWeekdaysParse[a].test(e))return a;if(f&&"ddd"===t&&this._shortWeekdaysParse[a].test(e))return a;if(f&&"dd"===t&&this._minWeekdaysParse[a].test(e))return a;if(!f&&this._weekdaysParse[a].test(e))return a}},hf.weekdaysRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(_(this,"_weekdaysRegex")||(this._weekdaysRegex=Qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hf.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(_(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hf.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(_(this,"_weekdaysRegex")||Ze.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(_(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ke),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hf.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hf.meridiem=function(e,t,f){return e>11?f?"pm":"PM":f?"am":"AM"},ut("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,f=1===M(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+f}}),n.lang=S("moment.lang is deprecated. Use moment.locale instead.",ut),n.langData=S("moment.langData is deprecated. Use moment.localeData instead.",dt);var bf=Math.abs;function yf(e,t,f,a){var n=Jt(t,f);return e._milliseconds+=a*n._milliseconds,e._days+=a*n._days,e._months+=a*n._months,e._bubble()}function vf(e){return e<0?Math.floor(e):Math.ceil(e)}function wf(e){return 4800*e/146097}function kf(e){return 146097*e/4800}function Mf(e){return function(){return this.as(e)}}var Lf=Mf("ms"),xf=Mf("s"),Sf=Mf("m"),Tf=Mf("h"),Df=Mf("d"),Yf=Mf("w"),jf=Mf("M"),Af=Mf("y");function Cf(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ef=Cf("milliseconds"),Hf=Cf("seconds"),Nf=Cf("minutes"),Of=Cf("hours"),Rf=Cf("days"),If=Cf("months"),Pf=Cf("years"),zf=Math.round,Ff={ss:44,s:45,m:45,h:22,d:26,M:11},Bf=Math.abs;function qf(e){return(e>0)-(e<0)||+e}function Uf(){if(!this.isValid())return this.localeData().invalidDate();var e,t,f=Bf(this._milliseconds)/1e3,a=Bf(this._days),n=Bf(this._months);e=k(f/60),t=k(e/60),f%=60,e%=60;var o=k(n/12),r=n%=12,s=a,c=t,i=e,u=f?f.toFixed(3).replace(/\.?0+$/,""):"",_=this.asSeconds();if(!_)return"P0D";var d=_<0?"-":"",l=qf(this._months)!==qf(_)?"-":"",h=qf(this._days)!==qf(_)?"-":"",m=qf(this._milliseconds)!==qf(_)?"-":"";return d+"P"+(o?l+o+"Y":"")+(r?l+r+"M":"")+(s?h+s+"D":"")+(c||i||u?"T":"")+(c?m+c+"H":"")+(i?m+i+"M":"")+(u?m+u+"S":"")}var Wf=Nt.prototype;return Wf.isValid=function(){return this._isValid},Wf.abs=function(){var e=this._data;return this._milliseconds=bf(this._milliseconds),this._days=bf(this._days),this._months=bf(this._months),e.milliseconds=bf(e.milliseconds),e.seconds=bf(e.seconds),e.minutes=bf(e.minutes),e.hours=bf(e.hours),e.months=bf(e.months),e.years=bf(e.years),this},Wf.add=function(e,t){return yf(this,e,t,1)},Wf.subtract=function(e,t){return yf(this,e,t,-1)},Wf.as=function(e){if(!this.isValid())return NaN;var t,f,a=this._milliseconds;if("month"===(e=N(e))||"year"===e)return t=this._days+a/864e5,f=this._months+wf(t),"month"===e?f:f/12;switch(t=this._days+Math.round(kf(this._months)),e){case"week":return t/7+a/6048e5;case"day":return t+a/864e5;case"hour":return 24*t+a/36e5;case"minute":return 1440*t+a/6e4;case"second":return 86400*t+a/1e3;case"millisecond":return Math.floor(864e5*t)+a;default:throw new Error("Unknown unit "+e)}},Wf.asMilliseconds=Lf,Wf.asSeconds=xf,Wf.asMinutes=Sf,Wf.asHours=Tf,Wf.asDays=Df,Wf.asWeeks=Yf,Wf.asMonths=jf,Wf.asYears=Af,Wf.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*M(this._months/12):NaN},Wf._bubble=function(){var e,t,f,a,n,o=this._milliseconds,r=this._days,s=this._months,c=this._data;return o>=0&&r>=0&&s>=0||o<=0&&r<=0&&s<=0||(o+=864e5*vf(kf(s)+r),r=0,s=0),c.milliseconds=o%1e3,e=k(o/1e3),c.seconds=e%60,t=k(e/60),c.minutes=t%60,f=k(t/60),c.hours=f%24,r+=k(f/24),n=k(wf(r)),s+=n,r-=vf(kf(n)),a=k(s/12),s%=12,c.days=r,c.months=s,c.years=a,this},Wf.clone=function(){return Jt(this)},Wf.get=function(e){return e=N(e),this.isValid()?this[e+"s"]():NaN},Wf.milliseconds=Ef,Wf.seconds=Hf,Wf.minutes=Nf,Wf.hours=Of,Wf.days=Rf,Wf.weeks=function(){return k(this.days()/7)},Wf.months=If,Wf.years=Pf,Wf.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),f=function(e,t,f){var a=Jt(e).abs(),n=zf(a.as("s")),o=zf(a.as("m")),r=zf(a.as("h")),s=zf(a.as("d")),c=zf(a.as("M")),i=zf(a.as("y")),u=n<=Ff.ss&&["s",n]||n0,u[4]=f,function(e,t,f,a,n){return n.relativeTime(t||1,!!f,e,a)}.apply(null,u)}(this,!e,t);return e&&(f=t.pastFuture(+this,f)),t.postformat(f)},Wf.toISOString=Uf,Wf.toString=Uf,Wf.toJSON=Uf,Wf.locale=ef,Wf.localeData=ff,Wf.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Uf),Wf.lang=tf,U("X",0,0,"unix"),U("x",0,0,"valueOf"),ue("x",oe),ue("X",/[+-]?\d+(\.\d{1,3})?/),he("X",function(e,t,f){f._d=new Date(1e3*parseFloat(e,10))}),he("x",function(e,t,f){f._d=new Date(M(e))}),n.version="2.19.4",t=jt,n.fn=df,n.min=function(){return Et("isBefore",[].slice.call(arguments,0))},n.max=function(){return Et("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=l,n.unix=function(e){return jt(1e3*e)},n.months=function(e,t){return gf(e,t,"months")},n.isDate=i,n.locale=ut,n.invalid=g,n.duration=Jt,n.isMoment=w,n.weekdays=function(e,t,f){return pf(e,t,f,"weekdays")},n.parseZone=function(){return jt.apply(null,arguments).parseZone()},n.localeData=dt,n.isDuration=Ot,n.monthsShort=function(e,t){return gf(e,t,"monthsShort")},n.weekdaysMin=function(e,t,f){return pf(e,t,f,"weekdaysMin")},n.defineLocale=_t,n.updateLocale=function(e,t){if(null!=t){var f,a,n=ot;null!=(a=it(e))&&(n=a._config),t=A(n,t),(f=new C(t)).parentLocale=rt[e],rt[e]=f,ut(e)}else null!=rt[e]&&(null!=rt[e].parentLocale?rt[e]=rt[e].parentLocale:null!=rt[e]&&delete rt[e]);return rt[e]},n.locales=function(){return T(rt)},n.weekdaysShort=function(e,t,f){return pf(e,t,f,"weekdaysShort")},n.normalizeUnits=N,n.relativeTimeRounding=function(e){return void 0===e?zf:"function"==typeof e&&(zf=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==Ff[e]&&(void 0===t?Ff[e]:(Ff[e]=t,"s"===e&&(Ff.ss=t-1),!0))},n.calendarFormat=function(e,t){var f=e.diff(t,"days",!0);return f<-6?"sameElse":f<-1?"lastWeek":f<0?"lastDay":f<1?"sameDay":f<2?"nextDay":f<7?"nextWeek":"sameElse"},n.prototype=df,n}()}).call(this,f(45)(e))},function(e,t,f){var a=f(280),n=f(278),o=/[&<>"']/g,r=RegExp(o.source);e.exports=function(e){return(e=n(e))&&r.test(e)?e.replace(o,a):e}},function(e,t,f){"use strict";var a,n,o;n=[f(9),f(46),f(17),f(159),f(289),f(288),f(7),f(0),f(15),f(285),f(284),f(14),f(282)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i,u){const _=c,d=_.$build,l=_.$iq,h=_.$msg,m=_.$pres,g=c.SHA1.b64_sha1;(c=c.Strophe).addNamespace("CARBONS","urn:xmpp:carbons:2"),c.addNamespace("CHATSTATES","http://jabber.org/protocol/chatstates"),c.addNamespace("CSI","urn:xmpp:csi:0"),c.addNamespace("DELAY","urn:xmpp:delay"),c.addNamespace("FORWARD","urn:xmpp:forward:0"),c.addNamespace("HINTS","urn:xmpp:hints"),c.addNamespace("HTTPUPLOAD","urn:xmpp:http:upload:0"),c.addNamespace("MAM","urn:xmpp:mam:2"),c.addNamespace("NICK","http://jabber.org/protocol/nick"),c.addNamespace("OUTOFBAND","jabber:x:oob"),c.addNamespace("PUBSUB","http://jabber.org/protocol/pubsub"),c.addNamespace("ROSTERX","http://jabber.org/protocol/rosterx"),c.addNamespace("RSM","http://jabber.org/protocol/rsm"),c.addNamespace("SID","urn:xmpp:sid:0"),c.addNamespace("SPOILER","urn:xmpp:spoiler:0"),c.addNamespace("VCARD","vcard-temp"),c.addNamespace("VCARDUPDATE","vcard-temp:x:update"),c.addNamespace("XFORM","jabber:x:data"),f.templateSettings={escape:/\{\{\{([\s\S]+?)\}\}\}/g,evaluate:/\{\[([\s\S]+?)\]\}/g,interpolate:/\{\{([\s\S]+?)\}\}/g,imports:{_:f}};const p={templates:{},promises:{}};f.extend(p,u.Events),p.core_plugins=["converse-bookmarks","converse-chatboxes","converse-chatview","converse-caps","converse-controlbox","converse-core","converse-disco","converse-dragresize","converse-embedded","converse-fullscreen","converse-headline","converse-mam","converse-message-view","converse-minimize","converse-modal","converse-muc","converse-muc-views","converse-notification","converse-otr","converse-ping","converse-profile","converse-register","converse-roomslist","converse-roster","converse-rosterview","converse-singleton","converse-spoilers","converse-vcard"],i.enable(p,"_converse","pluggable"),p.STATUS_WEIGHTS={offline:6,unavailable:5,xa:4,away:3,dnd:2,chat:1,online:1},p.PRETTY_CHAT_STATUS={offline:"Offline",unavailable:"Unavailable",xa:"Extended Away",away:"Away",dnd:"Do not disturb",chat:"Chattty",online:"Online"},p.ANONYMOUS="anonymous",p.CLOSED="closed",p.EXTERNAL="external",p.LOGIN="login",p.LOGOUT="logout",p.OPENED="opened",p.PREBIND="prebind",p.CONNECTION_STATUS={0:"ERROR",1:"CONNECTING",2:"CONNFAIL",3:"AUTHENTICATING",4:"AUTHFAIL",5:"CONNECTED",6:"DISCONNECTED",7:"DISCONNECTING",8:"ATTACHED",9:"REDIRECT",10:"RECONNECTING"},p.SUCCESS="success",p.FAILURE="failure",p.DEFAULT_IMAGE_TYPE="image/png",p.DEFAULT_IMAGE="iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gwHCy455JBsggAABkJJREFUeNrtnM1PE1sUwHvvTD8otWLHST/Gimi1CEgr6M6FEWuIBo2pujDVsNDEP8GN/4MbN7oxrlipG2OCgZgYlxAbkRYw1KqkIDRCSkM7nXvvW8x7vjyNeQ9m7p1p3z1LQk/v/Dhz7vkEXL161cHl9wI5Ag6IA+KAOCAOiAPigDggLhwQB2S+iNZ+PcYY/SWEEP2HAAAIoSAIoihCCP+ngDDGtVotGAz29/cfOXJEUZSOjg6n06lp2sbGRqlUWlhYyGazS0tLbrdbEASrzgksyeYJId3d3el0uqenRxRFAAAA4KdfIIRgjD9+/Pj8+fOpqSndslofEIQwHA6Pjo4mEon//qmFhYXHjx8vLi4ihBgDEnp7e9l8E0Jo165dQ0NDd+/eDYVC2/qsJElDQ0OEkKWlpa2tLZamxAhQo9EIBoOjo6MXL17csZLe3l5FUT59+lQul5l5JRaAVFWNRqN37tw5ceKEQVWRSOTw4cOFQuHbt2+iKLYCIISQLMu3b99OJpOmKAwEAgcPHszn8+vr6wzsiG6UQQhxuVyXLl0aGBgwUW0sFstkMl6v90fo1KyAMMYDAwPnzp0zXfPg4GAqlWo0Gk0MiBAiy/L58+edTqf5Aa4onj59OhaLYYybFRCEMBaL0fNxBw4cSCQStN0QRUBut3t4eJjq6U+dOiVJElVPRBFQIBDo6+ujCqirqyscDlONGykC2lYyYSR6pBoQQapHZwAoHo/TuARYAOrs7GQASFEUqn6aIiBJkhgA6ujooFpUo6iaTa7koFwnaoWadLNe81tbWwzoaJrWrICWl5cZAFpbW6OabVAEtLi4yABQsVjUNK0pAWWzWQaAcrlcswKanZ1VVZUqHYRQEwOq1Wpv3ryhCmh6erpcLjdrNl+v1ycnJ+l5UELI27dvv3//3qxxEADgy5cvExMT9Mznw4cPtFtAdAPFarU6Pj5eKpVM17yxsfHy5cvV1VXazXu62gVBKBQKT58+rdVqJqrFGL948eLdu3dU8/g/H4FBUaJYLAqC0NPTY9brMD4+PjY25mDSracOCABACJmZmXE6nUePHjWu8NWrV48ePSKEsGlAs7Agfd5nenq6Wq0mk0kjDzY2NvbkyRMIIbP2PLvhBUEQ8vl8NpuNx+M+n29bzhVjvLKycv/+/YmJCcazQuwA6YzW1tYmJyf1SY+2trZ/rRk1Go1SqfT69esHDx4UCgVmNaa/zZ/9ABUhRFXVYDB48uTJeDweiUQkSfL7/T9MA2NcqVTK5fLy8vL8/PzU1FSxWHS5XJaM4wGr9sUwxqqqer3eUCgkSZJuUBBCfTRvc3OzXC6vrKxUKhWn02nhCJ5lM4oQQo/HgxD6+vXr58+fHf8sDOp+HQDg8XgclorFU676dKLlo6yWRdItIBwQB8QBcUCtfosRQjRNQwhhjPUC4w46WXryBSHU1zgEQWBz99EFhDGu1+t+v//48ePxeFxRlD179ng8nh0Efgiher2+vr6ur3HMzMysrq7uTJVdACGEurq6Ll++nEgkPB7Pj9jPoDHqOxyqqubz+WfPnuVyuV9XPeyeagAAAoHArVu3BgcHab8CuVzu4cOHpVKJUnfA5GweY+xyuc6cOXPv3r1IJMLAR8iyPDw8XK/Xi8Wiqqqmm5KZgBBC7e3tN27cuHbtGuPVpf7+/lAoNDs7W61WzfVKpgHSSzw3b95MpVKW3MfRaDQSiczNzVUqFRMZmQOIEOL1eq9fv3727FlL1t50URRFluX5+flqtWpWEGAOIFEUU6nUlStXLKSjy759+xwOx9zcnKZpphzGHMzhcDiTydgk9r1w4YIp7RPTAAmCkMlk2FeLf/tIEKbTab/fbwtAhJBoNGrutpNx6e7uPnTokC1eMU3T0um0DZPMkZER6wERQnw+n/FFSxpy7Nix3bt3WwwIIcRgIWnHkkwmjecfRgGx7DtuV/r6+iwGhDHev3+/bQF1dnYaH6E2CkiWZdsC2rt3r8WAHA5HW1ubbQGZcjajgOwTH/4qNko1Wlg4IA6IA+KAOKBWBUQIsfNojyliKIoRRfH9+/dut9umf3wzpoUNNQ4BAJubmwz+ic+OxefzWWlBhJD29nbug7iT5sIBcUAcEAfEAXFAHBAHxOVn+QMrmWpuPZx12gAAAABJRU5ErkJggg==",p.log=function(e,t,a=""){t!==c.LogLevel.ERROR&&t!==c.LogLevel.FATAL||(a=a||"color: maroon"),e instanceof Error&&(e=e.stack);const n=a?"%c":"",o=f.assign({debug:f.get(console,"log")?console.log.bind(console):f.noop,error:f.get(console,"log")?console.log.bind(console):f.noop,info:f.get(console,"log")?console.log.bind(console):f.noop,warn:f.get(console,"log")?console.log.bind(console):f.noop},console);t===c.LogLevel.ERROR?o.error(`${n} ERROR: ${e}`,a):t===c.LogLevel.WARN?p.debug&&o.warn(`${n} ${s().format()} WARNING: ${e}`,a):t===c.LogLevel.FATAL?o.error(`${n} FATAL: ${e}`,a):p.debug&&(t===c.LogLevel.DEBUG?o.debug(`${n} ${s().format()} DEBUG: ${e}`,a):o.info(`${n} ${s().format()} INFO: ${e}`,a))},c.log=function(e,t){p.log(e+" "+t,e)},c.error=function(e){p.log(e,c.LogLevel.ERROR)},p.__=function(e){return f.isUndefined(o)?e:o.translate.apply(o,arguments)};const b=p.__,y=["initialized","connectionInitialized","pluginsInitialized","statusInitialized"];function v(e){p.promises[e]=r.getResolveablePromise()}return p.emit=function(e){p.trigger.apply(this,arguments);const t=p.promises[e];f.isUndefined(t)||t.resolve()},p.router=new u.Router,p.initialize=function(e,a){e=f.isUndefined(e)?{}:e;const n=r.getResolveablePromise();let s;if(f.each(y,v),f.isUndefined(p.connection)||(u.history.stop(),p.chatboxviews.closeAllChatBoxes(),p.bookmarks&&p.bookmarks.reset(),delete p.controlboxtoggle,delete p.chatboxviews,p.connection.reset(),p.off(),p.stopListening(),p._tearDown()),"onpagehide"in window?s="pagehide":"onbeforeunload"in window?s="beforeunload":"onunload"in window&&(s="unload"),this.TIMEOUTS={PAUSED:1e4,INACTIVE:9e4},this.INACTIVE="inactive",this.ACTIVE="active",this.COMPOSING="composing",this.PAUSED="paused",this.GONE="gone",this.default_settings={allow_contact_requests:!0,allow_non_roster_messaging:!1,animate:!0,authentication:"login",auto_away:0,auto_login:!1,auto_reconnect:!0,auto_subscribe:!1,auto_xa:0,blacklisted_plugins:[],bosh_service_url:void 0,connection_options:{},credentials_url:null,csi_waiting_time:0,debug:!1,default_state:"online",expose_rid_and_sid:!1,filter_by_resource:!1,forward_messages:!1,geouri_regex:/https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,geouri_replacement:"https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2",hide_offline_users:!1,include_offline_state:!1,jid:void 0,keepalive:!0,locales_url:"locale/{{{locale}}}/LC_MESSAGES/converse.json",locales:["af","ar","bg","ca","de","es","eu","en","fr","he","hu","id","it","ja","nb","nl","pl","pt_BR","ru","tr","uk","zh_CN","zh_TW"],message_carbons:!0,nickname:void 0,password:void 0,prebind_url:null,priority:0,registration_domain:"",rid:void 0,root:window.document,show_only_online_users:!1,show_send_button:!1,sid:void 0,storage:"session",strict_plugin_dependencies:!1,synchronize_availability:!0,trusted:!0,view_mode:"overlayed",websocket_url:void 0,whitelisted_plugins:[]},f.assignIn(this,this.default_settings),f.assignIn(this,f.pick(e,f.keys(this.default_settings))),this.authentication===p.ANONYMOUS&&this.auto_login&&!this.jid)throw new Error("Config Error: you need to provide the server's domain via the 'jid' option when using anonymous authentication with auto_login.");function i(){p.initPlugins(),p.initConnection(),p.setUpXMLLogging(),p.logIn(),p.registerGlobalEventHandlers(),u.history.started||u.history.start()}return f.isUndefined(o)?p.locale="en":o.setLocales(e.i18n,p),this.callback=a||f.noop,this.send_initial_presence=!0,this.msg_counter=0,this.user_settings=e,this.generateResource=(()=>`/converse.js-${Math.floor(139749528*Math.random()).toString()}`),this.sendCSI=function(e){p.connection.send(d(e,{xmlns:c.NS.CSI})),p.inactive=e===p.INACTIVE},this.onUserActivity=function(){p.idle_seconds>0&&(p.idle_seconds=0),p.connection.authenticated&&(p.inactive&&p.sendCSI(p.ACTIVE),!0===p.auto_changed_status&&(p.auto_changed_status=!1,p.xmppstatus.set("status",p.default_state)))},this.onEverySecond=function(){if(!p.connection.authenticated)return;const e=p.xmppstatus.get("status");p.idle_seconds++,p.csi_waiting_time>0&&p.idle_seconds>p.csi_waiting_time&&!p.inactive&&p.sendCSI(p.INACTIVE),p.auto_away>0&&p.idle_seconds>p.auto_away&&"away"!==e&&"xa"!==e&&"dnd"!==e?(p.auto_changed_status=!0,p.xmppstatus.set("status","away")):p.auto_xa>0&&p.idle_seconds>p.auto_xa&&"xa"!==e&&"dnd"!==e&&(p.auto_changed_status=!0,p.xmppstatus.set("status","xa"))},this.registerIntervalHandler=function(){p.auto_away<1&&p.auto_xa<1&&p.csi_waiting_time<1||(p.idle_seconds=0,p.auto_changed_status=!1,window.addEventListener("click",p.onUserActivity),window.addEventListener("focus",p.onUserActivity),window.addEventListener("keypress",p.onUserActivity),window.addEventListener("mousemove",p.onUserActivity),window.addEventListener(s,p.onUserActivity),p.everySecondTrigger=window.setInterval(p.onEverySecond,1e3))},this.setConnectionStatus=function(e,t){p.connfeedback.set({connection_status:e,message:t})},this.rejectPresenceSubscription=function(e,t){const f=m({to:e,type:"unsubscribed"});t&&""!==t&&f.c("status").t(t),p.connection.send(f)},this.reconnect=f.debounce(function(){p.log("RECONNECTING"),p.log("The connection has dropped, attempting to reconnect."),p.setConnectionStatus(c.Status.RECONNECTING,b("The connection has dropped, attempting to reconnect.")),p.connection.reconnecting=!0,p._tearDown(),p.logIn(null,!0)},3e3,{leading:!0}),this.disconnect=function(){p.log("DISCONNECTED"),delete p.connection.reconnecting,p.connection.reset(),p._tearDown(),p.emit("disconnected")},this.onDisconnected=function(){const e=p.disconnection_reason;return p.disconnection_cause===c.Status.AUTHFAIL?p.credentials_url&&p.auto_reconnect?(p.emit("will-reconnect"),p.reconnect()):p.disconnect():p.disconnection_cause===p.LOGOUT||!f.isUndefined(e)&&e===f.get(c,"ErrorCondition.NO_AUTH_MECH")||"host-unknown"===e||"remote-connection-failed"===e||!p.auto_reconnect?p.disconnect():(p.emit("will-reconnect"),void p.reconnect())},this.setDisconnectionCause=function(e,t,a){f.isUndefined(e)?(delete p.disconnection_cause,delete p.disconnection_reason):(f.isUndefined(p.disconnection_cause)||a)&&(p.disconnection_cause=e,p.disconnection_reason=t)},this.onConnectStatusChanged=function(e,t){if(p.log(`Status changed to: ${p.CONNECTION_STATUS[e]}`),e===c.Status.CONNECTED||e===c.Status.ATTACHED)p.setConnectionStatus(e),p.send_initial_presence=!0,p.setDisconnectionCause(),p.connection.reconnecting?(p.log(e===c.Status.CONNECTED?"Reconnected":"Reattached"),p.onConnected(!0)):(p.log(e===c.Status.CONNECTED?"Connected":"Attached"),p.connection.restored&&(p.send_initial_presence=!1),p.onConnected());else if(e===c.Status.DISCONNECTED)p.setDisconnectionCause(e,t),p.onDisconnected();else if(e===c.Status.ERROR)p.setConnectionStatus(e,b("An error occurred while connecting to the chat server."));else if(e===c.Status.CONNECTING)p.setConnectionStatus(e);else if(e===c.Status.AUTHENTICATING)p.setConnectionStatus(e);else if(e===c.Status.AUTHFAIL)t||(t=b("Your Jabber ID and/or password is incorrect. Please try again.")),p.setConnectionStatus(e,t),p.setDisconnectionCause(e,t,!0),p.onDisconnected();else if(e===c.Status.CONNFAIL){let a=t;"host-unknown"===t||"remote-connection-failed"==t?a=b("Sorry, we could not connect to the XMPP host with domain: %1$s",`"${c.getDomainFromJid(p.connection.jid)}"`):f.isUndefined(t)||t!==f.get(c,"ErrorCondition.NO_AUTH_MECH")||(a=b("The XMPP server did not offer a supported authentication mechanism")),p.setConnectionStatus(e,a),p.setDisconnectionCause(e,t)}else e===c.Status.DISCONNECTING&&p.setDisconnectionCause(e,t)},this.incrementMsgCounter=function(){this.msg_counter+=1;const e=this.msg_counter;let t=document.title;f.isNil(t)||(t=-1===t.search(/^Messages \(\d+\) /)?`Messages (${e}) ${t}`:t.replace(/^Messages \(\d+\) /,`Messages (${e})`))},this.clearMsgCounter=function(){this.msg_counter=0;let e=document.title;f.isNil(e)||-1!==e.search(/^Messages \(\d+\) /)&&(e=e.replace(/^Messages \(\d+\) /,""))},this.initStatus=(e=>{if(e=!f.isUndefined(p.xmppstatus)&&e)p.onStatusInitialized(e);else{this.xmppstatus=new this.XMPPStatus;const t=g(`converse.xmppstatus-${p.bare_jid}`);this.xmppstatus.id=t,this.xmppstatus.browserStorage=new u.BrowserStorage[p.storage](t),this.xmppstatus.fetch({success:f.partial(p.onStatusInitialized,e),error:f.partial(p.onStatusInitialized,e)})}}),this.initSession=function(){p.session=new u.Model;const e=g("converse.bosh-session");p.session.id=e,p.session.browserStorage=new u.BrowserStorage[p.storage](e),p.session.fetch()},this.clearSession=function(){p.trusted?!f.isUndefined(this.session)&&this.session.browserStorage&&this.session.browserStorage._clear():(window.localStorage.clear(),window.sessionStorage.clear()),p.emit("clearSession")},this.logOut=function(){p.clearSession(),p.setDisconnectionCause(p.LOGOUT,void 0,!0),f.isUndefined(p.connection)?p._tearDown():p.connection.disconnect(),f.each(f.keys(p.promises),v),p.emit("logout")},this.saveWindowState=function(e,t){let f;const a={focus:"visible",focusin:"visible",pageshow:"visible",blur:"hidden",focusout:"hidden",pagehide:"hidden"};"visible"===(f=(e=e||document.createEvent("Events")).type in a?a[e.type]:document[t]?"hidden":"visible")&&p.clearMsgCounter(),p.windowState=f,p.emit("windowStateChanged",{state:f})},this.registerGlobalEventHandlers=function(){let e="hidden";e in document?document.addEventListener("visibilitychange",f.partial(p.saveWindowState,f,e)):(e="mozHidden")in document?document.addEventListener("mozvisibilitychange",f.partial(p.saveWindowState,f,e)):(e="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",f.partial(p.saveWindowState,f,e)):(e="msHidden")in document?document.addEventListener("msvisibilitychange",f.partial(p.saveWindowState,f,e)):"onfocusin"in document?document.onfocusin=document.onfocusout=f.partial(p.saveWindowState,f,e):window.onpageshow=window.onpagehide=window.onfocus=window.onblur=f.partial(p.saveWindowState,f,e),void 0!==document[e]&&f.partial(p.saveWindowState,f,e)({type:document[e]?"blur":"focus"})},this.enableCarbons=function(){if(!this.message_carbons||this.session.get("carbons_enabled"))return;const e=new c.Builder("iq",{from:this.connection.jid,id:"enablecarbons",type:"set"}).c("enable",{xmlns:c.NS.CARBONS});this.connection.addHandler(e=>{e.querySelectorAll("error").length>0?p.log("An error occured while trying to enable message carbons.",c.LogLevel.ERROR):(this.session.save({carbons_enabled:!0}),p.log("Message carbons have been enabled."))},null,"iq",null,"enablecarbons"),this.connection.send(e)},this.sendInitialPresence=function(){p.send_initial_presence&&p.xmppstatus.sendPresence()},this.onStatusInitialized=function(e){p.emit("statusInitialized",e),e?p.emit("reconnected"):(n.resolve(),p.emit("initialized"),p.emit("connected"))},this.setUserJid=function(){p.jid=p.connection.jid,p.bare_jid=c.getBareJidFromJid(p.connection.jid),p.resource=c.getResourceFromJid(p.connection.jid),p.domain=c.getDomainFromJid(p.connection.jid)},this.onConnected=function(e){p.connection.flush(),p.setUserJid(),p.initSession(),p.enableCarbons(),p.initStatus(e)},this.ConnectionFeedback=u.Model.extend({defaults:{connection_status:c.Status.DISCONNECTED,message:""},initialize(){this.on("change",()=>{p.emit("connfeedback",p.connfeedback)})}}),this.connfeedback=new this.ConnectionFeedback,this.XMPPStatus=u.Model.extend({defaults:()=>({jid:p.bare_jid,status:p.default_state}),initialize(){this.vcard=p.vcards.findWhere({jid:this.get("jid")}),f.isNil(this.vcard)&&(this.vcard=p.vcards.create({jid:this.get("jid")})),this.on("change:status",e=>{const t=this.get("status");this.sendPresence(t),p.emit("statusChanged",t)}),this.on("change:status_message",()=>{const e=this.get("status_message");this.sendPresence(this.get("status"),e),p.emit("statusMessageChanged",e)})},constructPresence(e,t){let a;return e=f.isString(e)?e:this.get("status")||p.default_state,t=f.isString(t)?t:this.get("status_message"),a="unavailable"===e||"probe"===e||"error"===e||"unsubscribe"===e||"unsubscribed"===e||"subscribe"===e||"subscribed"===e?m({type:e}):"offline"===e?m({type:"unavailable"}):"online"===e?m():m().c("show").t(e).up(),t&&a.c("status").t(t).up(),a.c("priority").t(f.isNaN(Number(p.priority))?0:p.priority),a},sendPresence(e,t){p.connection.send(this.constructPresence(e,t))}}),this.setUpXMLLogging=function(){c.log=function(e,t){p.log(t,e)},this.debug&&(this.connection.xmlInput=function(e){p.log(e.outerHTML,c.LogLevel.DEBUG,"color: darkgoldenrod")},this.connection.xmlOutput=function(e){p.log(e.outerHTML,c.LogLevel.DEBUG,"color: darkcyan")})},this.fetchLoginCredentials=(()=>new t((e,t)=>{const f=new XMLHttpRequest;f.open("GET",p.credentials_url,!0),f.setRequestHeader("Accept","application/json, text/javascript"),f.onload=function(){if(f.status>=200&&f.status<400){const t=JSON.parse(f.responseText);e({jid:t.jid,password:t.password})}else f.onerror()},f.onerror=function(){delete p.connection,p.emit("noResumeableSession",this),t(f.responseText)},f.send()})),this.startNewBOSHSession=function(){const e=new XMLHttpRequest;e.open("GET",p.prebind_url,!0),e.setRequestHeader("Accept","application/json, text/javascript"),e.onload=function(){if(e.status>=200&&e.status<400){const t=JSON.parse(e.responseText);p.connection.attach(t.jid,t.sid,t.rid,p.onConnectStatusChanged)}else e.onerror()},e.onerror=function(){delete p.connection,p.emit("noResumeableSession",this)},e.send()},this.restoreBOSHSession=function(e){if(!this.jid){const t='restoreBOSHSession: tried to restore a "keepalive" session but we don\'t have the JID for the user!';if(e)throw new Error(t);p.log(t)}try{return this.connection.restore(this.jid,this.onConnectStatusChanged),!0}catch(e){return p.log("Could not restore session for jid: "+this.jid+" Error message: "+e.message,c.LogLevel.WARN),this.clearSession(),!1}},this.attemptPreboundSession=function(e){if(!e){if(this.keepalive&&this.restoreBOSHSession(!0))return;if(this.jid&&this.sid&&this.rid)return this.connection.attach(this.jid,this.sid,this.rid,this.onConnectStatusChanged)}if(this.prebind_url)return this.startNewBOSHSession();throw new Error("attemptPreboundSession: If you use prebind and not keepalive, then you MUST supply JID, RID and SID values or a prebind_url.")},this.attemptNonPreboundSession=function(e,t){if(t||!this.keepalive||!this.restoreBOSHSession())if(e)this.autoLogin(e);else if(this.auto_login)if(this.credentials_url)this.fetchLoginCredentials().then(this.autoLogin.bind(this),this.autoLogin.bind(this));else{if(!this.jid)throw new Error("attemptNonPreboundSession: If you use auto_login, you also need to give either a jid value (and if applicable a password) or you need to pass in a URL from where the username and password can be fetched (via credentials_url).");this.autoLogin()}else t&&this.autoLogin()},this.autoLogin=function(e){if(e&&(this.jid=e.jid),this.authentication===p.ANONYMOUS||this.authentication===p.EXTERNAL){if(!this.jid)throw new Error("Config Error: when using anonymous login you need to provide the server's domain via the 'jid' option. Either when calling converse.initialize, or when calling _converse.api.user.login.");this.connection.reconnecting||this.connection.reset(),this.connection.connect(this.jid.toLowerCase(),null,this.onConnectStatusChanged)}else if(this.authentication===p.LOGIN){const t=f.isNil(e)?p.connection.pass||this.password:e.password;if(!t){if(this.auto_login)throw new Error("initConnection: If you use auto_login and authentication='login' then you also need to provide a password.");return p.setDisconnectionCause(c.Status.AUTHFAIL,void 0,!0),void p.disconnect()}const a=c.getResourceFromJid(this.jid);this.jid=a?c.getBareJidFromJid(this.jid).toLowerCase()+"/"+a:this.jid.toLowerCase()+p.generateResource(),this.connection.reconnecting||this.connection.reset(),this.connection.connect(this.jid,t,this.onConnectStatusChanged)}},this.logIn=function(e,t){this.authentication===p.PREBIND?this.attemptPreboundSession(t):this.attemptNonPreboundSession(e,t)},this.initConnection=function(){if(!this.connection){if(!this.bosh_service_url&&!this.websocket_url)throw new Error("initConnection: you must supply a value for either the bosh_service_url or websocket_url or both.");if(("WebSocket"in window||"MozWebSocket"in window)&&this.websocket_url)this.connection=new c.Connection(this.websocket_url,this.connection_options);else{if(!this.bosh_service_url)throw new Error("initConnection: this browser does not support websockets and bosh_service_url wasn't specified.");this.connection=new c.Connection(this.bosh_service_url,f.assignIn(this.connection_options,{keepalive:this.keepalive}))}}p.emit("connectionInitialized")},this._tearDown=function(){return p.emit("beforeTearDown"),f.isUndefined(p.session)||p.session.destroy(),window.removeEventListener("click",p.onUserActivity),window.removeEventListener("focus",p.onUserActivity),window.removeEventListener("keypress",p.onUserActivity),window.removeEventListener("mousemove",p.onUserActivity),window.removeEventListener(s,p.onUserActivity),window.clearInterval(p.everySecondTrigger),p.emit("afterTearDown"),p},this.initPlugins=function(){p.pluggable.initialized_plugins=[];const e=p.core_plugins.concat(p.whitelisted_plugins);"embedded"===p.view_mode&&f.forEach(["converse-bookmarks","converse-controlbox","converse-headline","converse-register"],e=>{p.blacklisted_plugins.push(e)}),p.pluggable.initializePlugins({updateSettings(){p.log("(DEPRECATION) The `updateSettings` method has been deprecated. Please use `_converse.api.settings.update` instead.",c.LogLevel.WARN),p.api.settings.update.apply(p,arguments)},_converse:p},e,p.blacklisted_plugins),p.emit("pluginsInitialized")},e.connection&&(this.connection=e.connection),f.isUndefined(p.connection)||"jasmine tests"!==p.connection.service?(f.isUndefined(o)?i():o.fetchTranslations(p.locale,p.locales,r.interpolate(p.locales_url,{locale:p.locale})).catch(f.partial(p.log,f,c.LogLevel.FATAL)).then(i).catch(f.partial(p.log,f,c.LogLevel.FATAL)),n):(i(),p)},p.api={connection:{connected:()=>p.connection&&p.connection.connected||!1,disconnect(){p.connection.disconnect()}},emit(){p.emit.apply(p,arguments)},user:{jid:()=>p.connection.jid,login(e){p.logIn(e)},logout(){p.logOut()},status:{get:()=>p.xmppstatus.get("status"),set(e,t){const a={status:e};if(!f.includes(f.keys(p.STATUS_WEIGHTS),e))throw new Error("Invalid availability value. See https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.1");f.isString(t)&&(a.status_message=t),p.xmppstatus.sendPresence(e),p.xmppstatus.save(a)},message:{get:()=>p.xmppstatus.get("status_message"),set(e){p.xmppstatus.save({status_message:e})}}}},settings:{update(e){r.merge(p.default_settings,e),r.merge(p,e),r.applyUserSettings(p,e,p.user_settings)},get(e){if(f.includes(f.keys(p.default_settings),e))return p[e]},set(e,t){const a={};f.isObject(e)?f.assignIn(p,f.pick(e,f.keys(p.default_settings))):f.isString("string")&&(a[e]=t,f.assignIn(p,f.pick(a,f.keys(p.default_settings))))}},promises:{add(e){e=f.isArray(e)?e:[e],f.each(e,v)}},tokens:{get:e=>!p.expose_rid_and_sid||f.isUndefined(p.connection)?null:"rid"===e.toLowerCase()?p.connection.rid||p.connection._proto.rid:"sid"===e.toLowerCase()?p.connection.sid||p.connection._proto.sid:void 0},listen:{once:p.once.bind(p),on:p.on.bind(p),not:p.off.bind(p),stanza(e,t,a){f.isFunction(t)?(a=t,t={}):t=t||{},p.connection.addHandler(a,t.ns,e,t.type,t.id,t.from,t)}},waitUntil(e){const t=p.promises[e];return f.isUndefined(t)?null:t},send(e){p.connection.send(e)}},window.converse={initialize:(e,t)=>p.initialize(e,t),plugins:{add(e,t){if(t.__name__=e,!f.isUndefined(p.pluggable.plugins[e]))throw new TypeError(`Error: plugin with name "${e}" has already been `+"registered!");p.pluggable.plugins[e]=t}},env:{$build:d,$iq:l,$msg:h,$pres:m,Backbone:u,Promise:t,Strophe:c,_:f,f:a,b64_sha1:g,moment:s,sizzle:e,utils:r}},window.dispatchEvent(new CustomEvent("converse-loaded")),window.converse})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(12),f(13),f(54),f(53),f(52),f(242),f(241),f(240),f(239),f(238),f(18),f(237),f(236),f(235),f(19),f(234),f(233),f(232),f(11),f(51),f(229)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i,u,_,d,l,h,m,g,p,b){const y=e.env,v=(y.$msg,y.Backbone),w=y.Promise,k=y.Strophe,M=y._,L=(y.b64_sha1,y.f,y.sizzle),x=y.moment,S=e.env.utils,T={ENTER:13,FORWARD_SLASH:47};return e.plugins.add("converse-chatview",{dependencies:["converse-chatboxes","converse-disco","converse-message-view","converse-modal"],overrides:{ChatBoxViews:{onChatBoxAdded(e){const t=this.__super__._converse;let f=this.get(e.get("id"));return f?this.__super__.onChatBoxAdded.apply(this,arguments):(f=new t.ChatBoxView({model:e}),this.add(e.get("id"),f),f)}}},initialize(){const e=this._converse,n=e.__;e.api.settings.update({use_emojione:!1,emojione_image_path:f.imagePathPNG,show_toolbar:!0,time_format:"HH:mm",visible_toolbar_buttons:{call:!1,clear:!0,emoji:!0,spoiler:!0}}),f.imagePathPNG=e.emojione_image_path,f.ascii=!0,e.api.listen.on("windowStateChanged",function(t){e.chatboxviews.each(function(e){e.onWindowStateChanged(t.state)})}),e.EmojiPicker=v.Model.extend({defaults:{current_category:"people",current_skintone:"",scroll_position:0},initialize(){const t=`converse.emoji-${e.bare_jid}`;this.id=t,this.browserStorage=new v.BrowserStorage[e.storage](t)}}),e.EmojiPickerView=v.VDOMView.extend({className:"emoji-picker-container",events:{"click .emoji-category-picker li.emoji-category":"chooseCategory","click .emoji-skintone-picker li.emoji-skintone":"chooseSkinTone"},initialize(){this.model.on("change:current_skintone",this.render,this),this.model.on("change:current_category",this.render,this)},toHTML(){return c(M.extend(this.model.toJSON(),{_:M,transform:e.use_emojione?f.shortnameToImage:f.shortnameToUnicode,emojis_by_category:S.getEmojisByCategory(e,f),toned_emojis:S.getTonedEmojis(e),skintones:["tone1","tone2","tone3","tone4","tone5"],shouldBeHidden:this.shouldBeHidden}))},shouldBeHidden(e,t,f){if(M.includes(e,"_tone")){if(!t||!M.includes(e,t))return!0}else if(t&&M.includes(f,e))return!0;return!1},chooseSkinTone(e){e.preventDefault(),e.stopPropagation();const t=("IMG"===e.target.nodeName?e.target.parentElement:e.target).getAttribute("data-skintone").trim();this.model.get("current_skintone")===t?this.model.save({current_skintone:""}):this.model.save({current_skintone:t})},chooseCategory(e){e.preventDefault(),e.stopPropagation();const t=("IMG"===e.target.nodeName?e.target.parentElement:e.target).getAttribute("data-category").trim();this.model.save({current_category:t,scroll_position:0})}}),e.ChatBoxHeading=e.ViewWithAvatar.extend({initialize(){this.model.on("change:status",this.onStatusMessageChanged,this),this.model.vcard.on("change",this.render,this)},render(){return this.el.innerHTML=r(M.extend(this.model.toJSON(),this.model.vcard.toJSON(),{_converse:e,info_close:n("Close this chat box")})),this.renderAvatar(),this},onStatusMessageChanged(t){this.render(),e.emit("contactStatusMessageChanged",{contact:t.attributes,message:t.get("status")})}}),e.UserDetailsModal=e.BootstrapModal.extend({events:{"click button.remove-contact":"removeContact","click button.refresh-contact":"refreshContact"},initialize(){e.BootstrapModal.prototype.initialize.apply(this,arguments),this.model.on("contactAdded",this.registerContactEventHandlers,this),this.registerContactEventHandlers()},toHTML(){return l(M.extend(this.model.toJSON(),this.model.vcard.toJSON(),{allow_contact_removal:e.allow_contact_removal,alt_profile_image:n("The User's Profile Image"),display_name:this.model.getDisplayName(),is_roster_contact:!M.isUndefined(this.model.contact),label_close:n("Close"),label_email:n("Email"),label_fullname:n("Full Name"),label_jid:n("Jabber ID"),label_nickname:n("Nickname"),label_remove:n("Remove as contact"),label_refresh:n("Refresh"),label_role:n("Role"),label_url:n("URL")}))},registerContactEventHandlers(){M.isUndefined(this.model.contact)||(this.model.contact.on("change",this.render,this),this.model.contact.vcard.on("change",this.render,this),this.model.contact.on("destroy",()=>{delete this.model.contact,this.render()}))},refreshContact(t){t&&t.preventDefault&&t.preventDefault();const f=this.el.querySelector(".fa-refresh");S.addClass("fa-spin",f),e.api.vcard.update(this.model.contact.vcard,!0).then(()=>S.removeClass("fa-spin",f)).catch(M.partial(e.log,M,k.LogLevel.FATAL))},removeContact(t){t&&t.preventDefault&&t.preventDefault(),e.allow_contact_removal&&!0===confirm(n("Are you sure you want to remove this contact?"))&&(this.modal.hide(),this.model.contact.removeFromRoster(e=>{this.model.contact.destroy()},t=>{e.log(t,k.LogLevel.ERROR),e.api.alert.show(k.LogLevel.ERROR,n("Error"),[n("Sorry, there was an error while trying to remove %1$s as a contact.",this.model.contact.getDisplayName())])}))}}),e.ChatBoxView=v.NativeView.extend({length:200,className:"chatbox hidden",is_chatroom:!1,events:{"change input.fileupload":"onFileSelection","click .close-chatbox-button":"close","click .show-user-details-modal":"showUserDetailsModal","click .new-msgs-indicator":"viewUnreadMessages","click .send-button":"onFormSubmitted","click .toggle-call":"toggleCall","click .toggle-clear":"clearMessages","click .toggle-compose-spoiler":"toggleComposeSpoilerMessage","click .toggle-smiley ul.emoji-picker li":"insertEmoji","click .toggle-smiley":"toggleEmojiMenu","click .spoiler-toggle":"toggleSpoilerMessage","click .upload-file":"toggleFileUpload","keypress .chat-textarea":"keyPressed","input .chat-textarea":"inputChanged"},initialize(){this.initDebounced(),this.createEmojiPicker(),this.model.messages.on("add",this.onMessageAdded,this),this.model.messages.on("rendered",this.scrollDown,this),this.model.on("show",this.show,this),this.model.on("destroy",this.remove,this),this.model.presence.on("change:show",this.onPresenceChanged,this),this.model.on("showHelpMessages",this.showHelpMessages,this),this.render(),this.fetchMessages(),e.emit("chatBoxOpened",this),e.emit("chatBoxInitialized",this)},initDebounced(){this.scrollDown=M.debounce(this._scrollDown,250),this.markScrolled=M.debounce(this._markScrolled,100),this.show=M.debounce(this._show,250,{leading:!0})},render(){return this.el.setAttribute("id",this.model.get("box_id")),this.el.innerHTML=o(M.extend(this.model.toJSON(),{unread_msgs:n("You have unread messages")})),this.content=this.el.querySelector(".chat-content"),this.renderMessageForm(),this.insertHeading(),this},renderToolbar(t,f){return e.show_toolbar?(t=t||b,f=M.assign(this.model.toJSON(),this.getToolbarOptions(f||{})),this.el.querySelector(".chat-toolbar").innerHTML=t(f),this.addSpoilerButton(f),this.addFileUploadButton(),this.insertEmojiPicker(),this):this},renderMessageForm(){let t;t=this.model.get("composing_spoiler")?n("Hidden message"):n("Personal message"),this.el.querySelector(".message-form-container").innerHTML=s(M.extend(this.model.toJSON(),{hint_value:M.get(this.el.querySelector(".spoiler-hint"),"value"),label_personal_message:t,label_send:n("Send"),label_spoiler_hint:n("Optional hint"),message_value:M.get(this.el.querySelector(".chat-textarea"),"value"),show_send_button:e.show_send_button,show_toolbar:e.show_toolbar,unread_msgs:n("You have unread messages")})),this.renderToolbar()},showUserDetailsModal(t){M.isUndefined(this.user_details_modal)&&(this.user_details_modal=new e.UserDetailsModal({model:this.model})),this.user_details_modal.show(t)},toggleFileUpload(e){this.el.querySelector("input.fileupload").click()},onFileSelection(e){this.model.sendFiles(e.target.files)},addFileUploadButton(t){e.api.disco.supports(k.NS.HTTPUPLOAD,e.domain).then(e=>{e.length&&this.el.querySelector(".chat-toolbar").insertAdjacentHTML("beforeend",h({tooltip_upload_file:n("Choose a file to send")}))}).catch(M.partial(e.log,M,k.LogLevel.FATAL))},addSpoilerButton(t){if(!t.show_spoiler_button||"chatroom"===this.model.get("type"))return;const f=this.model.get("jid"),a=this.model.presence.get("resources");M.isEmpty(a)||w.all(M.map(M.keys(a),t=>e.api.disco.supports(k.NS.SPOILER,`${f}/${t}`))).then(t=>{if(M.filter(t,"length").length){const t=g(this.model.toJSON());e.visible_toolbar_buttons.emoji?this.el.querySelector(".toggle-smiley").insertAdjacentHTML("afterEnd",t):this.el.querySelector(".chat-toolbar").insertAdjacentHTML("afterBegin",t)}}).catch(M.partial(e.log,M,k.LogLevel.FATAL))},insertHeading(){this.heading=new e.ChatBoxHeading({model:this.model}),this.heading.render(),this.heading.chatview=this,M.isUndefined(this.model.contact)||this.model.contact.on("destroy",this.heading.render,this);const t=this.el.querySelector(".flyout");return t.insertBefore(this.heading.el,t.querySelector(".chat-body")),this},getToolbarOptions(t){let f;return f=this.model.get("composing_spoiler")?n("Click to write as a normal (non-spoiler) message"):n("Click to write your message as a spoiler"),M.extend(t||{},{label_clear:n("Clear all messages"),tooltip_insert_smiley:n("Insert emojis"),tooltip_start_call:n("Start a call"),label_toggle_spoiler:f,show_call_button:e.visible_toolbar_buttons.call,show_spoiler_button:e.visible_toolbar_buttons.spoiler,use_emoji:e.visible_toolbar_buttons.emoji})},afterMessagesFetched(){this.insertIntoDOM(),this.scrollDown(),this.content.addEventListener("scroll",this.markScrolled.bind(this)),e.emit("afterMessagesFetched",this)},fetchMessages(){return this.model.messages.fetch({add:!0,success:this.afterMessagesFetched.bind(this),error:this.afterMessagesFetched.bind(this)}),this},insertIntoDOM(){return e.chatboxviews.insertRowColumn(this.el),this},showChatEvent(e,t=""){const f=x().format();return this.content.insertAdjacentHTML("beforeend",_({extra_classes:"chat-event",message:e,isodate:f,data:t})),this.insertDayIndicator(this.content.lastElementChild),this.scrollDown(),f},showErrorMessage(e){this.content.insertAdjacentHTML("beforeend",i({message:e,isodate:x().format()})),this.scrollDown()},addSpinner(e=!1){M.isNull(this.el.querySelector(".spinner"))&&(e?(this.content.insertAdjacentHTML("beforeend",m()),this.scrollDown()):this.content.insertAdjacentHTML("afterbegin",m()))},clearSpinner(){M.each(this.content.querySelectorAll("span.spinner"),e=>e.parentNode.removeChild(e))},insertDayIndicator(e){const t=S.getPreviousElement(e,".message:not(.chat-state-notification)"),f=M.isNull(t)?null:t.getAttribute("data-isodate"),a=e.getAttribute("data-isodate");if(M.isNull(f)||x(a).isAfter(f,"day")){const t=x(a).startOf("day");e.insertAdjacentHTML("beforeBegin",d({isodate:t.format(),datestring:t.format("dddd MMM Do YYYY")}))}},getLastMessageDate(e){const t=S.getFirstChildElement(this.content,".message:not(.chat-state-notification)"),f=t?t.getAttribute("data-isodate"):null;if(!M.isNull(f)&&x(f).isAfter(e))return null;const a=S.getLastChildElement(this.content,".message:not(.chat-state-notification)"),n=a?a.getAttribute("data-isodate"):null;if(M.isNull(n)||x(n).isBefore(e))return n;const o=M.invokeMap(L(".message:not(.chat-state-notification)",this.content),Element.prototype.getAttribute,"data-isodate");M.isObject(e)&&(e=e.format()),o.push(e),o.sort();const r=o.lastIndexOf(e);return 0===r?null:o[r-1]},setScrollPosition(e){if(this.model.get("scrolled")){const t=S.getNextElement(e,".chat-msg");if(t&&(0===this.content.scrollTop||this.model.get("top_visible_message"))){const e=this.model.get("top_visible_message")||t;this.model.set("top_visible_message",e),this.content.scrollTop=e.offsetTop-30}}else this.scrollDown()},showHelpMessages(e,t,f){return M.each(e,e=>{this.content.insertAdjacentHTML("beforeend",u({isodate:x().format(),type:t,message:a.filterXSS(e,{whiteList:{strong:[]}})}))}),!0===f?this.addSpinner():!1===f&&this.clearSpinner(),this.scrollDown()},clearChatStateNotification(e,t){t?M.each(L(`.chat-state-notification[data-csn="${e.get("from")}"][data-isodate="${t}"]`,this.content),S.removeElement):M.each(L(`.chat-state-notification[data-csn="${e.get("from")}"]`,this.content),S.removeElement)},shouldShowOnTextMessage(){return!S.isVisible(this.el)},insertMessage(e){if("error"===e.model.get("type")){const t=this.content.querySelector(`[data-msgid="${e.model.get("msgid")}"]`);if(t)return t.insertAdjacentElement("afterend",e.el)}const t=x(e.model.get("time"))||x,f=this.getLastMessageDate(t);if(M.isNull(f))this.content.insertAdjacentElement("afterbegin",e.el);else{const t=L(`[data-isodate="${f}"]:last`,this.content).pop();if("error"===e.model.get("type")&&S.hasClass("chat-error",t)&&t.textContent===e.model.get("message"))return;t.insertAdjacentElement("afterend",e.el),this.markFollowups(e.el)}},markFollowups(e){const t=e.getAttribute("data-from"),f=e.previousElementSibling,a=x(e.getAttribute("data-isodate")),n=e.nextElementSibling;S.hasClass("chat-action",e)||S.hasClass("chat-action",f)||f.getAttribute("data-from")!==t||!a.isBefore(x(f.getAttribute("data-isodate")).add(10,"minutes"))||S.addClass("chat-msg-followup",e),n&&(!S.hasClass("chat-action","el")&&n.getAttribute("data-from")===t&&x(n.getAttribute("data-isodate")).isBefore(a.add(10,"minutes"))?S.addClass("chat-msg-followup",n):S.removeClass("chat-msg-followup",n))},showMessage(t){const f=new e.MessageView({model:t});this.clearChatStateNotification(t),this.insertMessage(f),this.insertDayIndicator(f.el),this.setScrollPosition(f.el),S.isNewMessage(t)&&("me"===t.get("sender")?this.model.set("scrolled",!1):this.model.get("scrolled",!0)&&this.showNewMessagesIndicator()),this.shouldShowOnTextMessage()?this.show():this.scrollDown()},onMessageAdded(t){this.showMessage(t),e.emit("messageAdded",{message:t,chatbox:this.model})},parseMessageForCommands(e){const t=e.replace(/^\s*/,"").match(/^\/(.*)\s*$/);if(t){if("clear"===t[1])return this.clearMessages(),!0;if("help"===t[1]){const e=[`/clear: ${n("Remove messages")}`,`/me: ${n("Write in the third person")}`,`/help: ${n("Show this menu")}`];return this.showHelpMessages(e),!0}}},onMessageSubmitted(t,f){if(!e.connection.authenticated)return this.showHelpMessages(["Sorry, the connection has been lost, and your message could not be sent"],"error");if(this.parseMessageForCommands(t))return;const a=this.model.getOutgoingMessageAttributes(t,f);this.model.sendMessage(a)},setChatState(t){return M.isUndefined(this.chat_state_timeout)||(window.clearTimeout(this.chat_state_timeout),delete this.chat_state_timeout),t===e.COMPOSING?this.chat_state_timeout=window.setTimeout(this.setChatState.bind(this),e.TIMEOUTS.PAUSED,e.PAUSED):t===e.PAUSED&&(this.chat_state_timeout=window.setTimeout(this.setChatState.bind(this),e.TIMEOUTS.INACTIVE,e.INACTIVE)),this.model.set("chat_state",t),this},onFormSubmitted(t){t.preventDefault();const f=this.el.querySelector(".chat-textarea"),a=f.value;let n;if(this.model.get("composing_spoiler")){const e=this.el.querySelector("form.sendXMPPMessage input.spoiler-hint");n=e.value,e.value=""}f.value="",f.focus();const o=document.createEvent("Event");o.initEvent("input",!0,!0),f.dispatchEvent(o),""!==a&&(this.onMessageSubmitted(a,n),e.emit("messageSend",a)),this.setChatState(e.ACTIVE)},keyPressed(t){t.keyCode===T.ENTER?this.onFormSubmitted(t):t.keyCode!==T.FORWARD_SLASH&&this.model.get("chat_state")!==e.COMPOSING&&this.setChatState(e.COMPOSING)},inputChanged(e){e.target.style.height="auto",e.target.style.height=e.target.scrollHeight+"px"},clearMessages(e){return e&&e.preventDefault&&e.preventDefault(),!0===confirm(n("Are you sure you want to clear the messages from this conversation?"))&&(this.content.innerHTML="",this.model.messages.reset(),this.model.messages.browserStorage._clear()),this},insertIntoTextArea(e){const t=this.el.querySelector(".chat-textarea");let f=t.value;f&&" "!==f[f.length-1]&&(f+=" "),t.value=f+e+" ",t.focus()},createEmojiPicker(){M.isUndefined(e.emojipicker)&&(e.emojipicker=new e.EmojiPicker,e.emojipicker.fetch()),this.emoji_picker_view=new e.EmojiPickerView({model:e.emojipicker})},insertEmoji(e){e.stopPropagation();const t="IMG"===e.target.nodeName?e.target.parentElement:e.target;this.insertIntoTextArea(t.getAttribute("data-emoji"))},toggleEmojiMenu(e){if(M.isUndefined(this.emoji_dropdown)){e.stopPropagation();const f=this.el.querySelector(".toggle-smiley.dropup");this.emoji_dropdown=new t.Dropdown(f,!0),this.emoji_dropdown.toggle()}},toggleCall(t){t.stopPropagation(),e.emit("callButtonClicked",{connection:e.connection,model:this.model})},toggleComposeSpoilerMessage(){this.model.set("composing_spoiler",!this.model.get("composing_spoiler")),this.renderMessageForm(),this.focus()},toggleSpoilerMessage(e){e&&e.preventDefault&&e.preventDefault();const t=e.target,f=t.firstElementChild;S.slideToggleElement(t.parentElement.parentElement.querySelector(".spoiler")),"closed"==t.getAttribute("data-toggle-state")?(t.textContent="Show less",f.classList.remove("fa-eye"),f.classList.add("fa-eye-slash"),t.insertAdjacentElement("afterBegin",f),t.setAttribute("data-toggle-state","open")):(t.textContent="Show more",f.classList.remove("fa-eye-slash"),f.classList.add("fa-eye"),t.insertAdjacentElement("afterBegin",f),t.setAttribute("data-toggle-state","closed"))},onPresenceChanged(e){const t=e.get("show"),f=this.model.getDisplayName();let a;S.isVisible(this.el)&&("offline"===t?a=f+" "+n("has gone offline"):"away"===t?a=f+" "+n("has gone away"):"dnd"===t?a=f+" "+n("is busy"):"online"===t&&(a=f+" "+n("is online")),a&&(this.content.insertAdjacentHTML("beforeend",p({message:a,isodate:x().format()})),this.scrollDown()))},close(t){t&&t.preventDefault&&t.preventDefault(),v.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&e.router.navigate(""),e.connection.connected&&(this.setChatState(e.INACTIVE),this.model.sendChatState());try{this.model.destroy()}catch(t){e.log(t,k.LogLevel.ERROR)}return this.remove(),e.emit("chatBoxClosed",this),this},renderEmojiPicker(){this.emoji_picker_view.render()},insertEmojiPicker(){var e=this.el.querySelector(".emoji-picker");M.isNull(e)||(e.innerHTML="",e.appendChild(this.emoji_picker_view.el))},focus(){const t=this.el.querySelector(".chat-textarea");return M.isNull(t)||(t.focus(),e.emit("chatBoxFocused",this)),this},hide(){return this.el.classList.add("hidden"),this},afterShown(){S.isPersistableModel(this.model)&&(this.model.clearUnreadMsgCounter(),this.model.save()),this.setChatState(e.ACTIVE),this.renderEmojiPicker(),this.scrollDown(),this.focus()},_show(e){S.isVisible(this.el)?this.focus():S.fadeIn(this.el,M.bind(this.afterShown,this))},showNewMessagesIndicator(){S.showElement(this.el.querySelector(".new-msgs-indicator"))},hideNewMessagesIndicator(){const e=this.el.querySelector(".new-msgs-indicator");M.isNull(e)||e.classList.add("hidden")},_markScrolled:function(e){e&&e.preventDefault&&e.preventDefault();let t=!0;this.content.scrollTop+this.content.clientHeight>=this.content.scrollHeight-62&&(t=!1,this.onScrolledDown()),S.safeSave(this.model,{scrolled:t,top_visible_message:null})},viewUnreadMessages(){this.model.save({scrolled:!1,top_visible_message:null}),this.scrollDown()},_scrollDown(){M.isUndefined(this.content)||S.isVisible(this.content)&&!this.model.get("scrolled")&&(this.content.scrollTop=this.content.scrollHeight)},onScrolledDown(){this.hideNewMessagesIndicator(),"hidden"!==e.windowState&&this.model.clearUnreadMsgCounter(),e.emit("chatBoxScrolledDown",{chatbox:this.model})},onWindowStateChanged(e){this.model.get("num_unread",0)&&!this.model.newMessageWillBeHidden()&&this.model.clearUnreadMsgCounter()}}),e.on("connected",()=>{e.api.disco.own.features.add(k.NS.SPOILER)}),M.extend(e.api,{chatviews:{get:t=>M.isUndefined(t)?(e.log("chats.create: You need to provide at least one JID",k.LogLevel.ERROR),null):M.isString(t)?e.chatboxviews.get(t):M.map(t,f=>e.chatboxviews.get(t))}})}}),e})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){(function(a){var n,o,r;r="object"==typeof self&&self.self===self&&self||"object"==typeof a&&a.global===a&&a,n=[f(8),f(283),t],void 0===(o=function(e,t,f){r.Backbone=function(e,t,f,a){var n=e.Backbone,o=Array.prototype.slice;t.VERSION="1.3.3",t.$=a,t.noConflict=function(){return e.Backbone=n,this},t.emulateHTTP=!1,t.emulateJSON=!1;var r=function(e,t,a){f.each(t,function(t,n){f[n]&&(e.prototype[n]=function(e,t,a){switch(e){case 1:return function(){return f[t](this[a])};case 2:return function(e){return f[t](this[a],e)};case 3:return function(e,n){return f[t](this[a],s(e,this),n)};case 4:return function(e,n,o){return f[t](this[a],s(e,this),n,o)};default:return function(){var e=o.call(arguments);return e.unshift(this[a]),f[t].apply(f,e)}}}(t,n,a))})},s=function(e,t){return f.isFunction(e)?e:f.isObject(e)&&!t._isModel(e)?c(e):f.isString(e)?function(t){return t.get(e)}:e},c=function(e){var t=f.matches(e);return function(e){return t(e.attributes)}},i=t.Events={},u=/\s+/,_=function(e,t,a,n,o){var r,s=0;if(a&&"object"==typeof a){void 0!==n&&"context"in o&&void 0===o.context&&(o.context=n);for(r=f.keys(a);sthis.length&&(n=this.length),n<0&&(n+=this.length+1);var o,r,s=[],c=[],i=[],u=[],_={},d=t.add,l=t.merge,h=t.remove,m=!1,g=this.comparator&&null==n&&!1!==t.sort,p=f.isString(this.comparator)?this.comparator:null;for(r=0;r7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(H,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var a=document.body,n=a.insertBefore(this.iframe,a.firstChild).contentWindow;n.document.open(),n.document.close(),n.location.hash="#"+this.fragment}var o=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),C.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),f.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))},navigate:function(e,t){if(!C.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var f=this.root;""!==e&&"?"!==e.charAt(0)||(f=f.slice(0,-1)||"/");var a=f+e;if(e=this.decodeFragment(e.replace(N,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,a);else{if(!this._wantsHashChange)return this.location.assign(a);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var n=this.iframe.contentWindow;t.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,f){if(f){var a=e.href.replace(/(javascript:|#).*$/,"");e.replace(a+"#"+t)}else e.hash="#"+t}}),t.history=new C,b.extend=y.extend=T.extend=M.extend=C.extend=function(e,t){var a,n=this;return a=e&&f.has(e,"constructor")?e.constructor:function(){return n.apply(this,arguments)},f.extend(a,n,t),a.prototype=f.create(n.prototype,e),a.prototype.constructor=a,a.__super__=n.prototype,a};var O=function(){throw new Error('A "url" property or function must be specified')},R=function(e,t){var f=t.error;t.error=function(a){f&&f.call(t.context,e,a,t),e.trigger("error",e,a,t)}};return t}(r,f,e,t)}.apply(t,n))||(e.exports=o)}).call(this,f(5))},function(e,t){var f;f=function(){return this}();try{f=f||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(f=window)}e.exports=f},function(e,t,f){"use strict";var a,n,o;n=[f(21),f(2),f(13),f(57),f(20),f(255),f(56),f(55)],void 0===(o="function"==typeof(a=function(e,t,f){const a={moderator:1,participant:2,visitor:3,none:2},n=t.env,o=n.Strophe,r=n.Backbone,s=n.Promise,c=n.$iq,i=n.$build,u=n.$msg,_=n.$pres,d=n.b64_sha1,l=n.sizzle,h=n._;n.moment,o.addNamespace("MUC_ADMIN",o.NS.MUC+"#admin"),o.addNamespace("MUC_OWNER",o.NS.MUC+"#owner"),o.addNamespace("MUC_REGISTER","jabber:iq:register"),o.addNamespace("MUC_ROOMCONF",o.NS.MUC+"#roomconfig"),o.addNamespace("MUC_USER",o.NS.MUC+"#user"),t.MUC_NICK_CHANGED_CODE="303",t.CHATROOMS_TYPE="chatroom",t.ROOM_FEATURES=["passwordprotected","unsecured","hidden","publicroom","membersonly","open","persistent","temporary","nonanonymous","semianonymous","moderated","unmoderated","mam_enabled"],t.ROOMSTATUS={CONNECTED:0,CONNECTING:1,NICKNAME_REQUIRED:2,PASSWORD_REQUIRED:3,DISCONNECTED:4,ENTERED:5},t.plugins.add("converse-muc",{dependencies:["converse-chatboxes","converse-disco","converse-controlbox"],overrides:{_tearDown(){const f=this.chatboxes.where({type:t.CHATROOMS_TYPE});h.each(f,function(f){e.safeSave(f,{connection_status:t.ROOMSTATUS.DISCONNECTED})}),this.__super__._tearDown.call(this,arguments)},ChatBoxes:{model(e,f){const a=this.__super__._converse;return e.type==t.CHATROOMS_TYPE?new a.ChatRoom(e,f):this.__super__.model.apply(this,arguments)}}},initialize(){const n=this._converse,m=n.__;if(n.api.settings.update({allow_muc:!0,allow_muc_invitations:!0,auto_join_on_invite:!1,auto_join_rooms:[],muc_domain:void 0,muc_history_max_stanzas:void 0,muc_instant_rooms:!0,muc_nickname_from_jid:!1}),n.api.promises.add(["roomsAutoJoined"]),n.router.route("converse/room?jid=:jid",function(t){if(!e.isValidMUCJID(t))return n.log(`Invalid JID "${t}" provided in URL fragment`,o.LogLevel.WARN);const f=[n.api.waitUntil("roomsAutoJoined")];n.allow_bookmarks&&f.push(n.api.waitUntil("bookmarksInitialized")),s.all(f).then(()=>{n.api.rooms.open(t)})}),n.openChatRoom=function(e,f,a){f.type=t.CHATROOMS_TYPE,f.id=e,f.box_id=d(e);const o=n.chatboxes.getChatBox(e,f,!0);return o.trigger("show",!0),o},n.ChatRoom=n.ChatBox.extend({defaults:()=>h.assign(h.clone(n.ChatBox.prototype.defaults),h.zipObject(t.ROOM_FEATURES,h.map(t.ROOM_FEATURES,h.stubFalse)),{num_unread_general:0,affiliation:null,connection_status:t.ROOMSTATUS.DISCONNECTED,name:"",nick:n.xmppstatus.get("nickname"),description:"",features_fetched:!1,roomconfig:{},type:t.CHATROOMS_TYPE,message_type:"groupchat"}),initialize(){this.constructor.__super__.initialize.apply(this,arguments),this.occupants=new n.ChatRoomOccupants,this.occupants.browserStorage=new r.BrowserStorage.session(d(`converse.occupants-${n.bare_jid}${this.get("jid")}`)),this.occupants.chatroom=this,this.registerHandlers(),this.on("change:chat_state",this.sendChatState,this)},registerHandlers(){const e=this.get("jid");this.removeHandlers(),this.presence_handler=n.connection.addHandler(e=>(h.each(h.values(this.handlers.presence),t=>t(e)),this.onPresence(e),!0),o.NS.MUC,"presence",null,null,e,{ignoreNamespaceFragment:!0,matchBareFromJid:!0}),this.message_handler=n.connection.addHandler(e=>(h.each(h.values(this.handlers.message),t=>t(e)),this.onMessage(e),!0),null,"message","groupchat",null,e,{matchBareFromJid:!0})},removeHandlers(){return this.message_handler&&(n.connection.deleteHandler(this.message_handler),delete this.message_handler),this.presence_handler&&(n.connection.deleteHandler(this.presence_handler),delete this.presence_handler),this},addHandler(e,t,f){h.isNil(this.handlers)&&(this.handlers={}),h.isNil(this.handlers[e])&&(this.handlers[e]={}),this.handlers[e][t]=f},join(e,f){if(!(e=e||this.get("nick")))throw new TypeError("join: You need to provide a valid nickname");if(this.get("connection_status")===t.ROOMSTATUS.ENTERED)return this;const a=_({from:n.connection.jid,to:this.getRoomJIDAndNick(e)}).c("x",{xmlns:o.NS.MUC}).c("history",{maxstanzas:n.muc_history_max_stanzas}).up();return f&&a.cnode(o.xmlElement("password",[],f)),this.save("connection_status",t.ROOMSTATUS.CONNECTING),n.connection.send(a),this},leave(f){this.occupants.browserStorage._clear(),this.occupants.reset(),n.connection.connected&&this.sendUnavailablePresence(f),e.safeSave(this,{connection_status:t.ROOMSTATUS.DISCONNECTED}),this.removeHandlers()},sendUnavailablePresence(e){const t=_({type:"unavailable",from:n.connection.jid,to:this.getRoomJIDAndNick()});null!==e&&t.c("status",e),n.connection.sendPresence(t)},getOutgoingMessageAttributes(t,a){const o=this.get("composing_spoiler");return{nick:this.get("nick"),from:`${this.get("jid")}/${this.get("nick")}`,fullname:this.get("nick"),is_spoiler:o,message:t?e.httpToGeoUri(f.shortnameToUnicode(t),n):void 0,sender:"me",spoiler_hint:o?a:void 0,type:"groupchat"}},getRoomFeatures(){return new s((e,t)=>{n.api.disco.info(this.get("jid"),null,h.flow(this.parseRoomFeatures.bind(this),e),()=>{t(new Error("Could not parse the room features"))},5e3)})},getRoomJIDAndNick(e){e?this.save({nick:e}):e=this.get("nick");const t=this.get("jid"),f=o.getBareJidFromJid(t);return f+(null!==e?`/${e}`:"")},sendChatState(){if(this.get("connection_status")!==t.ROOMSTATUS.ENTERED)return;const e=this.get("chat_state");e!==n.GONE&&n.connection.send(u({to:this.get("jid"),type:"groupchat"}).c(e,{xmlns:o.NS.CHATSTATES}).up().c("no-store",{xmlns:o.NS.HINTS}).up().c("no-permanent-store",{xmlns:o.NS.HINTS}))},directInvite(t,f){if(this.get("membersonly")){const a={};a[t]="member";const n=h.partial(e.computeAffiliationsDelta,!0,!1);this.updateMemberLists([{jid:t,affiliation:"member",reason:f}],["member","owner","admin"],n)}const a={xmlns:"jabber:x:conference",jid:this.get("jid")};null!==f&&(a.reason=f),this.get("password")&&(a.password=this.get("password"));const o=u({from:n.connection.jid,to:t,id:n.connection.getUniqueId()}).c("x",a);n.connection.send(o),n.emit("roomInviteSent",{room:this,recipient:t,reason:f})},parseRoomFeatures(e){const t={features_fetched:!0,name:e.querySelector("identity").getAttribute("name")};h.each(e.querySelectorAll("feature"),function(e){const f=e.getAttribute("var");f.startsWith("muc_")?t[f.replace("muc_","")]=!0:f===o.NS.MAM&&(t.mam_enabled=!0)});const f=e.querySelector('field[var="muc#roominfo_description"] value');h.isNull(f)||(t.description=f.textContent),this.save(t)},requestMemberList(e){return new s((t,f)=>{e=e||"member";const a=c({to:this.get("jid"),type:"get"}).c("query",{xmlns:o.NS.MUC_ADMIN}).c("item",{affiliation:e});n.connection.sendIQ(a,t,f)})},setAffiliation(e,t){t=h.filter(t,t=>h.isUndefined(t.affiliation)||t.affiliation===e);const f=h.map(t,h.bind(this.sendAffiliationIQ,this,e));return s.all(f)},saveConfiguration(t){return new s((f,a)=>{const n=t?l(":input:not([type=button]):not([type=submit])",t):[],o=h.map(n,e.webForm2xForm);this.sendConfiguration(o,f,a)})},autoConfigureChatRoom(){return new s((e,t)=>{this.fetchRoomConfiguration().then(f=>{const a=[],n=f.querySelectorAll("field"),o=this.get("roomconfig");let r=n.length;h.each(n,f=>{const n=f.getAttribute("var").replace("muc#roomconfig_",""),s=f.getAttribute("type");let c;if(n in o){switch(s){case"boolean":c=o[n]?1:0;break;case"list-multi":c=f.innerHTML;break;default:c=o[n]}f.innerHTML=i("value").t(c)}a.push(f),--r||this.sendConfiguration(a,e,t)})})})},fetchRoomConfiguration(){return new s((e,t)=>{n.connection.sendIQ(c({to:this.get("jid"),type:"get"}).c("query",{xmlns:o.NS.MUC_OWNER}),e,t)})},sendConfiguration(e,t,f){const a=c({to:this.get("jid"),type:"set"}).c("query",{xmlns:o.NS.MUC_OWNER}).c("x",{xmlns:o.NS.XFORM,type:"submit"});return h.each(e||[],function(e){a.cnode(e).up()}),t=h.isUndefined(t)?h.noop:h.partial(t,a.nodeTree),f=h.isUndefined(f)?h.noop:h.partial(f,a.nodeTree),n.connection.sendIQ(a,t,f)},saveAffiliationAndRole(e){const t=l(`x[xmlns="${o.NS.MUC_USER}"] item`,e).pop(),f=e.querySelector("status[code='110']");if(f&&!h.isNil(t)){const e=t.getAttribute("affiliation"),f=t.getAttribute("role");e&&this.save({affiliation:e}),f&&this.save({role:f})}},sendAffiliationIQ(e,t){return new s((f,a)=>{const r=c({to:this.get("jid"),type:"set"}).c("query",{xmlns:o.NS.MUC_ADMIN}).c("item",{affiliation:t.affiliation||e,jid:t.jid});h.isUndefined(t.reason)||r.c("reason",t.reason),n.connection.sendIQ(r,f,a)})},setAffiliations(e){const t=h.uniq(h.map(e,"affiliation"));return s.all(h.map(t,h.partial(this.setAffiliation.bind(this),h,e)))},getJidsWithAffiliations(t){return h.isString(t)&&(t=[t]),new s((f,a)=>{const n=h.map(t,h.partial(this.requestMemberList.bind(this)));s.all(n).then(h.flow(e.marshallAffiliationIQs,f),h.flow(e.marshallAffiliationIQs,f))})},updateMemberLists(e,t,f){this.getJidsWithAffiliations(t).then(t=>this.setAffiliations(f(e,t))).then(()=>this.occupants.fetchMembers()).catch(h.partial(n.log,h,o.LogLevel.ERROR))},checkForReservedNick(e,t){return n.connection.sendIQ(c({to:this.get("jid"),from:n.connection.jid,type:"get"}).c("query",{xmlns:o.NS.DISCO_INFO,node:"x-roomuser-item"}),e,t),this},updateOccupantsOnPresence(e){const f=this.parsePresence(e);if("error"===f.type)return!0;const a=this.occupants.findOccupant(f);if("unavailable"===f.type&&a&&!h.includes(f.states,t.MUC_NICK_CHANGED_CODE)&&!a.isMember())return a.set(f),void a.destroy();const n=o.getBareJidFromJid(f.jid),r=h.extend(f,{jid:n||void 0,resource:f.jid?o.getResourceFromJid(f.jid):void 0});a?a.save(r):this.occupants.create(r)},parsePresence(e){const t=e.getAttribute("from"),f=e.getAttribute("type"),a={from:t,nick:o.getResourceFromJid(t),type:f,states:[],show:"unavailable"!==f?"online":"offline"};return h.each(e.childNodes,function(e){switch(e.nodeName){case"status":a.status=e.textContent||null;break;case"show":a.show=e.textContent||"online";break;case"x":e.getAttribute("xmlns")===o.NS.MUC_USER?h.each(e.childNodes,function(e){switch(e.nodeName){case"item":a.affiliation=e.getAttribute("affiliation"),a.role=e.getAttribute("role"),a.jid=e.getAttribute("jid"),a.nick=e.getAttribute("nick")||a.nick;break;case"status":e.getAttribute("code")&&a.states.push(e.getAttribute("code"))}}):e.getAttribute("xmlns")===o.NS.VCARDUPDATE&&(a.image_hash=h.get(e.querySelector("photo"),"textContent"))}}),a},isDuplicate(e,t){const f=e.getAttribute("id"),a=e.getAttribute("from");return!!f&&this.messages.where({msgid:f,from:a}).length},fetchFeaturesIfConfigurationChanged(e){const t=e.querySelector("status[code='104']"),f=e.querySelector("status[code='170']"),a=e.querySelector("status[code='171']"),n=e.querySelector("status[code='172']"),o=e.querySelector("status[code='173']"),r=e.querySelector("status[code='173']");(t||f||a||n||o||r)&&this.getRoomFeatures()},onMessage(t){this.fetchFeaturesIfConfigurationChanged(t);const f=t,a=t.querySelector("forwarded");let r;h.isNull(a)||(t=a.querySelector("message"),r=a.querySelector("delay"));const s=t.getAttribute("from"),c=o.getResourceFromJid(s),i=c&&o.unescapeNode(c)||"",u=h.propertyOf(t.querySelector("subject"))("textContent");this.isDuplicate(t,f)||(u&&e.safeSave(this,{subject:{author:i,text:u}}),""!==i&&(this.incrementUnreadMsgCounter(f),this.createMessage(t,r,f),i!==this.get("nick")&&n.emit("message",{stanza:f,chatbox:this})))},onPresence(e){if("error"===e.getAttribute("type"))return void this.save("connection_status",t.ROOMSTATUS.DISCONNECTED);const f=e.querySelector("status[code='110']");f&&"unavailable"!==e.getAttribute("type")&&this.onOwnPresence(e),this.updateOccupantsOnPresence(e),"none"!==this.get("role")&&this.get("connection_status")===t.ROOMSTATUS.CONNECTING&&this.save("connection_status",t.ROOMSTATUS.CONNECTED)},onOwnPresence(e){this.saveAffiliationAndRole(e);const f=e.querySelector("status[code='201']");if(f)if(this.get("auto_configure"))this.autoConfigureChatRoom().then(this.getRoomFeatures.bind(this));else{if(!n.muc_instant_rooms)return void this.trigger("configurationNeeded");this.saveConfiguration().then(this.getRoomFeatures.bind(this))}else this.get("features_fetched")||("owner"===this.get("affiliation")&&this.get("auto_configure")?this.autoConfigureChatRoom().then(this.getRoomFeatures.bind(this)):this.getRoomFeatures());this.save("connection_status",t.ROOMSTATUS.ENTERED)},isUserMentioned(e){return new RegExp(`\\b${this.get("nick")}\\b`).test(e)},incrementUnreadMsgCounter(t){const f=t.querySelector("body");if(!h.isNull(f)&&e.isNewMessage(t)&&this.newMessageWillBeHidden()){const e={num_unread_general:this.get("num_unread_general")+1};this.isUserMentioned(f.textContent)&&(e.num_unread=this.get("num_unread")+1,n.incrementMsgCounter()),this.save(e)}},clearUnreadMsgCounter(){e.safeSave(this,{num_unread:0,num_unread_general:0})}}),n.ChatRoomOccupant=r.Model.extend({defaults:{show:"offline"},initialize(e){this.set(h.extend({id:n.connection.getUniqueId()},e)),this.on("change:image_hash",this.onAvatarChanged,this)},onAvatarChanged(){const e=n.vcards.findWhere({jid:this.get("from")});if(!e)return;const t=this.get("image_hash");t&&e.get("image_hash")!==t&&n.api.vcard.update(e)},getDisplayName(){return this.get("nick")||this.get("jid")},isMember(){return h.includes(["admin","owner","member"],this.get("affiliation"))}}),n.ChatRoomOccupants=r.Collection.extend({model:n.ChatRoomOccupant,comparator(e,t){const f=e.get("role")||"none",n=t.get("role")||"none";if(a[f]===a[n]){const f=e.getDisplayName().toLowerCase(),a=t.getDisplayName().toLowerCase();return fa?1:0}return a[f]e.get("jid")),h.map(this.where({affiliation:"member"}),e=>e.get("jid")),h.map(this.where({affiliation:"owner"}),e=>e.get("jid"))));this.chatroom.getJidsWithAffiliations(["member","owner","admin"]).then(t=>{h.each(h.difference(e,t),e=>{const t=this.findOccupant({jid:e});"offline"===t.get("show")&&t.destroy()}),h.each(t,e=>{const t=this.findOccupant({jid:e.jid});t?t.save(e):this.create(e)})}).catch(h.partial(n.log,h,o.LogLevel.ERROR))},findOccupant(e){const t=o.getBareJidFromJid(e.jid);return null!==t?this.where({jid:t}).pop():this.where({nick:e.nick}).pop()}}),n.RoomsPanelModel=r.Model.extend({defaults:{muc_domain:""}}),n.onDirectMUCInvitation=function(e){const f=l('x[xmlns="jabber:x:conference"]',e).pop(),a=o.getBareJidFromJid(e.getAttribute("from")),r=f.getAttribute("jid"),s=f.getAttribute("reason");let c,i=n.roster.get(a);if(n.auto_join_on_invite?c=!0:(i=i?i.get("fullname"):o.getNodeFromJid(a),c=s?confirm(m('%1$s has invited you to join a chat room: %2$s, and left the following reason: "%3$s"',i,r,s)):confirm(m("%1$s has invited you to join a chat room: %2$s",i,r))),!0===c){const e=n.openChatRoom(r,{password:f.getAttribute("password")});e.get("connection_status")===t.ROOMSTATUS.DISCONNECTED&&n.chatboxviews.get(r).join()}},n.allow_muc_invitations){const e=function(){n.connection.addHandler(function(e){return n.onDirectMUCInvitation(e),!0},"jabber:x:conference","message")};n.on("connected",e),n.on("reconnected",e)}const g=function(e,f,a){return e=e.toLowerCase(),f.type=t.CHATROOMS_TYPE,f.id=e,f.box_id=d(e),n.chatboxes.getChatBox(e,f,a)},p=function(e,t){return g(e,t,!0)};function b(){n.chatboxes.each(function(e){e.get("type")===t.CHATROOMS_TYPE&&e.save("connection_status",t.ROOMSTATUS.DISCONNECTED)})}n.on("addClientFeatures",()=>{n.allow_muc&&n.api.disco.own.features.add(o.NS.MUC),n.allow_muc_invitations&&n.api.disco.own.features.add("jabber:x:conference")}),n.on("chatBoxesFetched",function(){h.each(n.auto_join_rooms,function(e){n.chatboxes.where({jid:e}).length||(h.isString(e)?n.api.rooms.open(e):h.isObject(e)?n.api.rooms.open(e.jid,e.nick):n.log('Invalid room criteria specified for "auto_join_rooms"',o.LogLevel.ERROR))}),n.emit("roomsAutoJoined")}),n.on("reconnecting",b),n.on("disconnecting",b),h.extend(n.api,{rooms:{close(e){if(h.isUndefined(e))n.chatboxviews.each(function(e){e.is_chatroom&&e.model&&e.close()});else if(h.isString(e)){const t=n.chatboxviews.get(e);t&&t.close()}else h.each(e,function(e){const t=n.chatboxviews.get(e);t&&t.close()})},create(e,t){if(h.isString(t)?t={nick:t}:h.isUndefined(t)&&(t={}),h.isUndefined(t.maximize)&&(t.maximize=!1),!t.nick&&n.muc_nickname_from_jid&&(t.nick=o.getNodeFromJid(n.bare_jid)),h.isUndefined(e))throw new TypeError("rooms.create: You need to provide at least one JID");return h.isString(e)?p(e,t):h.map(e,h.partial(p,h,t))},open(e,t){if(h.isUndefined(e))throw new TypeError("rooms.open: You need to provide at least one JID");return h.isString(e)?n.api.rooms.create(e,t).trigger("show"):h.map(e,e=>n.api.rooms.create(e,t).trigger("show"))},get(e,f,a){if(h.isString(f)?f={nick:f}:h.isUndefined(f)&&(f={}),h.isUndefined(e)){const e=[];return n.chatboxes.each(function(f){f.get("type")===t.CHATROOMS_TYPE&&e.push(f)}),e}return f.nick||(f.nick=o.getNodeFromJid(n.bare_jid)),h.isString(e)?g(e,f):h.map(e,h.partial(g,h,f))}}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(9),f(46),f(17),f(4),f(15),f(267),f(266),f(265),f(264),f(281)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i){n=n.Strophe;const u=/\b(https?:\/\/|www\.|https?:\/\/www\.)[^\s<>]{2,200}\b\/?/g,_=f.assign({debug:f.get(console,"log")?console.log.bind(console):f.noop,error:f.get(console,"log")?console.log.bind(console):f.noop,info:f.get(console,"log")?console.log.bind(console):f.noop,warn:f.get(console,"log")?console.log.bind(console):f.noop},console);var d={};function l(e,t){e.classList.remove("visible"),f.isFunction(t)&&t()}return d.getNextElement=function(t,a="*"){let n=t.nextElementSibling;for(;!f.isNull(n)&&!e.matchesSelector(n,a);)n=n.nextElementSibling;return n},d.getPreviousElement=function(t,a="*"){let n=t.previousSibling;for(;!f.isNull(n)&&!e.matchesSelector(n,a);)n=n.previousSibling;return n},d.getFirstChildElement=function(t,a="*"){let n=t.firstElementChild;for(;!f.isNull(n)&&!e.matchesSelector(n,a);)n=n.nextSibling;return n},d.getLastChildElement=function(t,a="*"){let n=t.lastElementChild;for(;!f.isNull(n)&&!e.matchesSelector(n,a);)n=n.previousSibling;return n},d.calculateElementHeight=function(e){return f.reduce(e.children,(e,t)=>e+t.offsetHeight,0)},d.addClass=function(e,t){t instanceof Element&&t.classList.add(e)},d.removeClass=function(e,t){return t instanceof Element&&t.classList.remove(e),t},d.removeElement=function(e){f.isNil(e)||f.isNil(e.parentNode)||e.parentNode.removeChild(e)},d.showElement=f.flow(f.partial(d.removeClass,"collapsed"),f.partial(d.removeClass,"hidden")),d.hideElement=function(e){return f.isNil(e)||e.classList.add("hidden"),e},d.ancestor=function(t,a){let n=t;for(;!f.isNil(n)&&!e.matchesSelector(n,a);)n=n.parentElement;return n},d.nextUntil=function(e,t,a=!1){const n=[];let o=e.nextElementSibling;for(;!f.isNil(o)&&!o.matches(t);)n.push(o),o=o.nextElementSibling;return n},d.unescapeHTML=function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},d.escapeHTML=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},d.addHyperlinks=function(e){return o.withinString(e,function(e){var t=new o(e);return t.normalize(),e.startsWith("http://")||e.startsWith("https://")||(e="http://"+e),e=encodeURI(decodeURI(e)).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"),`${d.escapeHTML(t.readable())}`})},d.renderImageURLs=function(a,n){const o=a.__,r=n.textContent.match(u)||[];return t.all(f.map(r,a=>new t((r,s)=>(a=a,new t((e,t)=>{var f=new Image,n=window.setTimeout(function(){t(new Error("Could not determine whether it's an image")),f=null},3e3);f.onerror=f.onabort=function(){clearTimeout(n),t(new Error("Could not determine whether it's an image"))},f.onload=function(){clearTimeout(n),e(f)},f.src=a})).then(function(t){const s=new Image;s.src=t.src,s.addEventListener("load",r),s.addEventListener("error",r),f.each(e(`a[href="${a}"]`,n),e=>{e.outerHTML=c({url:a,label_download:o("Download")})})}).catch(r))));var s},d.renderFileURL=function(e,t){const a=new o(t),n=e.__,r=a.filename();return!f.includes(["https","http"],a.protocol())||r.endsWith("mp3")||r.endsWith("mp4")||r.endsWith("jpg")||r.endsWith("jpeg")||r.endsWith("png")||r.endsWith("gif")||r.endsWith("svg")?t:s({url:t,label_download:n('Download: "%1$s',r)})},d.renderImageURL=function(e,t){const f=e.__;return t.endsWith("jpg")||t.endsWith("jpeg")||t.endsWith("png")||t.endsWith("gif")||t.endsWith("svg")?c({url:t,label_download:f("Download")}):t},d.renderMovieURL=function(e,t){const f=e.__;return t.endsWith("mp4")?i({url:t,label_download:f("Download video file")}):t},d.renderAudioURL=function(e,t){const f=e.__;return t.endsWith("mp3")?r({url:t,label_download:f("Download audio file")}):t},d.slideInAllElements=function(e,a=300){return t.all(f.map(e,f.partial(d.slideIn,f,a)))},d.slideToggleElement=function(e,t){return f.includes(e.classList,"collapsed")||f.includes(e.classList,"hidden")?d.slideOut(e,t):d.slideIn(e,t)},d.hasClass=function(e,t){return f.includes(t.classList,e)},d.slideOut=function(e,a=200){return new t((t,n)=>{if(f.isNil(e)){const e="Undefined or null element passed into slideOut";return _.warn(e),void n(new Error(e))}const o=e.getAttribute("data-slider-marker");o&&(e.removeAttribute("data-slider-marker"),window.cancelAnimationFrame(o));const r=d.calculateElementHeight(e);if(window.converse_disable_effects)return e.style.height=r+"px",function(e){e.removeAttribute("data-slider-marker"),e.classList.remove("collapsed"),e.style.overflow="",e.style.height=""}(e),void t();if(!d.hasClass("collapsed",e)&&!d.hasClass("hidden",e))return void t();const s=a/17;let c=0;e.style.height="0",e.style.overflow="hidden",e.classList.remove("hidden"),e.classList.remove("collapsed"),e.setAttribute("data-slider-marker",window.requestAnimationFrame(function f(){(c+=r/s){if(f.isNil(e)){const e="Undefined or null element passed into slideIn";return _.warn(e),n(new Error(e))}if(f.includes(e.classList,"collapsed"))return t(e);if(window.converse_disable_effects)return e.classList.add("collapsed"),e.style.height="",t(e);const o=e.getAttribute("data-slider-marker");o&&(e.removeAttribute("data-slider-marker"),window.cancelAnimationFrame(o));const r=e.offsetHeight,s=a/17;let c=r;e.style.overflow="hidden",e.setAttribute("data-slider-marker",window.requestAnimationFrame(function f(){(c-=r/s)>0?(e.style.height=c+"px",e.setAttribute("data-slider-marker",window.requestAnimationFrame(f))):(e.removeAttribute("data-slider-marker"),e.classList.add("collapsed"),e.style.height="",t(e))}))})},d.fadeIn=function(e,t){if(f.isNil(e)&&_.warn("Undefined or null element passed into fadeIn"),window.converse_disable_effects)return e.classList.remove("hidden"),l(e,t);f.includes(e.classList,"hidden")?(e.classList.add("visible"),e.classList.remove("hidden"),e.addEventListener("webkitAnimationEnd",f.partial(l,e,t)),e.addEventListener("animationend",f.partial(l,e,t)),e.addEventListener("oanimationend",f.partial(l,e,t))):l(e,t)},d.isValidJID=function(e){return 2===f.compact(e.split("@")).length&&!e.startsWith("@")&&!e.endsWith("@")},d.isValidMUCJID=function(e){return!e.startsWith("@")&&!e.endsWith("@")},d.isSameBareJID=function(e,t){return n.getBareJidFromJid(e).toLowerCase()===n.getBareJidFromJid(t).toLowerCase()},d.getMostRecentMessage=function(e){const t=e.messages.filter("message");return t[t.length-1]},d.isNewMessage=function(t){return t instanceof Element?!e('result[xmlns="'+n.NS.MAM+'"]',t).length&&!e('delay[xmlns="'+n.NS.DELAY+'"]',t).length:!t.get("delayed")},d.isOnlyChatStateNotification=function(e){return e instanceof a.Model&&(e=e.attributes),e.chat_state&&!e.oob_url&&!e.file&&!e.message},d.isOTRMessage=function(e){var t=e.querySelector("body"),a=f.isNull(t)?void 0:t.textContent;return a&&!!a.match(/^\?OTR/)},d.isHeadlineMessage=function(e,t){var a=t.getAttribute("from");if("headline"===t.getAttribute("type"))return!0;const o=e.chatboxes.get(n.getBareJidFromJid(a));return!(o&&"chatroom"===o.get("type")||"error"===t.getAttribute("type")||f.isNil(a)||f.includes(a,"@"))},d.merge=function e(t,a){for(var n in a)f.isObject(t[n])?e(t[n],a[n]):t[n]=a[n]},d.applyUserSettings=function e(t,a,n){for(var o in a)f.isUndefined(n[o])||(f.isObject(a[o])&&!f.isArray(a[o])?e(t[o],a[o],n[o]):t[o]=n[o])},d.stringToNode=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild},d.getOuterWidth=function(e,t=!1){var f=e.offsetWidth;if(!t)return f;var a=window.getComputedStyle(e);return f+=parseInt(a.marginLeft,10)+parseInt(a.marginRight,10)},d.stringToElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild},d.matchesSelector=function(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)},d.queryChildren=function(e,t){return f.filter(e.childNodes,f.partial(d.matchesSelector,f,t))},d.contains=function(e,t){return function(a){if("object"==typeof e){var n=!1;return f.forEach(e,function(e){n=n||f.includes(a.get(e).toLowerCase(),t.toLowerCase())}),n}if("string"==typeof e)return f.includes(a.get(e).toLowerCase(),t.toLowerCase());throw new TypeError("contains: wrong attribute type. Must be string or array.")}},d.isOfType=function(e,t){return t.get("type")==e},d.isInstance=function(e,t){return t instanceof e},d.getAttribute=function(e,t){return t.get(e)},d.contains.not=function(e,t){return function(f){return!d.contains(e,t)(f)}},d.rootContains=function(e,t){return e!==document||e.contains?e.contains?e.contains(t):window.HTMLElement.prototype.contains.call(e,t):document.head.contains(t)||document.body.contains(t)},d.createFragmentFromText=function(e){var t,f=document.createDocumentFragment(),a=document.createElement("body");for(a.innerHTML=e;t=a.firstChild;)f.appendChild(t);return f},d.addEmoji=function(e,t,f){return e.use_emojione?t.toImage(f):t.shortnameToUnicode(f)},d.getEmojisByCategory=function(e,t){if(f.isUndefined(e.emojis_by_category)){const a=f.values(f.mapValues(t.emojioneList,function(e,t,f){return e._shortname=t,e})),n=[":tone1:",":tone2:",":tone3:",":tone4:",":tone5:"],o=[":kiss_ww:",":kiss_mm:",":kiss_woman_man:"],r=[":woman",":man",":women_",":men_","_man_","_woman_","_woman:","_man:"],s=["modifier","regional"],c=f.difference(f.uniq(f.map(a,f.partial(f.get,f,"category"))),s),i={};f.forEach(c,e=>{let t=f.sortBy(f.filter(a,["category",e]),["uc_base"]);if(t=f.filter(t,e=>!f.includes(f.concat(n,o),e._shortname)&&!f.some(r,f.partial(f.includes,e._shortname))),"people"===e){const e=f.findIndex(t,["uc_base","1f600"]);t=f.union(f.slice(t,e),f.slice(t,0,e+1))}else"activity"===e?t=f.union(f.slice(t,26),f.slice(t,0,27)):"objects"===e?t=f.union(f.slice(t,23),f.slice(t,0,24)):"travel"===e?t=f.union(f.slice(t,16),f.slice(t,0,17)):"symbols"===e&&(t=f.union(f.slice(t,59),f.slice(t,0,60)));i[e]=t}),e.emojis_by_category=i}return e.emojis_by_category},d.getTonedEmojis=function(e){return e.toned_emojis=f.uniq(f.map(f.filter(d.getEmojisByCategory(e).people,e=>f.includes(e._shortname,"_tone")),e=>e._shortname.replace(/_tone[1-5]/,""))),e.toned_emojis},d.isPersistableModel=function(e){return e.collection&&e.collection.browserStorage},d.getResolveablePromise=function(){const e={},a=new t((t,f)=>{e.resolve=t,e.reject=f});return f.assign(a,e),a},d.interpolate=function(e,t){return e.replace(/{{{([^{}]*)}}}/g,(e,f)=>{var a=t[f];return"string"==typeof a||"number"==typeof a?a:e})},d.onMultipleEvents=function(e=[],t){let a=[];function n(f){a.push(f),e.length===a.length&&(t(a),a=[])}f.each(e,e=>e.object.on(e.event,n))},d.safeSave=function(e,t){d.isPersistableModel(e)?e.save(t):e.set(t)},d.isVisible=function(e){return!d.hasClass("hidden",e)&&(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0)},d.triggerEvent=function(e,t,f="Event",a=!0,n=!0){const o=document.createEvent(f);o.initEvent(t,a,n),e.dispatchEvent(o)},d.geoUriToHttp=function(e,t){return e.replace(/geo:([\-0-9.]+),([\-0-9.]+)(?:,([\-0-9.]+))?(?:\?(.*))?/g,t)},d.httpToGeoUri=function(e,t){return e.replace(t.geouri_regex,"geo:$1,$2")},d.getSelectValues=function(e){for(var t,f=[],a=e&&e.options,n=0,o=a.length;n+~]|"+z+")"+z+"*"),V=new RegExp("="+z+"*([^\\]'\"]*?)"+z+"*\\]","g"),G=new RegExp(q),Q=new RegExp("^"+F+"$"),X={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+z+"*(even|odd|(([+-]|)(\\d*)n|)"+z+"*(?:([+-]|)"+z+"*(\\d+)|))"+z+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+z+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+z+"*((?:-\\d)?\\d*)"+z+"*\\)|)(?=[^-]|$)","i")},K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,ee=/^[^{]+\{\s*\[native \w/,te=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,fe=/[+~]/,ae=new RegExp("\\\\([\\da-f]{1,6}"+z+"?|("+z+")|.)","ig"),ne=function(e,t,f){var a="0x"+t-65536;return a!=a||f?t:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,1023&a|56320)},oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},se=function(){g()},ce=ke(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{O.apply(E=R.call(x.childNodes),x.childNodes),E[x.childNodes.length].nodeType}catch(e){O={apply:E.length?function(e,t){N.apply(e,R.call(t))}:function(e,t){for(var f=e.length,a=0;e[f++]=t[a++];);e.length=f-1}}}function ie(e,t,f,a){var n,o,s,c,i,_,l,h=t&&t.ownerDocument,m=t?t.nodeType:9;if(f=f||[],"string"!=typeof e||!e||1!==m&&9!==m&&11!==m)return f;if(!a&&((t?t.ownerDocument||t:x)!==p&&g(t),t=t||p,y)){if(11!==m&&(i=te.exec(e)))if(n=i[1]){if(9===m){if(!(s=t.getElementById(n)))return f;if(s.id===n)return f.push(s),f}else if(h&&(s=h.getElementById(n))&&M(t,s)&&s.id===n)return f.push(s),f}else{if(i[2])return O.apply(f,t.getElementsByTagName(e)),f;if((n=i[3])&&r.getElementsByClassName&&t.getElementsByClassName)return O.apply(f,t.getElementsByClassName(n)),f}if(r.qsa&&!j[e+" "]&&(!v||!v.test(e))){if(1!==m)h=t,l=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(oe,re):t.setAttribute("id",c=L),o=(_=u(e)).length;o--;)_[o]="#"+c+" "+we(_[o]);l=_.join(","),h=fe.test(e)&&ye(t.parentNode)||t}if(l)try{return O.apply(f,h.querySelectorAll(l)),f}catch(e){}finally{c===L&&t.removeAttribute("id")}}}return d(e.replace(W,"$1"),t,f,a)}function ue(){var e=[];return function t(f,a){return e.push(f+" ")>s.cacheLength&&delete t[e.shift()],t[f+" "]=a}}function _e(e){return e[L]=!0,e}function de(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var f=e.split("|"),a=f.length;a--;)s.attrHandle[f[a]]=t}function he(e,t){var f=t&&e,a=f&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(a)return a;if(f)for(;f=f.nextSibling;)if(f===t)return-1;return e?1:-1}function me(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ge(e){return function(t){var f=t.nodeName.toLowerCase();return("input"===f||"button"===f)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ce(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function be(e){return _e(function(t){return t=+t,_e(function(f,a){for(var n,o=e([],f.length,t),r=o.length;r--;)f[n=o[r]]&&(f[n]=!(a[n]=f[n]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(o in r=ie.support={},i=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},g=ie.setDocument=function(e){var t,f,a=e?e.ownerDocument||e:x;return a!==p&&9===a.nodeType&&a.documentElement?(b=(p=a).documentElement,y=!i(p),x!==p&&(f=p.defaultView)&&f.top!==f&&(f.addEventListener?f.addEventListener("unload",se,!1):f.attachEvent&&f.attachEvent("onunload",se)),r.attributes=de(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=de(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ee.test(p.getElementsByClassName),r.getById=de(function(e){return b.appendChild(e).id=L,!p.getElementsByName||!p.getElementsByName(L).length}),r.getById?(s.filter.ID=function(e){var t=e.replace(ae,ne);return function(e){return e.getAttribute("id")===t}},s.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var f=t.getElementById(e);return f?[f]:[]}}):(s.filter.ID=function(e){var t=e.replace(ae,ne);return function(e){var f=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return f&&f.value===t}},s.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var f,a,n,o=t.getElementById(e);if(o){if((f=o.getAttributeNode("id"))&&f.value===e)return[o];for(n=t.getElementsByName(e),a=0;o=n[a++];)if((f=o.getAttributeNode("id"))&&f.value===e)return[o]}return[]}}),s.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var f,a=[],n=0,o=t.getElementsByTagName(e);if("*"===e){for(;f=o[n++];)1===f.nodeType&&a.push(f);return a}return o},s.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&y)return t.getElementsByClassName(e)},w=[],v=[],(r.qsa=ee.test(p.querySelectorAll))&&(de(function(e){b.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+z+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+z+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+L+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+L+"+*").length||v.push(".#.+[+~]")}),de(function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+z+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),b.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(r.matchesSelector=ee.test(k=b.matches||b.webkitMatchesSelector||b.mozMatchesSelector||b.oMatchesSelector||b.msMatchesSelector))&&de(function(e){r.disconnectedMatch=k.call(e,"*"),k.call(e,"[s!='']:x"),w.push("!=",q)}),v=v.length&&new RegExp(v.join("|")),w=w.length&&new RegExp(w.join("|")),t=ee.test(b.compareDocumentPosition),M=t||ee.test(b.contains)?function(e,t){var f=9===e.nodeType?e.documentElement:e,a=t&&t.parentNode;return e===a||!(!a||1!==a.nodeType||!(f.contains?f.contains(a):e.compareDocumentPosition&&16&e.compareDocumentPosition(a)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return m=!0,0;var f=!e.compareDocumentPosition-!t.compareDocumentPosition;return f||(1&(f=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===f?e===p||e.ownerDocument===x&&M(x,e)?-1:t===p||t.ownerDocument===x&&M(x,t)?1:h?I(h,e)-I(h,t):0:4&f?-1:1)}:function(e,t){if(e===t)return m=!0,0;var f,a=0,n=e.parentNode,o=t.parentNode,r=[e],s=[t];if(!n||!o)return e===p?-1:t===p?1:n?-1:o?1:h?I(h,e)-I(h,t):0;if(n===o)return he(e,t);for(f=e;f=f.parentNode;)r.unshift(f);for(f=t;f=f.parentNode;)s.unshift(f);for(;r[a]===s[a];)a++;return a?he(r[a],s[a]):r[a]===x?-1:s[a]===x?1:0},p):p},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&g(e),t=t.replace(V,"='$1']"),r.matchesSelector&&y&&!j[t+" "]&&(!w||!w.test(t))&&(!v||!v.test(t)))try{var f=k.call(e,t);if(f||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return f}catch(e){}return ie(t,p,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!==p&&g(e),M(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==p&&g(e);var f=s.attrHandle[t.toLowerCase()],a=f&&C.call(s.attrHandle,t.toLowerCase())?f(e,t,!y):void 0;return void 0!==a?a:r.attributes||!y?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},ie.escape=function(e){return(e+"").replace(oe,re)},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,f=[],a=0,n=0;if(m=!r.detectDuplicates,h=!r.sortStable&&e.slice(0),e.sort(A),m){for(;t=e[n++];)t===e[n]&&(a=f.push(n));for(;a--;)e.splice(f[a],1)}return h=null,e},c=ie.getText=function(e){var t,f="",a=0,n=e.nodeType;if(n){if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)f+=c(e)}else if(3===n||4===n)return e.nodeValue}else for(;t=e[a++];)f+=c(t);return f},(s=ie.selectors={cacheLength:50,createPseudo:_e,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ae,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(ae,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,f=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":f&&G.test(f)&&(t=u(f,!0))&&(t=f.indexOf(")",f.length-t)-f.length)&&(e[0]=e[0].slice(0,t),e[2]=f.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ae,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+z+")"+e+"("+z+"|$)"))&&D(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,f){return function(a){var n=ie.attr(a,e);return null==n?"!="===t:!t||(n+="","="===t?n===f:"!="===t?n!==f:"^="===t?f&&0===n.indexOf(f):"*="===t?f&&n.indexOf(f)>-1:"$="===t?f&&n.slice(-f.length)===f:"~="===t?(" "+n.replace(U," ")+" ").indexOf(f)>-1:"|="===t&&(n===f||n.slice(0,f.length+1)===f+"-"))}},CHILD:function(e,t,f,a,n){var o="nth"!==e.slice(0,3),r="last"!==e.slice(-4),s="of-type"===t;return 1===a&&0===n?function(e){return!!e.parentNode}:function(t,f,c){var i,u,_,d,l,h,m=o!==r?"nextSibling":"previousSibling",g=t.parentNode,p=s&&t.nodeName.toLowerCase(),b=!c&&!s,y=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===p:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[r?g.firstChild:g.lastChild],r&&b){for(y=(l=(i=(u=(_=(d=g)[L]||(d[L]={}))[d.uniqueID]||(_[d.uniqueID]={}))[e]||[])[0]===S&&i[1])&&i[2],d=l&&g.childNodes[l];d=++l&&d&&d[m]||(y=l=0)||h.pop();)if(1===d.nodeType&&++y&&d===t){u[e]=[S,l,y];break}}else if(b&&(y=l=(i=(u=(_=(d=t)[L]||(d[L]={}))[d.uniqueID]||(_[d.uniqueID]={}))[e]||[])[0]===S&&i[1]),!1===y)for(;(d=++l&&d&&d[m]||(y=l=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==p:1!==d.nodeType)||!++y||(b&&((u=(_=d[L]||(d[L]={}))[d.uniqueID]||(_[d.uniqueID]={}))[e]=[S,y]),d!==t)););return(y-=n)===a||y%a==0&&y/a>=0}}},PSEUDO:function(e,t){var f,a=s.pseudos[e]||s.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return a[L]?a(t):a.length>1?(f=[e,e,"",t],s.setFilters.hasOwnProperty(e.toLowerCase())?_e(function(e,f){for(var n,o=a(e,t),r=o.length;r--;)e[n=I(e,o[r])]=!(f[n]=o[r])}):function(e){return a(e,0,f)}):a}},pseudos:{not:_e(function(e){var t=[],f=[],a=_(e.replace(W,"$1"));return a[L]?_e(function(e,t,f,n){for(var o,r=a(e,null,n,[]),s=e.length;s--;)(o=r[s])&&(e[s]=!(t[s]=o))}):function(e,n,o){return t[0]=e,a(t,null,o,f),t[0]=null,!f.pop()}}),has:_e(function(e){return function(t){return ie(e,t).length>0}}),contains:_e(function(e){return e=e.replace(ae,ne),function(t){return(t.textContent||t.innerText||c(t)).indexOf(e)>-1}}),lang:_e(function(e){return Q.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(ae,ne).toLowerCase(),function(t){var f;do{if(f=y?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(f=f.toLowerCase())===e||0===f.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===b},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!s.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:be(function(){return[0]}),last:be(function(e,t){return[t-1]}),eq:be(function(e,t,f){return[f<0?f+t:f]}),even:be(function(e,t){for(var f=0;f=0;)e.push(a);return e}),gt:be(function(e,t,f){for(var a=f<0?f+t:f;++a1?function(t,f,a){for(var n=e.length;n--;)if(!e[n](t,f,a))return!1;return!0}:e[0]}function Le(e,t,f,a,n){for(var o,r=[],s=0,c=e.length,i=null!=t;s-1&&(o[i]=!(r[i]=_))}}else p=Le(p===r?p.splice(h,p.length):p),n?n(null,r,p,c):O.apply(r,p)})}function Se(e){for(var t,f,a,n=e.length,o=s.relative[e[0].type],r=o||s.relative[" "],c=o?1:0,i=ke(function(e){return e===t},r,!0),u=ke(function(e){return I(t,e)>-1},r,!0),_=[function(e,f,a){var n=!o&&(a||f!==l)||((t=f).nodeType?i(e,f,a):u(e,f,a));return t=null,n}];c1&&Me(_),c>1&&we(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(W,"$1"),f,c0,a=e.length>0,n=function(n,o,r,c,i){var u,_,d,h=0,m="0",b=n&&[],v=[],w=l,k=n||a&&s.find.TAG("*",i),M=S+=null==w?1:Math.random()||.1,L=k.length;for(i&&(l=o===p||o||i);m!==L&&null!=(u=k[m]);m++){if(a&&u){for(_=0,o||u.ownerDocument===p||(g(u),r=!y);d=e[_++];)if(d(u,o||p,r)){c.push(u);break}i&&(S=M)}f&&((u=!d&&u)&&h--,n&&b.push(u))}if(h+=m,f&&m!==h){for(_=0;d=t[_++];)d(b,v,o,r);if(n){if(h>0)for(;m--;)b[m]||v[m]||(v[m]=H.call(c));v=Le(v)}O.apply(c,v),i&&!n&&v.length>0&&h+t.length>1&&ie.uniqueSort(c)}return i&&(S=M,l=w),b};return f?_e(n):n}(n,a))).selector=e}return o},d=ie.select=function(e,t,f,a){var n,o,r,c,i,d="function"==typeof e&&e,l=!a&&u(e=d.selector||e);if(f=f||[],1===l.length){if((o=l[0]=l[0].slice(0)).length>2&&"ID"===(r=o[0]).type&&9===t.nodeType&&y&&s.relative[o[1].type]){if(!(t=(s.find.ID(r.matches[0].replace(ae,ne),t)||[])[0]))return f;d&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(n=X.needsContext.test(e)?0:o.length;n--&&(r=o[n],!s.relative[c=r.type]);)if((i=s.find[c])&&(a=i(r.matches[0].replace(ae,ne),fe.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(n,1),!(e=a.length&&we(o)))return O.apply(f,a),f;break}}return(d||_(e,l))(a,t,!y,f,!t||fe.test(e)&&ye(t.parentNode)||t),f},r.sortStable=L.split("").sort(A).join("")===L,r.detectDuplicates=!!m,g(),r.sortDetached=de(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),de(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,f){if(!f)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),r.attributes&&de(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,f){if(!f&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),de(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,f){var a;if(!f)return!0===e[t]?t.toLowerCase():(a=e.getAttributeNode(t))&&a.specified?a.value:null});var Te=n.Sizzle;ie.noConflict=function(){return n.Sizzle===ie&&(n.Sizzle=Te),ie},void 0===(a=function(){return ie}.call(t,f,t,e))||(e.exports=a)}(window)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(12),f(159),f(224),f(223),f(204),f(222),f(3),f(221),f(212)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r){const s=e.env,c=s.Strophe,i=s.Backbone,u=s.Promise,_=s._,d=s.moment,l=e.env.utils,h={Error:"error",Connecting:"info","Connection failure":"error",Authenticating:"info","Authentication failure":"error",Connected:"info",Disconnected:"error",Disconnecting:"warn",Attached:"info",Redirect:"info",Reconnecting:"warn"},m={0:"Error",1:"Connecting",2:"Connection failure",3:"Authenticating",4:"Authentication failure",5:"Connected",6:"Disconnected",7:"Disconnecting",8:"Attached",9:"Redirect",10:"Reconnecting"},g=[0,1,2,3,4,7,10];e.plugins.add("converse-controlbox",{dependencies:["converse-modal","converse-chatboxes","converse-rosterview","converse-chatview"],overrides:{_tearDown(){this.__super__._tearDown.apply(this,arguments),this.rosterview&&(this.rosterview.model.off().reset(),this.rosterview.each(function(e){e.removeAll(),e.remove()}),this.rosterview.removeAll().remove())},ChatBoxes:{chatBoxMayBeShown(e){return this.__super__.chatBoxMayBeShown.apply(this,arguments)&&"controlbox"!==e.get("id")}},ChatBoxViews:{onChatBoxAdded(e){const t=this.__super__._converse;if("controlbox"===e.get("box_id")){let f=this.get(e.get("id"));return f?(f.model=e,f.initialize(),f):(f=new t.ControlBoxView({model:e}),this.add(e.get("id"),f))}return this.__super__.onChatBoxAdded.apply(this,arguments)},closeAllChatBoxes(){const e=this.__super__._converse;return this.each(function(t){("controlbox"!==t.model.get("id")||e.disconnection_cause===e.LOGOUT&&!e.show_controlbox_by_default)&&t.close()}),this},getChatBoxWidth(e){const t=this.__super__._converse,f=this.get("controlbox");return"controlbox"===e.model.get("id")?f&&l.isVisible(f.el)?l.getOuterWidth(f.el,!0):l.getOuterWidth(t.controlboxtoggle.el,!0):this.__super__.getChatBoxWidth.apply(this,arguments)}},ChatBox:{initialize(){"controlbox"===this.get("id")?this.set({time_opened:d(0).valueOf()}):this.__super__.initialize.apply(this,arguments)}},ChatBoxView:{insertIntoDOM(){const e=this.__super__._converse.chatboxviews.get("controlbox");return e?e.el.insertAdjacentElement("afterend",this.el):this.__super__.insertIntoDOM.apply(this,arguments),this}}},initialize(){const e=this._converse,f=e.__;e.api.settings.update({allow_logout:!0,default_domain:void 0,locked_domain:void 0,show_controlbox_by_default:!1,sticky_controlbox:!1}),e.api.promises.add("controlboxInitialized"),f("Contacts"),e.addControlBox=(()=>e.chatboxes.add({id:"controlbox",box_id:"controlbox",type:"controlbox",closed:!e.show_controlbox_by_default})),e.ControlBoxView=e.ChatBoxView.extend({tagName:"div",className:"chatbox",id:"controlbox",events:{"click a.close-chatbox-button":"close"},initialize(){_.isUndefined(e.controlboxtoggle)&&(e.controlboxtoggle=new e.ControlBoxToggle),e.controlboxtoggle.el.insertAdjacentElement("afterend",this.el),this.model.on("change:connected",this.onConnected,this),this.model.on("destroy",this.hide,this),this.model.on("hide",this.hide,this),this.model.on("show",this.show,this),this.model.on("change:closed",this.ensureClosedState,this),this.render(),this.model.get("connected")&&this.insertRoster(),e.emit("controlboxInitialized",this)},render(){return this.model.get("connected")&&_.isUndefined(this.model.get("closed"))&&this.model.set("closed",!e.show_controlbox_by_default),this.el.innerHTML=n(_.extend(this.model.toJSON())),this.model.get("closed")?this.hide():this.show(),e.connection.connected&&e.connection.authenticated&&!e.connection.disconnecting?!this.model.get("connected")||this.controlbox_pane&&l.isVisible(this.controlbox_pane.el)||this.renderControlBoxPane():this.renderLoginPanel(),this},onConnected(){this.model.get("connected")&&(this.render(),this.insertRoster())},insertRoster(){e.api.waitUntil("rosterViewInitialized").then(()=>this.controlbox_pane.el.insertAdjacentElement("beforeEnd",e.rosterview.el)).catch(_.partial(e.log,_,c.LogLevel.FATAL))},createBrandHeadingHTML:()=>a({sticky_controlbox:e.sticky_controlbox}),insertBrandHeading(){const e=this.el.querySelector(".brand-heading-container");if(_.isNull(e)){const e=this.el.querySelector(".controlbox-head");e.insertAdjacentHTML("beforeend",this.createBrandHeadingHTML())}else e.outerHTML=this.createBrandHeadingHTML()},renderLoginPanel(){if(this.el.classList.add("logged-out"),_.isNil(this.loginpanel)){this.loginpanel=new e.LoginPanel({model:new e.LoginPanelModel});const t=this.el.querySelector(".controlbox-panes");t.innerHTML="",t.appendChild(this.loginpanel.render().el),this.insertBrandHeading()}else this.loginpanel.render();return this},renderControlBoxPane(){this.loginpanel&&(this.loginpanel.remove(),delete this.loginpanel),this.el.classList.remove("logged-out"),this.controlbox_pane=new e.ControlBoxPane,this.el.querySelector(".controlbox-panes").insertAdjacentElement("afterBegin",this.controlbox_pane.el)},close(t){if(t&&t.preventDefault&&t.preventDefault(),!e.sticky_controlbox)return e.connection.connected&&!e.connection.disconnecting?this.model.save({closed:!0}):this.model.trigger("hide"),e.emit("controlBoxClosed",this),this},ensureClosedState(){this.model.get("closed")?this.hide():this.show()},hide(t){if(!e.sticky_controlbox)return l.addClass("hidden",this.el),e.emit("chatBoxClosed",this),e.connection.connected||e.controlboxtoggle.render(),e.controlboxtoggle.show(t),this},onControlBoxToggleHidden(){this.model.set("closed",!1),this.el.classList.remove("hidden"),e.emit("controlBoxOpened",this)},show(){return e.controlboxtoggle.hide(this.onControlBoxToggleHidden.bind(this)),this},showHelpMessages(){}}),e.LoginPanelModel=i.Model.extend({defaults:{errors:[]}}),e.LoginPanel=i.VDOMView.extend({tagName:"div",id:"converse-login-panel",className:"controlbox-pane fade-in",events:{"submit form#converse-login":"authenticate","change input":"validate"},initialize(f){this.model.on("change",this.render,this),this.listenTo(e.connfeedback,"change",this.render),this.render(),_.forEach(this.el.querySelectorAll("[data-title]"),f=>{new t.Popover(f,{trigger:"mobile"===e.view_mode?"click":"hover",dismissible:"mobile"===e.view_mode,container:e.chatboxviews.el})})},toHTML(){const t=e.connfeedback.get("connection_status");let a,n;return _.includes(g,t)&&(a=h[n=m[t]]),r(_.extend(this.model.toJSON(),{__:f,_converse:e,ANONYMOUS:e.ANONYMOUS,EXTERNAL:e.EXTERNAL,LOGIN:e.LOGIN,PREBIND:e.PREBIND,auto_login:e.auto_login,authentication:e.authentication,connection_status:t,conn_feedback_class:a,conn_feedback_subject:n,conn_feedback_message:e.connfeedback.get("message"),placeholder_username:(e.locked_domain||e.default_domain)&&f("Username")||f("user@domain")}))},validate(){const t=this.el.querySelector("form"),a=t.querySelector("input[name=jid]");return!a.value||e.locked_domain||e.default_domain||l.isValidJID(a.value)?(a.setCustomValidity(""),!0):(a.setCustomValidity(f("Please enter a valid XMPP address")),!1)},authenticate(t){if(t&&t.preventDefault&&t.preventDefault(),e.authentication===e.ANONYMOUS)return void this.connect(e.jid,null);if(!this.validate())return;const f=new FormData(t.target);e.trusted=f.get("trusted"),e.storage=f.get("trusted")?"local":"session";let a=f.get("jid");e.locked_domain?a=c.escapeNode(a)+"@"+e.locked_domain:e.default_domain&&!_.includes(a,"@")&&(a=a+"@"+e.default_domain),this.connect(a,f.get("password"))},connect(t,f){if(t){const f=c.getResourceFromJid(t);t=f?c.getBareJidFromJid(t).toLowerCase()+"/"+f:t.toLowerCase()+e.generateResource()}_.includes(["converse/login","converse/register"],i.history.getFragment())&&e.router.navigate("",{replace:!0}),e.connection.reset(),e.connection.connect(t,f,e.onConnectStatusChanged)}}),e.ControlBoxPane=i.NativeView.extend({tagName:"div",className:"controlbox-pane",initialize(){e.xmppstatusview=new e.XMPPStatusView({model:e.xmppstatus}),this.el.insertAdjacentElement("afterBegin",e.xmppstatusview.render().el)}}),e.ControlBoxToggle=i.NativeView.extend({tagName:"a",className:"toggle-controlbox hidden",id:"toggle-controlbox",events:{click:"onClick"},attributes:{href:"#"},initialize(){e.chatboxviews.insertRowColumn(this.render().el),e.api.waitUntil("initialized").then(this.render.bind(this)).catch(_.partial(e.log,_,c.LogLevel.FATAL))},render(){return this.el.innerHTML=o({label_toggle:e.connection.connected?f("Chat Contacts"):f("Toggle chat")}),this},hide(e){l.hideElement(this.el),e()},show(e){l.fadeIn(this.el,e)},showControlBox(){let t=e.chatboxes.get("controlbox");t||(t=e.addControlBox()),e.connection.connected?t.save({closed:!1}):t.trigger("show")},onClick(t){if(t.preventDefault(),l.isVisible(e.root.querySelector("#controlbox"))){const t=e.chatboxes.get("controlbox");e.connection.connected?t.save({closed:!0}):t.trigger("hide")}else this.showControlBox()}}),e.on("clearSession",()=>{if(e.trusted){const t=_.get(e,"chatboxes",null);if(!_.isNil(t)){const e=t.get("controlbox");e&&e.collection&&e.collection.browserStorage&&e.save({connected:!1})}}}),u.all([e.api.waitUntil("connectionInitialized"),e.api.waitUntil("chatBoxesInitialized")]).then(e.addControlBox).catch(_.partial(e.log,_,c.LogLevel.FATAL)),e.on("chatBoxesFetched",()=>{const t=e.chatboxes.get("controlbox")||e.addControlBox();t.save({connected:!0})});const s=function(){const t=e.chatboxviews.get("controlbox");t.model.set({connected:!1}),t.renderLoginPanel()};e.on("disconnected",s),e.on("will-reconnect",s)}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(231),f(12),f(56)],void 0===(o="function"==typeof(a=function(e,t,f){const a=e.env,n=a.Strophe,o=a.Backbone,r=a._;e.plugins.add("converse-modal",{initialize(){const e=this._converse;let a;e.BootstrapModal=o.VDOMView.extend({initialize(){this.render().insertIntoDOM(),this.modal=new f.Modal(this.el,{backdrop:"static",keyboard:!0}),this.el.addEventListener("hide.bs.modal",e=>{r.isNil(this.trigger_el)||this.trigger_el.classList.remove("selected")},!1)},insertIntoDOM(){const t=e.chatboxviews.el.querySelector("#converse-modals");t.insertAdjacentElement("beforeEnd",this.el)},show(e){e&&(e.preventDefault(),this.trigger_el=e.target,this.trigger_el.classList.add("selected")),this.modal.show()}}),e.Alert=e.BootstrapModal.extend({initialize(){e.BootstrapModal.prototype.initialize.apply(this,arguments),this.model.on("change",this.render,this)},toHTML(){return t(this.model.toJSON())}}),r.extend(e.api,{alert:{show(t,f,s){if(r.isString(s)&&(s=[s]),t===n.LogLevel.ERROR?t="alert-danger":t===n.LogLevel.INFO?t="alert-info":t===n.LogLevel.WARN&&(t="alert-warning"),r.isUndefined(a)){const n=new o.Model({title:f,messages:s,type:t});a=new e.Alert({model:n})}else a.model.set({title:f,messages:s,type:t});a.show()}}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){(function(f){var a,n,o;n=[],void 0===(o="function"==typeof(a=function(){"use strict";var e=void 0!==f?f:this||window,t=document,a=t.documentElement,n=e.BSN={},o=n.supports=[],r="data-toggle",s="active",c="left",i="top",u="onmouseleave"in t?["mouseenter","mouseleave"]:["mouseover","mouseout"],_=/\b(top|bottom|left|right)+/,d=0,l="WebkitTransition"in a.style||"Transition".toLowerCase()in a.style,h="WebkitTransition"in a.style?"Webkit".toLowerCase()+"TransitionEnd":"Transition".toLowerCase()+"end",m=function(e){e.focus?e.focus():e.setActive()},g=function(e,t){e.classList.add(t)},p=function(e,t){e.classList.remove(t)},b=function(e,t){return e.classList.contains(t)},y=function(e,t){return[].slice.call(e.getElementsByClassName(t))},v=function(e,f){var a=f||t;return"object"==typeof e?e:a.querySelector(e)},w=function(e,f){var a=f.charAt(0),n=f.substr(1);if("."===a){for(;e&&e!==t;e=e.parentNode)if(null!==v(f,e.parentNode)&&b(e,n))return e}else if("#"===a)for(;e&&e!==t;e=e.parentNode)if(e.id===n)return e;return!1},k=function(e,t,f){e.addEventListener(t,f,!1)},M=function(e,t,f){e.removeEventListener(t,f,!1)},L=function(e,t,f){k(e,t,function a(n){f(n),M(e,t,a)})},x=function(e,t){l?L(e,h,function(e){t(e)}):t()},S=function(e,t,f){var a=new CustomEvent(e+".bs."+t);a.relatedTarget=f,this.dispatchEvent(a)},T=function(){return{y:e.pageYOffset||a.scrollTop,x:e.pageXOffset||a.scrollLeft}},D=function(e,f,n,o){var r,s,u,d,l,h,m={w:f.offsetWidth,h:f.offsetHeight},g=a.clientWidth||t.body.clientWidth,p=a.clientHeight||t.body.clientHeight,y=e.getBoundingClientRect(),w=o===t.body?T():{x:o.offsetLeft+o.scrollLeft,y:o.offsetTop+o.scrollTop},k={w:y.right-y.left,h:y.bottom-y.top},M=b(f,"popover"),L=v(".arrow",f),x=y.top+k.h/2-m.h/2<0,S=y.left+k.w/2-m.w/2<0,D=y.left+m.w/2+k.w/2>=g,Y=y.top+m.h/2+k.h/2>=p,j=y.top-m.h<0,A=y.left-m.w<0,C=y.top+m.h+k.h>=p,E=y.left+m.w+k.w>=g;n="right"===(n=(n="bottom"===(n=(n=(n===c||"right"===n)&&A&&E?i:n)===i&&j?"bottom":n)&&C?i:n)===c&&A?"right":n)&&E?c:n,-1===f.className.indexOf(n)&&(f.className=f.className.replace(_,n)),l=L.offsetWidth,h=L.offsetHeight,n===c||"right"===n?(s=n===c?y.left+w.x-m.w-(M?l:0):y.left+w.x+k.w,x?(r=y.top+w.y,u=k.h/2-l):Y?(r=y.top+w.y-m.h+k.h,u=m.h-k.h/2-l):(r=y.top+w.y-m.h/2+k.h/2,u=m.h/2-(M?.9*h:h/2))):n!==i&&"bottom"!==n||(r=n===i?y.top+w.y-m.h-(M?h:0):y.top+w.y+k.h,S?(s=0,d=y.left+k.w/2-l):D?(s=g-1.01*m.w,d=m.w-(g-y.left)+k.w/2-l/2):(s=y.left+w.x-m.w/2+k.w/2,d=m.w/2-l/2)),f.style.top=r+"px",f.style.left=s+"px",u&&(L.style.top=u+"px"),d&&(L.style.left=d+"px")};n.version="2.0.22";var Y=function(e){e=v(e);var t=this,f=w(e,".alert"),a=function(a){f=w(a.target,".alert"),(e=v('[data-dismiss="alert"]',f))&&f&&(e===a.target||e.contains(a.target))&&t.close()},n=function(){S.call(f,"closed","alert"),M(e,"click",a),f.parentNode.removeChild(f)};this.close=function(){f&&e&&b(f,"show")&&(S.call(f,"close","alert"),p(f,"show"),f&&(b(f,"fade")?x(f,n):n()))},"Alert"in e||k(e,"click",a),e.Alert=t};o.push(["Alert",Y,'[data-dismiss="alert"]']);var j=function(e){var f=!1,a="checked",n=function(t){var n="LABEL"===t.target.tagName?t.target:"LABEL"===t.target.parentNode.tagName?t.target.parentNode:null;if(n){var o=t.target,r=y(o.parentNode,"btn"),c=n.getElementsByTagName("INPUT")[0];if(c){if("checkbox"===c.type&&(c.checked?(p(n,s),c.getAttribute(a),c.removeAttribute(a),c.checked=!1):(g(n,s),c.getAttribute(a),c.setAttribute(a,a),c.checked=!0),f||(f=!0,S.call(c,"change","button"),S.call(e,"change","button"))),"radio"===c.type&&!f&&!c.checked){g(n,s),c.setAttribute(a,a),c.checked=!0,S.call(c,"change","button"),S.call(e,"change","button"),f=!0;for(var i=0,u=r.length;i=0&&(w++,m.slideTo(w))},this.interval)},this.slideTo=function(e){if(!x){var a,n=this.getActiveIndex();ne||n===D-1&&0===e)&&(Y=m.direction="right"),e<0?e=D-1:e===D&&(e=0),w=e,a=Y===c?"next":"prev",S.call(f,"slide","carousel",T[e]),x=!0,clearInterval(M),R(e),l&&b(f,"slide")?(g(T[e],"carousel-item-"+a),T[e].offsetWidth,g(T[e],"carousel-item-"+Y),g(T[n],"carousel-item-"+Y),L(T[n],h,function(o){var r=o.target!==T[n]?1e3*o.elapsedTime:0;setTimeout(function(){x=!1,g(T[e],s),p(T[n],s),p(T[e],"carousel-item-"+a),p(T[e],"carousel-item-"+Y),p(T[n],"carousel-item-"+Y),S.call(f,"slid","carousel",T[e]),t.hidden||!m.interval||b(f,"paused")||m.cycle()},r+100)})):(g(T[e],s),T[e].offsetWidth,p(T[n],s),setTimeout(function(){x=!1,m.interval&&!b(f,"paused")&&m.cycle(),S.call(f,"slid","carousel",T[e])},100))}},this.getActiveIndex=function(){return T.indexOf(y(f,"carousel-item active")[0])||0},"Carousel"in f||(m.pause&&m.interval&&(k(f,u[0],H),k(f,u[1],N),k(f,"touchstart",H),k(f,"touchend",N)),A&&k(A,"click",O),j&&k(j,"click",O),C&&k(C,"click",function(e){if(e.preventDefault(),!x){var t=e.target;if(!t||b(t,s)||!t.getAttribute("data-slide-to"))return!1;w=parseInt(t.getAttribute("data-slide-to"),10),m.slideTo(w)}}),!0===m.keyboard&&k(e,"keydown",function(e){if(!x){switch(e.which){case 39:w++;break;case 37:w--;break;default:return}m.slideTo(w)}})),m.getActiveIndex()<0&&(T.length&&g(T[0],s),E.length&&R(0)),m.interval&&m.cycle(),f.Carousel=m};o.push(["Carousel",A,'[data-ride="carousel"]']);var C=function(e,t){e=v(e),t=t||{};var f,a,n,o=null,r=null,s=this,c=!1,i=e.getAttribute("data-parent"),u=function(e,t){S.call(e,"hide","collapse"),c=!0,e.style.height=e.scrollHeight+"px",p(e,"collapse"),p(e,"show"),g(e,"collapsing"),e.offsetWidth,e.style.height="0px",x(e,function(){c=!1,e.setAttribute("aria-expanded","false"),t.setAttribute("aria-expanded","false"),p(e,"collapsing"),g(e,"collapse"),e.style.height="",S.call(e,"hidden","collapse")})};this.toggle=function(e){e.preventDefault(),c||(b(r,"show")?s.hide():s.show())},this.hide=function(){u(r,e),g(e,"collapsed")},this.show=function(){if(o){var t=v(".collapse.show",o),f=t&&(v('[data-toggle="collapse"][data-target="#'+t.id+'"]',o)||v('[data-toggle="collapse"][href="#'+t.id+'"]',o)),a=f&&(f.getAttribute("data-target")||f.href);t&&f&&t!==r&&(u(t,f),a.split("#")[1]!==r.id?g(f,"collapsed"):p(f,"collapsed"))}!function(e,t){S.call(e,"show","collapse"),c=!0,g(e,"collapsing"),p(e,"collapse"),e.style.height=e.scrollHeight+"px",x(e,function(){c=!1,e.setAttribute("aria-expanded","true"),t.setAttribute("aria-expanded","true"),p(e,"collapsing"),g(e,"collapse"),g(e,"show"),e.style.height="",S.call(e,"shown","collapse")})}(r,e),p(e,"collapsed")},"Collapse"in e||k(e,"click",s.toggle),f=e.href&&e.getAttribute("href"),a=e.getAttribute("data-target"),n=f||a&&"#"===a.charAt(0)&&a,r=n&&v(n),o=v(t.parent)||i&&w(e,i),e.Collapse=s};o.push(["Collapse",C,'[data-toggle="collapse"]']);var E=function(e,f){e=v(e),this.persist=!0===f||"true"===e.getAttribute("data-persist")||!1;var a=this,n=e.parentNode,o=null,r=v(".dropdown-menu",n),s=function(){for(var e=r.children,t=[],f=0;f1?i-1:0:40===n&&ia.clientHeight,(o=t.createElement("div")).className="modal-scrollbar-measure",t.body.appendChild(o),n=o.offsetWidth-o.clientWidth,t.body.removeChild(o),u=n},Y=function(){s.style.paddingLeft=!c&&i?u+"px":"",s.style.paddingRight=c&&!i?u+"px":""},j=function(){(_=v(".modal-backdrop"))&&null!==_&&"object"==typeof _&&(d=0,t.body.removeChild(_),_=null),S.call(s,"hidden","modal")},A=function(){b(s,"show")?k(t,"keydown",O):M(t,"keydown",O)},C=function(){b(s,"show")?k(e,"resize",h.update):M(e,"resize",h.update)},E=function(){b(s,"show")?k(s,"click",R):M(s,"click",R)},H=function(){m(s),S.call(s,"shown","modal",w)},N=function(){s.style.display="",f&&m(f),y(t,"modal show")[0]||(s.style.paddingLeft="",s.style.paddingRight="",function(){if(t.body.style.paddingRight="",L.length)for(var e=0;e×',l=v(a.container),h=v(_),m=w(f,".modal"),y=w(f,".fixed-top"),L=w(f,".fixed-bottom");this.template=a.template?a.template:null,this.trigger=a.trigger?a.trigger:n||"hover",this.animation=a.animation&&"fade"!==a.animation?a.animation:o||"fade",this.placement=a.placement?a.placement:r||i,this.delay=parseInt(a.delay||c)||200,this.dismissible=!(!a.dismissible&&"true"!==s),this.container=l||h||y||L||m||t.body;var T=this,Y=f.getAttribute("data-title")||null,j=f.getAttribute("data-content")||null;if(j||this.template){var A=null,C=0,E=this.placement,H=function(e){null!==A&&e.target===v(".close",A)&&T.hide()},N=function(a){"click"!=T.trigger&&"focus"!=T.trigger||!T.dismissible&&a(f,"blur",T.hide),T.dismissible&&a(t,"click",H),a(e,"resize",T.hide)},O=function(){N(k),S.call(f,"shown","popover")},R=function(){N(M),T.container.removeChild(A),C=null,A=null,S.call(f,"hidden","popover")};this.toggle=function(){null===A?T.show():T.hide()},this.show=function(){clearTimeout(C),C=setTimeout(function(){null===A&&(E=T.placement,function(){Y=f.getAttribute("data-title"),j=f.getAttribute("data-content"),A=t.createElement("div");var e=t.createElement("div");if(e.setAttribute("class","arrow"),A.appendChild(e),null!==j&&null===T.template){if(A.setAttribute("role","tooltip"),null!==Y){var a=t.createElement("h3");a.setAttribute("class","popover-header"),a.innerHTML=T.dismissible?Y+d:Y,A.appendChild(a)}var n=t.createElement("div");n.setAttribute("class","popover-body"),n.innerHTML=T.dismissible&&null===Y?j+d:j,A.appendChild(n)}else{var o=t.createElement("div");o.innerHTML=T.template,A.innerHTML=o.firstChild.innerHTML}T.container.appendChild(A),A.style.display="block",A.setAttribute("class","popover bs-popover-"+E+" "+T.animation)}(),D(f,A,E,T.container),!b(A,"show")&&g(A,"show"),S.call(f,"show","popover"),T.animation?x(A,O):O())},20)},this.hide=function(){clearTimeout(C),C=setTimeout(function(){A&&null!==A&&b(A,"show")&&(S.call(f,"hide","popover"),p(A,"show"),T.animation?x(A,R):R())},T.delay)},"Popover"in f||("hover"===T.trigger?(k(f,u[0],T.show),T.dismissible||k(f,u[1],T.hide)):"click"!=T.trigger&&"focus"!=T.trigger||k(f,T.trigger,T.toggle)),f.Popover=T}};o.push(["Popover",N,'[data-toggle="popover"]']);var O=function(t,f){t=v(t);var a=v(t.getAttribute("data-target")),n=t.getAttribute("data-offset");if((f=f||{}).target||a){for(var o,r=f.target&&v(f.target)||a,c=r&&r.getElementsByTagName("A"),i=parseInt(n||f.offset)||10,u=[],_=[],d=t.offsetHeight=h&&m>o;if(!d&&v)b(f,s)||(g(f,s),r&&!b(r,s)&&g(r,s),S.call(t,"activate","scrollspy",u[e]));else if(v){if(!v&&!d||d&&v)return}else b(f,s)&&(p(f,s),r&&b(r,s)&&!y(f.parentNode,s).length&&p(r,s))};this.refresh=function(){!function(){o=l?T().y:t.scrollTop;for(var e=0,f=u.length;e1&&(e=t[t.length-1]):e=t[0],e},A=function(){return v(j().getAttribute("href"))};this.show=function(){i=v((a=a||e).getAttribute("href")),n=j(),o=A(),m.isAnimating=!0,p(n,s),g(a,s),L&&(b(e.parentNode,"dropdown-menu")?b(L,s)||g(L,s):b(L,s)&&p(L,s)),S.call(n,"hide","tab",a),b(o,"fade")?(p(o,"show"),x(o,Y)):Y()},"Tab"in e||k(e,"click",function(e){var t=e.target.getAttribute("href");e.preventDefault(),a="tab"===e.target.getAttribute(r)||t&&"#"===t.charAt(0)?e.target:e.target.parentNode,!m.isAnimating&&!b(a,s)&&h.show()}),h.height&&(M=A().parentNode),e.Tab=h}};o.push(["Tab",R,'[data-toggle="tab"]']);var I=function(f,a){f=v(f),a=a||{};var n=f.getAttribute("data-animation"),o=f.getAttribute("data-placement"),r=f.getAttribute("data-delay"),s=f.getAttribute("data-container"),c=v(a.container),_=v(s),d=w(f,".modal"),l=w(f,".fixed-top"),h=w(f,".fixed-bottom");this.animation=a.animation&&"fade"!==a.animation?a.animation:n||"fade",this.placement=a.placement?a.placement:o||i,this.delay=parseInt(a.delay||r)||200,this.container=c||_||l||h||d||t.body;var m=this,y=0,L=this.placement,T=null,Y=f.getAttribute("title")||f.getAttribute("data-title")||f.getAttribute("data-original-title");if(Y&&""!=Y){var j=function(){k(e,"resize",m.hide),S.call(f,"shown","tooltip")},A=function(){M(e,"resize",m.hide),m.container.removeChild(T),T=null,y=null,S.call(f,"hidden","tooltip")};this.show=function(){clearTimeout(y),y=setTimeout(function(){if(null===T){if(L=m.placement,0==function(){if(!(Y=f.getAttribute("title")||f.getAttribute("data-title")||f.getAttribute("data-original-title"))||""==Y)return!1;(T=t.createElement("div")).setAttribute("role","tooltip");var e=t.createElement("div");e.setAttribute("class","arrow"),T.appendChild(e);var a=t.createElement("div");a.setAttribute("class","tooltip-inner"),T.appendChild(a),a.innerHTML=Y,m.container.appendChild(T),T.setAttribute("class","tooltip bs-tooltip-"+L+" "+m.animation)}())return;D(f,T,L,m.container),!b(T,"show")&&g(T,"show"),S.call(f,"show","tooltip"),m.animation?x(T,j):j()}},20)},this.hide=function(){clearTimeout(y),y=setTimeout(function(){T&&b(T,"show")&&(S.call(f,"hide","tooltip"),p(T,"show"),m.animation?x(T,A):A())},m.delay)},this.toggle=function(){T?m.hide():m.show()},"Tooltip"in f||(f.setAttribute("data-original-title",Y),f.removeAttribute("title"),k(f,u[0],m.show),k(f,u[1],m.hide)),f.Tooltip=m}};o.push(["Tooltip",I,'[data-toggle="tooltip"]']);var P=function(e,t){for(var f=0,a=t.length;f:-)":"1f606","':-(":"1f613",">:-(":"1f620",":'-(":"1f622","O:-)":"1f607","0:-3":"1f607","0:-)":"1f607","0;^)":"1f607","O;-)":"1f607","0;-)":"1f607","O:-3":"1f607","-__-":"1f611",":-Þ":"1f61b",":)":"1f606",">;)":"1f606",">=)":"1f606",";-)":"1f609","*-)":"1f609",";-]":"1f609",";^)":"1f609","':(":"1f613","'=(":"1f613",":-*":"1f618",":^*":"1f618",">:P":"1f61c","X-P":"1f61c",">:[":"1f61e",":-(":"1f61e",":-[":"1f61e",">:(":"1f620",":'(":"1f622",";-(":"1f622",">.<":"1f623","#-)":"1f635","%-)":"1f635","X-)":"1f635","\\0/":"1f646","\\O/":"1f646","0:3":"1f607","0:)":"1f607","O:)":"1f607","O=)":"1f607","O:3":"1f607","B-)":"1f60e","8-)":"1f60e","B-D":"1f60e","8-D":"1f60e","-_-":"1f611",">:\\":"1f615",">:/":"1f615",":-/":"1f615",":-.":"1f615",":-P":"1f61b",":Þ":"1f61b",":-b":"1f61b",":-O":"1f62e",O_O:"1f62e",">:O":"1f62e",":-X":"1f636",":-#":"1f636",":-)":"1f642","(y)":"1f44d","<3":"2764",":D":"1f603","=D":"1f603",";)":"1f609","*)":"1f609",";]":"1f609",";D":"1f609",":*":"1f618","=*":"1f618",":(":"1f61e",":[":"1f61e","=(":"1f61e",":@":"1f620",";(":"1f622","D:":"1f628",":$":"1f633","=$":"1f633","#)":"1f635","%)":"1f635","X)":"1f635","B)":"1f60e","8)":"1f60e",":/":"1f615",":\\":"1f615","=/":"1f615","=\\":"1f615",":L":"1f615","=L":"1f615",":P":"1f61b","=P":"1f61b",":b":"1f61b",":O":"1f62e",":X":"1f636",":#":"1f636","=X":"1f636","=#":"1f636",":)":"1f642","=]":"1f642","=)":"1f642",":]":"1f642"},e.asciiRegexp="(\\*\\\\0\\/\\*|\\*\\\\O\\/\\*|\\-___\\-|\\:'\\-\\)|'\\:\\-\\)|'\\:\\-D|\\>\\:\\-\\)|>\\:\\-\\)|'\\:\\-\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:'\\-\\(|O\\:\\-\\)|0\\:\\-3|0\\:\\-\\)|0;\\^\\)|O;\\-\\)|0;\\-\\)|O\\:\\-3|\\-__\\-|\\:\\-Þ|\\:\\-Þ|\\<\\/3|<\\/3|\\:'\\)|\\:\\-D|'\\:\\)|'\\=\\)|'\\:D|'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\=\\)|>\\=\\)|;\\-\\)|\\*\\-\\)|;\\-\\]|;\\^\\)|'\\:\\(|'\\=\\(|\\:\\-\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\-\\[|\\>\\:\\(|>\\:\\(|\\:'\\(|;\\-\\(|\\>\\.\\<|>\\.<|#\\-\\)|%\\-\\)|X\\-\\)|\\\\0\\/|\\\\O\\/|0\\:3|0\\:\\)|O\\:\\)|O\\=\\)|O\\:3|B\\-\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\-P|\\:Þ|\\:Þ|\\:\\-b|\\:\\-O|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:\\-#|\\:\\-\\)|\\(y\\)|\\<3|<3|\\:D|\\=D|;\\)|\\*\\)|;\\]|;D|\\:\\*|\\=\\*|\\:\\(|\\:\\[|\\=\\(|\\:@|;\\(|D\\:|\\:\\$|\\=\\$|#\\)|%\\)|X\\)|B\\)|8\\)|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\=P|\\:b|\\:O|\\:X|\\:#|\\=X|\\=#|\\:\\)|\\=\\]|\\=\\)|\\:\\])",e.emojiVersion="3.1",e.emojiSize="32",e.greedyMatch=!1,e.imagePathPNG="https://cdn.jsdelivr.net/emojione/assets/"+e.emojiVersion+"/png/",e.defaultPathPNG=e.imagePathPNG,e.imageTitleTag=!0,e.sprites=!1,e.spriteSize="32",e.unicodeAlt=!0,e.ascii=!1,e.riskyMatchAscii=!1,e.regShortNames=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+e.shortnames+")","gi"),e.regAscii=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)"+e.asciiRegexp+"(?=\\s|$|[!,.?]))","gi"),e.regAsciiRisky=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(()"+e.asciiRegexp+"())","gi"),e.regUnicode=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(?:🏳)️?‍?(?:🌈)|(?:👁)️?‍?(?:🗨)️?|[#-9]️?⃣|(?:(?:🏴)(?:\udb40[\udc60-\udcff]){1,6})|(?:\ud83c[\udde0-\uddff]){2}|(?:(?:\ud83d[\udc68\udc69]))️?(?:\ud83c[\udffa-\udfff])?‍?(?:[⚕⚖✈]|\ud83c[\udf3e-\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92])|(?:\ud83d[\udc68\udc69]|\ud83e[\uddd0-\udddf])(?:\ud83c[\udffa-\udfff])?‍?[♀♂⚕⚖✈]?️?|(?:(?:❤|\ud83d[\udc66-\udc69\udc8b])[‍️]{0,2}){1,3}(?:❤|\ud83d[\udc66-\udc69\udc8b])|(?:(?:❤|\ud83d[\udc66-\udc69\udc8b])️?){2,4}|(?:\ud83d[\udc68\udc69\udc6e\udc71-\udc87\udd75\ude45-\ude4e]|\ud83e[\udd26\udd37]|\ud83c[\udfc3-\udfcc]|\ud83e[\udd38-\udd3e]|\ud83d[\udea3-\udeb6]|⛹|👯)️?(?:\ud83c[\udffb-\udfff])?‍?[♀♂]?️?|(?:[☝⛹✊-✍]|\ud83c[\udf85-\udfcc]|\ud83d[\udc42-\udcaa\udd74-\udd96\ude45-\ude4f\udea3-\udecc]|\ud83e[\udd18-\udd3e])️?(?:\ud83c[\udffb-\udfff])|(?:[↔-↙↩-↪]️?|[#*]|[〰〽]️?|(?:\ud83c[\udd70-\udd71]|🆎|\ud83c[\udd91-\udd9a])️?|Ⓜ️?|[㊗㊙]️?|(?:\ud83c[\ude01-\ude02]|🈚|🈯|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51])️?|[‼⁉]️?|[▪-▫▶◀◻-◾]️?|[©®]️?|[™ℹ]️?|🀄️?|[⬅-⬇⬛-⬜⭐⭕]️?|[⌚-⌛⌨⏏⏩-⏳⏸-⏺]️?|🃏|[⤴⤵]️?)|[✀-➿]️?|[\ud800-\udbff][\udc00-\udfff]️?|[☀-⛿]️?|[0-9]️","g"),e.toImage=function(t){return t=e.unicodeToImage(t),t=e.shortnameToImage(t)},e.unifyUnicode=function(t){return t=e.toShort(t),t=e.shortnameToUnicode(t)},e.shortnameToAscii=function(t){var f,a=e.objectFlip(e.asciiList);return t=t.replace(e.regShortNames,function(t){return void 0!==t&&""!==t&&t in e.emojioneList?(f=e.emojioneList[t].uc_output,void 0!==a[f]?a[f]:t):t})},e.shortnameToUnicode=function(t){var f;if(t=t.replace(e.regShortNames,function(t){return void 0!==t&&""!==t&&t in e.emojioneList?(f=e.emojioneList[t].uc_output.toUpperCase(),e.emojioneList[t].uc_base,e.convert(f)):t}),e.ascii){var a=e.riskyMatchAscii?e.regAsciiRisky:e.regAscii;t=t.replace(a,function(t,a,n,o){return void 0!==o&&""!==o&&e.unescapeHTML(o)in e.asciiList?(o=e.unescapeHTML(o),f=e.asciiList[o].toUpperCase(),n+e.convert(f)):t})}return t},e.shortnameToImage=function(t){var f,a,n,o,r,s,c,i,u=e.mapUnicodeToShort();if(t=t.replace(e.regShortNames,function(t){if(void 0===t||""===t||-1===e.shortnames.indexOf(t))return t;if(!e.emojioneList[t])for(var f in e.emojioneList)if(e.emojioneList.hasOwnProperty(f)&&""!==f&&-1!==e.emojioneList[f].shortnames.indexOf(t)){t=f;break}return a=e.emojioneList[t].uc_output,n=e.emojioneList[t].uc_base,r=n.includes("-1f3f")?"diversity":e.emojioneList[t].category,s=e.imageTitleTag?'title="'+t+'"':"",c="32"==e.spriteSize||"64"==e.spriteSize?e.spriteSize:"32",i=e.imagePathPNG!=e.defaultPathPNG?e.imagePathPNG:e.defaultPathPNG+e.emojiSize+"/",o=e.unicodeAlt?e.convert(a.toUpperCase()):t,e.sprites?'"+o+"":''+o+''}),e.ascii){var _=e.riskyMatchAscii?e.regAsciiRisky:e.regAscii;t=t.replace(_,function(t,n,_,d){return void 0!==d&&""!==d&&e.unescapeHTML(d)in e.asciiList?(d=e.unescapeHTML(d),a=e.asciiList[d],f=u[a],r=a.includes("-1f3f")?"diversity":e.emojioneList[f].category,s=e.imageTitleTag?'title="'+e.escapeHTML(d)+'"':"",c="32"==e.spriteSize||"64"==e.spriteSize?e.spriteSize:"32",i=e.imagePathPNG!=e.defaultPathPNG?e.imagePathPNG:e.defaultPathPNG+e.emojiSize+"/",o=e.unicodeAlt?e.convert(a.toUpperCase()):e.escapeHTML(d),e.sprites?_+'"+o+"":_+''+o+''):t})}return t},e.unicodeToImage=function(t){var f,a,n,o,r,s,c,i,u=e.mapUnicodeToShort(),_=e.emojioneList;if(t=t.replace(e.regUnicode,function(t){if(void 0===t||""===t)return t;if(t in e.jsEscapeMap)n=e.jsEscapeMap[t];else{if(!(e.greedyMatch&&t in e.jsEscapeMapGreedy))return t;n=e.jsEscapeMapGreedy[t]}return a=u[n],n=_[a].uc_base,f=_[a].uc_output,r=n.includes("-1f3f")?"diversity":_[a].category,c="32"==e.spriteSize||"64"==e.spriteSize?e.spriteSize:"32",i=e.imagePathPNG!=e.defaultPathPNG?e.imagePathPNG:e.defaultPathPNG+e.emojiSize+"/",o=e.unicodeAlt?e.convert(f.toUpperCase()):a,s=e.imageTitleTag?'title="'+a+'"':"",e.sprites?'"+o+"":''+o+''}),e.ascii){var d=e.riskyMatchAscii?e.regAsciiRisky:e.regAscii;t=t.replace(d,function(t,a,n,_){return void 0!==_&&""!==_&&e.unescapeHTML(_)in e.asciiList?(_=e.unescapeHTML(_),f=e.asciiList[_],shortname=u[f],r=f.includes("-1f3f")?"diversity":e.emojioneList[shortname].category,s=e.imageTitleTag?'title="'+e.escapeHTML(_)+'"':"",c="32"==e.spriteSize||"64"==e.spriteSize?e.spriteSize:"32",i=e.imagePathPNG!=e.defaultPathPNG?e.imagePathPNG:e.defaultPathPNG+e.emojiSize+"/",o=e.unicodeAlt?e.convert(f.toUpperCase()):e.escapeHTML(_),e.sprites?n+'"+o+"":n+''+o+''):t})}return t},e.toShort=function(t){var f=e.unicodeCharRegex();return e.replaceAll(t,f)},e.convert=function(e){if(e.indexOf("-")>-1){for(var t=[],f=e.split("-"),a=0;a=65536&&n<=1114111){var o=Math.floor((n-65536)/1024)+55296,r=(n-65536)%1024+56320;n=String.fromCharCode(o)+String.fromCharCode(r)}else n=String.fromCharCode(n);t.push(n)}return t.join("")}if((f=parseInt(e,16))>=65536&&f<=1114111){o=Math.floor((f-65536)/1024)+55296,r=(f-65536)%1024+56320;return String.fromCharCode(o)+String.fromCharCode(r)}return String.fromCharCode(f)},e.escapeHTML=function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,function(e){return t[e]})},e.unescapeHTML=function(e){var t={"&":"&","&":"&","&":"&","<":"<","<":"<","<":"<",">":">",">":">",">":">",""":'"',""":'"',""":'"',"'":"'","'":"'","'":"'"};return e.replace(/&(?:amp|#38|#x26|lt|#60|#x3C|gt|#62|#x3E|apos|#39|#x27|quot|#34|#x22);/gi,function(e){return t[e]})},e.shortnameConversionMap=function(){var t,f=[];for(t in e.emojioneList)e.emojioneList.hasOwnProperty(t)&&""!==t&&(f[e.convert(e.emojioneList[t].uc_output)]=t);return f},e.unicodeCharRegex=function(){var f=[];for(t in e.emojioneList)e.emojioneList.hasOwnProperty(t)&&""!==t&&f.push(e.convert(e.emojioneList[t].uc_output));return f.join("|")},e.mapEmojioneList=function(t){for(var f in e.emojioneList){if(e.emojioneList.hasOwnProperty(f))t(e.emojioneList[f].uc_base,f)}},e.mapUnicodeToShort=function(){return e.memMapShortToUnicode||(e.memMapShortToUnicode={},e.mapEmojioneList(function(t,f){e.memMapShortToUnicode[t]=f})),e.memMapShortToUnicode},e.memorizeReplacement=function(){if(!e.unicodeReplacementRegEx||!e.memMapShortToUnicodeCharacters){var t=[];e.memMapShortToUnicodeCharacters={},e.mapEmojioneList(function(f,a){var n=e.convert(f);e.memMapShortToUnicodeCharacters[n]=a,t.push(n)}),e.unicodeReplacementRegEx=t.join("|")}},e.mapUnicodeCharactersToShort=function(){return e.memorizeReplacement(),e.memMapShortToUnicodeCharacters},e.objectFlip=function(e){var t,f={};for(t in e)e.hasOwnProperty(t)&&(f[e[t]]=t);return f},e.escapeRegExp=function(e){return e.replace(/[-[\]{}()*+?.,;:&\\^$#\s]/g,"\\$&")},e.replaceAll=function(t,f){var a=e.escapeRegExp(f),n=new RegExp("]*>.*?|]*>.*?|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|("+a+")","gi");return t.replace(n,function(t,f){return void 0===f||""===f?t:e.shortnameConversionMap()[f]})}}(this.emojione=this.emojione||{}),e.exports=this.emojione},function(e,t,f){var a,n,o;n=[f(4)],void 0===(o="function"==typeof(a=function(e){var t=/^\s*0&&(e.splice(_-1,2),_-=2)}e=e.join("/")}if((m||p)&&g){for(_=(f=e.split("/")).length;_>0;_-=1){if(a=f.slice(0,_).join("/"),m)for(d=m.length;d>0;d-=1)if((n=g[m.slice(0,d).join("/")])&&(n=n[a])){o=n,s=_;break}if(o)break;!c&&p&&p[a]&&(c=p[a],i=_)}!o&&c&&(o=c,s=i),o&&(f.splice(0,s,o),e=f.join("/"))}return e}function p(e,t){return function(){var f=l.call(arguments,0);return"string"!=typeof f[0]&&1===f.length&&f.push(null),o.apply(a,f.concat([e,t]))}}function b(e){return function(t){c[e]=t}}function y(e){if(m(i,e)){var t=i[e];delete i[e],_[e]=!0,n.apply(a,t)}if(!m(c,e)&&!m(_,e))throw new Error("No "+e);return c[e]}function v(e){var t,f=e?e.indexOf("!"):-1;return f>-1&&(t=e.substring(0,f),e=e.substring(f+1,e.length)),[t,e]}function w(e){return e?v(e):[]}r=function(e,t){var f,a,n=v(e),o=n[0],r=t[1];return e=n[1],o&&(f=y(o=g(o,r))),o?e=f&&f.normalize?f.normalize(e,(a=r,function(e){return g(e,a)})):g(e,r):(o=(n=v(e=g(e,r)))[0],e=n[1],o&&(f=y(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:f}},s={require:function(e){return p(e)},exports:function(e){var t=c[e];return void 0!==t?t:c[e]={}},module:function(e){return{id:e,uri:"",exports:c[e],config:function(e){return function(){return u&&u.config&&u.config[e]||{}}}(e)}}},n=function(e,t,f,n){var o,u,d,l,h,g,v,k=[],M=typeof f;if(g=w(n=n||e),"undefined"===M||"function"===M){for(t=!t.length&&f.length?["require","exports","module"]:t,h=0;h>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(f=t),a=0;a>2,r=(3&f)<<4|(a=e.charCodeAt(u++))>>4,s=(15&a)<<2|(n=e.charCodeAt(u++))>>6,c=63&n,isNaN(a)?(r=(3&f)<<4,s=c=64):isNaN(n)&&(c=64),i=i+t.charAt(o)+t.charAt(r)+t.charAt(s)+t.charAt(c)}while(u>4,a=(15&o)<<4|(r=t.indexOf(e.charAt(i++)))>>2,n=(3&r)<<6|(s=t.indexOf(e.charAt(i++))),c+=String.fromCharCode(f),64!==r&&(c+=String.fromCharCode(a)),64!==s&&(c+=String.fromCharCode(n))}while(i>5]|=128<<24-a%32,e[15+(a+64>>9<<4)]=a;var r,s,c,i,u,_,d,l,h=new Array(80),m=1732584193,g=-271733879,p=-1732584194,b=271733878,y=-1009589776;for(r=0;r16&&(a=e(a,8*t.length));for(var n=new Array(16),o=new Array(16),s=0;s<16;s++)n[s]=909522486^a[s],o[s]=1549556828^a[s];var c=e(n.concat(r(f)),512+8*f.length);return e(o.concat(c),672)}function n(e,t){var f=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(f>>16)<<16|65535&f}function o(e,t){return e<>>32-t}function r(e){for(var t=[],f=0;f<8*e.length;f+=8)t[f>>5]|=(255&e.charCodeAt(f/8))<<24-f%32;return t}function s(e){for(var t="",f=0;f<32*e.length;f+=8)t+=String.fromCharCode(e[f>>5]>>>24-f%32&255);return t}function c(e){for(var t,f,a="",n=0;n<4*e.length;n+=3)for(t=(e[n>>2]>>8*(3-n%4)&255)<<16|(e[n+1>>2]>>8*(3-(n+1)%4)&255)<<8|e[n+2>>2]>>8*(3-(n+2)%4)&255,f=0;f<4;f++)8*n+6*f>32*e.length?a+="=":a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t>>6*(3-f)&63);return a}return{b64_hmac_sha1:function(e,t){return c(a(e,t))},b64_sha1:function(t){return c(e(r(t),8*t.length))},binb2str:s,core_hmac_sha1:a,str_hmac_sha1:function(e,t){return s(a(e,t))},str_sha1:function(t){return s(e(r(t),8*t.length))}}}),function(e,t){"function"==typeof f&&f.amd?f("strophe-md5",[],function(){return t()}):e.MD5=t()}(this,function(){var e=function(e,t){var f=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(f>>16)<<16|65535&f},t=function(e){for(var t=[],f=0;f<8*e.length;f+=8)t[f>>5]|=(255&e.charCodeAt(f/8))<>>32-c,a);var s,c},a=function(e,t,a,n,o,r,s){return f(t&a|~t&n,e,t,o,r,s)},n=function(e,t,a,n,o,r,s){return f(t&n|a&~n,e,t,o,r,s)},o=function(e,t,a,n,o,r,s){return f(t^a^n,e,t,o,r,s)},r=function(e,t,a,n,o,r,s){return f(a^(t|~n),e,t,o,r,s)},s=function(t,f){t[f>>5]|=128<>>9<<4)]=f;for(var s,c,i,u,_=1732584193,d=-271733879,l=-1732584194,h=271733878,m=0;m>2]>>f%4*8+4&15)+"0123456789abcdef".charAt(e[f>>2]>>f%4*8&15);return t}(s(t(e),8*e.length))},hash:function(e){return function(e){for(var t="",f=0;f<32*e.length;f+=8)t+=String.fromCharCode(e[f>>5]>>>f%32&255);return t}(s(t(e),8*e.length))}}}),function(e,t){"function"==typeof f&&f.amd?f("strophe-utils",[],function(){return t()}):e.stropheUtils=t()}(this,function(){return{utf16to8:function(e){var t,f,a="",n=e.length;for(t=0;t=0&&f<=127?a+=e.charAt(t):f>2047?(a+=String.fromCharCode(224|f>>12&15),a+=String.fromCharCode(128|f>>6&63),a+=String.fromCharCode(128|f>>0&63)):(a+=String.fromCharCode(192|f>>6&31),a+=String.fromCharCode(128|f>>0&63));return a},addCookies:function(e){var t,f,a,n,o,r,s;for(t in e||{})o="",r="",s="",a="object"==typeof(f=e[t]),n=escape(unescape(a?f.value:f)),a&&(o=f.expires?";expires="+f.expires:"",r=f.domain?";domain="+f.domain:"",s=f.path?";path="+f.path:""),document.cookie=t+"="+n+o+r+s}}}),function(e,t){if("function"==typeof f&&f.amd)f("strophe-core",["strophe-sha1","strophe-md5","strophe-utils"],function(){return t.apply(this,arguments)});else{var a=t(e.SHA1,e.MD5,e.stropheUtils);e.Strophe=a.Strophe,e.$build=a.$build,e.$iq=a.$iq,e.$msg=a.$msg,e.$pres=a.$pres,e.SHA1=a.SHA1,e.MD5=a.MD5,e.b64_hmac_sha1=a.SHA1.b64_hmac_sha1,e.b64_sha1=a.SHA1.b64_sha1,e.str_hmac_sha1=a.SHA1.str_hmac_sha1,e.str_sha1=a.SHA1.str_sha1}}(this,function(e,t,f){var a;function n(e,t){return new a.Builder(e,t)}function o(e){return new a.Builder("iq",e)}function r(e){return new a.Builder("presence",e)}return(a={VERSION:"1.2.14",NS:{HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas",XHTML_IM:"http://jabber.org/protocol/xhtml-im",XHTML:"http://www.w3.org/1999/xhtml"},XHTML:{tags:["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul","body"],attributes:{a:["href"],blockquote:["style"],br:[],cite:["style"],em:[],img:["src","alt","style","height","width"],li:["style"],ol:["style"],p:["style"],span:["style"],strong:[],ul:["style"],body:[]},css:["background-color","color","font-family","font-size","font-style","font-weight","margin-left","margin-right","text-align","text-decoration"],validTag:function(e){for(var t=0;t0)for(var f=0;f/g,">")).replace(/'/g,"'")).replace(/"/g,""")},xmlunescape:function(e){return e=(e=(e=(e=(e=e.replace(/\&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/'/g,"'")).replace(/"/g,'"')},xmlTextNode:function(e){return a.xmlGenerator().createTextNode(e)},xmlHtmlNode:function(e){var t;return DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)),t},getText:function(e){if(!e)return null;var t="";0===e.childNodes.length&&e.nodeType===a.ElementType.TEXT&&(t+=e.nodeValue);for(var f=0;f0&&(s=c.join("; "),f.setAttribute(r,s))}else f.setAttribute(r,s);for(t=0;t/g,"\\3e").replace(/@/g,"\\40")},unescapeNode:function(e){return"string"!=typeof e?e:e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},getNodeFromJid:function(e){return e.indexOf("@")<0?null:e.split("@")[0]},getDomainFromJid:function(e){var t=a.getBareJidFromJid(e);if(t.indexOf("@")<0)return t;var f=t.split("@");return f.splice(0,1),f.join("@")},getResourceFromJid:function(e){var t=e.split("/");return t.length<2?null:(t.splice(0,1),t.join("/"))},getBareJidFromJid:function(e){return e?e.split("/")[0]:null},_handleError:function(e){void 0!==e.stack&&a.fatal(e.stack),e.sourceURL?a.fatal("error: "+this.handler+" "+e.sourceURL+":"+e.line+" - "+e.name+": "+e.message):e.fileName?a.fatal("error: "+this.handler+" "+e.fileName+":"+e.lineNumber+" - "+e.name+": "+e.message):a.fatal("error: "+e.message)},log:function(e,t){},debug:function(e){this.log(this.LogLevel.DEBUG,e)},info:function(e){this.log(this.LogLevel.INFO,e)},warn:function(e){this.log(this.LogLevel.WARN,e)},error:function(e){this.log(this.LogLevel.ERROR,e)},fatal:function(e){this.log(this.LogLevel.FATAL,e)},serialize:function(e){var t;if(!e)return null;"function"==typeof e.tree&&(e=e.tree());var f,n,o=e.nodeName;for(e.getAttribute("_realname")&&(o=e.getAttribute("_realname")),t="<"+o,f=0;f0){for(t+=">",f=0;f"}t+=""}else t+="/>";return t},_requestId:0,_connectionPlugins:{},addConnectionPlugin:function(e,t){a._connectionPlugins[e]=t}}).Builder=function(e,t){"presence"!==e&&"message"!==e&&"iq"!==e||(t&&!t.xmlns?t.xmlns=a.NS.CLIENT:t||(t={xmlns:a.NS.CLIENT})),this.nodeTree=a.xmlElement(e,t),this.node=this.nodeTree},a.Builder.prototype={tree:function(){return this.nodeTree},toString:function(){return a.serialize(this.nodeTree)},up:function(){return this.node=this.node.parentNode,this},root:function(){return this.node=this.nodeTree,this},attrs:function(e){for(var t in e)e.hasOwnProperty(t)&&(void 0===e[t]?this.node.removeAttribute(t):this.node.setAttribute(t,e[t]));return this},c:function(e,t,f){var n=a.xmlElement(e,t,f);return this.node.appendChild(n),"string"!=typeof f&&"number"!=typeof f&&(this.node=n),this},cnode:function(e){var t,f=a.xmlGenerator();try{t=void 0!==f.importNode}catch(e){t=!1}var n=t?f.importNode(e,!0):a.copyElement(e);return this.node.appendChild(n),this.node=n,this},t:function(e){var t=a.xmlTextNode(e);return this.node.appendChild(t),this},h:function(e){var t=document.createElement("body");t.innerHTML=e;for(var f=a.createHtml(t);f.childNodes.length>0;)this.node.appendChild(f.childNodes[0]);return this}},a.Handler=function(e,t,f,n,o,r,s){this.handler=e,this.ns=t,this.name=f,this.type=n,this.id=o,this.options=s||{matchBareFromJid:!1,ignoreNamespaceFragment:!1},this.options.matchBare&&(a.warn('The "matchBare" option is deprecated, use "matchBareFromJid" instead.'),this.options.matchBareFromJid=this.options.matchBare,delete this.options.matchBare),this.options.matchBareFromJid?this.from=r?a.getBareJidFromJid(r):null:this.from=r,this.user=!0},a.Handler.prototype={getNamespace:function(e){var t=e.getAttribute("xmlns");return t&&this.options.ignoreNamespaceFragment&&(t=t.split("#")[0]),t},namespaceMatch:function(e){var t=!1;if(!this.ns)return!0;var f=this;return a.forEachChild(e,null,function(e){f.getNamespace(e)===f.ns&&(t=!0)}),t=t||this.getNamespace(e)===this.ns},isMatch:function(e){var t=e.getAttribute("from");this.options.matchBareFromJid&&(t=a.getBareJidFromJid(t));var f=e.getAttribute("type");return!(!this.namespaceMatch(e)||this.name&&!a.isTagEqual(e,this.name)||this.type&&(Array.isArray(this.type)?-1===this.type.indexOf(f):f!==this.type)||this.id&&e.getAttribute("id")!==this.id||this.from&&t!==this.from)},run:function(e){var t=null;try{t=this.handler(e)}catch(e){throw a._handleError(e),e}return t},toString:function(){return"{Handler: "+this.handler+"("+this.name+","+this.id+","+this.ns+")}"}},a.TimedHandler=function(e,t){this.period=e,this.handler=t,this.lastCalled=(new Date).getTime(),this.user=!0},a.TimedHandler.prototype={run:function(){return this.lastCalled=(new Date).getTime(),this.handler()},reset:function(){this.lastCalled=(new Date).getTime()},toString:function(){return"{TimedHandler: "+this.handler+"("+this.period+")}"}},a.Connection=function(e,t){this.service=e,this.options=t||{};var n=this.options.protocol||"";for(var o in 0===e.indexOf("ws:")||0===e.indexOf("wss:")||0===n.indexOf("ws")?this._proto=new a.Websocket(this):this._proto=new a.Bosh(this),this.jid="",this.domain=null,this.features=null,this._sasl_data={},this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.protocolErrorHandlers={HTTP:{},websocket:{}},this._idleTimeout=null,this._disconnectTimeout=null,this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.do_authentication=!0,this.paused=!1,this.restored=!1,this._data=[],this._uniqueId=0,this._sasl_success_handler=null,this._sasl_failure_handler=null,this._sasl_challenge_handler=null,this.maxRetries=5,this._idleTimeout=setTimeout(function(){this._onIdle()}.bind(this),100),f.addCookies(this.options.cookies),this.registerSASLMechanisms(this.options.mechanisms),a._connectionPlugins)if(a._connectionPlugins.hasOwnProperty(o)){var r=a._connectionPlugins[o],s=function(){};s.prototype=r,this[o]=new s,this[o].init(this)}},a.Connection.prototype={reset:function(){this._proto._reset(),this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.restored=!1,this._data=[],this._requests=[],this._uniqueId=0},pause:function(){this.paused=!0},resume:function(){this.paused=!1},getUniqueId:function(e){var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});return"string"==typeof e||"number"==typeof e?t+":"+e:t+""},addProtocolErrorHandler:function(e,t,f){this.protocolErrorHandlers[e][t]=f},connect:function(e,t,f,n,o,r,s){this.jid=e,this.authzid=a.getBareJidFromJid(this.jid),this.authcid=s||a.getNodeFromJid(this.jid),this.pass=t,this.servtype="xmpp",this.connect_callback=f,this.disconnecting=!1,this.connected=!1,this.authenticated=!1,this.restored=!1,this.domain=a.getDomainFromJid(this.jid),this._changeConnectStatus(a.Status.CONNECTING,null),this._proto._connect(n,o,r)},attach:function(e,t,f,n,o,r,s){if(!(this._proto instanceof a.Bosh))throw{name:"StropheSessionError",message:'The "attach" method can only be used with a BOSH connection.'};this._proto._attach(e,t,f,n,o,r,s)},restore:function(e,t,f,a,n){if(!this._sessionCachingSupported())throw{name:"StropheSessionError",message:'The "restore" method can only be used with a BOSH connection.'};this._proto._restore(e,t,f,a,n)},_sessionCachingSupported:function(){if(this._proto instanceof a.Bosh){if(!JSON)return!1;try{sessionStorage.setItem("_strophe_","_strophe_"),sessionStorage.removeItem("_strophe_")}catch(e){return!1}return!0}return!1},xmlInput:function(e){},xmlOutput:function(e){},rawInput:function(e){},rawOutput:function(e){},nextValidRid:function(e){},send:function(e){if(null!==e){if("function"==typeof e.sort)for(var t=0;t=0&&this.addHandlers.splice(t,1)},registerSASLMechanisms:function(e){this.mechanisms={},(e=e||[a.SASLAnonymous,a.SASLExternal,a.SASLMD5,a.SASLOAuthBearer,a.SASLPlain,a.SASLSHA1]).forEach(this.registerSASLMechanism.bind(this))},registerSASLMechanism:function(e){this.mechanisms[e.prototype.name]=e},disconnect:function(e){if(this._changeConnectStatus(a.Status.DISCONNECTING,e),a.info("Disconnect was called because: "+e),this.connected){var t=!1;this.disconnecting=!0,this.authenticated&&(t=r({xmlns:a.NS.CLIENT,type:"unavailable"})),this._disconnectTimeout=this._addSysTimedHandler(3e3,this._onDisconnectTimeout.bind(this)),this._proto._disconnect(t)}else a.info("Disconnect was called before Strophe connected to the server"),this._proto._abortAllRequests(),this._doDisconnect()},_changeConnectStatus:function(e,t){for(var f in a._connectionPlugins)if(a._connectionPlugins.hasOwnProperty(f)){var n=this[f];if(n.statusChanged)try{n.statusChanged(e,t)}catch(e){a.error(f+" plugin caused an exception changing status: "+e)}}if(this.connect_callback)try{this.connect_callback(e,t)}catch(e){a._handleError(e),a.error("User connection callback caused an exception: "+e)}},_doDisconnect:function(e){"number"==typeof this._idleTimeout&&clearTimeout(this._idleTimeout),null!==this._disconnectTimeout&&(this.deleteTimedHandler(this._disconnectTimeout),this._disconnectTimeout=null),a.info("_doDisconnect was called"),this._proto._doDisconnect(),this.authenticated=!1,this.disconnecting=!1,this.restored=!1,this.handlers=[],this.timedHandlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this._changeConnectStatus(a.Status.DISCONNECTED,e),this.connected=!1},_dataRecv:function(e,t){a.info("_dataRecv called");var f=this._proto._reqToData(e);if(null!==f){var n,o;for(this.xmlInput!==a.Connection.prototype.xmlInput&&(f.nodeName===this._proto.strip&&f.childNodes.length?this.xmlInput(f.childNodes[0]):this.xmlInput(f)),this.rawInput!==a.Connection.prototype.rawInput&&(t?this.rawInput(t):this.rawInput(a.serialize(f)));this.removeHandlers.length>0;)o=this.removeHandlers.pop(),(n=this.handlers.indexOf(o))>=0&&this.handlers.splice(n,1);for(;this.addHandlers.length>0;)this.handlers.push(this.addHandlers.pop());if(this.disconnecting&&this._proto._emptyQueue())this._doDisconnect();else{var r,s,c=f.getAttribute("type");if(null!==c&&"terminate"===c){if(this.disconnecting)return;return r=f.getAttribute("condition"),s=f.getElementsByTagName("conflict"),null!==r?("remote-stream-error"===r&&s.length>0&&(r="conflict"),this._changeConnectStatus(a.Status.CONNFAIL,r)):this._changeConnectStatus(a.Status.CONNFAIL,"unknown"),void this._doDisconnect(r)}var i=this;a.forEachChild(f,null,function(e){var t,f;for(f=i.handlers,i.handlers=[],t=0;t0:n.getElementsByTagName("stream:features").length>0||n.getElementsByTagName("features").length>0){var o,r,s=[],c=n.getElementsByTagName("mechanism");if(c.length>0)for(o=0;oe[a].prototype.priority&&(a=f);a!==t&&(n=e[t],e[t]=e[a],e[a]=n)}return e},_attemptSASLAuth:function(e){e=this.sortMechanismsByPriority(e||[]);var t=0,f=!1;for(t=0;t0&&(t="conflict"),this._changeConnectStatus(a.Status.AUTHFAIL,t),!1;var f,n=e.getElementsByTagName("bind");if(!(n.length>0))return a.info("SASL binding failed."),this._changeConnectStatus(a.Status.AUTHFAIL,null),!1;(f=n[0].getElementsByTagName("jid")).length>0&&(this.jid=a.getText(f[0]),this.do_session?(this._addSysHandler(this._sasl_session_cb.bind(this),null,null,null,"_session_auth_2"),this.send(o({type:"set",id:"_session_auth_2"}).c("session",{xmlns:a.NS.SESSION}).tree())):(this.authenticated=!0,this._changeConnectStatus(a.Status.CONNECTED,null)))},_sasl_session_cb:function(e){if("result"===e.getAttribute("type"))this.authenticated=!0,this._changeConnectStatus(a.Status.CONNECTED,null);else if("error"===e.getAttribute("type"))return a.info("Session creation failed."),this._changeConnectStatus(a.Status.AUTHFAIL,null),!1;return!1},_sasl_failure_cb:function(e){return this._sasl_success_handler&&(this.deleteHandler(this._sasl_success_handler),this._sasl_success_handler=null),this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_mechanism&&this._sasl_mechanism.onFailure(),this._changeConnectStatus(a.Status.AUTHFAIL,null),!1},_auth2_cb:function(e){return"result"===e.getAttribute("type")?(this.authenticated=!0,this._changeConnectStatus(a.Status.CONNECTED,null)):"error"===e.getAttribute("type")&&(this._changeConnectStatus(a.Status.AUTHFAIL,null),this.disconnect("authentication failed")),!1},_addSysTimedHandler:function(e,t){var f=new a.TimedHandler(e,t);return f.user=!1,this.addTimeds.push(f),f},_addSysHandler:function(e,t,f,n,o){var r=new a.Handler(e,t,f,n,o);return r.user=!1,this.addHandlers.push(r),r},_onDisconnectTimeout:function(){return a.info("_onDisconnectTimeout was called"),this._changeConnectStatus(a.Status.CONNTIMEOUT,null),this._proto._onDisconnectTimeout(),this._doDisconnect(),!1},_onIdle:function(){for(var e,t,f;this.addTimeds.length>0;)this.timedHandlers.push(this.addTimeds.pop());for(;this.removeTimeds.length>0;)t=this.removeTimeds.pop(),(e=this.timedHandlers.indexOf(t))>=0&&this.timedHandlers.splice(e,1);var a=(new Date).getTime();for(f=[],e=0;e0&&(f="conflict"),this._conn._changeConnectStatus(e.Status.CONNFAIL,f)):this._conn._changeConnectStatus(e.Status.CONNFAIL,"unknown"),this._conn._doDisconnect(f),e.Status.CONNFAIL;this.sid||(this.sid=t.getAttribute("sid"));var o=t.getAttribute("requests");o&&(this.window=parseInt(o,10));var r=t.getAttribute("hold");r&&(this.hold=parseInt(r,10));var s=t.getAttribute("wait");s&&(this.wait=parseInt(s,10));var c=t.getAttribute("inactivity");c&&(this.inactivity=parseInt(c,10))},_disconnect:function(e){this._sendTerminate(e)},_doDisconnect:function(){this.sid=null,this.rid=Math.floor(4294967295*Math.random()),this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)},_emptyQueue:function(){return 0===this._requests.length},_callProtocolErrorHandlers:function(e){var t,f=this._getRequestStatus(e);(t=this._conn.protocolErrorHandlers.HTTP[f])&&t.call(this,f)},_hitError:function(t){this.errors++,e.warn("request errored, status: "+t+", number of errors: "+this.errors),this.errors>4&&this._conn._onDisconnectTimeout()},_no_auth_received:function(t){t=t?t.bind(this._conn):this._conn._connect_cb.bind(this._conn);var f=this._buildBody();this._requests.push(new e.Request(f.tree(),this._onRequestStateChange.bind(this,t.bind(this._conn)),f.tree().getAttribute("rid"))),this._throttledRequestHandler()},_onDisconnectTimeout:function(){this._abortAllRequests()},_abortAllRequests:function(){for(var e;this._requests.length>0;)(e=this._requests.pop()).abort=!0,e.xhr.abort(),e.xhr.onreadystatechange=function(){}},_onIdle:function(){var t=this._conn._data;if(this._conn.authenticated&&0===this._requests.length&&0===t.length&&!this._conn.disconnecting&&(e.info("no requests during idle cycle, sending blank request"),t.push(null)),!this._conn.paused){if(this._requests.length<2&&t.length>0){for(var f=this._buildBody(),a=0;a0){var n=this._requests[0].age();null!==this._requests[0].dead&&this._requests[0].timeDead()>Math.floor(e.SECONDARY_TIMEOUT*this.wait)&&this._throttledRequestHandler(),n>Math.floor(e.TIMEOUT*this.wait)&&(e.warn("Request "+this._requests[0].id+" timed out, over "+Math.floor(e.TIMEOUT*this.wait)+" seconds since last activity"),this._throttledRequestHandler())}}},_getRequestStatus:function(t,f){var a;if(4===t.xhr.readyState)try{a=t.xhr.status}catch(t){e.error("Caught an error while retrieving a request's status, reqStatus: "+a)}return void 0===a&&(a="number"==typeof f?f:0),a},_onRequestStateChange:function(t,f){if(e.debug("request id "+f.id+"."+f.sends+" state changed to "+f.xhr.readyState),f.abort)f.abort=!1;else if(4===f.xhr.readyState){var a=this._getRequestStatus(f);if(this.disconnecting&&a>=400)return this._hitError(a),void this._callProtocolErrorHandlers(f);var n=a>0&&a<500,o=f.sends>this._conn.maxRetries;if((n||o)&&(this._removeRequest(f),e.debug("request id "+f.id+" should now be removed")),200===a){var r=this._requests[0]===f;(this._requests[1]===f||r&&this._requests.length>0&&this._requests[0].age()>Math.floor(e.SECONDARY_TIMEOUT*this.wait))&&this._restartRequest(0),this._conn.nextValidRid(Number(f.rid)+1),e.debug("request id "+f.id+"."+f.sends+" got 200"),t(f),this.errors=0}else 0===a||a>=400&&a<600||a>=12e3?(e.error("request id "+f.id+"."+f.sends+" error "+a+" happened"),this._hitError(a),this._callProtocolErrorHandlers(f),a>=400&&a<500&&(this._conn._changeConnectStatus(e.Status.DISCONNECTING,null),this._conn._doDisconnect())):e.error("request id "+f.id+"."+f.sends+" error "+a+" happened");n||o?o&&!this._conn.connected&&this._conn._changeConnectStatus(e.Status.CONNFAIL,"giving-up"):this._throttledRequestHandler()}},_processRequest:function(t){var f=this,a=this._requests[t],n=this._getRequestStatus(a,-1);if(a.sends>this._conn.maxRetries)this._conn._onDisconnectTimeout();else{var o=a.age(),r=!isNaN(o)&&o>Math.floor(e.TIMEOUT*this.wait),s=null!==a.dead&&a.timeDead()>Math.floor(e.SECONDARY_TIMEOUT*this.wait),c=4===a.xhr.readyState&&(n<1||n>=500);if((r||s||c)&&(s&&e.error("Request "+this._requests[t].id+" timed out (secondary), restarting"),a.abort=!0,a.xhr.abort(),a.xhr.onreadystatechange=function(){},this._requests[t]=new e.Request(a.xmlData,a.origFunc,a.rid,a.sends),a=this._requests[t]),0===a.xhr.readyState){e.debug("request id "+a.id+"."+a.sends+" posting");try{var i=this._conn.options.contentType||"text/xml; charset=utf-8";a.xhr.open("POST",this._conn.service,!this._conn.options.sync),void 0!==a.xhr.setRequestHeader&&a.xhr.setRequestHeader("Content-Type",i),this._conn.options.withCredentials&&(a.xhr.withCredentials=!0)}catch(t){return e.error("XHR open failed: "+t.toString()),this._conn.connected||this._conn._changeConnectStatus(e.Status.CONNFAIL,"bad-service"),void this._conn.disconnect()}var u=function(){if(a.date=new Date,f._conn.options.customHeaders){var e=f._conn.options.customHeaders;for(var t in e)e.hasOwnProperty(t)&&a.xhr.setRequestHeader(t,e[t])}a.xhr.send(a.data)};if(a.sends>1){var _=1e3*Math.min(Math.floor(e.TIMEOUT*this.wait),Math.pow(a.sends,3));setTimeout(function(){u()},_)}else u();a.sends++,this._conn.xmlOutput!==e.Connection.prototype.xmlOutput&&(a.xmlData.nodeName===this.strip&&a.xmlData.childNodes.length?this._conn.xmlOutput(a.xmlData.childNodes[0]):this._conn.xmlOutput(a.xmlData)),this._conn.rawOutput!==e.Connection.prototype.rawOutput&&this._conn.rawOutput(a.data)}else e.debug("_processRequest: "+(0===t?"first":"second")+" request has readyState of "+a.xhr.readyState)}},_removeRequest:function(t){var f;for(e.debug("removing request"),f=this._requests.length-1;f>=0;f--)t===this._requests[f]&&this._requests.splice(f,1);t.xhr.onreadystatechange=function(){},this._throttledRequestHandler()},_restartRequest:function(e){var t=this._requests[e];null===t.dead&&(t.dead=new Date),this._processRequest(e)},_reqToData:function(e){try{return e.getResponse()}catch(e){if("parsererror"!==e)throw e;this._conn.disconnect("strophe-parsererror")}},_sendTerminate:function(t){e.info("_sendTerminate was called");var f=this._buildBody().attrs({type:"terminate"});t&&f.cnode(t.tree());var a=new e.Request(f.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),f.tree().getAttribute("rid"));this._requests.push(a),this._throttledRequestHandler()},_send:function(){clearTimeout(this._conn._idleTimeout),this._throttledRequestHandler(),this._conn._idleTimeout=setTimeout(function(){this._onIdle()}.bind(this._conn),100)},_sendRestart:function(){this._throttledRequestHandler(),clearTimeout(this._conn._idleTimeout)},_throttledRequestHandler:function(){this._requests?e.debug("_throttledRequestHandler called with "+this._requests.length+" requests"):e.debug("_throttledRequestHandler called with undefined requests"),this._requests&&0!==this._requests.length&&(this._requests.length>0&&this._processRequest(0),this._requests.length>1&&Math.abs(this._requests[0].rid-this._requests[1].rid): "+a);var n=t.getAttribute("version");return"string"!=typeof n?f="Missing version in ":"1.0"!==n&&(f="Wrong version in : "+n),!f||(this._conn._changeConnectStatus(e.Status.CONNFAIL,f),this._conn._doDisconnect(),!1)},_connect_cb_wrapper:function(t){if(0===t.data.indexOf("\s*)*/,"");if(""===f)return;var a=(new DOMParser).parseFromString(f,"text/xml").documentElement;this._conn.xmlInput(a),this._conn.rawInput(t.data),this._handleStreamStart(a)&&this._connect_cb(a)}else if(0===t.data.indexOf(" tag.")}}this._conn._doDisconnect()},_doDisconnect:function(){e.info("WebSockets _doDisconnect was called"),this._closeSocket()},_streamWrap:function(e){return""+e+""},_closeSocket:function(){if(this.socket)try{this.socket.close()}catch(e){}this.socket=null},_emptyQueue:function(){return!0},_onClose:function(t){this._conn.connected&&!this._conn.disconnecting?(e.error("Websocket closed unexpectedly"),this._conn._doDisconnect()):t&&1006===t.code&&!this._conn.connected&&this.socket?(e.error("Websocket closed unexcectedly"),this._conn._changeConnectStatus(e.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._conn._doDisconnect()):e.info("Websocket closed")},_no_auth_received:function(t){e.error("Server did not send any auth methods"),this._conn._changeConnectStatus(e.Status.CONNFAIL,"Server did not send any auth methods"),t&&(t=t.bind(this._conn))(),this._conn._doDisconnect()},_onDisconnectTimeout:function(){},_abortAllRequests:function(){},_onError:function(t){e.error("Websocket error "+t),this._conn._changeConnectStatus(e.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._disconnect()},_onIdle:function(){var t=this._conn._data;if(t.length>0&&!this._conn.paused){for(var f=0;f * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var o,r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",i="__lodash_hash_undefined__",u=500,_="__lodash_placeholder__",d=1,l=2,h=4,m=1,g=2,p=1,b=2,y=4,v=8,w=16,k=32,M=64,L=128,x=256,S=512,T=30,D="...",Y=800,j=16,A=1,C=2,E=1/0,H=9007199254740991,N=1.7976931348623157e308,O=NaN,R=4294967295,I=R-1,P=R>>>1,z=[["ary",L],["bind",p],["bindKey",b],["curry",v],["curryRight",w],["flip",S],["partial",k],["partialRight",M],["rearg",x]],F="[object Arguments]",B="[object Array]",q="[object AsyncFunction]",U="[object Boolean]",W="[object Date]",J="[object DOMException]",$="[object Error]",V="[object Function]",G="[object GeneratorFunction]",Q="[object Map]",X="[object Number]",K="[object Null]",Z="[object Object]",ee="[object Proxy]",te="[object RegExp]",fe="[object Set]",ae="[object String]",ne="[object Symbol]",oe="[object Undefined]",re="[object WeakMap]",se="[object WeakSet]",ce="[object ArrayBuffer]",ie="[object DataView]",ue="[object Float32Array]",_e="[object Float64Array]",de="[object Int8Array]",le="[object Int16Array]",he="[object Int32Array]",me="[object Uint8Array]",ge="[object Uint8ClampedArray]",pe="[object Uint16Array]",be="[object Uint32Array]",ye=/\b__p \+= '';/g,ve=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ke=/&(?:amp|lt|gt|quot|#39);/g,Me=/[&<>"']/g,Le=RegExp(ke.source),xe=RegExp(Me.source),Se=/<%-([\s\S]+?)%>/g,Te=/<%([\s\S]+?)%>/g,De=/<%=([\s\S]+?)%>/g,Ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,je=/^\w*$/,Ae=/^\./,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ee=/[\\^$.*+?()[\]{}|]/g,He=RegExp(Ee.source),Ne=/^\s+|\s+$/g,Oe=/^\s+/,Re=/\s+$/,Ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pe=/\{\n\/\* \[wrapped with (.+)\] \*/,ze=/,? & /,Fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/\\(\\)?/g,qe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ue=/\w*$/,We=/^[-+]0x[0-9a-f]+$/i,Je=/^0b[01]+$/i,$e=/^\[object .+?Constructor\]$/,Ve=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=/($^)/,Ke=/['\n\r\u2028\u2029\\]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tt="[\\ud800-\\udfff]",ft="["+et+"]",at="["+Ze+"]",nt="\\d+",ot="[\\u2700-\\u27bf]",rt="[a-z\\xdf-\\xf6\\xf8-\\xff]",st="[^\\ud800-\\udfff"+et+nt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ct="\\ud83c[\\udffb-\\udfff]",it="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",_t="[\\ud800-\\udbff][\\udc00-\\udfff]",dt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lt="(?:"+rt+"|"+st+")",ht="(?:"+dt+"|"+st+")",mt="(?:"+at+"|"+ct+")"+"?",gt="[\\ufe0e\\ufe0f]?"+mt+("(?:\\u200d(?:"+[it,ut,_t].join("|")+")[\\ufe0e\\ufe0f]?"+mt+")*"),pt="(?:"+[ot,ut,_t].join("|")+")"+gt,bt="(?:"+[it+at+"?",at,ut,_t,tt].join("|")+")",yt=RegExp("['’]","g"),vt=RegExp(at,"g"),wt=RegExp(ct+"(?="+ct+")|"+bt+gt,"g"),kt=RegExp([dt+"?"+rt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ft,dt,"$"].join("|")+")",ht+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ft,dt+lt,"$"].join("|")+")",dt+"?"+lt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",dt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",nt,pt].join("|"),"g"),Mt=RegExp("[\\u200d\\ud800-\\udfff"+Ze+"\\ufe0e\\ufe0f]"),Lt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],St=-1,Tt={};Tt[ue]=Tt[_e]=Tt[de]=Tt[le]=Tt[he]=Tt[me]=Tt[ge]=Tt[pe]=Tt[be]=!0,Tt[F]=Tt[B]=Tt[ce]=Tt[U]=Tt[ie]=Tt[W]=Tt[$]=Tt[V]=Tt[Q]=Tt[X]=Tt[Z]=Tt[te]=Tt[fe]=Tt[ae]=Tt[re]=!1;var Dt={};Dt[F]=Dt[B]=Dt[ce]=Dt[ie]=Dt[U]=Dt[W]=Dt[ue]=Dt[_e]=Dt[de]=Dt[le]=Dt[he]=Dt[Q]=Dt[X]=Dt[Z]=Dt[te]=Dt[fe]=Dt[ae]=Dt[ne]=Dt[me]=Dt[ge]=Dt[pe]=Dt[be]=!0,Dt[$]=Dt[V]=Dt[re]=!1;var Yt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jt=parseFloat,At=parseInt,Ct="object"==typeof e&&e&&e.Object===Object&&e,Et="object"==typeof self&&self&&self.Object===Object&&self,Ht=Ct||Et||Function("return this")(),Nt="object"==typeof t&&t&&!t.nodeType&&t,Ot=Nt&&"object"==typeof a&&a&&!a.nodeType&&a,Rt=Ot&&Ot.exports===Nt,It=Rt&&Ct.process,Pt=function(){try{return It&&It.binding&&It.binding("util")}catch(e){}}(),zt=Pt&&Pt.isArrayBuffer,Ft=Pt&&Pt.isDate,Bt=Pt&&Pt.isMap,qt=Pt&&Pt.isRegExp,Ut=Pt&&Pt.isSet,Wt=Pt&&Pt.isTypedArray;function Jt(e,t){return e.set(t[0],t[1]),e}function $t(e,t){return e.add(t),e}function Vt(e,t,f){switch(f.length){case 0:return e.call(t);case 1:return e.call(t,f[0]);case 2:return e.call(t,f[0],f[1]);case 3:return e.call(t,f[0],f[1],f[2])}return e.apply(t,f)}function Gt(e,t,f,a){for(var n=-1,o=null==e?0:e.length;++n-1}function tf(e,t,f){for(var a=-1,n=null==e?0:e.length;++a-1;);return f}function Lf(e,t){for(var f=e.length;f--&&_f(t,e[f],0)>-1;);return f}var xf=gf({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Sf=gf({"&":"&","<":"<",">":">",'"':""","'":"'"});function Tf(e){return"\\"+Yt[e]}function Df(e){return Mt.test(e)}function Yf(e){var t=-1,f=Array(e.size);return e.forEach(function(e,a){f[++t]=[a,e]}),f}function jf(e,t){return function(f){return e(t(f))}}function Af(e,t){for(var f=-1,a=e.length,n=0,o=[];++f",""":'"',"'":"'"});var Rf=function e(t){var f,a=(t=null==t?Ht:Rf.defaults(Ht.Object(),t,Rf.pick(Ht,xt))).Array,n=t.Date,Ze=t.Error,et=t.Function,tt=t.Math,ft=t.Object,at=t.RegExp,nt=t.String,ot=t.TypeError,rt=a.prototype,st=et.prototype,ct=ft.prototype,it=t["__core-js_shared__"],ut=st.toString,_t=ct.hasOwnProperty,dt=0,lt=(f=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",ht=ct.toString,mt=ut.call(ft),gt=Ht._,pt=at("^"+ut.call(_t).replace(Ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=Rt?t.Buffer:o,wt=t.Symbol,Mt=t.Uint8Array,Yt=bt?bt.allocUnsafe:o,Ct=jf(ft.getPrototypeOf,ft),Et=ft.create,Nt=ct.propertyIsEnumerable,Ot=rt.splice,It=wt?wt.isConcatSpreadable:o,Pt=wt?wt.iterator:o,sf=wt?wt.toStringTag:o,gf=function(){try{var e=qo(ft,"defineProperty");return e({},"",{}),e}catch(e){}}(),If=t.clearTimeout!==Ht.clearTimeout&&t.clearTimeout,Pf=n&&n.now!==Ht.Date.now&&n.now,zf=t.setTimeout!==Ht.setTimeout&&t.setTimeout,Ff=tt.ceil,Bf=tt.floor,qf=ft.getOwnPropertySymbols,Uf=bt?bt.isBuffer:o,Wf=t.isFinite,Jf=rt.join,$f=jf(ft.keys,ft),Vf=tt.max,Gf=tt.min,Qf=n.now,Xf=t.parseInt,Kf=tt.random,Zf=rt.reverse,ea=qo(t,"DataView"),ta=qo(t,"Map"),fa=qo(t,"Promise"),aa=qo(t,"Set"),na=qo(t,"WeakMap"),oa=qo(ft,"create"),ra=na&&new na,sa={},ca=hr(ea),ia=hr(ta),ua=hr(fa),_a=hr(aa),da=hr(na),la=wt?wt.prototype:o,ha=la?la.valueOf:o,ma=la?la.toString:o;function ga(e){if(As(e)&&!vs(e)&&!(e instanceof va)){if(e instanceof ya)return e;if(_t.call(e,"__wrapped__"))return mr(e)}return new ya(e)}var pa=function(){function e(){}return function(t){if(!js(t))return{};if(Et)return Et(t);e.prototype=t;var f=new e;return e.prototype=o,f}}();function ba(){}function ya(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function va(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function wa(e){var t=-1,f=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Ia(e,t,f,a,n,r){var s,c=t&d,i=t&l,u=t&h;if(f&&(s=n?f(e,a,n,r):f(e)),s!==o)return s;if(!js(e))return e;var _=vs(e);if(_){if(s=function(e){var t=e.length,f=e.constructor(t);return t&&"string"==typeof e[0]&&_t.call(e,"index")&&(f.index=e.index,f.input=e.input),f}(e),!c)return ro(e,s)}else{var m=Jo(e),g=m==V||m==G;if(Ls(e))return eo(e,c);if(m==Z||m==F||g&&!n){if(s=i||g?{}:Vo(e),!c)return i?function(e,t){return so(e,Wo(e),t)}(e,function(e,t){return e&&so(t,cc(t),e)}(s,e)):function(e,t){return so(e,Uo(e),t)}(e,Ha(s,e))}else{if(!Dt[m])return n?e:{};s=function(e,t,f,a){var n,o,r,s=e.constructor;switch(t){case ce:return to(e);case U:case W:return new s(+e);case ie:return function(e,t){var f=t?to(e.buffer):e.buffer;return new e.constructor(f,e.byteOffset,e.byteLength)}(e,a);case ue:case _e:case de:case le:case he:case me:case ge:case pe:case be:return fo(e,a);case Q:return function(e,t,f){return nf(t?f(Yf(e),d):Yf(e),Jt,new e.constructor)}(e,a,f);case X:case ae:return new s(e);case te:return(r=new(o=e).constructor(o.source,Ue.exec(o))).lastIndex=o.lastIndex,r;case fe:return function(e,t,f){return nf(t?f(Cf(e),d):Cf(e),$t,new e.constructor)}(e,a,f);case ne:return n=e,ha?ft(ha.call(n)):{}}}(e,m,Ia,c)}}r||(r=new xa);var p=r.get(e);if(p)return p;r.set(e,s);var b=_?o:(u?i?Oo:No:i?cc:sc)(e);return Qt(b||e,function(a,n){b&&(a=e[n=a]),Aa(s,n,Ia(a,t,f,n,e,r))}),s}function Pa(e,t,f){var a=f.length;if(null==e)return!a;for(e=ft(e);a--;){var n=f[a],r=t[n],s=e[n];if(s===o&&!(n in e)||!r(s))return!1}return!0}function za(e,t,f){if("function"!=typeof e)throw new ot(c);return sr(function(){e.apply(o,f)},t)}function Fa(e,t,f,a){var n=-1,o=ef,s=!0,c=e.length,i=[],u=t.length;if(!c)return i;f&&(t=ff(t,vf(f))),a?(o=tf,s=!1):t.length>=r&&(o=kf,s=!1,t=new La(t));e:for(;++n-1},ka.prototype.set=function(e,t){var f=this.__data__,a=Ca(f,e);return a<0?(++this.size,f.push([e,t])):f[a][1]=t,this},Ma.prototype.clear=function(){this.size=0,this.__data__={hash:new wa,map:new(ta||ka),string:new wa}},Ma.prototype.delete=function(e){var t=Fo(this,e).delete(e);return this.size-=t?1:0,t},Ma.prototype.get=function(e){return Fo(this,e).get(e)},Ma.prototype.has=function(e){return Fo(this,e).has(e)},Ma.prototype.set=function(e,t){var f=Fo(this,e),a=f.size;return f.set(e,t),this.size+=f.size==a?0:1,this},La.prototype.add=La.prototype.push=function(e){return this.__data__.set(e,i),this},La.prototype.has=function(e){return this.__data__.has(e)},xa.prototype.clear=function(){this.__data__=new ka,this.size=0},xa.prototype.delete=function(e){var t=this.__data__,f=t.delete(e);return this.size=t.size,f},xa.prototype.get=function(e){return this.__data__.get(e)},xa.prototype.has=function(e){return this.__data__.has(e)},xa.prototype.set=function(e,t){var f=this.__data__;if(f instanceof ka){var a=f.__data__;if(!ta||a.length0&&f(s)?t>1?$a(s,t-1,f,a,n):af(n,s):a||(n[n.length]=s)}return n}var Va=_o(),Ga=_o(!0);function Qa(e,t){return e&&Va(e,t,sc)}function Xa(e,t){return e&&Ga(e,t,sc)}function Ka(e,t){return Zt(t,function(t){return Ts(e[t])})}function Za(e,t){for(var f=0,a=(t=Qn(t,e)).length;null!=e&&ft}function an(e,t){return null!=e&&_t.call(e,t)}function nn(e,t){return null!=e&&t in ft(e)}function on(e,t,f){for(var n=f?tf:ef,r=e[0].length,s=e.length,c=s,i=a(s),u=1/0,_=[];c--;){var d=e[c];c&&t&&(d=ff(d,vf(t))),u=Gf(d.length,u),i[c]=!f&&(t||r>=120&&d.length>=120)?new La(c&&d):o}d=e[0];var l=-1,h=i[0];e:for(;++l=s)return c;var i=f[a];return c*("desc"==i?-1:1)}}return e.index-t.index}(e,t,f)})}function kn(e,t,f){for(var a=-1,n=t.length,o={};++a-1;)s!==e&&Ot.call(s,c,1),Ot.call(e,c,1);return e}function Ln(e,t){for(var f=e?t.length:0,a=f-1;f--;){var n=t[f];if(f==a||n!==o){var o=n;Qo(n)?Ot.call(e,n,1):Bn(e,n)}}return e}function xn(e,t){return e+Bf(Kf()*(t-e+1))}function Sn(e,t){var f="";if(!e||t<1||t>H)return f;do{t%2&&(f+=e),(t=Bf(t/2))&&(e+=e)}while(t);return f}function Tn(e,t){return cr(nr(e,t,Ec),e+"")}function Dn(e){return Ta(gc(e))}function Yn(e,t){var f=gc(e);return _r(f,Ra(t,0,f.length))}function jn(e,t,f,a){if(!js(e))return e;for(var n=-1,r=(t=Qn(t,e)).length,s=r-1,c=e;null!=c&&++no?0:o+t),(f=f>o?o:f)<0&&(f+=o),o=t>f?0:f-t>>>0,t>>>=0;for(var r=a(o);++n>>1,r=e[o];null!==r&&!Is(r)&&(f?r<=t:r=r){var u=t?null:To(e);if(u)return Cf(u);s=!1,n=kf,i=new La}else i=t?[]:c;e:for(;++a=a?e:Hn(e,t,f)}var Zn=If||function(e){return Ht.clearTimeout(e)};function eo(e,t){if(t)return e.slice();var f=e.length,a=Yt?Yt(f):new e.constructor(f);return e.copy(a),a}function to(e){var t=new e.constructor(e.byteLength);return new Mt(t).set(new Mt(e)),t}function fo(e,t){var f=t?to(e.buffer):e.buffer;return new e.constructor(f,e.byteOffset,e.length)}function ao(e,t){if(e!==t){var f=e!==o,a=null===e,n=e==e,r=Is(e),s=t!==o,c=null===t,i=t==t,u=Is(t);if(!c&&!u&&!r&&e>t||r&&s&&i&&!c&&!u||a&&s&&i||!f&&i||!n)return 1;if(!a&&!r&&!u&&e1?f[n-1]:o,s=n>2?f[2]:o;for(r=e.length>3&&"function"==typeof r?(n--,r):o,s&&Xo(f[0],f[1],s)&&(r=n<3?o:r,n=1),t=ft(t);++a-1?n[r?t[s]:s]:o}}function po(e){return Ho(function(t){var f=t.length,a=f,n=ya.prototype.thru;for(e&&t.reverse();a--;){var r=t[a];if("function"!=typeof r)throw new ot(c);if(n&&!s&&"wrapper"==Io(r))var s=new ya([],!0)}for(a=s?a:f;++a1&&v.reverse(),d&&uc))return!1;var u=r.get(e);if(u&&r.get(t))return u==t;var _=-1,d=!0,l=f&g?new La:o;for(r.set(e,t),r.set(t,e);++_-1&&e%1==0&&e1?"& ":"")+t[a],t=t.join(f>2?", ":" "),e.replace(Ie,"{\n/* [wrapped with "+t+"] */\n")}(a,function(e,t){return Qt(z,function(f){var a="_."+f[0];t&f[1]&&!ef(e,a)&&e.push(a)}),e.sort()}(function(e){var t=e.match(Pe);return t?t[1].split(ze):[]}(a),f)))}function ur(e){var t=0,f=0;return function(){var a=Qf(),n=j-(a-f);if(f=a,n>0){if(++t>=Y)return arguments[0]}else t=0;return e.apply(o,arguments)}}function _r(e,t){var f=-1,a=e.length,n=a-1;for(t=t===o?a:t;++f1?e[t-1]:o;return Nr(e,f="function"==typeof f?(e.pop(),f):o)});function Br(e){var t=ga(e);return t.__chain__=!0,t}function qr(e,t){return t(e)}var Ur=Ho(function(e){var t=e.length,f=t?e[0]:0,a=this.__wrapped__,n=function(t){return Oa(t,e)};return!(t>1||this.__actions__.length)&&a instanceof va&&Qo(f)?((a=a.slice(f,+f+(t?1:0))).__actions__.push({func:qr,args:[n],thisArg:o}),new ya(a,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(n)});var Wr=co(function(e,t,f){_t.call(e,f)?++e[f]:Na(e,f,1)});var Jr=go(yr),$r=go(vr);function Vr(e,t){return(vs(e)?Qt:Ba)(e,zo(t,3))}function Gr(e,t){return(vs(e)?Xt:qa)(e,zo(t,3))}var Qr=co(function(e,t,f){_t.call(e,f)?e[f].push(t):Na(e,f,[t])});var Xr=Tn(function(e,t,f){var n=-1,o="function"==typeof t,r=ks(e)?a(e.length):[];return Ba(e,function(e){r[++n]=o?Vt(t,e,f):rn(e,t,f)}),r}),Kr=co(function(e,t,f){Na(e,f,t)});function Zr(e,t){return(vs(e)?ff:gn)(e,zo(t,3))}var es=co(function(e,t,f){e[f?0:1].push(t)},function(){return[[],[]]});var ts=Tn(function(e,t){if(null==e)return[];var f=t.length;return f>1&&Xo(e,t[0],t[1])?t=[]:f>2&&Xo(t[0],t[1],t[2])&&(t=[t[0]]),wn(e,$a(t,1),[])}),fs=Pf||function(){return Ht.Date.now()};function as(e,t,f){return t=f?o:t,t=e&&null==t?e.length:t,Yo(e,L,o,o,o,o,t)}function ns(e,t){var f;if("function"!=typeof t)throw new ot(c);return e=Us(e),function(){return--e>0&&(f=t.apply(this,arguments)),e<=1&&(t=o),f}}var os=Tn(function(e,t,f){var a=p;if(f.length){var n=Af(f,Po(os));a|=k}return Yo(e,a,t,f,n)}),rs=Tn(function(e,t,f){var a=p|b;if(f.length){var n=Af(f,Po(rs));a|=k}return Yo(t,a,e,f,n)});function ss(e,t,f){var a,n,r,s,i,u,_=0,d=!1,l=!1,h=!0;if("function"!=typeof e)throw new ot(c);function m(t){var f=a,r=n;return a=n=o,_=t,s=e.apply(r,f)}function g(e){var f=e-u;return u===o||f>=t||f<0||l&&e-_>=r}function p(){var e=fs();if(g(e))return b(e);i=sr(p,function(e){var f=t-(e-u);return l?Gf(f,r-(e-_)):f}(e))}function b(e){return i=o,h&&a?m(e):(a=n=o,s)}function y(){var e=fs(),f=g(e);if(a=arguments,n=this,u=e,f){if(i===o)return function(e){return _=e,i=sr(p,t),d?m(e):s}(u);if(l)return i=sr(p,t),m(u)}return i===o&&(i=sr(p,t)),s}return t=Js(t)||0,js(f)&&(d=!!f.leading,r=(l="maxWait"in f)?Vf(Js(f.maxWait)||0,t):r,h="trailing"in f?!!f.trailing:h),y.cancel=function(){i!==o&&Zn(i),_=0,a=u=n=i=o},y.flush=function(){return i===o?s:b(fs())},y}var cs=Tn(function(e,t){return za(e,1,t)}),is=Tn(function(e,t,f){return za(e,Js(t)||0,f)});function us(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ot(c);var f=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=f.cache;if(o.has(n))return o.get(n);var r=e.apply(this,a);return f.cache=o.set(n,r)||o,r};return f.cache=new(us.Cache||Ma),f}function _s(e){if("function"!=typeof e)throw new ot(c);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}us.Cache=Ma;var ds=Xn(function(e,t){var f=(t=1==t.length&&vs(t[0])?ff(t[0],vf(zo())):ff($a(t,1),vf(zo()))).length;return Tn(function(a){for(var n=-1,o=Gf(a.length,f);++n=t}),ys=sn(function(){return arguments}())?sn:function(e){return As(e)&&_t.call(e,"callee")&&!Nt.call(e,"callee")},vs=a.isArray,ws=zt?vf(zt):function(e){return As(e)&&tn(e)==ce};function ks(e){return null!=e&&Ys(e.length)&&!Ts(e)}function Ms(e){return As(e)&&ks(e)}var Ls=Uf||Jc,xs=Ft?vf(Ft):function(e){return As(e)&&tn(e)==W};function Ss(e){if(!As(e))return!1;var t=tn(e);return t==$||t==J||"string"==typeof e.message&&"string"==typeof e.name&&!Hs(e)}function Ts(e){if(!js(e))return!1;var t=tn(e);return t==V||t==G||t==q||t==ee}function Ds(e){return"number"==typeof e&&e==Us(e)}function Ys(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=H}function js(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function As(e){return null!=e&&"object"==typeof e}var Cs=Bt?vf(Bt):function(e){return As(e)&&Jo(e)==Q};function Es(e){return"number"==typeof e||As(e)&&tn(e)==X}function Hs(e){if(!As(e)||tn(e)!=Z)return!1;var t=Ct(e);if(null===t)return!0;var f=_t.call(t,"constructor")&&t.constructor;return"function"==typeof f&&f instanceof f&&ut.call(f)==mt}var Ns=qt?vf(qt):function(e){return As(e)&&tn(e)==te};var Os=Ut?vf(Ut):function(e){return As(e)&&Jo(e)==fe};function Rs(e){return"string"==typeof e||!vs(e)&&As(e)&&tn(e)==ae}function Is(e){return"symbol"==typeof e||As(e)&&tn(e)==ne}var Ps=Wt?vf(Wt):function(e){return As(e)&&Ys(e.length)&&!!Tt[tn(e)]};var zs=Lo(mn),Fs=Lo(function(e,t){return e<=t});function Bs(e){if(!e)return[];if(ks(e))return Rs(e)?Nf(e):ro(e);if(Pt&&e[Pt])return function(e){for(var t,f=[];!(t=e.next()).done;)f.push(t.value);return f}(e[Pt]());var t=Jo(e);return(t==Q?Yf:t==fe?Cf:gc)(e)}function qs(e){return e?(e=Js(e))===E||e===-E?(e<0?-1:1)*N:e==e?e:0:0===e?e:0}function Us(e){var t=qs(e),f=t%1;return t==t?f?t-f:t:0}function Ws(e){return e?Ra(Us(e),0,R):0}function Js(e){if("number"==typeof e)return e;if(Is(e))return O;if(js(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=js(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ne,"");var f=Je.test(e);return f||Ve.test(e)?At(e.slice(2),f?2:8):We.test(e)?O:+e}function $s(e){return so(e,cc(e))}function Vs(e){return null==e?"":zn(e)}var Gs=io(function(e,t){if(tr(t)||ks(t))so(t,sc(t),e);else for(var f in t)_t.call(t,f)&&Aa(e,f,t[f])}),Qs=io(function(e,t){so(t,cc(t),e)}),Xs=io(function(e,t,f,a){so(t,cc(t),e,a)}),Ks=io(function(e,t,f,a){so(t,sc(t),e,a)}),Zs=Ho(Oa);var ec=Tn(function(e){return e.push(o,jo),Vt(Xs,o,e)}),tc=Tn(function(e){return e.push(o,Ao),Vt(uc,o,e)});function fc(e,t,f){var a=null==e?o:Za(e,t);return a===o?f:a}function ac(e,t){return null!=e&&$o(e,t,nn)}var nc=yo(function(e,t,f){e[t]=f},jc(Ec)),oc=yo(function(e,t,f){_t.call(e,t)?e[t].push(f):e[t]=[f]},zo),rc=Tn(rn);function sc(e){return ks(e)?Sa(e):ln(e)}function cc(e){return ks(e)?Sa(e,!0):hn(e)}var ic=io(function(e,t,f){yn(e,t,f)}),uc=io(function(e,t,f,a){yn(e,t,f,a)}),_c=Ho(function(e,t){var f={};if(null==e)return f;var a=!1;t=ff(t,function(t){return t=Qn(t,e),a||(a=t.length>1),t}),so(e,Oo(e),f),a&&(f=Ia(f,d|l|h,Co));for(var n=t.length;n--;)Bn(f,t[n]);return f});var dc=Ho(function(e,t){return null==e?{}:function(e,t){return kn(e,t,function(t,f){return ac(e,f)})}(e,t)});function lc(e,t){if(null==e)return{};var f=ff(Oo(e),function(e){return[e]});return t=zo(t),kn(e,f,function(e,f){return t(e,f[0])})}var hc=Do(sc),mc=Do(cc);function gc(e){return null==e?[]:wf(e,sc(e))}var pc=ho(function(e,t,f){return t=t.toLowerCase(),e+(f?bc(t):t)});function bc(e){return Sc(Vs(e).toLowerCase())}function yc(e){return(e=Vs(e))&&e.replace(Qe,xf).replace(vt,"")}var vc=ho(function(e,t,f){return e+(f?"-":"")+t.toLowerCase()}),wc=ho(function(e,t,f){return e+(f?" ":"")+t.toLowerCase()}),kc=lo("toLowerCase");var Mc=ho(function(e,t,f){return e+(f?"_":"")+t.toLowerCase()});var Lc=ho(function(e,t,f){return e+(f?" ":"")+Sc(t)});var xc=ho(function(e,t,f){return e+(f?" ":"")+t.toUpperCase()}),Sc=lo("toUpperCase");function Tc(e,t,f){return e=Vs(e),(t=f?o:t)===o?function(e){return Lt.test(e)}(e)?function(e){return e.match(kt)||[]}(e):function(e){return e.match(Fe)||[]}(e):e.match(t)||[]}var Dc=Tn(function(e,t){try{return Vt(e,o,t)}catch(e){return Ss(e)?e:new Ze(e)}}),Yc=Ho(function(e,t){return Qt(t,function(t){t=lr(t),Na(e,t,os(e[t],e))}),e});function jc(e){return function(){return e}}var Ac=po(),Cc=po(!0);function Ec(e){return e}function Hc(e){return dn("function"==typeof e?e:Ia(e,d))}var Nc=Tn(function(e,t){return function(f){return rn(f,e,t)}}),Oc=Tn(function(e,t){return function(f){return rn(e,f,t)}});function Rc(e,t,f){var a=sc(t),n=Ka(t,a);null!=f||js(t)&&(n.length||!a.length)||(f=t,t=e,e=this,n=Ka(t,sc(t)));var o=!(js(f)&&"chain"in f&&!f.chain),r=Ts(e);return Qt(n,function(f){var a=t[f];e[f]=a,r&&(e.prototype[f]=function(){var t=this.__chain__;if(o||t){var f=e(this.__wrapped__);return(f.__actions__=ro(this.__actions__)).push({func:a,args:arguments,thisArg:e}),f.__chain__=t,f}return a.apply(e,af([this.value()],arguments))})}),e}function Ic(){}var Pc=wo(ff),zc=wo(Kt),Fc=wo(rf);function Bc(e){return Ko(e)?mf(lr(e)):function(e){return function(t){return Za(t,e)}}(e)}var qc=Mo(),Uc=Mo(!0);function Wc(){return[]}function Jc(){return!1}var $c=vo(function(e,t){return e+t},0),Vc=So("ceil"),Gc=vo(function(e,t){return e/t},1),Qc=So("floor");var Xc,Kc=vo(function(e,t){return e*t},1),Zc=So("round"),ei=vo(function(e,t){return e-t},0);return ga.after=function(e,t){if("function"!=typeof t)throw new ot(c);return e=Us(e),function(){if(--e<1)return t.apply(this,arguments)}},ga.ary=as,ga.assign=Gs,ga.assignIn=Qs,ga.assignInWith=Xs,ga.assignWith=Ks,ga.at=Zs,ga.before=ns,ga.bind=os,ga.bindAll=Yc,ga.bindKey=rs,ga.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return vs(e)?e:[e]},ga.chain=Br,ga.chunk=function(e,t,f){t=(f?Xo(e,t,f):t===o)?1:Vf(Us(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var r=0,s=0,c=a(Ff(n/t));rn?0:n+f),(a=a===o||a>n?n:Us(a))<0&&(a+=n),a=f>a?0:Ws(a);f>>0)?(e=Vs(e))&&("string"==typeof t||null!=t&&!Ns(t))&&!(t=zn(t))&&Df(e)?Kn(Nf(e),0,f):e.split(t,f):[]},ga.spread=function(e,t){if("function"!=typeof e)throw new ot(c);return t=null==t?0:Vf(Us(t),0),Tn(function(f){var a=f[t],n=Kn(f,0,t);return a&&af(n,a),Vt(e,this,n)})},ga.tail=function(e){var t=null==e?0:e.length;return t?Hn(e,1,t):[]},ga.take=function(e,t,f){return e&&e.length?Hn(e,0,(t=f||t===o?1:Us(t))<0?0:t):[]},ga.takeRight=function(e,t,f){var a=null==e?0:e.length;return a?Hn(e,(t=a-(t=f||t===o?1:Us(t)))<0?0:t,a):[]},ga.takeRightWhile=function(e,t){return e&&e.length?Un(e,zo(t,3),!1,!0):[]},ga.takeWhile=function(e,t){return e&&e.length?Un(e,zo(t,3)):[]},ga.tap=function(e,t){return t(e),e},ga.throttle=function(e,t,f){var a=!0,n=!0;if("function"!=typeof e)throw new ot(c);return js(f)&&(a="leading"in f?!!f.leading:a,n="trailing"in f?!!f.trailing:n),ss(e,t,{leading:a,maxWait:t,trailing:n})},ga.thru=qr,ga.toArray=Bs,ga.toPairs=hc,ga.toPairsIn=mc,ga.toPath=function(e){return vs(e)?ff(e,lr):Is(e)?[e]:ro(dr(Vs(e)))},ga.toPlainObject=$s,ga.transform=function(e,t,f){var a=vs(e),n=a||Ls(e)||Ps(e);if(t=zo(t,4),null==f){var o=e&&e.constructor;f=n?a?new o:[]:js(e)&&Ts(o)?pa(Ct(e)):{}}return(n?Qt:Qa)(e,function(e,a,n){return t(f,e,a,n)}),f},ga.unary=function(e){return as(e,1)},ga.union=Ar,ga.unionBy=Cr,ga.unionWith=Er,ga.uniq=function(e){return e&&e.length?Fn(e):[]},ga.uniqBy=function(e,t){return e&&e.length?Fn(e,zo(t,2)):[]},ga.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?Fn(e,o,t):[]},ga.unset=function(e,t){return null==e||Bn(e,t)},ga.unzip=Hr,ga.unzipWith=Nr,ga.update=function(e,t,f){return null==e?e:qn(e,t,Gn(f))},ga.updateWith=function(e,t,f,a){return a="function"==typeof a?a:o,null==e?e:qn(e,t,Gn(f),a)},ga.values=gc,ga.valuesIn=function(e){return null==e?[]:wf(e,cc(e))},ga.without=Or,ga.words=Tc,ga.wrap=function(e,t){return ls(Gn(t),e)},ga.xor=Rr,ga.xorBy=Ir,ga.xorWith=Pr,ga.zip=zr,ga.zipObject=function(e,t){return $n(e||[],t||[],Aa)},ga.zipObjectDeep=function(e,t){return $n(e||[],t||[],jn)},ga.zipWith=Fr,ga.entries=hc,ga.entriesIn=mc,ga.extend=Qs,ga.extendWith=Xs,Rc(ga,ga),ga.add=$c,ga.attempt=Dc,ga.camelCase=pc,ga.capitalize=bc,ga.ceil=Vc,ga.clamp=function(e,t,f){return f===o&&(f=t,t=o),f!==o&&(f=(f=Js(f))==f?f:0),t!==o&&(t=(t=Js(t))==t?t:0),Ra(Js(e),t,f)},ga.clone=function(e){return Ia(e,h)},ga.cloneDeep=function(e){return Ia(e,d|h)},ga.cloneDeepWith=function(e,t){return Ia(e,d|h,t="function"==typeof t?t:o)},ga.cloneWith=function(e,t){return Ia(e,h,t="function"==typeof t?t:o)},ga.conformsTo=function(e,t){return null==t||Pa(e,t,sc(t))},ga.deburr=yc,ga.defaultTo=function(e,t){return null==e||e!=e?t:e},ga.divide=Gc,ga.endsWith=function(e,t,f){e=Vs(e),t=zn(t);var a=e.length,n=f=f===o?a:Ra(Us(f),0,a);return(f-=t.length)>=0&&e.slice(f,n)==t},ga.eq=gs,ga.escape=function(e){return(e=Vs(e))&&xe.test(e)?e.replace(Me,Sf):e},ga.escapeRegExp=function(e){return(e=Vs(e))&&He.test(e)?e.replace(Ee,"\\$&"):e},ga.every=function(e,t,f){var a=vs(e)?Kt:Ua;return f&&Xo(e,t,f)&&(t=o),a(e,zo(t,3))},ga.find=Jr,ga.findIndex=yr,ga.findKey=function(e,t){return cf(e,zo(t,3),Qa)},ga.findLast=$r,ga.findLastIndex=vr,ga.findLastKey=function(e,t){return cf(e,zo(t,3),Xa)},ga.floor=Qc,ga.forEach=Vr,ga.forEachRight=Gr,ga.forIn=function(e,t){return null==e?e:Va(e,zo(t,3),cc)},ga.forInRight=function(e,t){return null==e?e:Ga(e,zo(t,3),cc)},ga.forOwn=function(e,t){return e&&Qa(e,zo(t,3))},ga.forOwnRight=function(e,t){return e&&Xa(e,zo(t,3))},ga.get=fc,ga.gt=ps,ga.gte=bs,ga.has=function(e,t){return null!=e&&$o(e,t,an)},ga.hasIn=ac,ga.head=kr,ga.identity=Ec,ga.includes=function(e,t,f,a){e=ks(e)?e:gc(e),f=f&&!a?Us(f):0;var n=e.length;return f<0&&(f=Vf(n+f,0)),Rs(e)?f<=n&&e.indexOf(t,f)>-1:!!n&&_f(e,t,f)>-1},ga.indexOf=function(e,t,f){var a=null==e?0:e.length;if(!a)return-1;var n=null==f?0:Us(f);return n<0&&(n=Vf(a+n,0)),_f(e,t,n)},ga.inRange=function(e,t,f){return t=qs(t),f===o?(f=t,t=0):f=qs(f),function(e,t,f){return e>=Gf(t,f)&&e=-H&&e<=H},ga.isSet=Os,ga.isString=Rs,ga.isSymbol=Is,ga.isTypedArray=Ps,ga.isUndefined=function(e){return e===o},ga.isWeakMap=function(e){return As(e)&&Jo(e)==re},ga.isWeakSet=function(e){return As(e)&&tn(e)==se},ga.join=function(e,t){return null==e?"":Jf.call(e,t)},ga.kebabCase=vc,ga.last=Sr,ga.lastIndexOf=function(e,t,f){var a=null==e?0:e.length;if(!a)return-1;var n=a;return f!==o&&(n=(n=Us(f))<0?Vf(a+n,0):Gf(n,a-1)),t==t?function(e,t,f){for(var a=f+1;a--;)if(e[a]===t)return a;return a}(e,t,n):uf(e,lf,n,!0)},ga.lowerCase=wc,ga.lowerFirst=kc,ga.lt=zs,ga.lte=Fs,ga.max=function(e){return e&&e.length?Wa(e,Ec,fn):o},ga.maxBy=function(e,t){return e&&e.length?Wa(e,zo(t,2),fn):o},ga.mean=function(e){return hf(e,Ec)},ga.meanBy=function(e,t){return hf(e,zo(t,2))},ga.min=function(e){return e&&e.length?Wa(e,Ec,mn):o},ga.minBy=function(e,t){return e&&e.length?Wa(e,zo(t,2),mn):o},ga.stubArray=Wc,ga.stubFalse=Jc,ga.stubObject=function(){return{}},ga.stubString=function(){return""},ga.stubTrue=function(){return!0},ga.multiply=Kc,ga.nth=function(e,t){return e&&e.length?vn(e,Us(t)):o},ga.noConflict=function(){return Ht._===this&&(Ht._=gt),this},ga.noop=Ic,ga.now=fs,ga.pad=function(e,t,f){e=Vs(e);var a=(t=Us(t))?Hf(e):0;if(!t||a>=t)return e;var n=(t-a)/2;return ko(Bf(n),f)+e+ko(Ff(n),f)},ga.padEnd=function(e,t,f){e=Vs(e);var a=(t=Us(t))?Hf(e):0;return t&&at){var a=e;e=t,t=a}if(f||e%1||t%1){var n=Kf();return Gf(e+n*(t-e+jt("1e-"+((n+"").length-1))),t)}return xn(e,t)},ga.reduce=function(e,t,f){var a=vs(e)?nf:pf,n=arguments.length<3;return a(e,zo(t,4),f,n,Ba)},ga.reduceRight=function(e,t,f){var a=vs(e)?of:pf,n=arguments.length<3;return a(e,zo(t,4),f,n,qa)},ga.repeat=function(e,t,f){return t=(f?Xo(e,t,f):t===o)?1:Us(t),Sn(Vs(e),t)},ga.replace=function(){var e=arguments,t=Vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},ga.result=function(e,t,f){var a=-1,n=(t=Qn(t,e)).length;for(n||(n=1,e=o);++aH)return[];var f=R,a=Gf(e,R);t=zo(t),e-=R;for(var n=yf(a,t);++f=r)return e;var c=f-Hf(a);if(c<1)return a;var i=s?Kn(s,0,c).join(""):e.slice(0,c);if(n===o)return i+a;if(s&&(c+=i.length-c),Ns(n)){if(e.slice(c).search(n)){var u,_=i;for(n.global||(n=at(n.source,Vs(Ue.exec(n))+"g")),n.lastIndex=0;u=n.exec(_);)var d=u.index;i=i.slice(0,d===o?c:d)}}else if(e.indexOf(zn(n),c)!=c){var l=i.lastIndexOf(n);l>-1&&(i=i.slice(0,l))}return i+a},ga.unescape=function(e){return(e=Vs(e))&&Le.test(e)?e.replace(ke,Of):e},ga.uniqueId=function(e){var t=++dt;return Vs(e)+t},ga.upperCase=xc,ga.upperFirst=Sc,ga.each=Vr,ga.eachRight=Gr,ga.first=kr,Rc(ga,(Xc={},Qa(ga,function(e,t){_t.call(ga.prototype,t)||(Xc[t]=e)}),Xc),{chain:!1}),ga.VERSION="4.17.4",Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){ga[e].placeholder=ga}),Qt(["drop","take"],function(e,t){va.prototype[e]=function(f){f=f===o?1:Vf(Us(f),0);var a=this.__filtered__&&!t?new va(this):this.clone();return a.__filtered__?a.__takeCount__=Gf(f,a.__takeCount__):a.__views__.push({size:Gf(f,R),type:e+(a.__dir__<0?"Right":"")}),a},va.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Qt(["filter","map","takeWhile"],function(e,t){var f=t+1,a=f==A||3==f;va.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:zo(e,3),type:f}),t.__filtered__=t.__filtered__||a,t}}),Qt(["head","last"],function(e,t){var f="take"+(t?"Right":"");va.prototype[e]=function(){return this[f](1).value()[0]}}),Qt(["initial","tail"],function(e,t){var f="drop"+(t?"":"Right");va.prototype[e]=function(){return this.__filtered__?new va(this):this[f](1)}}),va.prototype.compact=function(){return this.filter(Ec)},va.prototype.find=function(e){return this.filter(e).head()},va.prototype.findLast=function(e){return this.reverse().find(e)},va.prototype.invokeMap=Tn(function(e,t){return"function"==typeof e?new va(this):this.map(function(f){return rn(f,e,t)})}),va.prototype.reject=function(e){return this.filter(_s(zo(e)))},va.prototype.slice=function(e,t){e=Us(e);var f=this;return f.__filtered__&&(e>0||t<0)?new va(f):(e<0?f=f.takeRight(-e):e&&(f=f.drop(e)),t!==o&&(f=(t=Us(t))<0?f.dropRight(-t):f.take(t-e)),f)},va.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},va.prototype.toArray=function(){return this.take(R)},Qa(va.prototype,function(e,t){var f=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),n=ga[a?"take"+("last"==t?"Right":""):t],r=a||/^find/.test(t);n&&(ga.prototype[t]=function(){var t=this.__wrapped__,s=a?[1]:arguments,c=t instanceof va,i=s[0],u=c||vs(t),_=function(e){var t=n.apply(ga,af([e],s));return a&&d?t[0]:t};u&&f&&"function"==typeof i&&1!=i.length&&(c=u=!1);var d=this.__chain__,l=!!this.__actions__.length,h=r&&!d,m=c&&!l;if(!r&&u){t=m?t:new va(this);var g=e.apply(t,s);return g.__actions__.push({func:qr,args:[_],thisArg:o}),new ya(g,d)}return h&&m?e.apply(this,s):(g=this.thru(_),h?a?g.value()[0]:g.value():g)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(e){var t=rt[e],f=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);ga.prototype[e]=function(){var e=arguments;if(a&&!this.__chain__){var n=this.value();return t.apply(vs(n)?n:[],e)}return this[f](function(f){return t.apply(vs(f)?f:[],e)})}}),Qa(va.prototype,function(e,t){var f=ga[t];if(f){var a=f.name+"";(sa[a]||(sa[a]=[])).push({name:t,func:f})}}),sa[bo(o,b).name]=[{name:"wrapper",func:o}],va.prototype.clone=function(){var e=new va(this.__wrapped__);return e.__actions__=ro(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ro(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ro(this.__views__),e},va.prototype.reverse=function(){if(this.__filtered__){var e=new va(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},va.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,f=vs(e),a=t<0,n=f?e.length:0,o=function(e,t,f){for(var a=-1,n=f.length;++a=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},ga.prototype.plant=function(e){for(var t,f=this;f instanceof ba;){var a=mr(f);a.__index__=0,a.__values__=o,t?n.__wrapped__=a:t=a;var n=a;f=f.__wrapped__}return n.__wrapped__=e,t},ga.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof va){var t=e;return this.__actions__.length&&(t=new va(this)),(t=t.reverse()).__actions__.push({func:qr,args:[jr],thisArg:o}),new ya(t,this.__chain__)}return this.thru(jr)},ga.prototype.toJSON=ga.prototype.valueOf=ga.prototype.value=function(){return Wn(this.__wrapped__,this.__actions__)},ga.prototype.first=ga.prototype.head,Pt&&(ga.prototype[Pt]=function(){return this}),ga}();Ht._=Rf,(n=function(){return Rf}.call(t,f,t,a))===o||(a.exports=n)}).call(this)}).call(this,f(5),f(45)(e))},function(e,t,f){"use strict";var a,n;a=[f(16)],void 0===(n=function(e){return e.noConflict()}.apply(t,a))||(e.exports=n)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/info.html --\x3e\n
"+f(e.message)+"
\n"}},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/spinner.html --\x3e\n\n'}},function(e,t,f){var a,n,o,r=r||{};r.nativeview=f(14),n=[f(8),f(4)],void 0===(o="function"==typeof(a=function(e,t){"use strict";var f=e.isUndefined(t.NativeView)?t.View:t.NativeView,a=t.Overview=function(t){var a=this;this.views={},this.keys=e.partial(e.keys,this.views),this.getAll=e.partial(e.identity,this.views),this.get=function(e){return a.views[e]},this.xget=function(t){return e.filter(a.views,function(e,f){return f!==t})},this.add=function(e,t){return a.views[e]=t,t},this.remove=function(e){void 0===e&&(new f).remove.apply(a);var t=a.views[e];if(t)return delete a.views[e],t.remove(),t},this.removeAll=function(){return e.each(e.keys(a.views),a.remove),a},f.apply(this,Array.prototype.slice.apply(arguments))};return e.each(["all","any","chain","collect","contains","detect","difference","drop","each","every","filter","find","first","foldl","foldr","forEach","head","include","indexOf","initial","inject","invoke","isEmpty","last","lastIndexOf","map","max","min","reduce","reduceRight","reject","rest","sample","select","shuffle","size","some","sortBy","tail","take","toArray","without"],function(t){a.prototype[t]=function(){var f=Array.prototype.slice.call(arguments);return f.unshift(this.views),e[t].apply(e,f)}}),e.extend(a.prototype,f.prototype),a.extend=f.extend,t.OrderedListView=t.Overview.extend({listItems:"model",sortEvent:"change",listSelector:".ordered-items",ItemView:void 0,initialize:function(){this.sortEventually=e.debounce(this.sortAndPositionAllItems.bind(this),500),this.items=e.get(this,this.listItems),this.items.on("add",this.createItemView,this),this.items.on("add",this.sortEventually,this),this.items.on(this.sortEvent,this.sortEventually,this)},createItemView:function(e){var t=this.get(e.get("id"));return t?(t.model=e,t.initialize()):(t=new this.ItemView({model:e}),this.add(e.get("id"),t)),t.render(),t},sortAndPositionAllItems:function(){var t=this;this.items.sort(),this.items.each(function(f){e.isUndefined(t.get(f.get("id")))&&t.createItemView(f),t.positionItem(f,t.el.querySelector(t.listSelector))})},positionItem:function(e,t){var f=this.get(e.get("id")),a=this.items.indexOf(e);return 0===a?t.insertAdjacentElement("afterbegin",f.el):a===this.items.length-1?t.insertAdjacentElement("beforeend",f.el):t.querySelector("li:nth-child("+a+")").insertAdjacentElement("afterend",f.el),f}}),t.Overview})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(9),f(17),f(7),f(262),f(261),f(260),f(256),f(259),f(59),f(58),f(258),f(257)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i,u,_){var d={"text-private":"password","text-single":"text",fixed:"label",boolean:"checkbox",hidden:"hidden","jid-multi":"textarea","list-single":"dropdown","list-multi":"dropdown"};return f.webForm2xForm=function(e){let n;return n="checkbox"===e.getAttribute("type")?e.checked?1:0:"TEXTAREA"==e.tagName?t.filter(e.value.split("\n"),t.trim):"SELECT"==e.tagName?f.getSelectValues(e):e.value,f.stringToNode(a({name:e.getAttribute("name"),value:n}))},f.xForm2webForm=function(a,l,h){if(a.getAttribute("type")){if("list-single"===a.getAttribute("type")||"list-multi"===a.getAttribute("type")){const e=t.map(f.queryChildren(a,"value"),t.partial(t.get,t,"textContent")),r=t.map(f.queryChildren(a,"option"),function(f){const o=t.get(f.querySelector("value"),"textContent");return n({value:o,label:f.getAttribute("label"),selected:t.includes(e,o),required:!t.isNil(a.querySelector("required"))})});return o({name:a.getAttribute("var"),label:a.getAttribute("label"),options:r.join(""),multiple:"list-multi"===a.getAttribute("type"),required:!t.isNil(a.querySelector("required"))})}return"fixed"===a.getAttribute("type")?'

'+t.get(a.querySelector("value"),"textContent")+"

":"jid-multi"===a.getAttribute("type")?r({name:a.getAttribute("var"),label:a.getAttribute("label")||"",value:t.get(a.querySelector("value"),"textContent"),required:!t.isNil(a.querySelector("required"))}):"boolean"===a.getAttribute("type")?s({name:a.getAttribute("var"),type:d[a.getAttribute("type")],label:a.getAttribute("label")||"",checked:"1"===t.get(a.querySelector("value"),"textContent")?'checked="1"':"",required:!t.isNil(a.querySelector("required"))}):"url"===a.getAttribute("var")?_({label:a.getAttribute("label")||"",value:t.get(a.querySelector("value"),"textContent")}):"username"===a.getAttribute("var")?c({domain:" @"+h,name:a.getAttribute("var"),type:d[a.getAttribute("type")],label:a.getAttribute("label")||"",value:t.get(a.querySelector("value"),"textContent"),required:!t.isNil(a.querySelector("required"))}):i({label:a.getAttribute("label")||"",name:a.getAttribute("var"),placeholder:null,required:!t.isNil(a.querySelector("required")),type:d[a.getAttribute("type")],value:t.get(a.querySelector("value"),"textContent")})}if("ocr"===a.getAttribute("var")){const f=a.querySelector("uri"),n=e('data[cid="'+f.textContent.replace(/^cid:/,"")+'"]',l)[0];return u({label:a.getAttribute("label"),name:a.getAttribute("var"),data:t.get(n,"textContent"),type:f.getAttribute("type"),required:!t.isNil(a.querySelector("required"))})}},f})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a=f(276).Symbol;e.exports=a},function(e,t,f){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日 HH:mm",LLLL:"YYYY年MMMD日dddd HH:mm",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日 HH:mm",llll:"YYYY年MMMD日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,f){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日 HH:mm",llll:"YYYY年MMMD日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,f){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";function t(e,t,f){var a,n,o={mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===f?t?"хвилина":"хвилину":"h"===f?t?"година":"годину":e+" "+(a=+e,n=o[f].split("_"),a%10==1&&a%100!=11?n[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?n[1]:n[2])}function f(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var f={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};if(!e)return f.nominative;var a=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative";return f[a][e.day()]},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:f("[Сьогодні "),nextDay:f("[Завтра "),lastDay:f("[Вчора "),nextWeek:f("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return f("[Минулої] dddd [").call(this);case 1:case 2:case 4:return f("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,f){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(f(0))},function(e,t,f){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},dayOfMonthOrdinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(e){if(0===e)return e+"'ıncı";var f=e%10,a=e%100-f,n=e>=100?100:null;return e+(t[f]||t[a]||t[n])},week:{dow:1,doy:7}})}(f(0))},function(e,t,f){!function(e){"use strict";function t(e,t,f){var a,n,o={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===f?t?"минута":"минуту":e+" "+(a=+e,n=o[f].split("_"),a%10==1&&a%100!=11?n[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?n[1]:n[2])}var f=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:f,longMonthsParse:f,shortMonthsParse:f,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:t,mm:t,h:"час",hh:t,d:"день",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,f){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº"})}(f(0))},function(e,t,f){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),f="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function a(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function n(e,t,f){var n=e+" ";switch(f){case"m":return t?"minuta":"minutę";case"mm":return n+(a(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(a(e)?"godziny":"godzin");case"MM":return n+(a(e)?"miesiące":"miesięcy");case"yy":return n+(a(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,a){return e?""===a?"("+f[e.month()]+"|"+t[e.month()]+")":/D MMMM/.test(a)?f[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:n,mm:n,h:n,hh:n,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:n,y:"rok",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),f="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],n=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?f[e.month()]:t[e.month()]:t},monthsRegex:n,monthsShortRegex:n,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 HH:mm dddd",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日 HH:mm dddd"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,f){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,f){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(f(0))},function(e,t,f){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function f(e,t,f,a){var n=e;switch(f){case"s":return a||t?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(a||t?" perc":" perce");case"mm":return n+(a||t?" perc":" perce");case"h":return"egy"+(a||t?" óra":" órája");case"hh":return n+(a||t?" óra":" órája");case"d":return"egy"+(a||t?" nap":" napja");case"dd":return n+(a||t?" nap":" napja");case"M":return"egy"+(a||t?" hónap":" hónapja");case"MM":return n+(a||t?" hónap":" hónapja");case"y":return"egy"+(a||t?" év":" éve");case"yy":return n+(a||t?" év":" éve")}return""}function a(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,f){return e<12?!0===f?"de":"DE":!0===f?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return a.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return a.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:f,m:f,mm:f,h:f,hh:f,d:f,dd:f,M:f,MM:f,y:f,yy:f},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,f){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?f?'לפנה"צ':"לפני הצהריים":e<18?f?'אחה"צ':"אחרי הצהריים":"בערב"}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(f(0))},function(e,t,f){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),f="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],n=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?f[e.month()]:t[e.month()]:t},monthsRegex:n,monthsShortRegex:n,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";function t(e,t,f,a){var n={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?n[f][0]:n[f][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var f=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(f="a"),e+f},week:{dow:1,doy:4}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,f=e%100;return 0===e?e+"-ев":0===f?e+"-ен":f>10&&f<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(f(0))},function(e,t,f){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},f={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},a=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(t,f,o,r){var s=a(t),c=n[e][a(t)];return 2===s&&(c=c[f?0:1]),c.replace(/%d/i,t)}},r=["كانون الثاني يناير","شباط فبراير","آذار مارس","نيسان أبريل","أيار مايو","حزيران يونيو","تموز يوليو","آب أغسطس","أيلول سبتمبر","تشرين الأول أكتوبر","تشرين الثاني نوفمبر","كانون الأول ديسمبر"];e.defineLocale("ar",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,f){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return f[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})}(f(0))},function(e,t,f){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,f){return e<12?f?"vm":"VM":f?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(f(0))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,f){(function(t,f){ /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.4+314e4831 */var a;a=function(){"use strict";function e(e){return"function"==typeof e}var a=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,o=void 0,r=void 0,s=function(e,t){h[n]=e,h[n+1]=t,2===(n+=2)&&(r?r(m):v())};var c="undefined"!=typeof window?window:void 0,i=c||{},u=i.MutationObserver||i.WebKitMutationObserver,_="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var e=setTimeout;return function(){return e(m,1)}}var h=new Array(1e3);function m(){for(var e=0;e{t.api.listen.on("serviceDiscovered",f),t.disco_entities.each(e=>{const t=e.features.findWhere({var:x.NS.MUC});t&&f(t)})}).catch(j.partial(t.log,j,x.LogLevel.ERROR))}(e):P(t.muc_domain,e)))}t.api.promises.add(["roomsPanelRendered"]),t.api.settings.update({auto_list_rooms:!1,hide_muc_server:!1,muc_disable_moderator_commands:!1,visible_toolbar_buttons:{toggle_occupants:!0}}),t.muc={info_messages:{100:M("This room is not anonymous"),102:M("This room now shows unavailable members"),103:M("This room does not show unavailable members"),104:M("The room configuration has changed"),170:M("Room logging is now enabled"),171:M("Room logging is now disabled"),172:M("This room is now no longer anonymous"),173:M("This room is now semi-anonymous"),174:M("This room is now fully-anonymous"),201:M("A new room has been created")},disconnect_messages:{301:M("You have been banned from this room"),307:M("You have been kicked from this room"),321:M("You have been removed from this room because of an affiliation change"),322:M("You have been removed from this room because the room has changed to members-only and you're not a member"),332:M("You have been removed from this room because the MUC (Multi-user chat) service is being shut down")},action_info_messages:{301:S("%1$s has been banned"),303:S("%1$s's nickname has changed"),307:S("%1$s has been kicked out"),321:S("%1$s has been removed because of an affiliation change"),322:S("%1$s has been removed for not being a member")},new_nickname_messages:{210:S("Your nickname has been automatically set to %1$s"),303:S("Your nickname has been changed to %1$s")}},t.ListChatRoomsModal=t.BootstrapModal.extend({events:{"submit form":"showRooms","click a.room-info":"toggleRoomInfo","change input[name=nick]":"setNick","change input[name=server]":"setDomain","click .open-room":"openRoom"},initialize(){t.BootstrapModal.prototype.initialize.apply(this,arguments),this.model.on("change:muc_domain",this.onDomainChange,this)},toHTML(){return m(j.extend(this.model.toJSON(),{heading_list_chatrooms:M("Query for Chatrooms"),label_server_address:M("Server address"),label_query:M("Show rooms"),server_placeholder:M("conference.example.org")}))},afterRender(){this.el.addEventListener("shown.bs.modal",()=>{this.el.querySelector('input[name="server"]').focus()},!1)},openRoom(e){e.preventDefault();const f=e.target.getAttribute("data-room-jid"),a=e.target.getAttribute("data-room-name");this.modal.hide(),t.api.rooms.open(f,{name:a})},toggleRoomInfo(e){e.preventDefault(),I(e)},onDomainChange(e){t.auto_list_rooms&&this.updateRoomsList()},roomStanzaItemToHTMLElement(e){const t=x.unescapeNode(e.getAttribute("name")||e.getAttribute("jid")),f=document.createElement("div");return f.innerHTML=b({name:x.xmlunescape(t),jid:e.getAttribute("jid"),open_title:M("Click to open this room"),info_title:M("Show more information on this room")}),f.firstElementChild},removeSpinner(){j.each(this.el.querySelectorAll("span.spinner"),e=>e.parentNode.removeChild(e))},informNoRoomsFound(){const e=this.el.querySelector(".available-chatrooms");e.innerHTML=v({feedback_text:M("No rooms found")});const t=this.el.querySelector('input[name="server"]');t.classList.remove("hidden"),this.removeSpinner()},onRoomsFound(e){const t=this.el.querySelector(".available-chatrooms");if(this.rooms=e.querySelectorAll("query item"),this.rooms.length){t.innerHTML=v({feedback_text:M("Rooms found:")});const e=document.createDocumentFragment(),f=j.reject(j.map(this.rooms,this.roomStanzaItemToHTMLElement),j.isNil);j.each(f,t=>e.appendChild(t)),t.appendChild(e),this.removeSpinner()}else this.informNoRoomsFound();return!0},updateRoomsList(){t.connection.sendIQ(C({to:this.model.get("muc_domain"),from:t.connection.jid,type:"get"}).c("query",{xmlns:x.NS.DISCO_ITEMS}),this.onRoomsFound.bind(this),this.informNoRoomsFound.bind(this),5e3)},showRooms(e){e.preventDefault();const t=new FormData(e.target);this.model.save("muc_domain",t.get("server")),this.updateRoomsList()},setDomain(e){this.model.save({muc_domain:e.target.value})},setNick(e){this.model.save({nick:e.target.value})}}),t.AddChatRoomModal=t.BootstrapModal.extend({events:{"submit form.add-chatroom":"openChatRoom"},toHTML(){return f(j.extend(this.model.toJSON(),{heading_new_chatroom:M("Enter a new Chatroom"),label_room_address:M("Room address"),label_nickname:M("Optional nickname"),chatroom_placeholder:M("name@conference.example.org"),label_join:M("Join")}))},afterRender(){this.el.addEventListener("shown.bs.modal",()=>{this.el.querySelector('input[name="chatroom"]').focus()},!1)},parseRoomDataFromEvent(e){const t=new FormData(e),f=t.get("chatroom"),a=x.getDomainFromJid(f);return this.model.save("muc_domain",a),{jid:f,nick:t.get("nickname")}},openChatRoom(e){e.preventDefault();const f=this.parseRoomDataFromEvent(e.target);t.api.rooms.open(f.jid,f),this.modal.hide(),e.target.reset()}}),t.ChatRoomView=t.ChatBoxView.extend({length:300,tagName:"div",className:"chatbox chatroom hidden",is_chatroom:!0,events:{"change input.fileupload":"onFileSelection","click .close-chatbox-button":"close","click .configure-chatroom-button":"getAndRenderConfigurationForm","click .new-msgs-indicator":"viewUnreadMessages","click .occupant-nick":"onOccupantClicked","click .send-button":"onFormSubmitted","click .toggle-call":"toggleCall","click .toggle-occupants":"toggleOccupants","click .toggle-smiley ul.emoji-picker li":"insertEmoji","click .toggle-smiley":"toggleEmojiMenu","click .upload-file":"toggleFileUpload","keypress .chat-textarea":"keyPressed","input .chat-textarea":"inputChanged"},initialize(){if(this.initDebounced(),this.model.messages.on("add",this.onMessageAdded,this),this.model.messages.on("rendered",this.scrollDown,this),this.model.on("change:affiliation",this.renderHeading,this),this.model.on("change:connection_status",this.afterConnected,this),this.model.on("change:description",this.renderHeading,this),this.model.on("change:name",this.renderHeading,this),this.model.on("change:subject",this.setChatRoomSubject,this),this.model.on("configurationNeeded",this.getAndRenderConfigurationForm,this),this.model.on("destroy",this.hide,this),this.model.on("show",this.show,this),this.model.occupants.on("add",this.showJoinNotification,this),this.model.occupants.on("remove",this.showLeaveNotification,this),this.model.occupants.on("change:show",e=>{e.isMember()&&!j.includes(e.get("states"),"303")&&("offline"===e.get("show")?this.showLeaveNotification(e):"online"===e.get("show")&&this.showJoinNotification(e))}),this.createEmojiPicker(),this.createOccupantsView(),this.render().insertIntoDOM(),this.registerHandlers(),this.model.get("connection_status")!==e.ROOMSTATUS.ENTERED){const e=()=>{N.isPersistableModel(this.model)&&(this.populateAndJoin(),t.emit("chatRoomOpened",this))};this.model.getRoomFeatures().then(e,e)}else this.fetchMessages(),t.emit("chatRoomOpened",this)},render(){return this.el.setAttribute("id",this.model.get("box_id")),this.el.innerHTML=n(),this.renderHeading(),this.renderChatArea(),this.model.get("connection_status")!==e.ROOMSTATUS.ENTERED&&this.showSpinner(),this},renderHeading(){this.el.querySelector(".chat-head-chatroom").innerHTML=this.generateHeadingHTML()},renderChatArea(){if(j.isNull(this.el.querySelector(".chat-area"))){const e=this.el.querySelector(".chatroom-body");e.innerHTML=a({label_message:M("Message"),label_send:M("Send"),show_send_button:t.show_send_button,show_toolbar:t.show_toolbar,unread_msgs:M("You have unread messages")}),e.insertAdjacentElement("beforeend",this.occupantsview.el),this.renderToolbar(l),this.content=this.el.querySelector(".chat-content"),this.toggleOccupants(null,!0)}return this},showChatStateNotification(e){if("me"!==e.get("sender"))return t.ChatBoxView.prototype.showChatStateNotification.apply(this,arguments)},createOccupantsView(){return this.model.occupants.chatroomview=this,this.occupantsview=new t.ChatRoomOccupantsView({model:this.model.occupants}),this.occupantsview.model.on("change:role",this.informOfOccupantsRoleChange,this),this},informOfOccupantsRoleChange(e,t){const f=e._previousAttributes.role;"moderator"===f&&this.showChatEvent(M("%1$s is no longer a moderator",e.get("nick"))),"visitor"===f&&this.showChatEvent(M("%1$s has been given a voice again",e.get("nick"))),"visitor"===e.get("role")&&this.showChatEvent(M("%1$s has been muted",e.get("nick"))),"moderator"===e.get("role")&&this.showChatEvent(M("%1$s is now a moderator",e.get("nick")))},generateHeadingHTML(){return c(j.extend(this.model.toJSON(),{Strophe:x,info_close:M("Close and leave this room"),info_configure:M("Configure this room"),description:this.model.get("description")||""}))},afterShown(){N.isPersistableModel(this.model)&&(this.model.clearUnreadMsgCounter(),this.model.save()),this.occupantsview.setOccupantsHeight(),this.scrollDown(),this.renderEmojiPicker()},show(){N.isVisible(this.el)?this.focus():(N.showElement(this.el),this.afterShown())},afterConnected(){this.model.get("connection_status")===e.ROOMSTATUS.ENTERED&&(this.hideSpinner(),this.setChatState(t.ACTIVE),this.scrollDown(),this.focus())},getToolbarOptions(){return j.extend(t.ChatBoxView.prototype.getToolbarOptions.apply(this,arguments),{label_hide_occupants:M("Hide the list of occupants"),show_occupants_toggle:this.is_chatroom&&t.visible_toolbar_buttons.toggle_occupants})},close(e){this.hide(),L.history.getFragment()==="converse/room?jid="+this.model.get("jid")&&t.router.navigate(""),this.model.leave(),t.ChatBoxView.prototype.close.apply(this,arguments)},setOccupantsVisibility(){this.el.querySelector(".toggle-occupants"),this.model.get("hidden_occupants")?(this.el.querySelector(".chat-area").classList.add("full"),N.hideElement(this.el.querySelector(".occupants"))):(this.el.querySelector(".chat-area").classList.remove("full"),this.el.querySelector(".occupants").classList.remove("hidden")),this.occupantsview.setOccupantsHeight()},toggleOccupants(e,t){e&&(e.preventDefault(),e.stopPropagation()),t||this.model.set({hidden_occupants:!this.model.get("hidden_occupants")}),this.setOccupantsVisibility(),this.scrollDown()},onOccupantClicked(e){this.insertIntoTextArea(e.target.textContent)},handleChatStateNotification(e){e.get("fullname")!==this.model.get("nick")&&e.get("chat_state")!==t.GONE&&t.ChatBoxView.prototype.handleChatStateNotification.apply(this,arguments)},modifyRole(e,f,a,n,o,r){const s=A("item",{nick:f,role:a}),c=C({to:e,type:"set"}).c("query",{xmlns:x.NS.MUC_ADMIN}).cnode(s.node);return null!==n&&c.c("reason",n),t.connection.sendIQ(c,o,r)},validateRoleChangeCommand(e,t){return!(t.length<1||t.length>2)||(this.showErrorMessage(M('Error: the "%1$s" command takes two arguments, the user\'s nickname and optionally a reason.',e),!0),!1)},onCommandError(e){t.log(e,x.LogLevel.FATAL),this.showErrorMessage(M("Sorry, an error happened while running the command. Check your browser's developer console for details."),!0)},parseMessageForCommands(e){const f=t.ChatBoxView.prototype;if(f.parseMessageForCommands.apply(this,arguments))return!0;if(t.muc_disable_moderator_commands)return!1;const a=e.replace(/^\s*/,"").match(/^\/(.*?)(?: (.*))?$/)||[!1,"",""],n=a[2]&&a[2].splitOnce(" ")||[],o=a[1].toLowerCase();switch(o){case"admin":if(!this.validateRoleChangeCommand(o,n))break;this.model.setAffiliation("admin",[{jid:n[0],reason:n[1]}]).then(()=>this.model.occupants.fetchMembers(),e=>this.onCommandError(e));break;case"ban":if(!this.validateRoleChangeCommand(o,n))break;this.model.setAffiliation("outcast",[{jid:n[0],reason:n[1]}]).then(()=>this.model.occupants.fetchMembers(),e=>this.onCommandError(e));break;case"deop":if(!this.validateRoleChangeCommand(o,n))break;this.modifyRole(this.model.get("jid"),n[0],"participant",n[1],void 0,this.onCommandError.bind(this));break;case"help":this.showHelpMessages([`/admin: ${M("Change user's affiliation to admin")}`,`/ban: ${M("Ban user from room")}`,`/clear: ${M("Remove messages")}`,`/deop: ${M("Change user role to participant")}`,`/help: ${M("Show this menu")}`,`/kick: ${M("Kick user from room")}`,`/me: ${M("Write in 3rd person")}`,`/member: ${M("Grant membership to a user")}`,`/mute: ${M("Remove user's ability to post messages")}`,`/nick: ${M("Change your nickname")}`,`/op: ${M("Grant moderator role to user")}`,`/owner: ${M("Grant ownership of this room")}`,`/revoke: ${M("Revoke user's membership")}`,`/subject: ${M("Set room subject")}`,`/topic: ${M("Set room subject (alias for /subject)")}`,`/voice: ${M("Allow muted user to post messages")}`]);break;case"kick":if(!this.validateRoleChangeCommand(o,n))break;this.modifyRole(this.model.get("jid"),n[0],"none",n[1],void 0,this.onCommandError.bind(this));break;case"mute":if(!this.validateRoleChangeCommand(o,n))break;this.modifyRole(this.model.get("jid"),n[0],"visitor",n[1],void 0,this.onCommandError.bind(this));break;case"member":if(!this.validateRoleChangeCommand(o,n))break;this.model.setAffiliation("member",[{jid:n[0],reason:n[1]}]).then(()=>this.model.occupants.fetchMembers(),e=>this.onCommandError(e));break;case"nick":t.connection.send(H({from:t.connection.jid,to:this.model.getRoomJIDAndNick(a[2]),id:t.connection.getUniqueId()}).tree());break;case"owner":if(!this.validateRoleChangeCommand(o,n))break;this.model.setAffiliation("owner",[{jid:n[0],reason:n[1]}]).then(()=>this.model.occupants.fetchMembers(),e=>this.onCommandError(e));break;case"op":if(!this.validateRoleChangeCommand(o,n))break;this.modifyRole(this.model.get("jid"),n[0],"moderator",n[1],void 0,this.onCommandError.bind(this));break;case"revoke":if(!this.validateRoleChangeCommand(o,n))break;this.model.setAffiliation("none",[{jid:n[0],reason:n[1]}]).then(()=>this.model.occupants.fetchMembers(),e=>this.onCommandError(e));break;case"topic":case"subject":t.connection.send(E({to:this.model.get("jid"),from:t.connection.jid,type:"groupchat"}).c("subject",{xmlns:"jabber:client"}).t(a[2]).tree());break;case"voice":if(!this.validateRoleChangeCommand(o,n))break;this.modifyRole(this.model.get("jid"),n[0],"participant",n[1],void 0,this.onCommandError.bind(this));break;default:return!1}return!0},registerHandlers(){this.model.addHandler("presence","ChatRoomView.onPresence",this.onPresence.bind(this)),this.model.addHandler("message","ChatRoomView.showStatusMessages",this.showStatusMessages.bind(this))},onPresence(e){"error"===e.getAttribute("type")?this.showErrorMessageFromPresence(e):this.showStatusMessages(e)},populateAndJoin(){this.model.occupants.fetchMembers(),this.join(),this.fetchMessages()},join(e,t){return e||this.model.get("nick")?(this.model.join(e,t),this):(this.checkForReservedNick(),this)},renderConfigurationForm(e){const t=this.el.querySelector(".chatroom-body");j.each(t.querySelectorAll(".chatroom-form-container"),N.removeElement),j.each(t.children,N.hideElement),t.insertAdjacentHTML("beforeend",s());const f=t.querySelector("form.chatroom-form"),a=f.querySelector("fieldset"),n=e.querySelectorAll("field"),o=j.get(e.querySelector("title"),"textContent"),r=j.get(e.querySelector("instructions"),"textContent");N.removeElement(a.querySelector("span.spinner")),a.insertAdjacentHTML("beforeend",`${o}`),r&&r!==o&&a.insertAdjacentHTML("beforeend",`

${r}

`),j.each(n,function(t){a.insertAdjacentHTML("beforeend",N.xForm2webForm(t,e))});const c=document.createElement("fieldset");c.insertAdjacentHTML("beforeend",``),c.insertAdjacentHTML("beforeend",``),f.insertAdjacentElement("beforeend",c),c.querySelector("input[type=button]").addEventListener("click",e=>{e.preventDefault(),this.closeForm()}),f.addEventListener("submit",e=>{e.preventDefault(),this.model.saveConfiguration(e.target).then(this.model.getRoomFeatures.bind(this.model)),this.closeForm()},!1)},closeForm(){N.removeElement(this.el.querySelector(".chatroom-form-container")),this.renderAfterTransition()},getAndRenderConfigurationForm(e){this.showSpinner(),this.model.fetchRoomConfiguration().then(this.renderConfigurationForm.bind(this)).catch(j.partial(t.log,j,x.LogLevel.ERROR))},submitNickname(e){e.preventDefault();const t=e.target.nick,f=t.value;f?(t.classList.remove("error"),this.el.querySelector(".chatroom-form-container").outerHTML=w(),this.join(f)):t.classList.add("error")},checkForReservedNick(){this.showSpinner(),this.model.checkForReservedNick(this.onNickNameFound.bind(this),this.onNickNameNotFound.bind(this))},onNickNameFound(e){const t=e.querySelector('query[node="x-roomuser-item"] identity'),f=t?t.getAttribute("name"):null;f?this.join(f):this.onNickNameNotFound()},onNickNameNotFound(e){const t=this.getDefaultNickName();t?this.join(t):this.renderNicknameForm(e)},getDefaultNickName(){const e=t.xmppstatus.vcard.get("nickname");return e||(t.muc_nickname_from_jid?x.unescapeNode(x.getNodeFromJid(t.bare_jid)):void 0)},onNicknameClash(e){if(t.muc_nickname_from_jid){const t=e.getAttribute("from").split("/")[1];if(t===this.getDefaultNickName())this.join(t+"-2");else{const e=t.lastIndexOf("-"),f=t.substring(e+1,t.length);this.join(t.substring(0,e+1)+String(Number(f)+1))}}else this.renderNicknameForm(M("The nickname you chose is reserved or currently in use, please choose a different one."))},hideChatRoomContents(){const e=this.el.querySelector(".chatroom-body");j.isNull(e)||j.each(e.children,e=>{e.classList.add("hidden")})},renderNicknameForm(t){this.hideChatRoomContents(),j.each(this.el.querySelectorAll("span.centered.spinner"),N.removeElement),j.isString(t)||(t="");const f=this.el.querySelector(".chatroom-body");f.insertAdjacentHTML("beforeend",u({heading:M("Please choose your nickname"),label_nickname:M("Nickname"),label_join:M("Enter room"),validation_message:t})),this.model.save("connection_status",e.ROOMSTATUS.NICKNAME_REQUIRED);const a=this.el.querySelector(".chatroom-form");a.addEventListener("submit",this.submitNickname.bind(this),!1)},submitPassword(e){e.preventDefault();const t=this.el.querySelector(".chatroom-form input[type=password]").value;this.showSpinner(),this.join(this.model.get("nick"),t)},renderPasswordForm(){const t=this.el.querySelector(".chatroom-body");j.each(t.children,N.hideElement),j.each(this.el.querySelectorAll(".spinner"),N.removeElement),t.insertAdjacentHTML("beforeend",_({heading:M("This chatroom requires a password"),label_password:M("Password: "),label_submit:M("Submit")})),this.model.save("connection_status",e.ROOMSTATUS.PASSWORD_REQUIRED),this.el.querySelector(".chatroom-form").addEventListener("submit",this.submitPassword.bind(this),!1)},showDisconnectMessage(e){N.hideElement(this.el.querySelector(".chat-area")),N.hideElement(this.el.querySelector(".occupants")),j.each(this.el.querySelectorAll(".spinner"),N.removeElement),this.el.querySelector(".chatroom-body").insertAdjacentHTML("beforeend",o({disconnect_message:e}))},getMessageFromStatus(e,f,a){const n=e.getAttribute("code");if("110"===n||"100"===n&&!a)return;if(n in t.muc.info_messages)return t.muc.info_messages[n];let o;if(a){if(n in t.muc.new_nickname_messages)return a&&"210"===n?o=x.getResourceFromJid(f.getAttribute("from")):a&&"303"===n&&(o=f.querySelector("x item").getAttribute("nick")),M(t.muc.new_nickname_messages[n],o)}else if(n in t.muc.action_info_messages)return o=x.getResourceFromJid(f.getAttribute("from")),M(t.muc.action_info_messages[n],o)},parseXUserElement(e,f,a){const n=e.querySelectorAll("status"),o=j.partial(this.getMessageFromStatus,j,f,a),r={},s=j.reject(j.map(n,o),j.isUndefined);s.length&&(r.messages=s);const c=j.invokeMap(n,Element.prototype.getAttribute,"code"),i=j.intersection(c,j.keys(t.muc.disconnect_messages)),u=a&&i.length>0;u&&(r.disconnected=!0,r.disconnection_message=t.muc.disconnect_messages[i[0]]);const _=e.querySelector("item");if(!j.isNull(_)){const e=_.querySelector("reason");e&&(r.reason=e?e.textContent:void 0);const t=_.querySelector("actor");t&&(r.actor=t?t.getAttribute("nick"):void 0)}return r},showNotificationsforUser(t){if(t.disconnected)return this.showDisconnectMessage(t.disconnection_message),t.actor&&this.showDisconnectMessage(M("This action was done by %1$s.",t.actor)),t.reason&&this.showDisconnectMessage(M('The reason given is: "%1$s".',t.reason)),void this.model.save("connection_status",e.ROOMSTATUS.DISCONNECTED);j.each(t.messages,e=>{this.content.insertAdjacentHTML("beforeend",h({data:"",isodate:T().format(),extra_classes:"chat-event",message:e}))}),t.reason&&this.showChatEvent(M('The reason given is: "%1$s".',t.reason)),j.get(t.messages,"length")&&this.scrollDown()},showJoinNotification(t){if(this.model.get("connection_status")!==e.ROOMSTATUS.ENTERED)return;const f=t.get("nick"),a=t.get("status"),n=this.content.lastElementChild;if(j.includes(j.get(n,"classList",[]),"chat-info")&&j.get(n,"dataset",{}).leave===`"${f}"`)n.outerHTML=h({data:`data-leavejoin="${f}"`,isodate:T().format(),extra_classes:"chat-event",message:M("%1$s has left and re-entered the room",f)});else{let e;e=j.isNil(a)?M("%1$s has entered the room",f):M('%1$s has entered the room. "%2$s"',f,a);const t={data:`data-join="${f}"`,isodate:T().format(),extra_classes:"chat-event",message:e};if(j.includes(j.get(n,"classList",[]),"chat-info")&&j.get(n,"dataset",{}).joinleave===`"${f}"`)n.outerHTML=h(t);else{const e=N.stringToElement(h(t));this.content.insertAdjacentElement("beforeend",e),this.insertDayIndicator(e)}}this.scrollDown()},showLeaveNotification(e){const t=e.get("nick"),f=e.get("status"),a=this.content.lastElementChild,n=a.getAttribute("data-isodate");if(j.includes(j.get(a,"classList",[]),"chat-info")&&T(n).isSame(new Date,"day")&&j.get(a,"dataset",{}).join===`"${t}"`){let e;e=j.isNil(f)?M("%1$s has entered and left the room",t):M('%1$s has entered and left the room. "%2$s"',t,f),a.outerHTML=h({data:`data-joinleave="${t}"`,isodate:T().format(),extra_classes:"chat-event",message:e})}else{let e;const n={message:e=j.isNil(f)?M("%1$s has left the room",t):M('%1$s has left the room. "%2$s"',t,f),isodate:T().format(),extra_classes:"chat-event",data:`data-leave="${t}"`};if(j.includes(j.get(a,"classList",[]),"chat-info")&&j.get(a,"dataset",{}).leavejoin===`"${t}"`)a.outerHTML=h(n);else{const e=N.stringToElement(h(n));this.content.insertAdjacentElement("beforeend",e),this.insertDayIndicator(e)}}this.scrollDown()},showStatusMessages(e){const t=Y(`x[xmlns="${x.NS.MUC_USER}"]`,e),f=e.querySelectorAll("status[code='110']").length,a=j.partial(this.parseXUserElement.bind(this),j,e,f),n=j.reject(j.map(t,a),j.isEmpty);j.each(n,this.showNotificationsforUser.bind(this))},showErrorMessageFromPresence(e){const t=e.querySelector("error");"auth"===t.getAttribute("type")?j.isNull(t.querySelector("not-authorized"))?j.isNull(t.querySelector("registration-required"))?j.isNull(t.querySelector("forbidden"))||this.showDisconnectMessage(M("You have been banned from this room.")):this.showDisconnectMessage(M("You are not on the member list of this room.")):this.renderPasswordForm():"modify"===t.getAttribute("type")?j.isNull(t.querySelector("jid-malformed"))||this.showDisconnectMessage(M("No nickname was specified.")):"cancel"===t.getAttribute("type")&&(j.isNull(t.querySelector("not-allowed"))?j.isNull(t.querySelector("not-acceptable"))?j.isNull(t.querySelector("conflict"))?j.isNull(t.querySelector("item-not-found"))?j.isNull(t.querySelector("service-unavailable"))||this.showDisconnectMessage(M("This room has reached its maximum number of occupants.")):this.showDisconnectMessage(M("This room does not (yet) exist.")):this.onNicknameClash(e):this.showDisconnectMessage(M("Your nickname doesn't conform to this room's policies.")):this.showDisconnectMessage(M("You are not allowed to create new rooms.")))},renderAfterTransition(){this.model.get("connection_status")==e.ROOMSTATUS.NICKNAME_REQUIRED?this.renderNicknameForm():this.model.get("connection_status")==e.ROOMSTATUS.PASSWORD_REQUIRED?this.renderPasswordForm():(this.el.querySelector(".chat-area").classList.remove("hidden"),this.setOccupantsVisibility(),this.scrollDown())},showSpinner(){N.removeElement(this.el.querySelector(".spinner"));const e=this.el.querySelector(".chatroom-body"),t=Array.prototype.slice.call(e.children,0);e.insertAdjacentHTML("afterbegin",w()),j.each(t,N.hideElement)},hideSpinner(){const e=this.el.querySelector(".spinner");return j.isNull(e)||(N.removeElement(e),this.renderAfterTransition()),this},setChatRoomSubject(){const e=this.model.get("subject");this.content.insertAdjacentHTML("beforeend",h({data:"",isodate:T().format(),extra_classes:"chat-event",message:M("Topic set by %1$s",e.author)})),this.content.insertAdjacentHTML("beforeend",h({data:"",isodate:T().format(),extra_classes:"chat-topic",message:e.text})),this.scrollDown()}}),t.RoomsPanel=L.NativeView.extend({tagName:"div",className:"controlbox-section",id:"chatrooms",events:{"click a.chatbox-btn.fa-users":"showAddRoomModal","click a.chatbox-btn.fa-list-ul":"showListRoomsModal","click a.room-info":"toggleRoomInfo"},render(){return this.el.innerHTML=y({heading_chatrooms:M("Chatrooms"),title_new_room:M("Add a new room"),title_list_rooms:M("Query for rooms")}),this},toggleRoomInfo(e){e.preventDefault(),I(e)},showAddRoomModal(e){j.isUndefined(this.add_room_modal)&&(this.add_room_modal=new t.AddChatRoomModal({model:this.model})),this.add_room_modal.show(e)},showListRoomsModal(e){j.isUndefined(this.list_rooms_modal)&&(this.list_rooms_modal=new t.ListChatRoomsModal({model:this.model})),this.list_rooms_modal.show(e)}}),t.ChatRoomOccupantView=L.VDOMView.extend({tagName:"li",initialize(){this.model.on("change",this.render,this)},toHTML(){const e=this.model.get("show");return g(j.extend({_:j,jid:"",show:e,hint_show:t.PRETTY_CHAT_STATUS[e],hint_occupant:M("Click to mention %1$s in your message.",this.model.get("nick")),desc_moderator:M("This user is a moderator."),desc_participant:M("This user can send messages in this room."),desc_visitor:M("This user can NOT send messages in this room."),label_moderator:M("Moderator"),label_visitor:M("Visitor"),label_owner:M("Owner"),label_member:M("Member"),label_admin:M("Admin")},this.model.toJSON()))},destroy(){this.el.parentElement.removeChild(this.el)}}),t.ChatRoomOccupantsView=L.OrderedListView.extend({tagName:"div",className:"occupants col-md-3 col-4",listItems:"model",sortEvent:"change:role",listSelector:".occupant-list",ItemView:t.ChatRoomOccupantView,initialize(){L.OrderedListView.prototype.initialize.apply(this,arguments),this.chatroomview=this.model.chatroomview,this.chatroomview.model.on("change:open",this.renderInviteWidget,this),this.chatroomview.model.on("change:affiliation",this.renderInviteWidget,this),this.chatroomview.model.on("change:hidden",this.onFeatureChanged,this),this.chatroomview.model.on("change:mam_enabled",this.onFeatureChanged,this),this.chatroomview.model.on("change:membersonly",this.onFeatureChanged,this),this.chatroomview.model.on("change:moderated",this.onFeatureChanged,this),this.chatroomview.model.on("change:nonanonymous",this.onFeatureChanged,this),this.chatroomview.model.on("change:open",this.onFeatureChanged,this),this.chatroomview.model.on("change:passwordprotected",this.onFeatureChanged,this),this.chatroomview.model.on("change:persistent",this.onFeatureChanged,this),this.chatroomview.model.on("change:publicroom",this.onFeatureChanged,this),this.chatroomview.model.on("change:semianonymous",this.onFeatureChanged,this),this.chatroomview.model.on("change:temporary",this.onFeatureChanged,this),this.chatroomview.model.on("change:unmoderated",this.onFeatureChanged,this),this.chatroomview.model.on("change:unsecured",this.onFeatureChanged,this),this.render(),this.model.fetch({add:!0,silent:!0,success:this.sortAndPositionAllItems.bind(this)})},render(){return this.el.innerHTML=d(j.extend(this.chatroomview.model.toJSON(),{allow_muc_invitations:t.allow_muc_invitations,label_occupants:M("Occupants")})),t.allow_muc_invitations&&t.api.waitUntil("rosterContactsFetched").then(this.renderInviteWidget.bind(this)),this.renderRoomFeatures()},renderInviteWidget(){const e=this.el.querySelector("form.room-invite");if(this.shouldInviteWidgetBeShown()){if(j.isNull(e)){const e=this.el.querySelector(".occupants-heading");e.insertAdjacentHTML("afterend",i({error_message:null,label_invitation:M("Invite")})),this.initInviteWidget()}}else j.isNull(e)||e.remove();return this},renderRoomFeatures(){const t=j.pick(this.chatroomview.model.attributes,e.ROOM_FEATURES),f=this.el.querySelector(".chatroom-features");return f.innerHTML=r(j.extend(this.chatroomview.model.toJSON(),{has_features:j.reduce(j.values(t),(e,t)=>e||t),label_features:M("Features"),label_hidden:M("Hidden"),label_mam_enabled:M("Message archiving"),label_membersonly:M("Members only"),label_moderated:M("Moderated"),label_nonanonymous:M("Non-anonymous"),label_open:M("Open"),label_passwordprotected:M("Password protected"),label_persistent:M("Persistent"),label_public:M("Public"),label_semianonymous:M("Semi-anonymous"),label_temporary:M("Temporary"),label_unmoderated:M("Unmoderated"),label_unsecured:M("No password"),tt_hidden:M("This room is not publicly searchable"),tt_mam_enabled:M("Messages are archived on the server"),tt_membersonly:M("This room is restricted to members only"),tt_moderated:M("This room is being moderated"),tt_nonanonymous:M("All other room occupants can see your XMPP username"),tt_open:M("Anyone can join this room"),tt_passwordprotected:M("This room requires a password before entry"),tt_persistent:M("This room persists even if it's unoccupied"),tt_public:M("This room is publicly searchable"),tt_semianonymous:M("Only moderators can see your XMPP username"),tt_temporary:M("This room will disappear once the last person leaves"),tt_unmoderated:M("This room is not being moderated"),tt_unsecured:M("This room does not require a password upon entry")})),this.setOccupantsHeight(),this},onFeatureChanged(e){j.isUndefined(this.debouncedRenderRoomFeatures)&&(this.debouncedRenderRoomFeatures=j.debounce(this.renderRoomFeatures,100,{leading:!1}));const t={};j.each(j.keys(e.changed),function(f){j.isNil(O[f])||(t[O[f]]=!e.changed[f])}),this.chatroomview.model.save(t,{silent:!0}),this.debouncedRenderRoomFeatures()},setOccupantsHeight(){const e=this.el.querySelector(".chatroom-features");this.el.querySelector(".occupant-list").style.cssText=`height: calc(100% - ${e.offsetHeight}px - 5em);`},promptForInvite(e){const t=prompt(M('You are about to invite %1$s to the chat room "%2$s". You may optionally include a message, explaining the reason for the invitation.',e.text.label,this.model.get("id")));null!==t&&this.chatroomview.model.directInvite(e.text.value,t);const f=e.target.form,a=f.querySelector(".pure-form-message.error");j.isNull(a)||a.parentNode.removeChild(a),e.target.value=""},inviteFormSubmitted(e){e.preventDefault();const t=e.target.querySelector("input.invited-contact"),f=t.value;if(!f||j.compact(f.split("@")).length<2)return e.target.outerHTML=i({error_message:M("Please enter a valid XMPP username"),label_invitation:M("Invite")}),void this.initInviteWidget();this.promptForInvite({target:t,text:{label:f,value:f}})},shouldInviteWidgetBeShown(){return t.allow_muc_invitations&&(this.chatroomview.model.get("open")||"owner"===this.chatroomview.model.get("affiliation"))},initInviteWidget(){const e=this.el.querySelector("form.room-invite");if(j.isNull(e))return;e.addEventListener("submit",this.inviteFormSubmitted.bind(this),!1);const f=this.el.querySelector("input.invited-contact"),a=t.roster.map(function(e){const t=e.get("fullname")||e.get("jid");return{label:t,value:e.get("jid")}});new k(f,{minChars:1,list:a}),f.addEventListener("awesomplete-selectcomplete",this.promptForInvite.bind(this))}}),t.on("controlboxInitialized",e=>{t.allow_muc&&(z(e),e.model.on("change:connected",j.partial(z,e)))}),t.on("reconnected",function(){t.chatboxviews.each(function(t){t.model.get("type")===e.CHATROOMS_TYPE&&(t.model.save("connection_status",e.ROOMSTATUS.DISCONNECTED),t.model.registerHandlers(),t.populateAndJoin())})})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(207),f(206)],void 0===(o="function"==typeof(a=function(e,t,f){const a=e.env,n=a.Backbone,o=a.Promise,r=a.Strophe,s=(a.SHA1,a._),c=a.$iq,i=(a.$build,a.b64_sha1),u=a.moment;a.sizzle,e.env.utils,e.plugins.add("converse-vcard",{initialize(){const e=this._converse;function a(e,f,a,n){const o=a.querySelector("vCard");let r={};if(s.isNull(o)||(r={stanza:a,fullname:s.get(o.querySelector("FN"),"textContent"),nickname:s.get(o.querySelector("NICKNAME"),"textContent"),image:s.get(o.querySelector("PHOTO BINVAL"),"textContent"),image_type:s.get(o.querySelector("PHOTO TYPE"),"textContent"),url:s.get(o.querySelector("URL"),"textContent"),role:s.get(o.querySelector("ROLE"),"textContent"),email:s.get(o.querySelector("EMAIL USERID"),"textContent")}),r.image){const e=t.enc.Base64.parse(r.image);r.image_hash=t.SHA1(e).toString()}n&&n(r)}function _(e,t,f,a){a&&a({stanza:f,jid:t})}function d(e,t,f){const a=c(t?{type:e,to:t}:{type:e});return f?a.cnode(f):a.c("vCard",{xmlns:r.NS.VCARD}),a}function l(e,t){return t=r.getBareJidFromJid(t)===e.bare_jid?null:t,new o((f,n)=>{e.connection.sendIQ(d("get",t),s.partial(a,e,t,s,f),s.partial(_,e,t,s,f),5e3)})}e.VCard=n.Model.extend({defaults:{image:e.DEFAULT_IMAGE,image_type:e.DEFAULT_IMAGE_TYPE},set(t,f,a){let o;return"object"==typeof t?(o=t,a=f):(o={})[t]=f,s.has(o,"image")&&!o.image?(o.image=e.DEFAULT_IMAGE,o.image_type=e.DEFAULT_IMAGE_TYPE,n.Model.prototype.set.call(this,o,a)):n.Model.prototype.set.apply(this,arguments)}}),e.VCards=n.Collection.extend({model:e.VCard,initialize(){this.on("add",t=>e.api.vcard.update(t))}}),e.initVCardCollection=function(){e.vcards=new e.VCards,e.vcards.browserStorage=new n.BrowserStorage[e.storage](i("converse.vcards")),e.vcards.fetch()},e.api.listen.on("connectionInitialized",e.initVCardCollection),e.on("addClientFeatures",()=>{e.api.disco.own.features.add(r.NS.VCARD)}),s.extend(e.api,{vcard:{set:function(t){return new o((a,n)=>{const o=r.xmlHtmlNode(f(t)).firstElementChild;e.connection.sendIQ(d("set",t.jid,o),a,n)})},get(t,f){if(s.isString(t))return l(e,t);if(!t.get("vcard_updated")||f){const f=t.get("jid")||t.get("muc_jid");if(!f)throw new Error("No JID to get vcard for!");return l(e,f)}return o.resolve({})},update(e,t){return new o((f,a)=>{this.get(e,t).then(t=>{e.save(s.extend(s.pick(t,["fullname","nickname","email","url","role","image_type","image","image_hash"]),{vcard_updated:u().format()})),f()})})}}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t){!function(){var t=function(e,f){var a=this;this.isOpened=!1,this.input=n(e),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),f=f||{},function(e,t,f){for(var a in t){var n=t[a],o=e.input.getAttribute("data-"+a.toLowerCase());"number"==typeof n?e[a]=parseInt(o):!1===n?e[a]=null!==o:n instanceof Function?e[a]=null:e[a]=o,e[a]||0===e[a]||(e[a]=a in f?f[a]:n)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:!1!==f.sort&&t.SORT_BYLENGTH,item:t.ITEM,replace:t.REPLACE},f),this.index=-1,this.container=n.create("div",{className:"awesomplete",around:e}),this.ul=n.create("ul",{hidden:"hidden",inside:this.container}),this.status=n.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-relevant":"additions",inside:this.container}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(e){var t=e.keyCode;a.opened&&(13===t&&a.selected?(e.preventDefault(),a.select()):27===t?a.close({reason:"esc"}):38!==t&&40!==t||(e.preventDefault(),a[38===t?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(e){var t=e.target;if(t!==this){for(;t&&!/li/i.test(t.nodeName);)t=t.parentNode;t&&0===e.button&&(e.preventDefault(),a.select(t,e.target))}}}},n.bind(this.input,this._events.input),n.bind(this.input.form,this._events.form),n.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||f.list||[],t.all.push(this)};function f(e){var t=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=t.label||t.value,this.value=t.value}t.prototype={set list(e){if(Array.isArray(e))this._list=e;else if("string"==typeof e&&e.indexOf(",")>-1)this._list=e.split(/\s*,\s*/);else if((e=n(e))&&e.children){var t=[];a.apply(e.children).forEach(function(e){if(!e.disabled){var f=e.textContent.trim(),a=e.value||f,n=e.label||f;""!==a&&t.push({label:n,value:a})}}),this._list=t}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(e){this.opened&&(this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,n.fire(this.input,"awesomplete-close",e||{}))},open:function(){this.ul.removeAttribute("hidden"),this.isOpened=!0,this.autoFirst&&-1===this.index&&this.goto(0),n.fire(this.input,"awesomplete-open")},destroy:function(){n.unbind(this.input,this._events.input),n.unbind(this.input.form,this._events.form);var e=this.container.parentNode;e.insertBefore(this.input,this.container),e.removeChild(this.container),this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var f=t.all.indexOf(this);-1!==f&&t.all.splice(f,1)},next:function(){var e=this.ul.children.length;this.goto(this.index-1&&t.length>0&&(t[e].setAttribute("aria-selected","true"),this.status.textContent=t[e].textContent,this.ul.scrollTop=t[e].offsetTop-this.ul.clientHeight+t[e].clientHeight,n.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(e,t){if(e?this.index=n.siblingIndex(e):e=this.ul.children[this.index],e){var f=this.suggestions[this.index];n.fire(this.input,"awesomplete-select",{text:f,origin:t||e})&&(this.replace(f),this.close({reason:"select"}),n.fire(this.input,"awesomplete-selectcomplete",{text:f}))}},evaluate:function(){var e=this,t=this.input.value;t.length>=this.minChars&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(a){return new f(e.data(a,t))}).filter(function(f){return e.filter(f,t)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(f){e.ul.appendChild(e.item(f,t))}),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):this.close({reason:"nomatches"})}},t.all=[],t.FILTER_CONTAINS=function(e,t){return RegExp(n.regExpEscape(t.trim()),"i").test(e)},t.FILTER_STARTSWITH=function(e,t){return RegExp("^"+n.regExpEscape(t.trim()),"i").test(e)},t.SORT_BYLENGTH=function(e,t){return e.length!==t.length?e.length-t.length:e * @license BSD-3-Clause * @version 3.6.1 */ !function(t){var f=/^(b|B)$/,a={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function o(e){var t,o,r,s,c,i,u,_,d,l,h,m,g,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},b=[],y=0,v=void 0,w=void 0;if(isNaN(e))throw new Error("Invalid arguments");return o=!0===p.bits,d=!0===p.unix,t=p.base||2,_=void 0!==p.round?p.round:d?1:2,l=void 0!==p.separator&&p.separator||"",h=void 0!==p.spacer?p.spacer:d?"":" ",g=p.symbols||p.suffixes||{},m=2===t&&p.standard||"jedec",u=p.output||"string",s=!0===p.fullform,c=p.fullforms instanceof Array?p.fullforms:[],v=void 0!==p.exponent?p.exponent:-1,i=(w=Number(e))<0,r=t>2?1e3:1024,i&&(w=-w),(-1===v||isNaN(v))&&(v=Math.floor(Math.log(w)/Math.log(r)))<0&&(v=0),v>8&&(v=8),0===w?(b[0]=0,b[1]=d?"":a[m][o?"bits":"bytes"][v]):(y=w/(2===t?Math.pow(2,10*v):Math.pow(1e3,v)),o&&(y*=8)>=r&&v<8&&(y/=r,v++),b[0]=Number(y.toFixed(v>0?_:0)),b[1]=10===t&&1===v?o?"kb":"kB":a[m][o?"bits":"bytes"][v],d&&(b[1]="jedec"===m?b[1].charAt(0):v>0?b[1].replace(/B$/,""):b[1],f.test(b[1])&&(b[0]=Math.floor(b[0]),b[1]=""))),i&&(b[0]=-b[0]),b[1]=g[b[1]]||b[1],"array"===u?b:"exponent"===u?v:"object"===u?{value:b[0],suffix:b[1],symbol:b[1]}:(s&&(b[1]=c[v]?c[v]:n[m][v]+(o?"bit":"byte")+(1===b[0]?"":"s")),l.length>0&&(b[0]=b[0].toString().replace(".",l)),b.join(h))}o.partial=function(e){return function(t){return o(t,e)}},e.exports=o}("undefined"!=typeof window&&window)}).call(this,f(5))},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(13),f(50),f(230),f(20),f(21)],void 0===(o="function"==typeof(a=function(e,t,f,a){const n=e.env,o=n.$msg,r=n.Backbone,s=n.Promise,c=n.Strophe,i=n.b64_sha1,u=n.moment,_=n.sizzle,d=n.utils,l=n._,h=e.env.utils;return e.plugins.add("converse-chatboxes",{dependencies:["converse-roster","converse-vcard"],overrides:{disconnect:function(){return this.__super__._converse.chatboxviews.closeAllChatBoxes(),this.__super__.disconnect.apply(this,arguments)},logOut:function(){return this.__super__._converse.chatboxviews.closeAllChatBoxes(),this.__super__.logOut.apply(this,arguments)},initStatus:function(e){const t=this.__super__._converse;return e||t.chatboxviews.closeAllChatBoxes(),this.__super__.initStatus.apply(this,arguments)}},initialize(){const n=this._converse,m=n.__;n.api.settings.update({auto_join_private_chats:[]}),n.api.promises.add(["chatBoxesFetched","chatBoxesInitialized","privateChatsAutoJoined"]),n.router.route("converse/chat?jid=:jid",function(e){if(!d.isValidJID(e))return n.log(`Invalid JID "${e}" provided in URL fragment`,c.LogLevel.WARN);s.all([n.api.waitUntil("rosterContactsFetched"),n.api.waitUntil("chatBoxesFetched")]).then(()=>{n.api.chats.open(e)})}),n.Message=r.Model.extend({defaults:()=>({msgid:n.connection.getUniqueId(),time:u().format()}),initialize(){this.setVCard(),this.get("file")&&(this.on("change:put",this.uploadFile,this),l.includes([n.SUCCESS,n.FAILURE],this.get("upload"))||this.getRequestSlotURL()),this.isOnlyChatStateNotification()&&window.setTimeout(this.destroy.bind(this),2e4)},getVCardForChatroomOccupant(){const e=this.collection.chatbox,t=c.getResourceFromJid(this.get("from"));if(e.get("nick")===t)return n.xmppstatus.vcard;{let f;if(this.get("vcard_jid")&&(f=n.vcards.findWhere({jid:this.get("vcard_jid")})),!f){let a;const o=e.occupants.findWhere({nick:t});o&&o.get("jid")?(a=o.get("jid"),this.save({vcard_jid:a},{silent:!0})):a=this.get("from"),f=n.vcards.findWhere({jid:a})||n.vcards.create({jid:a})}return f}},setVCard(){if("groupchat"===this.get("type"))this.vcard=this.getVCardForChatroomOccupant();else{const e=this.get("from");this.vcard=n.vcards.findWhere({jid:e})||n.vcards.create({jid:e})}},isOnlyChatStateNotification(){return h.isOnlyChatStateNotification(this)},getDisplayName(){return"groupchat"===this.get("type")?this.get("nick"):this.vcard.get("fullname")||this.get("from")},sendSlotRequestStanza(){const t=this.get("file");return new s((f,a)=>{const o=e.env.$iq({from:n.jid,to:this.get("slot_request_url"),type:"get"}).c("request",{xmlns:c.NS.HTTPUPLOAD,filename:t.name,size:t.size,"content-type":t.type});n.connection.sendIQ(o,f,a)})},getRequestSlotURL(){this.sendSlotRequestStanza().then(e=>{const t=e.querySelector("slot");if(!t)return this.save({type:"error",message:m("Sorry, could not determine file upload URL.")});this.save({get:t.querySelector("get").getAttribute("url"),put:t.querySelector("put").getAttribute("url")})}).catch(e=>(n.log(e,c.LogLevel.ERROR),this.save({type:"error",message:m("Sorry, could not determine upload URL.")})))},uploadFile(){const e=new XMLHttpRequest;e.onreadystatechange=(()=>{e.readyState===XMLHttpRequest.DONE&&(n.log("Status: "+e.status,c.LogLevel.INFO),200===e.status||201===e.status?this.save({upload:n.SUCCESS,oob_url:this.get("get"),message:this.get("get")}):e.onerror())}),e.upload.addEventListener("progress",e=>{e.lengthComputable&&this.set("progress",e.loaded/e.total)},!1),e.onerror=(()=>{let t=m("Sorry, could not succesfully upload your file.");e.responseText&&(t+=" "+m('Your server\'s response: "%1$s"',e.responseText)),this.save({type:"error",upload:n.FAILURE,message:t})}),e.open("PUT",this.get("put"),!0),e.setRequestHeader("Content-type","application/octet-stream"),e.send(this.get("file"))}}),n.Messages=r.Collection.extend({model:n.Message,comparator:"time"}),n.ChatBox=n.ModelWithVCardAndPresence.extend({defaults:{bookmarked:!1,chat_state:void 0,num_unread:0,type:"chatbox",message_type:"chat",url:""},initialize(){n.ModelWithVCardAndPresence.prototype.initialize.apply(this,arguments),n.api.waitUntil("rosterContactsFetched").then(()=>{this.addRelatedContact(n.roster.findWhere({jid:this.get("jid")}))}),this.messages=new n.Messages,this.messages.browserStorage=new r.BrowserStorage[n.storage](i(`converse.messages${this.get("jid")}${n.bare_jid}`)),this.messages.chatbox=this,this.messages.on("change:upload",e=>{e.get("upload")===n.SUCCESS&&this.sendMessageStanza(e)}),this.on("change:chat_state",this.sendChatState,this),this.save({box_id:i(this.get("jid")),time_opened:this.get("time_opened")||u().valueOf(),user_id:c.getNodeFromJid(this.get("jid"))})},addRelatedContact(e){l.isUndefined(e)||(this.contact=e,this.trigger("contactAdded",e))},getDisplayName(){return this.vcard.get("fullname")||this.get("jid")},createMessageStanza(e){const t=o({from:n.connection.jid,to:this.get("jid"),type:this.get("message_type"),id:e.get("msgid")}).c("body").t(e.get("message")).up().c(n.ACTIVE,{xmlns:c.NS.CHATSTATES}).up();return e.get("is_spoiler")&&(e.get("spoiler_hint")?t.c("spoiler",{xmlns:c.NS.SPOILER},e.get("spoiler_hint")).up():t.c("spoiler",{xmlns:c.NS.SPOILER}).up()),e.get("file")&&t.c("x",{xmlns:c.NS.OUTOFBAND}).c("url").t(e.get("message")).up(),t},sendMessageStanza(e){const t=this.createMessageStanza(e);n.connection.send(t),n.forward_messages&&n.connection.send(o({to:n.bare_jid,type:this.get("message_type"),id:e.get("msgid")}).c("forwarded",{xmlns:c.NS.FORWARD}).c("delay",{xmns:c.NS.DELAY,stamp:u().format()}).up().cnode(t.tree()))},getOutgoingMessageAttributes(e,f){const a=n.xmppstatus.get("fullname"),o=this.get("composing_spoiler");return{fullname:a,from:n.bare_jid,sender:"me",time:u().format(),message:e?h.httpToGeoUri(t.shortnameToUnicode(e),n):void 0,is_spoiler:o,spoiler_hint:o?f:void 0}},sendMessage(e){this.sendMessageStanza(this.messages.create(e))},sendChatState(){n.connection.send(o({to:this.get("jid"),type:"chat"}).c(this.get("chat_state"),{xmlns:c.NS.CHATSTATES}).up().c("no-store",{xmlns:c.NS.HINTS}).up().c("no-permanent-store",{xmlns:c.NS.HINTS}))},sendFiles(e){n.api.disco.supports(c.NS.HTTPUPLOAD,n.domain).then(t=>{const a=t.pop(),n=a.dataforms.where({FORM_TYPE:{value:c.NS.HTTPUPLOAD,type:"hidden"}}).pop(),o=window.parseInt(l.get(n,"attributes.max-file-size.value")),r=l.get(a,"id");r?l.each(e,e=>{if(!window.isNaN(o)&&window.parseInt(e.size)>o)return this.messages.create({message:m("The size of your file, %1$s, exceeds the maximum allowed by your server, which is %2$s.",e.name,f(o)),type:"error"});this.messages.create(l.extend(this.getOutgoingMessageAttributes(),{file:e,progress:0,slot_request_url:r,type:this.get("message_type")}))}):this.messages.create({message:m("Sorry, looks like file upload is not supported by your server."),type:"error"})}).catch(l.partial(n.log,l,c.LogLevel.FATAL))},getMessageBody:e=>"error"===e.getAttribute("type")?l.propertyOf(e.querySelector("error text"))("textContent"):l.propertyOf(e.querySelector("body"))("textContent"),getMessageAttributesFromStanza(e,t,f){t=t||e.querySelector("delay");const a=this.__super__._converse,n=(a.__,e.querySelector(`spoiler[xmlns="${c.NS.SPOILER}"]`)),o=e.getElementsByTagName(a.COMPOSING).length&&a.COMPOSING||e.getElementsByTagName(a.PAUSED).length&&a.PAUSED||e.getElementsByTagName(a.INACTIVE).length&&a.INACTIVE||e.getElementsByTagName(a.ACTIVE).length&&a.ACTIVE||e.getElementsByTagName(a.GONE).length&&a.GONE,r={type:e.getAttribute("type"),chat_state:o,delayed:!l.isNull(t),message:this.getMessageBody(e)||void 0,msgid:e.getAttribute("id"),time:t?t.getAttribute("stamp"):u().format(),is_spoiler:!l.isNull(n)};return"groupchat"===r.type?(r.from=e.getAttribute("from"),r.nick=c.unescapeNode(c.getResourceFromJid(r.from)),r.from===this.get("nick")?r.sender="me":r.sender="them"):(r.from=c.getBareJidFromJid(e.getAttribute("from")),r.from===a.bare_jid?(r.sender="me",r.fullname=a.xmppstatus.get("fullname")):(r.sender="them",r.fullname=this.get("fullname"))),l.each(_(`x[xmlns="${c.NS.OUTOFBAND}"]`,e),e=>{r.oob_url=e.querySelector("url").textContent,r.oob_desc=e.querySelector("url").textContent}),n&&(r.spoiler_hint=n.textContent.length>0?n.textContent:""),r},createMessage(e,t,f){const a=this.getMessageAttributesFromStanza.apply(this,arguments),n=h.isOnlyChatStateNotification(a);return n&&a.delayed?void 0:n||a.file||a.message||a.oob_url||"error"===a.type?this.messages.create(a):void 0},newMessageWillBeHidden(){return this.get("hidden")||this.get("minimized")||this.isScrolledUp()||"hidden"===n.windowState},incrementUnreadMsgCounter(e){l.isNull(e.querySelector("body"))||d.isNewMessage(e)&&this.newMessageWillBeHidden()&&(this.save({num_unread:this.get("num_unread")+1}),n.incrementMsgCounter())},clearUnreadMsgCounter(){h.safeSave(this,{num_unread:0})},isScrolledUp(){return this.get("scrolled",!0)}}),n.ChatBoxes=r.Collection.extend({comparator:"time_opened",model:(e,t)=>new n.ChatBox(e,t),registerMessageHandler(){n.connection.addHandler(this.onMessage.bind(this),null,"message","chat"),n.connection.addHandler(this.onErrorMessage.bind(this),null,"message","error")},chatBoxMayBeShown:e=>!0,onChatBoxesFetched(e){e.each(e=>{this.chatBoxMayBeShown(e)&&e.trigger("show")}),n.emit("chatBoxesFetched")},onConnected(){this.browserStorage=new r.BrowserStorage[n.storage](i(`converse.chatboxes-${n.bare_jid}`)),this.registerMessageHandler(),this.fetch({add:!0,success:this.onChatBoxesFetched.bind(this)})},onErrorMessage(e){const t=c.getBareJidFromJid(e.getAttribute("from"));if(d.isSameBareJID(t,n.bare_jid))return!0;const f=this.getChatBox(t);return!f||(f.createMessage(e,null,e),!0)},onMessage(e){let t,f,a,o=e.getAttribute("from"),r=e.getAttribute("to");const s=e,i=c.getResourceFromJid(r),u=!l.isNull(e.querySelector(`received[xmlns="${c.NS.CARBONS}"]`));if(n.filter_by_resource&&i&&i!==n.resource)return n.log(`onMessage: Ignoring incoming message intended for a different resource: ${r}`,c.LogLevel.INFO),!0;if(d.isHeadlineMessage(n,e))return n.log(`onMessage: Ignoring incoming headline message sent with type 'chat' from JID: ${o}`,c.LogLevel.INFO),!0;const _=e.querySelector("forwarded");if(!l.isNull(_)){const t=_.querySelector("message"),a=t.getAttribute("from");if(u&&c.getBareJidFromJid(a)!==o)return!0;e=t,f=_.querySelector("delay"),o=e.getAttribute("from"),r=e.getAttribute("to")}const h=c.getBareJidFromJid(o),m=c.getResourceFromJid(o);h===n.bare_jid?(t=c.getBareJidFromJid(r),a=c.getResourceFromJid(r)):(t=h,a=m);const g={fullname:l.get(n.api.contacts.get(t),"attributes.fullname")},p=this.getChatBox(t,g,!l.isNull(e.querySelector("body"))),b=e.getAttribute("id");if(p){const t=b&&p.messages.findWhere({msgid:b})||[];l.isEmpty(t)&&(p.incrementUnreadMsgCounter(s),p.createMessage(e,f,s))}return n.emit("message",{stanza:s,chatbox:p}),!0},getChatBox(e,t={},f){l.isObject(e)&&(f=t,e=(t=e).jid),e=c.getBareJidFromJid(e.toLowerCase());let a=this.get(c.getBareJidFromJid(e));return!a&&f&&(l.extend(t,{jid:e,id:e}),a=this.create(t,{error(e,t){n.log(t.responseText)}})),a}}),n.ChatBoxViews=r.Overview.extend({_ensureElement(){if(this.el)this.setElement(l.result(this,"el"),!1);else{let e=n.root.querySelector("#conversejs");if(l.isNull(e)){(e=document.createElement("div")).setAttribute("id","conversejs");const t=n.root.querySelector("body");t?t.appendChild(e):n.root.appendChild(e)}l.includes(["mobile","fullscreen"],n.view_mode)&&e.classList.add("fullscreen"),e.innerHTML="",this.setElement(e,!1)}},initialize(){this.model.on("add",this.onChatBoxAdded,this),this.model.on("destroy",this.removeChat,this),this.el.classList.add(`converse-${n.view_mode}`),this.render()},render(){try{this.el.innerHTML=a()}catch(e){this._ensureElement(),this.el.innerHTML=a()}this.row_el=this.el.querySelector(".row")},insertRowColumn(e){this.row_el.insertAdjacentElement("afterBegin",e)},onChatBoxAdded(e){return this.get(e.get("id"))},removeChat(e){this.remove(e.get("id"))},closeAllChatBoxes(){return this.each(function(e){e.close()}),this},chatBoxMayBeShown(e){return this.model.chatBoxMayBeShown(e)}}),n.getViewForChatBox=function(e){if(e)return n.chatboxviews.get(e.get("id"))},n.on("chatBoxesFetched",function(){l.each(n.auto_join_private_chats,function(e){n.chatboxes.where({jid:e}).length||(l.isString(e)?n.api.chats.open(e):n.log('Invalid jid criteria specified for "auto_join_private_chats"',c.LogLevel.ERROR))}),n.emit("privateChatsAutoJoined")}),n.api.waitUntil("rosterContactsFetched").then(()=>{n.roster.on("add",e=>{const t=n.chatboxes.findWhere({jid:e.get("jid")});t&&t.addRelatedContact(e)})}),n.on("addClientFeatures",()=>{n.api.disco.own.features.add(c.NS.HTTPUPLOAD),n.api.disco.own.features.add(c.NS.OUTOFBAND)}),n.api.listen.on("pluginsInitialized",()=>{n.chatboxes=new n.ChatBoxes,n.chatboxviews=new n.ChatBoxViews({model:n.chatboxes}),n.emit("chatBoxesInitialized")}),n.api.listen.on("beforeTearDown",()=>{n.chatboxes.remove(),delete n.chatboxes.browserStorage}),n.api.listen.on("presencesInitialized",()=>n.chatboxes.onConnected()),l.extend(n.api,{chats:{create(e,t){if(l.isUndefined(e))return n.log("chats.create: You need to provide at least one JID",c.LogLevel.ERROR),null;if(l.isString(e)){t&&!l.get(t,"fullname")&&(t.fullname=l.get(n.api.contacts.get(e),"attributes.fullname"));const f=n.chatboxes.getChatBox(e,t,!0);return l.isNil(f)?void n.log("Could not open chatbox for JID: "+e,c.LogLevel.ERROR):f}return l.map(e,e=>(t.fullname=l.get(n.api.contacts.get(e),"attributes.fullname"),n.chatboxes.getChatBox(e,t,!0).trigger("show")))},open(e,t){if(l.isUndefined(e))return n.log("chats.open: You need to provide at least one JID",c.LogLevel.ERROR),null;if(l.isString(e)){const f=n.api.chats.create(e,t);return f.trigger("show"),f}return l.map(e,e=>n.api.chats.create(e,t).trigger("show"))},get(e){if(l.isUndefined(e)){const e=[];return n.chatboxes.each(function(t){"chatroom"!==t.get("type")&&e.push(t)}),e}return l.isString(e)?n.chatboxes.getChatBox(e):l.map(e,l.partial(n.chatboxes.getChatBox.bind(n.chatboxes),l,{},!0))}}})}}),e})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){f(1);e.exports=function(e){var t="";Array.prototype.join;return t+='\x3c!-- src/templates/chatbox.html --\x3e\n
\n
\n
\n \n **'+f(e.username)+'\n \n

\x3c!-- message gets added here via renderMessage --\x3e

\n
\n'}},function(e,t,f){var a;!function e(t,f,n){function o(s,c){if(!f[s]){if(!t[s]){if(!c&&("function"==typeof a&&a))return a(s,!0);if(r)return r(s,!0);var i=new Error("Cannot find module '"+s+"'");throw i.code="MODULE_NOT_FOUND",i}var u=f[s]={exports:{}};t[s][0].call(u.exports,function(e){var f=t[s][1][e];return o(f||e)},u,u.exports,e,t,f,n)}return f[s].exports}for(var r="function"==typeof a&&a,s=0;s/g,_=/"/g,d=/"/g,l=/&#([a-zA-Z0-9]*);?/gim,h=/:?/gim,m=/&newline;?/gim,g=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,p=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,b=/u\s*r\s*l\s*\(.*/gi;function y(e){return e.replace(_,""")}function v(e){return e.replace(d,'"')}function w(e){return e.replace(l,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function k(e){return e.replace(h,":").replace(m," ")}function M(e){for(var t="",f=0,a=e.length;f/g;f.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","loop","preload","src","height","width"]},f.getDefaultWhiteList=r,f.onTag=function(e,t,f){},f.onIgnoreTag=function(e,t,f){},f.onTagAttr=function(e,t,f){},f.onIgnoreTagAttr=function(e,t,f){},f.safeAttrValue=function(e,t,f,a){if(f=L(f),"href"===t||"src"===t){if("#"===(f=o.trim(f)))return"#";if("http://"!==f.substr(0,7)&&"https://"!==f.substr(0,8)&&"mailto:"!==f.substr(0,7)&&"tel:"!==f.substr(0,4)&&"#"!==f[0]&&"/"!==f[0])return""}else if("background"===t){if(g.lastIndex=0,g.test(f))return""}else if("style"===t){if(p.lastIndex=0,p.test(f))return"";if(b.lastIndex=0,b.test(f)&&(g.lastIndex=0,g.test(f)))return"";!1!==a&&(f=(a=a||s).process(f))}return f=x(f)},f.escapeHtml=c,f.escapeQuote=y,f.unescapeQuote=v,f.escapeHtmlEntities=w,f.escapeDangerHtml5Entities=k,f.clearNonPrintableCharacter=M,f.friendlyAttrValue=L,f.escapeAttrValue=x,f.onIgnoreTagStripAll=function(){return""},f.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var f=!Array.isArray(e),a=[],n=!1;return{onIgnoreTag:function(r,s,c){if(function(t){return!!f||-1!==o.indexOf(e,t)}(r)){if(c.isClosing){var i="[/removed]",u=c.position+i.length;return a.push([!1!==n?n:c.position,u]),n=!1,i}return n||(n=c.position),"[removed]"}return t(r,s,c)},remove:function(e){var t="",f=0;return o.forEach(a,function(a){t+=e.slice(f,a[0]),f=a[1]}),t+=e.slice(f)}}},f.stripCommentTag=function(e){return e.replace(S,"")},f.stripBlankChar=function(e){var t=e.split("");return(t=t.filter(function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)})).join("")},f.cssFilter=s,f.getDefaultCSSWhiteList=n},{"./util":4,cssfilter:8}],2:[function(e,t,f){var a=e("./default"),n=e("./parser"),o=e("./xss");for(var r in(f=t.exports=function(e,t){return new o(t).process(e)}).FilterXSS=o,a)f[r]=a[r];for(var r in n)f[r]=n[r];"undefined"!=typeof window&&(window.filterXSS=t.exports)},{"./default":1,"./parser":3,"./xss":5}],3:[function(e,t,f){var a=e("./util");function n(e){var t=a.spaceIndex(e);if(-1===t)var f=e.slice(1,-1);else f=e.slice(1,t+1);return"/"===(f=a.trim(f).toLowerCase()).slice(0,1)&&(f=f.slice(1)),"/"===f.slice(-1)&&(f=f.slice(0,-1)),f}function o(e){return"0;t--){var f=e[t];if(" "!==f)return"="===f?t:-1}}function i(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}f.parseTag=function(e,t,f){"user strict";var a="",r=0,s=!1,c=!1,i=0,u=e.length,_="",d="";for(i=0;i"===l){a+=f(e.slice(r,s)),_=n(d=e.slice(s,i+1)),a+=t(s,a.length,_,d,o(d)),r=i+1,s=!1;continue}if(('"'===l||"'"===l)&&"="===e.charAt(i-1)){c=l;continue}}else if(l===c){c=!1;continue}}return r";var b=function(e){var t=c.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var f="/"===(e=c.trim(e.slice(t+1,-1)))[e.length-1];return f&&(e=c.trim(e.slice(0,-1))),{html:e,closing:f}}(r),y=f[n],v=s(b.html,function(e,t){var f,a=-1!==c.indexOf(y,e);return i(f=u(n,e,t,a))?a?(t=d(n,e,t,h))?e+'="'+t+'"':e:i(f=_(n,e,t,a))?void 0:f:f});r="<"+n;return v&&(r+=" "+v),b.closing&&(r+=" /"),r+=">"}return i(g=o(n,r,p))?l(r):g},l);return m&&(g=m.remove(g)),g},t.exports=u},{"./default":1,"./parser":3,"./util":4,cssfilter:8}],6:[function(e,t,f){var a=e("./default"),n=e("./parser");e("./util");function o(e){return void 0===e||null===e}function r(e){(e=function(e){var t={};for(var f in e)t[f]=e[f];return t}(e||{})).whiteList=e.whiteList||a.whiteList,e.onAttr=e.onAttr||a.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||a.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||a.safeAttrValue,this.options=e}r.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,f=t.whiteList,a=t.onAttr,r=t.onIgnoreAttr,s=t.safeAttrValue;return n(e,function(e,t,n,c,i){var u=f[n],_=!1;if(!0===u?_=u:"function"==typeof u?_=u(c):u instanceof RegExp&&(_=u.test(c)),!0!==_&&(_=!1),c=s(n,c)){var d,l={position:t,sourcePosition:e,source:i,isWhite:_};return _?o(d=a(n,c,l))?n+":"+c:d:o(d=r(n,c,l))?void 0:d}})},t.exports=r},{"./default":7,"./parser":9,"./util":10}],7:[function(e,t,f){function a(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var n=/javascript\s*\:/gim;f.whiteList=a(),f.getDefaultWhiteList=a,f.onAttr=function(e,t,f){},f.onIgnoreAttr=function(e,t,f){},f.safeAttrValue=function(e,t){return n.test(t)?"":t}},{}],8:[function(e,t,f){var a=e("./default"),n=e("./css");for(var o in(f=t.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,a)f[o]=a[o];"undefined"!=typeof window&&(window.filterCSS=t.exports)},{"./css":6,"./default":7}],9:[function(e,t,f){var a=e("./util");t.exports=function(e,t){";"!==(e=a.trimRight(e))[e.length-1]&&(e+=";");var f=e.length,n=!1,o=0,r=0,s="";function c(){if(!n){var f=a.trim(e.slice(o,r)),c=f.indexOf(":");if(-1!==c){var i=a.trim(f.slice(0,c)),u=a.trim(f.slice(c+1));if(i){var _=t(o,s.length,i,u,f);_&&(s+=_+"; ")}}}o=r+1}for(;rf[o.indexOf(n,e)]);return e||(s=s.concat(o.filter(f,function(e){const t=o.indexOf(r,e.jid);return t>=0&&e.affiliation!==a[t].affiliation}))),t&&(s=s.concat(o.map(o.difference(r,n),e=>({jid:e,affiliation:"none"})))),s},t.parseMemberListIQ=function(e){return o.map(n(`query[xmlns="${a.NS.MUC_ADMIN}"] item`,e),e=>{const f={affiliation:e.getAttribute("affiliation")},a=e.getAttribute("jid");t.isValidJID(a)?f.jid=a:f.nick=a;const n=e.getAttribute("nick");n&&(f.nick=n);const o=e.getAttribute("role");return o&&(f.role=n),f})},t.marshallAffiliationIQs=function(){return o.flatMap(arguments[0],t.parseMemberListIQ)}})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a,n,o,r=r||{};r.nativeview=f(14),n=[f(254),f(253),f(252),f(248),f(251),f(250),f(249),f(8),f(4)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c){"use strict";var i=new DOMParser,u=e.init([t.default,f.default,a.default,n.default,o.default]),_=s.isUndefined(c.NativeView)?c.View:c.NativeView;return c.VDOMView=_.extend({updateEventListeners:function(e,t){this.setElement(t.elm)},render:function(){s.isFunction(this.beforeRender)&&this.beforeRender();var e=r.toVNode(function(e){if("string"!=typeof e)throw new Error("Invalid parameter type in parseHTMLToDOM");if(!("DOMParser"in window))throw new Error("DOMParser is not available, so parsing string to DOM node is not possible.");if(!e)return document.createTextNode("");var t=(i=i||new DOMParser).parseFromString(e,"text/html");return t.body.firstChild?t.getElementsByTagName("body")[0].firstChild:t.head.firstChild&&("TITLE"!==t.head.firstChild.tagName||t.title)?t.head.firstChild:t.firstChild&&"HTML"!==t.firstChild.tagName?t.firstChild:document.createTextNode("")}(this.toHTML()));return e.data.hook=s.extend({create:this.updateEventListeners.bind(this),update:this.updateEventListeners.bind(this)}),(this.vnode?this.vnode.elm:this.el).outerHTML!==e.elm.outerHTML&&(this.vnode=u(this.vnode||this.el,e)),s.isFunction(this.afterRender)&&this.afterRender(),this}}),c.VDOMView})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(9)],void 0===(o="function"==typeof(a=function(e,t){const f=e.env,a=f.Backbone,n=f.Promise,o=f.Strophe,r=f.$iq,s=f.b64_sha1,c=f.utils,i=f._,u=f.f;e.plugins.add("converse-disco",{initialize(){const e=this._converse;function f(){e.api.disco.own.identities.add("client","web","Converse.js"),e.api.disco.own.features.add(o.NS.BOSH),e.api.disco.own.features.add(o.NS.CHATSTATES),e.api.disco.own.features.add(o.NS.DISCO_INFO),e.api.disco.own.features.add(o.NS.ROSTERX),e.message_carbons&&e.api.disco.own.features.add(o.NS.CARBONS),e.emit("addClientFeatures"),e.connection.addHandler(d,o.NS.DISCO_INFO,"iq","get",null,null),e.disco_entities=new e.DiscoEntities,e.disco_entities.browserStorage=new a.BrowserStorage[e.storage](s(`converse.disco-entities-${e.bare_jid}`)),e.disco_entities.fetchEntities().then(t=>{0!==t.length&&t.get(e.domain)||e.disco_entities.create({jid:e.domain}),e.emit("discoInitialized")}).catch(i.partial(e.log,i,o.LogLevel.FATAL))}e.api.promises.add("discoInitialized"),e.DiscoEntity=a.Model.extend({idAttribute:"jid",initialize(){this.waitUntilFeaturesDiscovered=c.getResolveablePromise(),this.dataforms=new a.Collection,this.dataforms.browserStorage=new a.BrowserStorage[e.storage](s("converse.dataforms-{this.get('jid')}")),this.features=new a.Collection,this.features.browserStorage=new a.BrowserStorage[e.storage](s(`converse.features-${this.get("jid")}`)),this.features.on("add",this.onFeatureAdded,this),this.identities=new a.Collection,this.identities.browserStorage=new a.BrowserStorage[e.storage](s(`converse.identities-${this.get("jid")}`)),this.fetchFeatures(),this.items=new e.DiscoEntities,this.items.browserStorage=new a.BrowserStorage[e.storage](s(`converse.disco-items-${this.get("jid")}`)),this.items.fetch()},getIdentity(t,f){const a=this;return new n((n,r)=>{a.waitUntilFeaturesDiscovered.then(function(){const e=a.identities.findWhere({category:t,type:f});n(e)}).catch(i.partial(e.log,i,o.LogLevel.FATAL))})},hasFeature(t){const f=this;return new n((a,n)=>{f.waitUntilFeaturesDiscovered.then(function(){f.features.findWhere({var:t})?a(f):a()}).catch(i.partial(e.log,i,o.LogLevel.FATAL))})},onFeatureAdded(t){t.entity=this,e.emit("serviceDiscovered",t)},fetchFeatures(){0===this.features.browserStorage.records.length?this.queryInfo():(this.features.fetch({add:!0,success:()=>{this.waitUntilFeaturesDiscovered.resolve(),this.trigger("featuresDiscovered")}}),this.identities.fetch({add:!0}))},queryInfo(){e.api.disco.info(this.get("jid"),null,this.onInfo.bind(this))},onDiscoItems(e){i.each(t(`query[xmlns="${o.NS.DISCO_ITEMS}"] item`,e),e=>{if(e.getAttribute("node"))return;const t=e.getAttribute("jid");i.isUndefined(this.items.get(t))&&this.items.create({jid:t})})},queryForItems(){i.isEmpty(this.identities.where({category:"server"}))||e.api.disco.items(this.get("jid"),null,this.onDiscoItems.bind(this))},onInfo(e){i.forEach(e.querySelectorAll("identity"),e=>{this.identities.create({category:e.getAttribute("category"),type:e.getAttribute("type"),name:e.getAttribute("name")})}),i.each(t(`x[type="result"][xmlns="${o.NS.XFORM}"]`,e),e=>{const t={};i.each(e.querySelectorAll("field"),e=>{t[e.getAttribute("var")]={value:i.get(e.querySelector("value"),"textContent"),type:e.getAttribute("type")}}),this.dataforms.create(t)}),e.querySelector(`feature[var="${o.NS.DISCO_ITEMS}"]`)&&this.queryForItems(),i.forEach(e.querySelectorAll("feature"),t=>{this.features.create({var:t.getAttribute("var"),from:e.getAttribute("from")})}),this.waitUntilFeaturesDiscovered.resolve(),this.trigger("featuresDiscovered")}}),e.DiscoEntities=a.Collection.extend({model:e.DiscoEntity,fetchEntities(){return new n((e,t)=>{this.fetch({add:!0,success:e,error(){t(new Error("Could not fetch disco entities"))}})})}}),e.api.listen.on("reconnected",f),e.api.listen.on("connected",f),e.api.listen.on("beforeTearDown",()=>{e.disco_entities&&(e.disco_entities.each(e=>{e.features.reset(),e.features.browserStorage._clear()}),e.disco_entities.reset(),e.disco_entities.browserStorage._clear())});const _=this;function d(t){const f=t.getElementsByTagName("query")[0].getAttribute("node"),a={xmlns:o.NS.DISCO_INFO};f&&(a.node=f);const n=r({type:"result",id:t.getAttribute("id")}),s=t.getAttribute("from");return null!==s&&n.attrs({to:s}),i.each(_._identities,e=>{const t={category:e.category,type:e.type};e.name&&(t.name=e.name),e.lang&&(t["xml:lang"]=e.lang),n.c("identity",t).up()}),i.each(_._features,e=>{n.c("feature",{var:e}).up()}),e.connection.send(n.tree()),!0}_._identities=[],_._features=[],i.extend(e.api,{disco:{own:{identities:{add(e,t,f,a){for(var n=0;n<_._identities.length;n++)if(_._identities[n].category==e&&_._identities[n].type==t&&_._identities[n].name==f&&_._identities[n].lang==a)return!1;_._identities.push({category:e,type:t,name:f,lang:a})},clear(){_._identities=[]},get:()=>_._identities},features:{add(e){for(var t=0;t<_._features.length;t++)if(_._features[t]==e)return!1;_._features.push(e)},clear(){_._features=[]},get:()=>_._features}},info(t,f,a,n,s){const c={xmlns:o.NS.DISCO_INFO};f&&(c.node=f);const i=r({from:e.connection.jid,to:t,type:"get"}).c("query",c);e.connection.sendIQ(i,a,n,s)},items(t,f,a,n,s){const c={xmlns:o.NS.DISCO_ITEMS};f&&(c.node=f);const i=r({from:e.connection.jid,to:t,type:"get"}).c("query",c);e.connection.sendIQ(i,a,n,s)},entities:{get:(t,f=!1)=>e.api.waitUntil("discoInitialized").then(()=>{if(i.isNil(t))return e.disco_entities;const a=e.disco_entities.get(t);return a||!f?a:e.disco_entities.create({jid:t})})},supports(t,f){if(i.isNil(f))throw new TypeError("disco.supports: You need to provide an entity JID");return new n((a,o)=>e.api.waitUntil("discoInitialized").then(()=>{e.api.disco.entities.get(f,!0).then(e=>{e.waitUntilFeaturesDiscovered.then(()=>{const f=i.concat(e.items.map(e=>e.hasFeature(t)),e.hasFeature(t));n.all(f).then(e=>{a(u.filter(u.isObject,e))}).catch(o)}).catch(o)}).catch(o)}).catch(o)).catch(i.partial(e.log,i,o.LogLevel.FATAL))},getIdentity:(t,f,a)=>new n((n,o)=>{e.api.waitUntil("discoInitialized").then(()=>{e.api.disco.entities.get(a,!0).then(e=>n(e.getIdentity(t,f)))})}).catch(i.partial(e.log,i,o.LogLevel.FATAL))}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/form_input.html --\x3e\n
\n \n
\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/register_link.html --\x3e\n
\n ',e._converse.auto_login||"CONNECTING"===e._converse.CONNECTION_STATUS[e.connection_status]||(t+="\n

"+f(e.__("Don't have a chat account?"))+'

\n

\n "),t+="\n
\n"}},function(e,t,f){"use strict";var a,n,o;n=[f(21),f(2),f(59),f(168),f(167),f(165),f(166),f(58),f(19),f(10)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c){const i=t.env,u=i.Strophe,_=i.Backbone,d=i.sizzle,l=i.$iq,h=i._;u.addNamespace("REGISTER","jabber:iq:register");let m=0;h.each(h.keys(u.Status),function(e){m=Math.max(m,u.Status[e])}),u.Status.REGIFAIL=m+1,u.Status.REGISTERED=m+2,u.Status.CONFLICT=m+3,u.Status.NOTACCEPTABLE=m+5,t.plugins.add("converse-register",{overrides:{LoginPanel:{render:function(e){const t=this.__super__._converse;return this.__super__.render.apply(this,arguments),t.allow_registration&&(h.isUndefined(this.registerlinkview)&&(this.registerlinkview=new t.RegisterLinkView({model:this.model}),this.registerlinkview.render(),this.el.querySelector(".buttons").insertAdjacentElement("beforeend",this.registerlinkview.el)),this.registerlinkview.render()),this}},ControlBoxView:{initialize(){this.__super__.initialize.apply(this,arguments),this.model.on("change:active-form",this.showLoginOrRegisterForm.bind(this))},showLoginOrRegisterForm(){this.__super__._converse,h.isNil(this.registerpanel)||("register"==this.model.get("active-form")?(this.loginpanel.el.classList.add("hidden"),this.registerpanel.el.classList.remove("hidden")):(this.loginpanel.el.classList.remove("hidden"),this.registerpanel.el.classList.add("hidden")))},renderRegistrationPanel(){const e=this.__super__._converse;return e.allow_registration&&(this.registerpanel=new e.RegisterPanel({model:this.model}),this.registerpanel.render(),this.registerpanel.el.classList.add("hidden"),this.el.querySelector("#converse-login-panel").insertAdjacentElement("afterend",this.registerpanel.el),this.showLoginOrRegisterForm()),this},renderLoginPanel(){return this.__super__.renderLoginPanel.apply(this,arguments),this.renderRegistrationPanel(),this}}},initialize(){const t=this._converse,i=t.__;function m(e){t.api.waitUntil("controlboxInitialized").then(()=>{const f=t.chatboxes.get("controlbox");f.set({"active-form":e})}).catch(h.partial(t.log,h,u.LogLevel.FATAL))}t.CONNECTION_STATUS[u.Status.REGIFAIL]="REGIFAIL",t.CONNECTION_STATUS[u.Status.REGISTERED]="REGISTERED",t.CONNECTION_STATUS[u.Status.CONFLICT]="CONFLICT",t.CONNECTION_STATUS[u.Status.NOTACCEPTABLE]="NOTACCEPTABLE",t.api.settings.update({allow_registration:!0,domain_placeholder:i(" e.g. conversejs.org"),providers_link:"https://xmpp.net/directory.php"}),t.router.route("converse/login",h.partial(m,"login")),t.router.route("converse/register",h.partial(m,"register")),t.RegisterLinkView=_.VDOMView.extend({toHTML(){return a(h.extend(this.model.toJSON(),{__:t.__,_converse:t,connection_status:t.connfeedback.get("connection_status")}))}}),t.RegisterPanel=_.NativeView.extend({tagName:"div",id:"converse-register-panel",className:"controlbox-pane fade-in",events:{"submit form#converse-register":"onFormSubmission","click .button-cancel":"renderProviderChoiceForm"},initialize(e){this.reset(),this.registerHooks()},render(){return this.model.set("registration_form_rendered",!1),this.el.innerHTML=n({__:i,default_domain:t.registration_domain,label_register:i("Fetch registration form"),help_providers:i("Tip: A list of public XMPP providers is available"),help_providers_link:i("here"),href_providers:t.providers_link,domain_placeholder:t.domain_placeholder}),t.registration_domain&&this.fetchRegistrationForm(t.registration_domain),this},registerHooks(){const e=t.connection,f=e._connect_cb.bind(e);e._connect_cb=((e,t,a)=>{this._registering?this.getRegistrationFields(e,t,a)&&(this._registering=!1):f(e,t,a)})},getRegistrationFields(e,f,a){const n=t.connection;n.connected=!0;const o=n._proto._reqToData(e);if(!o)return;if(n._proto._connect_cb(o)===u.Status.CONNFAIL)return this.showValidationError(i("Sorry, we're unable to connect to your chosen provider.")),!1;const r=o.getElementsByTagName("register"),s=o.getElementsByTagName("mechanism");if(0===r.length&&0===s.length)return n._proto._no_auth_received(f),!1;if(0===r.length)return n._changeConnectStatus(u.Status.REGIFAIL),this.showValidationError(i("Sorry, the given provider does not support in band account registration. Please try with a different provider.")),!0;n._addSysHandler(this.onRegistrationFields.bind(this),null,"iq",null,null);const c=l({type:"get"}).c("query",{xmlns:u.NS.REGISTER}).tree();return c.setAttribute("id",n.getUniqueId("sendIQ")),n.send(c),n.connected=!1,!0},onRegistrationFields(e){return"error"===e.getAttribute("type")?(t.connection._changeConnectStatus(u.Status.REGIFAIL,i('Something went wrong while establishing a connection with "%1$s". Are you sure it exists?',this.domain)),!1):1!==e.getElementsByTagName("query").length?(t.connection._changeConnectStatus(u.Status.REGIFAIL,"unknown"),!1):(this.setFields(e),this.model.get("registration_form_rendered")||this.renderRegistrationForm(e),!1)},reset(e){const t={fields:{},urls:[],title:"",instructions:"",registered:!1,_registering:!1,domain:null,form_type:null};h.extend(this,t),e&&h.extend(this,h.pick(e,h.keys(t)))},onFormSubmission(e){e&&e.preventDefault&&e.preventDefault(),h.isNull(e.target.querySelector("input[name=domain]"))?this.submitRegistrationForm(e.target):this.onProviderChosen(e.target)},onProviderChosen(e){const t=e.querySelector("input[name=domain]"),f=h.get(t,"value");f?(e.querySelector("input[type=submit]").classList.add("hidden"),this.fetchRegistrationForm(f.trim())):t.classList.add("error")},fetchRegistrationForm(e){return this.model.get("registration_form_rendered")||this.renderRegistrationRequest(),this.reset({domain:u.getDomainFromJid(e),_registering:!0}),t.connection.connect(this.domain,"",this.onConnectStatusChanged.bind(this)),!1},renderRegistrationRequest(){this.clearRegistrationForm().insertAdjacentHTML("beforeend",r({__:t.__,cancel:t.registration_domain}))},giveFeedback(e,t){let f=this.el.querySelector(".reg-feedback");h.isNull(f)||f.parentNode.removeChild(f);const a=this.el.querySelector("form");a.insertAdjacentHTML("afterbegin",''),(f=a.querySelector(".reg-feedback")).textContent=e,t&&f.classList.add(t)},clearRegistrationForm(){const e=this.el.querySelector("form");return e.innerHTML="",this.model.set("registration_form_rendered",!1),e},showSpinner(){const e=this.el.querySelector("form");return e.innerHTML=c(),this.model.set("registration_form_rendered",!1),this},onConnectStatusChanged(e){t.log("converse-register: onConnectStatusChanged"),h.includes([u.Status.DISCONNECTED,u.Status.CONNFAIL,u.Status.REGIFAIL,u.Status.NOTACCEPTABLE,u.Status.CONFLICT],e)?(t.log(`Problem during registration: Strophe.Status is ${t.CONNECTION_STATUS[e]}`,u.LogLevel.ERROR),this.abortRegistration()):e===u.Status.REGISTERED&&(t.log("Registered successfully."),t.connection.reset(),this.showSpinner(),h.includes(["converse/login","converse/register"],_.history.getFragment())&&t.router.navigate("",{replace:!0}),this.fields.password&&this.fields.username?(t.connection.connect(this.fields.username.toLowerCase()+"@"+this.domain.toLowerCase(),this.fields.password,t.onConnectStatusChanged),this.giveFeedback(i("Now logging you in"),"info")):(t.chatboxviews.get("controlbox").renderLoginPanel(),t.giveFeedback(i("Registered successfully"))),this.reset())},renderLegacyRegistrationForm(e){h.each(h.keys(this.fields),t=>{"username"===t?e.insertAdjacentHTML("beforeend",f({domain:` @${this.domain}`,name:t,type:"text",label:t,value:"",required:!0})):e.insertAdjacentHTML("beforeend",s({label:t,name:t,placeholder:t,required:!0,type:"password"===t||"email"===t?t:"text",value:""}))}),h.each(this.urls,t=>{e.insertAdjacentHTML("afterend",''+t+"")})},renderRegistrationForm(f){const a=this.el.querySelector("form");a.innerHTML=o({__:t.__,domain:this.domain,title:this.title,instructions:this.instructions,registration_domain:t.registration_domain});const n=a.querySelector("fieldset.buttons");"xform"===this.form_type?h.each(f.querySelectorAll("field"),t=>{n.insertAdjacentHTML("beforebegin",e.xForm2webForm(t,f,this.domain))}):this.renderLegacyRegistrationForm(a),this.fields||a.querySelector(".button-primary").classList.add("hidden"),a.classList.remove("hidden"),this.model.set("registration_form_rendered",!0)},showValidationError(e){const t=this.el.querySelector("form");let f=t.querySelector(".form-errors");if(h.isNull(f)){f='';const e=t.querySelector("p.instructions");h.isNull(e)?t.insertAdjacentHTML("afterbegin",f):e.insertAdjacentHTML("afterend",f),f=t.querySelector(".form-errors")}else f.innerHTML="";f.insertAdjacentHTML("beforeend",'

'+e+"

"),f.classList.remove("hidden")},reportErrors(e){const t=e.querySelectorAll("error");if(h.each(t,e=>{this.showValidationError(e.textContent)}),!t.length){const e=i("The provider rejected your registration attempt. Please check the values you entered for correctness.");this.showValidationError(e)}},renderProviderChoiceForm(e){e&&e.preventDefault&&e.preventDefault(),t.connection._proto._abortAllRequests(),t.connection.reset(),this.render()},abortRegistration(){t.connection._proto._abortAllRequests(),t.connection.reset(),this.model.get("registration_form_rendered")?t.registration_domain&&this.model.get("registration_form_rendered")&&this.fetchRegistrationForm(t.registration_domain):this.render()},submitRegistrationForm(f){const a=h.reduce(this.el.querySelectorAll("input.required"),function(e,t){return""===t.value?(t.classList.add("error"),e+1):e},0);if(a)return;const n=d(":input:not([type=button]):not([type=submit])",f),o=l({type:"set",id:t.connection.getUniqueId()}).c("query",{xmlns:u.NS.REGISTER});"xform"===this.form_type?(o.c("x",{xmlns:u.NS.XFORM,type:"submit"}),h.each(n,t=>{o.cnode(e.webForm2xForm(t)).up()})):h.each(n,e=>{o.c(e.getAttribute("name"),{},e.value)}),t.connection._addSysHandler(this._onRegisterIQ.bind(this),null,"iq",null,null),t.connection.send(o),this.setFields(o.tree())},setFields(e){const t=e.querySelector("query"),f=d(`x[xmlns="${u.NS.XFORM}"]`,t);f.length>0?this._setFieldsFromXForm(f.pop()):this._setFieldsFromLegacy(t)},_setFieldsFromLegacy(e){h.each(e.children,e=>{"instructions"!==e.tagName.toLowerCase()?"x"!==e.tagName.toLowerCase()?this.fields[e.tagName.toLowerCase()]=u.getText(e):"jabber:x:oob"===e.getAttribute("xmlns")&&this.urls.concat(h.map(e.querySelectorAll("url"),"textContent")):this.instructions=u.getText(e)}),this.form_type="legacy"},_setFieldsFromXForm(e){this.title=h.get(e.querySelector("title"),"textContent"),this.instructions=h.get(e.querySelector("instructions"),"textContent"),h.each(e.querySelectorAll("field"),e=>{const f=e.getAttribute("var");f?this.fields[f.toLowerCase()]=h.get(e.querySelector("value"),"textContent",""):t.log("Found field we couldn't parse",u.LogLevel.WARN)}),this.form_type="xform"},_onRegisterIQ(e){if("error"===e.getAttribute("type")){t.log("Registration failed.",u.LogLevel.ERROR),this.reportErrors(e);let f=e.getElementsByTagName("error");if(1!==f.length)return t.connection._changeConnectStatus(u.Status.REGIFAIL,"unknown"),!1;"conflict"===(f=f[0].firstChild.tagName.toLowerCase())?t.connection._changeConnectStatus(u.Status.CONFLICT,f):"not-acceptable"===f?t.connection._changeConnectStatus(u.Status.NOTACCEPTABLE,f):t.connection._changeConnectStatus(u.Status.REGIFAIL,f)}else t.connection._changeConnectStatus(u.Status.REGISTERED,null);return!1}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=t.Backbone,a=t.Promise,n=t.Strophe,o=t.$iq,r=t.$pres,s=t.b64_sha1,c=t.moment,i=t.sizzle,u=t._,_=e.env.utils;e.plugins.add("converse-roster",{dependencies:["converse-vcard"],initialize(){const e=this._converse,t=e.__;e.api.promises.add(["cachedRoster","roster","rosterContactsFetched","rosterGroupsFetched","rosterInitialized"]),e.registerPresenceHandler=function(){e.unregisterPresenceHandler(),e.presence_ref=e.connection.addHandler(function(t){return e.roster.presenceHandler(t),!0},null,"presence",null)},e.initRoster=function(){e.roster=new e.RosterContacts,e.roster.browserStorage=new f.BrowserStorage[e.storage](s(`converse.contacts-${e.bare_jid}`)),e.rostergroups=new e.RosterGroups,e.rostergroups.browserStorage=new f.BrowserStorage[e.storage](s(`converse.roster.groups${e.bare_jid}`)),e.emit("rosterInitialized")},e.populateRoster=function(t=!1){t?(e.send_initial_presence=!0,e.roster.fetchFromServer().then(()=>{e.emit("rosterContactsFetched"),e.sendInitialPresence()}).catch(t=>{e.log(t,n.LogLevel.ERROR),e.sendInitialPresence()})):e.rostergroups.fetchRosterGroups().then(()=>(e.emit("rosterGroupsFetched"),e.roster.fetchRosterContacts())).then(()=>{e.emit("rosterContactsFetched"),e.sendInitialPresence()}).catch(t=>{e.log(t,n.LogLevel.ERROR),e.sendInitialPresence()})},e.Presence=f.Model.extend({defaults:()=>({show:"offline",resources:{}}),getHighestPriorityResource(){const e=this.get("resources");if(u.isObject(e)&&u.size(e)){const t=u.flow(u.values,u.partial(u.sortBy,u,["priority","timestamp"]),u.reverse)(e)[0];if(!u.isUndefined(t))return t}},addResource(e){const t=e.getAttribute("from"),f=u.propertyOf(e.querySelector("show"))("textContent")||"online",a=n.getResourceFromJid(t),o=i(`delay[xmlns="${n.NS.DELAY}"]`,e).pop(),r=u.isNil(o)?c().format():c(o.getAttribute("stamp")).format();let s=u.propertyOf(e.querySelector("priority"))("textContent")||0;s=u.isNaN(parseInt(s,10))?0:parseInt(s,10);const _=u.isObject(this.get("resources"))?this.get("resources"):{};_[a]={name:a,priority:s,show:f,timestamp:r};const d={resources:_},l=this.getHighestPriorityResource();return s==l.priority&&r==l.timestamp&&(d.show=f),this.save(d),_},removeResource(e){let t=this.get("resources");u.isObject(t)?delete t[e]:t={},this.save({resources:t,show:u.propertyOf(this.getHighestPriorityResource())("show")||"offline"})}}),e.Presences=f.Collection.extend({model:e.Presence}),e.ModelWithVCardAndPresence=f.Model.extend({initialize(){this.setVCard(),this.setPresence()},setVCard(){const t=this.get("jid");this.vcard=e.vcards.findWhere({jid:t})||e.vcards.create({jid:t})},setPresence(){const t=this.get("jid");this.presence=e.presences.findWhere({jid:t})||e.presences.create({jid:t})}}),e.RosterContact=e.ModelWithVCardAndPresence.extend({defaults:{chat_state:void 0,image:e.DEFAULT_IMAGE,image_type:e.DEFAULT_IMAGE_TYPE,num_unread:0,status:""},initialize(t){e.ModelWithVCardAndPresence.prototype.initialize.apply(this,arguments);const f=t.jid,a=n.getBareJidFromJid(f).toLowerCase();n.getResourceFromJid(f),t.jid=a,this.set(u.assignIn({groups:[],id:a,jid:a,user_id:n.getNodeFromJid(f)},t)),this.presence.on("change:show",()=>e.emit("contactPresenceChanged",this)),this.presence.on("change:show",()=>this.trigger("presenceChanged"))},getDisplayName(){return this.vcard.get("fullname")||this.get("jid")},getFullname(){return this.vcard.get("fullname")},subscribe(t){const f=r({to:this.get("jid"),type:"subscribe"});t&&""!==t&&f.c("status").t(t).up();const a=e.xmppstatus.vcard.get("nickname")||e.xmppstatus.vcard.get("fullname");return a&&f.c("nick",{xmlns:n.NS.NICK}).t(a).up(),e.connection.send(f),this.save("ask","subscribe"),this},ackSubscribe(){e.connection.send(r({type:"subscribe",to:this.get("jid")}))},ackUnsubscribe(){e.connection.send(r({type:"unsubscribe",to:this.get("jid")})),this.removeFromRoster(),this.destroy()},unauthorize(t){return e.rejectPresenceSubscription(this.get("jid"),t),this},authorize(t){const f=r({to:this.get("jid"),type:"subscribed"});return t&&""!==t&&f.c("status").t(t),e.connection.send(f),this},removeFromRoster(t,f){const a=o({type:"set"}).c("query",{xmlns:n.NS.ROSTER}).c("item",{jid:this.get("jid"),subscription:"remove"});return e.connection.sendIQ(a,t,f),this}}),e.RosterContacts=f.Collection.extend({model:e.RosterContact,comparator(t,f){const a=t.presence.get("show")||"offline",n=f.presence.get("show")||"offline";if(e.STATUS_WEIGHTS[a]===e.STATUS_WEIGHTS[n]){const e=t.getDisplayName().toLowerCase(),a=f.getDisplayName().toLowerCase();return ea?1:0}return e.STATUS_WEIGHTS[a]{this.fetch({add:!0,silent:!0,success(a){0===a.length?(e.send_initial_presence=!0,e.roster.fetchFromServer().then(t).catch(f)):(e.emit("cachedRoster",a),t())}})})},subscribeToSuggestedItems:t=>(u.each(t.querySelectorAll("item"),function(t){"add"===t.getAttribute("action")&&e.roster.addAndSubscribe(t.getAttribute("jid"),e.xmppstatus.vcard.get("nickname")||e.xmppstatus.vcard.get("fullname"))}),!0),isSelf:t=>_.isSameBareJID(t,e.connection.jid),addAndSubscribe(t,f,a,n,o){const r=t=>{t instanceof e.RosterContact&&t.subscribe(n)};this.addContactToRoster(t,f,a,o).then(r,r)},sendContactAddIQ(t,f,a,r,s){f=u.isEmpty(f)?t:f;const c=o({type:"set"}).c("query",{xmlns:n.NS.ROSTER}).c("item",{jid:t,name:f});u.each(a,function(e){c.c("group").t(e).up()}),e.connection.sendIQ(c,r,s)},addContactToRoster(f,o,r,s){return new a((a,c)=>{r=r||[],this.sendContactAddIQ(f,o,r,()=>{const e=this.create(u.assignIn({ask:void 0,nickname:o,groups:r,jid:f,requesting:!1,subscription:"none"},s),{sort:!1});a(e)},function(f){alert(t("Sorry, there was an error while trying to add %1$s as a contact.",o)),e.log(f,n.LogLevel.ERROR),a(f)})})},subscribeBack(t,f){const a=this.get(t);if(a instanceof e.RosterContact)a.authorize().subscribe();else{const a=t=>{t instanceof e.RosterContact&&t.authorize().subscribe()},o=u.get(i(`nick[xmlns="${n.NS.NICK}"]`,f).pop(),"textContent",null);this.addContactToRoster(t,o,[],{subscription:"from"}).then(a,a)}},getNumOnlineContacts(){let t=["offline","unavailable"];return e.show_only_online_users&&(t=u.union(t,["dnd","xa","away"])),u.sum(this.models.filter(e=>!u.includes(t,e.presence.get("show"))))},onRosterPush(t){const f=t.getAttribute("id"),a=t.getAttribute("from");if(a&&""!==a&&n.getBareJidFromJid(a)!==e.bare_jid)return e.connection.send(o({type:"error",id:f,from:e.connection.jid}).c("error",{type:"cancel"}).c("service-unavailable",{xmlns:n.NS.ROSTER})),!0;e.connection.send(o({type:"result",id:f,from:e.connection.jid}));const r=i(`query[xmlns="${n.NS.ROSTER}"] item`,t);return u.each(r,this.updateContact.bind(this)),e.emit("rosterPush",t),!0},fetchFromServer(){return new a((t,f)=>{const a=o({type:"get",id:e.connection.getUniqueId("roster")}).c("query",{xmlns:n.NS.ROSTER}),r=u.flow(this.onReceivedFromServer.bind(this),t);return e.connection.sendIQ(a,r,function(t){const a="Error while trying to fetch roster from the server";e.log(a,n.LogLevel.ERROR),f(new Error(a))})})},onReceivedFromServer(t){const f=i(`query[xmlns="${n.NS.ROSTER}"] item`,t);u.each(f,this.updateContact.bind(this)),e.emit("roster",t)},updateContact(e){const t=e.getAttribute("jid");if(this.isSelf(t))return;const f=this.get(t),a=e.getAttribute("subscription"),o=e.getAttribute("ask"),r=u.map(e.getElementsByTagName("group"),n.getText);if(f){if("remove"===a)return f.destroy();f.save({subscription:a,ask:o,requesting:null,groups:r})}else{if("none"===a&&null===o||"remove"===a)return;this.create({ask:o,nickname:e.getAttribute("name"),groups:r,jid:t,subscription:a},{sort:!1})}},createRequestingContact(t){const f=n.getBareJidFromJid(t.getAttribute("from")),a=u.get(i(`nick[xmlns="${n.NS.NICK}"]`,t).pop(),"textContent",null),o={jid:f,subscription:"none",ask:null,requesting:!0,nickname:a};e.emit("contactRequest",this.create(o))},handleIncomingSubscription(f){const a=f.getAttribute("from"),o=n.getBareJidFromJid(a),r=this.get(o);e.allow_contact_requests||e.rejectPresenceSubscription(a,t("This client does not allow presence subscriptions")),e.auto_subscribe?r&&"to"===r.get("subscription")?r.authorize():this.subscribeBack(o,f):r?"none"!==r.get("subscription")?r.authorize():"subscribe"===r.get("ask")&&r.authorize():this.createRequestingContact(f)},handleOwnPresence(t){const f=t.getAttribute("from"),a=n.getResourceFromJid(f),o=t.getAttribute("type");if(e.connection.jid!==f&&"unavailable"!==o&&(!0===e.synchronize_availability||e.synchronize_availability===a)){const f=u.propertyOf(t.querySelector("show"))("textContent")||"online";e.xmppstatus.save({status:f});const a=u.propertyOf(t.querySelector("status"))("textContent");a&&e.xmppstatus.save({status_message:a})}e.jid===f&&"unavailable"===o&&e.xmppstatus.sendPresence()},presenceHandler(e){const t=e.getAttribute("type");if("error"===t)return!0;const f=e.getAttribute("from"),a=n.getBareJidFromJid(f);if(this.isSelf(a))return this.handleOwnPresence(e);if(i(`query[xmlns="${n.NS.MUC}"]`,e).length)return;const o=u.propertyOf(e.querySelector("status"))("textContent"),r=this.get(a);if(r&&o!==r.get("status")&&r.save({status:o}),"subscribed"===t&&r)r.ackSubscribe();else if("unsubscribed"===t&&r)r.ackUnsubscribe();else{if("unsubscribe"===t)return;if("subscribe"===t)this.handleIncomingSubscription(e);else if("unavailable"===t&&r){const e=n.getResourceFromJid(f);r.presence.removeResource(e)}else r&&r.presence.addResource(e)}}}),e.RosterGroup=f.Model.extend({initialize(f){this.set(u.assignIn({description:t("Click to hide these contacts"),state:e.OPENED},f)),this.contacts=new e.RosterContacts}}),e.RosterGroups=f.Collection.extend({model:e.RosterGroup,fetchRosterGroups(){return new a((e,t)=>{this.fetch({silent:!0,success:e})})}}),e.unregisterPresenceHandler=function(){u.isUndefined(e.presence_ref)||(e.connection.deleteHandler(e.presence_ref),delete e.presence_ref)},e.api.listen.on("beforeTearDown",e.unregisterPresenceHandler()),e.api.listen.on("afterTearDown",()=>{e.presences&&e.presences.off().reset()}),e.api.listen.on("clearSession",()=>{e.presences&&e.presences.browserStorage._clear()}),e.api.listen.on("statusInitialized",t=>{t||(e.presences=new e.Presences,e.presences.browserStorage=new f.BrowserStorage.session(s(`converse.presences-${e.bare_jid}`)),e.presences.fetch()),e.emit("presencesInitialized",t)}),e.api.listen.on("presencesInitialized",t=>{t?e.emit("rosterReadyAfterReconnection"):(e.registerIntervalHandler(),e.initRoster()),e.roster.onConnected(),e.populateRoster(t),e.registerPresenceHandler()}),u.extend(e.api,{contacts:{get(t){const f=function(t){return e.roster.get(n.getBareJidFromJid(t))||null};if(u.isUndefined(t))t=e.roster.pluck("jid");else if(u.isString(t))return f(t);return u.map(t,f)},add(t,f){if(!u.isString(t)||!u.includes(t,"@"))throw new TypeError("contacts.add: invalid jid");e.roster.addAndSubscribe(t,u.isEmpty(f)?t:f)}}})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a,n;a=[f(15)],void 0===(n=function(e){return function(e,t,f,a,n){e.addConnectionPlugin("ping",{_c:null,init:function(t){this._c=t,e.addNamespace("PING","urn:xmpp:ping")},ping:function(t,a,n,o){var r=this._c.getUniqueId("ping"),s=f({type:"get",to:t,id:r}).c("ping",{xmlns:e.NS.PING});this._c.sendIQ(s,a,n,o)},pong:function(e){var t=e.getAttribute("from"),a=e.getAttribute("id"),n=f({type:"result",to:t,id:a});this._c.sendIQ(n)},addPingHandler:function(t){return this._c.addHandler(t,e.NS.PING,"iq","get")}})}(e.Strophe,e.$build,e.$iq,e.$msg,e.$pres),e}.apply(t,a))||(e.exports=n)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(171)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=t.Strophe,a=t._;e.plugins.add("converse-ping",{initialize(){const e=this._converse;e.api.settings.update({ping_interval:180}),e.ping=function(t,n,o,r){return e.lastStanzaDate=new Date,a.isNil(t)&&(t=f.getDomainFromJid(e.bare_jid)),a.isUndefined(r)&&(r=null),a.isUndefined(n)&&(n=null),a.isUndefined(o)&&(o=null),!!e.connection&&(e.connection.ping.ping(t,n,o,r),!0)},e.pong=function(t){return e.lastStanzaDate=new Date,e.connection.ping.pong(t),!0},e.registerPongHandler=function(){a.isUndefined(e.connection.disco)||e.api.disco.own.features.add(f.NS.PING),e.connection.ping.addPingHandler(e.pong)},e.registerPingHandler=function(){e.registerPongHandler(),e.ping_interval>0&&(e.connection.addHandler(function(){return e.lastStanzaDate=new Date,!0}),e.connection.addTimedHandler(1e3,function(){const t=new Date;return e.lastStanzaDate||(e.lastStanzaDate=t),!((t-e.lastStanzaDate)/1e3>e.ping_interval)||e.ping()}))};const t=function(){e.registerPingHandler()};e.on("connected",t),e.on("reconnected",t)}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=t.utils,a=t.Strophe,n=t._;e.plugins.add("converse-notification",{initialize(){const e=this._converse,t=e.__;e.supports_html5_notification="Notification"in window,e.api.settings.update({notify_all_room_messages:!1,show_desktop_notifications:!0,show_chatstate_notifications:!1,chatstate_notification_blacklist:[],play_sounds:!0,sounds_path:"/sounds/",notification_icon:"/logo/conversejs-filled.svg"}),e.isOnlyChatStateNotification=(t=>n.isNull(t.querySelector("body"))&&(n.isNull(t.querySelector(e.ACTIVE))||n.isNull(t.querySelector(e.COMPOSING))||n.isNull(t.querySelector(e.INACTIVE))||n.isNull(t.querySelector(e.PAUSED))||n.isNull(t.querySelector(e.GONE)))),e.shouldNotifyOfGroupMessage=function(t){let f=e.notify_all_room_messages;const o=t.getAttribute("from"),r=a.getResourceFromJid(o),s=a.getBareJidFromJid(o),c=r&&a.unescapeNode(r)||"";if(""===c||t.querySelectorAll("delay").length>0)return!1;const i=e.chatboxes.get(s),u=t.querySelector("body");if(n.isNull(u))return!1;const _=new RegExp(`\\b${i.get("nick")}\\b`).test(u.textContent);return f=!0===f||n.isArray(f)&&n.includes(f,s),!(c===i.get("nick")||!f&&!_)},e.isMessageToHiddenChat=function(t){if(n.includes(["mobile","fullscreen","embedded"],e.view_mode)){const f=a.getBareJidFromJid(t.getAttribute("from")),o=e.chatboxes.get(f);return!!n.isNil(o)||o.get("hidden")||"hidden"===e.windowState}return"hidden"===e.windowState},e.shouldNotifyOfMessage=function(t){if(f.isOTRMessage(t))return!1;const o=t.querySelector("forwarded");if(!n.isNull(o))return!1;if("groupchat"===t.getAttribute("type"))return e.shouldNotifyOfGroupMessage(t);if(f.isHeadlineMessage(e,t))return e.isMessageToHiddenChat(t);const r=a.getBareJidFromJid(t.getAttribute("from"))===e.bare_jid;return!e.isOnlyChatStateNotification(t)&&!r&&e.isMessageToHiddenChat(t)},e.playSoundNotification=function(){let t;e.play_sounds&&!n.isUndefined(window.Audio)&&((t=new Audio(e.sounds_path+"msg_received.ogg")).canPlayType("audio/ogg")?t.play():(t=new Audio(e.sounds_path+"msg_received.mp3")).canPlayType("audio/mp3")&&t.play())},e.areDesktopNotificationsEnabled=function(){return e.supports_html5_notification&&e.show_desktop_notifications&&"granted"===Notification.permission},e.showMessageNotification=function(f){let o,r;const s=f.getAttribute("from"),c=a.getBareJidFromJid(s);if("headline"===f.getAttribute("type")){if(n.includes(c,"@")&&!e.allow_non_roster_messaging)return;o=t("Notification from %1$s",c)}else if(n.includes(c,"@"))if("groupchat"===f.getAttribute("type"))o=t("%1$s says",a.getResourceFromJid(s));else{if(n.isUndefined(e.roster))return void e.log("Could not send notification, because roster is undefined",a.LogLevel.ERROR);if(r=e.roster.get(c),n.isUndefined(r)){if(!e.allow_non_roster_messaging)return;o=t("%1$s says",c)}else o=t("%1$s says",r.getDisplayName())}else o=t("Notification from %1$s",c);const i=new Notification(o,{body:f.querySelector("body").textContent,lang:e.locale,icon:e.notification_icon});setTimeout(i.close.bind(i),5e3)},e.showChatStateNotification=function(f){if(n.includes(e.chatstate_notification_blacklist,f.jid))return;const a=f.chat_status;let o=null;if("offline"===a?o=t("has gone offline"):"away"===a?o=t("has gone away"):"dnd"===a?o=t("is busy"):"online"===a&&(o=t("has come online")),null===o)return;const r=new Notification(f.getDisplayName(),{body:o,lang:e.locale,icon:e.notification_icon});setTimeout(r.close.bind(r),5e3)},e.showContactRequestNotification=function(f){const a=new Notification(f.getDisplayName(),{body:t("wants to be your contact"),lang:e.locale,icon:e.notification_icon});setTimeout(a.close.bind(a),5e3)},e.showFeedbackNotification=function(t){if("error"===t.klass||"warn"===t.klass){const f=new Notification(t.subject,{body:t.message,lang:e.locale,icon:e.notification_icon});setTimeout(f.close.bind(f),5e3)}},e.handleChatStateNotification=function(t){e.areDesktopNotificationsEnabled()&&e.show_chatstate_notifications&&e.showChatStateNotification(t)},e.handleMessageNotification=function(t){const f=t.stanza;if(!e.shouldNotifyOfMessage(f))return!1;e.playSoundNotification(),e.areDesktopNotificationsEnabled()&&e.showMessageNotification(f)},e.handleContactRequestNotification=function(t){e.areDesktopNotificationsEnabled(!0)&&e.showContactRequestNotification(t)},e.handleFeedback=function(t){e.areDesktopNotificationsEnabled(!0)&&e.showFeedbackNotification(t)},e.requestPermission=function(){e.supports_html5_notification&&!n.includes(["denied","granted"],Notification.permission)&&Notification.requestPermission()},e.on("pluginsInitialized",function(){e.on("contactRequest",e.handleContactRequestNotification),e.on("contactPresenceChanged",e.handleChatStateNotification),e.on("message",e.handleMessageNotification),e.on("feedback",e.handleFeedback),e.on("connected",e.requestPermission)})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatroom_sidebar.html --\x3e\n\x3c!--
--\x3e\n

'+(0,a.escape)(e.label_occupants)+'

\n
    \n
    \n\x3c!--
    --\x3e\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/rooms_results.html --\x3e\n
  • '+(0,a.escape)(e.feedback_text)+"\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/room_panel.html --\x3e\n\x3c!--
    --\x3e\n
    \n '+f(e.heading_chatrooms)+'\n \n \n
    \n
    \n
    \n\x3c!--
    --\x3e\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/room_item.html --\x3e\n
  • \n \n
  • \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/room_description.html --\x3e\n\x3c!-- FIXME: check markup in mockup --\x3e\n
    \n

    '+f(e.label_jid)+" "+f(e.jid)+'

    \n

    '+f(e.label_desc)+" "+f(e.desc)+'

    \n

    '+f(e.label_occ)+" "+f(e.occ)+'

    \n

    '+f(e.label_features)+"\n

      \n ",e.passwordprotected&&(t+='\n
    • '+f(e.label_requires_auth)+"
    • \n "),t+="\n ",e.hidden&&(t+='\n
    • '+f(e.label_hidden)+"
    • \n "),t+="\n ",e.membersonly&&(t+='\n
    • '+f(e.label_requires_invite)+"
    • \n "),t+="\n ",e.moderated&&(t+='\n
    • '+f(e.label_moderated)+"
    • \n "),t+="\n ",e.nonanonymous&&(t+='\n
    • '+f(e.label_non_anon)+"
    • \n "),t+="\n ",e.open&&(t+='\n
    • '+f(e.label_open_room)+"
    • \n "),t+="\n ",e.persistent&&(t+='\n
    • '+f(e.label_permanent_room)+"
    • \n "),t+="\n ",e.publicroom&&(t+='\n
    • '+f(e.label_public)+"
    • \n "),t+="\n ",e.semianonymous&&(t+='\n
    • '+f(e.label_semi_anon)+"
    • \n "),t+="\n ",e.temporary&&(t+='\n
    • '+f(e.label_temp_room)+"
    • \n "),t+="\n ",e.unmoderated&&(t+='\n
    • '+f(e.label_unmoderated)+"
    • \n "),t+="\n
    \n

    \n
    \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/occupant.html --\x3e\n
  • \n \n
    \n '+f(e.nick||e.jid)+"\n ","owner"===e.affiliation&&(t+='\n '+f(e.label_owner)+"\n "),t+="\n ","admin"===e.affiliation&&(t+='\n '+f(e.label_admin)+"\n "),t+="\n ","member"===e.affiliation&&(t+='\n '+f(e.label_member)+"\n "),t+="\n\n ","moderator"===e.role&&(t+='\n '+f(e.label_moderator)+"\n "),t+="\n ","visitor"===e.role&&(t+='\n '+f(e.label_visitor)+"\n "),t+="\n
    \n \n
  • \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/list_chatrooms_modal.html --\x3e\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/chatroom_toolbar.html --\x3e\n",e.use_emoji&&(t+='\n
  • \n \n \n
  • \n'),t+="\n",e.show_call_button&&(t+='\n
  • \n'),t+="\n",e.show_occupants_toggle&&(t+='\n
  • \n'),t+="\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/chatroom_password_form.html --\x3e\n
    \n
    \n
    \n '+f(e.heading)+"\n \n \n
    \n \n
    \n
    \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/chatroom_nickname_form.html --\x3e\n
    \n
    \n
    \n \n

    '+f(e.validation_message)+'

    \n \n
    \n \n
    \n
    \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chatroom_invite.html --\x3e\n
    \n ',e.error_message&&(t+='\n '+f(e.error_message)+"\n "),t+='\n \n
    \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chatroom_head.html --\x3e\n
    \n
    \n ',e.name&&e.name!==e.Strophe.getNodeFromJid(e.jid)?t+="\n "+f(e.name)+"\n ":t+="\n "+f(e.Strophe.getNodeFromJid(e.jid))+"@"+f(e.Strophe.getDomainFromJid(e.jid))+"\n ",t+='\n
    \n

    '+f(e.description)+'

    \n

    \n
    \n \n ',"owner"==e.affiliation&&(t+='\n \n '),t+="\n
    \n"}},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatroom_form.html --\x3e\n
    \n
    \n
    \n \n
    \n
    \n
    \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/chatroom_features.html --\x3e\n",e.has_features&&(t+='\n

    '+f(e.label_features)+"

    \n"),t+='\n
      \n',e.passwordprotected&&(t+='\n
    • '+f(e.label_passwordprotected)+"
    • \n"),t+="\n",e.unsecured&&(t+='\n
    • '+f(e.label_unsecured)+"
    • \n"),t+="\n",e.hidden&&(t+='\n
    • '+f(e.label_hidden)+"
    • \n"),t+="\n",e.public_room&&(t+='\n
    • '+f(e.label_public)+"
    • \n"),t+="\n",e.membersonly&&(t+='\n
    • '+f(e.label_membersonly)+"
    • \n"),t+="\n",e.open&&(t+='\n
    • '+f(e.label_open)+"
    • \n"),t+="\n",e.persistent&&(t+='\n
    • '+f(e.label_persistent)+"
    • \n"),t+="\n",e.temporary&&(t+='\n
    • '+f(e.label_temporary)+"
    • \n"),t+="\n",e.nonanonymous&&(t+='\n
    • '+f(e.label_nonanonymous)+"
    • \n"),t+="\n",e.semianonymous&&(t+='\n
    • '+f(e.label_semianonymous)+"
    • \n"),t+="\n",e.moderated&&(t+='\n
    • '+f(e.label_moderated)+"
    • \n"),t+="\n",e.unmoderated&&(t+='\n
    • '+f(e.label_unmoderated)+"
    • \n"),t+="\n",e.mam_enabled&&(t+='\n
    • '+f(e.label_mam_enabled)+"
    • \n"),t+="\n
    \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatroom_disconnect.html --\x3e\n

    '+(0,a.escape)(e.disconnect_message)+"

    \n"}},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatroom.html --\x3e\n
    \n
    \n
    \n
    \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chatarea.html --\x3e\n
    \n
    \n
    \n ',e.show_toolbar&&(t+='\n
      \n '),t+='\n \n ',e.show_send_button&&(t+='\n \n "),t+="\n
      \n
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/add_chatroom_modal.html --\x3e\n\n'}},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chats_panel.html --\x3e\n\n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/trimmed_chat.html --\x3e\n\n ',e.num_unread&&(t+=' \n '+f(e.num_unread)+"\n "),t+="\n "+f(e.title||e.jid)+'\n\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/toggle_chats.html --\x3e\n"+f(e.num_minimized)+" "+f(e.Minimized)+'\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatbox_minimize.html --\x3e\n\n'}},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(195),f(194),f(193),f(192),f(3)],void 0===(o="function"==typeof(a=function(e,t,f,a,n){const o=e.env,r=o._,s=o.Backbone,c=o.Promise,i=o.Strophe,u=o.b64_sha1,_=o.moment,d=e.env.utils;e.plugins.add("converse-minimize",{dependencies:["converse-chatview","converse-controlbox","converse-muc","converse-muc-views","converse-headline"],enabled:e=>"overlayed"==e.view_mode,overrides:{registerGlobalEventHandlers(){const e=this.__super__._converse;return window.addEventListener("resize",r.debounce(function(t){e.connection.connected&&e.chatboxviews.trimChats()},200)),this.__super__.registerGlobalEventHandlers.apply(this,arguments)},ChatBox:{initialize(){this.__super__.initialize.apply(this,arguments),this.on("show",this.maximize,this),"controlbox"!==this.get("id")&&this.save({minimized:this.get("minimized")||!1,time_minimized:this.get("time_minimized")||_()})},maximize(){d.safeSave(this,{minimized:!1,time_opened:_().valueOf()})},minimize(){d.safeSave(this,{minimized:!0,time_minimized:_().format()})}},ChatBoxView:{events:{"click .toggle-chatbox-button":"minimize"},initialize(){return this.model.on("change:minimized",this.onMinimizedChanged,this),this.__super__.initialize.apply(this,arguments)},_show(){const e=this.__super__._converse;this.model.get("minimized")?this.minimize():(this.__super__._show.apply(this,arguments),e.chatboxviews.trimChats(this))},isNewMessageHidden(){return this.model.get("minimized")||this.__super__.isNewMessageHidden.apply(this,arguments)},shouldShowOnTextMessage(){return!this.model.get("minimized")&&this.__super__.shouldShowOnTextMessage.apply(this,arguments)},setChatBoxHeight(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxHeight.apply(this,arguments)},setChatBoxWidth(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxWidth.apply(this,arguments)},onMinimizedChanged(e){e.get("minimized")?this.minimize():this.maximize()},maximize(){return this.__super__._converse,this.insertIntoDOM(),this.model.isScrolledUp()||this.model.clearUnreadMsgCounter(),this.show(),this.__super__._converse.emit("chatBoxMaximized",this),this},minimize(e){const t=this.__super__._converse;e&&e.preventDefault&&e.preventDefault(),this.model.collection&&this.model.collection.browserStorage?this.model.save({scroll:this.content.scrollTop}):this.model.set({scroll:this.content.scrollTop}),this.setChatState(t.INACTIVE).model.minimize(),this.hide(),t.emit("chatBoxMinimized",this)}},ChatBoxHeading:{render(){const e=this.__super__._converse,f=e.__,a=(this.__super__.render.apply(this,arguments),t({info_minimize:f("Minimize this chat box")})),n=this.el.querySelector(".toggle-chatbox-button");if(n)n.outerHTML=a;else{const e=this.el.querySelector(".close-chatbox-button");e.insertAdjacentHTML("afterEnd",a)}}},ChatRoomView:{events:{"click .toggle-chatbox-button":"minimize"},initialize(){this.model.on("change:minimized",function(e){e.get("minimized")?this.hide():this.maximize()},this);const e=this.__super__.initialize.apply(this,arguments);return this.model.get("minimized")&&this.hide(),e},generateHeadingHTML(){const e=this.__super__._converse,f=e.__,a=this.__super__.generateHeadingHTML.apply(this,arguments),n=document.createElement("div");n.innerHTML=a;const o=n.querySelector(".close-chatbox-button");return o.insertAdjacentHTML("afterend",t({info_minimize:f("Minimize this chat box")})),n.innerHTML}},ChatBoxes:{chatBoxMayBeShown(e){return this.__super__.chatBoxMayBeShown.apply(this,arguments)&&!e.get("minimized")}},ChatBoxViews:{getChatBoxWidth:e=>!e.model.get("minimized")&&d.isVisible(e.el)?d.getOuterWidth(e.el,!0):0,getShownChats(){return this.filter(e=>!e.model.get("minimized")&&!e.model.get("closed")&&d.isVisible(e.el))},trimChats(e){const t=this.__super__._converse,f=this.getShownChats(),a=d.getOuterWidth(document.querySelector("body"),!0);t.no_trimming||f.length<=1||this.getChatBoxWidth(f[0])!==a&&t.api.waitUntil("minimizedChatsInitialized").then(()=>{const f=r.get(t.minimized_chats,"el"),n=e?e.model.get("id"):null;if(f){const t=r.includes(this.model.pluck("minimized"),!0)?d.getOuterWidth(f,!0):0,o=r.reduce(this.xget(n),(e,t)=>e+this.getChatBoxWidth(t),e?d.getOuterWidth(e.el,!0):0);if(t+o>a){const e=this.getOldestMaximizedChat([n]);if(e){const t=this.get(e.get("id"));t&&t.hide(),e.minimize()}}}}).catch(r.partial(t.log,r,i.LogLevel.FATAL))},getOldestMaximizedChat(e){e.push("controlbox");let t=0,f=this.model.sort().at(t);for(;r.includes(e,f.get("id"))||!0===f.get("minimized");)if(t++,!(f=this.model.at(t)))return null;return f}}},initialize(){const e=this._converse,o=e.__;e.templates.chatbox_minimize=t,e.templates.toggle_chats=f,e.templates.trimmed_chat=a,e.templates.chats_panel=n,e.api.settings.update({no_trimming:!1}),e.api.promises.add("minimizedChatsInitialized"),e.MinimizedChatBoxView=s.NativeView.extend({tagName:"div",className:"chat-head row no-gutters",events:{"click .close-chatbox-button":"close","click .restore-chat":"restore"},initialize(){this.model.on("change:num_unread",this.render,this)},render(){const e=r.extend(this.model.toJSON(),{tooltip:o("Click to restore this chat")});return"chatroom"===this.model.get("type")?(e.title=this.model.get("name"),d.addClass("chat-head-chatroom",this.el)):(e.title=this.model.get("fullname"),d.addClass("chat-head-chatbox",this.el)),this.el.innerHTML=a(e),this.el},close(t){t&&t.preventDefault&&t.preventDefault(),this.remove();const f=e.chatboxviews.get(this.model.get("id"));return f?f.close():(this.model.destroy(),e.emit("chatBoxClosed",this)),this},restore:r.debounce(function(e){e&&e.preventDefault&&e.preventDefault(),this.model.off("change:num_unread",null,this),this.remove(),this.model.maximize()},200,{leading:!0})}),e.MinimizedChats=s.Overview.extend({tagName:"div",id:"minimized-chats",className:"hidden",events:{"click #toggle-minimized-chats":"toggle"},initialize(){this.render(),this.initToggle(),this.addMultipleChats(this.model.where({minimized:!0})),this.model.on("add",this.onChanged,this),this.model.on("destroy",this.removeChat,this),this.model.on("change:minimized",this.onChanged,this),this.model.on("change:num_unread",this.updateUnreadMessagesCounter,this)},render(){return this.el.parentElement||(this.el.innerHTML=n(),e.chatboxviews.insertRowColumn(this.el)),0===this.keys().length?this.el.classList.add("hidden"):this.keys().length>0&&!d.isVisible(this.el)&&(this.el.classList.remove("hidden"),e.chatboxviews.trimChats()),this.el},tearDown(){return this.model.off("add",this.onChanged),this.model.off("destroy",this.removeChat),this.model.off("change:minimized",this.onChanged),this.model.off("change:num_unread",this.updateUnreadMessagesCounter),this},initToggle(){this.toggleview=new e.MinimizedChatsToggleView({model:new e.MinimizedChatsToggle});const t=u(`converse.minchatstoggle${e.bare_jid}`);this.toggleview.model.id=t,this.toggleview.model.browserStorage=new s.BrowserStorage[e.storage](t),this.toggleview.model.fetch()},toggle(e){e&&e.preventDefault&&e.preventDefault(),this.toggleview.model.save({collapsed:!this.toggleview.model.get("collapsed")}),d.slideToggleElement(this.el.querySelector(".minimized-chats-flyout"),200)},onChanged(e){"controlbox"!==e.get("id")&&(e.get("minimized")?this.addChat(e):this.get(e.get("id"))&&this.removeChat(e))},addChatView(t){const f=this.get(t.get("id"));if(f&&f.el.parentNode)return;const a=new e.MinimizedChatBoxView({model:t});this.el.querySelector(".minimized-chats-flyout").insertAdjacentElement("beforeEnd",a.render()),this.add(t.get("id"),a)},addMultipleChats(e){r.each(e,this.addChatView.bind(this)),this.toggleview.model.set({num_minimized:this.keys().length}),this.render()},addChat(e){this.addChatView(e),this.toggleview.model.set({num_minimized:this.keys().length}),this.render()},removeChat(e){this.remove(e.get("id")),this.toggleview.model.set({num_minimized:this.keys().length}),this.render()},updateUnreadMessagesCounter(){const e=this.model.pluck("num_unread");let t,f=0;for(t=0;t{e.minimized_chats=new e.MinimizedChats({model:e.chatboxes}),e.emit("minimizedChatsInitialized")}).catch(r.partial(e.log,r,i.LogLevel.FATAL)),e.on("controlBoxOpened",function(t){e.connection.connected&&e.chatboxviews.trimChats(t)})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(52),f(3)],void 0===(o="function"==typeof(a=function(e,t){const f=e.env,a=f._,n=f.utils;e.plugins.add("converse-headline",{dependencies:["converse-chatview"],overrides:{ChatBoxes:{model(e,t){const f=this.__super__._converse;return"headline"==e.type?new f.HeadlinesBox(e,t):this.__super__.model.apply(this,arguments)}},ChatBoxViews:{onChatBoxAdded(e){const t=this.__super__._converse;let f=this.get(e.get("id"));return f||"headline"!==e.get("type")?this.__super__.onChatBoxAdded.apply(this,arguments):(f=new t.HeadlinesBoxView({model:e}),this.add(e.get("id"),f),f)}}},initialize(){const e=this._converse;function f(t){const f=t.getAttribute("from");if(n.isHeadlineMessage(e,t)){if(a.includes(f,"@")&&!e.allow_non_roster_messaging)return;const n=e.chatboxes.create({id:f,jid:f,type:"headline",from:f});n.createMessage(t,void 0,t),e.emit("message",{chatbox:n,stanza:t})}return!0}function o(){e.connection.addHandler(f,null,"message")}e.__,e.HeadlinesBox=e.ChatBox.extend({defaults:{type:"headline",bookmarked:!1,chat_state:void 0,num_unread:0,url:""}}),e.HeadlinesBoxView=e.ChatBoxView.extend({className:"chatbox headlines",events:{"click .close-chatbox-button":"close","click .toggle-chatbox-button":"minimize","keypress textarea.chat-textarea":"keyPressed"},initialize(){this.initDebounced(),this.disable_mam=!0,this.model.messages.on("add",this.onMessageAdded,this),this.model.on("show",this.show,this),this.model.on("destroy",this.hide,this),this.model.on("change:minimized",this.onMinimizedChanged,this),this.render().insertHeading().fetchMessages().insertIntoDOM().hide(),e.emit("chatBoxOpened",this),e.emit("chatBoxInitialized",this)},render(){return this.el.setAttribute("id",this.model.get("box_id")),this.el.innerHTML=t(a.extend(this.model.toJSON(),{info_close:"",label_personal_message:"",show_send_button:!1,show_toolbar:!1,unread_msgs:""})),this.content=this.el.querySelector(".chat-content"),this},renderMessageForm:a.noop,afterShown:a.noop}),e.on("connected",o),e.on("reconnected",o)}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(3)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=t._;function a(e){"controlbox"!==e.model.get("id")&&(e.model.save({hidden:!0}),e.hide())}t.Strophe,e.plugins.add("converse-singleton",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views","converse-controlbox","converse-rosterview"],enabled:e=>f.includes(["mobile","fullscreen","embedded"],e.view_mode),overrides:{ChatBoxes:{chatBoxMayBeShown:e=>!e.get("hidden"),createChatBox(e,t){return(t=t||{}).hidden=!0,this.__super__.createChatBox.call(this,e,t)}},ChatBoxView:{shouldShowOnTextMessage:()=>!1,_show(e){return f.each(this.__super__._converse.chatboxviews.xget(this.model.get("id")),a),this.model.set("hidden",!1),this.__super__._show.apply(this,arguments)}},ChatRoomView:{show(e){return f.each(this.__super__._converse.chatboxviews.xget(this.model.get("id")),a),this.model.set("hidden",!1),this.__super__.show.apply(this,arguments)}}}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/inverse_brand_heading.html --\x3e\n
      \n
      \n

      Converse

      \n

      Open Source XMPP chat client brought to you by Opkode

      \n

      Translate it into your own language

      \n
      \n
      \n'}},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(199),f(3),f(10),f(6),f(198)],void 0===(o="function"==typeof(a=function(e,t){const f=e.env,a=(f.Strophe,f._);e.plugins.add("converse-fullscreen",{enabled:e=>a.includes(["fullscreen","embedded"],e.view_mode),overrides:{ControlBoxView:{createBrandHeadingHTML:()=>t(),insertBrandHeading(){const e=this.__super__._converse,t=e.root.getElementById("converse-login-panel");t.parentNode.insertAdjacentHTML("afterbegin",this.createBrandHeadingHTML())}}},initialize(){this._converse.api.settings.update({chatview_avatar_height:50,chatview_avatar_width:50,hide_open_bookmarks:!0,show_controlbox_by_default:!0,sticky_controlbox:!0})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(6)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=(t.Backbone,t._);e.plugins.add("converse-embedded",{enabled:e=>"embedded"===e.view_mode,initialize(){this._converse.api.settings.update({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0});const e=this._converse;if(!f.isArray(e.auto_join_rooms)&&!f.isArray(e.auto_join_private_chats))throw new Error("converse-embedded: auto_join_rooms must be an Array");if(1!==e.auto_join_rooms.length&&1!==e.auto_join_private_chats.length)throw new Error("converse-embedded: It doesn't make sense to have the auto_join_rooms setting to zero or more then one, since only one chat room can be open at any time.")}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/dragresize.html --\x3e\n
      \n
      \n
      \n'}},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(202),f(3),f(10)],void 0===(o="function"==typeof(a=function(e,t){const f=e.env._;function a(e,f){const a=f.el.querySelector(".box-flyout"),n=document.createElement("div");n.innerHTML=t(),a.insertBefore(n,a.firstChild)}e.plugins.add("converse-dragresize",{dependencies:["converse-chatview","converse-headline","converse-muc-views"],enabled:e=>"overlayed"==e.view_mode,overrides:{registerGlobalEventHandlers(){const e=this;return document.addEventListener("mousemove",function(t){if(!e.resizing||!e.allow_dragresize)return!0;t.preventDefault(),e.resizing.chatbox.resizeChatBox(t)}),document.addEventListener("mouseup",function(t){if(!e.resizing||!e.allow_dragresize)return!0;t.preventDefault();const f=e.applyDragResistance(e.resizing.chatbox.height,e.resizing.chatbox.model.get("default_height")),a=e.applyDragResistance(e.resizing.chatbox.width,e.resizing.chatbox.model.get("default_width"));e.connection.connected?(e.resizing.chatbox.model.save({height:f}),e.resizing.chatbox.model.save({width:a})):(e.resizing.chatbox.model.set({height:f}),e.resizing.chatbox.model.set({width:a})),e.resizing=null}),this.__super__.registerGlobalEventHandlers.apply(this,arguments)},ChatBox:{initialize(){const e=this.__super__._converse,t=this.__super__.initialize.apply(this,arguments),f=this.get("height"),a=this.get("width"),n="controlbox"===this.get("id")?this.set.bind(this):this.save.bind(this);return n({height:e.applyDragResistance(f,this.get("default_height")),width:e.applyDragResistance(a,this.get("default_width"))}),t}},ChatBoxView:{events:{"mousedown .dragresize-top":"onStartVerticalResize","mousedown .dragresize-left":"onStartHorizontalResize","mousedown .dragresize-topleft":"onStartDiagonalResize"},initialize(){window.addEventListener("resize",f.debounce(this.setDimensions.bind(this),100)),this.__super__.initialize.apply(this,arguments)},render(){const e=this.__super__.render.apply(this,arguments);return a(this.__super__._converse,this),this.setWidth(),e},setWidth(){this.model.get("width")&&(this.el.style.width=this.model.get("width"))},_show(){this.initDragResize().setDimensions(),this.__super__._show.apply(this,arguments)},initDragResize(){const e=this.__super__._converse,t=this.el.querySelector(".box-flyout"),a=window.getComputedStyle(t);if(f.isUndefined(this.model.get("height"))){const e=parseInt(a.height.replace(/px$/,""),10),t=parseInt(a.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 n=a["min-width"],o=a["min-height"];return this.model.set("min_width",n.endsWith("px")?Number(n.replace(/px$/,"")):0),this.model.set("min_height",o.endsWith("px")?Number(o.replace(/px$/,"")):0),this.prev_pageY=0,this.prev_pageX=0,e.connection.connected&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},setDimensions(){this.adjustToViewport(),this.setChatBoxHeight(this.model.get("height")),this.setChatBoxWidth(this.model.get("width"))},setChatBoxHeight(e){const t=this.__super__._converse;e=e?t.applyDragResistance(e,this.model.get("default_height"))+"px":"";const a=this.el.querySelector(".box-flyout");f.isNull(a)||(a.style.height=e)},setChatBoxWidth(e){const t=this.__super__._converse;e=e?t.applyDragResistance(e,this.model.get("default_width"))+"px":"",this.el.style.width=e;const a=this.el.querySelector(".box-flyout");f.isNull(a)||(a.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)},onStartVerticalResize(e){const t=this.__super__._converse;if(!t.allow_dragresize)return!0;const f=this.el.querySelector(".box-flyout"),a=window.getComputedStyle(f);this.height=parseInt(a.height.replace(/px$/,""),10),t.resizing={chatbox:this,direction:"top"},this.prev_pageY=e.pageY},onStartHorizontalResize(e){const t=this.__super__._converse;if(!t.allow_dragresize)return!0;const f=this.el.querySelector(".box-flyout"),a=window.getComputedStyle(f);this.width=parseInt(a.width.replace(/px$/,""),10),t.resizing={chatbox:this,direction:"left"},this.prev_pageX=e.pageX},onStartDiagonalResize(e){const t=this.__super__._converse;this.onStartHorizontalResize(e),this.onStartVerticalResize(e),t.resizing.direction="topleft"},resizeChatBox(e){let t;const a=this.__super__._converse;0===a.resizing.direction.indexOf("top")&&(t=e.pageY-this.prev_pageY)&&(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)),f.includes(a.resizing.direction,"left")&&(t=this.prev_pageX-e.pageX)&&(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))}},HeadlinesBoxView:{events:{"mousedown .dragresize-top":"onStartVerticalResize","mousedown .dragresize-left":"onStartHorizontalResize","mousedown .dragresize-topleft":"onStartDiagonalResize"},initialize(){return window.addEventListener("resize",f.debounce(this.setDimensions.bind(this),100)),this.__super__.initialize.apply(this,arguments)},render(){const e=this.__super__.render.apply(this,arguments);return a(this.__super__._converse,this),this.setWidth(),e}},ControlBoxView:{events:{"mousedown .dragresize-top":"onStartVerticalResize","mousedown .dragresize-left":"onStartHorizontalResize","mousedown .dragresize-topleft":"onStartDiagonalResize"},initialize(){window.addEventListener("resize",f.debounce(this.setDimensions.bind(this),100)),this.__super__.initialize.apply(this,arguments)},render(){const e=this.__super__.render.apply(this,arguments);return a(this.__super__._converse,this),this.setWidth(),e},renderLoginPanel(){const e=this.__super__.renderLoginPanel.apply(this,arguments);return this.initDragResize().setDimensions(),e},renderControlBoxPane(){const e=this.__super__.renderControlBoxPane.apply(this,arguments);return this.initDragResize().setDimensions(),e}},ChatRoomView:{events:{"mousedown .dragresize-top":"onStartVerticalResize","mousedown .dragresize-left":"onStartHorizontalResize","mousedown .dragresize-topleft":"onStartDiagonalResize"},initialize(){window.addEventListener("resize",f.debounce(this.setDimensions.bind(this),100)),this.__super__.initialize.apply(this,arguments)},render(){const e=this.__super__.render.apply(this,arguments);return a(this.__super__._converse,this),this.setWidth(),e}}},initialize(){const e=this._converse;e.api.settings.update({allow_dragresize:!0}),e.applyDragResistance=function(e,t){if(!f.isUndefined(e))return f.isUndefined(t)?e:e!==t&&Math.abs(e-t)<10?t:e}}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/controlbox_toggle.html --\x3e\n'+(0,a.escape)(e.label_toggle)+"\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/profile_modal.html --\x3e\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/vcard.html --\x3e\n\n '+f(e.fn)+"\n "+f(e.nickname)+"\n "+f(e.url)+"\n "+f(e.role)+"\n "+f(e.email)+"\n \n "+f(e.image_type)+"\n "+f(e.image)+"\n \n\n"}},function(e,t,f){var a,n;void 0===(n="function"==typeof(a=function(){var e,t,f,a,n=n||function(e,t){var f={},a=f.lib={},n=a.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var f=new e;return t&&f.mixIn(t),f.hasOwnProperty("init")||(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=a.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,f=e.words,a=this.sigBytes,n=e.sigBytes;if(this.clamp(),a%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[a+o>>>2]|=r<<24-(a+o)%4*8}else if(f.length>65535)for(var o=0;o>>2]=f[o>>>2];else t.push.apply(t,f);return this.sigBytes+=n,this},clamp:function(){var t=this.words,f=this.sigBytes;t[f>>>2]&=4294967295<<32-f%4*8,t.length=e.ceil(f/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var f=[],a=0;a>>2]>>>24-n%4*8&255;a.push((o>>>4).toString(16)),a.push((15&o).toString(16))}return a.join("")},parse:function(e){for(var t=e.length,f=[],a=0;a>>3]|=parseInt(e.substr(a,2),16)<<24-a%8*4;return new o.init(f,t/2)}},c=r.Latin1={stringify:function(e){for(var t=e.words,f=e.sigBytes,a=[],n=0;n>>2]>>>24-n%4*8&255;a.push(String.fromCharCode(o))}return a.join("")},parse:function(e){for(var t=e.length,f=[],a=0;a>>2]|=(255&e.charCodeAt(a))<<24-a%4*8;return new o.init(f,t)}},i=r.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},u=a.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=i.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var f=this._data,a=f.words,n=f.sigBytes,r=this.blockSize,s=4*r,c=n/s,i=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*r,u=e.min(4*i,n);if(i){for(var _=0;_>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=a.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,f=this._map,n=f.charAt(64);if(n){var o=e.indexOf(n);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(i|u)<<24-s%4*8,s++}return a.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.lib.Cipher||function(e){var t=n,f=t.lib,a=f.Base,o=f.WordArray,r=f.BufferedBlockAlgorithm,s=t.enc,c=(s.Utf8,s.Base64),i=t.algo.EvpKDF,u=f.Cipher=r.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,f){this.cfg=this.cfg.extend(f),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?y:p}return function(t){return{encrypt:function(f,a,n){return e(a).encrypt(t,f,a,n)},decrypt:function(f,a,n){return e(a).decrypt(t,f,a,n)}}}}()}),_=(f.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),d=f.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),l=_.CBC=function(){var t=d.extend();function f(t,f,a){var n=this._iv;if(n){var o=n;this._iv=e}else o=this._prevBlock;for(var r=0;r>>2];e.sigBytes-=t}},m=(f.BlockCipher=u.extend({cfg:u.cfg.extend({mode:l,padding:h}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,f=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var a=f.createEncryptor;else a=f.createDecryptor,this._minBufferSize=1;this._mode=a.call(f,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),f.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,f=e.salt;if(f)var a=o.create([1398893684,1701076831]).concat(f).concat(t);else a=t;return a.toString(c)},parse:function(e){var t=c.parse(e),f=t.words;if(1398893684==f[0]&&1701076831==f[1]){var a=o.create(f.slice(2,4));f.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:a})}},p=f.SerializableCipher=a.extend({cfg:a.extend({format:g}),encrypt:function(e,t,f,a){a=this.cfg.extend(a);var n=e.createEncryptor(f,a),o=n.finalize(t),r=n.cfg;return m.create({ciphertext:o,key:f,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:a.format})},decrypt:function(e,t,f,a){return a=this.cfg.extend(a),t=this._parse(t,a.format),e.createDecryptor(f,a).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(t.kdf={}).OpenSSL={execute:function(e,t,f,a){a||(a=o.random(8));var n=i.create({keySize:t+f}).compute(e,a),r=o.create(n.words.slice(t),4*f);return n.sigBytes=4*t,m.create({key:n,iv:r,salt:a})}},y=f.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:b}),encrypt:function(e,t,f,a){var n=(a=this.cfg.extend(a)).kdf.execute(f,e.keySize,e.ivSize);a.iv=n.iv;var o=p.encrypt.call(this,e,t,n.key,a);return o.mixIn(n),o},decrypt:function(e,t,f,a){a=this.cfg.extend(a),t=this._parse(t,a.format);var n=a.kdf.execute(f,e.keySize,e.ivSize,t.salt);return a.iv=n.iv,p.decrypt.call(this,e,t,n.key,a)}})}(),function(){var e=n,t=e.lib.BlockCipher,f=e.algo,a=[],o=[],r=[],s=[],c=[],i=[],u=[],_=[],d=[],l=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var f=0,n=0;for(t=0;t<256;t++){var h=n^n<<1^n<<2^n<<3^n<<4;h=h>>>8^255&h^99,a[f]=h,o[h]=f;var m=e[f],g=e[m],p=e[g],b=257*e[h]^16843008*h;r[f]=b<<24|b>>>8,s[f]=b<<16|b>>>16,c[f]=b<<8|b>>>24,i[f]=b,b=16843009*p^65537*g^257*m^16843008*f,u[h]=b<<24|b>>>8,_[h]=b<<16|b>>>16,d[h]=b<<8|b>>>24,l[h]=b,f?(f=m^e[e[e[p^m]]],n^=e[e[n]]):f=n=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],m=f.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,f=e.sigBytes/4,n=4*((this._nRounds=f+6)+1),o=this._keySchedule=[],r=0;r6&&r%f==4&&(s=a[s>>>24]<<24|a[s>>>16&255]<<16|a[s>>>8&255]<<8|a[255&s]):(s=a[(s=s<<8|s>>>24)>>>24]<<24|a[s>>>16&255]<<16|a[s>>>8&255]<<8|a[255&s],s^=h[r/f|0]<<24),o[r]=o[r-f]^s}for(var c=this._invKeySchedule=[],i=0;i>>24]]^_[a[s>>>16&255]]^d[a[s>>>8&255]]^l[a[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,r,s,c,i,a)},decryptBlock:function(e,t){var f=e[t+1];e[t+1]=e[t+3],e[t+3]=f,this._doCryptBlock(e,t,this._invKeySchedule,u,_,d,l,o),f=e[t+1],e[t+1]=e[t+3],e[t+3]=f},_doCryptBlock:function(e,t,f,a,n,o,r,s){for(var c=this._nRounds,i=e[t]^f[0],u=e[t+1]^f[1],_=e[t+2]^f[2],d=e[t+3]^f[3],l=4,h=1;h>>24]^n[u>>>16&255]^o[_>>>8&255]^r[255&d]^f[l++],g=a[u>>>24]^n[_>>>16&255]^o[d>>>8&255]^r[255&i]^f[l++],p=a[_>>>24]^n[d>>>16&255]^o[i>>>8&255]^r[255&u]^f[l++],b=a[d>>>24]^n[i>>>16&255]^o[u>>>8&255]^r[255&_]^f[l++];i=m,u=g,_=p,d=b}m=(s[i>>>24]<<24|s[u>>>16&255]<<16|s[_>>>8&255]<<8|s[255&d])^f[l++],g=(s[u>>>24]<<24|s[_>>>16&255]<<16|s[d>>>8&255]<<8|s[255&i])^f[l++],p=(s[_>>>24]<<24|s[d>>>16&255]<<16|s[i>>>8&255]<<8|s[255&u])^f[l++],b=(s[d>>>24]<<24|s[i>>>16&255]<<16|s[u>>>8&255]<<8|s[255&_])^f[l++],e[t]=m,e[t+1]=g,e[t+2]=p,e[t+3]=b},keySize:8});e.AES=t._createHelper(m)}(),function(){var e=n,t=e.lib,f=t.WordArray,a=t.Hasher,o=[],r=e.algo.SHA1=a.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var f=this._hash.words,a=f[0],n=f[1],r=f[2],s=f[3],c=f[4],i=0;i<80;i++){if(i<16)o[i]=0|e[t+i];else{var u=o[i-3]^o[i-8]^o[i-14]^o[i-16];o[i]=u<<1|u>>>31}var _=(a<<5|a>>>27)+c+o[i];_+=i<20?1518500249+(n&r|~n&s):i<40?1859775393+(n^r^s):i<60?(n&r|n&s|r&s)-1894007588:(n^r^s)-899497514,c=s,s=r,r=n<<30|n>>>2,n=a,a=_}f[0]=f[0]+a|0,f[1]=f[1]+n|0,f[2]=f[2]+r|0,f[3]=f[3]+s|0,f[4]=f[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,f=8*this._nDataBytes,a=8*e.sigBytes;return t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=Math.floor(f/4294967296),t[15+(a+64>>>9<<4)]=f,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(r),e.HmacSHA1=a._createHmacHelper(r)}(),function(e){var t=n,f=t.lib,a=f.WordArray,o=f.Hasher,r=t.algo,s=[],c=[];!function(){function t(t){for(var f=e.sqrt(t),a=2;a<=f;a++)if(!(t%a))return!1;return!0}function f(e){return 4294967296*(e-(0|e))|0}for(var a=2,n=0;n<64;)t(a)&&(n<8&&(s[n]=f(e.pow(a,.5))),c[n]=f(e.pow(a,1/3)),n++),a++}();var i=[],u=r.SHA256=o.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,t){for(var f=this._hash.words,a=f[0],n=f[1],o=f[2],r=f[3],s=f[4],u=f[5],_=f[6],d=f[7],l=0;l<64;l++){if(l<16)i[l]=0|e[t+l];else{var h=i[l-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,g=i[l-2],p=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;i[l]=m+i[l-7]+p+i[l-16]}var b=a&n^a&o^n&o,y=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),v=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&_)+c[l]+i[l];d=_,_=u,u=s,s=r+v|0,r=o,o=n,n=a,a=v+(y+b)|0}f[0]=f[0]+a|0,f[1]=f[1]+n|0,f[2]=f[2]+o|0,f[3]=f[3]+r|0,f[4]=f[4]+s|0,f[5]=f[5]+u|0,f[6]=f[6]+_|0,f[7]=f[7]+d|0},_doFinalize:function(){var t=this._data,f=t.words,a=8*this._nDataBytes,n=8*t.sigBytes;return f[n>>>5]|=128<<24-n%32,f[14+(n+64>>>9<<4)]=e.floor(a/4294967296),f[15+(n+64>>>9<<4)]=a,t.sigBytes=4*f.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(u),t.HmacSHA256=o._createHmacHelper(u)}(Math),function(){var e=n,t=e.lib.Base,f=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=f.parse(t));var a=e.blockSize,n=4*a;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),r=this._iKey=t.clone(),s=o.words,c=r.words,i=0;i\n \n '+f(e.text)+"\n \n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/profile_view.html --\x3e\n
      \n
      \n \n User Avatar\n \n '+f(e.fullname)+'\n \x3c!-- --\x3e\n \x3c!-- --\x3e\n ',e._converse.allow_logout&&(t+='\n \n '),t+='\n
      \n
      \n \n \n \n
      \n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chat_status_modal.html --\x3e\n\x3c!-- Change status Modal --\x3e\n\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/search_contact.html --\x3e\n
    • \n
      \n \n \n
      \n
    • \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/roster_item.html --\x3e\n\n \n ',e.num_unread&&(t+='\n '+f(e.num_unread)+"\n "),t+='\n \n",e.allow_contact_removal&&(t+='\n\n'),t+="\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/roster.html --\x3e\n
      \n '+f(e.heading_contacts)+'\n \n
      \n\n
      \n\n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/requesting_contact.html --\x3e\n",e.allow_chat_pending_contacts&&(t+='\n\n'),t+='\n'+f(e.display_name)+"\n",e.allow_chat_pending_contacts&&(t+="\n\n"),t+='\n\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/pending_contact.html --\x3e\n",e.allow_chat_pending_contacts&&(t+='\n\n'),t+='\n'+f(e.display_name)+" \n",e.allow_chat_pending_contacts&&(t+="\n"),t+='\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/group_header.html --\x3e\n\n \n
        \n \n
      \n
      \n \n \n
      \n
      \n
      \n\n"}},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(220),f(219),f(218),f(217),f(216),f(213),f(215),f(214),f(49),f(51),f(11)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i){const u=e.env,_=u.Backbone,d=u.Strophe,l=(u.$iq,u.b64_sha1),h=(u.sizzle,u._),m=e.env.utils;e.plugins.add("converse-rosterview",{dependencies:["converse-roster","converse-modal"],overrides:{afterReconnected(){this.__super__.afterReconnected.apply(this,arguments)},_tearDown(){this.__super__._tearDown.apply(this,arguments),h.isUndefined(this.rosterview)||this.rosterview.remove()},RosterGroups:{comparator(){const e=this.__super__._converse;return e.RosterGroupsComparator.apply(this,arguments)}}},initialize(){const e=this._converse,c=e.__;e.api.settings.update({allow_chat_pending_contacts:!0,allow_contact_removal:!0,roster_groups:!0,show_toolbar:!0,xhr_user_search_url:null}),e.api.promises.add("rosterViewInitialized");const u={dnd:c("This contact is busy"),online:c("This contact is online"),offline:c("This contact is offline"),unavailable:c("This contact is unavailable"),xa:c("This contact is away for an extended period"),away:c("This contact is away")},g=(c("Contacts"),c("Groups"),c("My contacts")),p=c("Pending contacts"),b=c("Contact requests"),y=c("Ungrouped"),v={};v[b]=0,v[g]=1,v[y]=2,v[p]=3,e.RosterGroupsComparator=function(e,t){e=e.get("name"),t=t.get("name");const f=h.keys(v),a=h.includes(f,e),n=h.includes(f,t);return a||n?a&&n?v[e]v[t]?1:0:!a&&n?t===b?1:-1:a&&!n?e===b?-1:1:void 0:e.toLowerCase()t.toLowerCase()?1:0},e.AddContactModal=e.BootstrapModal.extend({events:{"submit form":"addContactFromForm"},initialize(){e.BootstrapModal.prototype.initialize.apply(this,arguments),this.model.on("change",this.render,this)},toHTML(){const f=e.xhr_user_search_url?c("Contact name"):c("Optional nickname");return t(h.extend(this.model.toJSON(),{_converse:e,heading_new_contact:c("Add a Contact"),label_xmpp_address:c("XMPP Address"),label_nickname:f,contact_placeholder:c("name@example.org"),label_add:c("Add")}))},afterRender(){e.xhr_user_search_url&&h.isString(e.xhr_user_search_url)?this.initXHRAutoComplete():this.initJIDAutoComplete()},initJIDAutoComplete(){const t=this.el.querySelector('input[name="jid"]'),f=h.uniq(e.roster.map(e=>d.getDomainFromJid(e.get("jid"))));new i(t,{list:f,data:function(e,t){return t.slice(0,t.indexOf("@"))+"@"+e},filter:i.FILTER_STARTSWITH}),this.el.addEventListener("shown.bs.modal",()=>{t.focus()},!1)},initXHRAutoComplete(){const t=this.el.querySelector('input[name="name"]'),f=this.el.querySelector('input[name="jid"]'),a=new i(t,{minChars:1,list:[]}),n=new window.XMLHttpRequest;n.onload=function(){n.responseText&&(a.list=JSON.parse(n.responseText).map(e=>({label:e.fullname||e.jid,value:e.jid})),a.evaluate())},t.addEventListener("input",h.debounce(()=>{n.open("GET",`${e.xhr_user_search_url}q=${t.value}`,!0),n.send()},300)),this.el.addEventListener("awesomplete-selectcomplete",e=>{f.value=e.text.value,t.value=e.text.label}),this.el.addEventListener("shown.bs.modal",()=>{t.focus()},!1)},addContactFromForm(t){t.preventDefault();const f=new FormData(t.target),a=f.get("jid"),n=f.get("name");t.target.reset(),!a||h.compact(a.split("@")).length<2?this.model.set({error_message:c("Please enter a valid XMPP address"),jid:a}):(e.roster.addAndSubscribe(a,n),this.model.clear(),this.modal.hide())}}),e.RosterFilter=_.Model.extend({initialize(){this.set({filter_text:"",filter_type:"contacts",chat_state:""})}}),e.RosterFilterView=_.VDOMView.extend({tagName:"form",className:"roster-filter-form",events:{"keydown .roster-filter":"liveFilter","submit form.roster-filter-form":"submitFilter","click .clear-input":"clearFilter","click .filter-by span":"changeTypeFilter","change .state-type":"changeChatStateFilter"},initialize(){this.model.on("change:filter_type",this.render,this),this.model.on("change:filter_text",this.render,this)},toHTML(){return r(h.extend(this.model.toJSON(),{visible:this.shouldBeVisible(),placeholder:c("Filter"),title_contact_filter:c("Filter by contact name"),title_group_filter:c("Filter by group name"),title_status_filter:c("Filter by status"),label_any:c("Any"),label_unread_messages:c("Unread"),label_online:c("Online"),label_chatty:c("Chatty"),label_busy:c("Busy"),label_away:c("Away"),label_xa:c("Extended Away"),label_offline:c("Offline")}))},changeChatStateFilter(e){e&&e.preventDefault&&e.preventDefault(),this.model.save({chat_state:this.el.querySelector(".state-type").value})},changeTypeFilter(e){e&&e.preventDefault&&e.preventDefault();const t=e.target.dataset.type;"state"===t?this.model.save({filter_type:t,chat_state:this.el.querySelector(".state-type").value}):this.model.save({filter_type:t,filter_text:this.el.querySelector(".roster-filter").value})},liveFilter:h.debounce(function(e){this.model.save({filter_text:this.el.querySelector(".roster-filter").value})},250),submitFilter(e){e&&e.preventDefault&&e.preventDefault(),this.liveFilter(),this.render()},isActive(){return!("state"!==this.model.get("filter_type")&&!this.model.get("filter_text"))},shouldBeVisible(){return e.roster.length>=5||this.isActive()},showOrHide(){this.shouldBeVisible()?this.show():this.hide()},show(){return m.isVisible(this.el)?this:(this.el.classList.add("fade-in"),this.el.classList.remove("hidden"),this)},hide(){return m.isVisible(this.el)?(this.model.save({filter_text:"",chat_state:""}),this.el.classList.add("hidden"),this):this},clearFilter(e){e&&e.preventDefault&&(e.preventDefault(),m.hideElement(this.el.querySelector(".clear-input")));const t=this.el.querySelector(".roster-filter");t.value="",this.model.save({filter_text:""})}}),e.RosterContactView=_.NativeView.extend({tagName:"li",className:"d-flex hidden controlbox-padded",events:{"click .accept-xmpp-request":"acceptRequest","click .decline-xmpp-request":"declineRequest","click .open-chat":"openChat","click .remove-xmpp-contact":"removeContact"},initialize(){this.model.on("change",this.render,this),this.model.on("destroy",this.remove,this),this.model.on("open",this.openChat,this),this.model.on("remove",this.remove,this),this.model.presence.on("change:show",this.render,this),this.model.vcard.on("change:fullname",this.render,this)},render(){const t=this;if(!this.mayBeShown())return m.hideElement(this.el),this;const f=this.model,o=f.get("ask"),r=f.presence.get("show"),s=f.get("requesting"),i=f.get("subscription"),_=["current-xmpp-contact","pending-xmpp-contact","requesting-xmpp-contact"].concat(h.keys(u));if(h.each(_,function(e){h.includes(t.el.className,e)&&t.el.classList.remove(e)}),this.el.classList.add(r),this.el.setAttribute("data-status",r),"subscribe"===o||"from"===i){const t=f.getDisplayName();this.el.classList.add("pending-xmpp-contact"),this.el.innerHTML=a(h.extend(f.toJSON(),{display_name:t,desc_remove:c("Click to remove %1$s as a contact",t),allow_chat_pending_contacts:e.allow_chat_pending_contacts}))}else if(!0===s){const t=f.getDisplayName();this.el.classList.add("requesting-xmpp-contact"),this.el.innerHTML=n(h.extend(f.toJSON(),{display_name:t,desc_accept:c("Click to accept the contact request from %1$s",t),desc_decline:c("Click to decline the contact request from %1$s",t),allow_chat_pending_contacts:e.allow_chat_pending_contacts}))}else"both"!==i&&"to"!==i||(this.el.classList.add("current-xmpp-contact"),this.el.classList.remove(h.without(["both","to"],i)[0]),this.el.classList.add(i),this.renderRosterItem(f));return this},renderRosterItem(t){let f="fa-times-circle";const a=t.presence.get("show")||"offline";"online"===a?f="fa-circle":"away"===a?f="fa-dot-circle-o":"xa"===a?f="fa-circle-o":"dnd"===a&&(f="fa-minus-circle");const n=t.getDisplayName();return this.el.innerHTML=s(h.extend(t.toJSON(),{display_name:n,desc_status:u[a],status_icon:f,desc_chat:c("Click to chat with %1$s (JID: %2$s)",n,t.get("jid")),desc_remove:c("Click to remove %1$s as a contact",n),allow_contact_removal:e.allow_contact_removal,num_unread:t.get("num_unread")||0})),this},mayBeShown(){const t=this.model.presence.get("show");return!(e.show_only_online_users&&"online"!==t||e.hide_offline_users&&"offline"===t)||"subscribe"===this.model.get("ask")||"from"===this.model.get("subscription")||!0===this.model.get("requesting")},openChat(t){t&&t.preventDefault&&t.preventDefault();const f=this.model.attributes;e.api.chats.open(f.jid,f)},removeContact(t){if(t&&t.preventDefault&&t.preventDefault(),!e.allow_contact_removal)return;const f=confirm(c("Are you sure you want to remove this contact?"));!0===f&&this.model.removeFromRoster(e=>{this.model.destroy(),this.remove()},function(t){alert(c("Sorry, there was an error while trying to remove %1$s as a contact.",name)),e.log(t,d.LogLevel.ERROR)})},acceptRequest(t){t&&t.preventDefault&&t.preventDefault(),e.roster.sendContactAddIQ(this.model.get("jid"),this.model.getFullname(),[],()=>{this.model.authorize().subscribe()})},declineRequest(e){e&&e.preventDefault&&e.preventDefault();const t=confirm(c("Are you sure you want to decline this contact request?"));return!0===t&&this.model.unauthorize().destroy(),this}}),e.RosterGroupView=_.OrderedListView.extend({tagName:"div",className:"roster-group hidden",events:{"click a.group-toggle":"toggle"},ItemView:e.RosterContactView,listItems:"model.contacts",listSelector:".roster-group-contacts",sortEvent:"presenceChanged",initialize(){_.OrderedListView.prototype.initialize.apply(this,arguments),this.model.contacts.on("change:subscription",this.onContactSubscriptionChange,this),this.model.contacts.on("change:requesting",this.onContactRequestChange,this),this.model.contacts.on("remove",this.onRemove,this),e.roster.on("change:groups",this.onContactGroupChange,this),e.rosterview.on("rosterContactsFetchedAndProcessed",this.sortAndPositionAllItems.bind(this))},render(){return this.el.setAttribute("data-group",this.model.get("name")),this.el.innerHTML=f({label_group:this.model.get("name"),desc_group_toggle:this.model.get("description"),toggle_state:this.model.get("state"),_converse:e}),this.contacts_el=this.el.querySelector(".roster-group-contacts"),this},show(){return m.showElement(this.el),h.each(this.getAll(),t=>{t.mayBeShown()&&this.model.get("state")===e.OPENED&&m.showElement(t.el)}),this},collapse(){return m.slideIn(this.contacts_el)},filterOutContacts(e=[]){let t=0;this.getAll(),h.each(this.model.contacts.models,f=>{const a=this.get(f.get("id"));h.includes(e,f)?m.hideElement(a.el):a.mayBeShown()&&(m.showElement(a.el),t+=1)}),t?m.showElement(this.el):m.hideElement(this.el)},getFilterMatches(e,t){if(0===e.length)return[];let f;return e=e.toLowerCase(),f="state"===t?this.model.get("name")===b?this.model.contacts.filter(t=>!h.includes(t.presence.get("show"),e)&&!t.get("requesting")):"unread_messages"===e?this.model.contacts.filter({num_unread:0}):this.model.contacts.filter(t=>!h.includes(t.presence.get("show"),e)):this.model.contacts.filter(t=>!h.includes(t.getDisplayName().toLowerCase(),e.toLowerCase()))},filter(t,f){h.isNil(t)&&(f=f||e.rosterview.filter_view.model.get("filter_type"),t="state"===f?e.rosterview.filter_view.model.get("chat_state"):e.rosterview.filter_view.model.get("filter_text")),this.filterOutContacts(this.getFilterMatches(t,f))},toggle(t){t&&t.preventDefault&&t.preventDefault();const f=t.target.querySelector(".fa");h.includes(f.classList,"fa-caret-down")?(this.model.save({state:e.CLOSED}),this.collapse().then(()=>{f.classList.remove("fa-caret-down"),f.classList.add("fa-caret-right")})):(f.classList.remove("fa-caret-right"),f.classList.add("fa-caret-down"),this.model.save({state:e.OPENED}),this.filter(),m.showElement(this.el),m.slideOut(this.contacts_el))},onContactGroupChange(e){const t=h.includes(e.get("groups"),this.model.get("name")),f=e.get("id"),a=!this.get(f);t&&!a?this.items.trigger("add",e):t||this.removeContact(e)},onContactSubscriptionChange(e){this.model.get("name")===p&&"from"!==e.get("subscription")&&this.removeContact(e)},onContactRequestChange(e){this.model.get("name")!==b||e.get("requesting")||this.removeContact(e)},removeContact(e){this.model.contacts.remove(e,{silent:!0}),this.onRemove(e)},onRemove(e){this.remove(e.get("jid")),0===this.model.contacts.length&&this.remove()}}),e.RosterView=_.OrderedListView.extend({tagName:"div",id:"converse-roster",className:"controlbox-section",ItemView:e.RosterGroupView,listItems:"model",listSelector:".roster-contacts",sortEvent:null,subviewIndex:"name",events:{"click a.chatbox-btn.add-contact":"showAddContactModal"},initialize(){_.OrderedListView.prototype.initialize.apply(this,arguments),e.roster.on("add",this.onContactAdded,this),e.roster.on("change:groups",this.onContactAdded,this),e.roster.on("change",this.onContactChange,this),e.roster.on("destroy",this.update,this),e.roster.on("remove",this.update,this),e.presences.on("change:show",()=>{this.update(),this.updateFilter()}),this.model.on("reset",this.reset,this),e.on("rosterGroupsFetched",this.sortAndPositionAllItems.bind(this)),e.on("rosterContactsFetched",()=>{e.roster.each(e=>this.addRosterContact(e,{silent:!0})),this.update(),this.updateFilter(),this.trigger("rosterContactsFetchedAndProcessed")}),this.createRosterFilter()},render(){this.el.innerHTML=o({heading_contacts:c("Contacts"),title_add_contact:c("Add a contact")});const e=this.el.querySelector(".roster-filter-form");return this.el.replaceChild(this.filter_view.render().el,e),this.roster_el=this.el.querySelector(".roster-contacts"),this},showAddContactModal(t){h.isUndefined(this.add_contact_modal)&&(this.add_contact_modal=new e.AddContactModal({model:new _.Model})),this.add_contact_modal.show(t)},createRosterFilter(){const t=new e.RosterFilter;t.id=l(`_converse.rosterfilter${e.bare_jid}`),t.browserStorage=new _.BrowserStorage.local(this.filter.id),this.filter_view=new e.RosterFilterView({model:t}),this.filter_view.model.on("change",this.updateFilter,this),this.filter_view.model.fetch()},updateFilter:h.debounce(function(){const e=this.filter_view.model.get("filter_type");"state"===e?this.filter(this.filter_view.model.get("chat_state"),e):this.filter(this.filter_view.model.get("filter_text"),e)},100),update:h.debounce(function(){return m.isVisible(this.roster_el)||m.showElement(this.roster_el),this.filter_view.showOrHide(),this},e.animate?100:0),filter(e,t){h.each(this.getAll(),function(e){e.model.contacts.length>0&&e.show().filter("")}),e=e.toLowerCase(),"groups"===t?h.each(this.getAll(),function(t,f){h.includes(t.model.get("name").toLowerCase(),e.toLowerCase())?t.model.contacts.length>0&&m.slideOut(t.el):m.slideIn(t.el)}):h.each(this.getAll(),function(f){f.filter(e,t)})},reset(){return e.roster.reset(),this.removeAll(),this.render().update(),this},onContactAdded(e){this.addRosterContact(e),this.update(),this.updateFilter()},onContactChange(e){this.updateChatBox(e),this.update(),h.has(e.changed,"subscription")&&("from"===e.changed.subscription?this.addContactToGroup(e,p):h.includes(["both","to"],e.get("subscription"))&&this.addExistingContact(e)),h.has(e.changed,"ask")&&"subscribe"===e.changed.ask&&this.addContactToGroup(e,p),h.has(e.changed,"subscription")&&"true"===e.changed.requesting&&this.addContactToGroup(e,b),this.updateFilter()},updateChatBox(t){const f=e.chatboxes.get(t.get("jid")),a={};return f?(h.has(t.changed,"status")&&(a.status=t.get("status")),f.save(a),this):this},getGroup(e){const t=this.get(e);return t?t.model:this.model.create({name:e,id:l(e)})},addContactToGroup(e,t,f){this.getGroup(t).contacts.add(e,f),this.sortAndPositionAllItems()},addExistingContact(t,f){let a;e.roster_groups?0===(a=t.get("groups")).length&&(a=[y]):a=[g],h.each(a,h.bind(this.addContactToGroup,this,t,h,f))},addRosterContact(e,t){return"both"===e.get("subscription")||"to"===e.get("subscription")?this.addExistingContact(e,t):"subscribe"===e.get("ask")||"from"===e.get("subscription")?this.addContactToGroup(e,p,t):!0===e.get("requesting")&&this.addContactToGroup(e,b,t),this}});const w=function(){e.rosterview=new e.RosterView({model:e.rostergroups}),e.rosterview.render(),e.emit("rosterViewInitialized")};e.api.listen.on("rosterInitialized",w),e.api.listen.on("rosterReadyAfterReconnection",w),e.api.listen.on("message",function(t){const f=t.chatbox;if(!h.isUndefined(f)&&!h.isNull(t.stanza.querySelector("body"))&&"chatroom"!==f.get("type")&&m.isNewMessage(t.stanza)&&f.newMessageWillBeHidden()){const t=h.head(e.roster.where({jid:f.get("jid")}));h.isUndefined(t)||t.save({num_unread:t.get("num_unread")+1})}}),e.api.listen.on("chatBoxMaximized",function(t){const f=t.model;if("chatroom"!==f.get("type")){const t=h.head(e.roster.where({jid:f.get("jid")}));h.isUndefined(t)||f.isScrolledUp()||t.save({num_unread:0})}}),e.api.listen.on("chatBoxScrolledDown",function(t){const f=t.chatbox;if(h.isUndefined(f))return;const a=h.head(e.roster.where({jid:f.get("jid")}));h.isUndefined(a)||a.save({num_unread:0})})}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/login_panel.html --\x3e\n
      \n
      \n \n ",e.auto_login||"CONNECTING"===e._converse.CONNECTION_STATUS[e.connection_status]?t+='\n \n ':(t+="\n ",e.authentication!=e.LOGIN&&e.authentication!=e.EXTERNAL||(t+='\n
      \n \n \n
      \n ',e.authentication!==e.EXTERNAL&&(t+='\n
      \n \n \n
      \n '),t+='\n
      \n \n \n
      \n\n
      \n \n
      \n '),t+="\n ",e.authentication==e.ANONYMOUS&&(t+='\n \n '),t+="\n ",e.authentication==e.PREBIND&&(t+="\n

      Disconnected.

      \n "),t+="\n "),t+="\n \n
      \n"}},function(e,t,f){f(1);e.exports=function(e){var t="";Array.prototype.join;return t+='\x3c!-- src/templates/controlbox.html --\x3e\n
      \n'}},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/converse_brand_heading.html --\x3e\n\n \n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/csn.html --\x3e\n
      '+f(e.message)+"
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/spoiler_message.html --\x3e\n
      \n \n
      \n \n '+f(e.username)+'\n '+f(e.pretty_time)+'\n \n
      \n '+f(e.spoiler_hint)+'\n '+f(e.label_show)+'\n
      \n \n
      \n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/message.html --\x3e\n
      \n ',"headline"!==e.type&&(t+='\n \n '),t+='\n
      \n \n '+f(e.username)+"\n ",e.roles.forEach(function(e){t+=' '+f(e)+" "}),t+='\n \n '+f(e.pretty_time)+'\n \n \n
      \n
      \n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/file_progress.html --\x3e\n
      \n \n
      \n Uploading file: '+f(e.file.name)+", "+f(e.filesize)+'\n \n
      \n
      \n'}},function(e,t,f){"use strict";var a,n,o;n=[f(2),f(54),f(13),f(50),f(53),f(225),f(228),f(18),f(227),f(226)],void 0===(o="function"==typeof(a=function(e,t,f,a,n,o,r,s,c,i){const u=e.env,_=u.Backbone,d=u._,l=u.moment,h=e.env.utils;return e.plugins.add("converse-message-view",{initialize(){const e=this._converse,u=e.__;e.ViewWithAvatar=_.NativeView.extend({renderAvatar(){const e=this.el.querySelector("canvas");if(d.isNull(e))return;const t="data:"+this.model.vcard.get("image_type")+";base64,"+this.model.vcard.get("image"),f=new Image;f.onload=(()=>{const t=e.getContext("2d"),a=f.width/f.height;t.clearRect(0,0,e.width,e.height),a<1?t.drawImage(f,0,0,e.width,e.height*(1/a)):t.drawImage(f,0,0,e.width,e.height*a)}),f.src=t}}),e.MessageView=e.ViewWithAvatar.extend({initialize(){this.model.vcard.on("change",this.render,this),this.model.on("change:progress",this.renderFileUploadProgresBar,this),this.model.on("change:type",this.render,this),this.model.on("change:upload",this.render,this),this.model.on("destroy",this.remove,this),this.render()},render(){const e=h.hasClass("chat-msg-followup",this.el);return this.model.isOnlyChatStateNotification()?this.renderChatStateNotification():this.model.get("file")&&!this.model.get("oob_url")?this.renderFileUploadProgresBar():"error"===this.model.get("type")?this.renderErrorMessage():this.renderChatMessage(),e&&h.addClass("chat-msg-followup",this.el),this.el},replaceElement(e){return d.isNil(this.el.parentElement)||this.el.parentElement.replaceChild(e,this.el),this.setElement(e),this.el},renderChatMessage(){let a,o=this.model.get("message");this.isMeCommand()?(a=n,o=this.model.get("message").replace(/^\/me/,"")):a=this.model.get("is_spoiler")?i:c;const r=l(this.model.get("time")),s=this.model.vcard.get("role"),_=s?s.split(","):[],m=h.stringToElement(a(d.extend(this.model.toJSON(),{roles:_,pretty_time:r.format(e.time_format),time:r.format(),extra_classes:this.getExtraMessageClasses(),label_show:u("Show more"),username:this.model.getDisplayName()})));var g=this.model.get("oob_url");g&&(m.querySelector(".chat-msg-media").innerHTML=d.flow(d.partial(h.renderFileURL,e),d.partial(h.renderMovieURL,e),d.partial(h.renderAudioURL,e),d.partial(h.renderImageURL,e))(g));const p=m.querySelector(".chat-msg-text");o!==g&&(o=t.filterXSS(o,{whiteList:{}}),p.innerHTML=d.flow(d.partial(h.geoUriToHttp,d,e.geouri_replacement),h.addHyperlinks,d.partial(h.addEmoji,e,f,d))(o)),h.renderImageURLs(e,p).then(()=>{this.model.collection.trigger("rendered")}),this.replaceElement(m),"headline"!==this.model.get("type")&&this.renderAvatar()},renderErrorMessage(){const e=l(this.model.get("time")),t=h.stringToElement(s(d.extend(this.model.toJSON(),{extra_classes:"chat-error",isodate:e.format(),data:""})));return this.replaceElement(t)},renderChatStateNotification(){let t;const f=this.model.get("from"),a=this.model.getDisplayName();if(this.model.get("chat_state")===e.COMPOSING)t="me"===this.model.get("sender")?u("Typing from another device"):a+" "+u("is typing");else if(this.model.get("chat_state")===e.PAUSED)t="me"===this.model.get("sender")?u("Stopped typing on the other device"):a+" "+u("has stopped typing");else{if(this.model.get("chat_state")!==e.GONE)return;t=a+" "+u("has gone away")}const n=l().format();this.replaceElement(h.stringToElement(o({message:t,from:f,isodate:n})))},renderFileUploadProgresBar(){const e=h.stringToElement(r(d.extend(this.model.toJSON(),{filesize:a(this.model.get("file").size)})));this.replaceElement(e),this.renderAvatar()},isMeCommand(){const e=this.model.get("message");if(!e)return!1;const t=e.match(/^\/(.*?)(?: (.*))?$/);return t&&"me"===t[1]},processMessageText(){var t=this.get("message");t=h.geoUriToHttp(t,e.geouri_replacement)},getExtraMessageClasses(){let e=this.model.get("delayed")?"delayed":"";return"groupchat"===this.model.get("type")&&"them"===this.model.get("sender")&&this.model.collection.chatbox.isUserMentioned(this.model.get("message"))&&(e+=" mentioned"),e}})}}),e})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){f(1);e.exports=function(e){var t="";return t+='\x3c!-- src/templates/chatboxes.html --\x3e\n
      \n
      \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/alert_modal.html --\x3e\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/toolbar.html --\x3e\n",e.use_emoji&&(t+='\n
    • \n \n \n
    • \n'),t+="\n",e.show_call_button&&(t+='\n
    • \n'),t+="\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/status_message.html --\x3e\n
      '+f(e.message)+"
      \n"}},function(e,t,f){f(1);e.exports=function(e){var t,f="";Array.prototype.join;return f+='\x3c!-- src/templates/spoiler_button.html --\x3e\n
    • \n
    • \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="";return t+='\x3c!-- src/templates/toolbar_fileupload.html --\x3e\n
    • \n \n \n
    • \n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/user_details_modal.html --\x3e\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/new_day.html --\x3e\n
      \n
      \n \n
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t,f="",n=a.escape;Array.prototype.join;return f+='\x3c!-- src/templates/help_message.html --\x3e\n
      '+(null==(t=e.message)?"":t)+"
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/error_message.html --\x3e\n
      '+f(e.message)+"
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t,f="",n=a.escape;Array.prototype.join;return f+='\x3c!-- src/templates/emojis.html --\x3e\n
      \n',e._.forEach(e.emojis_by_category,function(a,o){f+='\n \n"}),f+='\n
        \n
      • \n
          \n ',e._.forEach(e.emojis_by_category,function(a,o){f+='\n
        • '+(null==(t=e.transform(e.emojis_by_category[o][0]._shortname))?"":t)+" \n
        • \n "}),f+='\n
        \n
      • \n
      • \n
          \n ',e._.forEach(e.skintones,function(a){f+='\n
        • '+(null==(t=e.transform(":"+a+":"))?"":t)+" \n
        • \n "}),f+="\n
        \n
      • \n
      \n
      \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t,f="",n=a.escape;Array.prototype.join;return f+='\x3c!-- src/templates/chatbox_message_form.html --\x3e\n
      \n\n
      \n ',e.show_toolbar&&(f+='\n
        \n '),f+='\n '+(null==(t=e.message_value)?"":t)+"\n ",e.show_send_button&&(f+='\n \n "),f+="\n
        \n
        \n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chatbox_head.html --\x3e\n
        \n
        \n
        \n \n
        \n ',e.url&&(t+='\n \n '),t+="\n "+f(e.fullname||e.jid)+"\n ",e.url&&(t+="\n \n "),t+='\n

        '+f(e.status)+'

        \n
        \n
        \n
        \n
        \n \n \n
        \n
        \n'}},function(e,t,f){"use strict";var a,n,o;n=[f(2)],void 0===(o="function"==typeof(a=function(e){const t=e.env,f=t.Strophe,a=t.$build,n=t._,o=t.b64_sha1;function r(e,t){return e.sort((e,f)=>e[t]>f[t]?-1:1)}function s(e){return a("c",{xmlns:f.NS.CAPS,hash:"sha-1",node:"https://conversejs.org",ver:function(e){const t=e.api.disco.own.identities.get(),f=e.api.disco.own.features.get();t.length>1&&(r(t,"category"),r(t,"type"),r(t,"lang"));let a=n.reduce(t,(e,t)=>`${e}${t.category}/${t.type}/${n.get(t,"lang","")}/${t.name}<`,"");return f.sort(),a=n.reduce(f,(e,t)=>`${e}${t}<`,a),o(a)}(e)}).nodeTree}f.addNamespace("CAPS","http://jabber.org/protocol/caps"),e.plugins.add("converse-caps",{overrides:{XMPPStatus:{constructPresence(){const e=this.__super__.constructPresence.apply(this,arguments);return e.root().cnode(s(this.__super__._converse)),e}}}})})?a.apply(t,n):a)||(e.exports=o)},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/bookmarks_list.html --\x3e\n\n \n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+='\x3c!-- src/templates/chatroom_bookmark_toggle.html --\x3e\n\n'}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+='\x3c!-- src/templates/chatroom_bookmark_form.html --\x3e\n
        \n
        \n
        \n '+f(e.heading)+"\n \n \n \n \n \n \n
        \n
        \n \n \n
        \n
        \n
        \n'}},function(e,t,f){var a;e.exports=function e(t,f,n){function o(s,c){if(!f[s]){if(!t[s]){var i="function"==typeof a&&a;if(!c&&i)return a(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var _=f[s]={exports:{}};t[s][0].call(_.exports,function(e){var f=t[s][1][e];return o(f||e)},_,_.exports,e,t,f,n)}return f[s].exports}for(var r="function"==typeof a&&a,s=0;s0?u:i.length,m=_>0?_:i.length,g=-1!==u||-1!==_?i.slice(0,Math.min(d,m)):i,b=e.elm=s(a)&&s(f=a.ns)?h.createElementNS(f,g):h.createElement(g);for(d0&&b.setAttribute("class",i.slice(m+1).replace(/\./g," ")),f=0;fl?(c=null==f[y+1]?null:f[y+1].elm,b(e,c,f,d,y,a)):d>y&&v(e,t,_,l)}(o,c,_,f):s(_)?(s(e.text)&&h.setTextContent(o,""),b(o,null,_,0,_.length-1,f)):s(c)?v(o,c,0,c.length-1):s(e.text)&&h.setTextContent(o,""):e.text!==t.text&&h.setTextContent(o,t.text),s(n)&&s(a=n.postpatch)&&a(e,t)}}return function(e,t){var f,n,o,r=[];for(f=0;f\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;return t+="\x3c!-- src/templates/form_url.html --\x3e\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t="",f=a.escape;Array.prototype.join;return t+="\x3c!-- src/templates/form_captcha.html --\x3e\n",e.label&&(t+="\n\n"),t+='\n\n'+f(e.label)+'\n\n"}},function(e,t,f){var a={escape:f(1)};e.exports=function(e){var t,f="",n=a.escape;Array.prototype.join;return f+="\x3c!-- src/templates/form_select.html --\x3e\n