You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
1.1 MiB

function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function nbi(){return new BigInteger(null)}function am1(e,t,n,i,a,o){for(;--o>=0;){var s=t*this[e++]+n[i]+a;a=Math.floor(s/67108864),n[i++]=67108863&s}return a}function am2(e,t,n,i,a,o){for(var s=32767&t,r=t>>15;--o>=0;){var l=32767&this[e],c=this[e++]>>15,d=r*l+c*s;l=s*l+((32767&d)<<15)+n[i]+(1073741823&a),a=(l>>>30)+(d>>>15)+r*c+(a>>>30),n[i++]=1073741823&l}return a}function am3(e,t,n,i,a,o){for(var s=16383&t,r=t>>14;--o>=0;){var l=16383&this[e],c=this[e++]>>14,d=r*l+c*s;l=s*l+((16383&d)<<14)+n[i]+a,a=(l>>28)+(d>>14)+r*c,n[i++]=268435455&l}return a}function int2char(e){return BI_RM.charAt(e)}function intAt(e,t){var n=BI_RC[e.charCodeAt(t)];return null==n?-1:n}function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function bnpFromInt(e){this.t=1,this.s=0>e?-1:0,e>0?this[0]=e:-1>e?this[0]=e+this.DV:this.t=0}function nbv(e){var t=nbi();return t.fromInt(e),t}function bnpFromString(e,t,n){var i;if(16==t)i=4;else if(8==t)i=3;else if(256==t)i=8;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return void this.fromRadix(e,t);i=2}this.t=0,this.s=0;for(var a=e.length,o=!1,s=0;--a>=0;){var r=8==i?255&e[a]:intAt(e,a);0>r?"-"==e.charAt(a)&&(o=!0):(o=!1,0==s?this[this.t++]=r:s+i>this.DB?(this[this.t-1]|=(r&(1<<this.DB-s)-1)<<s,this[this.t++]=r>>this.DB-s):this[this.t-1]|=r<<s,s+=i,s>=this.DB&&(s-=this.DB))}8==i&&0!=(128&e[0])&&n&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}function bnToString(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,i=(1<<t)-1,a=!1,o="",s=this.t,r=this.DB-s*this.DB%t;if(s-->0)for(r<this.DB&&(n=this[s]>>r)>0&&(a=!0,o=int2char(n));s>=0;)t>r?(n=(this[s]&(1<<r)-1)<<t-r,n|=this[--s]>>(r+=this.DB-t)):(n=this[s]>>(r-=t)&i,0>=r&&(r+=this.DB,--s)),n>0&&(a=!0),a&&(o+=int2char(n));return a?o:"0"}function bnNegate(){var e=nbi();return BigInteger.ZERO.subTo(this,e),e}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0}function nbits(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function bnpDRShiftTo(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s}function bnpLShiftTo(e,t){var n,i=e%this.DB,a=this.DB-i,o=(1<<a)-1,s=Math.floor(e/this.DB),r=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+s+1]=this[n]>>a|r,r=(this[n]&o)<<i;for(n=s-1;n>=0;--n)t[n]=0;t[s]=r,t.t=this.t+s+1,t.s=this.s,t.clamp()}function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)return void(t.t=0);var i=e%this.DB,a=this.DB-i,o=(1<<i)-1;t[0]=this[n]>>i;for(var s=n+1;s<this.t;++s)t[s-n-1]|=(this[s]&o)<<a,t[s-n]=this[s]>>i;i>0&&(t[this.t-n-1]|=(this.s&o)<<a),t.t=this.t-n,t.clamp()}function bnpSubTo(e,t){for(var n=0,i=0,a=Math.min(e.t,this.t);a>n;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=0>i?-1:0,-1>i?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()}function bnpMultiplyTo(e,t){var n=this.abs(),i=e.abs(),a=n.t;for(t.t=a+i.t;--a>=0;)t[a]=0;for(a=0;a<i.t;++a)t[a+n.t]=n.am(0,i[a],t,a,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger.ZERO.subTo(t,t)}function bnpSquareTo(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var i=t.a
}function getScrollWidth(){var e=$("<div>").css({position:"absolute",width:100,height:100,overflow:"scroll",top:-9999}).appendTo($(document.body)),t=e[0].offsetWidth-e[0].clientWidth;return e.remove(),t}function onCtrlEnter(e,t){$(e).on("keydown",function(e){return 13==e.keyCode&&(e.ctrlKey||e.metaKey)?(t(),cancelEvent(e)):void 0})}function setFieldSelection(e,t,n){e=$(e)[0];try{if(e.focus(),(void 0===t||t===!1)&&(t=e.value.length),(void 0===n||n===!1)&&(n=t),e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i.select()}else e.setSelectionRange&&e.setSelectionRange(t,n)}catch(a){}}function getFieldSelection(e){if(e.selectionStart)return e.selectionStart;if(!document.selection)return 0;var t="",n=document.selection.createRange(),i=n.text,a=n.duplicate(),o=0;try{a.moveToElementText(e)}catch(s){return 0}return n.text=i+t,o=a.text.indexOf(t),n.moveStart("character",-1),n.text="",o}function getRichValue(e){if(!e)return"";var t=[],n=[];return getRichElementValue(e,t,n),n.length&&t.push(n.join("")),t.join("\n")}function getRichValueWithCaret(e){if(!e)return[];var t,n,i=[],a=[],o=window.getSelection?window.getSelection():!1;if(o&&o.rangeCount){var s=o.getRangeAt(0);s.startContainer&&s.startContainer==s.endContainer&&s.startOffset==s.endOffset&&(t=s.startContainer,n=s.startOffset)}getRichElementValue(e,i,a,t,n),a.length&&i.push(a.join(""));var r=i.join("\n"),l=r.indexOf("");return-1!=l&&(r=r.substr(0,l)+r.substr(l+1)),[r,l]}function getRichElementValue(e,t,n,i,a){if(3!=e.nodeType){if(1==e.nodeType){var o,s="DIV"==e.tagName||"P"==e.tagName;s&&n.length||"BR"==e.tagName?(t.push(n.join("")),n.splice(0,n.length)):"IMG"==e.tagName&&e.alt&&n.push(e.alt),i===e&&n.push("");for(var o=e.firstChild;o;)getRichElementValue(o,t,n,i,a),o=o.nextSibling;s&&n.length&&(t.push(n.join("")),n.splice(0,n.length))}}else if(i===e){var r=e.nodeValue;n.push(r.substr(0,a)+""+r.substr(a))}else n.push(e.nodeValue)}function setRichFocus(e,t){if(e.focus(),window.getSelection&&document.createRange){var n=document.createRange();t?n.selectNode(t):n.selectNodeContents(e),n.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(n)}else if(void 0!==document.body.createTextRange){var a=document.body.createTextRange();a.moveToElementText(t||e),a.collapse(!1),a.select()}}function scrollToNode(e,t,n){var i=t.offsetTop-15,a=t.offsetHeight+30,o=e.scrollTop,s=e.clientHeight;o>i?(e.scrollTop=i,$(n).nanoScroller({flash:!0})):i+a-s>o&&(e.scrollTop=i+a-s,$(n).nanoScroller({flash:!0}))}function onContentLoaded(e){setZeroTimeout(e)}function tsNow(e){var t=+new Date+(window.tsOffset||0);return e?Math.floor(t/1e3):t}function safeReplaceObject(e,t){for(var n in e)t.hasOwnProperty(n)||"$"==n.charAt(0)||delete e[n];for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function listMergeSorted(e,t){e=e||[],t=t||[];for(var n=angular.copy(e),i=e.length?e[e.length-1]:4294967295,a=0;a<t.length;a++)t[a]<i&&n.push(t[a]);return n}function listUniqSorted(e){e=e||[];for(var t=[],n=!1,i=0;i<e.length;i++)e[i]!==n&&t.push(e[i]),n=e[i];return t}function templateUrl(e){var t={confirm_modal:"desktop",error_modal:"desktop",media_modal_layout:"desktop",slider:"desktop",reply_message:"desktop",chat_invite_link_modal:"desktop",reply_markup:"desktop"},n=t[e]||(Config.Mobile?"mobile":"desktop");return"partials/"+n+"/"+e+".html"}function encodeEntities(e){return e.replace(/&/g,"&amp;").replace(/([^\#-~| |!])/g,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function calcImageInBox(e,t,n,i,a){var o=n,s=i;return e/t>n/i?s=parseInt(t*n/e):(o=parseInt(e*i/t),o>n&&(s=parseInt(s*n/o),o=n)),a&&o>=e&&s>=t&&(o=e,s=t),{w:o,h:s}}function versionCompare(e,t){"string"!=typeof e&&(e=""),"string"!=typeof t&&(t=""),e=e.replace(/^\s+|\s+$/g,"").split("."),t=t.replace(/^\s+|\s+$/g,"").split(".");var n,i=Math.max(e.length,t.length);for(n=0;i>n;n++)if(e[n]!=t[n])return e[n]>t[n]?1:-1;return 0}function bigint(e){return new BigInteger(e.toString(16),16)}function bigStringInt(e){return new BigInteger(e,10)}function d
if(1!==(r=t.nodeType)&&9!==r)return[];if(N&&!i){if(a=vt.exec(e))if(s=a[1]){if(9===r){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&L(t,o)&&o.id===s)return n.push(o),n}else{if(a[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((s=a[3])&&w.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(s)),n}if(w.qsa&&(!U||!U.test(e))){if(m=u=B,h=t,g=9===r&&e,1===r&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(u=t.getAttribute("id"))?m=u.replace(bt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=c.length;l--;)c[l]=m+p(c[l]);h=yt.test(e)&&d(t.parentNode)||t,g=c.join(",")}if(g)try{return Q.apply(n,h.querySelectorAll(g)),n}catch(f){}finally{u||t.removeAttribute("id")}}}return x(e.replace(lt,"$1"),t,n,i)}function n(){function e(n,i){return t.push(n+" ")>k.cacheLength&&delete e[t.shift()],e[n+" "]=i}var t=[];return e}function i(e){return e[B]=!0,e}function a(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),i=e.length;i--;)k.attrHandle[n[i]]=t}function s(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||K)-(~e.sourceIndex||K);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,i){for(var a,o=e([],n.length,t),s=o.length;s--;)n[a=o[s]]&&(n[a]=!(i[a]=n[a]))})})}function d(e){return e&&typeof e.getElementsByTagName!==G&&e}function u(){}function p(e){for(var t=0,n=e.length,i="";n>t;t++)i+=e[t].value;return i}function m(e,t,n){var i=t.dir,a=n&&"parentNode"===i,o=j++;return t.first?function(t,n,o){for(;t=t[i];)if(1===t.nodeType||a)return e(t,n,o)}:function(t,n,s){var r,l,c=[q,o];if(s){for(;t=t[i];)if((1===t.nodeType||a)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||a){if(l=t[B]||(t[B]={}),(r=l[i])&&r[0]===q&&r[1]===o)return c[2]=r[2];if(l[i]=c,c[2]=e(t,n,s))return!0}}}function h(e){return e.length>1?function(t,n,i){for(var a=e.length;a--;)if(!e[a](t,n,i))return!1;return!0}:e[0]}function g(e,n,i){for(var a=0,o=n.length;o>a;a++)t(e,n[a],i);return i}function f(e,t,n,i,a){for(var o,s=[],r=0,l=e.length,c=null!=t;l>r;r++)(o=e[r])&&(!n||n(o,i,a))&&(s.push(o),c&&t.push(r));return s}function _(e,t,n,a,o,s){return a&&!a[B]&&(a=_(a)),o&&!o[B]&&(o=_(o,s)),i(function(i,s,r,l){var c,d,u,p=[],m=[],h=s.length,_=i||g(t||"*",r.nodeType?[r]:r,[]),v=!e||!i&&t?_:f(_,p,e,r,l),y=n?o||(i?e:h||a)?[]:s:v;if(n&&n(v,y,r,l),a)for(c=f(y,m),a(c,[],r,l),d=c.length;d--;)(u=c[d])&&(y[m[d]]=!(v[m[d]]=u));if(i){if(o||e){if(o){for(c=[],d=y.length;d--;)(u=y[d])&&c.push(v[d]=u);o(null,y=[],c,l)}for(d=y.length;d--;)(u=y[d])&&(c=o?tt.call(i,u):p[d])>-1&&(i[c]=!(s[c]=u))}}else y=f(y===s?y.splice(h,y.length):y),o?o(null,s,y,l):Q.apply(s,y)})}function v(e){for(var t,n,i,a=e.length,o=k.relative[e[0].type],s=o||k.relative[" "],r=o?1:0,l=m(function(e){return e===t},s,!0),c=m(function(e){return tt.call(t,e)>-1},s,!0),d=[function(e,n,i){return!o&&(i||n!==A)||((t=n).nodeType?l(e,n,i):c(e,n,i))}];a>r;r++)if(n=k.relative[e[r].type])d=[m(h(d),n)];else{if(n=k.filter[e[r].type].apply(null,e[r].matches),n[B]){for(i=++r;a>i&&!k.relative[e[i].type];i++);return _(r>1&&h(d),r>1&&p(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(lt,"$1"),n,i>r&&v(e.slice(r,i)),a>i&&v(e=e.slice(i)),a>i&&p(e))}d.push(n)}return h(d)}function y(e,n){var a=n.length>0,o=e.length>0,s=function(i,s,r,l,c){var d,u,p,m=0,h="0",g=i&&[],_=[],v=A,y=i||o&&k.find.TAG("*",c),b=q+=null==v?1:Math.random()||.1,w=y.length;for(c&&(A=s!==D&&s);h!==w&&null!=(d=y[h]);h++){if(o&&d){for(u=0;p=e[u++];)if(p(d,s,r)){l.push(d);break}c&&(q=b)}a&&((d=!p&&d)&&m--,i&&g.push(d))}if(m+=h,a&&h!==m){for(u=0;p=n[u++];)p(g,_,s,r);if(i){if(m>0)for(;h--;)g[h]||_[h]||(_[h]=X.cal
l&&!p.length&&(u.teardown&&u.teardown.call(e,h,f.handle)!==!1||at.removeEvent(e,m,f.handle),delete d[m])}else for(m in d)at.event.remove(e,m+t[c],n,i,!0);at.isEmptyObject(d)&&(delete f.handle,at._removeData(e,"events"))}},trigger:function(t,n,i,a){var o,s,r,l,c,d,u,p=[i||ht],m=tt.call(t,"type")?t.type:t,h=tt.call(t,"namespace")?t.namespace.split("."):[];if(r=d=i=i||ht,3!==i.nodeType&&8!==i.nodeType&&!Nt.test(m+at.event.triggered)&&(m.indexOf(".")>=0&&(h=m.split("."),m=h.shift(),h.sort()),s=m.indexOf(":")<0&&"on"+m,t=t[at.expando]?t:new at.Event(m,"object"==typeof t&&t),t.isTrigger=a?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:at.makeArray(n,[t]),c=at.event.special[m]||{},a||!c.trigger||c.trigger.apply(i,n)!==!1)){if(!a&&!c.noBubble&&!at.isWindow(i)){for(l=c.delegateType||m,Nt.test(l+m)||(r=r.parentNode);r;r=r.parentNode)p.push(r),d=r;d===(i.ownerDocument||ht)&&p.push(d.defaultView||d.parentWindow||e)}for(u=0;(r=p[u++])&&!t.isPropagationStopped();)t.type=u>1?l:c.bindType||m,o=(at._data(r,"events")||{})[t.type]&&at._data(r,"handle"),o&&o.apply(r,n),o=s&&r[s],o&&o.apply&&at.acceptData(r)&&(t.result=o.apply(r,n),t.result===!1&&t.preventDefault());if(t.type=m,!a&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(p.pop(),n)===!1)&&at.acceptData(i)&&s&&i[m]&&!at.isWindow(i)){d=i[s],d&&(i[s]=null),at.event.triggered=m;try{i[m]()}catch(g){}at.event.triggered=void 0,d&&(i[s]=d)}return t.result}},dispatch:function(e){e=at.event.fix(e);var t,n,i,a,o,s=[],r=Y.call(arguments),l=(at._data(this,"events")||{})[e.type]||[],c=at.event.special[e.type]||{};if(r[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=at.event.handlers.call(this,e,l),t=0;(a=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,o=0;(i=a.handlers[o++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,n=((at.event.special[i.origType]||{}).handle||i.handler).apply(a.elem,r),void 0!==n&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,a,o,s=[],r=t.delegateCount,l=e.target;if(r&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(a=[],o=0;r>o;o++)i=t[o],n=i.selector+" ",void 0===a[n]&&(a[n]=i.needsContext?at(n,this).index(l)>=0:at.find(n,this,null,[l]).length),a[n]&&a.push(i);a.length&&s.push({elem:l,handlers:a})}return r<t.length&&s.push({elem:this,handlers:t.slice(r)}),s},fix:function(e){if(e[at.expando])return e;var t,n,i,a=e.type,o=e,s=this.fixHooks[a];for(s||(this.fixHooks[a]=s=Pt.test(a)?this.mouseHooks:Dt.test(a)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new at.Event(o),t=i.length;t--;)n=i[t],e[n]=o[n];return e.target||(e.target=o.srcElement||ht),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,a,o=t.button,s=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=e.target.ownerDocument||ht,a=i.documentElement,n=i.body,e.pageX=t.clientX+(a&&a.scrollLeft||n&&n.scrollLeft||0)-(a&&a.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(a&&a.scrollTop||n&&n.scrollTop||0)-(a&&a.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?t.toElement:s),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus)try{return this.foc
}}}),nt.optSelected||(at.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),at.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){at.propFix[this.toLowerCase()]=this}),nt.enctype||(at.propFix.enctype="encoding");var Tn=/[\t\r\n\f]/g;at.fn.extend({addClass:function(e){var t,n,i,a,o,s,r=0,l=this.length,c="string"==typeof e&&e;if(at.isFunction(e))return this.each(function(t){at(this).addClass(e.call(this,t,this.className))});if(c)for(t=(e||"").match(yt)||[];l>r;r++)if(n=this[r],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Tn," "):" ")){for(o=0;a=t[o++];)i.indexOf(" "+a+" ")<0&&(i+=a+" ");s=at.trim(i),n.className!==s&&(n.className=s)}return this},removeClass:function(e){var t,n,i,a,o,s,r=0,l=this.length,c=0===arguments.length||"string"==typeof e&&e;if(at.isFunction(e))return this.each(function(t){at(this).removeClass(e.call(this,t,this.className))});if(c)for(t=(e||"").match(yt)||[];l>r;r++)if(n=this[r],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Tn," "):"")){for(o=0;a=t[o++];)for(;i.indexOf(" "+a+" ")>=0;)i=i.replace(" "+a+" "," ");s=e?at.trim(i):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):this.each(at.isFunction(e)?function(n){at(this).toggleClass(e.call(this,n,this.className,t),t)}:function(){if("string"===n)for(var t,i=0,a=at(this),o=e.match(yt)||[];t=o[i++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else(n===$t||"boolean"===n)&&(this.className&&at._data(this,"__className__",this.className),this.className=this.className||e===!1?"":at._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;i>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Tn," ").indexOf(t)>=0)return!0;return!1}}),at.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){at.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),at.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var In=at.now(),Dn=/\?/,Pn=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;at.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,i=null,a=at.trim(t+"");return a&&!at.trim(a.replace(Pn,function(e,t,a,o){return n&&t&&(i=0),0===i?e:(n=a||t,i+=!o-!a,"")}))?Function("return "+a)():at.error("Invalid JSON: "+t)},at.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(a){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||at.error("Invalid XML: "+t),n};var Nn,Un,On=/#.*$/,Rn=/([?&])_=[^&]*/,Ln=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Bn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fn=/^(?:GET|HEAD)$/,qn=/^\/\//,jn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hn={},zn={},Vn="*/".concat("*");try{Un=location.href}catch(Wn){Un=ht.createElement("a"),Un.href="",Un=Un.href}Nn=jn.exec(Un.toLowerCase())||[],at.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Un,type:"GET",isLocal:Bn.test(Nn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Vn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},conten
}function n(){l=!0}function i(){return l?(l=!1,""):r}function a(){var e,t,n,a=Array.prototype.slice.call(arguments),o=a.pop(),s=[],r=1==a.length,l=!0,p=i();for(t=0;t<a.length;t++)if(n=a[t]=p+a[t],"xt_"!=n.substr(0,3)&&void 0!==c[n])s.push(c[n]);else if(u){try{e=localStorage.getItem(n)}catch(m){u=!1}try{e=void 0===e||null===e?!1:JSON.parse(e)}catch(m){e=!1}s.push(c[n]=e)}else d?l=!1:s.push(c[n]=!1);return l?o(r?s[0]:s):void chrome.storage.local.get(a,function(e){var i;for(s=[],t=0;t<a.length;t++)n=a[t],i=e[n],i=void 0===i||null===i?!1:JSON.parse(i),s.push(c[n]=i);o(r?s[0]:s)})}function o(e,t){var n,a,o={},s=i();for(n in e)if(e.hasOwnProperty(n))if(a=e[n],n=s+n,c[n]=a,a=JSON.stringify(a),u)try{localStorage.setItem(n,a)}catch(r){u=!1}else o[n]=a;return u||!d?void(t&&t()):void chrome.storage.local.set(o,t)}function s(){var e,t,n,a=Array.prototype.slice.call(arguments),o=i();for("function"==typeof a[a.length-1]&&(n=a.pop()),e=0;e<a.length;e++)if(t=a[e]=o+a[e],delete c[t],u)try{localStorage.removeItem(t)}catch(s){u=!1}d?chrome.storage.local.remove(a,n):n&&n()}var r="",l=!1,c={},d=!!(e.chrome&&chrome.storage&&chrome.storage.local),u=!d&&!!e.localStorage;e.ConfigStorage={prefix:t,noPrefix:n,get:a,set:o,remove:s}}(this),function(){try{window==window.top||window.chrome&&chrome.app&&chrome.app.window?document.documentElement.style.display="block":top.location=self.location}catch(e){console.error("CJ protection",e)}if(window.safeConfirm=function(e,t){"string"==typeof e&&(e={message:e});var n=!1;try{n=confirm(e.message)}catch(i){n=!0}setTimeout(function(){t(n)},10)},window.applicationCache&&!Config.Modes.packed&&window.addEventListener){var t=window.applicationCache,n=!1,i=!1,a=function(e){clearTimeout(i),i=setTimeout(function(){try{t.update()}catch(e){console.log("appCache.update: "+e)}},e||3e5)},o=function(){t.addEventListener("updateready",function(){t.status==t.UPDATEREADY&&(n||(safeConfirm({type:"WEBOGRAM_UPDATED_RELOAD",message:"A new version of Webogram is downloaded. Launch it?"},function(e){e?window.location.reload():n=!0}),a()))},!1),t.addEventListener("noupdate",function(){a()},!1),t.addEventListener("error",function(){a()},!1)};a(3e3),window.addEventListener("load",o)}}(),function(){var e=[Config.Navigator.osX?"osx":"non_osx",Config.Navigator.retina?"is_2x":"is_1x"];Config.Modes.ios_standalone&&e.push("ios_standalone"),$(document.body).addClass(e.join(" ")),ConfigStorage.get("layout_selected","i18n_locale",function(e){var t=e[0],n=e[1],i="en-us",a={dom:!1,i18n_ng:!1,i18n_messages:!1,i18n_fallback:!1},o=function(){var e,t=!0;for(e in a)if(a.hasOwnProperty(e)&&a[e]===!1){t=!1;break}t&&(a.boot=!1,angular.bootstrap(document,["myApp"]))};switch(t){case"mobile":Config.Mobile=!0;break;case"desktop":Config.Mobile=!1;break;default:var s=$(window).width();Config.Mobile=Config.Navigator.mobile||s>10&&480>s}$("head").append('<link rel="stylesheet" href="css/'+(Config.Mobile?"mobile.css":"desktop.css")+'" />'),n||(n=(navigator.language||"").toLowerCase(),n=Config.I18n.aliases[n]||n);for(var r=0;r<Config.I18n.supported.length;r++)if(Config.I18n.supported[r]==n){Config.I18n.locale=n;break}a.i18n_ng=Config.I18n.locale==i,$.getJSON("js/locales/"+Config.I18n.locale+".json").success(function(e){Config.I18n.messages=e,a.i18n_messages=!0,Config.I18n.locale==i&&(a.i18n_fallback=!0),o()}),Config.I18n.locale!=i&&$.getJSON("js/locales/"+i+".json").success(function(e){Config.I18n.fallback_messages=e,a.i18n_fallback=!0,o()}),$(document).ready(function(){a.dom=!0,a.i18n_ng?o():$("<script>").appendTo("body").on("load",function(){a.i18n_ng=!0,o()}).attr("src","vendor/angular/i18n/angular-locale_"+Config.I18n.locale+".js")})})}(),function(e,t,n){"use strict";var i,a,o,s,r,l,c,d,u,p,m,h,g,f,_,v,y,b,w,k,$,S,C,M,x,A,E,T,I,D,P;C={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},b="scrollbar",y="scroll",u="mousedown",p="mouseenter",m="mousemove",g="mousewh
}),t}function o(){var e=r.yOffset;if($(e))e=e();else if(I(e)){var n=e[0],i=t.getComputedStyle(n);e="fixed"!==i.position?0:n.getBoundingClientRect().bottom}else w(e)||(e=0);return e}function s(e){if(e){e.scrollIntoView();var n=o();if(n){var i=e.getBoundingClientRect().top;t.scrollBy(0,i-n)}}else t.scrollTo(0,0)}function r(){var e,t=n.hash();t?(e=l.getElementById(t))?s(e):(e=a(l.getElementsByName(t)))?s(e):"top"===t&&s(null):s(null)}var l=t.document;return e&&i.$watch(function(){return n.hash()},function(e,t){(e!==t||""!==e)&&Dt(function(){i.$evalAsync(r)})}),r}]}function jt(){this.$get=["$$rAF","$timeout",function(e,t){return e.supported?function(t){return e(t)}:function(e){return t(e,0,!1)}}]}function Ht(e,t,i,a){function s(e){try{e.apply(null,B(arguments,1))}finally{if(k--,0===k)for(;$.length;)try{$.pop()()}catch(t){i.error(t)}}}function r(e,t){!function n(){o(C,function(e){e()}),S=t(n,e)}()}function l(){c(),d()}function c(){M=e.history.state,M=_(M)?null:M,R(M,P)&&(M=P),P=M}function d(){(A!==p.url()||x!==M)&&(A=p.url(),x=M,o(I,function(e){e(p.url(),M)}))}function u(e){try{return decodeURIComponent(e)}catch(t){return e}}var p=this,m=t[0],g=e.location,f=e.history,v=e.setTimeout,y=e.clearTimeout,w={};p.isMock=!1;var k=0,$=[];p.$$completeOutstandingRequest=s,p.$$incOutstandingRequestCount=function(){k++},p.notifyWhenNoOutstandingRequests=function(e){o(C,function(e){e()}),0===k?e():$.push(e)};var S,C=[];p.addPollFn=function(e){return _(S)&&r(100,v),C.push(e),e};var M,x,A=g.href,E=t.find("base"),T=null;c(),x=M,p.url=function(t,n,i){if(_(i)&&(i=null),g!==e.location&&(g=e.location),f!==e.history&&(f=e.history),t){var o=x===i;if(A===t&&(!a.history||o))return;var s=A&&_n(A)===_n(t);return A=t,x=i,!a.history||s&&o?(s||(T=t),n?g.replace(t):g.href=t):(f[n?"replaceState":"pushState"](i,"",t),c(),x=M),p}return T||g.href.replace(/%27/g,"'")},p.state=function(){return M};var I=[],D=!1,P=null;p.onUrlChange=function(t){return D||(a.history&&Vi(e).on("popstate",l),Vi(e).on("hashchange",l),D=!0),I.push(t),t},p.$$checkUrlChange=d,p.baseHref=function(){var e=E.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var N={},U="",O=p.baseHref();p.cookies=function(e,t){var a,o,s,r,l;if(!e){if(m.cookie!==U)for(U=m.cookie,o=U.split("; "),N={},r=0;r<o.length;r++)s=o[r],l=s.indexOf("="),l>0&&(e=u(s.substring(0,l)),N[e]===n&&(N[e]=u(s.substring(l+1))));return N}t===n?m.cookie=encodeURIComponent(e)+"=;path="+O+";expires=Thu, 01 Jan 1970 00:00:00 GMT":b(t)&&(a=(m.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path="+O).length+1,a>4096&&i.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+a+" > 4096 bytes)!"))},p.defer=function(e,t){var n;return k++,n=v(function(){delete w[n],s(e)},t||0),w[n]=!0,n},p.defer.cancel=function(e){return w[e]?(delete w[e],y(e),s(h),!0):!1}}function zt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,n,i){return new Ht(e,i,t,n)}]}function Vt(){this.$get=function(){function e(e,n){function a(e){e!=p&&(m?m==e&&(m=e.n):m=e,o(e.n,e.p),o(e,p),p=e,p.n=null)}function o(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in t)throw i("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var s=0,r=u({},n,{id:e}),l={},c=n&&n.capacity||Number.MAX_VALUE,d={},p=null,m=null;return t[e]={put:function(e,t){if(c<Number.MAX_VALUE){var n=d[e]||(d[e]={key:e});a(n)}if(!_(t))return e in l||s++,l[e]=t,s>c&&this.remove(m.key),t},get:function(e){if(c<Number.MAX_VALUE){var t=d[e];if(!t)return;a(t)}return l[e]},remove:function(e){if(c<Number.MAX_VALUE){var t=d[e];if(!t)return;t==p&&(p=t.p),t==m&&(m=t.n),o(t.n,t.p),delete d[e]}delete l[e],s--},removeAll:function(){l={},s=0,d={},p=m=null},destroy:function(){l=null,r=null,d=null,delete t[e]},info:function(){return u({},r,{size:s})}}}var t={};return e.info=function(){var e={};return o(t,function(t,n){e[n]=t.info()}),e},e.get=function(e){return t[e]},e}}function Wt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function Gt(e,i){function a(e,t){var n=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,i={};return o(e,function(e,a){var o=e.match(n
}}),c.absUrl()!=m&&a.url(c.absUrl(),!0);var g=!0;return a.onUrlChange(function(e,t){i.$evalAsync(function(){var n=c.absUrl(),a=c.$$state;c.$$parse(e),c.$$state=t,i.$broadcast("$locationChangeStart",e,n,t,a).defaultPrevented?(c.$$parse(n),c.$$state=a,r(n,!1,a)):(g=!1,l(n,a))}),i.$$phase||i.$digest()}),i.$watch(function(){var e=a.url(),t=a.state(),n=c.$$replace,s=e!==c.absUrl()||c.$$html5&&o.history&&t!==c.$$state;(g||s)&&(g=!1,i.$evalAsync(function(){i.$broadcast("$locationChangeStart",c.absUrl(),e,c.$$state,t).defaultPrevented?(c.$$parse(e),c.$$state=t):(s&&r(c.absUrl(),n,t===c.$$state?null:c.$$state),l(e,t))})),c.$$replace=!1}),c}]}function Mn(){var e=!0,t=this;this.debugEnabled=function(t){return v(t)?(e=t,this):e},this.$get=["$window",function(n){function i(e){return e instanceof Error&&(e.stack?e=e.message&&-1===e.stack.indexOf(e.message)?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function a(e){var t=n.console||{},a=t[e]||t.log||h,s=!1;try{s=!!a.apply}catch(r){}return s?function(){var e=[];return o(arguments,function(t){e.push(i(t))}),a.apply(t,e)}:function(e,t){a(e,null==t?"":t)}}return{log:a("log"),info:a("info"),warn:a("warn"),error:a("error"),debug:function(){var n=a("debug");return function(){e&&n.apply(t,arguments)}}()}}]}function xn(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw Xa("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function An(e,t){if(e){if(e.constructor===e)throw Xa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw Xa("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw Xa("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw Xa("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function En(e,t){if(e){if(e.constructor===e)throw Xa("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===Ja||e===Qa||e===eo)throw Xa("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function Tn(e){return e.constant}function In(e,t,n,i){An(e,i);for(var a,o=t.split("."),s=0;o.length>1;s++){a=xn(o.shift(),i);var r=An(e[a],i);r||(r={},e[a]=r),e=r}return a=xn(o.shift(),i),An(e[a],i),e[a]=n,n}function Dn(e){return"constructor"==e}function Pn(e,t,i,a,o,s,r){xn(e,s),xn(t,s),xn(i,s),xn(a,s),xn(o,s);var l=function(e){return An(e,s)},c=r||Dn(e)?l:g,d=r||Dn(t)?l:g,u=r||Dn(i)?l:g,p=r||Dn(a)?l:g,m=r||Dn(o)?l:g;return function(s,r){var l=r&&r.hasOwnProperty(e)?r:s;return null==l?l:(l=c(l[e]),t?null==l?n:(l=d(l[t]),i?null==l?n:(l=u(l[i]),a?null==l?n:(l=p(l[a]),o?null==l?n:l=m(l[o]):l):l):l):l)}}function Nn(e,t){return function(n,i){return e(n,i,An,t)}}function Un(e,t,i){var a=t.expensiveChecks,s=a?ro:so,r=s[e];if(r)return r;var l=e.split("."),c=l.length;if(t.csp)r=6>c?Pn(l[0],l[1],l[2],l[3],l[4],i,a):function(e,t){var o,s=0;do o=Pn(l[s++],l[s++],l[s++],l[s++],l[s++],i,a)(e,t),t=n,e=o;while(c>s);return o};else{var d="";a&&(d+="s = eso(s, fe);\nl = eso(l, fe);\n");var u=a;o(l,function(e,t){xn(e,i);var n=(t?"s":'((l&&l.hasOwnProperty("'+e+'"))?l:s)')+"."+e;(a||Dn(e))&&(n="eso("+n+", fe)",u=!0),d+="if(s == null) return undefined;\ns="+n+";\n"}),d+="return s;";var p=new Function("s","l","eso","fe",d);p.toString=f(d),u&&(p=Nn(p,i)),r=p}return r.sharedGetter=!0,r.assign=function(t,n){return In(t,e,n,e)},s[e]=r,r}function On(e){return $(e.valueOf)?e.valueOf():lo.call(e)}function Rn(){var e=lt(),t=lt();this.$get=["$filter","$sniffer",function(n,i){function a(e){var t=e;return e.sharedGetter&&(t=function(t,n){return e(t,n)},t.literal=e.literal,t.constant=e.constant,t.assign=e.assign),t}function s(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.constant||(a.inputs?s(a.inputs,t):-1===t.indexOf(a)&&t.push(
},i.$observe("min",function(e){v(e)&&!w(e)&&(e=parseFloat(e,10)),r=w(e)&&!isNaN(e)?e:n,a.$validate()})}if(i.max||i.ngMax){var l;a.$validators.max=function(e){return a.$isEmpty(e)||_(l)||l>=e},i.$observe("max",function(e){v(e)&&!w(e)&&(e=parseFloat(e,10)),l=w(e)&&!isNaN(e)?e:n,a.$validate()})}}function Ei(e,t,n,i,a,o){$i(e,t,n,i,a,o),wi(i),i.$$parserName="url",i.$validators.url=function(e){return i.$isEmpty(e)||Ao.test(e)}}function Ti(e,t,n,i,a,o){$i(e,t,n,i,a,o),wi(i),i.$$parserName="email",i.$validators.email=function(e){return i.$isEmpty(e)||Eo.test(e)}}function Ii(e,t,n,i){_(n.name)&&t.attr("name",c());var a=function(e){t[0].checked&&i.$setViewValue(n.value,e&&e.type)};t.on("click",a),i.$render=function(){var e=n.value;t[0].checked=e==i.$viewValue},n.$observe("value",i.$render)}function Di(e,t,n,a,o){var s;if(v(a)){if(s=e(a),!s.constant)throw i("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,a);return s(t)}return o}function Pi(e,t,n,i,a,o,s,r){var l=Di(r,e,"ngTrueValue",n.ngTrueValue,!0),c=Di(r,e,"ngFalseValue",n.ngFalseValue,!1),d=function(e){i.$setViewValue(t[0].checked,e&&e.type)};t.on("click",d),i.$render=function(){t[0].checked=i.$viewValue},i.$isEmpty=function(e){return e!==l},i.$formatters.push(function(e){return R(e,l)}),i.$parsers.push(function(e){return e?l:c})}function Ni(e){function t(e,t,l){t===n?i("$pending",e,l):a("$pending",e,l),E(t)?t?(u(r.$error,e,l),d(r.$$success,e,l)):(d(r.$error,e,l),u(r.$$success,e,l)):(u(r.$error,e,l),u(r.$$success,e,l)),r.$pending?(o(Wo,!0),r.$valid=r.$invalid=n,s("",null)):(o(Wo,!1),r.$valid=Ui(r.$error),r.$invalid=!r.$valid,s("",r.$valid));var c;c=r.$pending&&r.$pending[e]?n:r.$error[e]?!1:r.$$success[e]?!0:null,s(e,c),p.$setValidity(e,c,r)}function i(e,t,n){r[e]||(r[e]={}),d(r[e],t,n)}function a(e,t,i){r[e]&&u(r[e],t,i),Ui(r[e])&&(r[e]=n)}function o(e,t){t&&!c[e]?(m.addClass(l,e),c[e]=!0):!t&&c[e]&&(m.removeClass(l,e),c[e]=!1)}function s(e,t){e=e?"-"+tt(e,"-"):"",o(Fo+e,t===!0),o(qo+e,t===!1)}var r=e.ctrl,l=e.$element,c={},d=e.set,u=e.unset,p=e.parentForm,m=e.$animate;c[qo]=!(c[Fo]=l.hasClass(Fo)),r.$setValidity=t}function Ui(e){if(e)for(var t in e)return!1;return!0}function Oi(e,t){return e="ngClass"+e,["$animate",function(n){function i(e,t){var n=[];e:for(var i=0;i<e.length;i++){for(var a=e[i],o=0;o<t.length;o++)if(a==t[o])continue e;n.push(a)}return n}function a(e){if(na(e))return e;if(b(e))return e.split(" ");if(y(e)){var t=[];return o(e,function(e,n){e&&(t=t.concat(n.split(" ")))}),t}return e}return{restrict:"AC",link:function(s,r,l){function c(e){var t=u(e,1);l.$addClass(t)}function d(e){var t=u(e,-1);l.$removeClass(t)}function u(e,t){var n=r.data("$classCounts")||{},i=[];return o(e,function(e){(t>0||n[e])&&(n[e]=(n[e]||0)+t,n[e]===+(t>0)&&i.push(e))}),r.data("$classCounts",n),i.join(" ")}function p(e,t){var a=i(t,e),o=i(e,t);a=u(a,1),o=u(o,-1),a&&a.length&&n.addClass(r,a),o&&o.length&&n.removeClass(r,o)}function m(e){if(t===!0||s.$index%2===t){var n=a(e||[]);if(h){if(!R(e,h)){var i=a(h);p(i,n)}}else c(n)}h=O(e)}var h;s.$watch(l[e],m,!0),l.$observe("class",function(){m(s.$eval(l[e]))}),"ngClass"!==e&&s.$watch("$index",function(n,i){var o=1&n;if(o!==(1&i)){var r=a(s.$eval(l[e]));o===t?c(r):d(r)}})}}}]}var Ri=/^\/(.+)\/([a-z]*)$/,Li="validity",Bi=function(e){return b(e)?e.toLowerCase():e},Fi=Object.prototype.hasOwnProperty,qi=function(e){return b(e)?e.toUpperCase():e},ji=function(e){return b(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(32|e.charCodeAt(0))}):e},Hi=function(e){return b(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(-33&e.charCodeAt(0))}):e};"i"!=="I".toLowerCase()&&(Bi=ji,qi=Hi);var zi,Vi,Wi,Gi,Ki=[].slice,Yi=[].splice,Zi=[].push,Xi=Object.prototype.toString,Ji=i("ng"),Qi=e.angular||(e.angular={}),ea=0;zi=t.documentMode,h.$inject=[],g.$inject=[];var ta,na=Array.isArray,ia=function(e){return b(e)?e.trim():e},aa=function(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},oa=function(){if(v(oa.isActive_))return oa.isActive_;var e=!(!t.querySelector("[ng-csp]")&
a.$$setOptions(i[2]&&i[2].$options),o.$addControl(a),n.$observe("name",function(e){a.$name!==e&&o.$$renameControl(a,e)}),e.$on("$destroy",function(){o.$removeControl(a)})},post:function(e,t,n,i){var a=i[0];a.$options&&a.$options.updateOn&&t.on(a.$options.updateOn,function(e){a.$$debounceViewValueCommit(e&&e.type)}),t.on("blur",function(){a.$touched||e.$apply(function(){a.$setTouched()})})}}}}},Yo=f({restrict:"A",require:"ngModel",link:function(e,t,n,i){i.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),Zo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){i&&(n.required=!0,i.$validators.required=function(e){return!n.required||!i.$isEmpty(e)},n.$observe("required",function(){i.$validate()}))}}},Xo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,a,o){if(o){var s,r=a.ngPattern||a.pattern;a.$observe("pattern",function(e){if(b(e)&&e.length>0&&(e=new RegExp(e)),e&&!e.test)throw i("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",r,e,z(t));s=e||n,o.$validate()}),o.$validators.pattern=function(e){return o.$isEmpty(e)||_(s)||s.test(e)}}}}},Jo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var a=0;n.$observe("maxlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.maxlength=function(e,t){return i.$isEmpty(e)||t.length<=a}}}}},Qo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){if(i){var a=0;n.$observe("minlength",function(e){a=p(e)||0,i.$validate()}),i.$validators.minlength=function(e,t){return i.$isEmpty(e)||t.length>=a}}}}},es=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,i,a){var s=t.attr(i.$attr.ngList)||", ",r="false"!==i.ngTrim,l=r?ia(s):s,c=function(e){if(!_(e)){var t=[];return e&&o(e.split(l),function(e){e&&t.push(r?ia(e):e)}),t}};a.$parsers.push(c),a.$formatters.push(function(e){return na(e)?e.join(s):n}),a.$isEmpty=function(e){return!e||!e.length}}}},ts=/^(true|false|\d+)$/,ns=function(){return{restrict:"A",priority:100,compile:function(e,t){return ts.test(t.ngValue)?function(e,t,n){n.$set("value",e.$eval(n.ngValue))}:function(e,t,n){e.$watch(n.ngValue,function(e){n.$set("value",e)})}}}},is=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var i=this;this.$options=e.$eval(t.ngModelOptions),this.$options.updateOn!==n?(this.$options.updateOnDefault=!1,this.$options.updateOn=ia(this.$options.updateOn.replace(Oo,function(){return i.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},as=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,i,a){e.$$addBindingInfo(i,a.ngBind),i=i[0],t.$watch(a.ngBind,function(e){i.textContent=e===n?"":e})}}}}],os=["$interpolate","$compile",function(e,t){return{compile:function(i){return t.$$addBindingClass(i),function(i,a,o){var s=e(a.attr(o.$attr.ngBindTemplate));t.$$addBindingInfo(a,s.expressions),a=a[0],o.$observe("ngBindTemplate",function(e){a.textContent=e===n?"":e})}}}}],ss=["$sce","$parse","$compile",function(e,t,n){return{restrict:"A",compile:function(i,a){var o=t(a.ngBindHtml),s=t(a.ngBindHtml,function(e){return(e||"").toString()});return n.$$addBindingClass(i),function(t,i,a){n.$$addBindingInfo(i,a.ngBindHtml),t.$watch(s,function(){i.html(e.getTrustedHtml(o(t))||"")})}}}}],rs=Oi("",!0),ls=Oi("Odd",0),cs=Oi("Even",1),ds=vi({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),us=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ps={},ms={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(e){var t=Kt("ng-"+e);ps[t]=["$parse","$rootScope",function(n,i){return{restrict:"A",compile:function(a,o){var s=n(o[t],null,!0);return function(t,n){n.on(e,function(n){var a=function(){s(t,{$event:n})};ms[e]&&i.$$phase?t.$evalAsync(a):t.$apply(a)})}}}}]});var hs=["$animate",function(e){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,rest
return e=p(e)?e:e.split(/\s+/),d(e,function(e,i){e&&e.length>0&&(n+=(i>0?" ":"")+e+t)}),n}var E,T,I,D,P="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(P="-webkit-",E="WebkitTransition",T="webkitTransitionEnd transitionend"):(E="transition",T="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(P="-webkit-",I="WebkitAnimation",D="webkitAnimationEnd animationend"):(I="animation",D="animationend");var N,U="Duration",O="Property",R="Delay",L="IterationCount",B="PlayState",F="$$ngAnimateKey",q="$$ngAnimateCSS3Data",j=3,H=1.5,z=1e3,V={},W=0,G=[],K=null,Y=0,Z=[];return{animate:function(e,t,n,i,a,o){return o=o||{},o.from=n,o.to=i,M("animate",e,t,a,o)},enter:function(e,t,n){return n=n||{},M("enter",e,"ng-enter",t,n)},leave:function(e,t,n){return n=n||{},M("leave",e,"ng-leave",t,n)},move:function(e,t,n){return n=n||{},M("move",e,"ng-move",t,n)},beforeSetClass:function(e,t,n,i,a){a=a||{};var o=A(n,"-remove")+" "+A(t,"-add"),s=S("setClass",e,o,a.from);return s?(u(e,i),s):(l(),void i())},beforeAddClass:function(e,t,n,i){i=i||{};var a=S("addClass",e,A(t,"-add"),i.from);return a?(u(e,n),a):(l(),void n())},beforeRemoveClass:function(e,t,n,i){i=i||{};var a=S("removeClass",e,A(t,"-remove"),i.from);return a?(u(e,n),a):(l(),void n())},setClass:function(e,t,n,i,a){a=a||{},n=A(n,"-remove"),t=A(t,"-add");var o=n+" "+t;return C("setClass",e,o,i,a.to)},addClass:function(e,t,n,i){return i=i||{},C("addClass",e,A(t,"-add"),n,i.to)},removeClass:function(e,t,n,i){return i=i||{},C("removeClass",e,A(t,"-remove"),n,i.to)}}}])}])}(window,window.angular),function(e,t){"use strict";function n(){this.$get=["$$sanitizeUri",function(e){return function(t){var n=[];return o(t,l(n,function(t,n){return!/^unsafe/.test(e(t,n))})),n.join("")}}]}function i(e){var n=[],i=l(n,t.noop);return i.chars(e),n.join("")}function a(e){var t,n={},i=e.split(",");for(t=0;t<i.length;t++)n[i[t]]=!0;return n}function o(e,n){function i(e,i,o,r){if(i=t.lowercase(i),S[i])for(;y.last()&&C[y.last()];)a("",y.last());$[i]&&y.last()==i&&a("",i),r=b[i]||!!r,r||y.push(i);var l={};o.replace(p,function(e,t,n,i,a){var o=n||i||a||"";l[t]=s(o)}),n.start&&n.start(i,l,r)}function a(e,i){var a,o=0;if(i=t.lowercase(i))for(o=y.length-1;o>=0&&y[o]!=i;o--);if(o>=0){for(a=y.length-1;a>=o;a--)n.end&&n.end(y[a]);y.length=o}}"string"!=typeof e&&(e=null===e||"undefined"==typeof e?"":""+e);var o,r,l,v,y=[],w=e;for(y.last=function(){return y[y.length-1]};e;){if(v="",r=!0,y.last()&&x[y.last()]?(e=e.replace(new RegExp("(.*)<\\s*\\/\\s*"+y.last()+"[^>]*>","i"),function(e,t){return t=t.replace(g,"$1").replace(_,"$1"),n.chars&&n.chars(s(t)),""}),a("",y.last())):(0===e.indexOf("<!--")?(o=e.indexOf("--",4),o>=0&&e.lastIndexOf("-->",o)===o&&(n.comment&&n.comment(e.substring(4,o)),e=e.substring(o+3),r=!1)):f.test(e)?(l=e.match(f),l&&(e=e.replace(l[0],""),r=!1)):h.test(e)?(l=e.match(u),l&&(e=e.substring(l[0].length),l[0].replace(u,a),r=!1)):m.test(e)&&(l=e.match(d),l?(l[4]&&(e=e.substring(l[0].length),l[0].replace(d,i)),r=!1):(v+="<",e=e.substring(1))),r&&(o=e.indexOf("<"),v+=0>o?e:e.substring(0,o),e=0>o?"":e.substring(o),n.chars&&n.chars(s(v)))),e==w)throw c("badparse","The sanitizer was unable to parse the following block of html: {0}",e);w=e}a()}function s(e){if(!e)return"";var t=N.exec(e),n=t[1],i=t[3],a=t[2];return a&&(P.innerHTML=a.replace(/</g,"&lt;"),a="textContent"in P?P.textContent:P.innerText),n+a+i}function r(e){return e.replace(/&/g,"&amp;").replace(v,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(y,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(e,n){var i=!1,a=t.bind(e,e.push);return{start:function(e,o,s){e=t.lowercase(e),!i&&x[e]&&(i=e),i||A[e]!==!0||(a("<"),a(e),t.forEach(o,function(i,o){var s=t.lowercase(o),l="img"===e&&"src"===s||"background"===s;D[s]!==!0||E[s]===!0&&!n(i,l)||(a(" "),a(o),a('="'),a(r(i)),a('"'))}),a(s?"/>":">"))},end:function(e){e=t.lowercase(e),i||A[e]!==!0||(a("</"),a(e),a(">")),e==i&&(i=!1)},chars:function(e){i||a(r(e))}}}var c=t.$$minErr("$sanitize
var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array,rr,vv;for(rr="0".charCodeAt(0),vv=0;9>=vv;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;36>vv;++vv)BI_RC[rr++]=vv;Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFl
return p?this.w?(e=new Uint8Array(t),e.set(this.b.subarray(0,t))):e=this.b.subarray(0,t):(this.b.length>t&&(this.b.length=t),e=this.b),this.buffer=e},c.prototype.F=function(){return this.s||this.g(),this.m.slice()},c.prototype.g=function(){for(var t=this.input.length;this.c<t;){var a=new i,s=d,r=d,l=d,c=d,u=d,m=d,h=d,g=d,f=d,_=this.input,v=this.c;switch(a.u=_[v++],a.v=_[v++],(31!==a.u||139!==a.v)&&e(Error("invalid file signature:"+a.u+","+a.v)),a.p=_[v++],a.p){case 8:break;default:e(Error("unknown compression method: "+a.p))}if(a.h=_[v++],g=_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24,a.H=new Date(1e3*g),a.N=_[v++],a.M=_[v++],0<(4&a.h)&&(a.I=_[v++]|_[v++]<<8,v+=a.I),0<(8&a.h)){for(h=[],m=0;0<(u=_[v++]);)h[m++]=String.fromCharCode(u);a.name=h.join("")}if(0<(16&a.h)){for(h=[],m=0;0<(u=_[v++]);)h[m++]=String.fromCharCode(u);a.J=h.join("")}0<(2&a.h)&&(a.B=65535&n(_,0,v),a.B!==(_[v++]|_[v++]<<8)&&e(Error("invalid header crc16"))),s=_[_.length-4]|_[_.length-3]<<8|_[_.length-2]<<16|_[_.length-1]<<24,_.length-v-4-4<512*s&&(c=s),r=new o(_,{index:v,bufferSize:c}),a.data=l=r.g(),v=r.c,a.K=f=(_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24)>>>0,n(l,d,d)!==f&&e(Error("invalid CRC-32 checksum: 0x"+n(l,d,d).toString(16)+" / 0x"+f.toString(16))),a.L=s=(_[v++]|_[v++]<<8|_[v++]<<16|_[v++]<<24)>>>0,(4294967295&l.length)!==s&&e(Error("invalid input size: "+(4294967295&l.length)+" / "+s)),this.m.push(a),this.c=v}this.s=!0;var y,b,w,k=this.m,$=0,S=0;for(y=0,b=k.length;b>y;++y)S+=k[y].data.length;if(p)for(w=new Uint8Array(S),y=0;b>y;++y)w.set(k[y].data,$),$+=k[y].data.length;else{for(w=[],y=0;b>y;++y)w[y]=k[y].data;w=Array.prototype.concat.apply([],w)}return w},t("Zlib.Gunzip",c),t("Zlib.Gunzip.prototype.decompress",c.prototype.g),t("Zlib.Gunzip.prototype.getMembers",c.prototype.F)}.call(this),this.goog={provide:function(){},math:{}},goog.provide("goog.math.Long"),goog.math.Long=function(e,t){this.low_=0|e,this.high_=0|t},goog.math.Long.IntCache_={},goog.math.Long.fromInt=function(e){if(e>=-128&&128>e){var t=goog.math.Long.IntCache_[e];if(t)return t}var n=new goog.math.Long(0|e,0>e?-1:0);return e>=-128&&128>e&&(goog.math.Long.IntCache_[e]=n),n},goog.math.Long.fromNumber=function(e){return isNaN(e)||!isFinite(e)?goog.math.Long.ZERO:e<=-goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MIN_VALUE:e+1>=goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MAX_VALUE:0>e?goog.math.Long.fromNumber(-e).negate():new goog.math.Long(e%goog.math.Long.TWO_PWR_32_DBL_|0,e/goog.math.Long.TWO_PWR_32_DBL_|0)},goog.math.Long.fromBits=function(e,t){return new goog.math.Long(e,t)},goog.math.Long.fromString=function(e,t){if(0==e.length)throw Error("number format error: empty string");var n=t||10;if(2>n||n>36)throw Error("radix out of range: "+n);if("-"==e.charAt(0))return goog.math.Long.fromString(e.substring(1),n).negate();if(e.indexOf("-")>=0)throw Error('number format error: interior "-" character: '+e);for(var i=goog.math.Long.fromNumber(Math.pow(n,8)),a=goog.math.Long.ZERO,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),r=parseInt(e.substring(o,o+s),n);if(8>s){var l=goog.math.Long.fromNumber(Math.pow(n,s));a=a.multiply(l).add(goog.math.Long.fromNumber(r))}else a=a.multiply(i),a=a.add(goog.math.Long.fromNumber(r))}return a},goog.math.Long.TWO_PWR_16_DBL_=65536,goog.math.Long.TWO_PWR_24_DBL_=1<<24,goog.math.Long.TWO_PWR_32_DBL_=goog.math.Long.TWO_PWR_16_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_31_DBL_=goog.math.Long.TWO_PWR_32_DBL_/2,goog.math.Long.TWO_PWR_48_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_64_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_32_DBL_,goog.math.Long.TWO_PWR_63_DBL_=goog.math.Long.TWO_PWR_64_DBL_/2,goog.math.Long.ZERO=goog.math.Long.fromInt(0),goog.math.Long.ONE=goog.math.Long.fromInt(1),goog.math.Long.NEG_ONE=goog.math.Long.fromInt(-1),goog.math.Long.MAX_VALUE=goog.math.Long.fromBits(-1,2147483647),goog.math.Long.MIN_VALUE=goog.math.Long.fromBits(0,-2147483648),goog.math.Long.TWO_PWR_24_=goog.math.Long.fromInt(1<<24),goog.math.Long.prototype.toInt=function(){return this.low_},goog.math
}function Nt(e,t){return((4278124286&(e^t))>>>1)+((e&t)>>>0)>>>0}function Ut(e){return 256>e&&e>0?e:0>=e?0:~e>>24&255}function Ot(e,t){return Ut(e+parseInt((e-t)/2,10))}function Rt(){return Si}function Lt(e,t){return e&=255,t&=255,e>127&&(e-=256),t>127&&(t-=256),e*t>>>5}function Bt(e,t,n,i,a,o,s){var r=g,l=8>>e.n,c=e.U,d=e.u;if(8>l){e=(1<<e.n)-1;for(var u=(1<<l)-1,r=t;n>r;++r){t=0;for(var p=g,p=0;c>p;++p)0==(p&e)&&(t=i[a++]>>8&255),o[s++]=d[t&u],t>>=l}}else for(r=t;n>r;++r)for(p=0;c>p;++p)o[s++]=d[i[a++]>>8&255]}function Ft(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o>>0&255,i[a++]=o>>24&255}}function qt(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>16&240|o>>12&15,i[a++]=o>>0&240|o>>28&15}}function jt(e,t,n,i,a){for(n=t+n;n>t;){var o=e[t++];i[a++]=o>>24&255,i[a++]=o>>16&255,i[a++]=o>>8&255,i[a++]=o>>0&255}}function Ht(e,t,n,i){return T(e,8)!=vi?0:(t[0]=T(e,yi)+1,n[0]=T(e,yi)+1,i[0]=T(e,1),T(e,bi),1)}function zt(e,t){var n=g;return 4>e?e+1:(n=e-2>>1,(2+(1&e)<<n)+T(t,n)+1)}function Vt(e,t){if(t.Q+8>t.ya){var n=e.Y,i=0;for(p(n!=h);0!=n[i].s;){var a=n,o=t,s=o.T>>o.g&1;o.L?o.fa=1:(++o.g,8<=o.g&&A(o),o.Q==o.ya&&32==o.g&&(o.L=1)),i=i+a[i].s+s}return n[i].kc}for(n=e.Y,i=0,p(n!=h);0!=n[i].s;)a=n,o=t.T>>t.g&1,++t.g,i=i+a[i].s+o;return n[i].kc}function Wt(e,t){if(e!=h)for(var n=g,i=g,n=0;t>n;++n)for(var a=e[n].va,i=0;$i>i;++i)P(a[i])}function Gt(e,t,n){return t=0==e.eb?0:e.ac[e.bd+e.Ec*(n>>e.eb)+(t>>e.eb)],p(t<e.hc),e.Db[+t]}function Kt(n,i,a,o){var r=n.Na,l=n.O,c=l+i,d=a,u=o;for(o=n.Xa,a=n.vb,t(o,a,d,u,n.l*i);0<r--;){i=n.nc[r];var m=l,f=c,_=d,y=u,u=o,d=a;switch(p(f>m),p(f<=i.Vb),i.Qc){case Di:for(_=0,i=d+(f-m)*i.U;i>d;){var f=u,y=d,b=f[y]>>8&255,w=(16711935&f[y])>>>0,w=w+(b<<16|b),w=16711935&w;u[d++]=((4278255360&f[y])>>>0|w)>>>0,32==m&&_++}break;case Ti:var k=i,$=m,_=f,y=u,b=d,w=k.U;if(0==$){var S=g;for(Pt(y,b,Si),S=1;w>S;++S)Pt(y,b+S,y[b+S-1]);b+=w,++$}for(var C=(1<<k.n)-1,M=Ct(w,k.n),x=k.u,k=+($>>k.n)*M;_>$;){var A=x,E=k,T=h;for(Pt(y,b,y[b-w+0]),T=Do[A[E++]>>8&15],S=1;w>S;++S){var I=v;0==(S&C)&&(T=Do[A[E++]>>8&15]),I=T(y[b+S-1],y,b+S-w),Pt(y,b+S,I)}b+=w,++$,0==($&C)&&(k+=M)}f!=i.Vb&&(i=i.U,t(u,d-i,u,d+(f-m-1)*i,i));break;case Ii:for(_=i.U,y=(1<<i.n)-1,b=Ct(_,i.n),w=i.u,i=+(m>>i.n)*b;f>m;){for(S=w,$=i,C=e(Po),M=g,M=0;_>M;++M)0==(M&y)&&(x=S[$++],k=C,k.Cc=x>>0&255,k.Bc=x>>8&255,k.Kc=x>>16&255),x=u[d+M],k=x>>>8,A=x>>>16,E=x,A+=Lt(C.Cc,k),A&=255,E+=Lt(C.Bc,k),E+=Lt(C.Kc,A),E&=255,u[d+M]=(4278255360&x|A<<16|E)>>>0;d+=_,++m,0==(m&y)&&(i+=b)}break;case Pi:_==u&&0<i.n?(_=(f-m)*Ct(i.U,i.n),y=d+(f-m)*i.U-_,s(u,y,u,d,_),Bt(i,m,f,u,y,u,d)):Bt(i,m,f,_,y,u,d)}d=o,u=a}}function Yt(e,t){var n=e.V,i=e.Ha+e.l*e.O,a=t-e.O;if(!(0>=a)){Kt(e,a,n,i);var o=e.N,n=e.Xa,s=[e.vb],i=e.O,a=t,r=s,l=o.width;if(p(a>i),p(o.t<o.Ka),a>o.K&&(a=o.K),i<o.k){var c=o.k-i,i=o.k;r[0]+=l*c}if(i>=a?i=0:(r[0]+=o.t,o.w=i-o.k,o.m=o.Ka-o.t,o.h=a-i,i=1),i){if(s=s[0],i=e.Ib,a=o.width,i.J<Zn){var d=i.c.RGBA,r=d.ma,u=d.Sa+e.xa*d.f;if(o.I)n=EmitRescaledRows(e,n,s,a,o.h,r,u,d.f);else{for(var l=i.J,c=o.m,o=o.h,d=d.f,m=o;0<m--;){var h=n,g=s,f=c,_=r,v=u;switch(l){case Bn:for(f=g+f;f>g;){var y=h[g++];_[v++]=y>>16&255,_[v++]=y>>8&255,_[v++]=y>>0&255}break;case Fn:Ft(h,g,f,_,v);break;case Wn:Ft(h,g,f,_,v),WebPApplyAlphaMultiply(_,0,f,1,0);break;case qn:for(f=g+f;f>g;)y=h[g++],_[v++]=y>>0&255,_[v++]=y>>8&255,_[v++]=y>>16&255;break;case jn:jt(h,g,f,_,v);break;case Gn:jt(h,g,f,_,v),WebPApplyAlphaMultiply(_,0,f,1,0);break;case Hn:jt(h,g,f,_,v);break;case Kn:jt(h,g,f,_,v),WebPApplyAlphaMultiply(_,1,f,1,0);break;case zn:qt(h,g,f,_,v);break;case Yn:qt(h,g,f,_,v),WebPApplyAlphaMultiply4444(_,f,1,0);break;case Vn:for(f=g+f;f>g;)y=h[g++],_[v++]=y>>16&248|y>>13&7,_[v++]=y>>5&224|y>>3&31;break;default:p(0)}s+=a,u+=d}n=o}e.xa+=n}else e.xa=o.I?EmitRescaledRowsYUVA(e,n,s,a,o.h):EmitRowsYUVA(e,n,s,a,o.m,o.h);p(e.xa<=i.height)}e.O=t,p(e.O<=e.v)}}function Zt(e,t,n,i,a,o){var s=1,r=0,l=0,c=e.o,d=e.cb,u=d.Db,m=n,f=n;n+=i*a,a=xi+Ai;var _=a+d.xb,v=0<d.xb?d.Yb:h,y=d.Dc,b=!1;p(u!=h);e:for(;!c.L&&n>m;){var w=g;if(b||(0==(r&y)&&(u=Gt(d,r,l)),E(c),w=Vt(u.va[Bo],c)),xi>w||b
this.WebPGetDecoderVersion=this.Ld=function(){return 512};var $o=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],So=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Co=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Mo=u([da,ua],"");c(4,f);var xo=[[0,0,0,0],[1,0,0,0],[0,1,0,0],[1,1,0,0],[0,0,1,0],[1,0,1,0],[0,1,1,0],[1,1,1,0],[0,0,0,1],[1,0,0,1],[0,1,0,1],[1,1,0,1],[0,0,1,1],[1,0,1,1],[0,1,1,1],[1,1,1,1]],Ao=134480385,Eo=16,To=-227,Io=482,Do=[Rt,function(e){return e},function(e,t,n){return t[n+0]},function(e,t,n){return t[n+1]},function(e,t,n){return t[n-1]},function(e,t,n){return Nt(Nt(e,t[n+1]),t[n+0])},function(e,t,n){return Nt(e,t[n-1])},function(e,t,n){return Nt(e,t[n+0])},function(e,t,n){return Nt(t[n-1],t[n+0])},function(e,t,n){return Nt(t[n+0],t[n+1])},function(e,t,n){return Nt(Nt(e,t[n-1]),Nt(t[n+0],t[n+1]))},function(e,t,n){return 0>=Math.abs((e>>24&255)-(t[n-1]>>24&255))-Math.abs((t[n+0]>>24&255)-(t[n-1]>>24&255))+(Math.abs((e>>16&255)-(t[n-1]>>16&255))-Math.abs((t[n+0]>>16&255)-(t[n-1]>>16&255)))+(Math.abs((e>>8&255)-(t[n-1]>>8&255))-Math.abs((t[n+0]>>8&255)-(t[n-1]>>8&255)))+(Math.abs((255&e)-(255&t[n-1]))-Math.abs((255&t[n+0])-(255&t[n-1])))?t[n+0]:e},function(e,t,n){return(Ut((e>>24&255)+(t[n+0]>>24&255)-(t[n-1]>>24&255))<<24|Ut((e>>16&255)+(t[n+0]>>16&255)-(t[n-1]>>16&255))<<16|Ut((e>>8&255)+(t[n+0]>>8&255)-(t[n-1]>>8&255))<<8|Ut((255&e)+(255&t[n+0])-(255&t[n-1])))>>>0},function(e,t,n){var i=t[n-1];return e=Nt(e,t[n+0]),(Ot(e>>24&255,i>>24&255)<<24|Ot(e>>16&255,i>>16&255)<<16|Ot(e>>8&255,i>>8&255)<<8|Ot(e>>0&255,i>>0&255))>>>0},Rt,Rt],Po={Cc:f,Bc:f,Kc:f},No=16,Uo=16,Oo=16,Ro=[2,3,7],Lo=[3,3,11],Bo=0,Fo=1,qo=2,jo=3,Ho=4,zo=[xi+Ai,xi,xi,xi,40],Vo=19,Wo=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Go=120,Ko=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Yo=1<<Eo-1,Zo=c(256,0),Xo=c(256,0),Jo=c(256,_),Qo=c(256,_),es=c(Io-To,f),ts=c(Io-To,f),ns=0,is=Array(Jn),as=[function(e,t,n,i,a,o,s,r,l,c,d,u,p){hn(e,t,n,i,a,o,s,r,l,c,d,u,p,Mt,3)},gn,function(e,t,n,i,a,o,s,r,l,c,d,u,p){hn(e,t,n,i,a,o,s,r,l,c,d,u,p,Tt,3)},fn,_n,vn,function(e,t,n,i,a,o,s,r,l,c,d,u,p){hn(e,t,n,i,a,o,s,r,l,c,d,u,p,xt,2)},gn,fn,_n,vn];this.Hd=function(e,t,n,i){return Un(Bn,e,t,n,i)},this.Id=function(e,t,n,i){return Un(Fn,e,t,n,i)},this.Jd=function(e,t,n,i){return Un(zn,e,t,n,i)},this.Ed=function(e,t,n,i){return Un(Hn,e,t,n,i)},this.Fd=function(e,t,n,i){return Un(qn,e,t,n,i)},this.Gd=function(e,t,n,i){return Un(jn,e,t,n,i)},this.WebPDecode=this.Dd=function(t,n,i){var a=e(ui),o="VP8StatusCode";return i==h?ni:(o=On(t,[0],[n],i.input),o!=ei?o==ri?ii:o:(a.j=i.j,a.Qa=i.Qa,o=Nn(t,0,[n],a)))}}}();var _logTimer=(new Date).getTime();!function(e){function t(){return{shortIndexes:{},fullTexts:{}}}function n(e){var t="%"==e.charAt(0);return e=e.replace(o," ").replace(s,""),e=e.replace(/[^A-Za-z0-9]/g,function(e){return Config.LatinizeMap[e]||e}),e=e.toLowerCase(),t&&(e="%"+e),e}function i(e,t,i){if(void 0!==i.fullTexts[e])return!1;if(t=n(t),!t.length)return!1;var a=i.shortIndexes;i.fullTexts[e]=t,angular.forEach(t.split(" "),function(t){var n,i,o=Math.min(t.length,3);for(i=1;o>=i;i++)n=t.substr(0,i),void 0===a[n]?a[n]=[e]:a[n].push(e)})}function a(e,t){var i=t.shortIndexes,a=t.fullTexts;e=n(e);var o,s,r,l,c,d=e.split(" "),u=!1;for(s=0;s<d.length;s++){if(o=i[d[s].substr(0,3)],!o){u=[];break}(u===!1||u.length>o.length)&&(u=o)}for(o={},r=0;r<u.length;r++){for(c=!0,l=a[u[r]],s=0;s<d.length;s++)if(-1==l.indexOf(d[s])){c=!1;break}c&&(o[u[r]]=!0)}return o}var o=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g,s=/^\s+|\s$/g;e.SearchIndexManager={createIndex:t,indexObject:i,cleanSearchText:n,search:a}}(window),TLSerialization.prototype.createBuffer=function(){this.buffer=new ArrayBuffer(this.maxLe
}]).factory("MtpTimeManager",["Storage",function(e){function t(){var e=tsNow(),t=Math.floor(e/1e3)+a,n=e%1e3,o=nextRandomInt(65535),s=[t,n<<21|o<<3|4];return(i[0]>s[0]||i[0]==s[0]&&i[1]>=s[1])&&(s=[i[0],i[1]+4]),i=s,longFromInts(s[0],s[1])}function n(t,n){var o=t-Math.floor((n||tsNow())/1e3),s=Math.abs(a-o)>10;return e.set({server_time_offset:o}),i=[0,0],a=o,console.log(dT(),"Apply server time",t,n,o,s),s}var i=[0,0],a=0;return e.get("server_time_offset").then(function(e){e&&(a=e)}),{generateID:t,applyServerTime:n}}]).factory("MtpAuthorizer",["MtpDcConfigurator","MtpRsaKeysManager","MtpSecureRandom","MtpTimeManager","CryptoWorker","$http","$q","$timeout",function(e,t,n,i,a,o,s,r){function l(t,n){var a=n.byteLength,r=new Int32Array(n),l=new TLSerialization;l.storeLongP(0,0,"auth_key_id"),l.storeLong(i.generateID(),"msg_id"),l.storeInt(a,"request_length");var c=l.getBuffer(),d=new Int32Array(c),u=c.byteLength,p=new ArrayBuffer(u+a),m=new Int32Array(p);m.set(d),m.set(r,d.length);var h,g=f?p:m;try{h=o.post(e.chooseServer(t),g,{responseType:"arraybuffer",transformRequest:null})}catch(_){h=s.reject({code:406,type:"NETWORK_BAD_RESPONSE",originalError:_})}return h.then(function(e){if(!e.data||!e.data.byteLength)return s.reject({code:406,type:"NETWORK_BAD_RESPONSE"});try{{var t=new TLDeserialization(e.data,{mtproto:!0});t.fetchLong("auth_key_id"),t.fetchLong("msg_id"),t.fetchInt("msg_len")}}catch(n){return s.reject({code:406,type:"NETWORK_BAD_RESPONSE",originalError:n})}return t},function(e){return e.message||e.type||(e={code:406,type:"NETWORK_BAD_REQUEST",originalError:e}),s.reject(e)})}function c(e){var n=e.deferred,i=new TLSerialization({mtproto:!0});i.storeMethod("req_pq",{nonce:e.nonce}),console.log(dT(),"Send req_pq",bytesToHex(e.nonce)),l(e.dcID,i.getBuffer()).then(function(i){var o=i.fetchObject("ResPQ");if("resPQ"!=o._)throw new Error("resPQ response invalid: "+o._);if(!bytesCmp(e.nonce,o.nonce))throw new Error("resPQ nonce mismatch");if(e.serverNonce=o.server_nonce,e.pq=o.pq,e.fingerprints=o.server_public_key_fingerprints,console.log(dT(),"Got ResPQ",bytesToHex(e.serverNonce),bytesToHex(e.pq),e.fingerprints),e.publicKey=t.select(e.fingerprints),!e.publicKey)throw new Error("No public key found");console.log(dT(),"PQ factorization start",e.pq),a.factorize(e.pq).then(function(t){e.p=t[0],e.q=t[1],console.log(dT(),"PQ factorization done",t[2]),d(e)},function(e){console.log("Worker error",e,e.stack),n.reject(e)})},function(e){console.log(dT(),"req_pq error",e.message),n.reject(e)}),r(function(){t.prepare()})}function d(e){var t=e.deferred;e.newNonce=new Array(32),n.nextBytes(e.newNonce);var i=new TLSerialization({mtproto:!0});i.storeObject({_:"p_q_inner_data",pq:e.pq,p:e.p,q:e.q,nonce:e.nonce,server_nonce:e.serverNonce,new_nonce:e.newNonce},"P_Q_inner_data","DECRYPTED_DATA");var a=sha1BytesSync(i.getBuffer()).concat(i.getBytes()),o=new TLSerialization({mtproto:!0});o.storeMethod("req_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,p:e.p,q:e.q,public_key_fingerprint:e.publicKey.fingerprint,encrypted_data:rsaEncrypt(e.publicKey,a)}),console.log(dT(),"Send req_DH_params"),l(e.dcID,o.getBuffer()).then(function(n){var i=n.fetchObject("Server_DH_Params","RESPONSE");if("server_DH_params_fail"!=i._&&"server_DH_params_ok"!=i._)return t.reject(new Error("Server_DH_Params response invalid: "+i._)),!1;if(!bytesCmp(e.nonce,i.nonce))return t.reject(new Error("Server_DH_Params nonce mismatch")),!1;if(!bytesCmp(e.serverNonce,i.server_nonce))return t.reject(new Error("Server_DH_Params server_nonce mismatch")),!1;if("server_DH_params_fail"==i._){var a=sha1BytesSync(e.newNonce).slice(-16);return bytesCmp(a,i.new_nonce_hash)?(t.reject(new Error("server_DH_params_fail")),!1):(t.reject(new Error("server_DH_params_fail new_nonce_hash mismatch")),!1)}try{u(e,i.encrypted_answer)}catch(o){return t.reject(o),!1}p(e)},function(e){t.reject(e)})}function u(e,t){e.localTime=tsNow(),e.tmpAesKey=sha1BytesSync(e.newNonce.concat(e.serverNonce)).concat(sha1BytesSync(e.serverNonce.concat(e.newNonce)).slice(0,12)),e.tmpAesIv=sha1BytesSync(e.serverNonce.co
},g))},d.readAsArrayBuffer(v),l.promise},d)}(p,f++);return h.promise.cancel=function(){console.log("cancel upload",o,s),o||s||(o=!0,g({type:"UPLOAD_CANCELED"}))},h.promise}var v={},y={},b={},w={},k={},$=0;return{getCachedFile:u,getDownloadedFile:g,downloadFile:f,downloadSmallFile:h,saveSmallFile:m,uploadFile:_}}]).service("MtpSingleInstanceService",["_","$rootScope","$interval","Storage","AppRuntimeManager","IdleManager","ErrorService","MtpNetworkerFactory",function(e,t,n,i,a,o,s,r){function l(){if(!p&&!Config.Navigator.mobile&&!Config.Modes.packed){p=!0,o.start(),h=tsNow(),t.$watch("idle.isIDLE",d),n(d,5e3),d();try{$($window).on("beforeunload",c)}catch(e){}}}function c(){i.remove(m?"xt_instance":"xt_idle_instance")}function d(){var n=tsNow(),a=t.idle&&t.idle.isIDLE,o={id:u,idle:a,time:n};i.get("xt_instance","xt_idle_instance").then(function(t){var l=t[0],c=t[1];!l||l.time<n-6e4||l.id==u||l.idle||!a?(c&&(c.id==u?i.remove("xt_idle_instance"):c.time>n-1e4&&n>g&&(s.alert(e("error_modal_warning_title_raw"),e("error_modal_multiple_open_tabs_raw")),g+=tsNow()+6e4)),i.set({xt_instance:o}),m||r.startAll(),m=!0):(i.set({xt_idle_instance:o}),m&&r.stopAll(),m=!1)})}var u=nextRandomInt(4294967295),p=!1,m=!1,h=tsNow(),g=0;return{start:l}}]),angular.module("myApp",["ngRoute","ngSanitize","ngTouch","ui.bootstrap","mediaPlayer","izhukov.utils","izhukov.mtproto","izhukov.mtproto.wrapper","myApp.filters","myApp.services","myApp.templates","myApp.directives","myApp.controllers"]).config(["$locationProvider","$routeProvider","$compileProvider","StorageProvider",function(e,t,n,i){n.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//),n.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|tg|mailto|blob|filesystem|chrome-extension|app):|data:/),Config.Modes.test&&i.setPrefix("t_"),t.when("/",{templateUrl:templateUrl("welcome"),controller:"AppWelcomeController"}),t.when("/login",{templateUrl:templateUrl("login"),controller:"AppLoginController"}),t.when("/im",{templateUrl:templateUrl("im"),controller:"AppIMController",reloadOnSearch:!1}),t.otherwise({redirectTo:"/"})}]),angular.module("myApp.services",["myApp.i18n","izhukov.utils"]).service("AppUsersManager",["$rootScope","$modal","$modalStack","$filter","$q","qSync","MtpApiFileManager","MtpApiManager","RichTextProcessor","ErrorService","Storage","_",function(e,t,n,i,a,o,s,r,l,c,d,u){function p(){return R?R:R=r.invokeApi("contacts.getContacts",{hash:""}).then(function(e){var t,n;L=[],_(e.users);for(var n=0;n<e.contacts.length;n++)t=e.contacts[n].user_id,L.push(t),SearchIndexManager.indexObject(t,m(t),H);return L})}function m(e){var t=F[e];return t?(t.first_name||"")+" "+(t.last_name||"")+" "+(t.phone||"")+" "+(t.username||""):!1}function h(e){return p().then(function(t){if(angular.isString(e)&&e.length){for(var n=SearchIndexManager.search(e,H),i=[],a=0;a<t.length;a++)n[t[a]]&&i.push(t[a]);t=i}return t})}function g(e){return e&&e.toLowerCase()||""}function f(e){var t=g(e),n=q[t];return n&&g(F[n].username)==t?o.when(n):r.invokeApi("contacts.resolveUsername",{username:e}).then(function(e){return v(e),e.id})}function _(e){angular.forEach(e,v)}function v(t,n){if(angular.isObject(t)&&!(n&&angular.isObject(F[t.id])&&F[t.id].first_name)){var a=t.id;t.phone&&(t.rPhone=i("phoneNumber")(t.phone)),t.num=Math.abs(a)%8+1,t.first_name?(t.rFirstName=l.wrapRichText(t.first_name,{noLinks:!0,noLinebreaks:!0}),t.rFullName=t.last_name?l.wrapRichText(t.first_name+" "+(t.last_name||""),{noLinks:!0,noLinebreaks:!0}):t.rFirstName):(t.rFirstName=l.wrapRichText(t.last_name,{noLinks:!0,noLinebreaks:!0})||t.rPhone||u("user_first_name_deleted"),t.rFullName=l.wrapRichText(t.last_name,{noLinks:!0,noLinebreaks:!0})||t.rPhone||u("user_name_deleted")),t.username&&(q[g(t.username)]=a),t.sortName=SearchIndexManager.cleanSearchText(t.first_name+" "+(t.last_name||"")),t.pFlags={self:(1024&t.flags)>0,contact:(2048&t.flags)>0,mutual:(4096&t.flags)>0,deleted:(8192&t.flags)>0,bot:(16384&t.flags)>0,botNoPrivacy:(32768&t.flags)>0,botNoGroups:(65536&t.flags)>0};var o=t.sortName.split(" "),s=o
if(t.media)switch(t.media.caption&&t.media.caption.length&&(t.media.rCaption=_.wrapRichText(t.media.caption,{noCommands:!a,fromBot:i})),t.media._){case"messageMediaPhoto":t.media.photo=d.wrapForHistory(t.media.photo.id);break;case"messageMediaVideo":t.media.video=u.wrapForHistory(t.media.video.id);break;case"messageMediaDocument":t.media.document=p.wrapForHistory(t.media.document.id);break;case"messageMediaAudio":t.media.audio=m.wrapForHistory(t.media.audio.id);break;case"messageMediaGeo":var s="https://maps.google.com/?q="+t.media.geo.lat+","+t.media.geo["long"];t.media.mapUrl=o.trustAsResourceUrl(s);break;case"messageMediaVenue":var s;s="foursquare"==t.media.provider&&t.media.venue_id?"https://foursquare.com/v/"+encodeURIComponent(t.media.venue_id):"https://maps.google.com/?q="+t.media.geo.lat+","+t.media.geo["long"],t.media.mapUrl=o.trustAsResourceUrl(s);break;case"messageMediaContact":t.media.rFullName=_.wrapRichText(t.media.first_name+" "+(t.media.last_name||""),{noLinks:!0,noLinebreaks:!0});break;case"messageMediaWebPage":if(!t.media.webpage||"webPageEmpty"==t.media.webpage._||Config.Mobile){delete t.media;break}t.media.webpage=h.wrapForHistory(t.media.webpage.id)}else if(t.action)switch(t.action._){case"messageActionChatEditPhoto":t.action.photo=d.wrapForHistory(t.action.photo.id);break;case"messageActionChatCreate":case"messageActionChatEditTitle":t.action.rTitle=_.wrapRichText(t.action.title,{noLinks:!0,noLinebreaks:!0})||M("chat_title_deleted");break;case"messageActionBotIntro":t.action.rDescription=_.wrapRichText(t.action.description,{noCommands:!a,fromBot:i})}var l=t.reply_to_msg_id;if(l&&(ct[l]?t.reply_to_msg=X(l):(t.reply_to_msg={id:l,loading:!0},-1==$t.indexOf(l)&&($t.push(l),St===!1&&(St=setTimeout(et,100))))),t.message&&t.message.length){var c={noCommands:!a,fromBot:i};if(Config.Navigator.mobile||(c.extractUrlEmbed=!0),16&t.flags){var g=r.getSelf();g&&(c.highlightUsername=g.username)}t.richMessage=_.wrapRichText(t.message,c),c.extractedUrlEmbed&&(t.richUrlEmbed=c.extractedUrlEmbed)}return dt[e]=t}function Q(e){if(!e||"replyKeyboardHide"==e._)return!1;if(e.wrapped)return e;var t=e.rows&&e.rows.length||0;return t>0&&4>=t&&!e.pFlags.resize&&(e.splitCount=t),e.wrapped=!0,angular.forEach(e.rows,function(e){angular.forEach(e.buttons,function(e){e.rText=_.wrapRichText(e.text,{noLinks:!0,noLinebreaks:!0})})}),nextRandomInt(1)&&(e.rows=e.rows.slice(0,2)),e}function et(){if(St!==!1&&(clearTimeout(St),St=!1),$t.length){var e=$t.slice();$t=[],g.invokeApi("messages.getMessages",{id:e}).then(function(n){r.saveApiUsers(n.users),l.saveApiChats(n.chats),q(n.messages),t.$broadcast("messages_downloaded",e)})}}function tt(e,t){if(!e||!e.length)return!1;var n,i,a,o,s,r,l,c=0,d=e.length,u=d,p=!1,m=!Config.Mobile;for(t>0?u=Math.min(t,d):0>t&&(c=Math.max(0,u+t)),n=c;u>n;n++){if(o=e[n],i=Math.floor((o.date+lt)/86400),l=s&&s.grouped,r=o.grouped,i===a?o.needDate&&(delete o.needDate,p=!0):(!n||s)&&(o.needDate||(o.needDate=!0,p=!0)),o.fwd_from_id&&o.media&&o.media.document&&o.media.document.sticker&&(o.from_id!=(s||{}).from_id||!(s||{}).fwd_from_id)&&(delete o.fwd_from_id,o._="message"),s&&o.from_id==s.from_id&&!s.fwd_from_id==!o.fwd_from_id&&!s.action&&!o.action&&o.date<s.date+900){var h=o.message&&o.message.length<70&&-1==o.message.indexOf("\n")&&!o.reply_to_msg_id;o.grouped=m&&o.fwd_from_id&&o.fwd_from_id==s.fwd_from_id?h?"im_grouped_fwd_short":"im_grouped_fwd":!o.fwd_from_id&&h?"im_grouped_short":"im_grouped",m&&o.fwd_from_id&&(s.grouped||(s.grouped="im_grouped_fwd_start"),o.grouped&&n==d-1&&(o.grouped+=" im_grouped_fwd_end"))}else(s||!n)&&(delete o.grouped,m&&s&&s.grouped&&s.fwd_from_id&&(s.grouped+=" im_grouped_fwd_end"));p||l==(s&&s.grouped)||(p=!0),s=o,a=i}return p||r==(s&&s.grouped)||(p=!0),p}function nt(e){for(var t=0;t<mt.dialogs.length;t++)if(mt.dialogs[t].peerID==e)return[mt.dialogs[t],t];return[]}function it(e){Et!==!1&&e&&e>Et&&b.set({max_seen_msg:e})}function at(e,n){n=n||{};var i,a,o=Z(e),s=r.getUser(e.from_id),c=r.getUserPhoto(e.from_id,"User"),d={},u=!1,p=v.getNotifySettings();if(e.fwd_from_id&&n.fwd_count)u=It(n
p="tg://resolve?domain="+D[0]+(D[1]?"&"+D[1]:"")}}}else p=(u[5]?"":"http://")+u[4];p?(f.push('<a href="',encodeEntities(p),'" target="_blank">',encodeEntities(u[4]),"</a>",M),s.extractUrlEmbed&&!s.extractedUrlEmbed&&(s.extractedUrlEmbed=o(p))):f.push(encodeEntities(u[0]))}else if(u[7])f.push(s.noLinebreaks?" ":"<br/>");else if(u[8])(r=l[u[8]])&&(h=n(r))?(m=encodeEntities(c[r][1][0]),w=!0,f.push('<span class="emoji emoji-',h.category,"-",d*h.column,"-",d*h.row,'" ','title="',m,'">',":",m,":</span>")):f.push(encodeEntities(u[8]));else if(u[10]){var k=!s.noLinks&&A[_]||s.contextHashtag;k?f.push(encodeEntities(u[9]),"<a ",b?' target="_blank" ':"",'href="',k.replace("{1}",encodeURIComponent(u[10].substr(1))),'">',encodeEntities(u[10]),"</a>"):f.push(encodeEntities(u[9]),encodeEntities(u[10]))}else if(u[12])if(s.noLinks||s.noCommands||b)f.push(encodeEntities(u[0]));else{var P=u[13]||s.fromBot;f.push(encodeEntities(u[11]),'<a href="',encodeEntities("tg://bot_command?command="+encodeURIComponent(u[12])+(P?"&bot="+encodeURIComponent(P):"")),'">',encodeEntities("/"+u[12]+(u[13]?"@"+u[13]:"")),"</a>",encodeEntities(u[14]))}g=g.substr(u.index+u[0].length)}return f.push(encodeEntities(g)),i=t(f.join("")),w&&(i=i.replace(/\ufe0f|&#65039;|&#65533;|&#8205;/g,"",i),i=i.replace(/<span class="emoji emoji-(\d)-(\d+)-(\d+)"(.+?)<\/span>/g,'<span class="emoji emoji-spritesheet-$1" style="background-position: -$2px -$3px;" $4</span>')),e.trustAs("html",i)}function a(e){for(var t=e.length,n=e.split("(").length-1,i=e.split(")").length-1;i>n&&")"===e.charAt(t-1);)e=e.substr(0,t-1),i--,t--;return n>i&&(e=e.replace(/\)+$/,"")),e}function o(e){var t;if(t=e.match(b))return["youtube",t[1]];if(t=e.match(w))return["vimeo",t[1]];if(t=e.match(k))return["instagram",t[1]];if(t=e.match($))return["vine",t[1]];if(t=e.match(M)){var n="explore,upload,pages,terms-of-use,mobile,jobs,imprint".split(","),i="sets".split(",");if(-1==n.indexOf(t[1])&&-1==i.indexOf(t[2]))return["soundcloud",t[0]]}else if(t=e.match(x))return["spotify",t[3].replace("/",":")];if(!Config.Modes.chrome_packed){if(t=e.match(S))return["twitter",t[0]];if(t=e.match(C))return void 0!=t[2]?["facebook","https://www.facebook.com/"+t[2]+"/posts/"+t[1]]:["facebook",t[0]]}return!1}function s(e,t){if(u)return e;if(!e||!e.length)return"";t=t||{},e=e.replace(/\ufe0f/g,"",e);for(var n,i,a=e,e=[];n=a.match(v);)e.push(a.substr(0,n.index)),e.push(n[8]?(r=l[n[8]])&&(i=c[r][1][0])?":"+i+":":n[0]:n[0]),a=a.substr(n.index+n[0].length);return e.push(a),e.join("")}var r,l={},c=Config.Emoji,d=18,u=-1!=navigator.userAgent.search(/OS X|iPhone|iPad|iOS|Android/i),p="\\u0023\\u20E3|\\u00a9|\\u00ae|\\u203c|\\u2049|\\u2139|[\\u2194-\\u2199]|\\u21a9|\\u21aa|\\u231a|\\u231b|\\u23e9|[\\u23ea-\\u23ec]|\\u23f0|\\u24c2|\\u25aa|\\u25ab|\\u25b6|\\u2611|\\u2614|\\u26fd|\\u2705|\\u2709|[\\u2795-\\u2797]|\\u27a1|\\u27b0|\\u27bf|\\u2934|\\u2935|[\\u2b05-\\u2b07]|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u3030|\\u303d|\\u3297|\\u3299|[\\uE000-\\uF8FF\\u270A-\\u2764\\u2122\\u25C0\\u25FB-\\u25FE\\u2615\\u263a\\u2648-\\u2653\\u2660-\\u2668\\u267B\\u267F\\u2693\\u261d\\u26A0-\\u26FA\\u2708\\u2702\\u2601\\u260E]|[\\u2600\\u26C4\\u26BE\\u23F3\\u2764]|\\uD83D[\\uDC00-\\uDFFF]|\\uD83C[\\uDDE8-\\uDDFA<EFBFBD>]\\uD83C[\\uDDEA-\\uDDFA<EFBFBD>]|[0-9]\\u20e3|\\uD83C[\\uDC00-\\uDFFF]";for(r in c)l[c[r][0]]=r;var m="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA96
}),i.sort();var o,s,r=e.dialogs.length;for(o=0;r>o;o++)s=e.dialogs[o],n[s.peerID]&&(e.dialogs.splice(o,1),o--,r--);for(r=i.length,o=0;r>o;o++)s=a[i[o]],e.dialogs.unshift(l.wrapForDialog(s.top_message,s.unread_count));delete e.isEmpty.dialogs,w[s.peerID]||(w[s.peerID]=!0,g&&h())}),e.$on("dialog_flush",function(t,n){for(var i=0;i<e.dialogs.length;i++)if(e.dialogs[i].peerID==n.peerID){e.dialogs.splice(i,1);break}}),e.$on("history_delete",function(t,n){for(var i=0;i<e.dialogs.length;i++)if(e.dialogs[i].peerID==n.peerID){n.msgs[e.dialogs[i].id]&&(e.dialogs[i].deleted=!0);break}}),e.$on("apiUpdate",function(t,n){switch(n._){case"updateUserTyping":case"updateChatUserTyping":if(!s.hasUser(n.user_id))return void(n.chat_id&&r.getChatFull(n.chat_id));var a="updateUserTyping"==n._?n.user_id:-n.chat_id;s.forceUserOnline(n.user_id);for(var o=0;o<e.dialogs.length;o++)if(e.dialogs[o].peerID==a){e.dialogs[o].typing=n.user_id,i.cancel(k[a]),k[a]=i(function(){for(var t=0;t<e.dialogs.length;t++)e.dialogs[t].peerID==a&&e.dialogs[t].typing==n.user_id&&delete e.dialogs[t].typing},6e3);break}}}),e.$watchCollection("search",function(){e.dialogs=[],e.foundMessages=[],f=!1,b++,p(),a.q&&e.search.query!=a.q&&i(function(){t.url("/im"+(e.curDialog.peer?"?p="+e.curDialog.peer:""))})}),Config.Mobile&&e.$watch("curDialog.peer",function(){e.$broadcast("ui_dialogs_update")}),e.importPhonebook=function(){d.openPhonebookImport()},e.$on("contacts_update",function(){g&&h()}),e.$on("ui_dialogs_search_clear",e.searchClear);var $}]).controller("AppImHistoryController",["$scope","$location","$timeout","$modal","$rootScope","MtpApiManager","AppUsersManager","AppChatsManager","AppMessagesManager","AppPeersManager","ApiUpdatesManager","PeersSelectService","IdleManager","StatusManager","ErrorService",function(e,t,n,i,a,o,s,r,l,c,d,u,p,m,h){function g(t,n){var i=t.peer||e.curDialog.peer||"";return R=c.getPeerID(i),R==e.curDialog.peerID&&n.messageID==t.messageID&&n.startParam==t.startParam?!1:(a.selectedPeerID=R,e.curDialog.peerID=R,e.curDialog.inputPeer=c.getInputPeer(i),e.historyFilter.mediaType=!1,b(),E(!0),void(n.peer&&n.peer==t.peer&&t.messageID?w():R?(y(!0),C()):M()))}function f(t){var n,i,a,o=-1,s=10;for(n=0;n<e.peerHistories.length;n++)if(e.peerHistories[n].peerID==t){o=n;break}return o>-1?i=e.peerHistories[o]:(i={peerID:t,messages:[],ids:[]},e.peerHistories.unshift(i),a=e.peerHistories.length-s,a>0&&e.peerHistories.splice(s-1,a),i)}function _(t){var n;for(n=0;n<e.peerHistories.length;n++)if(e.peerHistories[n].peerID==t)return e.peerHistories[n];return!1}function v(t){var n;for(n=0;n<e.peerHistories.length;n++)if(e.peerHistories[n].peerID==t)return e.peerHistories.splice(n,1),!0;return!1}function y(t){var n=c.getPeer(R);return!n||n.deleted?(safeReplaceObject(e.state,{loaded:!1}),!1):(L=f(R),safeReplaceObject(e.historyPeer,{id:R,data:n,photo:c.getPeerPhoto(R,"User","Group")}),o.getUserID().then(function(t){e.ownID=t,e.ownPhoto=s.getUserPhoto(t,"User")}),void(t&&(e.historyState.typing.splice(0,e.historyState.typing.length),e.$broadcast("ui_peer_change"),e.$broadcast("ui_history_change"),safeReplaceObject(e.state,{loaded:!0,empty:!L.messages.length}))))}function b(){var t=e.historyState.startBot;e.historyState.startBot=!R||0>R||!s.isBot(R)||e.historyFilter.mediaType||e.curDialog.messageID?!1:e.state.empty||L&&1==L.messages.length&&L.messages[0].action&&"messageActionBotIntro"==L.messages[0].action._?2:e.curDialog.startParam?1:!1,t!=e.historyState.startBot&&e.$broadcast("ui_panel_update")}function w(){var t=_(R);t&&-1!=t.ids.indexOf(e.curDialog.messageID)?(e.historyUnread={},e.$broadcast("messages_focus",e.curDialog.messageID),e.$broadcast("ui_history_change_scroll",!0)):C()}function k(){if(q){if(K)return void(J=!0);J=!1,X=!0;var t=W,n=++Z,i=0,a=20;l.getHistory(e.curDialog.inputPeer,H,i,a).then(function(i){if(X=!1,t==W&&n==Z){var o,s;for(o=i.history.length-1;o>=0;o--)s=i.history[o],s>H&&(L.messages.push(l.wrapForHistory(s)),L.ids.push(s));i.history.length?(H=i.history.length>=a?i.history[0]:0,l.regroupWrappedHistory(L.messages,-a)&&e.$broadcast("messages_regroup"),
},e.photo={},e.$watch("photo.file",f),e.deletePhoto=function(){e.photo.updating=!0,r.invokeApi("messages.editChatPhoto",{chat_id:e.chatID,photo:{_:"inputChatPhotoEmpty"}}).then(g)["finally"](function(){e.photo.updating=!1})},e.editTitle=function(){var t=n.$new();t.chatID=e.chatID,i.open({templateUrl:templateUrl("chat_edit_modal"),controller:"ChatEditModalController",scope:t,windowClass:"md_simple_modal_window mobile_modal"})}}]).controller("SettingsModalController",["$rootScope","$scope","$timeout","$modal","AppUsersManager","AppChatsManager","AppPhotosManager","MtpApiManager","Storage","NotificationsManager","MtpApiFileManager","PasswordManager","ApiUpdatesManager","ChangelogNotifyService","LayoutSwitchService","AppRuntimeManager","ErrorService","_",function(e,t,n,i,a,o,s,r,l,c,d,u,p,m,h,g,f){function _(){n.cancel(y),y=!1,u.getState().then(function(e){t.password=e,"account.noPassword"==e._&&e.email_unconfirmed_pattern&&!b&&(y=n(_,5e3))})}function v(e){e&&e.type&&0===e.type.indexOf("image")&&(t.photo.updating=!0,d.uploadFile(e).then(function(e){r.invokeApi("photos.uploadProfilePhoto",{file:e,caption:"",geo_point:{_:"inputGeoPointEmpty"},crop:{_:"inputPhotoCropAuto"}}).then(function(e){a.saveApiUsers(e.users),r.getUserID().then(function(n){s.savePhoto(e.photo,{user_id:n}),p.processUpdateMessage({_:"updateShort",update:{_:"updateUserPhoto",user_id:n,date:tsNow(!0),photo:a.getUser(n).photo,previous:!0}}),t.photo=a.getUserPhoto(n,"User")})})})["finally"](function(){delete t.photo.updating}))}t.profile={},t.photo={},t.version=Config.App.version,r.getUserID().then(function(e){t.profile=a.getUser(e),t.photo=a.getUserPhoto(e,"User")}),r.invokeApi("users.getFullUser",{id:{_:"inputUserSelf"}}).then(function(e){a.saveApiUser(e.user),s.savePhoto(e.profile_photo,{user_id:e.user.id})}),t.notify={volume:.5},t.send={},t.$watch("photo.file",v),t.password={_:"account.noPassword"},_();var y=!1,b=!1;t.changePassword=function(n){if(n=n||{},"cancel_email"==n.action)return f.confirm({type:"PASSWORD_ABORT_SETUP"}).then(function(){u.updateSettings(t.password,{email:""}).then(_)});var a=e.$new();a.password=t.password,angular.extend(a,n);var o=i.open({scope:a,templateUrl:templateUrl("password_update_modal"),controller:"PasswordUpdateModalController",windowClass:"md_simple_modal_window mobile_modal"});o.result["finally"](_)},t.showSessions=function(){i.open({templateUrl:templateUrl("sessions_list_modal"),controller:"SessionsListModalController",windowClass:"md_simple_modal_window mobile_modal"})},t.$on("$destroy",function(){n.cancel(y),b=!0}),t.deletePhoto=function(){t.photo.updating=!0,r.invokeApi("photos.updateProfilePhoto",{id:{_:"inputPhotoEmpty"},crop:{_:"inputPhotoCropAuto"}}).then(function(e){r.getUserID().then(function(n){p.processUpdateMessage({_:"updateShort",update:{_:"updateUserPhoto",user_id:n,date:tsNow(!0),photo:e,previous:!0}}),t.photo=a.getUserPhoto(n,"User")})})["finally"](function(){delete t.photo.updating})},t.editProfile=function(){i.open({templateUrl:templateUrl("profile_edit_modal"),controller:"ProfileEditModalController",windowClass:"md_simple_modal_window mobile_modal"})},t.changeUsername=function(){i.open({templateUrl:templateUrl("username_edit_modal"),controller:"UsernameEditModalController",windowClass:"md_simple_modal_window mobile_modal"})},t.terminateSessions=function(){f.confirm({type:"TERMINATE_SESSIONS"}).then(function(){r.invokeApi("auth.resetAuthorizations",{})})},l.get("notify_nodesktop","send_ctrlenter","notify_volume","notify_novibrate","notify_nopreview").then(function(i){t.notify.desktop=!i[0],t.send.enter=i[1]?"":"1",t.notify.volume=i[2]!==!1?i[2]>0&&i[2]<=1?i[2]:0:.5,t.notify.canVibrate=c.getVibrateSupport(),t.notify.vibrate=!i[3],t.notify.preview=!i[4],t.notify.volumeOf4=function(){return 1+Math.ceil((t.notify.volume-.1)/.33)},t.toggleSound=function(){t.notify.volume=t.notify.volume?0:.5};var a;t.$watch("notify.volume",function(t,i){t!==i&&(l.set({notify_volume:t}),e.$broadcast("settings_changed"),c.clear(),a&&n.cancel(a),a=n(function(){c.testSound(t)},500))}),t.toggleDesktop=function(){t.notify.desktop=
}]),function(e,t,n,i){function a(e){ConfigStorage.get("emojis_popular",function(t){var n=[];if(t&&t.length){for(var i=0,a=t.length;a>i;i++)n.push({code:t[i][0],rate:t[i][1]});return void e(n)}ConfigStorage.get("emojis_recent",function(t){t=t||y||[];for(var i,a,o=0,s=t.length;s>o;o++)i=t[o],Array.isArray(i)&&(i=i[0]),i&&"string"==typeof i&&(":"==i.charAt(0)&&(i=i.substr(1,i.length-2)),(a=f[i])&&n.push({code:a,rate:1}));e(n)})})}function o(e){a(function(t){for(var n=!1,i=t.length,a=[],o=0;i>o;o++)t[o].code==e&&(n=!0,t[o].rate++),a.push([t[o].code,t[o].rate]);n?a.sort(function(e,t){return t[1]-e[1]}):(a.length>41&&(a=a.slice(0,41)),a.push([e,1])),ConfigStorage.set({emojis_popular:a})})}function s(){if(v===!1){v=SearchIndexManager.createIndex();var e;for(e in f)f.hasOwnProperty(e)&&SearchIndexManager.indexObject(f[e],e,v)}}function r(e){s();var t,n=SearchIndexManager.search(e,v),i=[];for(t in n)n.hasOwnProperty(t)&&i.push(t);return i}var l,c,d,u,p,m,h,g,t={},f={},_={},v=!1,y="joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused".split(",");for(l=0,h=n.length;h>l;l++)for(m=i[l][1],c=0,g=n[l].length;g>c;c++)d=n[l][c],p=Config.Emoji[d],u=p[1][0],t[d]=[p[0],u],f[u]=d,_[d]=[l,c,Math.floor(c/m),c%m];e.EmojiHelper={emojis:t,shortcuts:f,spritesheetPositions:_,getPopularEmoji:a,pushPopularEmoji:o,indexEmojis:s,searchEmojis:r}}(window,Config.Emoji,Config.EmojiCategories,Config.EmojiCategorySpritesheetDimens),EmojiTooltip.prototype.onMouseEnter=function(e){this.hideTimeout?(clearTimeout(this.hideTimeout),delete this.hideTimeout):e&&!this.showTimeout&&(this.showTimeout=setTimeout(this.show.bind(this),200))},EmojiTooltip.prototype.onMouseLeave=function(e){if(this.hideTimeout)e&&this.showTimeout&&(clearTimeout(this.showTimeout),delete this.showTimeout);else{var t=this;this.hideTimeout=setTimeout(function(){t.hide()},400)}},EmojiTooltip.prototype.createTooltip=function(){if(this.tooltipEl)return!1;var e=this;return this.tooltipEl=$('<div class="composer_emoji_tooltip noselect"><div class="composer_emoji_tooltip_tabs"></div><div class="composer_emoji_tooltip_content clearfix"></div><div class="composer_emoji_tooltip_footer"><a class="composer_emoji_tooltip_settings"></a></div><div class="composer_emoji_tooltip_tail"><i class="icon icon-tooltip-tail"></i></div></div>').appendTo(document.body),this.tabsEl=$(".composer_emoji_tooltip_tabs",this.tooltipEl),this.contentEl=$(".composer_emoji_tooltip_content",this.tooltipEl),this.footerEl=$(".composer_emoji_tooltip_footer",this.tooltipEl),this.settingsEl=$(".composer_emoji_tooltip_settings",this.tooltipEl),angular.forEach(["recent","smile","flower","bell","car","grid","stickers"],function(t,n){var i=$('<a class="composer_emoji_tooltip_tab composer_emoji_tooltip_tab_'+t+'"></a>').on("mousedown",function(t){return e.selectTab(n),cancelEvent(t)}).appendTo(e.tabsEl);Config.Navigator.touch||i.on("mouseenter mouseleave",function(t){clearTimeout(e.selectTabTimeout),"mouseenter"==t.type&&(e.selectTabTimeout=setTimeout(function(){e.selectTab(n)},300))})}),this.scroller=new Scroller(this.contentEl,{classPrefix:"composer_emoji_tooltip"}),this.contentEl.on("mousedown",function(t){t=t.originalEvent||t;var n,i,a,o=$(t.target);return"A"!=o[0].tagName&&(o=$(o[0].parentNode)),(n=o.attr("data-code"))&&(e.onEmojiSelected&&e.onEmojiSelected(n),EmojiHelper.pushPopularEmoji(n)),(i=o.attr("data-sticker"))&&(e.onStickerSelected&&e.onStickerSelected(i),Config.Mobile&&e.hide()),(a=o.attr("data-stickerset"))&&(e.onStickersetSelected&&e.onStickersetSelected(a),e.hide()),cancelEvent(t)}),Config.Navigator.touch||this.tooltipEl.on("mouseenter mouseleave",function(t){"mouseenter"==t.type?e.onMouseEnter():e.onMouseLeave()}),this.selectTab(0),$(window).on("resize",this.updatePosition.bind(this)),!0},EmojiTooltip.prototype.selectTab=function(e){return this.tab===e&&6!=
}),t.$on("dialogs_search_toggle",function(){$(d).addClass("im_dialogs_panel_search"),t.$broadcast("ui_dialogs_search"),$(n).scrollTop(0),i(function(){setFieldSelection(c)})}),t.$on("search_clear",function(){$(d).removeClass("im_dialogs_panel_search"),t.$broadcast("ui_dialogs_search")}),o.$observe("hasTabs",function(e){e="true"==e,$(p).toggle(e),t.$broadcast("ui_dialogs_tabs",e)}),$(document).on("keydown",s),t.$on("$destroy",function(){$(document).off("keydown",s)}),t.$on("ui_dialogs_change",function(){onContentLoaded(function(){var e=$(l).find(".active a.im_dialog")[0];e&&scrollToNode(l,e.parentNode,r)})})}return{link:a}}]).directive("myDialogsList",["$window","$timeout",function(e,t){function n(n,i,a){function o(){if(u&&u.offsetHeight||(u=$(d)[0]),a.modal){var t=$(e).height()-(u?u.offsetHeight:58)-(Config.Mobile?46:200);return t=Math.min(350,t),$(i).css({height:t}),void g()}c&&c.offsetHeight||(c=$(".tg_page_head")[0]),p&&p.offsetHeight||(p=$(".footer_wrap")[0]),r&&r.offsetHeight||(r=$(".im_dialogs_col_wrap")[0]);var n=p?p.offsetHeight:0;n&&n++,$(i).css({height:$(e).height()-n-(c?c.offsetHeight:48)-(u?u.offsetHeight:58)-parseInt($(r).css("paddingBottom")||0)}),g()}var s=$(".im_dialogs_wrap",i)[0],r=$(".im_dialogs_col_wrap")[0],l=$(".im_dialogs_scrollable_wrap",i)[0],c=$(".tg_page_head")[0],d=Config.Mobile&&a.modal?".mobile_modal_body .im_dialogs_panel":".im_dialogs_panel",u=$(d)[0],p=$(".footer_wrap")[0],m=!1,h=!1;onContentLoaded(function(){$(s).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0})});var g=function(){onContentLoaded(function(){$(s).nanoScroller()})};n.$on("ui_dialogs_prepend",g),n.$on("ui_dialogs_tabs",function(e,t){m=t,o()}),n.$on("ui_dialogs_search",o),n.$on("ui_dialogs_update",o),n.$on("ui_dialogs_append",function(){onContentLoaded(function(){g(),h=!1,t(function(){$(l).trigger("scroll")})})}),n.$on("ui_dialogs_change",function(){onContentLoaded(function(){g(),h=!1,t(function(){$(l).trigger("scroll")})})}),$(l).on("scroll",function(){i.is(":visible")&&!h&&l.scrollTop>=l.scrollHeight-l.clientHeight-300&&(n.$emit("dialogs_need_more"),h=!0)}),$(e).on("resize",o),o(),setTimeout(o,1e3)}return{link:n}}]).directive("myContactsList",["$window","$timeout",function(e){function t(t,n){function i(){$(n).css({height:$(e).height()-(o&&o.offsetHeight||0)-(a&&a.offsetHeight||0)-(Config.Mobile?64:200)}),$(s).nanoScroller()}var a=$(".contacts_modal_search")[0],o=$(".contacts_modal_panel")[0],s=$(".contacts_wrap",n)[0];onContentLoaded(function(){$(s).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),i()}),$(e).on("resize",i),t.$on("contacts_change",function(){onContentLoaded(i)})}return{link:t}}]).directive("myCountriesList",["$window","$timeout",function(e){function t(t,n){function i(){$(n).css({height:$(e).height()-(o&&o.offsetHeight||0)-(a&&a.offsetHeight||0)-(Config.Mobile?64:200)}),$(s).nanoScroller()}var a=$(".countries_modal_search")[0],o=$(".countries_modal_panel")[0],s=$(".countries_wrap",n)[0];onContentLoaded(function(){$(s).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),i()}),$(e).on("resize",i),t.$on("contacts_change",function(){onContentLoaded(i)})}return{link:t}}]).directive("mySessionsList",["$window","$timeout",function(e){function t(t,n){function i(){$(n).css({height:Math.min(760,$(e).height()-(Config.Mobile?64:200))}),$(a).nanoScroller()}var a=$(".sessions_wrap",n)[0];onContentLoaded(function(){$(a).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),i()}),$(e).on("resize",i)}return{link:t}}]).directive("myStickersList",["$window","$timeout",function(e){function t(t,n){function i(){$(n).css({height:Math.min(500,$(e).height()-(Config.Mobile?64:200))}),$(a).nanoScroller()}var a=$(".stickerset_wrap",n)[0];onContentLoaded(function(){$(a).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),i()}),$(e).on("resize",i)}return{link:t}}]).directive("myHistory",["$window","$timeout","$rootScope","$transition",function(e,t,n,i){function a(a,o){function s(e,n){var i,a,o=!1;if(!e&&(a=$(".im_message_focus
})}return{link:e}}).directive("myScrollToOn",function(){return{link:function(e,t,n){var i=n.myScrollToOn,a=function(){onContentLoaded(function(){$("html, body").animate({scrollTop:t.offset().top},200)})};"$init"==i?a():e.$on(i,a)}}}),angular.module("myApp.directives").directive("myDialogsListMobile",["$window","$timeout",function(e,t){function n(n,i,a){function o(){return d&&d.offsetHeight||(d=$(c)[0]),a.modal?void $(i).css({height:$(e).height()-(d?d.offsetHeight:58)-46}):(l&&l.offsetHeight||(l=$(".tg_page_head")[0]),s&&s.offsetHeight||(s=$(".im_dialogs_col_wrap")[0]),void $(i).css({height:$(e).height()-(l?l.offsetHeight:46)-(d?d.offsetHeight:58)-parseInt($(s).css("paddingBottom")||0)}))}var s=$(".im_dialogs_col_wrap")[0],r=i[0],l=$(".tg_page_head")[0],c=a.modal?".mobile_modal_body .im_dialogs_panel":".im_dialogs_panel",d=$(c)[0],u=!1,p=!1;n.$on("ui_dialogs_tabs",function(e,t){u=t,o()}),n.$on("ui_dialogs_search",o),n.$on("ui_dialogs_update",o),n.$on("ui_dialogs_append",function(){onContentLoaded(function(){p=!1,t(function(){$(r).trigger("scroll")})})}),n.$on("ui_dialogs_change",function(){onContentLoaded(function(){p=!1,t(function(){$(r).trigger("scroll")})})}),$(r).on("scroll",function(){i.is(":visible")&&!p&&r.scrollTop>=r.scrollHeight-r.clientHeight-300&&(n.$emit("dialogs_need_more"),p=!0)}),$(e).on("resize",o),o(),setTimeout(o,1e3)}return{link:n}}]).directive("myHistoryMobile",["$window","$timeout","$rootScope","$transition",function(e,t){function n(n,i){function a(){var e,n;if(n=$(".im_message_focus:visible",l)[0]){var i=l.clientHeight,a=l.scrollTop,o=n.offsetTop,s=n.clientHeight;(!a||o>a+i||a>o+s)&&(l.scrollTop=Math.max(0,o-Math.floor(i/2)+26)),f=!1}else(e=$(".im_message_unread_split:visible",l)[0])?(l.scrollTop=Math.max(0,e.offsetTop-52),f=!1):(l.scrollTop=l.scrollHeight,f=!0);t(function(){$(l).trigger("scroll"),_=l.scrollTop})}function o(t){if(i.is(":visible")||$(i[0].parentNode.parentNode).is(":visible")){$(u).is(":visible")&&$(u).css({height:$(m).height()}),p&&p.offsetHeight||(p=$(".tg_page_head")[0]);var n=$(e).height()-d.offsetHeight-(p?p.offsetHeight:46);$(r).css({height:n}),s(),t!==!0&&f&&onContentLoaded(function(){l.scrollTop=l.scrollHeight})}}function s(){return}var r=$(".im_history_wrap",i)[0],l=($(".im_history_messages",i)[0],$(".im_history_scrollable_wrap",i)[0]),c=$(".im_history_scrollable",i)[0],d=$(".im_bottom_panel_wrap",i)[0],u=$(".im_send_form_wrap",i)[0],p=$(".tg_page_head")[0],m=$(".im_send_form",i)[0],h=!1,g=!1;onContentLoaded(function(){l.scrollTop=l.scrollHeight}),n.$on("ui_history_append_new",function(e,t){if(f||t.my){var n=parseInt($(l).css("paddingRight"));$(l).addClass("im_history_to_bottom"),$(c).css({bottom:0,marginLeft:-Math.ceil(n/2)}),onContentLoaded(function(){$(l).removeClass("im_history_to_bottom"),$(c).css({bottom:"",marginLeft:""}),l.scrollTop=l.scrollHeight,s()})}}),n.$on("ui_history_change",function(){var e=parseInt($(l).css("paddingRight"));$(l).addClass("im_history_to_bottom"),$(c).css({bottom:0,marginLeft:-Math.ceil(e/2)}),onContentLoaded(function(){$(l).removeClass("im_history_to_bottom"),$(c).css({bottom:"",marginLeft:""}),o(!0),h=!1,g=!1,a()})}),n.$on("ui_history_change_scroll",function(){onContentLoaded(a)}),n.$on("ui_history_focus",function(){f||(l.scrollTop=l.scrollHeight,f=!0)}),n.$on("ui_history_prepend",function(){var e=l.scrollHeight,i=l.scrollTop,o=parseInt($(l).css("paddingRight")),r=l.clientHeight;$(l).addClass("im_history_to_bottom"),l.scrollHeight,$(c).css({bottom:-(e-i-r),marginLeft:-Math.ceil(o/2)});var d=function(){$(l).removeClass("im_history_to_bottom"),$(c).css({bottom:"",marginLeft:""}),_>=0?a():l.scrollTop=i+l.scrollHeight-e,s(),h=!1,t(function(){l.scrollHeight!=e&&$(l).trigger("scroll")}),clearTimeout(u),p()},u=setTimeout(d,0),p=n.$on("$viewContentLoaded",d)}),n.$on("ui_history_append",function(){var e=l.scrollHeight;onContentLoaded(function(){f=!1,s(),g=!1,_>=0&&a(),t(function(){l.scrollHeight!=e&&$(l).trigger("scroll")})})}),n.$on("ui_panel_update",function(){onContentLoaded(function(){o(),n.$broadcast("ui_message_send"),t(function(){$(l).trigger