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.

18 lines
714 KiB

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 r=t*this[e++]+n[i]+a;a=Math.floor(r/67108864),n[i++]=67108863&r}return a}function am2(e,t,n,i,a,o){for(var r=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],l=this[e++]>>15,u=s*c+l*r;c=r*c+((32767&u)<<15)+n[i]+(1073741823&a),a=(c>>>30)+(u>>>15)+s*l+(a>>>30),n[i++]=1073741823&c}return a}function am3(e,t,n,i,a,o){for(var r=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],l=this[e++]>>14,u=s*c+l*r;c=r*c+((16383&u)<<14)+n[i]+a,a=(c>>28)+(u>>14)+s*l,n[i++]=268435455&c}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,r=0;--a>=0;){var s=8==i?255&e[a]:intAt(e,a);0>s?"-"==e.charAt(a)&&(o=!0):(o=!1,0==r?this[this.t++]=s:r+i>this.DB?(this[this.t-1]|=(s&(1<<this.DB-r)-1)<<r,this[this.t++]=s>>this.DB-r):this[this.t-1]|=s<<r,r+=i,r>=this.DB&&(r-=this.DB))}8==i&&0!=(128&e[0])&&n&&(this.s=-1,r>0&&(this[this.t-1]|=(1<<this.DB-r)-1<<r)),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="",r=this.t,s=this.DB-r*this.DB%t;if(r-->0)for(s<this.DB&&(n=this[r]>>s)>0&&(a=!0,o=int2char(n));r>=0;)t>s?(n=(this[r]&(1<<s)-1)<<t-s,n|=this[--r]>>(s+=this.DB-t)):(n=this[r]>>(s-=t)&i,0>=s&&(s+=this.DB,--r)),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,r=Math.floor(e/this.DB),s=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+r+1]=this[n]>>a|s,s=(this[n]&o)<<i;for(n=r-1;n>=0;--n)t[n]=0;t[r]=s,t.t=this.t+r+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 r=n+1;r<this.t;++r)t[r-n-1]|=(this[r]&o)<<a,t[r-n]=this[r]>>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 F(e,t,n){var i,a,o,r,s,c,l,u,d=this,p={},h=e.style,f=e.nodeType&&Tt(e),g=at._data(e,"fxshow");n.queue||(s=at._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,c=s.empty.fire,s.empty.fire=function(){s.unqueued||c()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,at.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],l=at.css(e,"display"),u="none"===l?at._data(e,"olddisplay")||k(e.nodeName):l,"inline"===u&&"none"===at.css(e,"float")&&(nt.inlineBlockNeedsLayout&&"inline"!==k(e.nodeName)?h.zoom=1:h.display="inline-block")),n.overflow&&(h.overflow="hidden",nt.shrinkWrapBlocks()||d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],mn.exec(a)){if(delete t[i],o=o||"toggle"===a,a===(f?"hide":"show")){if("show"!==a||!g||void 0===g[i])continue;f=!0}p[i]=g&&g[i]||at.style(e,i)}else l=void 0;if(at.isEmptyObject(p))"inline"===("none"===l?k(e.nodeName):l)&&(h.display=l);else{g?"hidden"in g&&(f=g.hidden):g=at._data(e,"fxshow",{}),o&&(g.hidden=!f),f?at(e).show():d.done(function(){at(e).hide()}),d.done(function(){var t;at._removeData(e,"fxshow");for(t in p)at.style(e,t,p[t])});for(i in p)r=L(f?g[i]:0,i,d),i in g||(g[i]=r.start,f&&(r.end=r.start,r.start="width"===i||"height"===i?1:0))}}function B(e,t){var n,i,a,o,r;for(n in e)if(i=at.camelCase(n),a=t[i],o=e[n],at.isArray(o)&&(a=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),r=at.cssHooks[i],r&&"expand"in r){o=r.expand(o),delete e[i];for(n in o)n in e||(e[n]=o[n],t[n]=a)}else t[i]=a}function O(e,t,n){var i,a,o=0,r=_n.length,s=at.Deferred().always(function(){delete c.elem}),c=function(){if(a)return!1;for(var t=fn||P(),n=Math.max(0,l.startTime+l.duration-t),i=n/l.duration||0,o=1-i,r=0,c=l.tweens.length;c>r;r++)l.tweens[r].run(o);return s.notifyWith(e,[l,o,n]),1>o&&c?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:at.extend({},t),opts:at.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:fn||P(),duration:n.duration,tweens:[],createTween:function(t,n){var i=at.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,i=t?l.tweens.length:0;if(a)return this;for(a=!0;i>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),u=l.props;for(B(u,l.opts.specialEasing);r>o;o++)if(i=_n[o].call(l,e,u,l.opts))return i;return at.map(u,L,l),at.isFunction(l.opts.start)&&l.opts.start.call(e,l),at.fx.timer(at.extend(c,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function U(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,a=0,o=t.toLowerCase().match(_t)||[];if(at.isFunction(n))for(;i=o[a++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function R(e,t,n,i){function a(s){var c;return o[s]=!0,at.each(e[s]||[],function(e,s){var l=s(t,n,i);return"string"!=typeof l||r||o[l]?r?!(c=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),c}var o={},r=e===Vn;return a(t.dataTypes[0])||!o["*"]&&a("*")}function q(e,t){var n,i,a=at.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((a[i]?e:n||(n={}))[i]=t[i]);return n&&at.extend(!0,e,n),e}function H(e,t,n){for(var i,a,o,r,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===a&&(a=e.mimeType||t.getResponseHeader("Content-Type"));if(a)for(r in s)if(s[r]&&s[r].test(a)){c.unshift(r);break}if(c[0]in n)o=c[0];else{for(r in n){if(!c[0]||e.converters[r+" "+c[0]]){o=r;break}i||(i=r)}o=o||i}return o?(o!==c[0]&&c.unshift(o),n[o]):void 0}function j(e,t,n,i){var a,o,r,s,c,l={},u=e.dataTypes.slice();if(u[1])for(r in e.converters)l[r.toLowerCase()]=e.converters[r];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!c&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=o,o=u.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(r=l[c+" "+o]||l["* "+o],!r)for(a in l)if(s=a.split(" "),s[1]===o&&(r=l[c+" "+s[0]]||l["* "+s[0]])){r===
},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},at.extend({Deferred:function(e){var t=[["resolve","done",at.Callbacks("once memory"),"resolved"],["reject","fail",at.Callbacks("once memory"),"rejected"],["notify","progress",at.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var e=arguments;return at.Deferred(function(n){at.each(t,function(t,o){var r=at.isFunction(e[t])&&e[t];a[o[1]](function(){var e=r&&r.apply(this,arguments);e&&at.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?at.extend(e,i):i}},a={};return i.pipe=i.then,at.each(t,function(e,o){var r=o[2],s=o[3];i[o[1]]=r.add,s&&r.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),a[o[0]]=function(){return a[o[0]+"With"](this===a?i:this,arguments),this},a[o[0]+"With"]=r.fireWith}),i.promise(a),e&&e.call(a,a),a},when:function(e){var t,n,i,a=0,o=X.call(arguments),r=o.length,s=1!==r||e&&at.isFunction(e.promise)?r:0,c=1===s?e:at.Deferred(),l=function(e,n,i){return function(a){n[e]=this,i[e]=arguments.length>1?X.call(arguments):a,i===t?c.notifyWith(n,i):--s||c.resolveWith(n,i)}};if(r>1)for(t=new Array(r),n=new Array(r),i=new Array(r);r>a;a++)o[a]&&at.isFunction(o[a].promise)?o[a].promise().done(l(a,i,o)).fail(c.reject).progress(l(a,n,t)):--s;return s||c.resolveWith(i,o),c.promise()}});var wt;at.fn.ready=function(e){return at.ready.promise().done(e),this},at.extend({isReady:!1,readyWait:1,holdReady:function(e){e?at.readyWait++:at.ready(!0)},ready:function(e){if(e===!0?!--at.readyWait:!at.isReady){if(!ft.body)return setTimeout(at.ready);at.isReady=!0,e!==!0&&--at.readyWait>0||(wt.resolveWith(ft,[at]),at.fn.triggerHandler&&(at(ft).triggerHandler("ready"),at(ft).off("ready")))}}}),at.ready.promise=function(t){if(!wt)if(wt=at.Deferred(),"complete"===ft.readyState)setTimeout(at.ready);else if(ft.addEventListener)ft.addEventListener("DOMContentLoaded",s,!1),e.addEventListener("load",s,!1);else{ft.attachEvent("onreadystatechange",s),e.attachEvent("onload",s);var n=!1;try{n=null==e.frameElement&&ft.documentElement}catch(i){}n&&n.doScroll&&!function a(){if(!at.isReady){try{n.doScroll("left")}catch(e){return setTimeout(a,50)}r(),at.ready()}}()}return wt.promise(t)};var $t,Ct="undefined";for($t in at(nt))break;nt.ownLast="0"!==$t,nt.inlineBlockNeedsLayout=!1,at(function(){var e,t,n,i;n=ft.getElementsByTagName("body")[0],n&&n.style&&(t=ft.createElement("div"),i=ft.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==Ct&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",nt.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))}),function(){var e=ft.createElement("div");if(null==nt.deleteExpando){nt.deleteExpando=!0;try{delete e.test}catch(t){nt.deleteExpando=!1}}e=null}(),at.acceptData=function(e){var t=at.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return 1!==n&&9!==n?!1:!t||t!==!0&&e.getAttribute("classid")===t};var St=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,kt=/([A-Z])/g;at.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?at.cache[e[at.expando]]:e[at.expando],!!e&&!l(e)},data:function(e,t,n){return u(e,t,n)},removeData:function(e,t){return d(e,t)},_data:function(e,t,n){return u(e,t,n,!0)},_removeData:function(e,t){return d(e,t,!0)}}),at.fn.extend({data:function(e,t){var n,i,a,o=this[0],r=o&&o.attributes;if(void 0===e){if(this.length&&(a=at.data(o),1===o.nodeType&&!at._data(o,"parsedAttrs"))){for(n=r.length;n--;)r[n]&&(i=r[n].name,0===i.indexOf("data-")&&(i=at.camelCase(i.slice(5)),c(o,i,a[i])));at._data(o,"parsedAttrs",!0)}return a}return"object"==typeof e?this.each(function(){at.data(this,e)}):arguments.length>1?this.each(function()
}},at.fx=I.prototype.init,at.fx.step={};var fn,gn,mn=/^(?:toggle|show|hide)$/,vn=new RegExp("^(?:([+-])=|)("+xt+")([a-z%]*)$","i"),yn=/queueHooks$/,_n=[F],bn={"*":[function(e,t){var n=this.createTween(e,t),i=n.cur(),a=vn.exec(t),o=a&&a[3]||(at.cssNumber[e]?"":"px"),r=(at.cssNumber[e]||"px"!==o&&+i)&&vn.exec(at.css(n.elem,e)),s=1,c=20;if(r&&r[3]!==o){o=o||r[3],a=a||[],r=+i||1;do s=s||".5",r/=s,at.style(n.elem,e,r+o);while(s!==(s=n.cur()/i)&&1!==s&&--c)}return a&&(r=n.start=+r||+i||0,n.unit=o,n.end=a[1]?r+(a[1]+1)*a[2]:+a[2]),n}]};at.Animation=at.extend(O,{tweener:function(e,t){at.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,a=e.length;a>i;i++)n=e[i],bn[n]=bn[n]||[],bn[n].unshift(t)},prefilter:function(e,t){t?_n.unshift(e):_n.push(e)}}),at.speed=function(e,t,n){var i=e&&"object"==typeof e?at.extend({},e):{complete:n||!n&&t||at.isFunction(e)&&e,duration:e,easing:n&&t||t&&!at.isFunction(t)&&t};return i.duration=at.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in at.fx.speeds?at.fx.speeds[i.duration]:at.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){at.isFunction(i.old)&&i.old.call(this),i.queue&&at.dequeue(this,i.queue)},i},at.fn.extend({fadeTo:function(e,t,n,i){return this.filter(Tt).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var a=at.isEmptyObject(e),o=at.speed(t,n,i),r=function(){var t=O(this,at.extend({},e),o);(a||at._data(this,"finish"))&&t.stop(!0)};return r.finish=r,a||o.queue===!1?this.each(r):this.queue(o.queue,r)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,a=null!=e&&e+"queueHooks",o=at.timers,r=at._data(this);if(a)r[a]&&r[a].stop&&i(r[a]);else for(a in r)r[a]&&r[a].stop&&yn.test(a)&&i(r[a]);for(a=o.length;a--;)o[a].elem!==this||null!=e&&o[a].queue!==e||(o[a].anim.stop(n),t=!1,o.splice(a,1));(t||!n)&&at.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=at._data(this),i=n[e+"queue"],a=n[e+"queueHooks"],o=at.timers,r=i?i.length:0;for(n.finish=!0,at.queue(this,e,[]),a&&a.stop&&a.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;r>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),at.each(["toggle","show","hide"],function(e,t){var n=at.fn[t];at.fn[t]=function(e,i,a){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,i,a)}}),at.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){at.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),at.timers=[],at.fx.tick=function(){var e,t=at.timers,n=0;for(fn=at.now();n<t.length;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||at.fx.stop(),fn=void 0},at.fx.timer=function(e){at.timers.push(e),e()?at.fx.start():at.timers.pop()},at.fx.interval=13,at.fx.start=function(){gn||(gn=setInterval(at.fx.tick,at.fx.interval))},at.fx.stop=function(){clearInterval(gn),gn=null},at.fx.speeds={slow:600,fast:200,_default:400},at.fn.delay=function(e,t){return e=at.fx?at.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var i=setTimeout(t,e);n.stop=function(){clearTimeout(i)}})},function(){var e,t,n,i,a;t=ft.createElement("div"),t.setAttribute("className","t"),t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",i=t.getElementsByTagName("a")[0],n=ft.createElement("select"),a=n.appendChild(ft.createElement("option")),e=t.getElementsByTagName("input")[0],i.style.cssText="top:1px",nt.getSetAttribute="t"!==t.className,nt.style=/top/.test(i.getAttribute("style")),nt.hrefNormalized="/a"===i.getAttribute("href"),nt.checkOn=!!e.value,nt.optSelected=a.selected,nt.enctype=!!ft.createElement("form").enctype,n.disabled=!0,nt.optDisabled=!a.disabled,e=ft.createElement("input"),e.setAttribute("value",""),nt.input=""===e.getAttribute("value"),e.value="t",e.setAttr
}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(e,t,n){"use strict";var i,a,o,r,s,c,l,u,d,p,h,f,g,m,v,y,_,b,w,$,C,S,k,x,M,T,E,A,D,I,P;k={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",_="scroll",d="mousedown",p="mouseenter",h="mousemove",g="mousewheel",f="mouseup",y="resize",s="drag",c="enter",$="up",v="panedown",o="DOMMouseScroll",r="down",C="wheel",l="keydown",u="keyup",w="touchmove",i="Microsoft Internet Explorer"===t.navigator.appName&&/msie 7./i.test(t.navigator.appVersion)&&t.ActiveXObject,a=null,E=t.requestAnimationFrame,S=t.cancelAnimationFrame,D=n.createElement("div").style,P=function(){var e,t,n,i,a,o;for(i=["t","webkitT","MozT","msT","OT"],e=a=0,o=i.length;o>a;e=++a)if(n=i[e],t=i[e]+"ransform",t in D)return i[e].substr(0,i[e].length-1);return!1}(),I=function(e){return P===!1?!1:""===P?e:P+e.charAt(0).toUpperCase()+e.substr(1)},A=I("transform"),M=A!==!1,x=function(){var e,t,i;return e=n.createElement("div"),t=e.style,t.position="absolute",t.width="100px",t.height="100px",t.overflow=_,t.top="-9999px",n.body.appendChild(e),i=e.offsetWidth-e.clientWidth,n.body.removeChild(e),i},T=function(){var e,n,i;return n=t.navigator.userAgent,(e=/(?=.+Mac OS X)(?=.+Firefox)/.test(n))?(i=/Firefox\/\d{2}\./.exec(n),i&&(i=i[0].replace(/\D+/g,"")),e&&+i>23):!1},m=function(){function l(i,o){this.el=i,this.options=o,a||(a=x()),this.$el=e(this.el),this.doc=e(this.options.documentContext||n),this.win=e(this.options.windowContext||t),this.body=this.doc.find("body"),this.$content=this.$el.children("."+o.contentClass),this.$content.attr("tabindex",this.options.tabIndex||0),this.content=this.$content[0],this.previousPosition=0,this.options.iOSNativeScrolling&&(null!=this.el.style.WebkitOverflowScrolling||navigator.userAgent.match(/mobi.+Gecko/i))?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}return l.prototype.preventScrolling=function(e,t){if(this.isActive)if(e.type===o)(t===r&&e.originalEvent.detail>0||t===$&&e.originalEvent.detail<0)&&e.preventDefault();else if(e.type===g){if(!e.originalEvent||!e.originalEvent.wheelDelta)return;(t===r&&e.originalEvent.wheelDelta<0||t===$&&e.originalEvent.wheelDelta>0)&&e.preventDefault()}},l.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0},l.prototype.updateScrollValues=function(){var e,t;e=this.content,this.maxScrollTop=e.scrollHeight-e.clientHeight,this.prevScrollTop=this.contentScrollTop||0,this.contentScrollTop=e.scrollTop,t=this.contentScrollTop>this.previousPosition?"down":this.contentScrollTop<this.previousPosition?"up":"same",this.previousPosition=this.contentScrollTop,"same"!==t&&this.$el.trigger("update",{position:this.contentScrollTop,maximum:this.maxScrollTop,direction:t}),this.iOSNativeScrolling||(this.maxSliderTop=this.paneHeight-this.sliderHeight,this.sliderTop=0===this.maxScrollTop?0:this.contentScrollTop*this.maxSliderTop/this.maxScrollTop)},l.prototype.setOnScrollStyles=function(){var e;M?(e={},e[A]="translate(0, "+this.sliderTop+"px)"):e={top:this.sliderTop},E?(S&&thi
}function ft(e){return e.replace(oa,function(e,t,n,i){return i?n.toUpperCase():n}).replace(ra,"Moz$1")}function gt(e){return!ua.test(e)}function mt(e){var t=e.nodeType;return 1===t||!t||9===t}function vt(e,t){var n,i,a,r,s=t.createDocumentFragment(),c=[];if(gt(e))c.push(t.createTextNode(e));else{for(n=n||s.appendChild(t.createElement("div")),i=(da.exec(e)||["",""])[1].toLowerCase(),a=ha[i]||ha._default,n.innerHTML=a[1]+e.replace(pa,"<$1></$2>")+a[2],r=a[0];r--;)n=n.lastChild;c=R(c,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",o(c,function(e){s.appendChild(e)}),s}function yt(e,n){n=n||t;var i;return(i=la.exec(e))?[n.createElement(i[1])]:(i=vt(e,n))?i.childNodes:[]}function _t(e){if(e instanceof _t)return e;var t;if(b(e)&&(e=Xi(e),t=!0),!(this instanceof _t)){if(t&&"<"!=e.charAt(0))throw ca("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new _t(e)}t?Et(this,yt(e)):Et(this,e)}function bt(e){return e.cloneNode(!0)}function wt(e,t){if(t||Ct(e),e.querySelectorAll)for(var n=e.querySelectorAll("*"),i=0,a=n.length;a>i;i++)Ct(n[i])}function $t(e,t,n,i){if(y(i))throw ca("offargs","jqLite#off() does not support the `selector` argument");var a=St(e),r=a&&a.events,s=a&&a.handle;if(s)if(t)o(t.split(" "),function(t){v(n)?(aa(e,t,r[t]),delete r[t]):F(r[t]||[],n)});else for(t in r)"$destroy"!==t&&aa(e,t,r[t]),delete r[t]}function Ct(e,t){var i=e.ng339,a=i&&ta[i];if(a){if(t)return void delete a.data[t];a.handle&&(a.events.$destroy&&a.handle({},"$destroy"),$t(e)),delete ta[i],e.ng339=n}}function St(e,t){var i=e.ng339,a=i&&ta[i];return t&&!a&&(e.ng339=i=ht(),a=ta[i]={events:{},data:{},handle:n}),a}function kt(e,t,n){if(mt(e)){var i=y(n),a=!i&&t&&!_(t),o=!t,r=St(e,!a),s=r&&r.data;if(i)s[t]=n;else{if(o)return s;if(a)return s&&s[t];d(s,t)}}}function xt(e,t){return e.getAttribute?(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1:!1}function Mt(e,t){t&&e.setAttribute&&o(t.split(" "),function(t){e.setAttribute("class",Xi((" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+Xi(t)+" "," ")))})}function Tt(e,t){if(t&&e.setAttribute){var n=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");o(t.split(" "),function(e){e=Xi(e),-1===n.indexOf(" "+e+" ")&&(n+=e+" ")}),e.setAttribute("class",Xi(n))}}function Et(e,t){if(t)if(t.nodeType)e[e.length++]=t;else{var n=t.length;if("number"==typeof n&&t.window!==t){if(n)for(var i=0;n>i;i++)e[e.length++]=t[i]}else e[e.length++]=t}}function At(e,t){return Dt(e,"$"+(t||"ngController")+"Controller")}function Dt(e,t,i){9==e.nodeType&&(e=e.documentElement);for(var a=Ki(t)?t:[t];e;){for(var o=0,r=a.length;r>o;o++)if((i=Oi.data(e,a[o]))!==n)return i;e=e.parentNode||11===e.nodeType&&e.host}}function It(e){for(wt(e,!0);e.firstChild;)e.removeChild(e.firstChild)}function Pt(e,t){t||wt(e);var n=e.parentNode;n&&n.removeChild(e)}function Nt(e,t){var n=ga[t.toLowerCase()];return n&&ma[I(e)]&&n}function Lt(e,t){var n=e.nodeName;return("INPUT"===n||"TEXTAREA"===n)&&va[t]}function Ft(e,t){var n=function(n,i){n.isDefaultPrevented=function(){return n.defaultPrevented};var a=t[i||n.type],o=a?a.length:0;if(o){o>1&&(a=O(a));for(var r=0;o>r;r++)a[r].call(e,n)}};return n.elem=e,n}function Bt(e,t){var n=e&&e.$$hashKey;if(n)return"function"==typeof n&&(n=e.$$hashKey()),n;var i=typeof e;return n="function"==i||"object"==i&&null!==e?e.$$hashKey=i+":"+(t||l)():i+":"+e}function Ot(e,t){if(t){var n=0;this.nextUid=function(){return++n}}o(e,this.put,this)}function Ut(e){var t=e.toString().replace(wa,""),n=t.match(ya);return n?"function("+(n[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function Rt(e,t,n){var i,a,r,s;if("function"==typeof e){if(!(i=e.$inject)){if(i=[],e.length){if(t)throw b(n)&&n||(n=e.name||Ut(e)),$a("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);a=e.toString().replace(wa,""),r=a.match(ya),o(r[1].split(_a),function(e){e.replace(ba,function(e,t,n){i.push(n)})})}e.$inject=i}}else Ki(e)?(s=e.length-1,rt(e[s],"
return r.startSymbol=function(){return e},r.endSymbol=function(){return t},r}]}function un(){this.$get=["$rootScope","$window","$q","$$q",function(e,t,n,i){function a(a,r,s,c){var l=t.setInterval,u=t.clearInterval,d=0,p=y(c)&&!c,h=(p?i:n).defer(),f=h.promise;return s=y(s)?s:0,f.then(null,null,a),f.$$intervalId=l(function(){h.notify(d++),s>0&&d>=s&&(h.resolve(d),u(f.$$intervalId),delete o[f.$$intervalId]),p||e.$apply()},r),o[f.$$intervalId]=h,f}var o={};return a.cancel=function(e){return e&&e.$$intervalId in o?(o[e.$$intervalId].reject("canceled"),t.clearInterval(e.$$intervalId),delete o[e.$$intervalId],!0):!1},a}]}function dn(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(e){return 1===e?"one":"other"}}}}function pn(e){for(var t=e.split("/"),n=t.length;n--;)t[n]=Y(t[n]);return t.join("/")}function hn(e,t,n){var i=Kn(e,n);t.$$protocol=i.protocol,t.$$host=i.hostname,t.$$port=p(i.port)||Ea[i.protocol]||null}function fn(e,t,n){var i="/"!==e.charAt(0);i&&(e="/"+e);var a=Kn(e,n);t.$$path=decodeURIComponent(i&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname),t.$$search=K(a.search),t.$$hash=decodeURIComponent(a.hash),t.$$path&&"/"!=t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function gn(e,t){return 0===t.indexOf(e)?t.substr(e.length):void 0}function mn(e){var t=e.indexOf("#");return-1==t?e:e.substr(0,t)}function vn(e){return e.substr(0,mn(e).lastIndexOf("/")+1)}function yn(e){return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function _n(e,t){this.$$html5=!0,t=t||"";var i=vn(e);hn(e,this,e),this.$$parse=function(t){var n=gn(i,t);if(!b(n))throw Aa("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',t,i);fn(n,this,e),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var e=X(this.$$search),t=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=pn(this.$$path)+(e?"?"+e:"")+t,this.$$absUrl=i+this.$$url.substr(1)},this.$$parseLinkUrl=function(a,o){if(o&&"#"===o[0])return this.hash(o.slice(1)),!0;var r,s,c;return(r=gn(e,a))!==n?(s=r,c=(r=gn(t,r))!==n?i+(gn("/",r)||r):e+s):(r=gn(i,a))!==n?c=i+r:i==a+"/"&&(c=i),c&&this.$$parse(c),!!c}}function bn(e,t){var n=vn(e);hn(e,this,e),this.$$parse=function(i){function a(e,t,n){var i,a=/^\/[A-Z]:(\/.*)/;return 0===t.indexOf(n)&&(t=t.replace(n,"")),a.exec(t)?e:(i=a.exec(e),i?i[1]:e)}var o=gn(e,i)||gn(n,i),r="#"==o.charAt(0)?gn(t,o):this.$$html5?o:"";if(!b(r))throw Aa("ihshprfx",'Invalid url "{0}", missing hash prefix "{1}".',i,t);fn(r,this,e),this.$$path=a(this.$$path,r,e),this.$$compose()},this.$$compose=function(){var n=X(this.$$search),i=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=pn(this.$$path)+(n?"?"+n:"")+i,this.$$absUrl=e+(this.$$url?t+this.$$url:"")},this.$$parseLinkUrl=function(t){return mn(e)==mn(t)?(this.$$parse(t),!0):!1}}function wn(e,t){this.$$html5=!0,bn.apply(this,arguments);var n=vn(e);this.$$parseLinkUrl=function(i,a){if(a&&"#"===a[0])return this.hash(a.slice(1)),!0;var o,r;return e==mn(i)?o=i:(r=gn(n,i))?o=e+t+r:n===i+"/"&&(o=n),o&&this.$$parse(o),!!o},this.$$compose=function(){var n=X(this.$$search),i=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=pn(this.$$path)+(n?"?"+n:"")+i,this.$$absUrl=e+t+this.$$url}}function $n(e){return function(){return this[e]}}function Cn(e,t){return function(n){return v(n)?this[e]:(this[e]=t(n),this.$$compose(),this)}}function Sn(
d&&(a=L(d,i)>=0,a&&(F(d,i),u--,0===d.length&&delete s.$pending[e]));var h=s.$pending&&0===u;if(h&&(s.$pending=n),t)(o||a)&&(o&&F(o,i),o&&o.length||(p[e]&&l--,l?h&&(r(!1),s.$valid=!1,s.$invalid=!0):s.$pending||(r(t),s.$valid=!0,s.$invalid=!1),p[e]=!1,r(!0,e),c.$setValidity(e,!0,s)));else{if(s.$pending||(s.$valid=!1,s.$invalid=!0),l||r(t),o){if(N(o,i))return}else p[e]=o=[],l++,r(!1,e),c.$setValidity(e,!1,s);o.push(i)}},s.$setDirty=function(){a.removeClass(e,yo),a.addClass(e,_o),s.$dirty=!0,s.$pristine=!1,c.$setDirty()},s.$setPristine=function(){a.setClass(e,yo,_o+" "+Ja),s.$dirty=!1,s.$pristine=!0,s.$submitted=!1,o(d,function(e){e.$setPristine()})},s.$setSubmitted=function(){a.addClass(e,Ja),s.$submitted=!0,c.$setSubmitted()}}function mi(e){e.$formatters.push(function(t){return e.$isEmpty(t)?t:t.toString()})}function vi(e,t,n,i,a,o){yi(e,t,n,i,a,o),mi(i)}function yi(e,t,n,i,a,o){var r=t.prop(Di),s=t[0].placeholder,c={},l=Ii(t[0].type);if(i.$$validityState=r,!a.android){var u=!1;t.on("compositionstart",function(){u=!0}),t.on("compositionend",function(){u=!1,d()})}var d=function(a){if(!u){var o=t.val(),d=a&&a.type;if(Bi&&"input"===(a||c).type&&t[0].placeholder!==s)return void(s=t[0].placeholder);"password"===l||n.ngTrim&&"false"===n.ngTrim||(o=Xi(o));var p=r&&i.$$hasNativeValidators;(i.$viewValue!==o||""===o&&p)&&(e.$$phase?i.$setViewValue(o,d,p):e.$apply(function(){i.$setViewValue(o,d,p)}))}};if(a.hasEvent("input"))t.on("input",d);else{var p,h=function(e){p||(p=o.defer(function(){d(e),p=null}))};t.on("keydown",function(e){var t=e.keyCode;91===t||t>15&&19>t||t>=37&&40>=t||h(e)}),a.hasEvent("paste")&&t.on("paste cut",h)}t.on("change",d),i.$render=function(){t.val(i.$isEmpty(i.$viewValue)?"":i.$viewValue)}}function _i(e){if($(e))return e;if(b(e)){co.lastIndex=0;var t=co.exec(e);if(t){var n=+t[1],i=+t[2],a=ri(n),o=7*(i-1);return new Date(n,0,a.getDate()+o)}}return 0/0}function bi(e,t){return function(n){var i,a;return $(n)?n:b(n)&&(e.lastIndex=0,i=e.exec(n))?(i.shift(),a={yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0},o(i,function(e,n){n<t.length&&(a[t[n]]=+e)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0)):0/0}}function wi(e,t,i,a){return function(o,r,s,c,l,u,d){$i(o,r,s,c),yi(o,r,s,c,l,u);var p=c&&c.$options&&c.$options.timezone;c.$$parserName=e,c.$parsers.push(function(e){if(c.$isEmpty(e))return null;if(t.test(e)){var a=i(e);return"UTC"===p&&a.setMinutes(a.getMinutes()-a.getTimezoneOffset()),a}return n}),c.$formatters.push(function(e){return $(e)?d("date")(e,a,p):""}),s.min&&(c.$validators.min=function(e){return c.$isEmpty(e)||v(s.min)||i(e)>=i(s.min)}),s.max&&(c.$validators.max=function(e){return c.$isEmpty(e)||v(s.max)||i(e)<=i(s.max)})}}function $i(e,t,i,a){var o=t[0],r=a.$$hasNativeValidators=_(o.validity);r&&a.$parsers.push(function(e){var i=t.prop(Di)||{};return i.badInput||i.typeMismatch?n:e})}function Ci(e,t,i,a,o,r){$i(e,t,i,a),yi(e,t,i,a,o,r),a.$$parserName="number",a.$parsers.push(function(e){return a.$isEmpty(e)?null:oo.test(e)?parseFloat(e):n}),a.$formatters.push(function(e){if(!a.$isEmpty(e)){if(!w(e))throw ho("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),i.min&&(a.$validators.min=function(e){return a.$isEmpty(e)||v(i.min)||e>=parseFloat(i.min)}),i.max&&(a.$validators.max=function(e){return a.$isEmpty(e)||v(i.max)||e<=parseFloat(i.max)})}function Si(e,t,n,i,a,o){$i(e,t,n,i),yi(e,t,n,i,a,o),mi(i),i.$$parserName="url",i.$validators.url=function(e,t){var n=e||t;return i.$isEmpty(n)||io.test(n)}}function ki(e,t,n,i,a,o){$i(e,t,n,i),yi(e,t,n,i,a,o),mi(i),i.$$parserName="email",i.$validators.email=function(e,t){var n=e||t;return i.$isEmpty(n)||ao.test(n)}}function xi(e,t,n,i){v(n.name)&&t.attr("name",l());var a=function(a){t[0].checked&&e.$apply(function(){i.$setViewValue(n.value,a&&a.type)})};t.on("click",a),i.$render=function(){var e=n.value;t[0].checked=e==i.$viewValue},n.$observe("value",i.$render)}function Mi(e,t,n,a,o){var r;if(y(a)){if(r=e(a),!r.constant)throw i("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,a);return r(t)}return o}function Ti(e,t,n,i,a,o,r,s)
},i):h.$commitViewValue(t)},e.$watch(function(){var t=u(e);if(h.$options&&h.$options.getterSetter&&C(t)&&(t=t()),h.$modelValue!==t&&(v(h.$$invalidModelValue)||h.$$invalidModelValue!=t)){for(var n=h.$formatters,i=n.length,a=t;i--;)a=n[i](a);h.$$runValidators(t,a),h.$viewValue!==a&&(h.$viewValue=h.$$lastCommittedViewValue=a,h.$render())}return t})}],So=function(){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Co,link:{pre:function(e,t,n,i){var a=i[0],o=i[1]||Qa;a.$$setOptions(i[2]&&i[2].$options),o.$addControl(a),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(t){e.$apply(function(){a.$$debounceViewValueCommit(t&&t.type)})}),t.on("blur",function(){a.$touched||e.$apply(function(){a.$setTouched()})})}}}},ko=m({restrict:"A",require:"ngModel",link:function(e,t,n,i){i.$viewChangeListeners.push(function(){e.$eval(n.ngChange)})}}),xo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,n,i){i&&(n.required=!0,i.$validators.required=function(e,t){return!n.required||!i.$isEmpty(t)},n.$observe("required",function(){i.$validate()}))}}},Mo=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,a,o){if(o){var r,s=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}",s,e,W(t));r=e||n,o.$validate()}),o.$validators.pattern=function(e){return o.$isEmpty(e)||v(r)||r.test(e)}}}}},To=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(t)||t.length<=a}}}}},Eo=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(t)||t.length>=a}}}}},Ao=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,i,a){var r=t.attr(i.$attr.ngList)||", ",s="false"!==i.ngTrim,c=s?Xi(r):r,l=function(e){if(!v(e)){var t=[];return e&&o(e.split(c),function(e){e&&t.push(s?Xi(e):e)}),t}};a.$parsers.push(l),a.$formatters.push(function(e){return Ki(e)?e.join(r):n}),a.$isEmpty=function(e){return!e||!e.length}}}},Do=/^(true|false|\d+)$/,Io=function(){return{restrict:"A",priority:100,compile:function(e,t){return Do.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)})}}}},Po=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=Xi(this.$options.updateOn.replace(po,function(){return i.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},No=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,i,a){e.$$addBindingInfo(i,a.ngBind),t.$watch(a.ngBind,function(e){i.text(e==n?"":e)})}}}}],Lo=["$interpolate","$compile",function(e,t){return{compile:function(n){return t.$$addBindingClass(n),function(n,i,a){var o=e(i.attr(a.$attr.ngBindTemplate));t.$$addBindingInfo(i,o.expressions),a.$observe("ngBindTemplate",function(e){i.text(e)})}}}}],Fo=["$sce","$parse","$compile",function(e,t,n){return{restrict:"A",compile:function(i,a){var o=t(a.ngBindHtml),r=t(a.ngBindHtml,function(e){return(e||"").toString()});return n.$$addBindingClass(i),function(t,i,a){n.$$addBindingInfo(i,a.ngBindHtml),t.$watch(r,function(){i.html(e.getTrustedHtml(o(t))||"")})}}}}],Bo=Ei("",!0),Oo=Ei("Odd",0),Uo=Ei("Even",1),Ro=fi({compile:function(e,t){t.$set("ngCloak",n),e.removeClass("ng-cloak")}}),qo=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Ho={},jo={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress
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,s){if(i=t.lowercase(i),S[i])for(;_.last()&&k[_.last()];)a("",_.last());C[i]&&_.last()==i&&a("",i),s=b[i]||!!s,s||_.push(i);var c={};o.replace(p,function(e,t,n,i,a){var o=n||i||a||"";c[t]=r(o)}),n.start&&n.start(i,c,s)}function a(e,i){var a,o=0;if(i=t.lowercase(i))for(o=_.length-1;o>=0&&_[o]!=i;o--);if(o>=0){for(a=_.length-1;a>=o;a--)n.end&&n.end(_[a]);_.length=o}}"string"!=typeof e&&(e=null===e||"undefined"==typeof e?"":""+e);var o,s,c,y,_=[],w=e;for(_.last=function(){return _[_.length-1]};e;){if(y="",s=!0,_.last()&&x[_.last()]?(e=e.replace(new RegExp("(.*)<\\s*\\/\\s*"+_.last()+"[^>]*>","i"),function(e,t){return t=t.replace(g,"$1").replace(v,"$1"),n.chars&&n.chars(r(t)),""}),a("",_.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),s=!1)):m.test(e)?(c=e.match(m),c&&(e=e.replace(c[0],""),s=!1)):f.test(e)?(c=e.match(d),c&&(e=e.substring(c[0].length),c[0].replace(d,a),s=!1)):h.test(e)&&(c=e.match(u),c?(c[4]&&(e=e.substring(c[0].length),c[0].replace(u,i)),s=!1):(y+="<",e=e.substring(1))),s&&(o=e.indexOf("<"),y+=0>o?e:e.substring(0,o),e=0>o?"":e.substring(o),n.chars&&n.chars(r(y)))),e==w)throw l("badparse","The sanitizer was unable to parse the following block of html: {0}",e);w=e}a()}function r(e){if(!e)return"";var t=D.exec(e),n=t[1],i=t[3],a=t[2];return a&&(A.innerHTML=a.replace(/</g,"&lt;"),a="textContent"in A?A.textContent:A.innerText),n+a+i}function s(e){return e.replace(/&/g,"&amp;").replace(y,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(_,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c(e,n){var i=!1,a=t.bind(e,e.push);return{start:function(e,o,r){e=t.lowercase(e),!i&&x[e]&&(i=e),i||M[e]!==!0||(a("<"),a(e),t.forEach(o,function(i,o){var r=t.lowercase(o),c="img"===e&&"src"===r||"background"===r;E[r]!==!0||T[r]===!0&&!n(i,c)||(a(" "),a(o),a('="'),a(s(i)),a('"'))}),a(r?"/>":">"))},end:function(e){e=t.lowercase(e),i||M[e]!==!0||(a("</"),a(e),a(">")),e==i&&(i=!1)},chars:function(e){i||a(s(e))}}}var l=t.$$minErr("$sanitize"),u=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,d=/^<\/\s*([\w:-]+)[^>]*>/,p=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,h=/^</,f=/^<\//,g=/<!--(.*?)-->/g,m=/<!DOCTYPE([^>]*?)>/i,v=/<!\[CDATA\[(.*?)]]>/g,y=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_=/([^\#-~| |!])/g,b=a("area,br,col,hr,img,wbr"),w=a("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),$=a("rp,rt"),C=t.extend({},$,w),S=t.extend({},w,a("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),k=t.extend({},$,a("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),x=a("script,style"),M=t.extend({},b,S,k,C),T=a("background,cite,href,longdesc,src,usemap"),E=t.extend({},T,a("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width")),A=document.createElement("pre"),D=/^(\s*)([\s\S]*?)(\s*)$/;t.module("ngSanitize",[]).provider("$sanitize",n),t.module("ngSanitize").filter("linky",["$sanitize",function(e){var n=/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,a=/^mailto:/;return function(o,r){function s(e){e&&h.push(i(e))}function c(e,n){h.push("<a "),t.isDefined(r)&&(h.push('target="'),h.push(r),h.push('" ')),h.push('href="'),h.push(e),h.push('">'),s(n),h.push("</a>")}if(!o)return o;for(var l,u,d,p=o,h=[];l=p.match(n);)u=l[0],l[2]==l[3]&&(u="mailto:
}}),n}(),t.pad={}),g=f.Pkcs7={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,o=i<<24|i<<16|i<<8|i,r=[],s=0;i>s;s+=4)r.push(o);var c=a.create(r,i);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},m=(f.NoPadding={pad:function(){},unpad:function(){}},n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:g}),reset:function(){u.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=n.createEncryptor;else{var i=n.createDecryptor;this._minBufferSize=1}this._mode=i.call(n,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),v=t.format={},y=v.OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var i=a.create([1398893684,1701076831]).concat(n).concat(t);else var i=t;return i.toString(s)},parse:function(e){var t=s.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var i=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:i})}},_=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var a=e.createEncryptor(n,i),o=a.finalize(t),r=a.cfg;return m.create({ciphertext:o,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var a=e.createDecryptor(n,i).finalize(t.ciphertext);return a},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=t.kdf={},w=b.OpenSSL={execute:function(e,t,n,i){i||(i=a.random(8));var o=l.create({keySize:t+n}).compute(e,i),r=a.create(o.words.slice(t),4*n);return o.sigBytes=4*t,m.create({key:o,iv:r,salt:i})}},$=n.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:w}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var a=i.kdf.execute(n,e.keySize,e.ivSize);i.iv=a.iv;var o=_.encrypt.call(this,e,t,a.key,i);return o.mixIn(a),o},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var a=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);i.iv=a.iv;var o=_.decrypt.call(this,e,t,a.key,i);return o}})}(),function(){var e=CryptoJS,t=e.lib,n=t.BlockCipher,i=e.algo,a=[],o=[],r=[],s=[],c=[],l=[],u=[],d=[],p=[],h=[];!function(){for(var e=[],t=0;256>t;t++)e[t]=128>t?t<<1:t<<1^283;for(var n=0,i=0,t=0;256>t;t++){var f=i^i<<1^i<<2^i<<3^i<<4;f=f>>>8^255&f^99,a[n]=f,o[f]=n;var g=e[n],m=e[g],v=e[m],y=257*e[f]^16843008*f;r[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y;var y=16843009*v^65537*m^257*g^16843008*n;u[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,h[f]=y,n?(n=g^e[e[e[v^g]]],i^=e[e[i]]):n=i=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],g=i.AES=n.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,o=4*(i+1),r=this._keySchedule=[],s=0;o>s;s++)if(n>s)r[s]=t[s];else{var c=r[s-1];s%n?n>6&&s%n==4&&(c=a[c>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c]):(c=c<<8|c>>>24,c=a[c>>>24]<<24|a[c>>>16&255]<<16|a[c>>>8&255]<<8|a[255&c],c^=f[s/n|0]<<24),r[s]=r[s-n]^c}for(var l=this._invKeySchedule=[],g=0;o>g;g++){var s=o-g;if(g%4)var c=r[s];else var c=r[s-4];l[g]=4>g||4>=s?c:u[a[c>>>24]]^d[a[c>>>16&255]]^p[a[c>>>8&255]]^h[a[255&c]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,r,s,c,l,a)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,d,p,h,o);var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,a,o,r,s){for(var c=this._nRounds,l=e[t]^n[0],u=e[t+1]^n[1],d=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;c>f;f++){var g=i[l>>>24]^a[u>>>16&255]^o[d>>>8&255]^r[255&p]^n[h++],m=i[u>>>24]^a[d>>>16&255]^o[p>>>8&255]^r[255&l]^n[h++],v=i[d>>>24]^a[p>>>16&255]^o[l>>>8&255]^r[255&u]^n[h++],y=i[p>>>24]^a[l>>>16&255]^o[u>>>8&255]^r[255&d]^n[h++];l=g
var a,o=this.mtproto?Config.Schema.MTProto:Config.Schema.API,r=e._,s=!1,c=!1;for((s="%"==t.charAt(0))&&(t=t.substr(1)),a=0;a<o.constructors.length;a++)if(o.constructors[a].predicate==r){c=o.constructors[a];break}if(!c)throw new Error("No predicate "+r+" found");r==t&&(s=!0),s||this.writeInt(intToUint(c.id),n+"["+r+"][id]");var l=this;return angular.forEach(c.params,function(t){l.storeObject(e[t.name],t.type,n+"["+r+"]["+t.name+"]")}),c.type},TLDeserialization.prototype.readInt=function(e){if(this.offset>=4*this.intView.length)throw new Error("Nothing to fetch: "+e);var t=this.intView[this.offset/4];return this.debug&&console.log("<<<",t.toString(16),t,e),this.offset+=4,t},TLDeserialization.prototype.fetchInt=function(e){return this.readInt((e||"")+":int")},TLDeserialization.prototype.fetchDouble=function(e){var t=new ArrayBuffer(8),n=new Int32Array(t),i=new Float64Array(t);return n[0]=this.readInt((e||"")+":double[low]"),n[1]=this.readInt((e||"")+":double[high]"),i[0]},TLDeserialization.prototype.fetchLong=function(e){var t=this.readInt((e||"")+":long[low]"),n=this.readInt((e||"")+":long[high]"),i=bigint(n).shiftLeft(32).add(bigint(t)).toString();return i},TLDeserialization.prototype.fetchBool=function(e){var t=this.readInt((e||"")+":bool");return 2574415285==t?!0:3162085175==t?!1:(this.offset-=4,this.fetchObject("Object",e))},TLDeserialization.prototype.fetchString=function(e){var t=this.byteView[this.offset++];if(254==t)var t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16;for(var n="",i=0;t>i;i++)n+=String.fromCharCode(this.byteView[this.offset++]);for(;this.offset%4;)this.offset++;try{var a=decodeURIComponent(escape(n))}catch(o){var a=n}return this.debug&&console.log("<<<",a,(e||"")+":string"),a},TLDeserialization.prototype.fetchBytes=function(e){var t=this.byteView[this.offset++];if(254==t)var t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16;for(var n=[],i=0;t>i;i++)n.push(this.byteView[this.offset++]);for(;this.offset%4;)this.offset++;return this.debug&&console.log("<<<",bytesToHex(n),(e||"")+":bytes"),n},TLDeserialization.prototype.fetchIntBytes=function(e,t){if(e%32)throw new Error("Invalid bits: "+e);for(var n=e/8,i=[],a=0;n>a;a++)i.push(this.byteView[this.offset++]);return this.debug&&console.log("<<<",bytesToHex(i),(t||"")+":int"+e),i},TLDeserialization.prototype.fetchRawBytes=function(e,t){e===!1&&(e=this.readInt((t||"")+"_length"));for(var n=[],i=0;e>i;i++)n.push(this.byteView[this.offset++]);return this.debug&&console.log("<<<",bytesToHex(n),t||""),n},TLDeserialization.prototype.fetchObject=function(e,t){switch(e){case"int":return this.fetchInt(t);case"long":return this.fetchLong(t);case"int128":return this.fetchIntBytes(128,t);case"int256":return this.fetchIntBytes(256,t);case"int512":return this.fetchIntBytes(512,t);case"string":return this.fetchString(t);case"bytes":return this.fetchBytes(t);case"double":return this.fetchDouble(t);case"Bool":return this.fetchBool(t)}if(t=t||e||"Object","Vector"==e.substr(0,6)||"vector"==e.substr(0,6)){if("V"==e.charAt(0)){var n=this.readInt(t+"[id]");if(481674261!=n)throw new Error("Invalid vector constructor "+n)}var i=this.readInt(t+"[count]"),a=[];if(i>0)for(var o=e.substr(7,e.length-8),r=0;i>r;r++)a.push(this.fetchObject(o,t+"["+r+"]"));return a}var s=this.mtproto?Config.Schema.MTProto:Config.Schema.API,c=!1,l=!1;if("%"==e.charAt(0)){var u=e.substr(1);for(r=0;r<s.constructors.length;r++)if(s.constructors[r].type==u){l=s.constructors[r];break}if(!l)throw new Error("Constructor not found for type: "+e)}else if(e.charAt(0)>=97&&e.charAt(0)<=122){for(r=0;r<s.constructors.length;r++)if(s.constructors[r].predicate==e){l=s.constructors[r];break}if(!l)throw new Error("Constructor not found for predicate: "+e)}else{var n=this.readInt(t+"[id]"),d=uintToInt(n);if(812830625==d){var p=this.fetchBytes(t+"[packed_string]"),h=gzipUncompress(p),f=bytesToArrayBuffer(h),g=new TLDeserialization(f);return g.fetchObject(e,t)}for(r=0;r<s.constructors.length;r++)if(s.constructors[r].id==d){l=s.cons
return a.sha1Hash(e.slice(0,u)).then(function(e){if(!bytesCmp(o,e.slice(-16)))throw new Error("server msgKey mismatch");var n=bytesToArrayBuffer(l),i={mtproto:!0,override:{mt_message:function(e,t){e.msg_id=this.fetchLong(t+"[msg_id]"),e.seqno=this.fetchInt(t+"[seqno]"),e.bytes=this.fetchInt(t+"[bytes]");var n=this.getOffset();try{e.body=this.fetchObject("Object",t+"[body]")}catch(i){console.error(dT(),"parse error",i.message,i.stack),e.body={_:"parse_error",error:i}}this.offset!=n+e.bytes&&(console.warn(dT(),"set offset",this.offset,n,e.bytes),console.log(dT(),e),this.offset=n+e.bytes)},mt_rpc_result:function(e,n){e.req_msg_id=this.fetchLong(n+"[req_msg_id]");var i=t.sentMessages[e.req_msg_id],a=i&&i.resultType||"Object";e.result=this.fetchObject(a,n+"[result]")}}},a=new TLDeserialization(n,i),u=a.fetchObject("","INPUT");return{response:u,messageID:s,sessionID:r,seqNo:c}})})},u.prototype.applyServerSalt=function(e){var t=longToBytes(e),n={};return n["dc"+this.dcID+"_server_salt"]=bytesToHex(t),i.set(n),this.serverSalt=t,!0},u.prototype.sheduleRequest=function(e){this.offline&&this.checkConnection("forced shedule");var t=tsNow()+e;return e&&this.nextReq&&this.nextReq<=t?!1:(s.cancel(this.nextReqPromise),this.nextReqPromise=s(this.performSheduledRequest.bind(this),e||0),void(this.nextReq=t))},u.prototype.onSessionCreate=function(){},u.prototype.ackMessage=function(e){this.pendingAcks.push(e),this.sheduleRequest(3e4)},u.prototype.reqResendMessage=function(e){console.log(dT(),"Req resend",e),this.pendingResends.push(e),this.sheduleRequest(100)},u.prototype.cleanupSent=function(){var e=this,t=!1;return angular.forEach(this.sentMessages,function(n,i){if(n.notContentRelated&&void 0===e.pendingMessages[i])delete e.sentMessages[i];else if(n.container){for(var a=0;a<n.inner.length;a++)if(void 0!==e.sentMessages[n.inner[a]])return void(t=!0);delete e.sentMessages[i]}else t=!0}),!t},u.prototype.processMessageAck=function(e){var t=this.sentMessages[e];return t&&!t.acked?(delete t.body,t.acked=!0,!0):!1},u.prototype.processError=function(e){var t=(e.error_message||"").match(/^([A-Z_0-9]+\b)(: (.+))?/)||[];return e.error_code=uintToInt(e.error_code),{code:!e.error_code||e.error_code<=0?500:e.error_code,type:t[1]||"UNKNOWN",description:t[3]||"CODE#"+e.error_code+" "+e.error_message,originalError:e}},u.prototype.processMessage=function(e,n,i){switch(e._){case"msg_container":for(var a=e.messages.length,o=0;a>o;o++)this.processMessage(e.messages[o],n,i);break;case"bad_server_salt":console.log(dT(),"Bad server salt",e);var r=this.sentMessages[e.bad_msg_id];if(!r||r.seq_no!=e.bad_msg_seqno)throw console.log(e.bad_msg_id,e.bad_msg_seqno),new Error("Bad server salt for invalid message");this.applyServerSalt(e.new_server_salt),this.pushResend(e.bad_msg_id),this.ackMessage(n);break;case"bad_msg_notification":console.log(dT(),"Bad msg notification",e);var r=this.sentMessages[e.bad_msg_id];if(!r||r.seq_no!=e.bad_msg_seqno)throw console.log(e.bad_msg_id,e.bad_msg_seqno),new Error("Bad msg notification for invalid message");if(16==e.error_code||17==e.error_code){t.applyServerTime(bigStringInt(n).shiftRight(32).toString(10))&&(console.log(dT(),"Update session"),this.updateSession());var s=this.updateSentMessage(e.bad_msg_id);this.pushResend(s.msg_id),this.ackMessage(n)}break;case"message":this.serverMessages.push(e.msg_id),this.processMessage(e.body,e.msg_id,i);break;case"new_session_created":this.ackMessage(n),this.processMessageAck(e.first_msg_id),this.applyServerSalt(e.server_salt),this.onSessionCreate(i,n);break;case"msgs_ack":for(var o=0;o<e.msg_ids.length;o++)this.processMessageAck(e.msg_ids[o]);break;case"msg_detailed_info":if(!this.sentMessages[e.msg_id]){this.ackMessage(e.answer_msg_id);break}case"msg_new_detailed_info":this.reqResendMessage(e.answer_msg_id);break;case"msgs_state_info":if(this.ackMessage(e.answer_msg_id),this.lastResendReq&&this.lastResendReq.req_msg_id==e.req_msg_id&&this.pendingResends.length){var o,c,l;for(o=0;o<this.lastResendReq.resend_msg_ids.length;o++)c=this.lastResendReq.resend_msg_ids[o],l=this.pendingResends.inde
}),c.progress.cancel=function(){e||(o.resolve(),s.cancel(),N(d))},s["finally"](function(){o.resolve()})}),Z=o.promise},E([m]),f.pending.unshift(l),t.$broadcast("history_append",{peerID:n,messageID:l,my:!0}),m.send()}),K[d]=[n,l]}function I(e,n){var i=Q--,o=[nextRandomInt(4294967295),nextRandomInt(4294967295)],r=bigint(o[0]).shiftLeft(32).add(bigint(o[1])).toString(),l=W[e],u=s.getInputPeerByID(e);void 0===l&&(l=W[e]={count:null,history:[],pending:[]}),p.getUserID().then(function(d){var h;switch(n._){case"inputMediaContact":h=angular.extend({},n,{_:"messageMediaContact"});break;case"inputMediaPhoto":h={photo:c.getPhoto(n.id.id)}}var f={_:"message",id:i,from_id:d,to_id:s.getOutputPeer(e),out:!0,unread:!0,date:tsNow(!0)+it,message:"",media:h,random_id:r,pending:!0},g=function(e){var n=V[i];e?(f.error=!0,n&&(n.error=!0)):(delete f.error,n&&delete n.error),t.$broadcast("messages_pending")};f.send=function(){p.invokeApi("messages.sendMedia",{peer:u,media:n,random_id:o}).then(function(e){f.date=e.message.date,f.id=e.message.id,f.media=e.message.media,a.processUpdateMessage({_:"updates",users:e.users,chats:e.chats,seq:e.seq,updates:[{_:"updateMessageID",random_id:r,id:e.message.id},{_:"updateNewMessage",message:f,pts:e.pts}]})},function(){g(!0)})},E([f]),l.pending.unshift(i),t.$broadcast("history_append",{peerID:e,messageID:i,my:!0}),f.send()}),K[r]=[e,i]}function P(e,t){return t=t.sort(),p.invokeApi("messages.forwardMessages",{peer:s.getInputPeerByID(e),id:t}).then(function(e){var t=[];angular.forEach(e.messages,function(n){t.push({_:"updateNewMessage",message:n,pts:e.pts})}),a.processUpdateMessage({_:"updates",users:e.users,chats:e.chats,seq:e.seq,updates:t})})}function N(e){var t=K[e];if(console.log("pending",e,t),t){var n,i=t[0],o=t[1],r=W[i];for(a.processUpdateMessage({_:"updateShort",update:{_:"updateDeleteMessages",messages:[o]}}),n=0;n<r.pending.length;n++)if(r.pending[n]==o){r.pending.splice(n,1);break}return delete V[o],delete j[o],!0}return!1}function L(e,n){var i=K[e];if(i){var a,o=i[0],r=i[1],s=W[o],c=!1,l=!1;for(a=0;a<s.pending.length;a++)if(s.pending[a]==r){s.pending.splice(a,1);break}return(c=j[r])&&(delete c.pending,delete c.error,delete c.random_id,delete c.send),(l=V[r])&&(V[n.id]=angular.extend(l,O(n.id)),delete l.pending,delete l.error,delete l.random_id,delete l.send,t.$broadcast("messages_pending")),delete V[r],delete j[r],c}return!1}function F(e){var t=e.to_id&&s.getPeerID(e.to_id)||0;return 0>t?t:e.out?t:e.from_id}function B(e,t){var n=-1!=t;if(n&&void 0!==z[e])return z[e];var i=angular.copy(j[e])||{id:e};return i.fromUser=o.getUser(i.from_id),(i.chatID=i.to_id.chat_id)?(i.peerID=-i.chatID,i.peerData=r.getChat(i.chatID),i.peerString=r.getChatString(i.chatID)):(i.peerID=i.out?i.to_id.user_id:i.from_id,i.peerData=o.getUser(i.peerID),i.peerString=o.getUserString(i.peerID)),i.peerPhoto=s.getPeerPhoto(i.peerID,"User","Group"),i.unreadCount=t,"messageService"==i._&&i.action.user_id&&(i.action.user=o.getUser(i.action.user_id)),i.message&&i.message.length&&(i.richMessage=f.wrapRichText(i.message.substr(0,64),{noLinks:!0,noLinebreaks:!0})),i.dateText=st(i.date),n&&(z[e]=i),i}function O(e){if(void 0!==V[e])return V[e];var t=angular.copy(j[e])||{id:e};if(t.media&&void 0!==t.media.progress&&(t.media.progress=j[e].media.progress),t.media)switch(t.media._){case"messageMediaPhoto":t.media.photo=c.wrapForHistory(t.media.photo.id);break;case"messageMediaVideo":t.media.video=l.wrapForHistory(t.media.video.id);break;case"messageMediaDocument":t.media.document=u.wrapForHistory(t.media.document.id);break;case"messageMediaAudio":t.media.audio=d.wrapForHistory(t.media.audio.id);break;case"messageMediaContact":t.media.rFullName=f.wrapRichText(t.media.first_name+" "+(t.media.last_name||""),{noLinks:!0,noLinebreaks:!0})}else if(t.action)switch(t.action._){case"messageActionChatEditPhoto":t.action.photo=c.wrapForHistory(t.action.photo.id);break;case"messageActionChatCreate":case"messageActionChatEditTitle":t.action.rTitle=f.wrapRichText(t.action.title,{noLinks:!0,noLinebreaks:!0})||"DELETED"}return t.message&&t.message.length&&(t
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 o(){e.get("last_version").then(function(t){t!=Config.App.version&&(t&&r(t),e.set({last_version:Config.App.version}))})}function r(e){var n=t.$new();n.lastVersion=e,n.canShowVersion=function(t){return n.lastVersion===!1||void 0===n.lastVersion?!0:a(t,e)>=0},i.open({templateUrl:"partials/changelog_modal.html",scope:n,windowClass:"changelog_modal_window page_modal"})}return{checkUpdate:o,showChangelog:r}}]),angular.module("myApp.controllers",[]).controller("AppWelcomeController",["$scope","$location","MtpApiManager","ErrorService","ChangelogNotifyService",function(e,t,n,i,a){n.getUserID().then(function(n){n?t.url("/im"):e.showWelcome=!0}),a.checkUpdate()}]).controller("AppLoginController",["$scope","$location","$timeout","$modal","$modalStack","MtpApiManager","ErrorService","ChangelogNotifyService",function(e,t,n,i,a,o,r,s){function c(){var t=(navigator.language||"").toLowerCase(),n=Config.LangCountries[t],i=!Config.Navigator.mobile;if(l(-1==["en","en-us","en-uk"].indexOf(t)?void 0!==n?n:t.indexOf("-")>0?t.split("-")[1].toUpperCase():"US":"US"),i){var a=e.credentials.phone_country;o.invokeApi("help.getNearestDc",{},{dcID:4,createNetworker:!0}).then(function(t){a==e.credentials.phone_country&&l(t.country),t.nearest_dc!=t.this_dc&&o.getNetworker(t.nearest_dc,{createNetworker:!0})})}}function l(e){var t,n;for(t=0;t<Config.CountryCodes.length;t++)if(n=Config.CountryCodes[t],n[0]==e)return u({name:n[1],code:n[2]});return u({name:"United States",code:"+1"})}function u(t){g=t,e.credentials.phone_country!=t.code?e.credentials.phone_country=t.code:d(),e.$broadcast("country_selected")}function d(){var t,n,i,a=((e.credentials.phone_country||"")+(e.credentials.phone_number||"")).replace(/\D+/g,""),o=0,r=!1;if(a.length)if(g&&!a.indexOf(g.code.replace(/\D+/g,"")))r=g.name;else for(t=0;t<Config.CountryCodes.length;t++)for(n=2;n<Config.CountryCodes[t].length;n++)i=Config.CountryCodes[t][n].replace(/\D+/g,""),i.length>o&&!a.indexOf(i)&&(o=i.length,r=Config.CountryCodes[t][1]);e.credentials.phone_full=a,e.credentials.phone_country_name=r||"Unknown"}function p(e){o.setUserAuth(f.dcID,{expires:e.expires,id:e.user.id}),n.cancel(m),t.url("/im")}function h(){n.cancel(m),e.credentials.viaApp||(--e.callPending.remaining?m=n(h,1e3):(e.callPending.success=!1,o.invokeApi("auth.sendCall",{phone_number:e.credentials.phone_full,phone_code_hash:e.credentials.phone_code_hash},f).then(function(){e.callPending.success=!0})))}a.dismissAll(),o.getUserID().then(function(e){return e?void t.url("/im"):void 0});var f={dcID:2,createNetworker:!0},g=!1;e.credentials={phone_country:"",phone_country_name:"",phone_number:"",phone_full:""},e.progress={},e.callPending={},e.chooseCountry=function(){var e="partials/country_select_modal.html",t="countries_modal_window page_modal";Config.Navigator.mobile&&(e="partials/mobile/country_select_modal.html",t+=" mobile_modal");var n=i.open({templateUrl:e,controller:"CountrySelectModalController",windowClass:t});n.result.then(u)},e.$watch("credentials.phone_country",d),e.$watch("credentials.phone_number",d),c();var m;e.sendCode=function(){n.cancel(m),r.confirm({type:"LOGIN_PHONE_CORRECT",country_code:e.credentials.phone_country,phone_number:e.credentials.phone_number}).then(function(){e.progress.enabled=!0,o.invokeApi("auth.sendCode",{phone_number:e.credentials.phone_full,sms_type:5,api_id:Config.App.id,api_hash:Config.App.hash},f).then(function(t){e.progress.enabled=!1,e.credentials.phone_code_hash=t.phone_code_hash,e.credentials.phone_occupied=t.phone_registered,e.credentials.viaApp="auth.sentAppCode"==t._,e.callPending.remaining=t.send_call_timeout||60,e.error={},h()},function(t){switch(e.progress.enabled=!1,console.log("sendCode error",t),t.type){case"NETWORK_BAD_REQUEST":"https:"==location.protocol&&(r.confirm({type:"HTTPS_MIXED_FAIL"}).then(function(){location=location.toString().replace(/^https:/,"http:")}),t.handled=!0);break;case"PHONE_NUMBER_INVALID":e.error={field:"phone"},t.handled=!0}})})},e.sendSms=function(){e.cr
}),t.notify={},t.send={},t.$watch("photo.file",f),t.deletePhoto=function(){t.photo.updating=!0,s.invokeApi("photos.updateProfilePhoto",{id:{_:"inputPhotoEmpty"},crop:{_:"inputPhotoCropAuto"}}).then(function(e){s.getUserID().then(function(n){d.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:"partials/profile_edit_modal.html",controller:"ProfileEditModalController",windowClass:"profile_edit_modal_window page_modal"})},t.terminateSessions=function(){h.confirm({type:"TERMINATE_SESSIONS"}).then(function(){s.invokeApi("auth.resetAuthorizations",{})})},c.get("notify_nodesktop","notify_nosound","send_ctrlenter","notify_volume","notify_novibrate").then(function(i){t.notify.desktop=!i[0],t.send.enter=i[2]?"":"1",t.notify.volume=i[1]?0:i[3]!==!1?i[3]>0&&Math.ceil(10*i[3])||0:5,t.notify.canVibrate=l.getVibrateSupport(),t.notify.vibrate=!i[4],t.notify.volumeOf4=function(){return 1+Math.ceil((t.notify.volume-1)/3.3)},t.toggleSound=function(){t.notify.volume=t.notify.volume?0:5};var a;t.$watch("notify.volume",function(e,t){if(e!==t){var i=e/10;c.set({notify_volume:i}),c.remove("notify_nosound"),l.clear(),a&&n.cancel(a),a=n(function(){l.testSound(i)},500)}}),t.toggleDesktop=function(){t.notify.desktop=!t.notify.desktop,t.notify.desktop?c.remove("notify_nodesktop"):c.set({notify_nodesktop:!0})},t.toggleVibrate=function(){t.notify.vibrate=!t.notify.vibrate,t.notify.vibrate?c.remove("notify_novibrate"):c.set({notify_novibrate:!0})},t.toggleCtrlEnter=function(n){t.send.enter=n,t.send.enter?c.remove("send_ctrlenter"):c.set({send_ctrlenter:!0}),e.$broadcast("settings_changed")}}),t.openChangelog=function(){p.showChangelog(!1)}}]).controller("ProfileEditModalController",["$rootScope","$scope","$timeout","$modal","$modalInstance","AppUsersManager","AppChatsManager","MtpApiManager","Storage","NotificationsManager","MtpApiFileManager","ApiUpdatesManager",function(e,t,n,i,a,o,r,s){t.profile={},t.error={},s.getUserID().then(function(e){t.profile=o.getUser(e)}),t.updateProfile=function(){t.profile.updating=!0,s.invokeApi("account.updateProfile",{first_name:t.profile.first_name||"",last_name:t.profile.last_name||""}).then(function(e){t.error={},o.saveApiUser(e),a.close()},function(e){switch(e.type){case"FIRSTNAME_INVALID":t.error={field:"first_name"},e.handled=!0;break;case"LASTNAME_INVALID":t.error={field:"last_name"},e.handled=!0;break;case"NAME_NOT_MODIFIED":e.handled=!0,a.close()}})["finally"](function(){delete t.profile.updating})}}]).controller("ContactsModalController",["$scope","$modal","$modalInstance","AppUsersManager","ErrorService",function(e,t,n,i){function a(){e.selectedContacts={},e.selectedCount=0}function o(t){i.getContacts(t).then(function(n){e.contacts=[],e.slice.limit=20,angular.forEach(n,function(t){var n={userID:t,user:i.getUser(t),userPhoto:i.getUserPhoto(t,"User")};e.contacts.push(n)}),e.contactsEmpty=t?!1:!e.contacts.length,e.$broadcast("contacts_change")})}if(e.contacts=[],e.search={},e.slice={limit:20,limitDelta:20},a(),e.disabledContacts={},e.disabled)for(var r=0;r<e.disabled.length;r++)e.disabledContacts[e.disabled[r]]=!0;if(e.selected)for(var r=0;r<e.selected.length;r++)e.selectedContacts[e.selected[r]]||(e.selectedContacts[e.selected[r]]=!0,e.selectedCount++);e.$watch("search.query",o),e.toggleEdit=function(t){e.action=t?"edit":"",e.multiSelect=t,a()},e.contactSelect=function(t){return e.disabledContacts[t]?!1:e.multiSelect?void(e.selectedContacts[t]?(delete e.selectedContacts[t],e.selectedCount--):(e.selectedContacts[t]=!0,e.selectedCount++)):n.close(t)},e.submitSelected=function(){if(e.selectedCount>0){var t=[];return angular.forEach(e.selectedContacts,function(e,n){t.push(n)}),n.close(t)}},e.deleteSelected=function(){if(e.selectedCount>0){var t=[];angular.forEach(e.selectedContacts,function(e,n){t.push(n)}),i.deleteContacts(t).then(function(){a(),o(e.search.query)})}},e.importContact=function(){i.openImportContact().then(f
}]),angular.module("myApp.directives",["myApp.filters"]).directive("myHead",function(){return{restrict:"AE",templateUrl:"partials/head.html"}}).directive("myDialog",function(){return{restrict:"AE",templateUrl:"partials/dialog.html"}}).directive("myMessage",["$filter",function(e){function t(e,t){var u,d,p=!1,h=!1,f=!1,g=!1,m=!1,v=!1,y=!1,_=function(){p!=(e.selectedMsgs[e.historyMessage.id]||!1)&&(p=!p,t.toggleClass(o,p))},b=function(){h!=e.historyMessage.grouped&&(h&&t.removeClass(h),h=e.historyMessage.grouped,h&&t.addClass(h)),v!=(e.historyMessage.needDate||!1)&&(v=!v,v?u?u.show():(u=$(i),$(u[0].firstChild).text(n(e.historyMessage.date)),d?u.insertBefore(d):u.prependTo(t)):u.hide())};if(_(),b(),e.$on("messages_select",_),e.$on("messages_regroup",b),e.$on("messages_focus",function(n,i){i==e.historyMessage.id!=f&&(f=!f,t.toggleClass(r,f))}),e.historyMessage.unread){var w;if(!e.historyMessage.out){var C=function(){y!=(e.historyUnreadAfter==e.historyMessage.id)&&(y=!y,y?d?d.show():d=$(a).prependTo(t):(d.hide(),w&&w()))};C(),w=e.$on("messages_unread_after",C)}t.addClass(s);var S=e.$on("messages_read",function(){e.historyMessage.unread||(t.removeClass(s),S(),w&&!y&&w())})}if(e.historyMessage.error||e.historyMessage.pending){var k=function(){m!=(e.historyMessage.pending||!1)&&(m=!m,t.toggleClass(l,m)),g!=(e.historyMessage.error||!1)&&(g=!g,t.toggleClass(c,g)),g||m||x()},x=e.$on("messages_pending",k);k()}}var n=e("myDate"),i='<div class="im_message_date_split im_service_message_wrap"><div class="im_service_message"></div></div>',a='<div class="im_message_unread_split">Unread messages</div>',o="im_message_selected",r="im_message_focus",s="im_message_unread",c="im_message_error",l="im_message_pending";return{link:t,templateUrl:"partials/message.html"}}]).directive("myServiceMessage",function(){return{templateUrl:"partials/message_service.html"}}).directive("myMessagePhoto",function(){return{templateUrl:"partials/message_attach_photo.html"}}).directive("myMessageVideo",function(){return{templateUrl:"partials/message_attach_video.html"}}).directive("myMessageDocument",function(){return{templateUrl:"partials/message_attach_document.html"}}).directive("myMessageAudio",function(){return{templateUrl:"partials/message_attach_audio.html"}}).directive("myMessageMap",function(){return{templateUrl:"partials/message_attach_map.html"}}).directive("myMessageContact",function(){return{templateUrl:"partials/message_attach_contact.html"}}).directive("myMessagePending",function(){return{templateUrl:"partials/message_attach_pending.html"}}).directive("myDialogs",["$modalStack","$transition","$window","$timeout",function(e,t,n,i){function a(t,a,o){function r(t){if(!p&&e.getTop())return!0;if(36==t.keyCode&&!t.shiftKey&&!t.ctrlKey&&t.altKey){var n=$(c).find(".im_dialog_wrap a");return n.length&&(n.trigger("mousedown"),c.scrollTop=0,$(s).nanoScroller({flash:!0})),cancelEvent(t)}if(27==t.keyCode||9==t.keyCode&&t.shiftKey&&!t.ctrlKey&&!t.metaKey)return p||(l.focus(),l.value&&l.select()),cancelEvent(t);if(p&&13==t.keyCode){var n=$(c).find(".im_dialog_selected")[0]||$(c).find(".im_dialog_wrap a")[0];return n&&$(n).trigger("mousedown"),cancelEvent(t)}if(38==t.keyCode||40==t.keyCode){var i=!t.shiftKey&&t.altKey;if(!i&&(!p||t.metaKey))return!0;var a,o=40==t.keyCode,n=!i&&$(c).find(".im_dialog_selected")[0]||$(c).find(".active a.im_dialog")[0],r=n&&n.parentNode;if(r){var a=n[o?"nextSibling":"previousSibling"];if(!a||!a.className||-1==a.className.indexOf("im_dialog_wrap")){var u=$(c).find(".im_dialog_wrap"),d=u.index(n.parentNode),h=d+(o?1:-1);a=u[h]}}else{var u=$(c).find(".im_dialog_wrap");a=o?u[0]:u[u.length-1]}if(i?a&&$(a).find("a").trigger("mousedown"):(r&&a&&$(r).find("a").removeClass("im_dialog_selected"),a&&$(a).find("a").addClass("im_dialog_selected")),a){var f=a.offsetTop,g=a.offsetHeight,m=c.scrollTop,v=c.clientHeight;m>f?(c.scrollTop=f,$(s).nanoScroller({flash:!0})):f+g-v>m&&(c.scrollTop=f+g-v,$(s).nanoScroller({flash:!0}))}return cancelEvent(t)}}var s=$(".im_dialogs_wrap",a)[0],c=$(".im_dialogs_scrollable_wrap",a)[0],l=$(".im_dialogs_search_field",a
//# sourceMappingURL=js/app.js.map