diff --git a/js/app.js b/js/app.js index 335f6888..f538ed79 100644 --- a/js/app.js +++ b/js/app.js @@ -2,7 +2,7 @@ function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):n return!1}function cancelEvent(e){return e=e||window.event,e&&(e=e.originalEvent||e,e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.cancelBubble=!0),!1}function hasOnclick(e){if(e.onclick||e.getAttribute("ng-click"))return!0;var t=$._data(e,"events");return!(!t||!t.click&&!t.mousedown)}function getScrollWidth(){var e=$("
").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){if(13==e.keyCode&&(e.ctrlKey||e.metaKey))return t(),cancelEvent(e)})}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(),r=0;try{a.moveToElementText(e)}catch(o){return 0}return n.text=i+t,r=a.text.indexOf(t),n.moveStart("character",-1),n.text="",r}function getRichValue(e){if(!e)return"";var t=[],n=[];getRichElementValue(e,t,n),n.length&&t.push(n.join(""));var i=t.join("\n");return i=i.replace(/\u00A0/g," ")}function getRichValueWithCaret(e){if(!e)return[];var t,n,i=[],a=[],r=!!window.getSelection&&window.getSelection();if(r&&r.rangeCount){var o=r.getRangeAt(0);o.startContainer&&o.startContainer==o.endContainer&&o.startOffset==o.endOffset&&(t=o.startContainer,n=o.startOffset)}getRichElementValue(e,i,a,t,n),a.length&&i.push(a.join(""));var s=i.join("\n"),l=s.indexOf("");return l!=-1&&(s=s.substr(0,l)+s.substr(l+1)),s=s.replace(/\u00A0/g," "),[s,l]}function getRichElementValue(e,t,n,i,a){if(3!=e.nodeType){if(1==e.nodeType){var r,o=i===e,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),o&&!a&&n.push("");for(var r=e.firstChild;r;)getRichElementValue(r,t,n,i,a),r=r.nextSibling;o&&a&&n.push(""),s&&n.length&&(t.push(n.join("")),n.splice(0,n.length))}}else if(i===e){var l=e.nodeValue;n.push(l.substr(0,a)+""+l.substr(a))}else n.push(e.nodeValue)}function setRichFocus(e,t,n){if(e.focus(),!t||t.parentNode!=e||t.nextSibling||n||(e.removeChild(t),t=null),window.getSelection&&document.createRange){var i=document.createRange();t?i.selectNode(t):i.selectNodeContents(e),n||i.collapse(!1);var a=window.getSelection();a.removeAllRanges(),a.addRange(i)}else if(void 0!==document.body.createTextRange){var r=document.body.createTextRange();r.moveToElementText(t||e),n||r.collapse(!1),r.select()}}function getSelectedText(){var e=(window.getSelection&&window.getSelection()||document.getSelection&&document.getSelection()||document.selection&&document.selection.createRange().text||"").toString().replace(/^\s+|\s+$/g,"");return e}function scrollToNode(e,t,n){var i=t.offsetTop-15,a=t.offsetHeight+30,r=e.scrollTop,o=e.clientHeight;r>i?(e.scrollTop=i,$(n).nanoScroller({flash:!0})):r/g,">")}function calcImageInBox(e,t,n,i,a){var r=n,o=i;return e/t>n/i?o=parseInt(t*n/e):(r=parseInt(e*i/t),r>n&&(o=parseInt(o*n/r),r=n)),a&&r>=e&&o>=t&&(r=e,o=t),{w:r,h:o}}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;nt[n]?1:-1;return 0}function bigint(e){return new BigInteger(e.toString(16),16)}function bigStringInt(e){return new BigInteger(e,10)}function dHexDump(e){for(var t=[],n=0;n>>t&24),2!==t&&i-r!==1||(n+=String.fromCharCode(uint6ToBase64(a>>>18&63),uint6ToBase64(a>>>12&63),uint6ToBase64(a>>>6&63),uint6ToBase64(63&a)),a=0);return n.replace(/A(?=A$|$)/g,"=")}function uint6ToBase64(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65}function base64ToBlob(e,t){for(var n=1024,i=atob(e),a=i.length,r=Math.ceil(a/n),o=new Array(r),s=0;s>>2]|=e[t]<<24-t%4*8;return new CryptoJS.lib.WordArray.init(i,n)}function bytesFromWords(e){for(var t=e.words,n=e.sigBytes,i=[],a=0;a>>2]>>>24-a%4*8&255);return i}function bytesFromBigInt(e,t){var n=e.toByteArray();if(t&&n.lengtht);)n=n.slice(1);return n}function bytesFromLeemonBigInt(e,t){var n=bigInt2str(e,16);return bytesFromHex(n)}function bytesToArrayBuffer(e){return new Uint8Array(e).buffer}function convertToArrayBuffer(e){return e instanceof ArrayBuffer?e:void 0!==e.buffer&&e.buffer.byteLength==e.length*e.BYTES_PER_ELEMENT?e.buffer:bytesToArrayBuffer(e)}function convertToUint8Array(e){return void 0!==e.buffer?e:new Uint8Array(e)}function convertToByteArray(e){if(Array.isArray(e))return e;e=convertToUint8Array(e);for(var t=[],n=0,i=e.length;n2147483647&&(e-=4294967296),e}function sha1HashSync(e){this.rushaInstance=this.rushaInstance||new Rusha(1048576);var t=rushaInstance.rawDigest(e).buffer;return t}function sha1BytesSync(e){return bytesFromArrayBuffer(sha1HashSync(e))}function sha256HashSync(e){var t=CryptoJS.SHA256(bytesToWords(e)),n=bytesFromWords(t);return n}function rsaEncrypt(e,t){t=addPadding(t,255);var n=new BigInteger(e.modulus,16),i=new BigInteger(e.exponent,16),a=new BigInteger(t),r=a.modPowInt(i,n),o=bytesFromBigInt(r,256);return o}function addPadding(e,t,n){t=t||16;var i=e.byteLength||e.length,a=t-i%t;if(a>0&&a0&&(u=u.subtract(e))),c=c.add(c),c.compareTo(e)>0&&(c=c.subtract(e)),d=d.shiftRight(1);r=u.clone();var p=r.compareTo(o)<0?o.subtract(r):r.subtract(o);if(t=p.gcd(e),!t.equals(BigInteger.ONE))break;0==(l&l-1)&&(o=r.clone())}if(t.compareTo(BigInteger.ONE)>0)break}var f,m,h=e.divide(t);return t.compareTo(h)>0?(f=h,m=t):(f=t,m=h),[bytesFromBigInt(f),bytesFromBigInt(m),n]}function gcdLong(e,t){for(;e.notEquals(goog.math.Long.ZERO)&&t.notEquals(goog.math.Long.ZERO);){for(;t.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)t=t.shiftRight(1);for(;e.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)e=e.shiftRight(1);e.compare(t)>0?e=e.subtract(t):t=t.subtract(e)}return t.equals(goog.math.Long.ZERO)?e:t}function pqPrimeLong(e){for(var t,n=0,i=0;i<3;i++){for(var a=goog.math.Long.fromInt((15&nextRandomInt(128))+17),r=goog.math.Long.fromInt(nextRandomInt(1e9)+1),o=r,s=1<0&&(u=u.subtract(e))),c=c.add(c),c.compare(e)>0&&(c=c.subtract(e)),d=d.shiftRight(1);r=u;var p=r.compare(o)<0?o.subtract(r):r.subtract(o);if(t=gcdLong(p,e),t.notEquals(goog.math.Long.ONE))break;0==(l&l-1)&&(o=r)}if(t.compare(goog.math.Long.ONE)>0)break}var f,m,h=e.div(t);return t.compare(h)>0?(f=h,m=t):(f=t,m=h),[bytesFromHex(f.toString(16)),bytesFromHex(m.toString(16)),n]}function pqPrimeLeemon(e){var t,n,i,a,r,o,s,l=64,c=Math.ceil(l/bpe)+1,d=0,u=new Array(c),p=new Array(c),f=new Array(c),r=new Array(c),m=new Array(c),h=new Array(c),g=new Array(c);for(t=0;t<3;t++){for(n=(15&nextRandomInt(128))+17,copyInt_(h,nextRandomInt(1e9)+1),copy_(g,h),a=1<
').appendTo(document.body);var i=$("
").appendTo(this.autoCompleteWrapEl);t.dropdownDirective(i,function(e,t){n.autoCompleteEl=t,n.autoCompleteScope=e,n.setUpAutoComplete()}),this.isActive=!1,this.onTyping=t.onTyping,this.onMessageSubmit=t.onMessageSubmit,this.onDirectionKey=t.onDirectionKey,this.getSendOnEnter=t.getSendOnEnter,this.onFilePaste=t.onFilePaste,this.onCommandSend=t.onCommandSend,this.onInlineResultSend=t.onInlineResultSend,this.mentions=t.mentions,this.commands=t.commands,this.renderToggleCnt=0}function Scroller(e,t){t=t||{};t.classPrefix||"scroller";this.content=$(e),this.useNano=void 0!==t.nano?t.nano:!Config.Mobile,this.maxHeight=t.maxHeight,this.minHeight=t.minHeight,this.useNano?this.setUpNano():this.setUpNative(),this.updateHeight()}!function(e){"use strict";e.console=e.console||{};for(var t,n,i=e.console,a={},r=function(){},o="memory".split(","),s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=o.pop();)i[t]||(i[t]=a);for(;n=s.pop();)i[n]||(i[n]=r)}("undefined"==typeof window?this:window),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),a=i.length>>>0;if(0===a)return-1;var r=+t||0;if(Math.abs(r)===1/0&&(r=0),r>=a)return-1;for(n=Math.max(r>=0?r:a-Math.abs(r),0);n1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var n={};return e.prototype=null,n}}()),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,i=function(){},a=function(){return n.apply(this instanceof i&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,a.prototype=new i,a}),function(e){function t(t){var n=++c;return l.push([n,t]),e.postMessage(a,"*"),n}function n(e){if(e&&e>=c)for(var t=0,n=l.length;t0)){var n=l.shift()[1];n()}}var a="zero-timeout-message",r=e.setTimeout,o=e.clearTimeout,s=r(function(){},0),l=[],c=s+1e8;e.addEventListener("message",i,!0),e.setTimeout=function(e,n){return!n||n<=5?t(e):r(e,n)},e.clearTimeout=function(e){return e>=c&&n(e),o(e)},e.setZeroTimeout=t}(this),!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=ae.type(e);return"function"!==n&&!ae.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function i(e,t,n){if(ae.isFunction(t))return ae.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return ae.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pe.test(t))return ae.filter(t,e,n);t=ae.filter(t,e)}return ae.grep(e,function(e){return ae.inArray(e,t)>=0!==n})}function a(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function r(e){var t=be[e]={};return ae.each(e.match(ye)||[],function(e,n){t[n]=!0}),t}function o(){me.addEventListener?(me.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(me.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(me.addEventListener||"load"===event.type||"complete"===me.readyState)&&(o(),ae.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ae,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Se.test(n)?ae.parseJSON(n):n)}catch(a){}ae.data(e,t,n)}else n=void 0}return n}function c(e){var t;for(t in e)if(("data"!==t||!ae.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function d(e,t,n,i){if(ae.acceptData(e)){var a,r,o=ae.expando,s=e.nodeType,l=s?ae.cache:e,c=s?e[o]:e[o]&&o;if(c&&l[c]&&(i||l[c].data)||void 0!==n||"string"!=typeof t)return c||(c=s?e[o]=K.pop()||ae.guid++:o),l[c]||(l[c]=s?{}:{toJSON:ae.noop}),("object"==typeof t||"function"==typeof t)&&(i?l[c]=ae.extend(l[c],t):l[c].data=ae.extend(l[c].data,t)),r=l[c],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[ae.camelCase(t)]=n),"string"==typeof t?(a=r[t],null==a&&(a=r[ae.camelCase(t)])):a=r,a}}function u(e,t,n){if(ae.acceptData(e)){var i,a,r=e.nodeType,o=r?ae.cache:e,s=r?e[ae.expando]:ae.expando;if(o[s]){if(t&&(i=n?o[s]:o[s].data)){ae.isArray(t)?t=t.concat(ae.map(t,ae.camelCase)):t in i?t=[t]:(t=ae.camelCase(t),t=t in i?[t]:t.split(" ")),a=t.length;for(;a--;)delete i[t[a]];if(n?!c(i):!ae.isEmptyObject(i))return}(n||(delete o[s].data,c(o[s])))&&(r?ae.cleanData([e],!0):ne.deleteExpando||o!=o.window?delete o[s]:o[s]=null)}}}function p(){return!0}function f(){return!1}function m(){try{return me.activeElement}catch(e){}}function h(e){var t=Ne.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,i,a=0,r=typeof e.getElementsByTagName!==Me?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Me?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[a]);a++)!t||ae.nodeName(i,t)?r.push(i):ae.merge(r,g(i,t));return void 0===t||t&&ae.nodeName(e,t)?ae.merge([e],r):r}function _(e){Ie.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t){return ae.nodeName(e,"table")&&ae.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function y(e){return e.type=(null!==ae.find.attr(e,"type"))+"/"+e.type,e}function b(e){var t=Ge.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)ae._data(n,"globalEval",!t||ae._data(t[i],"globalEval"))}function k(e,t){if(1===t.nodeType&&ae.hasData(e)){var n,i,a,r=ae._data(e),o=ae._data(t,r),s=r.events;if(s){delete o.handle,o.events={};for(n in s)for(i=0,a=s[n].length;a>i;i++)ae.event.add(t,n,s[n][i])}o.data&&(o.data=ae.extend({},o.data))}}function M(e,t){var n,i,a;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[ae.expando]){a=ae._data(t);for(i in a.events)ae.removeEvent(t,i,a.handle);t.removeAttribute(ae.expando)}"script"===n&&t.text!==e.text?(y(t).text=e.text,b(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!ae.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ie.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function S(t,n){var i,a=ae(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(a[0]))?i.display:ae.css(a[0],"display");return a.detach(),r}function A(e){var t=me,n=Qe[e];return n||(n=S(e,t),"none"!==n&&n||(Ze=(Ze||ae("