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.
11 lines
332 KiB
11 lines
332 KiB
!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=!!t&&"length"in t&&t.length,n=pt.type(t);return"function"!==n&&!pt.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function i(t,e,n){if(pt.isFunction(e))return pt.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return pt.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(St.test(e))return pt.filter(e,t,n);e=pt.filter(e,t)}return pt.grep(t,function(t){return pt.inArray(t,e)>-1!==n})}function r(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function o(t){var e={};return pt.each(t.match(Et)||[],function(t,n){e[n]=!0}),e}function s(){it.addEventListener?(it.removeEventListener("DOMContentLoaded",a),t.removeEventListener("load",a)):(it.detachEvent("onreadystatechange",a),t.detachEvent("onload",a))}function a(){(it.addEventListener||"load"===t.event.type||"complete"===it.readyState)&&(s(),pt.ready())}function c(t,e,n){if(void 0===n&&1===t.nodeType){var i="data-"+e.replace(Nt,"-$1").toLowerCase();if(n=t.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Lt.test(n)?pt.parseJSON(n):n)}catch(t){}pt.data(t,e,n)}else n=void 0}return n}function l(t){var e;for(e in t)if(("data"!==e||!pt.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function u(t,e,n,i){if(Pt(t)){var r,o,s=pt.expando,a=t.nodeType,c=a?pt.cache:t,l=a?t[s]:t[s]&&s;if(l&&c[l]&&(i||c[l].data)||void 0!==n||"string"!=typeof e)return l||(l=a?t[s]=nt.pop()||pt.guid++:s),c[l]||(c[l]=a?{}:{toJSON:pt.noop}),"object"!=typeof e&&"function"!=typeof e||(i?c[l]=pt.extend(c[l],e):c[l].data=pt.extend(c[l].data,e)),o=c[l],i||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pt.camelCase(e)]=n),"string"==typeof e?(r=o[e],null==r&&(r=o[pt.camelCase(e)])):r=o,r}}function d(t,e,n){if(Pt(t)){var i,r,o=t.nodeType,s=o?pt.cache:t,a=o?t[pt.expando]:pt.expando;if(s[a]){if(e&&(i=n?s[a]:s[a].data)){pt.isArray(e)?e=e.concat(pt.map(e,pt.camelCase)):e in i?e=[e]:(e=pt.camelCase(e),e=e in i?[e]:e.split(" ")),r=e.length;for(;r--;)delete i[e[r]];if(n?!l(i):!pt.isEmptyObject(i))return}(n||(delete s[a].data,l(s[a])))&&(o?pt.cleanData([t],!0):dt.deleteExpando||s!=s.window?delete s[a]:s[a]=void 0)}}}function h(t,e,n,i){var r,o=1,s=20,a=i?function(){return i.cur()}:function(){return pt.css(t,e,"")},c=a(),l=n&&n[3]||(pt.cssNumber[e]?"":"px"),u=(pt.cssNumber[e]||"px"!==l&&+c)&&$t.exec(pt.css(t,e));if(u&&u[3]!==l){l=l||u[3],n=n||[],u=+c||1;do o=o||".5",u/=o,pt.style(t,e,u+l);while(o!==(o=a()/c)&&1!==o&&--s)}return n&&(u=+u||+c||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=u,i.end=r)),r}function p(t){var e=qt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function f(t,e){var n,i,r=0,o="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):void 0;if(!o)for(o=[],n=t.childNodes||t;null!=(i=n[r]);r++)!e||pt.nodeName(i,e)?o.push(i):pt.merge(o,f(i,e));return void 0===e||e&&pt.nodeName(t,e)?pt.merge([t],o):o}function g(t,e){for(var n,i=0;null!=(n=t[i]);i++)pt._data(n,"globalEval",!e||pt._data(e[i],"globalEval"))}function m(t){Rt.test(t.type)&&(t.defaultChecked=t.checked)}function v(t,e,n,i,r){for(var o,s,a,c,l,u,d,h=t.length,v=p(e),y=[],b=0;h>b;b++)if(s=t[b],s||0===s)if("object"===pt.type(s))pt.merge(y,s.nodeType?[s]:s);else if(Yt.test(s)){for(c=c||v.appendChild(e.createElement("div")),l=(Ht.exec(s)||["",""])[1].toLowerCase(),d=Xt[l]||Xt._default,c.innerHTML=d[1]+pt.htmlPrefilter(s)+d[2],o=d[0];o--;)c=c.lastChild;if(!dt.leadingWhitespace&&zt.test(s)&&y.push(e.createTextNode(zt.exec(s)[0])),!dt.tbody)for(s="table"!==l||Ut.test(s)?"<table>"!==d[1]||Ut.test(s)?0:c:c.firstChild,o=s&&s.childNodes.length;o--;)pt.nodeName(u=s.childNodes[o],"tbody")&&!u.childNodes.length&&s.removeChild(u);for(pt.merge(y,c.childNodes),c.textContent="";c.firstChild;)c.removeChild(c.firstChild);c=v.lastChild}else y.push(e.createTextNode(s));for(c&&v.removeChild(c),dt.appendChecked||pt.grep(f(y,"input"),m),b=0;s=y[b++];)if(i&&pt.inArray(s,i)>-1)r&&r.push(s);else if(a=pt.contains(s.ownerDocument,s),c=f(v.appendChild(s),"script"),a&&g(c),n)for(o=0;s=c[o++];)Ft.test(s.type||"")&&n.push(s);return c=null,v}function y(){return!0}function b(){return!1}function _(){try{return it.activeElement}catch(t){}}function w(t,e,n,i,r,o){var s,a;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(a in e)w(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),r===!1)r=b;else if(!r)return t;return 1===o&&(s=r,r=function(t){return pt().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=pt.guid++)),t.each(function(){pt.event.add(this,e,r,i,n)})}function x(t,e){return pt.nodeName(t,"table")&&pt.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function S(t){return t.type=(null!==pt.find.attr(t,"type"))+"/"+t.type,t}function M(t){var e=re.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function k(t,e){if(1===e.nodeType&&pt.hasData(t)){var n,i,r,o=pt._data(t),s=pt._data(e,o),a=o.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,r=a[n].length;r>i;i++)pt.event.add(e,n,a[n][i])}s.data&&(s.data=pt.extend({},s.data))}}function T(t,e){var n,i,r;if(1===e.nodeType){if(n=e.nodeName.toLowerCase(),!dt.noCloneEvent&&e[pt.expando]){r=pt._data(e);for(i in r.events)pt.removeEvent(e,i,r.handle);e.removeAttribute(pt.expando)}"script"===n&&e.text!==t.text?(S(e).text=t.text,M(e)):"object"===n?(e.parentNode&&(e.outerHTML=t.outerHTML),dt.html5Clone&&t.innerHTML&&!pt.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&Rt.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.defaultSelected=e.selected=t.defaultSelected:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}}function B(t,e,n,i){e=ot.apply([],e);var r,o,s,a,c,l,u=0,d=t.length,h=d-1,p=e[0],g=pt.isFunction(p);if(g||d>1&&"string"==typeof p&&!dt.checkClone&&ie.test(p))return t.each(function(r){var o=t.eq(r);g&&(e[0]=p.call(this,r,o.html())),B(o,e,n,i)});if(d&&(l=v(e,t[0].ownerDocument,!1,t,i),r=l.firstChild,1===l.childNodes.length&&(l=r),r||i)){for(a=pt.map(f(l,"script"),S),s=a.length;d>u;u++)o=l,u!==h&&(o=pt.clone(o,!0,!0),s&&pt.merge(a,f(o,"script"))),n.call(t[u],o,u);if(s)for(c=a[a.length-1].ownerDocument,pt.map(a,M),u=0;s>u;u++)o=a[u],Ft.test(o.type||"")&&!pt._data(o,"globalEval")&&pt.contains(c,o)&&(o.src?pt._evalUrl&&pt._evalUrl(o.src):pt.globalEval((o.text||o.textContent||o.innerHTML||"").replace(oe,"")));l=r=null}return t}function C(t,e,n){for(var i,r=e?pt.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||pt.cleanData(f(i)),i.parentNode&&(n&&pt.contains(i.ownerDocument,i)&&g(f(i,"script")),i.parentNode.removeChild(i));return t}function E(t,e){var n=pt(e.createElement(t)).appendTo(e.body),i=pt.css(n[0],"display");return n.detach(),i}function A(t){var e=it,n=le[t];return n||(n=E(t,e),"none"!==n&&n||(ce=(ce||pt("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement),e=(ce[0].contentWindow||ce[0].contentDocument).document,e.write(),e.close(),n=E(t,e),ce.detach()),le[t]=n),n}function j(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function P(t){if(t in Me)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=Se.length;n--;)if(t=Se[n]+e,t in Me)return t}function L(t,e){for(var n,i,r,o=[],s=0,a=t.length;a>s;s++)i=t[s],i.style&&(o[s]=pt._data(i,"olddisplay"),n=i.style.display,e?(o[s]||"none"!==n||(i.style.display=""),""===i.style.display&&Wt(i)&&(o[s]=pt._data(i,"olddisplay",A(i.nodeName)))):(r=Wt(i),(n&&"none"!==n||!r)&&pt._data(i,"olddisplay",r?n:pt.css(i,"display"))));for(s=0;a>s;s++)i=t[s],i.style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?o[s]||"":"none"));return t}function N(t,e,n){var i=_e.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function D(t,e,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===e?1:0,s=0;4>o;o+=2)"margin"===n&&(s+=pt.css(t,n+Ot[o],!0,r)),i?("content"===n&&(s-=pt.css(t,"padding"+Ot[o],!0,r)),"margin"!==n&&(s-=pt.css(t,"border"+Ot[o]+"Width",!0,r))):(s+=pt.css(t,"padding"+Ot[o],!0,r),"padding"!==n&&(s+=pt.css(t,"border"+Ot[o]+"Width",!0,r)));return s}function $(t,e,n){var i=!0,r="width"===e?t.offsetWidth:t.offsetHeight,o=fe(t),s=dt.boxSizing&&"border-box"===pt.css(t,"boxSizing",!1,o);if(0>=r||null==r){if(r=ge(t,e,o),(0>r||null==r)&&(r=t.style[e]),de.test(r))return r;i=s&&(dt.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+D(t,e,n||(s?"border":"content"),i,o)+"px"}function O(t,e,n,i,r){return new O.prototype.init(t,e,n,i,r)}function W(){return t.setTimeout(function(){ke=void 0}),ke=pt.now()}function I(t,e){var n,i={height:t},r=0;for(e=e?1:0;4>r;r+=2-e)n=Ot[r],i["margin"+n]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function R(t,e,n){for(var i,r=(z.tweeners[e]||[]).concat(z.tweeners["*"]),o=0,s=r.length;s>o;o++)if(i=r[o].call(n,e,t))return i}function H(t,e,n){var i,r,o,s,a,c,l,u,d=this,h={},p=t.style,f=t.nodeType&&Wt(t),g=pt._data(t,"fxshow");n.queue||(a=pt._queueHooks(t,"fx"),null==a.unqueued&&(a.unqueued=0,c=a.empty.fire,a.empty.fire=function(){a.unqueued||c()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,pt.queue(t,"fx").length||a.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=pt.css(t,"display"),u="none"===l?pt._data(t,"olddisplay")||A(t.nodeName):l,"inline"===u&&"none"===pt.css(t,"float")&&(dt.inlineBlockNeedsLayout&&"inline"!==A(t.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",dt.shrinkWrapBlocks()||d.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(i in e)if(r=e[i],Be.exec(r)){if(delete e[i],o=o||"toggle"===r,r===(f?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;f=!0}h[i]=g&&g[i]||pt.style(t,i)}else l=void 0;if(pt.isEmptyObject(h))"inline"===("none"===l?A(t.nodeName):l)&&(p.display=l);else{g?"hidden"in g&&(f=g.hidden):g=pt._data(t,"fxshow",{}),o&&(g.hidden=!f),f?pt(t).show():d.done(function(){pt(t).hide()}),d.done(function(){var e;pt._removeData(t,"fxshow");for(e in h)pt.style(t,e,h[e])});for(i in h)s=R(f?g[i]:0,i,d),i in g||(g[i]=s.start,f&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}function F(t,e){var n,i,r,o,s;for(n in t)if(i=pt.camelCase(n),r=e[i],o=t[n],pt.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),s=pt.cssHooks[i],s&&"expand"in s){o=s.expand(o),delete t[i];for(n in o)n in t||(t[n]=o[n],e[n]=r)}else e[i]=r}function z(t,e,n){var i,r,o=0,s=z.prefilters.length,a=pt.Deferred().always(function(){delete c.elem}),c=function(){if(r)return!1;for(var e=ke||W(),n=Math.max(0,l.startTime+l.duration-e),i=n/l.duration||0,o=1-i,s=0,c=l.tweens.length;c>s;s++)l.tweens[s].run(o);return a.notifyWith(t,[l,o,n]),1>o&&c?n:(a.resolveWith(t,[l]),!1)},l=a.promise({elem:t,props:pt.extend({},e),opts:pt.extend(!0,{specialEasing:{},easing:pt.easing._default},n),originalProperties:e,originalOptions:n,startTime:ke||W(),duration:n.duration,tweens:[],createTween:function(e,n){var i=pt.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(i),i},stop:function(e){var n=0,i=e?l.tweens.length:0;if(r)return this;for(r=!0;i>n;n++)l.tweens[n].run(1);return e?(a.notifyWith(t,[l,1,0]),a.resolveWith(t,[l,e])):a.rejectWith(t,[l,e]),this}}),u=l.props;for(F(u,l.opts.specialEasing);s>o;o++)if(i=z.prefilters[o].call(l,t,u,l.opts))return pt.isFunction(i.stop)&&(pt._queueHooks(l.elem,l.opts.queue).stop=pt.proxy(i.stop,i)),i;return pt.map(u,R,l),pt.isFunction(l.opts.start)&&l.opts.start.call(t,l),pt.fx.timer(pt.extend(c,{elem:t,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 q(t){return pt.attr(t,"class")||""}function X(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(Et)||[];if(pt.isFunction(n))for(;i=o[r++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Y(t,e,n,i){function r(a){var c;return o[a]=!0,pt.each(t[a]||[],function(t,a){var l=a(e,n,i);return"string"!=typeof l||s||o[l]?s?!(c=l):void 0:(e.dataTypes.unshift(l),r(l),!1)}),c}var o={},s=t===Qe;return r(e.dataTypes[0])||!o["*"]&&r("*")}function U(t,e){var n,i,r=pt.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&pt.extend(!0,t,n),t}function J(t,e,n){for(var i,r,o,s,a=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in a)if(a[s]&&a[s].test(r)){c.unshift(s);break}if(c[0]in n)o=c[0];else{for(s in n){if(!c[0]||t.converters[s+" "+c[0]]){o=s;break}i||(i=s)}o=o||i}return o?(o!==c[0]&&c.unshift(o),n[o]):void 0}function V(t,e,n,i){var r,o,s,a,c,l={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)l[s.toLowerCase()]=t.converters[s];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=o,o=u.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(s=l[c+" "+o]||l["* "+o],!s)for(r in l)if(a=r.split(" "),a[1]===o&&(s=l[c+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[r]:l[r]!==!0&&(o=a[0],u.unshift(a[1]));break}if(s!==!0)if(s&&t["throws"])e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+c+" to "+o}}}return{state:"success",data:e}}function G(t){return t.style&&t.style.display||pt.css(t,"display")}function K(t){if(!pt.contains(t.ownerDocument||it,t))return!0;for(;t&&1===t.nodeType;){if("none"===G(t)||"hidden"===t.type)return!0;t=t.parentNode}return!1}function Q(t,e,n,i){var r;if(pt.isArray(e))pt.each(e,function(e,r){n||rn.test(t)?i(t,r):Q(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)});else if(n||"object"!==pt.type(e))i(t,e);else for(r in e)Q(t+"["+r+"]",e[r],n,i)}function Z(){try{return new t.XMLHttpRequest}catch(t){}}function tt(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function et(t){return pt.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}var nt=[],it=t.document,rt=nt.slice,ot=nt.concat,st=nt.push,at=nt.indexOf,ct={},lt=ct.toString,ut=ct.hasOwnProperty,dt={},ht="1.12.4",pt=function(t,e){return new pt.fn.init(t,e)},ft=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,gt=/^-ms-/,mt=/-([\da-z])/gi,vt=function(t,e){return e.toUpperCase()};pt.fn=pt.prototype={jquery:ht,constructor:pt,selector:"",length:0,toArray:function(){return rt.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:rt.call(this)},pushStack:function(t){var e=pt.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t){return pt.each(this,t)},map:function(t){return this.pushStack(pt.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(rt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:st,sort:nt.sort,splice:nt.splice},pt.extend=pt.fn.extend=function(){var t,e,n,i,r,o,s=arguments[0]||{},a=1,c=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||pt.isFunction(s)||(s={}),a===c&&(s=this,a--);c>a;a++)if(null!=(r=arguments[a]))for(i in r)t=s[i],n=r[i],s!==n&&(l&&n&&(pt.isPlainObject(n)||(e=pt.isArray(n)))?(e?(e=!1,o=t&&pt.isArray(t)?t:[]):o=t&&pt.isPlainObject(t)?t:{},s[i]=pt.extend(l,o,n)):void 0!==n&&(s[i]=n));return s},pt.extend({expando:"jQuery"+(ht+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===pt.type(t)},isArray:Array.isArray||function(t){return"array"===pt.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){var e=t&&t.toString();return!pt.isArray(t)&&e-parseFloat(e)+1>=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==pt.type(t)||t.nodeType||pt.isWindow(t))return!1;try{if(t.constructor&&!ut.call(t,"constructor")&&!ut.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}if(!dt.ownFirst)for(e in t)return ut.call(t,e);for(e in t);return void 0===e||ut.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?ct[lt.call(t)]||"object":typeof t},globalEval:function(e){e&&pt.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(gt,"ms-").replace(mt,vt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var i,r=0;if(n(t))for(i=t.length;i>r&&e.call(t[r],r,t[r])!==!1;r++);else for(r in t)if(e.call(t[r],r,t[r])===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(ft,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(n(Object(t))?pt.merge(i,"string"==typeof t?[t]:t):st.call(i,t)),i},inArray:function(t,e,n){var i;if(e){if(at)return at.call(e,t,n);for(i=e.length,n=n?0>n?Math.max(0,i+n):n:0;i>n;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;n>i;)t[r++]=e[i++];if(n!==n)for(;void 0!==e[i];)t[r++]=e[i++];return t.length=r,t},grep:function(t,e,n){for(var i,r=[],o=0,s=t.length,a=!n;s>o;o++)i=!e(t[o],o),i!==a&&r.push(t[o]);return r},map:function(t,e,i){var r,o,s=0,a=[];if(n(t))for(r=t.length;r>s;s++)o=e(t[s],s,i),null!=o&&a.push(o);else for(s in t)o=e(t[s],s,i),null!=o&&a.push(o);return ot.apply([],a)},guid:1,proxy:function(t,e){var n,i,r;return"string"==typeof e&&(r=t[e],e=t,t=r),pt.isFunction(t)?(n=rt.call(arguments,2),i=function(){return t.apply(e||this,n.concat(rt.call(arguments)))},i.guid=t.guid=t.guid||pt.guid++,i):void 0},now:function(){return+new Date},support:dt}),"function"==typeof Symbol&&(pt.fn[Symbol.iterator]=nt[Symbol.iterator]),pt.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){ct["[object "+e+"]"]=e.toLowerCase()});var yt=function(t){function e(t,e,n,i){var r,o,s,a,c,l,d,p,f=e&&e.ownerDocument,g=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return n;if(!i&&((e?e.ownerDocument||e:R)!==P&&j(e),e=e||P,N)){if(11!==g&&(l=vt.exec(t)))if(r=l[1]){if(9===g){if(!(s=e.getElementById(r)))return n;if(s.id===r)return n.push(s),n}else if(f&&(s=f.getElementById(r))&&W(e,s)&&s.id===r)return n.push(s),n}else{if(l[2])return Q.apply(n,e.getElementsByTagName(t)),n;if((r=l[3])&&w.getElementsByClassName&&e.getElementsByClassName)return Q.apply(n,e.getElementsByClassName(r)),n}if(w.qsa&&!X[t+" "]&&(!D||!D.test(t))){if(1!==g)f=e,p=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(bt,"\\$&"):e.setAttribute("id",a=I),d=k(t),o=d.length,c=ht.test(a)?"#"+a:"[id='"+a+"']";o--;)d[o]=c+" "+h(d[o]);p=d.join(","),f=yt.test(t)&&u(e.parentNode)||e}if(p)try{return Q.apply(n,f.querySelectorAll(p)),n}catch(t){}finally{a===I&&e.removeAttribute("id")}}}return B(t.replace(at,"$1"),e,n,i)}function n(){function t(n,i){return e.push(n+" ")>x.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function i(t){return t[I]=!0,t}function r(t){var e=P.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),i=n.length;i--;)x.attrHandle[n[i]]=e}function s(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||U)-(~t.sourceIndex||U);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function a(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function c(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return i(function(e){return e=+e,i(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function u(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function d(){}function h(t){for(var e=0,n=t.length,i="";n>e;e++)i+=t[e].value;return i}function p(t,e,n){var i=e.dir,r=n&&"parentNode"===i,o=F++;return e.first?function(e,n,o){for(;e=e[i];)if(1===e.nodeType||r)return t(e,n,o)}:function(e,n,s){var a,c,l,u=[H,o];if(s){for(;e=e[i];)if((1===e.nodeType||r)&&t(e,n,s))return!0}else for(;e=e[i];)if(1===e.nodeType||r){if(l=e[I]||(e[I]={}),c=l[e.uniqueID]||(l[e.uniqueID]={}),(a=c[i])&&a[0]===H&&a[1]===o)return u[2]=a[2];if(c[i]=u,u[2]=t(e,n,s))return!0}}}function f(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function g(t,n,i){for(var r=0,o=n.length;o>r;r++)e(t,n[r],i);return i}function m(t,e,n,i,r){for(var o,s=[],a=0,c=t.length,l=null!=e;c>a;a++)(o=t[a])&&(n&&!n(o,i,r)||(s.push(o),l&&e.push(a)));return s}function v(t,e,n,r,o,s){return r&&!r[I]&&(r=v(r)),o&&!o[I]&&(o=v(o,s)),i(function(i,s,a,c){var l,u,d,h=[],p=[],f=s.length,v=i||g(e||"*",a.nodeType?[a]:a,[]),y=!t||!i&&e?v:m(v,h,t,a,c),b=n?o||(i?t:f||r)?[]:s:y;if(n&&n(y,b,a,c),r)for(l=m(b,p),r(l,[],a,c),u=l.length;u--;)(d=l[u])&&(b[p[u]]=!(y[p[u]]=d));if(i){if(o||t){if(o){for(l=[],u=b.length;u--;)(d=b[u])&&l.push(y[u]=d);o(null,b=[],l,c)}for(u=b.length;u--;)(d=b[u])&&(l=o?tt(i,d):h[u])>-1&&(i[l]=!(s[l]=d))}}else b=m(b===s?b.splice(f,b.length):b),o?o(null,s,b,c):Q.apply(s,b)})}function y(t){for(var e,n,i,r=t.length,o=x.relative[t[0].type],s=o||x.relative[" "],a=o?1:0,c=p(function(t){return t===e},s,!0),l=p(function(t){return tt(e,t)>-1},s,!0),u=[function(t,n,i){var r=!o&&(i||n!==C)||((e=n).nodeType?c(t,n,i):l(t,n,i));return e=null,r}];r>a;a++)if(n=x.relative[t[a].type])u=[p(f(u),n)];else{if(n=x.filter[t[a].type].apply(null,t[a].matches),n[I]){for(i=++a;r>i&&!x.relative[t[i].type];i++);return v(a>1&&f(u),a>1&&h(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(at,"$1"),n,i>a&&y(t.slice(a,i)),r>i&&y(t=t.slice(i)),r>i&&h(t))}u.push(n)}return f(u)}function b(t,n){var r=n.length>0,o=t.length>0,s=function(i,s,a,c,l){var u,d,h,p=0,f="0",g=i&&[],v=[],y=C,b=i||o&&x.find.TAG("*",l),_=H+=null==y?1:Math.random()||.1,w=b.length;for(l&&(C=s===P||s||l);f!==w&&null!=(u=b[f]);f++){if(o&&u){for(d=0,s||u.ownerDocument===P||(j(u),a=!N);h=t[d++];)if(h(u,s||P,a)){c.push(u);break}l&&(H=_)}r&&((u=!h&&u)&&p--,i&&g.push(u))}if(p+=f,r&&f!==p){for(d=0;h=n[d++];)h(g,v,s,a);if(i){if(p>0)for(;f--;)g[f]||v[f]||(v[f]=G.call(c));v=m(v)}Q.apply(c,v),l&&!i&&v.length>0&&p+n.length>1&&e.uniqueSort(c)}return l&&(H=_,C=y),g};return r?i(s):s}var _,w,x,S,M,k,T,B,C,E,A,j,P,L,N,D,$,O,W,I="sizzle"+1*new Date,R=t.document,H=0,F=0,z=n(),q=n(),X=n(),Y=function(t,e){return t===e&&(A=!0),0},U=1<<31,J={}.hasOwnProperty,V=[],G=V.pop,K=V.push,Q=V.push,Z=V.slice,tt=function(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",rt="\\["+nt+"*("+it+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+nt+"*\\]",ot=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+rt+")*)|.*)\\)|)",st=new RegExp(nt+"+","g"),at=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),lt=new RegExp("^"+nt+"*([>+~]|"+nt+")"+nt+"*"),ut=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),dt=new RegExp(ot),ht=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it+"|[*])"),ATTR:new RegExp("^"+rt),PSEUDO:new RegExp("^"+ot),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,bt=/'|\\/g,_t=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),wt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},xt=function(){j()};try{Q.apply(V=Z.call(R.childNodes),R.childNodes),V[R.childNodes.length].nodeType}catch(t){Q={apply:V.length?function(t,e){K.apply(t,Z.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}w=e.support={},M=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},j=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:R;return i!==P&&9===i.nodeType&&i.documentElement?(P=i,L=P.documentElement,N=!M(P),(n=P.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",xt,!1):n.attachEvent&&n.attachEvent("onunload",xt)),w.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=r(function(t){return t.appendChild(P.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=mt.test(P.getElementsByClassName),w.getById=r(function(t){return L.appendChild(t).id=I,!P.getElementsByName||!P.getElementsByName(I).length}),w.getById?(x.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&N){var n=e.getElementById(t);return n?[n]:[]}},x.filter.ID=function(t){var e=t.replace(_t,wt);return function(t){return t.getAttribute("id")===e}}):(delete x.find.ID,x.filter.ID=function(t){var e=t.replace(_t,wt);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),x.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},x.find.CLASS=w.getElementsByClassName&&function(t,e){return"undefined"!=typeof e.getElementsByClassName&&N?e.getElementsByClassName(t):void 0},$=[],D=[],(w.qsa=mt.test(P.querySelectorAll))&&(r(function(t){L.appendChild(t).innerHTML="<a id='"+I+"'></a><select id='"+I+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&D.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||D.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+I+"-]").length||D.push("~="),t.querySelectorAll(":checked").length||D.push(":checked"),t.querySelectorAll("a#"+I+"+*").length||D.push(".#.+[+~]")}),r(function(t){var e=P.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&D.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),D.push(",.*:")})),(w.matchesSelector=mt.test(O=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&r(function(t){w.disconnectedMatch=O.call(t,"div"),O.call(t,"[s!='']:x"),$.push("!=",ot)}),D=D.length&&new RegExp(D.join("|")),$=$.length&&new RegExp($.join("|")),e=mt.test(L.compareDocumentPosition),W=e||mt.test(L.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Y=e?function(t,e){if(t===e)return A=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===P||t.ownerDocument===R&&W(R,t)?-1:e===P||e.ownerDocument===R&&W(R,e)?1:E?tt(E,t)-tt(E,e):0:4&n?-1:1)}:function(t,e){if(t===e)return A=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],c=[e];if(!r||!o)return t===P?-1:e===P?1:r?-1:o?1:E?tt(E,t)-tt(E,e):0;if(r===o)return s(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)c.unshift(n);for(;a[i]===c[i];)i++;return i?s(a[i],c[i]):a[i]===R?-1:c[i]===R?1:0},P):P},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==P&&j(t),n=n.replace(ut,"='$1']"),w.matchesSelector&&N&&!X[n+" "]&&(!$||!$.test(n))&&(!D||!D.test(n)))try{var i=O.call(t,n);if(i||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return e(n,P,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==P&&j(t),W(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==P&&j(t);var n=x.attrHandle[e.toLowerCase()],i=n&&J.call(x.attrHandle,e.toLowerCase())?n(t,e,!N):void 0;return void 0!==i?i:w.attributes||!N?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,r=0;if(A=!w.detectDuplicates,E=!w.sortStable&&t.slice(0),t.sort(Y),A){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return E=null,t},S=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=S(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=S(e);return n},x=e.selectors={cacheLength:50,createPseudo:i,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_t,wt),t[3]=(t[3]||t[4]||t[5]||"").replace(_t,wt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&dt.test(n)&&(e=k(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(_t,wt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=z[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&z(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(r){var o=e.attr(r,t);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(st," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var l,u,d,h,p,f,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!c&&!a,b=!1;if(m){if(o){for(;g;){for(h=e;h=h[g];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&y){for(h=m,d=h[I]||(h[I]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),l=u[t]||[],p=l[0]===H&&l[1],b=p&&l[2],h=p&&m.childNodes[p];h=++p&&h&&h[g]||(b=p=0)||f.pop();)if(1===h.nodeType&&++b&&h===e){u[t]=[H,p,b];break}}else if(y&&(h=e,d=h[I]||(h[I]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),l=u[t]||[],p=l[0]===H&&l[1],b=p),b===!1)for(;(h=++p&&h&&h[g]||(b=p=0)||f.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&(d=h[I]||(h[I]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),u[t]=[H,b]),h!==e)););return b-=r,b===i||b%i===0&&b/i>=0}}},PSEUDO:function(t,n){var r,o=x.pseudos[t]||x.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[I]?o(n):o.length>1?(r=[t,t,"",n],x.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,r=o(t,n),s=r.length;s--;)i=tt(t,r[s]),t[i]=!(e[i]=r[s])}):function(t){return o(t,0,r)}):o}},pseudos:{
|
|
not:i(function(t){var e=[],n=[],r=T(t.replace(at,"$1"));return r[I]?i(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(_t,wt),function(e){return(e.textContent||e.innerText||S(e)).indexOf(t)>-1}}),lang:i(function(t){return ht.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(_t,wt).toLowerCase(),function(e){var n;do if(n=N?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===L},focus:function(t){return t===P.activeElement&&(!P.hasFocus||P.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!x.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return ft.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[0>n?n+e:n]}),even:l(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:l(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:l(function(t,e,n){for(var i=0>n?n+e:n;--i>=0;)t.push(i);return t}),gt:l(function(t,e,n){for(var i=0>n?n+e:n;++i<e;)t.push(i);return t})}},x.pseudos.nth=x.pseudos.eq;for(_ in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[_]=a(_);for(_ in{submit:!0,reset:!0})x.pseudos[_]=c(_);return d.prototype=x.filters=x.pseudos,x.setFilters=new d,k=e.tokenize=function(t,n){var i,r,o,s,a,c,l,u=q[t+" "];if(u)return n?0:u.slice(0);for(a=t,c=[],l=x.preFilter;a;){i&&!(r=ct.exec(a))||(r&&(a=a.slice(r[0].length)||a),c.push(o=[])),i=!1,(r=lt.exec(a))&&(i=r.shift(),o.push({value:i,type:r[0].replace(at," ")}),a=a.slice(i.length));for(s in x.filter)!(r=pt[s].exec(a))||l[s]&&!(r=l[s](r))||(i=r.shift(),o.push({value:i,type:s,matches:r}),a=a.slice(i.length));if(!i)break}return n?a.length:a?e.error(t):q(t,c).slice(0)},T=e.compile=function(t,e){var n,i=[],r=[],o=X[t+" "];if(!o){for(e||(e=k(t)),n=e.length;n--;)o=y(e[n]),o[I]?i.push(o):r.push(o);o=X(t,b(r,i)),o.selector=t}return o},B=e.select=function(t,e,n,i){var r,o,s,a,c,l="function"==typeof t&&t,d=!i&&k(t=l.selector||t);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&w.getById&&9===e.nodeType&&N&&x.relative[o[1].type]){if(e=(x.find.ID(s.matches[0].replace(_t,wt),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=pt.needsContext.test(t)?0:o.length;r--&&(s=o[r],!x.relative[a=s.type]);)if((c=x.find[a])&&(i=c(s.matches[0].replace(_t,wt),yt.test(o[0].type)&&u(e.parentNode)||e))){if(o.splice(r,1),t=i.length&&h(o),!t)return Q.apply(n,i),n;break}}return(l||T(t,d))(i,e,!N,n,!e||yt.test(t)&&u(e.parentNode)||e),n},w.sortStable=I.split("").sort(Y).join("")===I,w.detectDuplicates=!!A,j(),w.sortDetached=r(function(t){return 1&t.compareDocumentPosition(P.createElement("div"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,n){var i;return n?void 0:t[e]===!0?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),e}(t);pt.find=yt,pt.expr=yt.selectors,pt.expr[":"]=pt.expr.pseudos,pt.uniqueSort=pt.unique=yt.uniqueSort,pt.text=yt.getText,pt.isXMLDoc=yt.isXML,pt.contains=yt.contains;var bt=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&pt(t).is(n))break;i.push(t)}return i},_t=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},wt=pt.expr.match.needsContext,xt=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,St=/^.[^:#\[\.,]*$/;pt.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?pt.find.matchesSelector(i,t)?[i]:[]:pt.find.matches(t,pt.grep(e,function(t){return 1===t.nodeType}))},pt.fn.extend({find:function(t){var e,n=[],i=this,r=i.length;if("string"!=typeof t)return this.pushStack(pt(t).filter(function(){for(e=0;r>e;e++)if(pt.contains(i[e],this))return!0}));for(e=0;r>e;e++)pt.find(t,i[e],n);return n=this.pushStack(r>1?pt.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(i(this,t||[],!1))},not:function(t){return this.pushStack(i(this,t||[],!0))},is:function(t){return!!i(this,"string"==typeof t&&wt.test(t)?pt(t):t||[],!1).length}});var Mt,kt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,Tt=pt.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||Mt,"string"==typeof t){if(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:kt.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof pt?e[0]:e,pt.merge(this,pt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:it,!0)),xt.test(i[1])&&pt.isPlainObject(e))for(i in e)pt.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}if(r=it.getElementById(i[2]),r&&r.parentNode){if(r.id!==i[2])return Mt.find(t);this.length=1,this[0]=r}return this.context=it,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):pt.isFunction(t)?"undefined"!=typeof n.ready?n.ready(t):t(pt):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),pt.makeArray(t,this))};Tt.prototype=pt.fn,Mt=pt(it);var Bt=/^(?:parents|prev(?:Until|All))/,Ct={children:!0,contents:!0,next:!0,prev:!0};pt.fn.extend({has:function(t){var e,n=pt(t,this),i=n.length;return this.filter(function(){for(e=0;i>e;e++)if(pt.contains(this,n[e]))return!0})},closest:function(t,e){for(var n,i=0,r=this.length,o=[],s=wt.test(t)||"string"!=typeof t?pt(t,e||this.context):0;r>i;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&pt.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?pt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?pt.inArray(this[0],pt(t)):pt.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(pt.uniqueSort(pt.merge(this.get(),pt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),pt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return bt(t,"parentNode")},parentsUntil:function(t,e,n){return bt(t,"parentNode",n)},next:function(t){return r(t,"nextSibling")},prev:function(t){return r(t,"previousSibling")},nextAll:function(t){return bt(t,"nextSibling")},prevAll:function(t){return bt(t,"previousSibling")},nextUntil:function(t,e,n){return bt(t,"nextSibling",n)},prevUntil:function(t,e,n){return bt(t,"previousSibling",n)},siblings:function(t){return _t((t.parentNode||{}).firstChild,t)},children:function(t){return _t(t.firstChild)},contents:function(t){return pt.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:pt.merge([],t.childNodes)}},function(t,e){pt.fn[t]=function(n,i){var r=pt.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=pt.filter(i,r)),this.length>1&&(Ct[t]||(r=pt.uniqueSort(r)),Bt.test(t)&&(r=r.reverse())),this.pushStack(r)}});var Et=/\S+/g;pt.Callbacks=function(t){t="string"==typeof t?o(t):pt.extend({},t);var e,n,i,r,s=[],a=[],c=-1,l=function(){for(r=t.once,i=e=!0;a.length;c=-1)for(n=a.shift();++c<s.length;)s[c].apply(n[0],n[1])===!1&&t.stopOnFalse&&(c=s.length,n=!1);t.memory||(n=!1),e=!1,r&&(s=n?[]:"")},u={add:function(){return s&&(n&&!e&&(c=s.length-1,a.push(n)),function e(n){pt.each(n,function(n,i){pt.isFunction(i)?t.unique&&u.has(i)||s.push(i):i&&i.length&&"string"!==pt.type(i)&&e(i)})}(arguments),n&&!e&&l()),this},remove:function(){return pt.each(arguments,function(t,e){for(var n;(n=pt.inArray(e,s,n))>-1;)s.splice(n,1),c>=n&&c--}),this},has:function(t){return t?pt.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=a=[],s=n="",this},disabled:function(){return!s},lock:function(){return r=!0,n||u.disable(),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},pt.extend({Deferred:function(t){var e=[["resolve","done",pt.Callbacks("once memory"),"resolved"],["reject","fail",pt.Callbacks("once memory"),"rejected"],["notify","progress",pt.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return pt.Deferred(function(n){pt.each(e,function(e,o){var s=pt.isFunction(t[e])&&t[e];r[o[1]](function(){var t=s&&s.apply(this,arguments);t&&pt.isFunction(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===i?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?pt.extend(t,i):i}},r={};return i.pipe=i.then,pt.each(e,function(t,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=s.fireWith}),i.promise(r),t&&t.call(r,r),r},when:function(t){var e,n,i,r=0,o=rt.call(arguments),s=o.length,a=1!==s||t&&pt.isFunction(t.promise)?s:0,c=1===a?t:pt.Deferred(),l=function(t,n,i){return function(r){n[t]=this,i[t]=arguments.length>1?rt.call(arguments):r,i===e?c.notifyWith(n,i):--a||c.resolveWith(n,i)}};if(s>1)for(e=new Array(s),n=new Array(s),i=new Array(s);s>r;r++)o[r]&&pt.isFunction(o[r].promise)?o[r].promise().progress(l(r,n,e)).done(l(r,i,o)).fail(c.reject):--a;return a||c.resolveWith(i,o),c.promise()}});var At;pt.fn.ready=function(t){return pt.ready.promise().done(t),this},pt.extend({isReady:!1,readyWait:1,holdReady:function(t){t?pt.readyWait++:pt.ready(!0)},ready:function(t){(t===!0?--pt.readyWait:pt.isReady)||(pt.isReady=!0,t!==!0&&--pt.readyWait>0||(At.resolveWith(it,[pt]),pt.fn.triggerHandler&&(pt(it).triggerHandler("ready"),pt(it).off("ready"))))}}),pt.ready.promise=function(e){if(!At)if(At=pt.Deferred(),"complete"===it.readyState||"loading"!==it.readyState&&!it.documentElement.doScroll)t.setTimeout(pt.ready);else if(it.addEventListener)it.addEventListener("DOMContentLoaded",a),t.addEventListener("load",a);else{it.attachEvent("onreadystatechange",a),t.attachEvent("onload",a);var n=!1;try{n=null==t.frameElement&&it.documentElement}catch(t){}n&&n.doScroll&&!function e(){if(!pt.isReady){try{n.doScroll("left")}catch(n){return t.setTimeout(e,50)}s(),pt.ready()}}()}return At.promise(e)},pt.ready.promise();var jt;for(jt in pt(dt))break;dt.ownFirst="0"===jt,dt.inlineBlockNeedsLayout=!1,pt(function(){var t,e,n,i;n=it.getElementsByTagName("body")[0],n&&n.style&&(e=it.createElement("div"),i=it.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(e),"undefined"!=typeof e.style.zoom&&(e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",dt.inlineBlockNeedsLayout=t=3===e.offsetWidth,t&&(n.style.zoom=1)),n.removeChild(i))}),function(){var t=it.createElement("div");dt.deleteExpando=!0;try{delete t.test}catch(t){dt.deleteExpando=!1}t=null}();var Pt=function(t){var e=pt.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return(1===n||9===n)&&(!e||e!==!0&&t.getAttribute("classid")===e)},Lt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Nt=/([A-Z])/g;pt.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){return t=t.nodeType?pt.cache[t[pt.expando]]:t[pt.expando],!!t&&!l(t)},data:function(t,e,n){return u(t,e,n)},removeData:function(t,e){return d(t,e)},_data:function(t,e,n){return u(t,e,n,!0)},_removeData:function(t,e){return d(t,e,!0)}}),pt.fn.extend({data:function(t,e){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=pt.data(o),1===o.nodeType&&!pt._data(o,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&(i=s[n].name,0===i.indexOf("data-")&&(i=pt.camelCase(i.slice(5)),c(o,i,r[i])));pt._data(o,"parsedAttrs",!0)}return r}return"object"==typeof t?this.each(function(){pt.data(this,t)}):arguments.length>1?this.each(function(){pt.data(this,t,e)}):o?c(o,t,pt.data(o,t)):void 0},removeData:function(t){return this.each(function(){pt.removeData(this,t)})}}),pt.extend({queue:function(t,e,n){var i;return t?(e=(e||"fx")+"queue",i=pt._data(t,e),n&&(!i||pt.isArray(n)?i=pt._data(t,e,pt.makeArray(n)):i.push(n)),i||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=pt.queue(t,e),i=n.length,r=n.shift(),o=pt._queueHooks(t,e),s=function(){pt.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return pt._data(t,n)||pt._data(t,n,{empty:pt.Callbacks("once memory").add(function(){pt._removeData(t,e+"queue"),pt._removeData(t,n)})})}}),pt.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?pt.queue(this[0],t):void 0===e?this:this.each(function(){var n=pt.queue(this,t,e);pt._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&pt.dequeue(this,t)})},dequeue:function(t){return this.each(function(){pt.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=pt.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)n=pt._data(o[s],t+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}}),function(){var t;dt.shrinkWrapBlocks=function(){if(null!=t)return t;t=!1;var e,n,i;return n=it.getElementsByTagName("body")[0],n&&n.style?(e=it.createElement("div"),i=it.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(e),"undefined"!=typeof e.style.zoom&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(it.createElement("div")).style.width="5px",t=3!==e.offsetWidth),n.removeChild(i),t):void 0}}();var Dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,$t=new RegExp("^(?:([+-])=|)("+Dt+")([a-z%]*)$","i"),Ot=["Top","Right","Bottom","Left"],Wt=function(t,e){return t=e||t,"none"===pt.css(t,"display")||!pt.contains(t.ownerDocument,t)},It=function(t,e,n,i,r,o,s){var a=0,c=t.length,l=null==n;if("object"===pt.type(n)){r=!0;for(a in n)It(t,e,a,n[a],!0,o,s)}else if(void 0!==i&&(r=!0,pt.isFunction(i)||(s=!0),l&&(s?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(pt(t),n)})),e))for(;c>a;a++)e(t[a],n,s?i:i.call(t[a],a,e(t[a],n)));return r?t:l?e.call(t):c?e(t[0],n):o},Rt=/^(?:checkbox|radio)$/i,Ht=/<([\w:-]+)/,Ft=/^$|\/(?:java|ecma)script/i,zt=/^\s+/,qt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";!function(){var t=it.createElement("div"),e=it.createDocumentFragment(),n=it.createElement("input");t.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",dt.leadingWhitespace=3===t.firstChild.nodeType,dt.tbody=!t.getElementsByTagName("tbody").length,dt.htmlSerialize=!!t.getElementsByTagName("link").length,dt.html5Clone="<:nav></:nav>"!==it.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,e.appendChild(n),dt.appendChecked=n.checked,t.innerHTML="<textarea>x</textarea>",dt.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,e.appendChild(t),n=it.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),dt.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.noCloneEvent=!!t.addEventListener,t[pt.expando]=1,dt.attributes=!t.getAttribute(pt.expando)}();var Xt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:dt.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};Xt.optgroup=Xt.option,Xt.tbody=Xt.tfoot=Xt.colgroup=Xt.caption=Xt.thead,Xt.th=Xt.td;var Yt=/<|&#?\w+;/,Ut=/<tbody/i;!function(){var e,n,i=it.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})n="on"+e,(dt[e]=n in t)||(i.setAttribute(n,"t"),dt[e]=i.attributes[n].expando===!1);i=null}();var Jt=/^(?:input|select|textarea)$/i,Vt=/^key/,Gt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Kt=/^(?:focusinfocus|focusoutblur)$/,Qt=/^([^.]*)(?:\.(.+)|)/;pt.event={global:{},add:function(t,e,n,i,r){var o,s,a,c,l,u,d,h,p,f,g,m=pt._data(t);if(m){for(n.handler&&(c=n,n=c.handler,r=c.selector),n.guid||(n.guid=pt.guid++),(s=m.events)||(s=m.events={}),(u=m.handle)||(u=m.handle=function(t){return"undefined"==typeof pt||t&&pt.event.triggered===t.type?void 0:pt.event.dispatch.apply(u.elem,arguments)},u.elem=t),e=(e||"").match(Et)||[""],a=e.length;a--;)o=Qt.exec(e[a])||[],p=g=o[1],f=(o[2]||"").split(".").sort(),p&&(l=pt.event.special[p]||{},p=(r?l.delegateType:l.bindType)||p,l=pt.event.special[p]||{},d=pt.extend({type:p,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&pt.expr.match.needsContext.test(r),namespace:f.join(".")},c),(h=s[p])||(h=s[p]=[],h.delegateCount=0,l.setup&&l.setup.call(t,i,f,u)!==!1||(t.addEventListener?t.addEventListener(p,u,!1):t.attachEvent&&t.attachEvent("on"+p,u))),l.add&&(l.add.call(t,d),d.handler.guid||(d.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,d):h.push(d),pt.event.global[p]=!0);t=null}},remove:function(t,e,n,i,r){var o,s,a,c,l,u,d,h,p,f,g,m=pt.hasData(t)&&pt._data(t);if(m&&(u=m.events)){for(e=(e||"").match(Et)||[""],l=e.length;l--;)if(a=Qt.exec(e[l])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p){for(d=pt.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,h=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=o=h.length;o--;)s=h[o],!r&&g!==s.origType||n&&n.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(h.splice(o,1),s.selector&&h.delegateCount--,d.remove&&d.remove.call(t,s));c&&!h.length&&(d.teardown&&d.teardown.call(t,f,m.handle)!==!1||pt.removeEvent(t,p,m.handle),delete u[p])}else for(p in u)pt.event.remove(t,p+e[l],n,i,!0);pt.isEmptyObject(u)&&(delete m.handle,pt._removeData(t,"events"))}},trigger:function(e,n,i,r){var o,s,a,c,l,u,d,h=[i||it],p=ut.call(e,"type")?e.type:e,f=ut.call(e,"namespace")?e.namespace.split("."):[];if(a=u=i=i||it,3!==i.nodeType&&8!==i.nodeType&&!Kt.test(p+pt.event.triggered)&&(p.indexOf(".")>-1&&(f=p.split("."),p=f.shift(),f.sort()),s=p.indexOf(":")<0&&"on"+p,e=e[pt.expando]?e:new pt.Event(p,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=f.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:pt.makeArray(n,[e]),l=pt.event.special[p]||{},r||!l.trigger||l.trigger.apply(i,n)!==!1)){if(!r&&!l.noBubble&&!pt.isWindow(i)){for(c=l.delegateType||p,Kt.test(c+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(i.ownerDocument||it)&&h.push(u.defaultView||u.parentWindow||t)}for(d=0;(a=h[d++])&&!e.isPropagationStopped();)e.type=d>1?c:l.bindType||p,o=(pt._data(a,"events")||{})[e.type]&&pt._data(a,"handle"),o&&o.apply(a,n),o=s&&a[s],o&&o.apply&&Pt(a)&&(e.result=o.apply(a,n),e.result===!1&&e.preventDefault());if(e.type=p,!r&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(h.pop(),n)===!1)&&Pt(i)&&s&&i[p]&&!pt.isWindow(i)){u=i[s],u&&(i[s]=null),pt.event.triggered=p;try{i[p]()}catch(t){}pt.event.triggered=void 0,u&&(i[s]=u)}return e.result}},dispatch:function(t){t=pt.event.fix(t);var e,n,i,r,o,s=[],a=rt.call(arguments),c=(pt._data(this,"events")||{})[t.type]||[],l=pt.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(s=pt.event.handlers.call(this,t,c),e=0;(r=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(o.namespace)||(t.handleObj=o,t.data=o.data,i=((pt.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a),void 0!==i&&(t.result=i)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,i,r,o,s=[],a=e.delegateCount,c=t.target;if(a&&c.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;c!=this;c=c.parentNode||this)if(1===c.nodeType&&(c.disabled!==!0||"click"!==t.type)){for(i=[],n=0;a>n;n++)o=e[n],r=o.selector+" ",void 0===i[r]&&(i[r]=o.needsContext?pt(r,this).index(c)>-1:pt.find(r,this,null,[c]).length),i[r]&&i.push(o);i.length&&s.push({elem:c,handlers:i})}return a<e.length&&s.push({elem:this,handlers:e.slice(a)}),s},fix:function(t){if(t[pt.expando])return t;var e,n,i,r=t.type,o=t,s=this.fixHooks[r];for(s||(this.fixHooks[r]=s=Gt.test(r)?this.mouseHooks:Vt.test(r)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,t=new pt.Event(o),e=i.length;e--;)n=i[e],t[n]=o[n];return t.target||(t.target=o.srcElement||it),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,s.filter?s.filter(t,o):t},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,i,r,o=e.button,s=e.fromElement;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||it,r=i.documentElement,n=i.body,t.pageX=e.clientX+(r&&r.scrollLeft||n&&n.scrollLeft||0)-(r&&r.clientLeft||n&&n.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||n&&n.scrollTop||0)-(r&&r.clientTop||n&&n.clientTop||0)),!t.relatedTarget&&s&&(t.relatedTarget=s===t.target?e.toElement:s),t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0),t}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==_()&&this.focus)try{return this.focus(),!1}catch(t){}},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return pt.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(t){return pt.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n){var i=pt.extend(new pt.Event,n,{type:t,isSimulated:!0});pt.event.trigger(i,null,e),i.isDefaultPrevented()&&n.preventDefault()}},pt.removeEvent=it.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)}:function(t,e,n){var i="on"+e;t.detachEvent&&("undefined"==typeof t[i]&&(t[i]=null),t.detachEvent(i,n))},pt.Event=function(t,e){return this instanceof pt.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?y:b):this.type=t,e&&pt.extend(this,e),this.timeStamp=t&&t.timeStamp||pt.now(),void(this[pt.expando]=!0)):new pt.Event(t,e)},pt.Event.prototype={constructor:pt.Event,isDefaultPrevented:b,isPropagationStopped:b,isImmediatePropagationStopped:b,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=y,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=y,t&&!this.isSimulated&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=y,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},pt.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){pt.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,o=t.handleObj;return r&&(r===i||pt.contains(i,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),dt.submit||(pt.event.special.submit={setup:function(){return!pt.nodeName(this,"form")&&void pt.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=pt.nodeName(e,"input")||pt.nodeName(e,"button")?pt.prop(e,"form"):void 0;n&&!pt._data(n,"submit")&&(pt.event.add(n,"submit._submit",function(t){t._submitBubble=!0}),pt._data(n,"submit",!0))})},postDispatch:function(t){t._submitBubble&&(delete t._submitBubble,this.parentNode&&!t.isTrigger&&pt.event.simulate("submit",this.parentNode,t))},teardown:function(){return!pt.nodeName(this,"form")&&void pt.event.remove(this,"._submit")}}),dt.change||(pt.event.special.change={setup:function(){return Jt.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(pt.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._justChanged=!0)}),pt.event.add(this,"click._change",function(t){this._justChanged&&!t.isTrigger&&(this._justChanged=!1),pt.event.simulate("change",this,t)})),!1):void pt.event.add(this,"beforeactivate._change",function(t){var e=t.target;Jt.test(e.nodeName)&&!pt._data(e,"change")&&(pt.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||pt.event.simulate("change",this.parentNode,t)}),pt._data(e,"change",!0))})},handle:function(t){var e=t.target;return this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type?t.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return pt.event.remove(this,"._change"),!Jt.test(this.nodeName)}}),dt.focusin||pt.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){pt.event.simulate(e,t.target,pt.event.fix(t))};pt.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=pt._data(i,e);r||i.addEventListener(t,n,!0),pt._data(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=pt._data(i,e)-1;r?pt._data(i,e,r):(i.removeEventListener(t,n,!0),pt._removeData(i,e))}}}),pt.fn.extend({on:function(t,e,n,i){return w(this,t,e,n,i)},one:function(t,e,n,i){return w(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,pt(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return e!==!1&&"function"!=typeof e||(n=e,e=void 0),n===!1&&(n=b),this.each(function(){pt.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){pt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];return n?pt.event.trigger(t,e,n,!0):void 0}});var Zt=/ jQuery\d+="(?:null|\d+)"/g,te=new RegExp("<(?:"+qt+")[\\s/>]","i"),ee=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ne=/<script|<style|<link/i,ie=/checked\s*(?:[^=]|=\s*.checked.)/i,re=/^true\/(.*)/,oe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,se=p(it),ae=se.appendChild(it.createElement("div"));pt.extend({htmlPrefilter:function(t){return t.replace(ee,"<$1></$2>")},clone:function(t,e,n){var i,r,o,s,a,c=pt.contains(t.ownerDocument,t);if(dt.html5Clone||pt.isXMLDoc(t)||!te.test("<"+t.nodeName+">")?o=t.cloneNode(!0):(ae.innerHTML=t.outerHTML,ae.removeChild(o=ae.firstChild)),!(dt.noCloneEvent&&dt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||pt.isXMLDoc(t)))for(i=f(o),a=f(t),s=0;null!=(r=a[s]);++s)i[s]&&T(r,i[s]);if(e)if(n)for(a=a||f(t),i=i||f(o),s=0;null!=(r=a[s]);s++)k(r,i[s]);else k(t,o);return i=f(o,"script"),i.length>0&&g(i,!c&&f(t,"script")),i=a=r=null,o},cleanData:function(t,e){for(var n,i,r,o,s=0,a=pt.expando,c=pt.cache,l=dt.attributes,u=pt.event.special;null!=(n=t[s]);s++)if((e||Pt(n))&&(r=n[a],o=r&&c[r])){if(o.events)for(i in o.events)u[i]?pt.event.remove(n,i):pt.removeEvent(n,i,o.handle);c[r]&&(delete c[r],l||"undefined"==typeof n.removeAttribute?n[a]=void 0:n.removeAttribute(a),nt.push(r))}}}),pt.fn.extend({domManip:B,detach:function(t){return C(this,t,!0)},remove:function(t){return C(this,t)},text:function(t){return It(this,function(t){return void 0===t?pt.text(this):this.empty().append((this[0]&&this[0].ownerDocument||it).createTextNode(t))},null,t,arguments.length)},append:function(){return B(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=x(this,t);e.appendChild(t)}})},prepend:function(){return B(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=x(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return B(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return B(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&pt.cleanData(f(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&pt.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return pt.clone(this,t,e)})},html:function(t){return It(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Zt,""):void 0;if("string"==typeof t&&!ne.test(t)&&(dt.htmlSerialize||!te.test(t))&&(dt.leadingWhitespace||!zt.test(t))&&!Xt[(Ht.exec(t)||["",""])[1].toLowerCase()]){t=pt.htmlPrefilter(t);try{for(;i>n;n++)e=this[n]||{},1===e.nodeType&&(pt.cleanData(f(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return B(this,arguments,function(e){var n=this.parentNode;pt.inArray(this,t)<0&&(pt.cleanData(f(this)),n&&n.replaceChild(e,this))},t)}}),pt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){pt.fn[t]=function(t){for(var n,i=0,r=[],o=pt(t),s=o.length-1;s>=i;i++)n=i===s?this:this.clone(!0),pt(o[i])[e](n),st.apply(r,n.get());return this.pushStack(r)}});var ce,le={HTML:"block",BODY:"block"},ue=/^margin/,de=new RegExp("^("+Dt+")(?!px)[a-z%]+$","i"),he=function(t,e,n,i){var r,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];r=n.apply(t,i||[]);for(o in e)t.style[o]=s[o];return r},pe=it.documentElement;!function(){function e(){var e,u,d=it.documentElement;d.appendChild(c),l.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",n=r=a=!1,i=s=!0,t.getComputedStyle&&(u=t.getComputedStyle(l),n="1%"!==(u||{}).top,a="2px"===(u||{}).marginLeft,r="4px"===(u||{width:"4px"}).width,l.style.marginRight="50%",i="4px"===(u||{marginRight:"4px"}).marginRight,e=l.appendChild(it.createElement("div")),e.style.cssText=l.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",e.style.marginRight=e.style.width="0",l.style.width="1px",s=!parseFloat((t.getComputedStyle(e)||{}).marginRight),l.removeChild(e)),l.style.display="none",o=0===l.getClientRects().length,o&&(l.style.display="",l.innerHTML="<table><tr><td></td><td>t</td></tr></table>",l.childNodes[0].style.borderCollapse="separate",
|
|
e=l.getElementsByTagName("td"),e[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===e[0].offsetHeight,o&&(e[0].style.display="",e[1].style.display="none",o=0===e[0].offsetHeight)),d.removeChild(c)}var n,i,r,o,s,a,c=it.createElement("div"),l=it.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",dt.opacity="0.5"===l.style.opacity,dt.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",dt.clearCloneStyle="content-box"===l.style.backgroundClip,c=it.createElement("div"),c.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",c.appendChild(l),dt.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,pt.extend(dt,{reliableHiddenOffsets:function(){return null==n&&e(),o},boxSizingReliable:function(){return null==n&&e(),r},pixelMarginRight:function(){return null==n&&e(),i},pixelPosition:function(){return null==n&&e(),n},reliableMarginRight:function(){return null==n&&e(),s},reliableMarginLeft:function(){return null==n&&e(),a}}))}();var fe,ge,me=/^(top|right|bottom|left)$/;t.getComputedStyle?(fe=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},ge=function(t,e,n){var i,r,o,s,a=t.style;return n=n||fe(t),s=n?n.getPropertyValue(e)||n[e]:void 0,""!==s&&void 0!==s||pt.contains(t.ownerDocument,t)||(s=pt.style(t,e)),n&&!dt.pixelMarginRight()&&de.test(s)&&ue.test(e)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o),void 0===s?s:s+""}):pe.currentStyle&&(fe=function(t){return t.currentStyle},ge=function(t,e,n){var i,r,o,s,a=t.style;return n=n||fe(t),s=n?n[e]:void 0,null==s&&a&&a[e]&&(s=a[e]),de.test(s)&&!me.test(e)&&(i=a.left,r=t.runtimeStyle,o=r&&r.left,o&&(r.left=t.currentStyle.left),a.left="fontSize"===e?"1em":s,s=a.pixelLeft+"px",a.left=i,o&&(r.left=o)),void 0===s?s:s+""||"auto"});var ve=/alpha\([^)]*\)/i,ye=/opacity\s*=\s*([^)]*)/i,be=/^(none|table(?!-c[ea]).+)/,_e=new RegExp("^("+Dt+")(.*)$","i"),we={position:"absolute",visibility:"hidden",display:"block"},xe={letterSpacing:"0",fontWeight:"400"},Se=["Webkit","O","Moz","ms"],Me=it.createElement("div").style;pt.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=ge(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":dt.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=pt.camelCase(e),c=t.style;if(e=pt.cssProps[a]||(pt.cssProps[a]=P(a)||a),s=pt.cssHooks[e]||pt.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:c[e];if(o=typeof n,"string"===o&&(r=$t.exec(n))&&r[1]&&(n=h(t,e,r),o="number"),null!=n&&n===n&&("number"===o&&(n+=r&&r[3]||(pt.cssNumber[a]?"":"px")),dt.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),!(s&&"set"in s&&void 0===(n=s.set(t,n,i)))))try{c[e]=n}catch(t){}}},css:function(t,e,n,i){var r,o,s,a=pt.camelCase(e);return e=pt.cssProps[a]||(pt.cssProps[a]=P(a)||a),s=pt.cssHooks[e]||pt.cssHooks[a],s&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=ge(t,e,i)),"normal"===o&&e in xe&&(o=xe[e]),""===n||n?(r=parseFloat(o),n===!0||isFinite(r)?r||0:o):o}}),pt.each(["height","width"],function(t,e){pt.cssHooks[e]={get:function(t,n,i){return n?be.test(pt.css(t,"display"))&&0===t.offsetWidth?he(t,we,function(){return $(t,e,i)}):$(t,e,i):void 0},set:function(t,n,i){var r=i&&fe(t);return N(t,n,i?D(t,e,i,dt.boxSizing&&"border-box"===pt.css(t,"boxSizing",!1,r),r):0)}}}),dt.opacity||(pt.cssHooks.opacity={get:function(t,e){return ye.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,r=pt.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,(e>=1||""===e)&&""===pt.trim(o.replace(ve,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===e||i&&!i.filter)||(n.filter=ve.test(o)?o.replace(ve,r):o+" "+r)}}),pt.cssHooks.marginRight=j(dt.reliableMarginRight,function(t,e){return e?he(t,{display:"inline-block"},ge,[t,"marginRight"]):void 0}),pt.cssHooks.marginLeft=j(dt.reliableMarginLeft,function(t,e){return e?(parseFloat(ge(t,"marginLeft"))||(pt.contains(t.ownerDocument,t)?t.getBoundingClientRect().left-he(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}):0))+"px":void 0}),pt.each({margin:"",padding:"",border:"Width"},function(t,e){pt.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];4>i;i++)r[t+Ot[i]+e]=o[i]||o[i-2]||o[0];return r}},ue.test(t)||(pt.cssHooks[t+e].set=N)}),pt.fn.extend({css:function(t,e){return It(this,function(t,e,n){var i,r,o={},s=0;if(pt.isArray(e)){for(i=fe(t),r=e.length;r>s;s++)o[e[s]]=pt.css(t,e[s],!1,i);return o}return void 0!==n?pt.style(t,e,n):pt.css(t,e)},t,e,arguments.length>1)},show:function(){return L(this,!0)},hide:function(){return L(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Wt(this)?pt(this).show():pt(this).hide()})}}),pt.Tween=O,O.prototype={constructor:O,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||pt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(pt.cssNumber[n]?"":"px")},cur:function(){var t=O.propHooks[this.prop];return t&&t.get?t.get(this):O.propHooks._default.get(this)},run:function(t){var e,n=O.propHooks[this.prop];return this.options.duration?this.pos=e=pt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=pt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){pt.fx.step[t.prop]?pt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[pt.cssProps[t.prop]]&&!pt.cssHooks[t.prop]?t.elem[t.prop]=t.now:pt.style(t.elem,t.prop,t.now+t.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},pt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},pt.fx=O.prototype.init,pt.fx.step={};var ke,Te,Be=/^(?:toggle|show|hide)$/,Ce=/queueHooks$/;pt.Animation=pt.extend(z,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return h(n.elem,t,$t.exec(e),n),n}]},tweener:function(t,e){pt.isFunction(t)?(e=t,t=["*"]):t=t.match(Et);for(var n,i=0,r=t.length;r>i;i++)n=t[i],z.tweeners[n]=z.tweeners[n]||[],z.tweeners[n].unshift(e)},prefilters:[H],prefilter:function(t,e){e?z.prefilters.unshift(t):z.prefilters.push(t)}}),pt.speed=function(t,e,n){var i=t&&"object"==typeof t?pt.extend({},t):{complete:n||!n&&e||pt.isFunction(t)&&t,duration:t,easing:n&&e||e&&!pt.isFunction(e)&&e};return i.duration=pt.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in pt.fx.speeds?pt.fx.speeds[i.duration]:pt.fx.speeds._default,null!=i.queue&&i.queue!==!0||(i.queue="fx"),i.old=i.complete,i.complete=function(){pt.isFunction(i.old)&&i.old.call(this),i.queue&&pt.dequeue(this,i.queue)},i},pt.fn.extend({fadeTo:function(t,e,n,i){return this.filter(Wt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=pt.isEmptyObject(t),o=pt.speed(e,n,i),s=function(){var e=z(this,pt.extend({},t),o);(r||pt._data(this,"finish"))&&e.stop(!0)};return s.finish=s,r||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,r=null!=t&&t+"queueHooks",o=pt.timers,s=pt._data(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&Ce.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||pt.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,n=pt._data(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=pt.timers,s=i?i.length:0;for(n.finish=!0,pt.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;s>e;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish})}}),pt.each(["toggle","show","hide"],function(t,e){var n=pt.fn[e];pt.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(I(e,!0),t,i,r)}}),pt.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){pt.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}}),pt.timers=[],pt.fx.tick=function(){var t,e=pt.timers,n=0;for(ke=pt.now();n<e.length;n++)t=e[n],t()||e[n]!==t||e.splice(n--,1);e.length||pt.fx.stop(),ke=void 0},pt.fx.timer=function(t){pt.timers.push(t),t()?pt.fx.start():pt.timers.pop()},pt.fx.interval=13,pt.fx.start=function(){Te||(Te=t.setInterval(pt.fx.tick,pt.fx.interval))},pt.fx.stop=function(){t.clearInterval(Te),Te=null},pt.fx.speeds={slow:600,fast:200,_default:400},pt.fn.delay=function(e,n){return e=pt.fx?pt.fx.speeds[e]||e:e,n=n||"fx",this.queue(n,function(n,i){var r=t.setTimeout(n,e);i.stop=function(){t.clearTimeout(r)}})},function(){var t,e=it.createElement("input"),n=it.createElement("div"),i=it.createElement("select"),r=i.appendChild(it.createElement("option"));n=it.createElement("div"),n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",t=n.getElementsByTagName("a")[0],e.setAttribute("type","checkbox"),n.appendChild(e),t=n.getElementsByTagName("a")[0],t.style.cssText="top:1px",dt.getSetAttribute="t"!==n.className,dt.style=/top/.test(t.getAttribute("style")),dt.hrefNormalized="/a"===t.getAttribute("href"),dt.checkOn=!!e.value,dt.optSelected=r.selected,dt.enctype=!!it.createElement("form").enctype,i.disabled=!0,dt.optDisabled=!r.disabled,e=it.createElement("input"),e.setAttribute("value",""),dt.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),dt.radioValue="t"===e.value}();var Ee=/\r/g,Ae=/[\x20\t\r\n\f]+/g;pt.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=pt.isFunction(t),this.each(function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,pt(this).val()):t,null==r?r="":"number"==typeof r?r+="":pt.isArray(r)&&(r=pt.map(r,function(t){return null==t?"":t+""})),e=pt.valHooks[this.type]||pt.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=pt.valHooks[r.type]||pt.valHooks[r.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(Ee,""):null==n?"":n)):void 0}}),pt.extend({valHooks:{option:{get:function(t){var e=pt.find.attr(t,"value");return null!=e?e:pt.trim(pt.text(t)).replace(Ae," ")}},select:{get:function(t){for(var e,n,i=t.options,r=t.selectedIndex,o="select-one"===t.type||0>r,s=o?null:[],a=o?r+1:i.length,c=0>r?a:o?r:0;a>c;c++)if(n=i[c],(n.selected||c===r)&&(dt.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!pt.nodeName(n.parentNode,"optgroup"))){if(e=pt(n).val(),o)return e;s.push(e)}return s},set:function(t,e){for(var n,i,r=t.options,o=pt.makeArray(e),s=r.length;s--;)if(i=r[s],pt.inArray(pt.valHooks.option.get(i),o)>-1)try{i.selected=n=!0}catch(t){i.scrollHeight}else i.selected=!1;return n||(t.selectedIndex=-1),r}}}}),pt.each(["radio","checkbox"],function(){pt.valHooks[this]={set:function(t,e){return pt.isArray(e)?t.checked=pt.inArray(pt(t).val(),e)>-1:void 0}},dt.checkOn||(pt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var je,Pe,Le=pt.expr.attrHandle,Ne=/^(?:checked|selected)$/i,De=dt.getSetAttribute,$e=dt.input;pt.fn.extend({attr:function(t,e){return It(this,pt.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){pt.removeAttr(this,t)})}}),pt.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?pt.prop(t,e,n):(1===o&&pt.isXMLDoc(t)||(e=e.toLowerCase(),r=pt.attrHooks[e]||(pt.expr.match.bool.test(e)?Pe:je)),void 0!==n?null===n?void pt.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=pt.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!dt.radioValue&&"radio"===e&&pt.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i,r=0,o=e&&e.match(Et);if(o&&1===t.nodeType)for(;n=o[r++];)i=pt.propFix[n]||n,pt.expr.match.bool.test(n)?$e&&De||!Ne.test(n)?t[i]=!1:t[pt.camelCase("default-"+n)]=t[i]=!1:pt.attr(t,n,""),t.removeAttribute(De?n:i)}}),Pe={set:function(t,e,n){return e===!1?pt.removeAttr(t,n):$e&&De||!Ne.test(n)?t.setAttribute(!De&&pt.propFix[n]||n,n):t[pt.camelCase("default-"+n)]=t[n]=!0,n}},pt.each(pt.expr.match.bool.source.match(/\w+/g),function(t,e){var n=Le[e]||pt.find.attr;$e&&De||!Ne.test(e)?Le[e]=function(t,e,i){var r,o;return i||(o=Le[e],Le[e]=r,r=null!=n(t,e,i)?e.toLowerCase():null,Le[e]=o),r}:Le[e]=function(t,e,n){return n?void 0:t[pt.camelCase("default-"+e)]?e.toLowerCase():null}}),$e&&De||(pt.attrHooks.value={set:function(t,e,n){return pt.nodeName(t,"input")?void(t.defaultValue=e):je&&je.set(t,e,n)}}),De||(je={set:function(t,e,n){var i=t.getAttributeNode(n);return i||t.setAttributeNode(i=t.ownerDocument.createAttribute(n)),i.value=e+="","value"===n||e===t.getAttribute(n)?e:void 0}},Le.id=Le.name=Le.coords=function(t,e,n){var i;return n?void 0:(i=t.getAttributeNode(e))&&""!==i.value?i.value:null},pt.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);return n&&n.specified?n.value:void 0},set:je.set},pt.attrHooks.contenteditable={set:function(t,e,n){je.set(t,""!==e&&e,n)}},pt.each(["width","height"],function(t,e){pt.attrHooks[e]={set:function(t,n){return""===n?(t.setAttribute(e,"auto"),n):void 0}}})),dt.style||(pt.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Oe=/^(?:input|select|textarea|button|object)$/i,We=/^(?:a|area)$/i;pt.fn.extend({prop:function(t,e){return It(this,pt.prop,t,e,arguments.length>1)},removeProp:function(t){return t=pt.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(t){}})}}),pt.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pt.isXMLDoc(t)||(e=pt.propFix[e]||e,r=pt.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=pt.find.attr(t,"tabindex");return e?parseInt(e,10):Oe.test(t.nodeName)||We.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),dt.hrefNormalized||pt.each(["href","src"],function(t,e){pt.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}}),dt.optSelected||(pt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),pt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pt.propFix[this.toLowerCase()]=this}),dt.enctype||(pt.propFix.enctype="encoding");var Ie=/[\t\r\n\f]/g;pt.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,c=0;if(pt.isFunction(t))return this.each(function(e){pt(this).addClass(t.call(this,e,q(this)))});if("string"==typeof t&&t)for(e=t.match(Et)||[];n=this[c++];)if(r=q(n),i=1===n.nodeType&&(" "+r+" ").replace(Ie," ")){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");a=pt.trim(i),r!==a&&pt.attr(n,"class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,c=0;if(pt.isFunction(t))return this.each(function(e){pt(this).removeClass(t.call(this,e,q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Et)||[];n=this[c++];)if(r=q(n),i=1===n.nodeType&&(" "+r+" ").replace(Ie," ")){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");a=pt.trim(i),r!==a&&pt.attr(n,"class",a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):pt.isFunction(t)?this.each(function(n){pt(this).toggleClass(t.call(this,n,q(this),e),e)}):this.each(function(){var e,i,r,o;if("string"===n)for(i=0,r=pt(this),o=t.match(Et)||[];e=o[i++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||(e=q(this),e&&pt._data(this,"__className__",e),pt.attr(this,"class",e||t===!1?"":pt._data(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+q(n)+" ").replace(Ie," ").indexOf(e)>-1)return!0;return!1}}),pt.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(t,e){pt.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),pt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}});var Re=t.location,He=pt.now(),Fe=/\?/,ze=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pt.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var n,i=null,r=pt.trim(e+"");return r&&!pt.trim(r.replace(ze,function(t,e,r,o){return n&&e&&(i=0),0===i?t:(n=r||e,i+=!o-!r,"")}))?Function("return "+r)():pt.error("Invalid JSON: "+e)},pt.parseXML=function(e){var n,i;if(!e||"string"!=typeof e)return null;try{t.DOMParser?(i=new t.DOMParser,n=i.parseFromString(e,"text/xml")):(n=new t.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(e))}catch(t){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pt.error("Invalid XML: "+e),n};var qe=/#.*$/,Xe=/([?&])_=[^&]*/,Ye=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ue=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Je=/^(?:GET|HEAD)$/,Ve=/^\/\//,Ge=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ke={},Qe={},Ze="*/".concat("*"),tn=Re.href,en=Ge.exec(tn.toLowerCase())||[];pt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tn,type:"GET",isLocal:Ue.test(en[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ze,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pt.parseJSON,"text xml":pt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?U(U(t,pt.ajaxSettings),e):U(pt.ajaxSettings,t)},ajaxPrefilter:X(Ke),ajaxTransport:X(Qe),ajax:function(e,n){function i(e,n,i,r){var o,d,y,b,w,S=n;2!==_&&(_=2,c&&t.clearTimeout(c),u=void 0,a=r||"",x.readyState=e>0?4:0,o=e>=200&&300>e||304===e,i&&(b=J(h,x,i)),b=V(h,b,x,o),o?(h.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(pt.lastModified[s]=w),w=x.getResponseHeader("etag"),w&&(pt.etag[s]=w)),204===e||"HEAD"===h.type?S="nocontent":304===e?S="notmodified":(S=b.state,d=b.data,y=b.error,o=!y)):(y=S,!e&&S||(S="error",0>e&&(e=0))),x.status=e,x.statusText=(n||S)+"",o?g.resolveWith(p,[d,S,x]):g.rejectWith(p,[x,S,y]),x.statusCode(v),v=void 0,l&&f.trigger(o?"ajaxSuccess":"ajaxError",[x,h,o?d:y]),m.fireWith(p,[x,S]),l&&(f.trigger("ajaxComplete",[x,h]),--pt.active||pt.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,o,s,a,c,l,u,d,h=pt.ajaxSetup({},n),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?pt(p):pt.event,g=pt.Deferred(),m=pt.Callbacks("once memory"),v=h.statusCode||{},y={},b={},_=0,w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===_){if(!d)for(d={};e=Ye.exec(a);)d[e[1].toLowerCase()]=e[2];e=d[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===_?a:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return _||(t=b[n]=b[n]||t,y[t]=e),this},overrideMimeType:function(t){return _||(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>_)for(e in t)v[e]=[v[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||w;return u&&u.abort(e),i(0,e),this}};if(g.promise(x).complete=m.add,x.success=x.done,x.error=x.fail,h.url=((e||h.url||tn)+"").replace(qe,"").replace(Ve,en[1]+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=pt.trim(h.dataType||"*").toLowerCase().match(Et)||[""],null==h.crossDomain&&(r=Ge.exec(h.url.toLowerCase()),h.crossDomain=!(!r||r[1]===en[1]&&r[2]===en[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(en[3]||("http:"===en[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=pt.param(h.data,h.traditional)),Y(Ke,h,n,x),2===_)return x;l=pt.event&&h.global,l&&0===pt.active++&&pt.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Je.test(h.type),s=h.url,h.hasContent||(h.data&&(s=h.url+=(Fe.test(s)?"&":"?")+h.data,delete h.data),h.cache===!1&&(h.url=Xe.test(s)?s.replace(Xe,"$1_="+He++):s+(Fe.test(s)?"&":"?")+"_="+He++)),h.ifModified&&(pt.lastModified[s]&&x.setRequestHeader("If-Modified-Since",pt.lastModified[s]),pt.etag[s]&&x.setRequestHeader("If-None-Match",pt.etag[s])),(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",h.contentType),x.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ze+"; q=0.01":""):h.accepts["*"]);for(o in h.headers)x.setRequestHeader(o,h.headers[o]);if(h.beforeSend&&(h.beforeSend.call(p,x,h)===!1||2===_))return x.abort();w="abort";for(o in{success:1,error:1,complete:1})x[o](h[o]);if(u=Y(Qe,h,n,x)){if(x.readyState=1,l&&f.trigger("ajaxSend",[x,h]),2===_)return x;h.async&&h.timeout>0&&(c=t.setTimeout(function(){x.abort("timeout")},h.timeout));try{_=1,u.send(y,i)}catch(t){if(!(2>_))throw t;i(-1,t)}}else i(-1,"No Transport");return x},getJSON:function(t,e,n){return pt.get(t,e,n,"json")},getScript:function(t,e){return pt.get(t,void 0,e,"script")}}),pt.each(["get","post"],function(t,e){pt[e]=function(t,n,i,r){return pt.isFunction(n)&&(r=r||i,i=n,n=void 0),pt.ajax(pt.extend({url:t,type:e,dataType:r,data:n,success:i},pt.isPlainObject(t)&&t))}}),pt._evalUrl=function(t){return pt.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pt.fn.extend({wrapAll:function(t){if(pt.isFunction(t))return this.each(function(e){pt(this).wrapAll(t.call(this,e))});if(this[0]){var e=pt(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return pt.isFunction(t)?this.each(function(e){pt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=pt(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=pt.isFunction(t);return this.each(function(n){pt(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){pt.nodeName(this,"body")||pt(this).replaceWith(this.childNodes)}).end()}}),pt.expr.filters.hidden=function(t){return dt.reliableHiddenOffsets()?t.offsetWidth<=0&&t.offsetHeight<=0&&!t.getClientRects().length:K(t)},pt.expr.filters.visible=function(t){return!pt.expr.filters.hidden(t)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,sn=/^(?:submit|button|image|reset|file)$/i,an=/^(?:input|select|textarea|keygen)/i;pt.param=function(t,e){var n,i=[],r=function(t,e){e=pt.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=pt.ajaxSettings&&pt.ajaxSettings.traditional),pt.isArray(t)||t.jquery&&!pt.isPlainObject(t))pt.each(t,function(){r(this.name,this.value)});else for(n in t)Q(n,t[n],e,r);return i.join("&").replace(nn,"+")},pt.fn.extend({serialize:function(){return pt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=pt.prop(this,"elements");return t?pt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!pt(this).is(":disabled")&&an.test(this.nodeName)&&!sn.test(t)&&(this.checked||!Rt.test(t))}).map(function(t,e){var n=pt(this).val();return null==n?null:pt.isArray(n)?pt.map(n,function(t){return{name:e.name,value:t.replace(on,"\r\n")}}):{name:e.name,value:n.replace(on,"\r\n")}}).get()}}),pt.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return this.isLocal?tt():it.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||tt()}:Z;var cn=0,ln={},un=pt.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in ln)ln[t](void 0,!0)}),dt.cors=!!un&&"withCredentials"in un,un=dt.ajax=!!un,un&&pt.ajaxTransport(function(e){if(!e.crossDomain||dt.cors){var n;return{send:function(i,r){var o,s=e.xhr(),a=++cn;if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)void 0!==i[o]&&s.setRequestHeader(o,i[o]+"");s.send(e.hasContent&&e.data||null),n=function(t,i){var o,c,l;if(n&&(i||4===s.readyState))if(delete ln[a],n=void 0,s.onreadystatechange=pt.noop,i)4!==s.readyState&&s.abort();else{l={},o=s.status,"string"==typeof s.responseText&&(l.text=s.responseText);try{c=s.statusText}catch(t){c=""}o||!e.isLocal||e.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&r(o,c,l,s.getAllResponseHeaders())},e.async?4===s.readyState?t.setTimeout(n):s.onreadystatechange=ln[a]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),pt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return pt.globalEval(t),t}}}),pt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),pt.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=it.head||pt("head")[0]||it.documentElement;return{send:function(i,r){e=it.createElement("script"),e.async=!0,t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,n){(n||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),e=null,n||r(200,"success"))},n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var dn=[],hn=/(=)\?(?=&|$)|\?\?/;pt.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=dn.pop()||pt.expando+"_"+He++;return this[t]=!0,t}}),pt.ajaxPrefilter("json jsonp",function(e,n,i){var r,o,s,a=e.jsonp!==!1&&(hn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&hn.test(e.data)&&"data");return a||"jsonp"===e.dataTypes[0]?(r=e.jsonpCallback=pt.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(hn,"$1"+r):e.jsonp!==!1&&(e.url+=(Fe.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return s||pt.error(r+" was not called"),s[0]},e.dataTypes[0]="json",o=t[r],t[r]=function(){s=arguments},i.always(function(){void 0===o?pt(t).removeProp(r):t[r]=o,e[r]&&(e.jsonpCallback=n.jsonpCallback,dn.push(r)),s&&pt.isFunction(o)&&o(s[0]),s=o=void 0}),"script"):void 0}),pt.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||it;var i=xt.exec(t),r=!n&&[];return i?[e.createElement(i[1])]:(i=v([t],e,r),r&&r.length&&pt(r).remove(),pt.merge([],i.childNodes))};var pn=pt.fn.load;pt.fn.load=function(t,e,n){if("string"!=typeof t&&pn)return pn.apply(this,arguments);var i,r,o,s=this,a=t.indexOf(" ");return a>-1&&(i=pt.trim(t.slice(a,t.length)),t=t.slice(0,a)),pt.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),s.length>0&&pt.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){o=arguments,s.html(i?pt("<div>").append(pt.parseHTML(t)).find(i):t)}).always(n&&function(t,e){s.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},pt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){pt.fn[e]=function(t){return this.on(e,t)}}),pt.expr.filters.animated=function(t){return pt.grep(pt.timers,function(e){return t===e.elem}).length},pt.offset={setOffset:function(t,e,n){var i,r,o,s,a,c,l,u=pt.css(t,"position"),d=pt(t),h={};"static"===u&&(t.style.position="relative"),a=d.offset(),o=pt.css(t,"top"),c=pt.css(t,"left"),l=("absolute"===u||"fixed"===u)&&pt.inArray("auto",[o,c])>-1,l?(i=d.position(),s=i.top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(c)||0),pt.isFunction(e)&&(e=e.call(t,n,pt.extend({},a))),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+r),"using"in e?e.using.call(t,h):d.css(h)}},pt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){pt.offset.setOffset(this,t,e)});var e,n,i={top:0,left:0},r=this[0],o=r&&r.ownerDocument;return o?(e=o.documentElement,pt.contains(e,r)?("undefined"!=typeof r.getBoundingClientRect&&(i=r.getBoundingClientRect()),n=et(o),{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var t,e,n={top:0,left:0},i=this[0];return"fixed"===pt.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),pt.nodeName(t[0],"html")||(n=t.offset()),n.top+=pt.css(t[0],"borderTopWidth",!0),n.left+=pt.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-pt.css(i,"marginTop",!0),left:e.left-n.left-pt.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&!pt.nodeName(t,"html")&&"static"===pt.css(t,"position");)t=t.offsetParent;return t||pe})}}),pt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);pt.fn[t]=function(i){return It(this,function(t,i,r){var o=et(t);return void 0===r?o?e in o?o[e]:o.document.documentElement[i]:t[i]:void(o?o.scrollTo(n?pt(o).scrollLeft():r,n?r:pt(o).scrollTop()):t[i]=r)},t,i,arguments.length,null)}}),pt.each(["top","left"],function(t,e){pt.cssHooks[e]=j(dt.pixelPosition,function(t,n){return n?(n=ge(t,e),de.test(n)?pt(t).position()[e]+"px":n):void 0})}),pt.each({Height:"height",Width:"width"},function(t,e){pt.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,i){pt.fn[i]=function(i,r){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||r===!0?"margin":"border");return It(this,function(e,n,i){var r;return pt.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===i?pt.css(e,n,s):pt.style(e,n,i,s)},e,o?i:void 0,o,null)}})}),pt.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),pt.fn.size=function(){return this.length},pt.fn.andSelf=pt.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return pt});var fn=t.jQuery,gn=t.$;return pt.noConflict=function(e){return t.$===pt&&(t.$=gn),e&&t.jQuery===pt&&(t.jQuery=fn),pt},e||(t.jQuery=t.$=pt),pt}),function(){$.extend({nextTick:function(t){return window.requestAnimationFrame(function(){return window.requestAnimationFrame(function(){return window.requestAnimationFrame(function(){return t()})})})}}),$.fn.extend({transitionEnd:function(t){return this.one("transitionend",t)},disableTransition:function(){return this.css("transition","none").css("transition")},enableTransition:function(t){return this.css("transition","all "+t+" ease-in-out").css("transition")},zindex:function(t){return this.css("z-index",t)},
|
|
translateX:function(t){return this.css("transform","translateX("+t+"px)")},translateY:function(t){return this.css("transform","translateY("+t+"px)")},translate:function(t,e){return this.css("transform","translate("+t+"px, "+e+"px)")},onScroll:function(t){var e;return e=!!MB.supportsPassive&&{passive:!0},this[0].removeEventListener("scroll",t,e),this[0].addEventListener("scroll",t,e)}})}.call(this),!function(t){"use strict";function e(t,e){var n=(65535&t)+(65535&e),i=(t>>16)+(e>>16)+(n>>16);return i<<16|65535&n}function n(t,e){return t<<e|t>>>32-e}function i(t,i,r,o,s,a){return e(n(e(e(i,t),e(o,a)),s),r)}function r(t,e,n,r,o,s,a){return i(e&n|~e&r,t,e,o,s,a)}function o(t,e,n,r,o,s,a){return i(e&r|n&~r,t,e,o,s,a)}function s(t,e,n,r,o,s,a){return i(e^n^r,t,e,o,s,a)}function a(t,e,n,r,o,s,a){return i(n^(e|~r),t,e,o,s,a)}function c(t,n){t[n>>5]|=128<<n%32,t[(n+64>>>9<<4)+14]=n;var i,c,l,u,d,h=1732584193,p=-271733879,f=-1732584194,g=271733878;for(i=0;i<t.length;i+=16)c=h,l=p,u=f,d=g,h=r(h,p,f,g,t[i],7,-680876936),g=r(g,h,p,f,t[i+1],12,-389564586),f=r(f,g,h,p,t[i+2],17,606105819),p=r(p,f,g,h,t[i+3],22,-1044525330),h=r(h,p,f,g,t[i+4],7,-176418897),g=r(g,h,p,f,t[i+5],12,1200080426),f=r(f,g,h,p,t[i+6],17,-1473231341),p=r(p,f,g,h,t[i+7],22,-45705983),h=r(h,p,f,g,t[i+8],7,1770035416),g=r(g,h,p,f,t[i+9],12,-1958414417),f=r(f,g,h,p,t[i+10],17,-42063),p=r(p,f,g,h,t[i+11],22,-1990404162),h=r(h,p,f,g,t[i+12],7,1804603682),g=r(g,h,p,f,t[i+13],12,-40341101),f=r(f,g,h,p,t[i+14],17,-1502002290),p=r(p,f,g,h,t[i+15],22,1236535329),h=o(h,p,f,g,t[i+1],5,-165796510),g=o(g,h,p,f,t[i+6],9,-1069501632),f=o(f,g,h,p,t[i+11],14,643717713),p=o(p,f,g,h,t[i],20,-373897302),h=o(h,p,f,g,t[i+5],5,-701558691),g=o(g,h,p,f,t[i+10],9,38016083),f=o(f,g,h,p,t[i+15],14,-660478335),p=o(p,f,g,h,t[i+4],20,-405537848),h=o(h,p,f,g,t[i+9],5,568446438),g=o(g,h,p,f,t[i+14],9,-1019803690),f=o(f,g,h,p,t[i+3],14,-187363961),p=o(p,f,g,h,t[i+8],20,1163531501),h=o(h,p,f,g,t[i+13],5,-1444681467),g=o(g,h,p,f,t[i+2],9,-51403784),f=o(f,g,h,p,t[i+7],14,1735328473),p=o(p,f,g,h,t[i+12],20,-1926607734),h=s(h,p,f,g,t[i+5],4,-378558),g=s(g,h,p,f,t[i+8],11,-2022574463),f=s(f,g,h,p,t[i+11],16,1839030562),p=s(p,f,g,h,t[i+14],23,-35309556),h=s(h,p,f,g,t[i+1],4,-1530992060),g=s(g,h,p,f,t[i+4],11,1272893353),f=s(f,g,h,p,t[i+7],16,-155497632),p=s(p,f,g,h,t[i+10],23,-1094730640),h=s(h,p,f,g,t[i+13],4,681279174),g=s(g,h,p,f,t[i],11,-358537222),f=s(f,g,h,p,t[i+3],16,-722521979),p=s(p,f,g,h,t[i+6],23,76029189),h=s(h,p,f,g,t[i+9],4,-640364487),g=s(g,h,p,f,t[i+12],11,-421815835),f=s(f,g,h,p,t[i+15],16,530742520),p=s(p,f,g,h,t[i+2],23,-995338651),h=a(h,p,f,g,t[i],6,-198630844),g=a(g,h,p,f,t[i+7],10,1126891415),f=a(f,g,h,p,t[i+14],15,-1416354905),p=a(p,f,g,h,t[i+5],21,-57434055),h=a(h,p,f,g,t[i+12],6,1700485571),g=a(g,h,p,f,t[i+3],10,-1894986606),f=a(f,g,h,p,t[i+10],15,-1051523),p=a(p,f,g,h,t[i+1],21,-2054922799),h=a(h,p,f,g,t[i+8],6,1873313359),g=a(g,h,p,f,t[i+15],10,-30611744),f=a(f,g,h,p,t[i+6],15,-1560198380),p=a(p,f,g,h,t[i+13],21,1309151649),h=a(h,p,f,g,t[i+4],6,-145523070),g=a(g,h,p,f,t[i+11],10,-1120210379),f=a(f,g,h,p,t[i+2],15,718787259),p=a(p,f,g,h,t[i+9],21,-343485551),h=e(h,c),p=e(p,l),f=e(f,u),g=e(g,d);return[h,p,f,g]}function l(t){var e,n="";for(e=0;e<32*t.length;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function u(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;for(e=0;e<8*t.length;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function d(t){return l(c(u(t),8*t.length))}function h(t,e){var n,i,r=u(t),o=[],s=[];for(o[15]=s[15]=void 0,r.length>16&&(r=c(r,8*t.length)),n=0;16>n;n+=1)o[n]=909522486^r[n],s[n]=1549556828^r[n];return i=c(o.concat(u(e)),512+8*e.length),l(c(s.concat(i),640))}function p(t){var e,n,i="0123456789abcdef",r="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),r+=i.charAt(e>>>4&15)+i.charAt(15&e);return r}function f(t){return unescape(encodeURIComponent(t))}function g(t){return d(f(t))}function m(t){return p(g(t))}function v(t,e){return h(f(t),f(e))}function y(t,e){return p(v(t,e))}function b(t,e,n){return e?n?v(e,t):y(e,t):n?g(t):m(t)}"function"==typeof define&&define.amd?define(function(){return b}):t.md5=b}(this),function(t){t.fn.qrcode=function(e){function n(t){this.mode=a,this.data=t}function i(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function r(t,e){if(void 0==t.length)throw Error(t.length+"/"+e);for(var n=0;n<t.length&&0==t[n];)n++;this.num=Array(t.length-n+e);for(var i=0;i<t.length-n;i++)this.num[i]=t[i+n]}function o(t,e){this.totalCount=t,this.dataCount=e}function s(){this.buffer=[],this.length=0}var a;n.prototype={getLength:function(){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}},i.prototype={addData:function(t){this.dataList.push(new n(t)),this.dataCache=null},isDark:function(t,e){if(0>t||this.moduleCount<=t||0>e||this.moduleCount<=e)throw Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var t=1,t=1;40>t;t++){for(var e=o.getRSBlocks(t,this.errorCorrectLevel),n=new s,i=0,r=0;r<e.length;r++)i+=e[r].dataCount;for(r=0;r<this.dataList.length;r++)e=this.dataList[r],n.put(e.mode,4),n.put(e.getLength(),c.getLengthInBits(e.mode,t)),e.write(n);if(n.getLengthInBits()<=8*i)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),7<=this.typeNumber&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=i.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;7>=n;n++)if(!(-1>=t+n||this.moduleCount<=t+n))for(var i=-1;7>=i;i++)-1>=e+i||this.moduleCount<=e+i||(this.modules[t+n][e+i]=0<=n&&6>=n&&(0==i||6==i)||0<=i&&6>=i&&(0==n||6==n)||2<=n&&4>=n&&2<=i&&4>=i)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;8>n;n++){this.makeImpl(!0,n);var i=c.getLostPoint(this);(0==n||t>i)&&(t=i,e=n)}return e},createMovieClip:function(t,e,n){for(t=t.createEmptyMovieClip(e,n),this.make(),e=0;e<this.modules.length;e++)for(var n=1*e,i=0;i<this.modules[e].length;i++){var r=1*i;this.modules[e][i]&&(t.beginFill(0,100),t.moveTo(r,n),t.lineTo(r+1,n),t.lineTo(r+1,n+1),t.lineTo(r,n+1),t.endFill())}return t},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=0==t%2);for(t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=0==t%2)},setupPositionAdjustPattern:function(){for(var t=c.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var i=t[e],r=t[n];if(null==this.modules[i][r])for(var o=-2;2>=o;o++)for(var s=-2;2>=s;s++)this.modules[i+o][r+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(t){for(var e=c.getBCHTypeNumber(this.typeNumber),n=0;18>n;n++){var i=!t&&1==(e>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;18>n;n++)i=!t&&1==(e>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i},setupTypeInfo:function(t,e){for(var n=c.getBCHTypeInfo(this.errorCorrectLevel<<3|e),i=0;15>i;i++){var r=!t&&1==(n>>i&1);6>i?this.modules[i][8]=r:8>i?this.modules[i+1][8]=r:this.modules[this.moduleCount-15+i][8]=r}for(i=0;15>i;i++)r=!t&&1==(n>>i&1),8>i?this.modules[8][this.moduleCount-i-1]=r:9>i?this.modules[8][15-i-1+1]=r:this.modules[8][15-i-1]=r;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;0<s;s-=2)for(6==s&&s--;;){for(var a=0;2>a;a++)if(null==this.modules[i][s-a]){var l=!1;o<t.length&&(l=1==(t[o]>>>r&1)),c.getMask(e,i,s-a)&&(l=!l),this.modules[i][s-a]=l,r--,-1==r&&(o++,r=7)}if(i+=n,0>i||this.moduleCount<=i){i-=n,n=-n;break}}}},i.PAD0=236,i.PAD1=17,i.createData=function(t,e,n){for(var e=o.getRSBlocks(t,e),r=new s,a=0;a<n.length;a++){var l=n[a];r.put(l.mode,4),r.put(l.getLength(),c.getLengthInBits(l.mode,t)),l.write(r)}for(a=t=0;a<e.length;a++)t+=e[a].dataCount;if(r.getLengthInBits()>8*t)throw Error("code length overflow. ("+r.getLengthInBits()+">"+8*t+")");for(r.getLengthInBits()+4<=8*t&&r.put(0,4);0!=r.getLengthInBits()%8;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*t)&&(r.put(i.PAD0,8),!(r.getLengthInBits()>=8*t));)r.put(i.PAD1,8);return i.createBytes(r,e)},i.createBytes=function(t,e){for(var n=0,i=0,o=0,s=Array(e.length),a=Array(e.length),l=0;l<e.length;l++){var u=e[l].dataCount,d=e[l].totalCount-u,i=Math.max(i,u),o=Math.max(o,d);s[l]=Array(u);for(var h=0;h<s[l].length;h++)s[l][h]=255&t.buffer[h+n];for(n+=u,h=c.getErrorCorrectPolynomial(d),u=new r(s[l],h.getLength()-1).mod(h),a[l]=Array(h.getLength()-1),h=0;h<a[l].length;h++)d=h+u.getLength()-a[l].length,a[l][h]=0<=d?u.get(d):0}for(h=l=0;h<e.length;h++)l+=e[h].totalCount;for(n=Array(l),h=u=0;h<i;h++)for(l=0;l<e.length;l++)h<s[l].length&&(n[u++]=s[l][h]);for(h=0;h<o;h++)for(l=0;l<e.length;l++)h<a[l].length&&(n[u++]=a[l][h]);return n},a=4;for(var c={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;0<=c.getBCHDigit(e)-c.getBCHDigit(c.G15);)e^=c.G15<<c.getBCHDigit(e)-c.getBCHDigit(c.G15);return(t<<10|e)^c.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;0<=c.getBCHDigit(e)-c.getBCHDigit(c.G18);)e^=c.G18<<c.getBCHDigit(e)-c.getBCHDigit(c.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return c.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case 0:return 0==(e+n)%2;case 1:return 0==e%2;case 2:return 0==n%3;case 3:return 0==(e+n)%3;case 4:return 0==(Math.floor(e/2)+Math.floor(n/3))%2;case 5:return 0==e*n%2+e*n%3;case 6:return 0==(e*n%2+e*n%3)%2;case 7:return 0==(e*n%3+(e+n)%2)%2;default:throw Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new r([1],0),n=0;n<t;n++)e=e.multiply(new r([1,l.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&10>e)switch(t){case 1:return 10;case 2:return 9;case a:return 8;case 8:return 8;default:throw Error("mode:"+t)}else if(27>e)switch(t){case 1:return 12;case 2:return 11;case a:return 16;case 8:return 10;default:throw Error("mode:"+t)}else{if(!(41>e))throw Error("type:"+e);switch(t){case 1:return 14;case 2:return 13;case a:return 16;case 8:return 12;default:throw Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,i=0;i<e;i++)for(var r=0;r<e;r++){for(var o=0,s=t.isDark(i,r),a=-1;1>=a;a++)if(!(0>i+a||e<=i+a))for(var c=-1;1>=c;c++)0>r+c||e<=r+c||0==a&&0==c||s==t.isDark(i+a,r+c)&&o++;5<o&&(n+=3+o-5)}for(i=0;i<e-1;i++)for(r=0;r<e-1;r++)o=0,t.isDark(i,r)&&o++,t.isDark(i+1,r)&&o++,t.isDark(i,r+1)&&o++,t.isDark(i+1,r+1)&&o++,(0==o||4==o)&&(n+=3);for(i=0;i<e;i++)for(r=0;r<e-6;r++)t.isDark(i,r)&&!t.isDark(i,r+1)&&t.isDark(i,r+2)&&t.isDark(i,r+3)&&t.isDark(i,r+4)&&!t.isDark(i,r+5)&&t.isDark(i,r+6)&&(n+=40);for(r=0;r<e;r++)for(i=0;i<e-6;i++)t.isDark(i,r)&&!t.isDark(i+1,r)&&t.isDark(i+2,r)&&t.isDark(i+3,r)&&t.isDark(i+4,r)&&!t.isDark(i+5,r)&&t.isDark(i+6,r)&&(n+=40);for(r=o=0;r<e;r++)for(i=0;i<e;i++)t.isDark(i,r)&&o++;return t=Math.abs(100*o/e/e-50)/5,n+10*t}},l={glog:function(t){if(1>t)throw Error("glog("+t+")");return l.LOG_TABLE[t]},gexp:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return l.EXP_TABLE[t]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},u=0;8>u;u++)l.EXP_TABLE[u]=1<<u;for(u=8;256>u;u++)l.EXP_TABLE[u]=l.EXP_TABLE[u-4]^l.EXP_TABLE[u-5]^l.EXP_TABLE[u-6]^l.EXP_TABLE[u-8];for(u=0;255>u;u++)l.LOG_TABLE[l.EXP_TABLE[u]]=u;return r.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var i=0;i<t.getLength();i++)e[n+i]^=l.gexp(l.glog(this.get(n))+l.glog(t.get(i)));return new r(e,0)},mod:function(t){if(0>this.getLength()-t.getLength())return this;for(var e=l.glog(this.get(0))-l.glog(t.get(0)),n=Array(this.getLength()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(i=0;i<t.getLength();i++)n[i]^=l.gexp(l.glog(t.get(i))+e);return new r(n,0).mod(t)}},o.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],o.getRSBlocks=function(t,e){var n=o.getRsBlockTable(t,e);if(void 0==n)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var i=n.length/3,r=[],s=0;s<i;s++)for(var a=n[3*s+0],c=n[3*s+1],l=n[3*s+2],u=0;u<a;u++)r.push(new o(c,l));return r},o.getRsBlockTable=function(t,e){switch(e){case 1:return o.RS_BLOCK_TABLE[4*(t-1)+0];case 0:return o.RS_BLOCK_TABLE[4*(t-1)+1];case 3:return o.RS_BLOCK_TABLE[4*(t-1)+2];case 2:return o.RS_BLOCK_TABLE[4*(t-1)+3]}},s.prototype={get:function(t){return 1==(this.buffer[Math.floor(t/8)]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},"string"==typeof e&&(e={text:e}),e=t.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:2,background:"#ffffff",foreground:"#000000"},e),this.each(function(){var n;if("canvas"==e.render){n=new i(e.typeNumber,e.correctLevel),n.addData(e.text),n.make();var r=document.createElement("canvas");r.width=e.width,r.height=e.height;for(var o=r.getContext("2d"),s=e.width/n.getModuleCount(),a=e.height/n.getModuleCount(),c=0;c<n.getModuleCount();c++)for(var l=0;l<n.getModuleCount();l++){o.fillStyle=n.isDark(c,l)?e.foreground:e.background;var u=Math.ceil((l+1)*s)-Math.floor(l*s),d=Math.ceil((c+1)*s)-Math.floor(c*s);o.fillRect(Math.round(l*s),Math.round(c*a),u,d)}}else for(n=new i(e.typeNumber,e.correctLevel),n.addData(e.text),n.make(),r=t("<table></table>").css("width",e.width+"px").css("height",e.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",e.background),o=e.width/n.getModuleCount(),s=e.height/n.getModuleCount(),a=0;a<n.getModuleCount();a++)for(c=t("<tr></tr>").css("height",s+"px").appendTo(r),l=0;l<n.getModuleCount();l++)t("<td></td>").css("width",o+"px").css("background-color",n.isDark(a,l)?e.foreground:e.background).appendTo(c);n=r,jQuery(n).appendTo(this)})}}(jQuery),function(){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");Math.uuid=function(e,n){var i,r=t,o=[];if(n=n||r.length,e)for(i=0;i<e;i++)o[i]=r[0|Math.random()*n];else{var s;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",i=0;i<36;i++)o[i]||(s=0|16*Math.random(),o[i]=r[19==i?3&s|8:s])}return o.join("")},Math.uuidFast=function(){for(var e,n=t,i=new Array(36),r=0,o=0;o<36;o++)8==o||13==o||18==o||23==o?i[o]="-":14==o?i[o]="4":(r<=2&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,i[o]=n[19==o?3&e|8:e]);return i.join("")},Math.uuidCompact=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"==t?e:3&e|8;return n.toString(16)})}}(),$(function(){jQuery.timeago.settings.strings["zh-CN"]={prefixAgo:null,prefixFromNow:"\u4ece\u73b0\u5728\u5f00\u59cb",suffixAgo:"\u4e4b\u524d",suffixFromNow:null,seconds:"\u4e0d\u5230 1 \u5206\u949f",minute:"\u5927\u7ea6 1 \u5206\u949f",minutes:"%d \u5206\u949f",hour:"\u5927\u7ea6 1 \u5c0f\u65f6",hours:"\u5927\u7ea6 %d \u5c0f\u65f6",day:"1 \u5929",days:"%d \u5929",month:"\u5927\u7ea6 1 \u4e2a\u6708",months:"%d \u6708",year:"\u5927\u7ea6 1 \u5e74",years:"%d \u5e74",numbers:[],wordSeparator:""}}),function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return r(n?n:t)},u,u.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e){"use strict";function n(t){t.fn.perfectScrollbar=function(t){return this.each(function(){if("object"==typeof t||"undefined"==typeof t){var e=t;r.get(this)||i.initialize(this,e)}else{var n=t;"update"===n?i.update(this):"destroy"===n&&i.destroy(this)}})}}var i=t("../main"),r=t("../plugin/instances");if("function"==typeof define&&define.amd)define(["jquery"],n);else{var o=window.jQuery?window.jQuery:window.$;"undefined"!=typeof o&&n(o)}e.exports=n},{"../main":7,"../plugin/instances":18}],2:[function(t,e,n){"use strict";function i(t,e){var n=t.className.split(" ");n.indexOf(e)<0&&n.push(e),t.className=n.join(" ")}function r(t,e){var n=t.className.split(" "),i=n.indexOf(e);i>=0&&n.splice(i,1),t.className=n.join(" ")}n.add=function(t,e){t.classList?t.classList.add(e):i(t,e)},n.remove=function(t,e){t.classList?t.classList.remove(e):r(t,e)},n.list=function(t){return t.classList?Array.prototype.slice.apply(t.classList):t.className.split(" ")}},{}],3:[function(t,e){"use strict";function n(t,e){return window.getComputedStyle(t)[e]}function i(t,e,n){return"number"==typeof n&&(n=n.toString()+"px"),t.style[e]=n,t}function r(t,e){for(var n in e){var i=e[n];"number"==typeof i&&(i=i.toString()+"px"),t.style[n]=i}return t}var o={};o.e=function(t,e){var n=document.createElement(t);return n.className=e,n},o.appendTo=function(t,e){return e.appendChild(t),t},o.css=function(t,e,o){return"object"==typeof e?r(t,e):"undefined"==typeof o?n(t,e):i(t,e,o)},o.matches=function(t,e){return"undefined"!=typeof t.matches?t.matches(e):"undefined"!=typeof t.matchesSelector?t.matchesSelector(e):"undefined"!=typeof t.webkitMatchesSelector?t.webkitMatchesSelector(e):"undefined"!=typeof t.mozMatchesSelector?t.mozMatchesSelector(e):"undefined"!=typeof t.msMatchesSelector?t.msMatchesSelector(e):void 0},o.remove=function(t){"undefined"!=typeof t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)},o.queryChildren=function(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return o.matches(t,e)})},e.exports=o},{}],4:[function(t,e){"use strict";var n=function(t){this.element=t,this.events={}};n.prototype.bind=function(t,e){"undefined"==typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e),this.element.addEventListener(t,e,!1)},n.prototype.unbind=function(t,e){var n="undefined"!=typeof e;this.events[t]=this.events[t].filter(function(i){return!(!n||i===e)||(this.element.removeEventListener(t,i,!1),!1)},this)},n.prototype.unbindAll=function(){for(var t in this.events)this.unbind(t)};var i=function(){this.eventElements=[]};i.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return"undefined"==typeof e&&(e=new n(t),this.eventElements.push(e)),e},i.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},i.prototype.unbind=function(t,e,n){this.eventElement(t).unbind(e,n)},i.prototype.unbindAll=function(){for(var t=0;t<this.eventElements.length;t++)this.eventElements[t].unbindAll()},i.prototype.once=function(t,e,n){var i=this.eventElement(t),r=function(t){i.unbind(e,r),n(t)};i.bind(e,r)},e.exports=i},{}],5:[function(t,e){"use strict";e.exports=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}()},{}],6:[function(t,e,n){"use strict";var i=t("./class"),r=t("./dom"),o=n.toInt=function(t){return parseInt(t,10)||0},s=n.clone=function(t){if(null===t)return null;if(t.constructor===Array)return t.map(s);if("object"==typeof t){var e={};for(var n in t)e[n]=s(t[n]);return e}return t};n.extend=function(t,e){var n=s(t);for(var i in e)n[i]=s(e[i]);return n},n.isEditable=function(t){return r.matches(t,"input,[contenteditable]")||r.matches(t,"select,[contenteditable]")||r.matches(t,"textarea,[contenteditable]")||r.matches(t,"button,[contenteditable]")},n.removePsClasses=function(t){for(var e=i.list(t),n=0;n<e.length;n++){var r=e[n];0===r.indexOf("ps-")&&i.remove(t,r)}},n.outerWidth=function(t){return o(r.css(t,"width"))+o(r.css(t,"paddingLeft"))+o(r.css(t,"paddingRight"))+o(r.css(t,"borderLeftWidth"))+o(r.css(t,"borderRightWidth"))},n.startScrolling=function(t,e){i.add(t,"ps-in-scrolling"),"undefined"!=typeof e?i.add(t,"ps-"+e):(i.add(t,"ps-x"),i.add(t,"ps-y"))},n.stopScrolling=function(t,e){i.remove(t,"ps-in-scrolling"),"undefined"!=typeof e?i.remove(t,"ps-"+e):(i.remove(t,"ps-x"),i.remove(t,"ps-y"))},n.env={isWebKit:"WebkitAppearance"in document.documentElement.style,supportsTouch:"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,supportsIePointer:null!==window.navigator.msMaxTouchPoints}},{"./class":2,"./dom":3}],7:[function(t,e){"use strict";var n=t("./plugin/destroy"),i=t("./plugin/initialize"),r=t("./plugin/update");e.exports={initialize:i,update:r,destroy:n}},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(t,e){"use strict";e.exports={handlers:["click-rail","drag-scrollbar","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollXMarginOffset:0,scrollYMarginOffset:0,stopPropagationOnClick:!0,suppressScrollX:!1,suppressScrollY:!1,swipePropagation:!0,useBothWheelAxes:!1,wheelPropagation:!1,wheelSpeed:1,theme:"default"}},{}],9:[function(t,e){"use strict";var n=t("../lib/helper"),i=t("../lib/dom"),r=t("./instances");e.exports=function(t){var e=r.get(t);e&&(e.event.unbindAll(),i.remove(e.scrollbarX),i.remove(e.scrollbarY),i.remove(e.scrollbarXRail),i.remove(e.scrollbarYRail),n.removePsClasses(t),r.remove(t))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(t,e){"use strict";function n(t,e){function n(t){return t.getBoundingClientRect()}var r=function(t){t.stopPropagation()};e.settings.stopPropagationOnClick&&e.event.bind(e.scrollbarY,"click",r),e.event.bind(e.scrollbarYRail,"click",function(r){var a=i.toInt(e.scrollbarYHeight/2),c=e.railYRatio*(r.pageY-window.pageYOffset-n(e.scrollbarYRail).top-a),l=e.railYRatio*(e.railYHeight-e.scrollbarYHeight),u=c/l;u<0?u=0:u>1&&(u=1),s(t,"top",(e.contentHeight-e.containerHeight)*u),o(t),r.stopPropagation()}),e.settings.stopPropagationOnClick&&e.event.bind(e.scrollbarX,"click",r),e.event.bind(e.scrollbarXRail,"click",function(r){var a=i.toInt(e.scrollbarXWidth/2),c=e.railXRatio*(r.pageX-window.pageXOffset-n(e.scrollbarXRail).left-a),l=e.railXRatio*(e.railXWidth-e.scrollbarXWidth),u=c/l;u<0?u=0:u>1&&(u=1),s(t,"left",(e.contentWidth-e.containerWidth)*u-e.negativeScrollAdjustment),o(t),r.stopPropagation()})}var i=t("../../lib/helper"),r=t("../instances"),o=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=r.get(t);n(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(t,e){"use strict";function n(t,e){function n(n){var o=i+n*e.railXRatio,s=Math.max(0,e.scrollbarXRail.getBoundingClientRect().left)+e.railXRatio*(e.railXWidth-e.scrollbarXWidth);o<0?e.scrollbarXLeft=0:o>s?e.scrollbarXLeft=s:e.scrollbarXLeft=o;var a=r.toInt(e.scrollbarXLeft*(e.contentWidth-e.containerWidth)/(e.containerWidth-e.railXRatio*e.scrollbarXWidth))-e.negativeScrollAdjustment;c(t,"left",a)}var i=null,s=null,l=function(e){n(e.pageX-s),a(t),e.stopPropagation(),e.preventDefault()},u=function(){r.stopScrolling(t,"x"),e.event.unbind(e.ownerDocument,"mousemove",l)};e.event.bind(e.scrollbarX,"mousedown",function(n){s=n.pageX,i=r.toInt(o.css(e.scrollbarX,"left"))*e.railXRatio,r.startScrolling(t,"x"),e.event.bind(e.ownerDocument,"mousemove",l),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}function i(t,e){function n(n){var o=i+n*e.railYRatio,s=Math.max(0,e.scrollbarYRail.getBoundingClientRect().top)+e.railYRatio*(e.railYHeight-e.scrollbarYHeight);o<0?e.scrollbarYTop=0:o>s?e.scrollbarYTop=s:e.scrollbarYTop=o;var a=r.toInt(e.scrollbarYTop*(e.contentHeight-e.containerHeight)/(e.containerHeight-e.railYRatio*e.scrollbarYHeight));c(t,"top",a)}var i=null,s=null,l=function(e){n(e.pageY-s),a(t),e.stopPropagation(),e.preventDefault()},u=function(){r.stopScrolling(t,"y"),e.event.unbind(e.ownerDocument,"mousemove",l)};e.event.bind(e.scrollbarY,"mousedown",function(n){s=n.pageY,i=r.toInt(o.css(e.scrollbarY,"top"))*e.railYRatio,r.startScrolling(t,"y"),e.event.bind(e.ownerDocument,"mousemove",l),e.event.once(e.ownerDocument,"mouseup",u),n.stopPropagation(),n.preventDefault()})}var r=t("../../lib/helper"),o=t("../../lib/dom"),s=t("../instances"),a=t("../update-geometry"),c=t("../update-scroll");e.exports=function(t){var e=s.get(t);n(t,e),i(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(t,e){"use strict";function n(t,e){function n(n,i){var r=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===r&&i>0||r>=e.contentHeight-e.containerHeight&&i<0)return!e.settings.wheelPropagation}var o=t.scrollLeft;if(0===i){if(!e.scrollbarXActive)return!1;if(0===o&&n<0||o>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}var o=!1;e.event.bind(t,"mouseenter",function(){o=!0}),e.event.bind(t,"mouseleave",function(){o=!1});var c=!1;e.event.bind(e.ownerDocument,"keydown",function(l){if(!l.isDefaultPrevented||!l.isDefaultPrevented()){var u=r.matches(e.scrollbarX,":focus")||r.matches(e.scrollbarY,":focus");if(o||u){var d=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(d){if("IFRAME"===d.tagName)d=d.contentDocument.activeElement;else for(;d.shadowRoot;)d=d.shadowRoot.activeElement;if(i.isEditable(d))return}var h=0,p=0;switch(l.which){case 37:h=-30;break;case 38:p=30;break;case 39:h=30;break;case 40:p=-30;break;case 33:p=90;break;case 32:p=l.shiftKey?90:-90;break;case 34:p=-90;break;case 35:p=l.ctrlKey?-e.contentHeight:-e.containerHeight;break;case 36:p=l.ctrlKey?t.scrollTop:e.containerHeight;break;default:return}a(t,"top",t.scrollTop-p),a(t,"left",t.scrollLeft+h),s(t),c=n(h,p),c&&l.preventDefault()}}})}var i=t("../../lib/helper"),r=t("../../lib/dom"),o=t("../instances"),s=t("../update-geometry"),a=t("../update-scroll");e.exports=function(t){var e=o.get(t);n(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(t,e){"use strict";function n(t,e){function n(n,i){var r=t.scrollTop;if(0===n){if(!e.scrollbarYActive)return!1;if(0===r&&i>0||r>=e.contentHeight-e.containerHeight&&i<0)return!e.settings.wheelPropagation}var o=t.scrollLeft;if(0===i){if(!e.scrollbarXActive)return!1;if(0===o&&n<0||o>=e.contentWidth-e.containerWidth&&n>0)return!e.settings.wheelPropagation}return!0}function i(t){var e=t.deltaX,n=-1*t.deltaY;return"undefined"!=typeof e&&"undefined"!=typeof n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!==e&&n!==n&&(e=0,n=t.wheelDelta),[e,n]}function s(e,n){var i=t.querySelector("textarea:hover, .ps-child:hover");if(i){if("TEXTAREA"!==i.tagName&&!window.getComputedStyle(i).overflow.match(/(scroll|auto)/))return!1;var r=i.scrollHeight-i.clientHeight;if(r>0&&!(0===i.scrollTop&&n>0||i.scrollTop===r&&n<0))return!0;var o=i.scrollLeft-i.clientWidth;if(o>0&&!(0===i.scrollLeft&&e<0||i.scrollLeft===o&&e>0))return!0}return!1}function a(a){var l=i(a),u=l[0],d=l[1];s(u,d)||(c=!1,e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(d?o(t,"top",t.scrollTop-d*e.settings.wheelSpeed):o(t,"top",t.scrollTop+u*e.settings.wheelSpeed),c=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(u?o(t,"left",t.scrollLeft+u*e.settings.wheelSpeed):o(t,"left",t.scrollLeft-d*e.settings.wheelSpeed),c=!0):(o(t,"top",t.scrollTop-d*e.settings.wheelSpeed),o(t,"left",t.scrollLeft+u*e.settings.wheelSpeed)),r(t),c=c||n(u,d),c&&(a.stopPropagation(),a.preventDefault()))}var c=!1;"undefined"!=typeof window.onwheel?e.event.bind(t,"wheel",a):"undefined"!=typeof window.onmousewheel&&e.event.bind(t,"mousewheel",a)}var i=t("../instances"),r=t("../update-geometry"),o=t("../update-scroll");e.exports=function(t){var e=i.get(t);n(t,e)}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(t,e){"use strict";function n(t,e){e.event.bind(t,"scroll",function(){r(t)})}var i=t("../instances"),r=t("../update-geometry");e.exports=function(t){var e=i.get(t);n(t,e)}},{"../instances":18,"../update-geometry":19}],15:[function(t,e){"use strict";function n(t,e){function n(){var t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===t.toString().length?null:t.getRangeAt(0).commonAncestorContainer}function a(){l||(l=setInterval(function(){return r.get(t)?(s(t,"top",t.scrollTop+u.top),s(t,"left",t.scrollLeft+u.left),void o(t)):void clearInterval(l)},50))}function c(){l&&(clearInterval(l),l=null),i.stopScrolling(t)}var l=null,u={top:0,left:0},d=!1;e.event.bind(e.ownerDocument,"selectionchange",function(){t.contains(n())?d=!0:(d=!1,c())}),e.event.bind(window,"mouseup",function(){d&&(d=!1,c())}),e.event.bind(window,"mousemove",function(e){
|
|
if(d){var n={x:e.pageX,y:e.pageY},r={left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight};n.x<r.left+3?(u.left=-5,i.startScrolling(t,"x")):n.x>r.right-3?(u.left=5,i.startScrolling(t,"x")):u.left=0,n.y<r.top+3?(r.top+3-n.y<5?u.top=-5:u.top=-20,i.startScrolling(t,"y")):n.y>r.bottom-3?(n.y-r.bottom+3<5?u.top=5:u.top=20,i.startScrolling(t,"y")):u.top=0,0===u.top&&0===u.left?c():a()}})}var i=t("../../lib/helper"),r=t("../instances"),o=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){var e=r.get(t);n(t,e)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(t,e){"use strict";function n(t,e,n,i){function a(n,i){var r=t.scrollTop,o=t.scrollLeft,s=Math.abs(n),a=Math.abs(i);if(a>s){if(i<0&&r===e.contentHeight-e.containerHeight||i>0&&0===r)return!e.settings.swipePropagation}else if(s>a&&(n<0&&o===e.contentWidth-e.containerWidth||n>0&&0===o))return!e.settings.swipePropagation;return!0}function c(e,n){s(t,"top",t.scrollTop-n),s(t,"left",t.scrollLeft-e),o(t)}function l(){_=!0}function u(){_=!1}function d(t){return t.targetTouches?t.targetTouches[0]:t}function h(t){return!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)}function p(t){if(h(t)){w=!0;var e=d(t);m.pageX=e.pageX,m.pageY=e.pageY,v=(new Date).getTime(),null!==b&&clearInterval(b),t.stopPropagation()}}function f(t){if(!w&&e.settings.swipePropagation&&p(t),!_&&w&&h(t)){var n=d(t),i={pageX:n.pageX,pageY:n.pageY},r=i.pageX-m.pageX,o=i.pageY-m.pageY;c(r,o),m=i;var s=(new Date).getTime(),l=s-v;l>0&&(y.x=r/l,y.y=o/l,v=s),a(r,o)&&(t.stopPropagation(),t.preventDefault())}}function g(){!_&&w&&(w=!1,clearInterval(b),b=setInterval(function(){return r.get(t)?Math.abs(y.x)<.01&&Math.abs(y.y)<.01?void clearInterval(b):(c(30*y.x,30*y.y),y.x*=.8,void(y.y*=.8)):void clearInterval(b)},10))}var m={},v=0,y={},b=null,_=!1,w=!1;n&&(e.event.bind(window,"touchstart",l),e.event.bind(window,"touchend",u),e.event.bind(t,"touchstart",p),e.event.bind(t,"touchmove",f),e.event.bind(t,"touchend",g)),i&&(window.PointerEvent?(e.event.bind(window,"pointerdown",l),e.event.bind(window,"pointerup",u),e.event.bind(t,"pointerdown",p),e.event.bind(t,"pointermove",f),e.event.bind(t,"pointerup",g)):window.MSPointerEvent&&(e.event.bind(window,"MSPointerDown",l),e.event.bind(window,"MSPointerUp",u),e.event.bind(t,"MSPointerDown",p),e.event.bind(t,"MSPointerMove",f),e.event.bind(t,"MSPointerUp",g)))}var i=t("../../lib/helper"),r=t("../instances"),o=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){if(i.env.supportsTouch||i.env.supportsIePointer){var e=r.get(t);n(t,e,i.env.supportsTouch,i.env.supportsIePointer)}}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(t,e){"use strict";var n=t("../lib/helper"),i=t("../lib/class"),r=t("./instances"),o=t("./update-geometry"),s={"click-rail":t("./handler/click-rail"),"drag-scrollbar":t("./handler/drag-scrollbar"),keyboard:t("./handler/keyboard"),wheel:t("./handler/mouse-wheel"),touch:t("./handler/touch"),selection:t("./handler/selection")},a=t("./handler/native-scroll");e.exports=function(t,e){e="object"==typeof e?e:{},i.add(t,"ps-container");var c=r.add(t);c.settings=n.extend(c.settings,e),i.add(t,"ps-theme-"+c.settings.theme),c.settings.handlers.forEach(function(e){s[e](t)}),a(t),o(t)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(t,e,n){"use strict";function i(t){function e(){c.add(t,"ps-focus")}function n(){c.remove(t,"ps-focus")}var i=this;i.settings=a.clone(l),i.containerWidth=null,i.containerHeight=null,i.contentWidth=null,i.contentHeight=null,i.isRtl="rtl"===u.css(t,"direction"),i.isNegativeScroll=function(){var e=t.scrollLeft,n=null;return t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=e,n}(),i.negativeScrollAdjustment=i.isNegativeScroll?t.scrollWidth-t.clientWidth:0,i.event=new d,i.ownerDocument=t.ownerDocument||document,i.scrollbarXRail=u.appendTo(u.e("div","ps-scrollbar-x-rail"),t),i.scrollbarX=u.appendTo(u.e("div","ps-scrollbar-x"),i.scrollbarXRail),i.scrollbarX.setAttribute("tabindex",0),i.event.bind(i.scrollbarX,"focus",e),i.event.bind(i.scrollbarX,"blur",n),i.scrollbarXActive=null,i.scrollbarXWidth=null,i.scrollbarXLeft=null,i.scrollbarXBottom=a.toInt(u.css(i.scrollbarXRail,"bottom")),i.isScrollbarXUsingBottom=i.scrollbarXBottom===i.scrollbarXBottom,i.scrollbarXTop=i.isScrollbarXUsingBottom?null:a.toInt(u.css(i.scrollbarXRail,"top")),i.railBorderXWidth=a.toInt(u.css(i.scrollbarXRail,"borderLeftWidth"))+a.toInt(u.css(i.scrollbarXRail,"borderRightWidth")),u.css(i.scrollbarXRail,"display","block"),i.railXMarginWidth=a.toInt(u.css(i.scrollbarXRail,"marginLeft"))+a.toInt(u.css(i.scrollbarXRail,"marginRight")),u.css(i.scrollbarXRail,"display",""),i.railXWidth=null,i.railXRatio=null,i.scrollbarYRail=u.appendTo(u.e("div","ps-scrollbar-y-rail"),t),i.scrollbarY=u.appendTo(u.e("div","ps-scrollbar-y"),i.scrollbarYRail),i.scrollbarY.setAttribute("tabindex",0),i.event.bind(i.scrollbarY,"focus",e),i.event.bind(i.scrollbarY,"blur",n),i.scrollbarYActive=null,i.scrollbarYHeight=null,i.scrollbarYTop=null,i.scrollbarYRight=a.toInt(u.css(i.scrollbarYRail,"right")),i.isScrollbarYUsingRight=i.scrollbarYRight===i.scrollbarYRight,i.scrollbarYLeft=i.isScrollbarYUsingRight?null:a.toInt(u.css(i.scrollbarYRail,"left")),i.scrollbarYOuterWidth=i.isRtl?a.outerWidth(i.scrollbarY):null,i.railBorderYWidth=a.toInt(u.css(i.scrollbarYRail,"borderTopWidth"))+a.toInt(u.css(i.scrollbarYRail,"borderBottomWidth")),u.css(i.scrollbarYRail,"display","block"),i.railYMarginHeight=a.toInt(u.css(i.scrollbarYRail,"marginTop"))+a.toInt(u.css(i.scrollbarYRail,"marginBottom")),u.css(i.scrollbarYRail,"display",""),i.railYHeight=null,i.railYRatio=null}function r(t){return t.getAttribute("data-ps-id")}function o(t,e){t.setAttribute("data-ps-id",e)}function s(t){t.removeAttribute("data-ps-id")}var a=t("../lib/helper"),c=t("../lib/class"),l=t("./default-setting"),u=t("../lib/dom"),d=t("../lib/event-manager"),h=t("../lib/guid"),p={};n.add=function(t){var e=h();return o(t,e),p[e]=new i(t),p[e]},n.remove=function(t){delete p[r(t)],s(t)},n.get=function(t){return p[r(t)]}},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(t,e){"use strict";function n(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function i(t,e){var n={width:e.railXWidth};e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft,e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-t.scrollTop:n.top=e.scrollbarXTop+t.scrollTop,s.css(e.scrollbarXRail,n);var i={top:t.scrollTop,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?i.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:i.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:i.left=e.scrollbarYLeft+t.scrollLeft,s.css(e.scrollbarYRail,i),s.css(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),s.css(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var r=t("../lib/helper"),o=t("../lib/class"),s=t("../lib/dom"),a=t("./instances"),c=t("./update-scroll");e.exports=function(t){var e=a.get(t);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight;var l;t.contains(e.scrollbarXRail)||(l=s.queryChildren(t,".ps-scrollbar-x-rail"),l.length>0&&l.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarXRail,t)),t.contains(e.scrollbarYRail)||(l=s.queryChildren(t,".ps-scrollbar-y-rail"),l.length>0&&l.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarYRail,t)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=n(e,r.toInt(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=r.toInt((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=n(e,r.toInt(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=r.toInt(t.scrollTop*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),i(t,e),e.scrollbarXActive?o.add(t,"ps-active-x"):(o.remove(t,"ps-active-x"),e.scrollbarXWidth=0,e.scrollbarXLeft=0,c(t,"left",0)),e.scrollbarYActive?o.add(t,"ps-active-y"):(o.remove(t,"ps-active-y"),e.scrollbarYHeight=0,e.scrollbarYTop=0,c(t,"top",0))}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(t,e){"use strict";var n,i,r=t("./instances"),o=document.createEvent("Event"),s=document.createEvent("Event"),a=document.createEvent("Event"),c=document.createEvent("Event"),l=document.createEvent("Event"),u=document.createEvent("Event"),d=document.createEvent("Event"),h=document.createEvent("Event"),p=document.createEvent("Event"),f=document.createEvent("Event");o.initEvent("ps-scroll-up",!0,!0),s.initEvent("ps-scroll-down",!0,!0),a.initEvent("ps-scroll-left",!0,!0),c.initEvent("ps-scroll-right",!0,!0),l.initEvent("ps-scroll-y",!0,!0),u.initEvent("ps-scroll-x",!0,!0),d.initEvent("ps-x-reach-start",!0,!0),h.initEvent("ps-x-reach-end",!0,!0),p.initEvent("ps-y-reach-start",!0,!0),f.initEvent("ps-y-reach-end",!0,!0),e.exports=function(t,e,g){if("undefined"==typeof t)throw"You must provide an element to the update-scroll function";if("undefined"==typeof e)throw"You must provide an axis to the update-scroll function";if("undefined"==typeof g)throw"You must provide a value to the update-scroll function";"top"===e&&g<=0&&(t.scrollTop=g=0,t.dispatchEvent(p)),"left"===e&&g<=0&&(t.scrollLeft=g=0,t.dispatchEvent(d));var m=r.get(t);"top"===e&&g>=m.contentHeight-m.containerHeight&&(g=m.contentHeight-m.containerHeight,g-t.scrollTop<=1?g=t.scrollTop:t.scrollTop=g,t.dispatchEvent(f)),"left"===e&&g>=m.contentWidth-m.containerWidth&&(g=m.contentWidth-m.containerWidth,g-t.scrollLeft<=1?g=t.scrollLeft:t.scrollLeft=g,t.dispatchEvent(h)),n||(n=t.scrollTop),i||(i=t.scrollLeft),"top"===e&&g<n&&t.dispatchEvent(o),"top"===e&&g>n&&t.dispatchEvent(s),"left"===e&&g<i&&t.dispatchEvent(a),"left"===e&&g>i&&t.dispatchEvent(c),"top"===e&&(t.scrollTop=n=g,t.dispatchEvent(l)),"left"===e&&(t.scrollLeft=i=g,t.dispatchEvent(u))}},{"./instances":18}],21:[function(t,e){"use strict";var n=t("../lib/helper"),i=t("../lib/dom"),r=t("./instances"),o=t("./update-geometry"),s=t("./update-scroll");e.exports=function(t){var e=r.get(t);e&&(e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,i.css(e.scrollbarXRail,"display","block"),i.css(e.scrollbarYRail,"display","block"),e.railXMarginWidth=n.toInt(i.css(e.scrollbarXRail,"marginLeft"))+n.toInt(i.css(e.scrollbarXRail,"marginRight")),e.railYMarginHeight=n.toInt(i.css(e.scrollbarYRail,"marginTop"))+n.toInt(i.css(e.scrollbarYRail,"marginBottom")),i.css(e.scrollbarXRail,"display","none"),i.css(e.scrollbarYRail,"display","none"),o(t),s(t,"top",t.scrollTop),s(t,"left",t.scrollLeft),i.css(e.scrollbarXRail,"display",""),i.css(e.scrollbarYRail,"display",""))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]),function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t,t.document)}):"undefined"!=typeof module&&module.exports?module.exports=e(t,t.document):t.Shake=e(t,t.document)}("undefined"!=typeof window?window:this,function(t,e){"use strict";function n(n){if(this.hasDeviceMotion="ondevicemotion"in t,this.options={threshold:15,timeout:1e3},"object"==typeof n)for(var i in n)n.hasOwnProperty(i)&&(this.options[i]=n[i]);if(this.lastTime=new Date,this.lastX=null,this.lastY=null,this.lastZ=null,"function"==typeof e.CustomEvent)this.event=new e.CustomEvent("shake",{bubbles:!0,cancelable:!0});else{if("function"!=typeof e.createEvent)return!1;this.event=e.createEvent("Event"),this.event.initEvent("shake",!0,!0)}}return n.prototype.reset=function(){this.lastTime=new Date,this.lastX=null,this.lastY=null,this.lastZ=null},n.prototype.start=function(){this.reset(),this.hasDeviceMotion&&t.addEventListener("devicemotion",this,!1)},n.prototype.stop=function(){this.hasDeviceMotion&&t.removeEventListener("devicemotion",this,!1),this.reset()},n.prototype.devicemotion=function(e){var n=e.accelerationIncludingGravity;if(n){var i,r,o=0,s=0,a=0;if(null===this.lastX&&null===this.lastY&&null===this.lastZ)return this.lastX=n.x,this.lastY=n.y,void(this.lastZ=n.z);o=Math.abs(this.lastX-n.x),s=Math.abs(this.lastY-n.y),a=Math.abs(this.lastZ-n.z),(o>this.options.threshold&&s>this.options.threshold||o>this.options.threshold&&a>this.options.threshold||s>this.options.threshold&&a>this.options.threshold)&&(i=new Date,r=i.getTime()-this.lastTime.getTime(),r>this.options.timeout&&(t.dispatchEvent(this.event),this.lastTime=new Date)),this.lastX=n.x,this.lastY=n.y,this.lastZ=n.z}},n.prototype.handleEvent=function(t){if("function"==typeof this[t.type])return this[t.type](t)},n}),void function(t){var e="2.0.4",n=t.AV||{};t.AV=n,"function"==typeof define&&define.amd&&define("AV",[],function(){return n});var i={heartbeatsTime:3e4},r={},o={},s={open:"open",close:"close",message:"message",reuse:"reuse",error:"error"},a=function(){var e={options:void 0,ws:void 0,heartbeatsTimer:void 0,ec:void 0,closeFlag:!1,reuseTimer:void 0},n=function(){r.log("WebSocket opened."),o.loginPush(e.options),o.heartbeats(),o.guard(),e.ec.emit(s.open)},a=function(){r.log("WebSocket closed."),e.ec.emit(s.close)},c=function(t){var n=JSON.parse(t.data);if("data"===n.cmd){o.ackPush(n.ids);var i,r=n.msg.length;for(i=0;i<r;i++)e.ec.emit(s.message,n.msg[i])}},l=function(t){throw t},u=function(t){e.ws.send(JSON.stringify(t))},d=function(t,e,n){var i=[];"string"==typeof t?i.push(t):i=t,o.channels(i,e,n)};return o.getId=function(t){var e="AV/"+t.appId+"/installationId",n=r.storage(e);return n?n:(id=r.getId(),t.id=id,o.sendId(t,function(){r.storage(e,id)}),id)},o.sendId=function(t,n){r.ajax({url:"https://"+e.options.host+"/1.1/installations",method:"post",appId:t.appId,appKey:t.appKey,data:{deviceType:t.deviceType,installationId:t.id,channels:t.channels}},function(i){i?n&&(n(i),e.ec.emit("leancloud-send-id-ok")):setTimeout(function(){o.sendId(t)},5e3)})},o.sendPush=function(t,n){r.ajax({url:"https://"+e.options.host+"/1.1/push",method:"post",appId:t.appId,appKey:t.appKey,data:t},function(e,i){if(e)n&&n(e);else{if(403===i.code||404===i.code)throw i.error;setTimeout(function(){o.sendPush(t,n)},5e3)}})},o.channels=function(t,n,i){var o={installationId:e.options.id,deviceType:e.options.deviceType};i?o.channels={__op:"Remove",objects:t}:o.channels=t,r.ajax({url:"https://"+e.options.host+"/1.1/installations",method:"post",appId:e.options.appId,appKey:e.options.appKey,data:o},function(t){n&&n(t)})},o.createSocket=function(t){var i=new WebSocket(t);e.ws=i,i.addEventListener("open",n),i.addEventListener("close",a),i.addEventListener("message",c),i.addEventListener("error",l)},o.heartbeats=function(){u({}),e.ws.addEventListener("message",function(){e.heartbeatsTimer&&clearTimeout(e.heartbeatsTimer),e.heartbeatsTimer=setTimeout(function(){u({})},i.heartbeatsTime)})},o.guard=function(){e.ec.on(s.close,function(){e.closeFlag||e.ec.emit(s.reuse)})},o.connect=function(t){var n=t.server;if(!(n&&r.now()<n.expires))throw e.ec.emit(s.error),"WebSocket connet failed.";o.createSocket(n.server)},o.ackPush=function(t){u({cmd:"ack",appId:e.options.appId,installationId:e.options.id,ids:t})},o.loginPush=function(t){u({cmd:"login",appId:t.appId,installationId:t.id})},o.getServer=function(n,i){var o=n.appId,a=n.secure,c="",l="http://";t&&"https:"===t.location.protocol&&(l="https://");var u="";switch(n.region){case"cn":u="g0";break;case"us":u="a0";break;default:throw"There is no this region."}c=l+"router-"+u+"-push.leancloud.cn/v1/route?appId="+o,a&&(c+="&secure=1"),r.ajax({url:c},function(t,n){if(t)t.expires=r.now()+1e3*t.ttl,e.server=t,i(t);else{if(403===n.code||404===n.code)throw n.error;e.ec.emit(s.error)}})},{installationId:"",cache:e,open:function(t){var n=this;return o.getServer(e.options,function(t){t&&o.connect({server:e.server})}),t&&e.ec.on(s.open,t),e.ec.once(s.reuse+" "+s.error,function(){e.reuseTimer&&clearTimeout(e.reuseTimer),e.reuseTimer=setTimeout(function(){n.open()},5e3)}),this},close:function(){return e.closeFlag=!0,e.ws.close(),this},on:function(t,n){return e.ec.on(t,n),this},once:function(t,n){return e.ec.once(t,n),this},off:function(t,n){return e.ec.off(t,n),this},emit:function(t,n){return e.ec.emit(t,n),this},send:function(t,n){var i={appId:e.options.appId,appKey:e.options.appKey};if(t.channels||t.where||t.expiration_time||t.expiration_interval||t.push_time||t.prod){for(var r in t)i[r]=t[r];o.sendPush(i,n)}else i.data=t,o.sendPush(i,n);return this},subscribe:function(t,e){return d(t,e),this},unsubscribe:function(t,e){return d(t,e,!0),this},receive:function(t){if(!t)throw"Receive must hava callback.";return e.ec.on(s.message,function(e){t(e)}),this}}};n.push=function(e){if("object"!=typeof e)throw"AV.push need a argument at least.";if(e.appId){if(e.appKey){var n=!t.WebSocket.loadFlashPolicyFile;switch(e={appId:e.appId,appKey:e.appKey,peerId:e.clientId,secure:"undefined"==typeof e.secure?n:e.secure,region:e.region||"cn",channels:e.channels||[],deviceType:"web"},e.region){case"cn":e.host="leancloud.cn";break;case"us":e.host="us-api.leancloud.cn"}var i=a();return i.cache.options=e,e.id=o.getId(e),i.installationId=e.id,i.cache.ec=r.eventCenter(),i}throw"Options must have appKey."}throw"Options must have appId."},n.push.version=e,n.push._tool=r,n.push._engine=o,r.noop=function(){},r.getId=function(){var t=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,3)};return"AV-"+t()+"-"+t()+"-"+t()},r.log=function(t){console.log(t)},r.ajax=function(t,e){var n=t.url,i=t.method||"get",r=new XMLHttpRequest;r.open(i,n),"post"!==i&&"put"!==i||r.setRequestHeader("Content-Type","application/json"),t.appId&&r.setRequestHeader("X-AVOSCloud-Application-Id",t.appId),t.appKey&&r.setRequestHeader("X-AVOSCloud-Application-Key",t.appKey),r.onprogress=function(){},r.ontimeout=function(){},r.timeout=0,r.onload=function(){r.status>=200&&r.status<300?e(JSON.parse(r.responseText)):e(null,JSON.parse(r.responseText))},r.onerror=function(t){throw e(null,t),"Network error."},r.send(JSON.stringify(t.data))},r.now=function(){return Date.now()},r.storage=function(e,n){if(!n){var i=t.localStorage.getItem(e);return/^[\{|\[]/.test(i)&&/[\}|\]]$/.test(i)&&(i=JSON.parse(i)),i}"object"==typeof n&&(n=JSON.stringify(n)),t.localStorage.setItem(e,n)},r.eventCenter=function(){function t(t){var e=[],n=0,i=t.length;if(i){for(;n<i;n++)t[n]&&e.push(t[n]);return e}return null}var e={},n={},i=function(t,i,r){if(!t)throw"No event name.";if(!i)throw"No callback function.";var o,s=t.split(/\s+/);o=r?n:e;for(var a=0,c=s.length;a<c;a++)s[a]&&(o[s[a]]||(o[s[a]]=[]),o[s[a]].push(i))},r=function(t,i,r){var o;if(o=r?n:e,o[t])for(var s=0,a=o[t].length;s<a;s++)if(o[t][s]===i)return void(o[t][s]=null)};return{on:function(t,e){return i(t,e),this},once:function(t,e){return i(t,e,!0),this},emit:function(i,o){if(!i)throw"No emit event name.";var s=0,a=0;if(e[i]){for(s=0,a=e[i].length;s<a;s++)e[i][s]&&e[i][s].call(this,o);e[i]=t(e[i])}if(n[i]){for(s=0,a=n[i].length;s<a;s++)n[i][s]&&(n[i][s].call(this,o),r(i,n[i][s],!0));n[i]=t(n[i])}return this},off:function(t,e){return r(t,e),this}}}}(window),function(t,e){"use strict";t.rails!==e&&t.error("jquery-ujs has already been loaded!");var n,i=t(document);t.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return t("meta[name=csrf-token]").attr("content")},csrfParam:function(){return t("meta[name=csrf-param]").attr("content")},CSRFProtection:function(t){var e=n.csrfToken();e&&t.setRequestHeader("X-CSRF-Token",e)},refreshCSRFTokens:function(){t('form input[name="'+n.csrfParam()+'"]').val(n.csrfToken())},fire:function(e,n,i){var r=t.Event(n);return e.trigger(r,i),r.result!==!1},confirm:function(t){return confirm(t)},ajax:function(e){return t.ajax(e)},href:function(t){return t[0].href},isRemote:function(t){return t.data("remote")!==e&&t.data("remote")!==!1},handleRemote:function(i){var r,o,s,a,c,l;if(n.fire(i,"ajax:before")){if(a=i.data("with-credentials")||null,c=i.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType,i.is("form")){r=i.data("ujs:submit-button-formmethod")||i.attr("method"),o=i.data("ujs:submit-button-formaction")||i.attr("action"),s=t(i[0]).serializeArray();var u=i.data("ujs:submit-button");u&&(s.push(u),i.data("ujs:submit-button",null)),i.data("ujs:submit-button-formmethod",null),i.data("ujs:submit-button-formaction",null)}else i.is(n.inputChangeSelector)?(r=i.data("method"),o=i.data("url"),s=i.serialize(),i.data("params")&&(s=s+"&"+i.data("params"))):i.is(n.buttonClickSelector)?(r=i.data("method")||"get",o=i.data("url"),s=i.serialize(),i.data("params")&&(s=s+"&"+i.data("params"))):(r=i.data("method"),o=n.href(i),s=i.data("params")||null);return l={type:r||"GET",data:s,dataType:c,beforeSend:function(t,r){return r.dataType===e&&t.setRequestHeader("accept","*/*;q=0.5, "+r.accepts.script),!!n.fire(i,"ajax:beforeSend",[t,r])&&void i.trigger("ajax:send",t)},success:function(t,e,n){i.trigger("ajax:success",[t,e,n])},complete:function(t,e){i.trigger("ajax:complete",[t,e])},error:function(t,e,n){i.trigger("ajax:error",[t,e,n])},crossDomain:n.isCrossDomain(o)},a&&(l.xhrFields={withCredentials:a}),o&&(l.url=o),n.ajax(l)}return!1},isCrossDomain:function(t){var e=document.createElement("a");e.href=location.href;var n=document.createElement("a");try{return n.href=t,n.href=n.href,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return!0}},handleMethod:function(i){var r=n.href(i),o=i.data("method"),s=i.attr("target"),a=n.csrfToken(),c=n.csrfParam(),l=t('<form method="post" action="'+r+'"></form>'),u='<input name="_method" value="'+o+'" type="hidden" />';c===e||a===e||n.isCrossDomain(r)||(u+='<input name="'+c+'" value="'+a+'" type="hidden" />'),s&&l.attr("target",s),l.hide().append(u).appendTo("body"),l.submit()},formElements:function(e,n){return e.is("form")?t(e[0].elements).filter(n):e.find(n)},disableFormElements:function(e){n.formElements(e,n.disableSelector).each(function(){n.disableFormElement(t(this))})},disableFormElement:function(t){var n,i;n=t.is("button")?"html":"val",i=t.data("disable-with"),i!==e&&(t.data("ujs:enable-with",t[n]()),t[n](i)),t.prop("disabled",!0),t.data("ujs:disabled",!0)},enableFormElements:function(e){n.formElements(e,n.enableSelector).each(function(){n.enableFormElement(t(this))})},enableFormElement:function(t){var n=t.is("button")?"html":"val";t.data("ujs:enable-with")!==e&&(t[n](t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.prop("disabled",!1),t.removeData("ujs:disabled")},allowAction:function(t){var e,i=t.data("confirm"),r=!1;if(!i)return!0;if(n.fire(t,"confirm")){try{r=n.confirm(i)}catch(t){(console.error||console.log).call(console,t.stack||t)}e=n.fire(t,"confirm:complete",[r])}return r&&e},blankInputs:function(e,n,i){var r,o,s,a,c=t(),l=n||"input,textarea",u=e.find(l),d={};return u.each(function(){r=t(this),r.is("input[type=radio]")?(a=r.attr("name"),d[a]||(0===e.find('input[type=radio]:checked[name="'+a+'"]').length&&(s=e.find('input[type=radio][name="'+a+'"]'),c=c.add(s)),d[a]=a)):(o=r.is("input[type=checkbox],input[type=radio]")?r.is(":checked"):!!r.val(),o===i&&(c=c.add(r)))}),!!c.length&&c},nonBlankInputs:function(t,e){return n.blankInputs(t,e,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(t){var i=t.data("disable-with");i!==e&&(t.data("ujs:enable-with",t.html()),t.html(i)),t.bind("click.railsDisable",function(t){return n.stopEverything(t)}),t.data("ujs:disabled",!0)},enableElement:function(t){t.data("ujs:enable-with")!==e&&(t.html(t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.unbind("click.railsDisable"),t.removeData("ujs:disabled")}},n.fire(i,"rails:attachBindings")&&(t.ajaxPrefilter(function(t,e,i){t.crossDomain||n.CSRFProtection(i)}),t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableFormElement(e)}),t(t.rails.linkDisableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableElement(e)})}),i.delegate(n.linkDisableSelector,"ajax:complete",function(){n.enableElement(t(this))}),i.delegate(n.buttonDisableSelector,"ajax:complete",function(){n.enableFormElement(t(this))}),i.delegate(n.linkClickSelector,"click.rails",function(e){var i=t(this),r=i.data("method"),o=i.data("params"),s=e.metaKey||e.ctrlKey;if(!n.allowAction(i))return n.stopEverything(e);if(!s&&i.is(n.linkDisableSelector)&&n.disableElement(i),n.isRemote(i)){if(s&&(!r||"GET"===r)&&!o)return!0;var a=n.handleRemote(i);return a===!1?n.enableElement(i):a.fail(function(){n.enableElement(i)}),!1}return r?(n.handleMethod(i),!1):void 0}),i.delegate(n.buttonClickSelector,"click.rails",function(e){var i=t(this);if(!n.allowAction(i)||!n.isRemote(i))return n.stopEverything(e);i.is(n.buttonDisableSelector)&&n.disableFormElement(i);var r=n.handleRemote(i);return r===!1?n.enableFormElement(i):r.fail(function(){n.enableFormElement(i)}),!1}),i.delegate(n.inputChangeSelector,"change.rails",function(e){var i=t(this);return n.allowAction(i)&&n.isRemote(i)?(n.handleRemote(i),!1):n.stopEverything(e)}),i.delegate(n.formSubmitSelector,"submit.rails",function(i){var r,o,s=t(this),a=n.isRemote(s);if(!n.allowAction(s))return n.stopEverything(i);if(s.attr("novalidate")===e)if(s.data("ujs:formnovalidate-button")===e){if(r=n.blankInputs(s,n.requiredInputSelector,!1),r&&n.fire(s,"ajax:aborted:required",[r]))return n.stopEverything(i)}else s.data("ujs:formnovalidate-button",e);if(a){if(o=n.nonBlankInputs(s,n.fileInputSelector)){setTimeout(function(){n.disableFormElements(s)},13);var c=n.fire(s,"ajax:aborted:file",[o]);return c||setTimeout(function(){n.enableFormElements(s)},13),c}return n.handleRemote(s),!1}setTimeout(function(){n.disableFormElements(s)},13)}),i.delegate(n.formInputClickSelector,"click.rails",function(e){var i=t(this);if(!n.allowAction(i))return n.stopEverything(e);var r=i.attr("name"),o=r?{name:r,value:i.val()}:null,s=i.closest("form");0===s.length&&(s=t("#"+i.attr("form"))),s.data("ujs:submit-button",o),s.data("ujs:formnovalidate-button",i.attr("formnovalidate")),s.data("ujs:submit-button-formaction",i.attr("formaction")),s.data("ujs:submit-button-formmethod",i.attr("formmethod"))}),i.delegate(n.formSubmitSelector,"ajax:send.rails",function(e){this===e.target&&n.disableFormElements(t(this))}),i.delegate(n.formSubmitSelector,"ajax:complete.rails",function(e){this===e.target&&n.enableFormElements(t(this))}),t(function(){n.refreshCSRFTokens()}))}(jQuery),+function(t){"use strict";var e=function(e,n){this.options=n,this.$element=t(e),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};e.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},e.prototype.toggle=function(t){return this[this.isShown?"hide":"show"](t)},e.prototype.show=function(e){var n=this,i=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.backdrop(function(){var i=t.support.transition&&n.$element.hasClass("fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show().scrollTop(0),i&&n.$element[0].offsetWidth,n.$element.addClass("in").attr("aria-hidden",!1),n.enforceFocus();var r=t.Event("shown.bs.modal",{relatedTarget:e});i?n.$element.find(".modal-dialog").one(t.support.transition.end,function(){n.$element.focus().trigger(r)}).emulateTransitionEnd(300):n.$element.focus().trigger(r)}))},e.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one(t.support.transition.end,t.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.focus()},this))},e.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},e.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.removeBackdrop(),t.$element.trigger("hidden.bs.modal")})},e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},e.prototype.backdrop=function(e){var n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=t.support.transition&&n;if(this.$backdrop=t('<div class="modal-backdrop '+n+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;i?this.$backdrop.one(t.support.transition.end,e).emulateTransitionEnd(150):e()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,e).emulateTransitionEnd(150):e()):e&&e()};var n=t.fn.modal;t.fn.modal=function(n,i){return this.each(function(){var r=t(this),o=r.data("bs.modal"),s=t.extend({},e.DEFAULTS,r.data(),"object"==typeof n&&n);o||r.data("bs.modal",o=new e(this,s)),"string"==typeof n?o[n](i):s.show&&o.show(i)})},t.fn.modal.Constructor=e,t.fn.modal.noConflict=function(){return t.fn.modal=n,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var n=t(this),i=n.attr("href"),r=t(n.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=r.data("bs.modal")?"toggle":t.extend({
|
|
remote:!/#/.test(i)&&i},r.data(),n.data());n.is("a")&&e.preventDefault(),r.modal(o,this).one("hide",function(){n.is(":visible")&&n.focus()})}),t(document).on("show.bs.modal",".modal",function(){t(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){t(document.body).removeClass("modal-open")})}(jQuery),+function(t){"use strict";var e=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,n,i){this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(i);for(var r=this.options.trigger.split(" "),o=r.length;o--;){var s=r[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",c="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(c+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,function(t,i){n[t]!=i&&(e[t]=i)}),e},e.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void(n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show()},e.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void(n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide()},e.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(e),e.isDefaultPrevented())return;var n=this,i=this.tip();this.setContent(),this.options.animation&&i.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,o=/\s?auto?\s?/i,s=o.test(r);s&&(r=r.replace(o,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(r),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var a=this.getPosition(),c=i[0].offsetWidth,l=i[0].offsetHeight;if(s){var u=this.$element.parent(),d=r,h=document.documentElement.scrollTop||document.body.scrollTop,p="body"==this.options.container?window.innerWidth:u.outerWidth(),f="body"==this.options.container?window.innerHeight:u.outerHeight(),g="body"==this.options.container?0:u.offset().left;r="bottom"==r&&a.top+a.height+l-h>f?"top":"top"==r&&a.top-h-l<0?"bottom":"right"==r&&a.right+c>p?"left":"left"==r&&a.left-c<g?"right":r,i.removeClass(d).addClass(r)}var m=this.getCalculatedOffset(r,a,c,l);this.applyPlacement(m,r),this.hoverState=null;var v=function(){n.$element.trigger("shown.bs."+n.type)};t.support.transition&&this.$tip.hasClass("fade")?i.one(t.support.transition.end,v).emulateTransitionEnd(150):v()}},e.prototype.applyPlacement=function(e,n){var i,r=this.tip(),o=r[0].offsetWidth,s=r[0].offsetHeight,a=parseInt(r.css("margin-top"),10),c=parseInt(r.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(c)&&(c=0),e.top=e.top+a,e.left=e.left+c,t.offset.setOffset(r[0],t.extend({using:function(t){r.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),r.addClass("in");var l=r[0].offsetWidth,u=r[0].offsetHeight;if("top"==n&&u!=s&&(i=!0,e.top=e.top+s-u),/bottom|top/.test(n)){var d=0;e.left<0&&(d=e.left*-2,e.left=0,r.offset(e),l=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(d-o+l,l,"left")}else this.replaceArrow(u-s,u,"top");i&&r.offset(e)},e.prototype.replaceArrow=function(t,e,n){this.arrow().css(n,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},e.prototype.hide=function(){function e(){"in"!=n.hoverState&&i.detach(),n.$element.trigger("hidden.bs."+n.type)}var n=this,i=this.tip(),r=t.Event("hide.bs."+this.type);if(this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?i.one(t.support.transition.end,e).emulateTransitionEnd(150):e(),this.hoverState=null,this},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},e.prototype.getCalculatedOffset=function(t,e,n,i){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-n/2}:"top"==t?{top:e.top-i,left:e.left+e.width/2-n/2}:"left"==t?{top:e.top+e.height/2-i/2,left:e.left-n}:{top:e.top+e.height/2-i/2,left:e.left+e.width}},e.prototype.getTitle=function(){var t,e=this.$element,n=this.options;return t=e.attr("data-original-title")||("function"==typeof n.title?n.title.call(e[0]):n.title)},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var n=e?t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("in")?n.leave(n):n.enter(n)},e.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=t.fn.tooltip;t.fn.tooltip=function(n){return this.each(function(){var i=t(this),r=i.data("bs.tooltip"),o="object"==typeof n&&n;(r||"destroy"!=n)&&(r||i.data("bs.tooltip",r=new e(this,o)),"string"==typeof n&&r[n]())})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=n,this}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&"object"==typeof module.exports?require("jquery"):jQuery)}(function(t){function e(){var e=o.settings;if(e.autoDispose&&!t.contains(document.documentElement,this))return t(this).timeago("dispose"),this;var s=n(this);return isNaN(s.datetime)||(0==e.cutoff||Math.abs(r(s.datetime))<e.cutoff)&&t(this).text(i(s.datetime,t(this).attr("lang")?t(this).attr("lang"):o.settings.lang)),this}function n(e){if(e=t(e),!e.data("timeago")){e.data("timeago",{datetime:o.datetime(e)});var n=t.trim(e.text());o.settings.localeTitle?e.attr("title",e.data("timeago").datetime.toLocaleString()):!(n.length>0)||o.isTime(e)&&e.attr("title")||e.attr("title",n)}return e.data("timeago")}function i(t,e){return o.inWords(r(t),e)}function r(t){return(new Date).getTime()-t.getTime()}t.timeago=function(e){return i(e instanceof Date?e:"string"==typeof e?t.timeago.parse(e):"number"==typeof e?new Date(e):t.timeago.datetime(e))};var o=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,autoDispose:!0,lang:"en",strings:{en:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}}},inWords:function(e,n){function i(n,i){var o=t.isFunction(n)?n(i,e):n,s=r.numbers&&r.numbers[i]||i;return o.replace(/%d/i,s)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var r=this.settings.strings[n]||this.settings.strings[this.settings.lang]||this.settings.strings.en,o=r.prefixAgo,s=r.suffixAgo;if(this.settings.allowFuture&&e<0&&(o=r.prefixFromNow,s=r.suffixFromNow),!this.settings.allowPast&&e>=0)return r.inPast;var a=Math.abs(e)/1e3,c=a/60,l=c/60,u=l/24,d=u/365,h=a<45&&i(r.seconds,Math.round(a))||a<90&&i(r.minute,1)||c<45&&i(r.minutes,Math.round(c))||c<90&&i(r.hour,1)||l<24&&i(r.hours,Math.round(l))||l<42&&i(r.day,1)||u<30&&i(r.days,Math.round(u))||u<45&&i(r.month,1)||u<365&&i(r.months,Math.round(u/30))||d<1.5&&i(r.year,1)||i(r.years,Math.round(d)),p=r.wordSeparator||"";return void 0===r.wordSeparator&&(p=" "),t.trim([o,h,s].join(p))},parse:function(e){var n=t.trim(e);return n=n.replace(/\.\d+/,""),n=n.replace(/-/,"/").replace(/-/,"/"),n=n.replace(/T/," ").replace(/Z/," UTC"),n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),n=n.replace(/([\+\-]\d\d)$/," $100"),new Date(n)},datetime:function(e){var n=o.isTime(e)?t(e).attr("datetime"):t(e).attr("title");return o.parse(n)},isTime:function(e){return"time"===t(e).get(0).tagName.toLowerCase()}});var s={init:function(){var n=t.proxy(e,this);n();var i=o.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(n,i.refreshMillis))},update:function(n){var i=n instanceof Date?n:o.parse(n);t(this).data("timeago",{datetime:i}),o.settings.localeTitle&&t(this).attr("title",i.toLocaleString()),e.apply(this)},updateFromDOM:function(){t(this).data("timeago",{datetime:o.parse(o.isTime(this)?t(this).attr("datetime"):t(this).attr("title"))}),e.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};t.fn.timeago=function(t,e){var n=t?s[t]:s.init;if(!n)throw new Error("Unknown function name '"+t+"' for timeago");return this.each(function(){n.call(this,e)}),this},document.createElement("abbr"),document.createElement("time")}),function(t){t(document).on("ready turbolinks:load page:load ajax:success",function(){t("time[data-time-ago]").timeago()})}(jQuery),function(){var t,e,n,i,r,o,s,a,c,l,u=[].slice,d=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},h=function(t,e){function n(){this.constructor=t}for(var i in e)p.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},p={}.hasOwnProperty,f=function(t,e){return function(){return t.apply(e,arguments)}};n={bind:function(t,e){var n,i,r,o,s;for(i=t.split(" "),this.hasOwnProperty("_callbacks")||this._callbacks||(this._callbacks={}),r=0,o=i.length;r<o;r++)s=i[r],(n=this._callbacks)[s]||(n[s]=[]),this._callbacks[s].push(e);return this},one:function(t,e){var n;return this.bind(t,n=function(){return this.unbind(t,n),e.apply(this,arguments)})},trigger:function(){var t,e,n,i,r,o,s;if(t=1<=arguments.length?u.call(arguments,0):[],n=t.shift(),o=null!=(s=this._callbacks)?s[n]:void 0){for(i=0,r=o.length;i<r&&(e=o[i],e.apply(this,t)!==!1);i++);return!0}},listenTo:function(t,e,n){return t.bind(e,n),this.listeningTo||(this.listeningTo=[]),this.listeningTo.push({obj:t,ev:e,callback:n}),this},listenToOnce:function(t,e,n){var i,r;return r=this.listeningToOnce||(this.listeningToOnce=[]),t.bind(e,i=function(){var o,s,a,c,l;for(s=-1,o=a=0,c=r.length;a<c;o=++a)l=r[o],l.obj===t&&l.ev===e&&l.callback===i&&(s=o);return t.unbind(e,i),s!==-1&&r.splice(s,1),n.apply(this,arguments)}),r.push({obj:t,ev:e,callback:i}),this},stopListening:function(e,n,i){var r,o,s,a,c,l,u,h,p,f,g,m,v,y,b,_,w,x;if(0===arguments.length){for(_=[this.listeningTo,this.listeningToOnce],c=0,h=_.length;c<h;c++)if(m=_[c],null!=m?m.length:void 0)for(l=0,p=m.length;l<p;l++)v=m[l],v.obj.unbind(v.ev,v.callback);this.listeningTo=void 0,this.listeningToOnce=void 0}else if(e)for(n=n?n.split(" "):[void 0],w=[this.listeningTo,this.listeningToOnce],u=0,f=w.length;u<f;u++)if(m=w[u])for(y=0,g=n.length;y<g;y++)for(o=n[y],a=b=x=m.length-1;x<=0?b<=0:b>=0;a=x<=0?++b:--b)v=m[a],v.obj===e&&(i&&v.callback!==i||(o&&o!==v.ev?o&&(s=v.ev.split(" "),d.call(s,o)>=0&&(s=function(){var t,e,n;for(n=[],e=0,t=s.length;e<t;e++)r=s[e],r!==o&&n.push(r);return n}(),v.ev=t.trim(s.join(" ")),v.obj.unbind(o,v.callback))):(v.obj.unbind(v.ev,v.callback),a!==-1&&m.splice(a,1))));return this},unbind:function(t,e){var n,i,r,o,s,a,c,l,u,d;if(0===arguments.length)return this._callbacks={},this;if(!t)return this;for(i=t.split(" "),o=0,a=i.length;o<a;o++)if(u=i[o],l=null!=(d=this._callbacks)?d[u]:void 0)if(e){for(r=s=0,c=l.length;s<c;r=++s)if(n=l[r],n===e){l=l.slice(),l.splice(r,1),this._callbacks[u]=l;break}}else delete this._callbacks[u];return this}},n.on=n.bind,n.off=n.unbind,i={trace:!0,logPrefix:"(App)",log:function(){var t;if(t=1<=arguments.length?u.call(arguments,0):[],this.trace)return this.logPrefix&&t.unshift(this.logPrefix),"undefined"!=typeof console&&null!==console&&"function"==typeof console.log&&console.log.apply(console,t),this}},l=["included","extended"],o=function(){function t(){"function"==typeof this.init&&this.init.apply(this,arguments)}return t.include=function(t){var e,n,i;if(!t)throw new Error("include(obj) requires obj");for(e in t)i=t[e],d.call(l,e)<0&&(this.prototype[e]=i);return null!=(n=t.included)&&n.apply(this),this},t.extend=function(t){var e,n,i;if(!t)throw new Error("extend(obj) requires obj");for(e in t)i=t[e],d.call(l,e)<0&&(this[e]=i);return null!=(n=t.extended)&&n.apply(this),this},t.proxy=function(t){return function(e){return function(){return t.apply(e,arguments)}}(this)},t.prototype.proxy=function(t){return function(e){return function(){return t.apply(e,arguments)}}(this)},t}(),r=function(e){function i(t){i.__super__.constructor.apply(this,arguments),null!=this.constructor.uuid&&"function"==typeof this.constructor.uuid?(this.cid=this.constructor.uuid(),this.id||(this.id=this.cid)):this.cid=(null!=t?t.cid:void 0)||this.constructor.uid("c-"),t&&this.load(t)}return h(i,e),i.extend(n),i.include(n),i.records=[],i.irecords={},i.attributes=[],i.configure=function(){var t,e;return e=arguments[0],t=2<=arguments.length?u.call(arguments,1):[],this.className=e,this.deleteAll(),t.length&&(this.attributes=t),this.attributes&&(this.attributes=c(this.attributes)),this.attributes||(this.attributes=[]),this.unbind(),this},i.toString=function(){return this.className+"("+this.attributes.join(", ")+")"},i.find=function(t,e){var n;return null==e&&(e=this.notFound),(null!=(n=this.irecords[t])?n.clone():void 0)||("function"==typeof e?e(t):void 0)},i.findAll=function(t,e){var n,i,r,o;for(o=[],i=0,r=t.length;i<r;i++)n=t[i],this.find(n,e)&&o.push(this.find(n));return o},i.notFound=function(){return null},i.exists=function(t){return Boolean(this.irecords[t])},i.addRecord=function(t,e){var n;return(n=this.irecords[t.id||t.cid])?n.refresh(t):(t.id||(t.id=t.cid),this.irecords[t.id]=this.irecords[t.cid]=t,void 0!==e?this.records.splice(e,0,t):this.records.push(t)),t},i.refresh=function(t,e){var n,i,r,o,s;for(null==e&&(e={}),e.clear&&this.deleteAll(),o=this.fromJSON(t),Array.isArray(o)||(o=[o]),n=0,i=o.length;n<i;n++)r=o[n],this.addRecord(r);return this.sort(),s=this.cloneArray(o),this.trigger("refresh",s,e),s},i.select=function(t){var e,n,i,r,o;for(r=this.records,o=[],e=0,n=r.length;e<n;e++)i=r[e],t(i)&&o.push(i.clone());return o},i.findByAttribute=function(t,e){var n,i,r,o;for(o=this.records,n=0,i=o.length;n<i;n++)if(r=o[n],r[t]===e)return r.clone();return null},i.findAllByAttribute=function(t,e){return this.select(function(n){return n[t]===e})},i.each=function(t){var e,n,i,r,o;for(r=this.records,o=[],e=0,n=r.length;e<n;e++)i=r[e],o.push(t(i.clone()));return o},i.all=function(){return this.cloneArray(this.records)},i.slice=function(t,e){return null==t&&(t=0),this.cloneArray(this.records.slice(t,e))},i.first=function(t){var e;return null==t&&(t=1),t>1?this.cloneArray(this.records.slice(0,t)):null!=(e=this.records[0])?e.clone():void 0},i.last=function(t){var e;return"number"==typeof t?this.cloneArray(this.records.slice(-t)):null!=(e=this.records[this.records.length-1])?e.clone():void 0},i.count=function(){return this.records.length},i.deleteAll=function(){return this.records=[],this.irecords={}},i.destroyAll=function(t){var e,n,i,r,o;for(r=this.records,o=[],e=0,n=r.length;e<n;e++)i=r[e],o.push(i.destroy(t));return o},i.update=function(t,e,n){return this.find(t).updateAttributes(e,n)},i.create=function(t,e){var n;return n=new this(t),n.save(e)},i.destroy=function(t,e){return this.find(t).destroy(e)},i.change=function(t){return"function"==typeof t?this.bind("change",t):this.trigger.apply(this,["change"].concat(u.call(arguments)))},i.fetch=function(t){return"function"==typeof t?this.bind("fetch",t):this.trigger.apply(this,["fetch"].concat(u.call(arguments)))},i.toJSON=function(){return this.records},i.beforeFromJSON=function(t){return t},i.fromJSON=function(t){var e,n,i,r;if(t){if("string"==typeof t&&(t=JSON.parse(t)),t=this.beforeFromJSON(t),Array.isArray(t)){for(i=[],e=0,n=t.length;e<n;e++)r=t[e],r instanceof this?i.push(r):i.push(new this(r));return i}return t instanceof this?t:new this(t)}},i.fromForm=function(){var t;return(t=new this).fromForm.apply(t,arguments)},i.sort=function(){return this.comparator&&this.records.sort(this.comparator),this},i.cloneArray=function(t){var e,n,i,r;for(i=[],e=0,n=t.length;e<n;e++)r=t[e],i.push(r.clone());return i},i.idCounter=0,i.uid=function(t){var e;return null==t&&(t=""),e=t+this.idCounter++,this.exists(e)&&(e=this.uid(t)),e},i.prototype.isNew=function(){return!this.exists()},i.prototype.isValid=function(){return!this.validate()},i.prototype.validate=function(){},i.prototype.load=function(t){var e,n;t.id&&(this.id=t.id);for(e in t)if(n=t[e],"function"==typeof this[e]){if("function"==typeof n)continue;this[e](n)}else this[e]=n;return this},i.prototype.attributes=function(){var t,e,n,i,r;for(r={},i=this.constructor.attributes,t=0,n=i.length;t<n;t++)e=i[t],e in this&&("function"==typeof this[e]?r[e]=this[e]():r[e]=this[e]);return this.id&&(r.id=this.id),r},i.prototype.eql=function(t){return t&&t.constructor===this.constructor&&(t.cid===this.cid||t.id&&t.id===this.id)},i.prototype.save=function(t){var e,n;return null==t&&(t={}),t.validate!==!1&&(e=this.validate())?(this.trigger("error",this,e),!1):(this.trigger("beforeSave",this,t),n=this.isNew()?this.create(t):this.update(t),this.stripCloneAttrs(),this.trigger("save",n,t),n)},i.prototype.stripCloneAttrs=function(){var t,e;if(!this.hasOwnProperty("cid")){for(t in this)p.call(this,t)&&(e=this[t],d.call(this.constructor.attributes,t)>=0&&delete this[t]);return this}},i.prototype.updateAttribute=function(t,e,n){var i;return i={},i[t]=e,this.updateAttributes(i,n)},i.prototype.updateAttributes=function(t,e){return this.load(t),this.save(e)},i.prototype.changeID=function(t){var e;if(t!==this.id)return e=this.constructor.irecords,e[t]=e[this.id],this.cid!==this.id&&delete e[this.id],this.id=t,this.save()},i.prototype.remove=function(t){var e,n,i,r,o;for(null==t&&(t={}),o=this.constructor.records.slice(0),e=n=0,i=o.length;n<i;e=++n)if(r=o[e],this.eql(r)){o.splice(e,1);break}if(this.constructor.records=o,t.clear)return delete this.constructor.irecords[this.id],delete this.constructor.irecords[this.cid]},i.prototype.destroy=function(t){return null==t&&(t={}),null==t.clear&&(t.clear=!0),this.trigger("beforeDestroy",this,t),this.remove(t),this.destroyed=!0,this.trigger("destroy",this,t),this.trigger("change",this,"destroy",t),this.listeningTo&&this.stopListening(),this.unbind(),this},i.prototype.dup=function(t){var e,n;return null==t&&(t=!0),e=this.attributes(),t?delete e.id:e.cid=this.cid,n=new this.constructor(e),t||this._callbacks&&(n._callbacks=this._callbacks),n},i.prototype.clone=function(){return a(this)},i.prototype.reload=function(){var t;return this.isNew()?this:(t=this.constructor.find(this.id),this.load(t.attributes()),t)},i.prototype.refresh=function(t){return t=this.constructor.fromJSON(t),t.id&&this.id!==t.id&&this.changeID(t.id),this.constructor.irecords[this.id].load(t),this.trigger("refresh",this),this.trigger("change",this,"refresh"),this},i.prototype.toJSON=function(){return this.attributes()},i.prototype.toString=function(){return"<"+this.constructor.className+" ("+JSON.stringify(this)+")>"},i.prototype.fromForm=function(e){var n,i,r,o,s,a,c,l,u,d,h,p,f,g;for(g={},h=t(e).find("[type=checkbox]:not([value])"),i=0,a=h.length;i<a;i++)n=h[i],g[n.name]=t(n).prop("checked");for(p=t(e).find('[type=checkbox][name$="[]"]'),r=0,c=p.length;r<c;r++)n=p[r],u=n.name.replace(/\[\]$/,""),g[u]||(g[u]=[]),t(n).prop("checked")&&g[u].push(n.value);for(f=t(e).serializeArray(),s=0,l=f.length;s<l;s++)o=f[s],g[d=o.name]||(g[d]=o.value);return this.load(g)},i.prototype.exists=function(){return this.constructor.exists(this.id)},i.prototype.update=function(t){var e,n;return this.trigger("beforeUpdate",this,t),n=this.constructor.irecords,n[this.id].load(this.attributes()),this.constructor.sort(),e=n[this.id].clone(),e.trigger("update",e,t),e.trigger("change",e,"update",t),e},i.prototype.create=function(t){var e,n;return this.trigger("beforeCreate",this,t),this.id||(this.id=this.cid),n=this.dup(!1),this.constructor.addRecord(n,t.idx),this.constructor.sort(),e=n.clone(),e.trigger("create",e,t),e.trigger("change",e,"create",t),e},i.prototype.bind=function(){var t;return t=this.constructor.irecords[this.id]||this,n.bind.apply(t,arguments)},i.prototype.one=function(){var t;return t=this.constructor.irecords[this.id]||this,n.one.apply(t,arguments)},i.prototype.unbind=function(){var t;return t=this.constructor.irecords[this.id]||this,n.unbind.apply(t,arguments)},i.prototype.trigger=function(){var t;return n.trigger.apply(this,arguments),"refresh"===arguments[0]||(t=this.constructor).trigger.apply(t,arguments)},i}(o),r.prototype.on=r.prototype.bind,r.prototype.off=r.prototype.unbind,e=function(e){function r(e){this.release=f(this.release,this);var n,i,o,s,a;this.options=e,s=this.options;for(i in s)a=s[i],this[i]=a;for(this.el||(this.el=document.createElement(this.tag)),this.el=t(this.el),this.className&&this.el.addClass(this.className),this.attributes&&this.el.attr(this.attributes),this.events||(this.events=this.constructor.events),this.elements||(this.elements=this.constructor.elements),n=this;o=n.constructor.__super__;)o.events&&(this.events=t.extend({},o.events,this.events)),o.elements&&(this.elements=t.extend({},o.elements,this.elements)),n=o;this.events&&this.delegateEvents(this.events),this.elements&&this.refreshElements(),r.__super__.constructor.apply(this,arguments)}return h(r,e),r.include(n),r.include(i),r.prototype.eventSplitter=/^(\S+)\s*(.*)$/,r.prototype.tag="div",r.prototype.release=function(){return this.trigger("release",this),this.el.remove(),this.unbind(),this.stopListening()},r.prototype.$=function(t){return this.el.find(t)},r.prototype.delegateEvents=function(t){var e,n,i,r,o,s;o=[];for(n in t){if(r=t[n],"function"==typeof r)r=function(t){return function(e){return function(){return e.apply(t,arguments),!0}}}(this)(r);else{if(!this[r])throw new Error(r+" doesn't exist");r=function(t){return function(e){return function(){return t[e].apply(t,arguments),!0}}}(this)(r)}i=n.match(this.eventSplitter),e=i[1],s=i[2],""===s?o.push(this.el.bind(e,r)):o.push(this.el.on(e,s,r))}return o},r.prototype.refreshElements=function(){var t,e,n,i;e=this.elements,n=[];for(t in e)i=e[t],n.push(this[i]=this.$(t));return n},r.prototype.delay=function(t,e){return setTimeout(this.proxy(t),e||0)},r.prototype.html=function(t){return this.el.html(t.el||t),this.refreshElements(),this.el},r.prototype.append=function(){var t,e,n;return e=1<=arguments.length?u.call(arguments,0):[],e=function(){var n,i,r;for(r=[],n=0,i=e.length;n<i;n++)t=e[n],r.push(t.el||t);return r}(),(n=this.el).append.apply(n,e),this.refreshElements(),this.el},r.prototype.appendTo=function(t){return this.el.appendTo(t.el||t),this.refreshElements(),this.el},r.prototype.prepend=function(){var t,e,n;return e=1<=arguments.length?u.call(arguments,0):[],e=function(){var n,i,r;for(r=[],n=0,i=e.length;n<i;n++)t=e[n],r.push(t.el||t);return r}(),(n=this.el).prepend.apply(n,e),this.refreshElements(),this.el},r.prototype.replace=function(e){var n,i,r;return e=e.el||e,"string"==typeof e&&(e=t.trim(e)),r=[this.el,t((null!=(i=t.parseHTML(e))?i[0]:void 0)||e)],n=r[0],this.el=r[1],n.replaceWith(this.el),this.delegateEvents(this.events),this.refreshElements(),this.el},r}(o),t=("undefined"!=typeof window&&null!==window?window.jQuery:void 0)||("undefined"!=typeof window&&null!==window?window.Zepto:void 0)||function(t){return t},a=Object.create||function(t){var e;return e=function(){},e.prototype=t,new e},c=function(t){return Array.prototype.slice.call(t,0)},s=this.Spine={},"undefined"!=typeof module&&null!==module&&(module.exports=s),s.version="1.6.0",s.$=t,s.Events=n,s.Log=i,s.Module=o,s.Controller=e,s.Model=r,o.extend.call(s,n),o.create=o.sub=e.create=e.sub=r.sub=function(t,e){var n;return n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(this),t&&n.include(t),e&&n.extend(e),"function"==typeof n.unbind&&n.unbind(),n},r.setup=function(t,e){var n;return null==e&&(e=[]),n=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return h(e,t),e}(this),n.configure.apply(n,[t].concat(u.call(e))),n},s.Class=o}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty,r=[].slice,o=function(t,e){return function(){return t.apply(e,arguments)}};e=this.Spine||require("spine"),t=e.$,e.Manager=function(t){function i(){this.controllers=[],this.bind("change",this.change),this.add.apply(this,arguments)}return n(i,t),i.include(e.Events),i.prototype.add=function(){var t,e,n,i,o;for(e=1<=arguments.length?r.call(arguments,0):[],o=[],n=0,i=e.length;n<i;n++)t=e[n],o.push(this.addOne(t));return o},i.prototype.addOne=function(t){return t.bind("active",function(e){return function(){var n;return n=1<=arguments.length?r.call(arguments,0):[],e.trigger.apply(e,["change",t].concat(r.call(n)))}}(this)),t.bind("release",function(e){return function(){var n;return e.controllers=function(){var e,i,r,o;for(r=this.controllers,o=[],e=0,i=r.length;e<i;e++)n=r[e],n!==t&&o.push(n);return o}.call(e)}}(this)),this.controllers.push(t)},i.prototype.deactivate=function(){return this.trigger.apply(this,["change",!1].concat(r.call(arguments)))},i.prototype.change=function(){var t,e,n,i,o,s;for(n=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],s=this.controllers,i=0,o=s.length;i<o;i++)e=s[i],e!==n&&e.deactivate.apply(e,t);if(n)return n.activate.apply(n,t)},i}(e.Module),e.Controller.include({active:function(){var t;return t=1<=arguments.length?r.call(arguments,0):[],"function"==typeof t[0]?this.bind("active",t[0]):(t.unshift("active"),this.trigger.apply(this,t)),this},isActive:function(){return this.el.hasClass("active")},activate:function(){return this.el.addClass("active"),this},deactivate:function(){return this.el.removeClass("active"),this}}),e.Stack=function(t){function i(){this.release=o(this.release,this);var t,n,r,s,a,c;i.__super__.constructor.apply(this,arguments),this.manager=new e.Manager,this.router=null!=(r=e.Route)?r.create():void 0,s=this.controllers;for(n in s){if(c=s[n],null!=this[n])throw Error("'@"+n+"' already assigned");this[n]=new c({stack:this}),this.add(this[n])}a=this.routes,t=function(t){return function(e,n){var i;return"function"==typeof n&&(i=n),i||(i=function(){var e;return(e=t[n]).active.apply(e,arguments)}),t.route(e,i)}}(this);for(n in a)c=a[n],t(n,c);this["default"]&&this[this["default"]].active()}return n(i,t),i.prototype.controllers={},i.prototype.routes={},i.prototype.className="spine stack",i.prototype.add=function(t){return this.manager.add(t),this.append(t)},i.prototype.release=function(){var t;return null!=(t=this.router)&&t.destroy(),i.__super__.release.apply(this,arguments)},i}(e.Controller),"undefined"!=typeof module&&null!==module&&(module.exports=e.Manager),"undefined"!=typeof module&&null!==module&&(module.exports.Stack=e.Stack)}.call(this),function(){var t,e,n,i,r,o,s,a,c,l,u,d=[].slice,h=function(t,e){return function(){return t.apply(e,arguments)}},p=function(t,e){function n(){this.constructor=t}for(var i in e)f.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},f={}.hasOwnProperty;u=this.Spine||require("spine"),t=u.$,a=u.Model,c=t({}),e={getURL:function(t){return null!=t.className?this.generateURL(t):this.generateURL(t,encodeURIComponent(t.id))},getCollectionURL:function(t){return this.generateURL(t)},getScope:function(t){return("function"==typeof t.scope?t.scope():void 0)||t.scope},getCollection:function(t){return t.url!==t.generateURL?"function"==typeof t.url?t.url():t.url:null!=t.className?t.className.toLowerCase()+"s":void 0},generateURL:function(){var t,n,i,r,o;return i=arguments[0],t=2<=arguments.length?d.call(arguments,1):[],n=e.getCollection(i)||e.getCollection(i.constructor),o=e.getScope(i)||e.getScope(i.constructor),t.unshift(n),t.unshift(o),r=t.join("/"),r=r.replace(/(\/\/)/g,"/"),r=r.replace(/^\/|\/$/g,""),0!==r.indexOf("../")?a.host+"/"+r:r},enabled:!0,disable:function(t){var e;if(!this.enabled)return t();this.enabled=!1;try{return t()}catch(t){throw e=t}finally{this.enabled=!0}},queue:function(t){return t?c.queue(t):c.queue()},clearQueue:function(){return this.queue([])},config:{loadMethod:"GET",updateMethod:"PUT",createMethod:"POST",destroyMethod:"DELETE"}},n=function(){function n(){}return n.prototype.defaults={dataType:"json",processData:!1,headers:{"X-Requested-With":"XMLHttpRequest"}},n.prototype.queue=e.queue,n.prototype.ajax=function(e,n){return t.ajax(this.ajaxSettings(e,n))},n.prototype.ajaxQueue=function(n,i,r){var o,s,a,l,u,h;return s=null,o=t.Deferred(),l=o.promise(),e.enabled?(h=this.ajaxSettings(n,i),a=void 0!==h.parallel?h.parallel:"GET"===h.type,u=function(n){var i,l,u;if(null!=(null!=r?r.id:void 0)&&(null==h.url&&(h.url=e.getURL(r)),null!=(i=h.data)&&(i.id=r.id)),"string"!=typeof h.data&&h.processData!==!0&&(h.data=JSON.stringify(h.data)),u=function(){return o.resolve.apply(this,d.call(arguments).concat([h]))},l=function(){return o.reject.apply(this,d.call(arguments).concat([h]))},s=t.ajax(h),s.done(u),s.fail(l),s.then(n,n),a)return c.dequeue()},l.abort=function(e){var n;return s?s.abort(e):(n=t.inArray(u,this.queue()),n>-1&&this.queue().splice(n,1),o.rejectWith(h.context||h,[l,e,""]),l)},this.queue(u),l):l},n.prototype.ajaxSettings=function(e,n){return t.extend({},this.defaults,n,e)},n}(),i=function(t){function n(t){this.model=t,this.failResponse=h(this.failResponse,this),this.recordsResponse=h(this.recordsResponse,this)}return p(n,t),n.prototype.find=function(t,n,i){var r;return null==i&&(i={}),r=new this.model({id:t}),this.ajaxQueue(n,{type:i.method||e.config.loadMethod,url:i.url||e.getURL(r),parallel:i.parallel}).done(this.recordsResponse(i)).fail(this.failResponse(i))},n.prototype.all=function(t,n){return null==n&&(n={}),this.ajaxQueue(t,{type:n.method||e.config.loadMethod,url:n.url||e.getURL(this.model),parallel:n.parallel}).done(this.recordsResponse(n)).fail(this.failResponse(n))},n.prototype.fetch=function(t,e){var n;return null==t&&(t={}),null==e&&(e={}),(n=t.id)?(delete t.id,this.find(n,t,e).done(function(t){return function(n){return t.model.refresh(n,e)}}(this))):this.all(t,e).done(function(t){return function(n){return t.model.refresh(n,e)}}(this))},n.prototype.recordsResponse=function(t){return function(e){return function(n,i,r,o){var s;return e.model.trigger("ajaxSuccess",null,i,r,o),null!=(s=t.done)?s.call(e.model,o):void 0}}(this)},n.prototype.failResponse=function(t){return function(e){return function(n,i,r,o){var s;return e.model.trigger("ajaxError",null,n,i,r,o),null!=(s=t.fail)?s.call(e.model,o):void 0}}(this)},n}(n),l=function(t){function n(t){this.record=t,this.failResponse=h(this.failResponse,this),this.recordResponse=h(this.recordResponse,this),
|
|
this.model=this.record.constructor}return p(n,t),n.prototype.reload=function(t,n){return null==n&&(n={}),this.ajaxQueue(t,{type:n.method||e.config.loadMethod,url:n.url,parallel:n.parallel},this.record).done(this.recordResponse(n)).fail(this.failResponse(n))},n.prototype.create=function(t,n){return null==n&&(n={}),this.ajaxQueue(t,{type:n.method||e.config.createMethod,contentType:"application/json",data:this.record.toJSON(),url:n.url||e.getCollectionURL(this.record),parallel:n.parallel}).done(this.recordResponse(n)).fail(this.failResponse(n))},n.prototype.update=function(t,n){return null==n&&(n={}),this.ajaxQueue(t,{type:n.method||e.config.updateMethod,contentType:"application/json",data:this.record.toJSON(),url:n.url,parallel:n.parallel},this.record).done(this.recordResponse(n)).fail(this.failResponse(n))},n.prototype.destroy=function(t,n){return null==n&&(n={}),this.ajaxQueue(t,{type:n.method||e.config.destroyMethod,url:n.url,parallel:n.parallel},this.record).done(this.recordResponse(n)).fail(this.failResponse(n))},n.prototype.recordResponse=function(t){return function(e){return function(n,i,r,o){var s;return null!=n&&Object.getOwnPropertyNames(n).length&&!e.record.destroyed&&e.record.refresh(n,{ajax:!1}),e.record.trigger("ajaxSuccess",e.record,e.model.fromJSON(n),i,r,o),null!=(s=t.done)?s.call(e.record,o):void 0}}(this)},n.prototype.failResponse=function(t){return function(e){return function(n,i,r,o){var s;switch(o.type){case"POST":e.createFailed();break;case"DELETE":e.destroyFailed()}return e.record.trigger("ajaxError",e.record,n,i,r,o),null!=(s=t.fail)?s.call(e.record,o):void 0}}(this)},n.prototype.createFailed=function(){return this.record.remove({clear:!0})},n.prototype.destroyFailed=function(){return this.record.destroyed=!1,this.record.constructor.refresh(this.record)},n}(n),a.host="",o={include:function(){var t;return t=1<=arguments.length?d.call(arguments,0):[],t.unshift(encodeURIComponent(this.id)),e.generateURL.apply(e,[this].concat(d.call(t)))},extend:function(){var t;return t=1<=arguments.length?d.call(arguments,0):[],e.generateURL.apply(e,[this].concat(d.call(t)))}},s={ajax:function(){return new l(this)},generateURL:o.include,url:o.include},r={ajax:function(){return new i(this)},generateURL:o.extend,url:o.extend},a.Ajax={extended:function(){return this.fetch(this.ajaxFetch),this.change(this.ajaxChange),this.extend(r),this.include(s)},ajaxFetch:function(){var t;return(t=this.ajax()).fetch.apply(t,arguments)},ajaxChange:function(t,e,n){var i;if(null==n&&(n={}),n.ajax!==!1)return"function"==typeof(i=t.ajax())[e]?i[e](n.ajax,n):void 0}},a.Ajax.Methods={extended:function(){return this.extend(r),this.include(s)}},e.defaults=n.prototype.defaults,e.Base=n,e.Singleton=l,e.Collection=i,u.Ajax=e,"undefined"!=typeof module&&null!==module&&(module.exports=e)}.call(this),function(){var t,e;window.MB=window.MB||{},window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,MB.serverCountry="CN",jQuery.timeago&&(jQuery.timeago.settings.lang=window.MBLocale),MB.v={},MB.l={},MB.f={ga:{},inSharing:/^\/app/.test(window.location.pathname),isDuplicateDemo:!1,minFSWarned:!1},MB.config={showRuler:!0,showGeneral:!0,screenBg:"#FFFFFF",assetWidth:158,ignoreError:/(Network error|Uncaught InvalidStateError|Uncaught #<Event>|Blocked a frame|NPObject)/,rulerWidth:16,lnMinWidth:244,screenContainerWidth:1e4,panelBaseZIndex:100,colorList:["#FF7100","#5B6B73"],disableColorList:["#C8CDD0","#C8CDD0"],SCALES:[20,30,50,75,80,90,100,120,150,200,300,400]},MB.maxTimestamp=1,MB.browserInfo=function(){var t,e,n;return n=navigator.userAgent,e=void 0,t=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],/trident/i.test(t[1])?(e=/\brv[ :]+(\d+)/g.exec(n)||[],{name:"IE",version:parseFloat(e[1]||"")}):"Chrome"===t[1]&&(e=n.match(/\b(OPR|Edge)\/(\d+)/),null!==e)?{name:e[1].replace("OPR","Opera"),version:parseFloat(e[2])}:(t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=n.match(/version\/(\d+)/i))&&t.splice(1,1,e[1]),{name:t[0],version:parseFloat(t[1])})}(),MB.checkFA=function(t){var e,n;for(e=n=12;n>=1;e=--n)$("#font-preload .ah").css("font-size",e+"px"),$("#font-preload .ah").css("line-height","100%"),$("#font-preload .ah").text("a").height()===e&&(MB.config.minFS=e);return t()},MB.trackPageView=function(t){return window.ga&&ga("send","pageview",{page:t})},MB.ga=function(){var t;return t=arguments[arguments.length-1],window.ga&&!this.f.ga[t]&&window.ga.apply(window,arguments),this.f.ga[t]=!0},MB.event=function(t,e,n){return null==e&&(e="goal"),null==n&&(n="v3"),MB.ga("send","event",e,"["+n+"]"+t)},MB.isMac=function(){return/(Macintosh)/i.test(navigator.userAgent)},MB.isWindows=function(){return/(Windows)/i.test(navigator.userAgent)},MB.isElectron=function(){return/Electron/i.test(navigator.userAgent)},MB.isLegacyElectron=function(){var t,e,n,i,r;return!!(t=window.isElectron)&&(r=t.split("."),e=r[0],n=r[1],i=r[2],(e-0||n-6||i-4)<0)},MB.isPhantom=function(){return/Phantom/i.test(navigator.userAgent)},MB.isWechat=function(){return/MicroMessenger/i.test(navigator.userAgent)},MB.isEmbedded=function(){return $("body").hasClass("embed")},MB.isChrome=function(){return/Chrome/i.test(navigator.userAgent)},MB.isChrome63=function(){return/Chrome\/63/i.test(navigator.userAgent)},MB.isFirefox=function(){return/Firefox/i.test(navigator.userAgent)},MB.isMobile=function(){return/(iPod|iPhone|iPad|Android)/.test(navigator.userAgent)},MB.isAndroid=function(){return/Android/i.test(navigator.userAgent)},MB.isiPad=function(){return/(iPad)/.test(navigator.userAgent)},MB.isIOS=function(){return/(iPod|iPhone|iPad)/.test(navigator.userAgent)},MB.isOffline=function(){return Boolean(window.MBData)},MB.isStandAlone=function(){return navigator.standalone},MB.isIOS9=function(){return/(9_0|9_1)/.test(navigator.userAgent)},MB.isIOS11=function(){return/11_\d/.test(navigator.userAgent)},MB.isOddIOS=function(){return MB.isStandAlone()&&MB.isIOS9()&&(window.innerHeight>window.innerWidth||MB.isiPad())},MB.pointInRect=function(t,e,n){return t>n.left&&t<n.left+n.width&&e>n.top&&e<n.top+n.height},MB.project=function(){return MB.currentProject},MB.staticMap=function(){return"/images/workspace/staticmap_"+window.MBLocale+".png"},MB.exceedProjectQuota=function(t,e){var n,i,r;return n=!1,t&&(t.expired||t.limitation.collaborators<1)&&(r=t.owner_id===MB.user.id?"user":"team",MB.promptRenew(e+"_team_project",{action:"renew",role:r,plan:t.owner_plan}),n=!0),t||!MB.user.expired&&"free"!==MB.user.plan||(i=Project.select(function(t){return t.owner_id===MB.user.id&&!t.team_cid}),i.length>=MB.user.limitation.projects&&(MB.promptRenew("user_projects",{action:"upgrade",role:"user",plan:MB.user.current_plan}),n=!0)),n},MB.scale=function(){return $("body").data("scale")},MB.preference=function(){return Preference.first()},MB.readDataURL=function(t,e,n){var i,r;if(t)return r=/^image\/(png|jpg|jpeg|gif|svg|tiff|svg\+xml)$/i,r.test(t.type)?t.size>1024e3?n?n(new Error(I18N.file_too_large)):MB.alert({title:I18N.file_too_large,desc:I18N.optimize_your_image,isHTML:!0}):(i=new FileReader,i.onload=function(t){var n,i;return n=t.target.result,i=new Image,i.onload=function(){return e(n,i.width,i.height)},i.src=n},i.readAsDataURL(t)):n?n(new Error(I18N.unsupported)):alert(I18N.unsupported)},MB.supportedBrowser=function(){return/(Webkit|Firefox|Coding_iOS|Trident\/7.0)/i.test(navigator.userAgent)},MB.nextgid=function(t){return t?t.substr(0,21)+"-"+Math.uuid(21,16):null},MB.cloneBuiltin=function(t,e,n){var i;return i="/app/"+t+"/duplicate.json",MB.safeLoading(I18N.load_project),$.getJSON(i,function(){return function(t){var i;if(t.project.combo)i=new Combo;else{if(!t.project.template)return;i=new Template}return i.load(t.project),e&&(i.name=e,i.lsave()),Screen.refresh(t.screens),Widget.refresh(t.widgets),Link.refresh(t.links),Panel.refresh(t.panels),ScreenAlign.refresh(t.screen_aligns),$("#safemode").hide(),n(i)}}(this))},MB.triggerProgress=function(t){var e,n;return $("body").trigger("queue:save"),n=MB.autoSaver.queue.length,e=setInterval(function(){var n;if(n=MB.autoSaver.queue.length,0===n&&(clearInterval(e),"function"==typeof t))return t()},1e3)},MB.checkDupProgress=function(t,e){return setTimeout(function(){return function(){var n,i;return i="/sidekiq/critical/job/"+t+".json",n=$.getJSON(i,function(n){return"complete"===n.result?"function"==typeof e?e():window.location.reload():MB.checkDupProgress(t,e)})}}(this),2e3)},MB.unescape=function(t){var e;return e={"&":"&","<":"<",">":">"},t.replace(/(&|<|>)/g,function(t){return e[t]})},MB.strip=function(t){var e;return e=document.createElement("div"),e.innerHTML=t,e.textContent||e.innerText||""},MB.isEditing=function(t){var e;return!!t&&(e=(t.target||t.srcElement).tagName,"INPUT"===e||"SELECT"===e||"TEXTAREA"===e||MB.f.editing)},MB.hex=function(t){return("0"+parseInt(t).toString(16)).slice(-2)},MB.rgb2hex=function(t){return t&&"rgba(0, 0, 0, 0)"!==t&&"transparent"!==t?(t=t.match(/^rgb[a]*\((\d+),\s*(\d+),\s*(\d+)/),"#"+this.hex(t[1])+this.hex(t[2])+this.hex(t[3])):"transparent"},MB.hex2rgb=function(t){return t=parseInt(t.indexOf("#")>-1?t.substring(1):t,16),{r:t>>16,g:(65280&t)>>8,b:255&t}},MB.atan2=function(t,e){return Math.atan2(e,t)/Math.PI*180},MB.cos=function(t){return Math.cos(t/180*Math.PI)},MB.sin=function(t){return Math.sin(t/180*Math.PI)},MB.hypotenuse=function(t,e){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2))},MB.activePanel=function(){return $("#screens").find(".panel.selected").length},MB.canvasLeft=function(){return MB.activePanel()?document.querySelector(".panel.selected").getBoundingClientRect().left:document.querySelector("#canvas").getBoundingClientRect().left},MB.canvasTop=function(){return MB.activePanel()?document.querySelector(".panel.selected").getBoundingClientRect().top:document.querySelector("#canvas").getBoundingClientRect().top},MB.trigger=function(t,e){return $("body").trigger(t,e)},MB.lastTimestamp=function(){return MB.maxTimestamp+1},MB.safeLoading=function(t){return t===!1?$("#safemode").hide():"number"==typeof t?$("#safemode .progress").text(""):($("#safemode .text").html(t),$("#safemode .progress").text(""),$("#safemode").show())},MB.globalStateAlert=function(){return!(!MB.currentScreen.cscreenstates().length||MB.getIsGlobalActive())&&(MB.alert({title:I18N.warning,desc:I18N.global_state_alert,isHTML:!0}),!0)},MB.minFontSizeIssue=function(){if(!(MB.f.inSharing||MB.f.minFSWarned||MB.isMobile()||MB.isPhantom()))return MB.f.minFSWarned=!0,MB.alert({title:I18N.warning,desc:I18N.font_size_issue,confirmText:I18N.know_how}).then(function(){return function(t){if(t)return window.open("https://modao.cc/posts/9166")}}(this))},MB.clearPasteBoard=function(){return $("#clipboard").focus().select(),document.execCommand("copy"),setTimeout(function(){return $("#clipboard").blur()},100)},MB.refreshWorkspaceRoute=function(){if(window.parent&&window.parent!==window)try{return window.parent.history.replaceState({},"",location.pathname+location.search)}catch(t){}},MB.supportsPassive=!1;try{e=Object.defineProperty({},"passive",{get:function(){return MB.supportsPassive=!0}}),window.addEventListener("test",null,e)}catch(t){}t=function(){var t,e;return t={getItem:function(){},setItem:function(){},removeItem:function(){},clear:function(){}},e=function(){var t;try{return localStorage.setItem("localStorage",1),localStorage.removeItem("localStorage"),!0}catch(e){return t=e,!1}},e()?localStorage:t},MB.localStorageDelegate=t()}.call(this),function(){var t,e,n;MB.SHELLS={ipad_3_4:{device:"ipad",bg:"ipad",width:881,height:1247,top:111,left:56.5},ipad_pro:{device:"ipad",bg:"ipad_pro",width:1224,height:1716,top:175,left:100},web:{device:"web",bg:"desktop",width:960,height:1200,top:0,left:0},iphone_5:{device:"iphone_5",bg:"iphone_se",width:379,height:798,top:119,left:32},iphone_6:{device:"iphone_6",bg:"iphone_7",width:435,height:888,top:114,left:30},iphone_6_plus:{device:"iphone_6_plus",bg:"iphone_7_plus",width:482,height:983,top:127,left:34},iphone_x:{device:"iphone_x",bg:"iphone_x",width:431,height:862,top:25,left:28},Huawei:{device:"huawei",bg:"huawei_p9",width:400,height:800,top:77,left:20},samsung:{device:"samsung",bg:"samsung_s7",width:398,height:804,top:85,left:19},google_pixel_2:{device:"google_pixel_2",bg:"google_pixel_2",width:481,height:956,top:112,left:35},google_pixel_2_xl:{device:"google_pixel_2_xl",bg:"google_pixel_2_xl",width:509,height:955,top:70,left:49},android:{device:"android",bg:"nexus_5",width:402,height:798,top:70,left:21}},MB.DEVICES={android:{google_nexus:{width:360,height:640,name:"Google Nexus 5"},google_pixel_2:{width:411,height:731,name:"Google Pixel 2"},google_pixel_2_xl:{width:411,height:823,name:"Google Pixel 2 XL"},samsung:{width:360,height:640,name:"Samsung S7"},Xiaomi:{width:360,height:640,name:"Xiaomi"},Huawei:{width:360,height:640,name:"Huawei P8"},Meizu:{width:360,height:600,name:"Meizu",hide:!0},google_nexus_4:{width:384,height:640,name:"Google Nexus 4",hide:!0},customize:{width:360,height:640,name:"Customize"}},iphone:{iphone_4:{width:320,height:480,scale:100,icon_size:"120x120",name:"iPhone 4",hide:!0},iphone_5:{width:320,height:568,scale:100,icon_size:"120x120",name:"iPhone 5/SE"},iphone_6:{width:375,height:667,scale:100,icon_size:"180x180",name:"iPhone 6/7/8"},iphone_6_plus:{width:414,height:736,scale:100,icon_size:"180x180",name:"iPhone 6/7/8 Plus"},iphone_x:{width:375,height:812,scale:100,icon_size:"180x180",name:"iPhone X"}},ipad:{ipad_3_4:{width:768,height:1024,scale:75,icon_size:"152x152",name:"iPad"},ipad_pro:{width:1024,height:1366,scale:75,icon_size:"152x152",name:"iPad Pro"}},web:{desktop:{width:1440,height:1024,name:"Webpage"}},"default":{iphone:"iphone_6",ipad:"ipad_3_4",android:"google_nexus"}},MB.INSPECTABLES={label:["locked","text","fs","br","bs","ha","va","width","height","top","left","z","th","lh","td","bo","i","bg","bc","tc","o","ts","tsc","ds","sc","ro","padding","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],text_view:["locked","text","fs","br","bs","ha","va","width","height","top","left","z","th","lh","td","bo","i","bg","bc","tc","o","ts","tsc","ds","sc","ro","padding","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration","clip"],sticky:["locked","text","fs","ha","lh","bo","i","td","width","height","top","left","bg","tc","th","slw","slt","padding"],button:["locked","text","fs","br","bs","ha","va","width","height","top","left","z","th","td","bo","i","bg","bc","tc","o","ts","tsc","ds","sc","ro","ls","icon","is","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],icon_button:["locked","is","icon","br","bs","top","left","width","height","z","th","bg","bc","tc","o","ds","sc","ro","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],text_field:["locked","text","fs","br","bs","ha","va","width","height","top","left","z","th","bg","bc","tc","o","ds","sc","ro","td","bo","i","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],mtext_input:["locked","text","fs","br","bs","ha","width","height","top","left","z","th","bg","bc","tc","o","ds","sc","td","bo","i","ls","fixed","fixed_type","input_type"],mtextarea:["locked","text","fs","br","bs","ha","width","height","top","left","z","th","lh","bg","bc","tc","o","ds","sc","td","bo","i","ls","fixed","fixed_type","padding"],mselect:["locked","text","fs","bs","width","height","top","left","z","th","bg","bc","tc","o","ds","sc","td","bo","i","ls","fixed","fixed_type"],"switch":["locked","top","left","z","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],ios_switch:["locked","top","left","z","width","height","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],android_switch:["locked","top","left","z","width","height","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],ios_check:["locked","top","left","z","width","height","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],android_check:["locked","top","left","z","width","height","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],android_radio:["locked","top","left","z","width","height","checked","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],mcheckbox2:["locked","top","left","width","height","z","o","checked","fixed","fixed_type"],mradiobutton:["locked","top","left","width","height","z","o","checked","fixed","fixed_type"],mfile_input:["locked","top","left","width","height","z","o","fixed","fixed_type"],image_view:["locked","bs","br","width","height","top","left","image","z","th","bg","bc","tc","o","p","ds","sc","ro","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration","clip","filter"],map_view:["locked","width","height","top","left","z","fixed","fixed_type"],navigation_bar:["locked","text","fs","top","left","z","width","height","th","td","bo","i","bg","tc","bc","o","ts","tsc","ds","sc","fixed","fixed_type"],nav_bar:["locked","text","fs","top","left","z","width","height","th","td","bo","i","bg","tc","bc","o","ts","tsc","ds","sc","fixed","fixed_type"],search_bar:["locked","text","fs","top","left","width","ha","z","th","bg","tc","bc","o","ds","sc","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],tab_item:["locked","text","is","icon","width","left","top","fs","z","th","bg","tc","o","ds","sc","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],tab_bar:["locked","height","z","th","bg","bc","o","ds","sc","ani_name","ani_delay","ani_count","ani_duration"],hr:["locked","width","height","top","left","o","z","th","bc","ls","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],ve:["locked","width","height","top","left","o","z","th","bc","ls","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],keyboard:["locked","z","numeric"],iphone_keyboard:["locked","width","height","top","left","z","numeric","fixed","fixed_type"],ipad_keyboard:["locked","width","height","top","left","z","numeric","fixed","fixed_type"],android_keyboard:["locked","width","height","top","left","z","numeric","fixed","fixed_type"],status_bar:["locked","text","th","bg","tc","bc","o","z"],ios_status_bar:["locked","text","th","bg","tc","bc","o","width","height","top","left","z","fixed","fixed_type"],iphone_x_status_bar:["locked","text","th","bg","tc","bc","o","width","height","top","left","z","fixed","fixed_type"],android_status_bar:["locked","text","th","bg","tc","bc","o","width","height","top","left","z","fixed","fixed_type"],rectangle:["locked","height","top","left","z","th","bg","bc","o","ds","sc","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],rounded_rect:["locked","text","fs","br","bs","ha","va","width","height","top","left","z","lh","th","td","bo","i","bg","bc","tc","o","ts","tsc","ds","sc","ro","padding","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],circle_rect:["locked","text","fs","bs","ha","va","width","height","top","left","z","lh","th","td","bo","i","bg","bc","tc","o","ts","tsc","ds","sc","ro","padding","ls","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],triangleb:["locked","width","height","top","left","z","th","tc","o","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],triangletl:["locked","width","height","top","left","z","th","tc","o","ro","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"],lr:["locked","width","height","top","left","z","fixed","fixed_type"],webpage:["locked","width","height","top","left","z","text"],pg:["locked","icon"],mtooltip:["locked","text","fs","br","ha","va","width","height","top","left","z","th","lh","td","bo","i","bg","tc","o","ts","tsc","ds","sc","bs","bc","ro","padding","tt_placement","tt_offset","tt_arrow_size","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration"]},MB.INSPECTABLES.pg=["left","top"],e=MB.INSPECTABLES;for(t in e)n=e[t],n.push("v");window.Spine&&(Spine.Model.prototype.refresh=function(t){var e;return e=this.constructor.irecords[this.id],e&&e.load(t),this.trigger("refresh"),this},Spine.Model.State={lsave:function(t,e){var n,i,r,o,s,a,c,l,u,d;if(null==t&&(t=!0),null==e&&(e=!0),Spine.Ajax.disable(function(t){return function(){return t.save()}}(this)),!t)return!0;if(i=this.getState("default").dup(),u=this.getState(this.screenstate_cid),u.restore(this),u.lsave(),o=MB.getIsGlobalActive&&MB.getIsGlobalActive(),!o&&"default"!==this.screenstate_cid)return!0;if(n=this.cs(),!n||!e)return!0;for(l=n.cscreenstates(),s=0,a=l.length;s<a;s++)d=l[s],d.cid!==this.screenstate_cid&&(c=this.getState(d.cid),c.exists()||"default"!==this.screenstate_cid?c.exists()&&o&&(r=c.gid,c.restore(this),c.gid=r,c.lsave(!0,!1)):(c.restore(i),c.lsave(!0,!1)));return"default"!==this.screenstate_cid&&o&&(c=this.getState("default"),r=c.gid,c.restore(this),c.gid=r,c.lsave(!0,!1)),!0},setState:function(t,e){var n,i,r,o;if(t||(t="default"),o=this.screenstate_cid||"default",o!==t)return n=this.getState("default"),n.exists()||n.lsave(!1,!1),r=this.getState(o),r.exists()&&r.restore(this),i=this.getState(t),i.exists()?this.restore(i):this.restore(n),e?(this.screenstate_cid=t,this.lsave(!1,!1)):void 0}},Spine.Model.Dirty={lsave:function(t){return null==t&&(t=!0),Spine.Ajax.disable(function(t){return function(){return t.save()}}(this)),t&&$("body").trigger("queue:add",[this,!1]),!0},ldestroy:function(t){if(null==t&&(t=!0),Spine.Ajax.disable(function(t){return function(){return t.destroy()}}(this)),t)return $("body").trigger("queue:add",[this,!0])}})}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};this.Project=function(e){function i(){i.__super__.constructor.apply(this,arguments)}return t(i,e),i.configure("Project","cid","created_at","updated_at","password","access","access_token","name","icon","splash","screens_count","width","height","scale","device","model","shell_type","_shell_type","archived","deleted","destroyed","highlight","_highlight","combo","template","wechat","duplicating","owner_id","owner_email","owner_name","owner_avatar","owner_plan","owner_paid","expired","validated","parent_cid","auto_scale","description","version","team_cid","slack_web_hook_url","channels","png_scale","pngs_scale","limitation"),i.include(Spine.Model.Dirty),i.extend(Spine.Model.Ajax),i.prototype.load=function(t){var e;return this.id=t.cid,i.__super__.load.call(this,t),this.access_token||(this.access_token=Math.uuid(33)),this.model||(this.model=this.device_model()),void 0===this._highlight&&(this._highlight=t.highlight),this._shell_type||(this._shell_type=t.shell_type),e="web"===this.device?100:200,this.png_scale||(this.png_scale=e),this.pngs_scale||(this.pngs_scale=e)},i.prototype.cscreens=function(){return Screen.findAllByAttribute("project_cid",this.cid)},i.prototype.cteam=function(){return Team.find(this.team_cid)},i.prototype.type=function(){return this.template?"template":this.combo?"combo":"project"},i.prototype.rootScreens=function(){var t;return t=Screen.select(function(t){return function(e){return e.project_cid===t.cid&&!e.parent_cid}}(this)),t.sort(function(t,e){return t.position-e.position})},i.prototype.homeScreen=function(){return this.rootScreens()[0]},i.prototype.orient=function(){return"customize"===this.model||"web"===this.device?"portrait":this.width>this.height?"landscape":"portrait"},i.prototype.isPrivate=function(){return"private"===this.access},i.prototype.isPublic=function(){return"public"===this.access},i.prototype.isWeb=function(){return"web"===this.device},i.prototype.isAndroid=function(){return"android"===this.device&&("customize"!==this.model||this.width<=720)},i.prototype.swidth=function(t){return t===this.orient()?this.width:this.height},i.prototype.sheight=function(t){return t===this.orient()?this.height:this.width},i.prototype.deviceShell=function(){var t;return["customize","Meizu"].indexOf(this.model)!==-1||"device"!==this._shell_type?null:MB.SHELLS[this.model]||MB.SHELLS[this.device]?t=$.extend({},MB.SHELLS[this.model]||MB.SHELLS[this.device]):null},i.prototype.defaultShell=function(){var t,e,n,i,r,o;return r="none"===this._shell_type?0:12,o=this.width+2*r,i=this.height+2*r,n=this.template||this.combo||"customize"===this.model||"web"===this.device?o:Math.min(o,i),e=this.template||this.combo||"customize"===this.model||"web"===this.device?i:Math.max(o,i),t={device:"default",width:n,height:e,top:r,left:r}},i.prototype.icon_size=function(){return MB.DEVICES[this.device][this.model].icon_size},i.prototype.splash_width=function(){return MB.DEVICES[this.device][this.model].width},i.prototype.splash_height=function(){return MB.DEVICES[this.device][this.model].height},i.prototype.shell=function(){var t,e,n,i;return i=this.deviceShell()||this.defaultShell(),e=this.homeScreen(),e&&"landscape"===e.orientation&&(t=i.height,n=i.left,i.height=i.width,i.width=t,i.left=i.top,i.top=n),i},i.prototype.device_model=function(){var t,e,n,i,r;r=Math.min(this.width,this.height),t=Math.max(this.width,this.height),n=MB.DEVICES[this.device];for(e in n)if(i=n[e],r===i.width&&t===i.height)return e},i.prototype.device_name=function(){switch(this.device){case"android":return"Android";case"web":return I18N.w.webpage;default:return MB.DEVICES[this.device][this.model].name}},i.prototype.setResolution=function(t,e){var n,i;if(this.width!==t||this.height!==e)return i=this.width,n=this.height,this.width=t,this.height=e,n?this.download(function(r){return function(){var o,s,a,c;for(a=r.cscreens(),o=0,s=a.length;o<s;o++)c=a[o],"portrait"===c.orientation?(c.width=t,e>n&&(c.height=e+(c.height-n))):(c.width=e,t>i&&(c.height=t+(c.height-i))),c.lsave();return r.setComponentWidth(r.width),MB.safeLoading(I18N.in_progress),MB.triggerProgress(function(){return $("#safemode").hide()})}}(this)):this.setComponentWidth(this.width)},i.prototype.setComponentWidth=function(t){var e,i;return i=this.cscreens().map(function(t){return t.cid}),e=["status_bar","iphone_status_bar","iphone_x_status_bar","android_status_bar","navigation_bar","nav_bar","tab_bar","keyboard","iphone_keyboard","ipad_keyboard","android_keyboard"],Widget.select(function(){return function(r){var o,s;if(o=r.name,n.call(e,o)>=0&&(s=r.screen_cid,n.call(i,s)>=0))return r.left=null,r.top=null,r.width=t,"status_bar"===r.name&&(r.height=MB.COMPONENTS[r.name].height),"keyboard"===r.name&&(r.height=r.cs().kbDH()),r.lsave()}}(this))},i.prototype.setup=function(){return"android"===this.device?this.setupAndroid():this.setupiOS()},i.prototype.setDevice=function(){return!0},i.prototype.setupAndroid=function(){return MB.COMPONENTS.status_bar.height=23,MB.COMPONENTS.nav_bar.top=23,MB.COMPONENTS.nav_bar.height=55},i.prototype.setupiOS=function(){return"iphone_x"===this.model?(MB.COMPONENTS.status_bar.height=44,MB.COMPONENTS.nav_bar.top=44,MB.COMPONENTS.nav_bar.height=45):(MB.COMPONENTS.status_bar.height=20,MB.COMPONENTS.nav_bar.top=20,MB.COMPONENTS.nav_bar.height=45)},i.prototype.isTeam=function(){return!1},i.prototype.collaborators=function(){return Collaborator.select(function(t){return function(e){return"MOCK"!==e.email&&(e.project_cid===t.cid||t.team_cid&&e.team_cid===t.team_cid)}}(this))},i.prototype.collaboratorByUid=function(t){var e,n,i,r;for(r=this.collaborators(),n=0,i=r.length;n<i;n++)if(e=r[n],e.user_id===t)return e;return null},i.prototype.roleByUid=function(t){var e;return t===this.owner_id?"admin":(e=this.collaboratorByUid(t),e?e.role:"none")},i.prototype.canEdit=function(){var t;return"admin"===(t=this.roleByUid(MB.user.id))||"editor"===t},i.prototype.canAdmin=function(){return"admin"===this.roleByUid(MB.user.id)},i.prototype.isCollaborated=function(){return this.collaborators().length>1},i.prototype.isViewOnly=function(){return this.isCollaborated()&&this.limitation.collaborators<1},i.prototype.leftPanelMode=function(){return localStorage[this.cid+"_leftPanelMode"]},i.prototype.setLeftPanelMode=function(t){return localStorage[this.cid+"_leftPanelMode"]=t},i.prototype.fixBadScreens=function(){return Screen.each(function(t){return function(e){var n;if(e.project_cid===t.cid&&e.parent_cid)return n=e.parent(),(!n||n&&n.project_cid!==t.cid)&&(MB.ga("send","event","bug","\u53d1\u73b0\u4e00\u4e2a\u6ca1\u6709\u7236\u9875\u9762\u7684\u9875\u9762: "+e.cid),e.parent_cid=null,e.lsave()),ScreenManager.fixBadScreen(e)}}(this))},i.prototype.download=function(t,e){return this.cscreens().length>0?t():(MB.safeLoading(I18N.load_project),MB.pusher.subscribe(this.cid),$.getJSON("/templates.json",function(n){return function(i){return Template.refresh(i.templates),Combo.refresh(i.combos),Screen.refresh(i.screens),Widget.refresh(i.widgets),Link.refresh(i.links),$.ajax({type:"GET",url:"/app/"+n.access_token+".json?password="+md5(n.password),timeout:18e4,success:function(e){var i,r,o,s,a,c,l;for(a=e.templates,i=0,o=a.length;i<o;i++)l=a[i],l.host_cid=n.cid;for(Template.refresh(e.templates),Screen.refresh(e.screens),n.fixBadScreens(),Widget.refresh(e.widgets),Link.refresh(e.links),Panel.refresh(e.panels),ScreenAlign.refresh(e.screen_aligns),Screenstate.refresh(e.screenstates),Widgetstate.refresh(e.widgetstates),Panelstate.refresh(e.panelstates),CommentThread.refresh(e.threads),Comment.refresh(e.comments),c=e.templates,r=0,s=c.length;r<s;r++)l=c[r],MB.pusher.subscribe(l.cid);return MB.pusher.open||!n.isCollaborated()?($("#safemode").hide(),t()):($("#safemode .text").text(I18N.connect_to_push_server),MB.pusher.onOpen=function(){return $("#safemode").hide(),t()})},error:e})}}(this)))},i.prototype.duplicate=function(t,e,n){var r,o,s,a,c,l,u,d,h,p,f,g,m,v,y,b,_,w,x,S,M,k,T,B,C,E,A,j,P,L,N,D,$,O,W,I,R,H,F,z,q,X,Y,U,J;for(null==t&&(t=!0),null==e&&(e=!1),null==n&&(n={}),A=this.template?"t":this.combo?"c":"p",o=A+Math.uuid(10,16)+(new Date).valueOf(),d=this.template?Template:this.combo?Combo:i,T="break_away"===this.behavior?this.name:this.name+I18N.name_copy,E=new d({name:T,access_token:Math.uuid(31),scale:this.scale,width:this.width,height:this.height,device:this.device,access:this.access,cid:o,icon:"/images/icon_normal.png",splash:this.splash,password:this.password,template:this.template,combo:this.combo,builtin:!1,master:!!t&&this.master,behavior:this.behavior,created_at:(new Date).toISOString(),updated_at:(new Date).toISOString(),model:this.model,archived:!1,auto_scale:this.auto_scale,parent_cid:e?this.cid:null,shell_type:this.shell_type,team_cid:this.team_cid,owner_id:MB.user.id,owner_email:MB.user.email,owner_name:MB.user.name,owner_avatar:MB.user.avatar,limitation:this.limitation}),this.team_cid&&(E.owner_id=this.owner_id,E.owner_email=this.owner_email,E.owner_name=this.owner_name,E.owner_avatar=this.owner_avatar),E.template&&(E.host_cid=MB.project().cid),E.lsave(),F={},p={},U={},C={},z={"default":"default"},L=this.cscreens(),l=0,f=L.length;l<f;l++)H=L[l],H.parent_cid||(a=new Screen({name:H.name,project_cid:E.cid,cid:"s"+Math.uuid(10,16)+(new Date).valueOf(),orientation:H.orientation,position:H.position,expanded:H.expanded,width:H.width,height:H.height,hh:H.hh,fh:H.fh,bgcolor:H.bgcolor,bgimage:H.bgimage}),a.lsave(),F[H.cid]=a.cid);for(N=this.cscreens(),u=0,g=N.length;u<g;u++)r=N[u],r.parent_cid&&(s=new Screen({name:r.name,project_cid:E.cid,parent_cid:F[r.parent_cid],cid:"s"+Math.uuid(10,16)+(new Date).valueOf(),orientation:r.orientation,position:r.position,expanded:r.expanded,width:r.width,height:r.height,hh:r.hh,fh:r.fh,bgcolor:r.bgcolor,bgimage:r.bgimage}),s.lsave(),F[r.cid]=s.cid);for(D=this.cscreens(),S=0,m=D.length;S<m;S++)for(H=D[S],$=H.clinks(),M=0,v=$.length;M<v;M++)x=$[M],q="prev"===x.target_cid?x.target_cid:F[x.target_cid],h=new Link,h.restore(x),h.load({screen_cid:F[H.cid],target_cid:q,cid:"l"+Math.uuid(10,16)+(new Date).valueOf(),sourcestate_cid:z[x.sourcestate_cid],targetstate_cid:z[x.targetstate_cid]}),h.lsave(),p[x.cid]=h.cid;for(O=this.cscreens(),j=0,y=O.length;j<y;j++)for(H=O[j],W=H.cwidgets(),P=0,b=W.length;P<b;P++)Y=W[P],B=null,B=Link.exists(Y.gid)?p[Y.gid]:C[k=Y.gid]||(C[k]=MB.nextgid(Y.gid)),c=new Widget,c.restore(Y),c.load({screen_cid:F[H.cid],cid:"w"+Math.uuid(10,16)+(new Date).valueOf(),gid:B}),c.lsave(),this.template&&(U[Y.cid]=c.cid);if(this.template)for(I=this.cscreens(),X=0,_=I.length;X<_;X++)for(H=I[X],R=Link.findAllByAttribute("state_cid",H.cid),J=0,w=R.length;J<w;J++)x=R[J],q="prev"===x.target_cid?x.target_cid:n[x.target_cid]||x.target_cid,h=new Link,h.restore(x),h.load({screen_cid:null,
|
|
state_cid:F[x.state_cid],target_cid:q,cid:"l"+Math.uuid(10,16)+(new Date).valueOf()}),h.lsave();return MB.pusher.subscribe(this.cid),E},i}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Asset=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Asset","cid","sid","user_id","width","height","image","raw","name","deleted","destroyed","uri","project_cid","timestamp","size","thumb"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t),this.sid||(this.sid=this.cid)},n.prototype.properSrc=function(){return/svg$/.test(this.image)?this.image:this.thumb||this.raw||this.image},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Assettag=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Assettag","cid","tag","asset_cids"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t),this.asset_cids||(this.asset_cids=""),this.assets_count=this.cids().length},n.prototype.cids=function(){var t,e,n,i,r;for(i=this.asset_cids.split(","),r=[],e=0,n=i.length;e<n;e++)t=i[e],t&&r.push(t);return r},n.prototype.addAsset=function(t){var e;return e=this.cids(),e.push(t),this.asset_cids=e.join(","),this.lsave()},n.prototype.removeAsset=function(t){var e,n;return e=this.cids(),n=e.indexOf(t),e.splice(n,1),this.asset_cids=e.join(","),this.lsave()},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.CoWorker=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("CoWorker","name","avatar","screen_cid","last_seen"),n.prototype.load=function(t){return n.__super__.load.call(this,t)},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Collaborator=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Collaborator","name","email","role","project_cid","avatar","cid","team_cid","user_id","channel"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t)},n.prototype.updateHostChannel=function(t){var e,n;if(this.channel&&(e=Project.find(this.project_cid)||Team.find(this.team_cid),e&&e.channels))return n=e.channels.indexOf(this.channel),n===-1&&"update"===t?e.channels.push(this.channel):n!==-1&&"destroy"===t&&e.channels.splice(n,1),e.lsave(!1)},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Combo=function(e){function n(){n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Project","cid","created_at","updated_at","password","access","access_token","name","icon","splash","screens_count","width","height","scale","device","model","shell_type","archived","deleted","destroyed","highlight","combo","template","wechat","owner_id","owner_email","owner_name","owner_avatar","owner_plan","expired","validated","parent_cid","auto_scale","description","version","builtin","limitation"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t),this.access_token||(this.access_token=Math.uuid(33)),this.model||(this.model=this.device_model())},n.prototype.swidth=function(){return this.width},n.prototype.sheight=function(){return this.height},n.prototype.orient=function(){return"portrait"},n.prototype.updatePanelSize=function(t,e){return this.height=e,this.width=t,this.lsave()},n}(Project)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.CommentThread=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("CommentThread","cid","screen_cid","user_id","created_at","updated_at","left","top"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t)},n.prototype.s=function(){return $("body").data("scale")},n.prototype.getLeft=function(){return(this.left||0)*this.s()/100},n.prototype.getTop=function(){return(this.top||0)*this.s()/100},n.prototype.setLeft=function(t){return this.left=Math.round(100*t/this.s())},n.prototype.setTop=function(t){return this.top=Math.round(100*t/this.s())},n}(Spine.Model),this.Comment=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Comment","cid","thread_cid","user_id","created_at","updated_at","message"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t)},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Link=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Link","cid","target_cid","screen_cid","transition","gesture","destroyed","timer","state_cid","menu_offset","timestamp","targetstate_cid","sourcestate_cid","ani_duration","easing","ani_delay","reset","left","right","top","bottom","width","height"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){var e;return this.id=t.cid,n.__super__.load.call(this,t),this.panel_cid="",this.menu_offset||(this.menu_offset=75),this.ani_duration||(this.ani_duration=this.targetstate_cid?"0.4s":"0.2s"),this.ani_delay||(this.ani_delay=""),this.easing||(this.easing="linear"),this.sourcestate_cid||(this.sourcestate_cid="default"),this.targetstate_cid||(this.targetstate_cid=null),e=Screen.find(this.target_cid),e&&e.cp()?this.template=e.cp().template:this.template=!1},n.prototype.cs=function(){return Screen.find(this.screen_cid)},n.prototype.ts=function(){return this.target_cid?Screen.find(this.target_cid):this.targetstate_cid?Screen.find(this.screen_cid):void 0},n.prototype.cwidgets=function(){var t,e;return MB.linkCaches||(MB.linkCaches={}),t=this.cs()?this.cid+this.cs().state_cid:this.cid,MB.linkCaches[t]?MB.linkCaches[t]:(e=[],e=Widget.findAllByAttribute("gid",this.cid),e=e.concat(Panel.findAllByAttribute("gid",this.cid)),MB.linkCaches[t]=e,e)},n.prototype.delay=function(){return this.ani_duration||"0s"},n.prototype.restore=function(t){return this.transition=t.transition,this.timer=t.timer,this.menu_offset=t.menu_offset,this.gesture=t.gesture,this.ani_duration=t.ani_duration,this.ani_delay=t.ani_delay,this.target_cid=t.target_cid,this.targetstate_cid=t.targetstate_cid},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Panel=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Panel","cid","screen_cid","template_cid","top","left","width","height","name","gid","behavior","z","timestamp","v","fixed","fixed_type","main_state_cid","screenstate_cid","locked","timerFired"),n.include(Spine.Model.Dirty),n.include(Spine.Model.State),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,this.moveable=!0,this.gestureable=!0,this.name="panel",n.__super__.load.call(this,t),this.timestamp||(this.timestamp=MB.lastTimestamp()),this.timestamp>MB.maxTimestamp&&(MB.maxTimestamp=this.timestamp),this.zoomable="e,w,n,s",0!==this.z&&(this.z||(this.z=5)),this.ro=0,this.v!==!1&&(this.v||(this.v=!0)),this.locked||(this.locked=!1),this.fixed||(this.fixed=!1),this.fixed_type||(this.fixed_type=1),this.o||(this.o=100),this.main_state_cid||(this.main_state_cid=null),this.screenstate_cid||(this.screenstate_cid="default")},n.prototype.getState=function(t){var e;return e=Panelstate.find(t+this.cid),e||new Panelstate({cid:t+this.cid,screenstate_cid:t,panel_cid:this.cid}).restore(this)},n.ATTRS=["top","left","width","height","v","fixed","fixed_type","z","gid","behavior","template_cid","timestamp","main_state_cid","locked"],n.prototype.restore=function(t){var e,i,r,o;for(t.screen_cid&&(this.screen_cid=t.screen_cid),o=n.ATTRS,i=0,r=o.length;i<r;i++)e=o[i],this[e]=t[e];return this},n.prototype.equals=function(t){var e,i,r,o;for(o=n.ATTRS,i=0,r=o.length;i<r;i++)if(e=o[i],this[e]!==t[e])return!1;return!0},n.prototype.ct=function(){return Template.find(this.template_cid)},n.prototype.states=function(){var t,e,n,i,r;for(n=this.ct().cscreens(),i=[],t=0,e=n.length;t<e;t++)r=n[t],r.panel_cid=this.cid,i.push(r);return i},n.prototype.mainState=function(){var t;return t=Screen.find(this.main_state_cid),t&&t.project_cid===this.template_cid?t:this.ct().homeScreen()},n.prototype.l=function(){return this.left*this.s()/100},n.prototype.t=function(){return this.top*this.s()/100},n.prototype.w=function(){return Math.round(this.width*this.s()/100)},n.prototype.h=function(){return Math.round(this.height*this.s()/100)},n.prototype.r=function(){return this.l()+this.w()},n.prototype.b=function(){return this.t()+this.h()},n.prototype.bR=function(){return 0},n.prototype.rect=function(){return{top:this.top,left:this.left,width:this.width,height:this.height,right:this.left+this.width,bottom:this.top+this.height}},n.prototype.s=function(){return 100},n.prototype.inspectables=function(){return["states","left","top","width","height","fixed","fixed_type","v","main_state_cid","locked"]},n.prototype.cs=function(){return this._cs||(this._cs=Screen.find(this.screen_cid))},n.prototype.isFooter=function(){return!1},n.prototype.inFooter=function(){return this.t()>=this.cs().footerTop()&&this.t()<=this.cs().height},n.prototype.valid=function(){var t;return t=Template.find(this.template_cid),!(!t||!t.cscreens().length)||(MB.ga("send","event","bug","\u53d1\u73b0\u4e00\u4e2a\u9875\u9762\u6ca1\u6709\u4e0b\u8f7d\u7684\u6bcd\u7248"),this.ldestroy(),!1)},n.prototype.isBottomFixed=function(t){return parseInt(this.fixed_type)===Widget.FIX_TYPE.bottom||this.fixed_type===Widget.FIX_TYPE.auto&&this.t()>t.h()-t.dH()/2},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Panelstate=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Panelstate","screen_cid","cid","template_cid","top","left","width","height","name","gid","behavior","z","timestamp","v","fixed","fixed_type","main_state_cid","screenstate_cid","panel_cid","locked"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){if(n.__super__.load.call(this,t),"default"!==this.screenstate_cid)return this.screen_cid=null},n}(Panel)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Preference=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Preference","cid","gt","gl","asset","at","al","rt","rl","link_line","grid","ct","cl","pt","pl","ruler","guide","app_order"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return n.__super__.load.call(this,t),this.states=!0},n}(Spine.Model)}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty,i=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};t=function(){return function(t){var e;return e=t.cid,/^w_default_/.test(e)}}(this),this.Screen=function(n){function r(){r.__super__.constructor.apply(this,arguments)}return e(r,n),r.configure("Screen","cid","name","orientation","position","project_cid","parent_cid","expanded","height","hh","fh","bgcolor","bgimage","width","artboard_id","artboard_asset_id","state_cid","_widgetsByName"),r.include(Spine.Model.Dirty),r.extend(Spine.Model.Ajax),r.prototype.load=function(t){if(this.id=t.cid,r.__super__.load.call(this,t),this.project_cid||(this.project_cid=t.Project_cid),this.project_cid)return this.height||(this.height=this.cp().sheight(this.orientation||this.orient())),this.width||(this.width=this.cp().swidth(this.orientation||this.orient())),this.bgcolor||(this.bgcolor=this.dBg()),this.state_cid||(this.state_cid="default")},r.prototype.device=function(){return this.cp().device},r.prototype.scale=function(){return this.cp().scale},r.prototype.orient=function(){return"customize"===this.cp().model?this.width&&this.cp().width!==this.width?"landscape":"portrait":this.orientation.toLowerCase()},r.prototype.h=function(){return Math.round(this.height*MB.scale()/100)},r.prototype.w=function(){return Math.round(this.width*MB.scale()/100)},r.prototype.cp=function(){return Project.find(this.project_cid)||Template.find(this.project_cid)||Combo.find(this.project_cid)},r.prototype.cwidgets=function(){return Widget.findAllByAttribute("screen_cid",this.cid).sort(function(t,e){return t.timestamp-e.timestamp})},r.prototype.cpanels=function(){return Panel.findAllByAttribute("screen_cid",this.cid).sort(function(t,e){return t.timestamp-e.timestamp})},r.prototype.cscreenstates=function(){return Screenstate.findAllByAttribute("screen_cid",this.cid).sort(function(t,e){return t.timestamp-e.timestamp})},r.prototype.citems=function(){var t,e;return e=Widget.findAllByAttribute("screen_cid",this.cid),t=Panel.findAllByAttribute("screen_cid",this.cid),e.concat(t).sort(function(t,e){return t.z!==e.z?t.z-e.z:t.timestamp-e.timestamp})},r.prototype.clinks=function(){return Link.select(function(t){return function(e){return e.screen_cid===t.cid&&!e.state_cid}}(this))},r.prototype.parent=function(){return r.find(this.parent_cid)},r.prototype.expandable=function(){var t,e,n,r;for(r=this,t=[r.cid];e=r.parent();)n=e.cid,i.call(t,n)>=0?(r.parent_cid=null,r.lsave()):(r=e,t.push(r.cid));return t.length<4},r.prototype.siblings=function(){var t;return t=this.parent_cid?this.parent().children():this.cp().rootScreens()},r.prototype.isLastChild=function(){var t,e;return e=this.siblings(),t=e.findIndex(function(t){return function(e){return e.cid===t.cid}}(this)),t===e.length-1},r.prototype.children=function(){var t;return t=r.select(function(t){return function(e){return e.parent_cid===t.cid}}(this)),t.sort(function(t,e){return t.position-e.position})},r.prototype.getState=function(t){return Screenstate.find(t)||new Screenstate({cid:t})},r.prototype.setState=function(t,e){var n,i;if(t!==this.state_cid)return n=this.getState(this.cid+"default"),"default"===this.state_cid&&(n.hh=this.hh,n.fh=this.fh,n.lsave(!1)),this.state_cid=t,this.lsave(!1),i=this.getState(t),this.hh=i.hh||0===i.hh?i.hh:n.hh,this.fh=i.fh||0===i.fh?i.fh:n.fh,e?this.lsave(!1):void 0},r.prototype.setOrientation=function(t){return this.orientation=t,this.height=this.cp().sheight(t),this.width=this.cp().swidth(t)},r.prototype.setup=function(t){var e,n,i,r,o,s,a,c,l,u,d,h;if(e=this.cp(),n=e.device,a=e.model,"web"!==n)return h="iphone_x"===a?"iphone_x":["iphone","ipad"].includes(n)?"ios":"android"===n?"android":void 0,u=new Widget({cid:"w_default_"+Math.uuid(10,16)+(new Date).valueOf(),name:h+"_status_bar",left:null,top:null,width:this.width,height:MB.COMPONENTS[h+"_status_bar"].height,screen_cid:this.cid}),u.lsave(),t&&(c=new Widget({cid:"w_default_"+Math.uuid(10,16)+(new Date).valueOf(),name:"nav_bar",left:null,top:MB.COMPONENTS[h+"_status_bar"].height,height:MB.COMPONENTS.nav_bar.height,text:t,width:this.width,screen_cid:this.cid}),c.lsave()),"iphone_x"===a?(d=new Widget({cid:"w_default_"+Math.uuid(10,16)+(new Date).valueOf(),screen_cid:this.cid,name:"tab_bar",width:this.width,height:34,bc:"transparent"}),d.lsave(),l="portrait"===this.orientation?[799,121,134]:[364,299,214],o=l[0],r=l[1],s=l[2],i=new Widget({cid:"w_default_"+Math.uuid(10,16)+(new Date).valueOf(),screen_cid:this.cid,name:"rounded_rect",bs:0,br:3,bg:"#000000",top:o,left:r,width:s,height:5}),i.lsave()):void 0},r.prototype.maxZ=function(){var t,e;return e=-(1/0),t=!0,Widget.select(function(n){return function(i){return i.screen_cid===n.cid&&"sticky"!==i.name&&(e=Math.max(e,i.z),t=!1),!1}}(this)),Panel.select(function(n){return function(i){return i.screen_cid===n.cid&&"sticky"!==i.name&&(e=Math.max(e,i.z),t=!1),!1}}(this)),t?5:e},r.prototype.minZ=function(){var t,e;return e=1/0,t=!0,Widget.select(function(n){return function(i){return i.screen_cid===n.cid&&"sticky"!==i.name&&(t=!1,e=Math.min(e,i.z)),!1}}(this)),Panel.select(function(n){return function(i){return i.screen_cid===n.cid&&"sticky"!==i.name&&(t=!1,e=Math.min(e,i.z)),!1}}(this)),t?5:e},r.prototype.widgetsByName=function(){var t,e,n,i;if(!this._widgetsByName){for(this._widgetsByName={},n=this.cwidgets(),t=0,e=n.length;t<e;t++)i=n[t],this._widgetsByName[i.name]=i;this.lsave(!1)}return this._widgetsByName},r.prototype.sb=function(){return this.widgetsByName().status_bar},r.prototype.tb=function(){return this.widgetsByName().tab_bar},r.prototype.nb=function(){return this.widgetsByName().navigation_bar},r.prototype.kb=function(){return this.widgetsByName().keyboard},r.prototype.sbH=function(){return this.sb()?this.sb().height:0},r.prototype.tbH=function(){return this.tb()?this.tb().height:0},r.prototype.nbH=function(){return this.nb()?this.nb().height:0},r.prototype.kbH=function(){return"web"!==this.cp().device&&this.kb()?this.kbDH():0},r.KEYBOARDS={ipad:{portrait:[1536,526],landscape:[2048,704]},iphone:{portrait:[640,348],landscape:[1136,252]},android:{portrait:[574,354],landscape:[956,278]}},r.prototype.kbDH=function(){var t,e,n,i;return t=this.cp().device,n=r.KEYBOARDS[t][this.orient()],i=n[0],e=n[1],Math.round(e*this.width/i)},r.prototype.headerHeight=function(e){var n,i,r,o,s,a,c,l,u,d,h,p,f;return null==e&&(e=100),this.cp().template?0:isFinite(this.hh)&&null!==this.hh?this.hh*e/100:(u=this.cp(),n=u.device,a=u.model,d=this.cwidgets(),i=d[0],p=d[1],f="iphone_x"===a?"iphone_x":["iphone","ipad"].includes(n)?"ios":"android"===n?"android":null,s=!!i&&/_status_bar$/.test(i.name)&&t(i),h=s?MB.COMPONENTS[f+"_status_bar"].height:this.sbH(),r=!!p&&"nav_bar"===p.name&&t(p),l=r?MB.COMPONENTS.nav_bar.height:this.nbH(),o=!!i&&"nav_bar"===i.name&&t(i),c=o?MB.COMPONENTS.nav_bar.height+MB.COMPONENTS[f+"_status_bar"].height:null,(c||h+l)*e/100)},r.prototype.footerHeight=function(t){return null==t&&(t=100),this.cp().template||0===this.fh?0:(this.fh||Math.max(this.kbH(),this.tbH()))*t/100},r.prototype.headerHeightS=function(){return this.headerHeight(MB.scale())},r.prototype.footerHeightS=function(){return this.footerHeight(MB.scale())},r.prototype.footerTop=function(){return this.height-this.footerHeight()},r.prototype.dW=function(){return Math.round(this.cp().swidth(this.orient())*MB.scale()/100)},r.prototype.dH=function(){return Math.round(this.cp().sheight(this.orient())*MB.scale()/100)},r.prototype.dBg=function(){return"project"===this.cp().type()?MB.config.screenBg:"transparent"},r.prototype.bg=function(){return this.bgcolor&&"transparent"!==this.bgcolor?this.bgcolor:MB.config.screenBg},r.prototype.eH=function(){return this.h()-this.dH()},r.prototype.splash=function(){return this.cp().splash||""},r.prototype.sa=function(){return ScreenAlign.find(this.cid)||new ScreenAlign({cid:this.cid})},r.prototype.halignLines=function(){var t,e,n,i,r;for(i=this.sa().h.split(","),r=[],t=0,n=i.length;t<n;t++)e=i[t],e&&r.push(Number(e));return r},r.prototype.valignLines=function(){var t,e,n,i,r;for(i=this.sa().v.split(","),r=[],t=0,n=i.length;t<n;t++)e=i[t],e&&r.push(Number(e));return r},r.prototype.duplicate=function(){var t,e,n,i,o,s,a,c,l,u,d,h,p,f,g,m,v,y,b,_,w,x,S,M,k,T,B,C,E,A,j,P,L,N,D,$,O,W,I,R,H,F;for(e=new r({name:this.name+" Copy",project_cid:this.project_cid,orientation:this.orientation,cid:"s"+Math.uuid(10,16)+(new Date).valueOf(),parent_cid:this.parent_cid,width:this.width,height:this.height,hh:this.hh,fh:this.fh,bgcolor:this.bgcolor,bgimage:this.bgimage,state_cid:"default",position:this.position+1,artboard_id:this.artboard_id,artboard_asset_id:this.artboard_asset_id}),e.lsave(),(O=ScreenAlign.find(this.cid))&&(n=new ScreenAlign({cid:e.cid,h:O.h,v:O.v}),n.lsave()),l={},B={},I={"default":"default"},j=this.cscreenstates(),o=0,u=j.length;o<u;o++)W=j[o],M=new Screenstate({screen_cid:e.cid,name:W.name,timestamp:W.timestamp,cid:"ss"+Math.uuid(10,16)+(new Date).valueOf()}),M.lsave(),I[W.cid]=M.cid;for(P=this.clinks(),s=0,d=P.length;s<d;s++)m=P[s],c=new Link,c.restore(m),c.load({screen_cid:e.cid,cid:"l"+Math.uuid(10,16)+(new Date).valueOf(),sourcestate_cid:I[m.sourcestate_cid],targetstate_cid:I[m.targetstate_cid]}),c.lsave(),l[m.cid]=c.cid;for(L=this.cwidgets(),a=0,h=L.length;a<h;a++)for(H=L[a],H.setState("default",!1),T=null,T=Link.exists(H.gid)?l[H.gid]:B[b=H.gid]||(B[b]=MB.nextgid(H.gid)),i=new Widget,i.restore(H),i.load({screen_cid:e.cid,cid:"w"+Math.uuid(10,16)+(new Date).valueOf(),gid:T}),i.lsave(),N=Widgetstate.findAllByAttribute("widget_cid",H.cid),v=0,p=N.length;v<p;v++)F=N[v],I[F.screenstate_cid]&&"default"!==F.screenstate_cid&&(T=Link.exists(F.gid)?l[F.gid]:B[_=F.gid]||(B[_]=MB.nextgid(F.gid)),k=new Widgetstate,k.restore(F),k.load({cid:I[F.screenstate_cid]+i.cid,screenstate_cid:I[F.screenstate_cid],widget_cid:i.cid,gid:T}),k.lsave());for(D=this.cpanels(),y=0,f=D.length;y<f;y++)for(C=D[y],C.setState("default",!1),T=null,T=Link.exists(C.gid)?l[C.gid]:B[w=C.gid]||(B[w]=MB.nextgid(C.gid)),R=Template.find(C.template_cid),"break_away"===R.behavior&&(R=R.duplicate(!1)),t=new Panel,t.restore(C),t.load({screen_cid:e.cid,cid:"p"+Math.uuid(10,16)+(new Date).valueOf(),template_cid:R.cid,gid:T}),t.lsave(),$=Panelstate.findAllByAttribute("panel_cid",C.cid),A=0,g=$.length;A<g;A++)E=$[A],I[E.screenstate_cid]&&"default"!==E.screenstate_cid&&(S=new Panelstate,S.restore(E),T=Link.exists(E.gid)?l[E.gid]:B[x=E.gid]||(B[x]=MB.nextgid(E.gid)),S.load({cid:I[E.screenstate_cid]+t.cid,template_cid:t.template_cid,screenstate_cid:I[E.screenstate_cid],panel_cid:t.cid,gid:T}),S.lsave());return e},r.prototype.getImage=function(){return this.bgimage},r.prototype.getAsset=function(){return Asset.find(this.bgimage)||Asset.findAllByAttribute("image",this.bgimage)[0]},r.prototype.getRealBgImage=function(){var t;return t=Asset.find(this.bgimage),t?t.image||t.raw:this.bgimage},r.prototype.detectConflict=function(t){var e,n,i,r,o,s,a,c;for(s=t?[t]:this.clinks(),e=0,r=s.length;e<r;e++)if(i=s[e],["up","down"].indexOf(i.gesture)!==-1){if(this.height>this.dH())return void MB.alert({title:I18N.gesture_conflict,desc:I18N.vertical_conflict})}else if(["left","right"].indexOf(i.gesture)!==-1)for(c=this.cpanels(),n=0,o=c.length;n<o;n++)if(a=c[n],a.width<a.ct().width)return void MB.alert({title:I18N.gesture_conflict,desc:I18N.horizontal_conflict})},r}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.ScreenAlign=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("screen_align","cid","h","v"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return n.__super__.load.call(this,t),this.h||(this.h=""),this.v||(this.v="")},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Screenstate=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Screenstate","cid","name","screen_cid","timestamp","hh","fh"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t)},n.prototype.cs=function(){return Screen.find(this.screen_cid)},n.prototype.widgetStates=function(){return Widgetstate.findAllByAttribute("screenstate_cid",this.cid)},n.prototype.panelStates=function(){return Panelstate.findAllByAttribute("screenstate_cid",this.cid)},n.prototype.stateLinks=function(){return Link.select(function(t){return function(e){return e.sourcestate_cid===t.cid||e.targetstate_cid===t.cid}}(this))},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Team=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Team","name","icon","cid","owner_id","owner_email","owner_name","owner_avatar","color","updated_at","created_at","channels","limitation"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t)},n.prototype.cprojects=function(){return Project.select(function(t){return function(e){return e.team_cid===t.cid&&!e.deleted&&!e.template&&!e.combo&&e.screens_count}}(this))},n.prototype.collaborators=function(){return Collaborator.select(function(t){return function(e){return"MOCK"!==e.email&&e.team_cid===t.cid}}(this))},n.prototype.collaboratorByUid=function(t){var e,n,i,r;for(r=this.collaborators(),n=0,i=r.length;n<i;n++)if(e=r[n],e.user_id===t)return e;return null},n.prototype.roleByUid=function(t){var e;return t===this.owner_id?"admin":(e=this.collaboratorByUid(t),e?e.role:"none")},n.prototype.canAdmin=function(){return"admin"===this.roleByUid(MB.user.id)},n.prototype.isTeam=function(){return!0},n.prototype.colorO=function(t){return this.color.replace("RGB","RGBA").replace(")",","+t+")")},n}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Template=function(e){function n(){n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Project","cid","created_at","updated_at","password","access","access_token","name","icon","splash","screens_count","width","height","scale","device","model","shell_type","archived","deleted","destroyed","highlight","combo","template","wechat","owner_id","owner_email","owner_name","owner_avatar","owner_plan","expired","validated","parent_cid","auto_scale","description","version","team_cid","builtin","master","behavior","host_cid","limitation"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.masters=function(){return this.select(function(t){return t.master&&!t.deleted})},n.prototype.load=function(t){return this.id=t.cid,n.__super__.load.call(this,t),this.access_token||(this.access_token=Math.uuid(33)),this.model||(this.model=this.device_model())},n.prototype.swidth=function(){return this.width},n.prototype.sheight=function(){return this.height},n.prototype.orient=function(){return"portrait"},n.prototype.updatePanelSize=function(t,e){var n,i,r,o,s,a,c,l;for(a=Panel.findAllByAttribute("template_cid",this.cid),n=0,r=a.length;n<r;n++)s=a[n],s.height=e,s.width===this.width&&(s.width=t),s.lsave();for(c=this.cscreens(),i=0,o=c.length;i<o;i++)l=c[i],l.height=e,l.width=t,l.lsave();return this.height=e,this.width=t,this.lsave()},n}(Project)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};this.Widget=function(e){function i(){return i.__super__.constructor.apply(this,arguments)}return t(i,e),i.configure("Widget","screen_cid","name","text","icon","top","left","width","height","cid","fs","br","bs","is","ha","va","image","z","th","lh","o","ds","sc","bg","tc","bc","bo","i","td","f","ts","tsc","p","destroyed","ro","gid","timestamp","padding","ls","checked","numeric","tt_placement","tt_offset","tt_arrow_size","v","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration","screenstate_cid","input_type","slw","slt","clip","filter","locked","_ratio","_isPanelWidget"),i.include(Spine.Model.Dirty),i.include(Spine.Model.State),i.extend(Spine.Model.Ajax),i.ATTRS=["name","text","icon","width","height","left","top","gid","timestamp","fs","is","bs","br","va","ha","lh","z","th","image","bg","tc","bc","ds","sc","ts","tsc","o","bo","i","td","p","ro","ls","padding","checked","numeric","v","fixed","fixed_type","tt_placement","tt_offset","tt_arrow_size","ani_name","ani_delay","ani_count","ani_duration","input_type","slw","slt","clip","filter","locked"],i.FIX_TYPE={auto:1,top:2,bottom:3},i.MAXZ=Math.pow(2,30)-1,i.prototype.load=function(t){var e;if(this.id=t.cid,i.__super__.load.call(this,t),this.multiline=["text_view","sticky","rounded_rect","circle_rect","mtooltip","mselect"].indexOf(this.name)!==-1,this.richedit=["label","text_view","sticky","rounded_rect","circle_rect","mtooltip"].indexOf(this.name)!==-1,this.iconic=["icon_button","tab_item"].includes(this.name)||"button"===this.name&&!!this.icon,this.moveable=["status_bar","tab_bar","keyboard"].indexOf(this.name)===-1,this.gestureable=["pg","lr","image_view","rectangle","rounded_rect","circle_rect"].indexOf(this.name)!==-1,"mcheckbox"===this.name&&(this.name="mcheckbox2"),MB.COMPONENTS[this.name]?this.zoomable=MB.COMPONENTS[this.name].zoomable||"n,s,e,w,ne,nw,se,sw":this.zoomable=" ",["text_field"].indexOf(this.name)!==-1&&(this.zoomable="n,s,e,w,ne,nw,se,sw"),e=MB.COMPONENTS[this.name],e&&("number"!=typeof this.fs&&(this.fs=e.fs),"number"!=typeof this.is&&(this.is=e.is),"number"!=typeof this.br&&(this.br=e.br),"number"!=typeof this.bs&&(this.bs=e.bs),this.ha||(this.ha=e.ha),this.va||(this.va=e.va),0!==this.z&&(this.z||(this.z=e.z)),e.lh&&(this.lh||(this.lh=Math.floor(this.fs*e.lh))),this.padding||(this.padding=e.padding)),this.text||(this.text=""),"label"===this.name&&(this.text=this.text.replace(/\n$/,"")),this.autoWidth="label"===this.name,this.autoHeight=["mtooltip","text_view","sticky"].indexOf(this.name)!==-1,this.th||(this.th="status_bar"===this.name?"light":""),0!==this.o&&(this.o||(this.o=100)),this.ds||(this.ds=0),this.bs||(this.bs=0),this.br||(this.br=0),this.sc||(this.sc=MB.currentProject&&MB.currentProject.isAndroid()?"#222222":"#aaaaaa"),this.ts||(this.ts=0),this.tsc||(this.tsc="#aaaaaa"),this.bo||(this.bo=0),this.i||(this.i=0),this.td||(this.td="normal"),this.bg||(this.bg=""),this.tc||(this.tc=""),this.bc||(this.bc=""),0!==this.z&&(this.z||(this.z=5)),this.ro||(this.ro=0),this.ls||(this.ls=0),this.filter||(this.filter=""),this.input_type||(this.input_type="text"),this.timestamp||(this.timestamp=MB.lastTimestamp()),this.timestamp>MB.maxTimestamp&&(MB.maxTimestamp=this.timestamp),this.padding||(this.padding=0),this.checked!==!1&&(this.checked||(this.checked=!0)),this.numeric||(this.numeric=!1),this.v!==!1&&(this.v||(this.v=!0)),this.p!==!1&&(this.p||(this.p=!0)),this.locked||(this.locked=!1),this.fixed||(this.fixed=!1),this.fixed_type=parseInt(this.fixed_type||1),this.tt_placement||(this.tt_placement="left"),this.tt_offset||(this.tt_offset=10),this.tt_arrow_size||(this.tt_arrow_size=10),this.screenstate_cid||(this.screenstate_cid="default"),this.ani_name||(this.ani_name="none"),this.slt||(this.slt=20),this.slw||(this.slw=50),"sticky"===this.name&&(this.z=i.MAXZ),"label"===this.name&&/\n/.test(this.text))return this.name="text_view",this.lsave()},i.prototype.cs=function(){return this._cs||(this._cs=Screen.find(this.screen_cid));
|
|
},i.prototype.isFullWidth=function(){return["status_bar","tab_bar","keyboard"].indexOf(this.name)!==-1},i.prototype.isFooter=function(){return["tab_bar","keyboard"].indexOf(this.name)!==-1},i.prototype.inFooter=function(){return!this.isFooter()&&(0!==this.cs().footerHeight()&&(this.t()>=this.cs().footerTop()&&this.t()<=this.cs().height))},i.prototype.getState=function(t){var e;return e=Widgetstate.find(t+this.cid),e||new Widgetstate({cid:t+this.cid,screenstate_cid:t,widget_cid:this.cid}).restore(this)},i.prototype.restore=function(t){var e,n,r,o;for(t.screen_cid&&(this.screen_cid=t.screen_cid),o=i.ATTRS,n=0,r=o.length;n<r;n++)e=o[n],this[e]=t[e];return this},i.prototype.equals=function(t){var e,n,r,o;for(o=i.ATTRS,n=0,r=o.length;n<r;n++)if(e=o[n],this[e]!==t[e])return!1;return!0},i.prototype.styleEquals=function(t){var e,r,o,s,a;for(r="sticky"===t.name?[]:["top","left"],a=i.ATTRS,o=0,s=a.length;o<s;o++)if(e=a[o],n.call(r,e)<0&&this[e]!==t[e])return!1;return!0},i.prototype.status_bar_t=function(){return 0},i.prototype.keyboard_t=function(){return this.cs()?this.cs().height-this.height:null},i.prototype.tab_bar_t=function(){return this.cs()?this.cs().height-this.height:null},i.prototype.navigation_bar_t=function(){return this.cs()?this.cs().sbH():null},i.prototype.t=function(){return"navigation_bar"!==this.name||this.top?this.moveable?this.top:this[this.name+"_t"]():this.navigation_bar_t()},i.prototype.l=function(){return this.left||0},i.prototype.w=function(){return this.isFullWidth()&&this.cs()?this.cs().width:this.width},i.prototype.h=function(){return this.height},i.prototype.r=function(){return this.l()+this.w()},i.prototype.b=function(){return this.t()+this.h()},i.prototype.rect=function(){return this.ro?this._rotateRect():{top:this.t(),left:this.l(),width:this.w(),height:this.h(),right:this.r(),bottom:this.b()}},i.prototype._rotateRect=function(){var t,e,n,i,r,o,s,a,c,l,u,d,h,p;return o=MB.atan2(this.width,this.height),c=o-this.ro,l=c-2*o,u=c+180,d=l+180,e=this.left+this.width/2,n=this.top+this.height/2,r=MB.hypotenuse(this.width/2,this.height/2),s=h=1/0,a=t=-(1/0),[c,l,u,d].forEach(function(i){var o,c;if(o=Math.round(e+r*MB.cos(i)),c=Math.round(n+r*MB.sin(i)),o<s&&(s=o),c<h&&(h=c),o>a&&(a=o),c>t)return t=c}),p=a-s,i=t-h,{top:h,left:s,width:p,height:i,right:a,bottom:t}},i.prototype.s=function(){return 100},i.prototype.fS=function(){var t;return t=(this.fs||0).toFixed(1),t<MB.config.minFS&&t>0&&MB.minFontSizeIssue(),t},i.prototype.bS=function(){return this.bs?Math.floor(this.bs)||1:0},i.prototype.iS=function(){return Math.round(this.is)},i.prototype.bR=function(){return Math.round(this.br)},i.prototype.lH=function(){return Math.round(this.lh)},i.prototype.paddingS=function(){return Math.round(this.padding)},i.prototype.lineStyle=function(){return["solid","dotted","dashed"][this.ls]},i.prototype.arrowSize=function(){return Math.round(this.tt_arrow_size)},i.prototype.ttOffset=function(){return Math.round(this.tt_offset)},i.prototype.inspectables=function(){return MB.INSPECTABLES[this.name]},i.prototype._textWidth=function(){var t,e;return e=document.getElementById("font-preload"),MB.currentProject&&(e.className=MB.currentProject.device),$("#font-preload .aw").css("font-size",this.fs),$("#font-preload .aw").css("font-weight",this.bo?"bold":"normal"),t=$("#font-preload .aw").html(this.text).width()+1+2*this.padding+2*this.bs,t<20&&(t=20),t},i.prototype.textHeight=function(){return this._textHeight(this.text)},i.prototype._textHeight=function(t){var e,n,i,r,o;return o=this.width-2*this.padding-2*this.bs,"mtooltip"===this.name&&["left","right"].indexOf(this.tt_placement)!==-1&&(o-=10),i=this.bo?"bold":"normal",n=document.getElementById("font-preload"),MB.currentProject&&(n.className=MB.currentProject.device),e=n.getElementsByClassName("ah")[0],e.style.fontSize!==this.fs+"px"&&(e.style.fontSize=this.fs+"px"),e.style.width!==o+"px"&&(e.style.width=o+"px"),e.style.lineHeight!==this.lh+"px"&&(e.style.lineHeight=this.lh+"px"),e.style.fontWeight!==i&&(e.style.fontWeight=i),e.innerHTML=MB.v.multiline(t),r=e.offsetHeight+2*this.padding+2*this.bs,r<10&&(r=10),r},i.prototype.minWidth=function(){return["label","button"].indexOf(this.name)!==-1?this._textWidth():10},i.prototype.minHeight=function(){return["label","button"].indexOf(this.name)!==-1?this.lh+2*this.padding+2*this.bs:["mtooltip","text_view","sticky"].indexOf(this.name)!==-1?this.textHeight():10},i.prototype.initialWidth=function(){return["label"].indexOf(this.name)!==-1?this._textWidth():null},i.prototype.initialHeight=function(){return["mtooltip","text_view"].indexOf(this.name)!==-1?this.textHeight():null},i.prototype.clipType=function(){var t;return this.clip?(t=/(.*?)\(/.exec(this.clip)[1],t.charAt(0).toUpperCase()+t.slice(1)):null},i.prototype.clipPolygonPoints=function(){var t,e,n,i,r;for(i=this.clip.split(","),r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(n.replace(/[^\d\s\%]/g,""));return r},i.prototype.clipInsetPoints=function(){var t,e,n,i,r;for(i=this.clip.split(/\s/),r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(parseInt(n.replace(/[^\d]/g,"")));return r},i.prototype.clipCenter=function(){var t;return t=/at (\d*?)\% (\d*?)\%/.exec(this.clip)||[50,50],{x:parseInt(t[1]),y:parseInt(t[2])}},i.prototype.clipCRadius=function(){return parseInt(/(\d*?)\% at/.exec(this.clip)[1])},i.prototype.clipXRadius=function(){return parseInt(/(\d*?)\% (\d*?)\% at/.exec(this.clip)[1])},i.prototype.clipYRadius=function(){return parseInt(/(\d*?)\% (\d*?)\% at/.exec(this.clip)[2])},i.prototype.setClipPoint=function(t,e,n){return"number"==typeof t?this.set_poly_point(t,e):this["set_clip_"+t](e,n)},i.prototype.set_clip_xradius=function(t){var e,n;return e=this.clipCenter(),n=Math.round(Math.abs(e.x-t.left)),this.clip="ellipse("+n+"% "+this.clipYRadius()+"% at "+e.x+"% "+e.y+"%)"},i.prototype.set_clip_yradius=function(t){var e,n;return e=this.clipCenter(),n=Math.round(Math.abs(e.y-t.top)),this.clip="ellipse("+this.clipXRadius()+"% "+n+"% at "+e.x+"% "+e.y+"%)"},i.prototype.set_clip_cradius=function(t,e){var n,i,r,o,s,a,c;return n=this.clipCenter(),r=this.w()*n.x/100,o=this.h()*n.y/100,a=e.position.left-r,c=e.position.top-o,s=Math.sqrt(Math.pow(a,2)+Math.pow(c,2)),i=Math.round(s/(this.w()+this.h())*200),this.clip="circle("+i+"% at "+n.x+"% "+n.y+"%)"},i.prototype.set_clip_ccenter=function(t){return this.clip="circle("+this.clipCRadius()+"% at "+t.left+"% "+t.top+"%)"},i.prototype.set_clip_ecenter=function(t){return this.clip="ellipse("+this.clipXRadius()+"% "+this.clipYRadius()+"% at "+t.left+"% "+t.top+"%)"},i.prototype.set_clip_linset=function(t){var e;return e=this.clipInsetPoints(),this.clip="inset("+e[0]+"% "+e[1]+"% "+e[2]+"% "+t.left+"%)"},i.prototype.set_clip_tinset=function(t){var e;return e=this.clipInsetPoints(),this.clip="inset("+t.top+"% "+e[1]+"% "+e[2]+"% "+e[3]+"%)"},i.prototype.set_clip_rinset=function(t){var e;return e=this.clipInsetPoints(),this.clip="inset("+e[0]+"% "+(100-t.left)+"% "+e[2]+"% "+e[3]+"%)"},i.prototype.set_clip_binset=function(t){var e;return e=this.clipInsetPoints(),this.clip="inset("+e[0]+"% "+e[1]+"% "+(100-t.top)+"% "+e[3]+"%)"},i.prototype.set_clip_cinset=function(t){var e,n,i;return e=this.clipInsetPoints(),n=(100-e[1]-e[3])/2,i=(100-e[0]-e[2])/2,t.top>100-i&&(t.top=100-i),t.top<i&&(t.top=i),t.left>100-n&&(t.left=100-n),t.left<n&&(t.left=n),this.clip="inset("+(t.top-i)+"% "+(100-t.left-n)+"% "+(100-t.top-i)+"% "+(t.left-n)+"%)"},i.prototype.set_poly_point=function(t,e){var n;return n=this.clipPolygonPoints(),n[t]=e.left+"% "+e.top+"%",this.clip="polygon("+n.join(",")+")"},i.prototype.isBottomFixed=function(t){return parseInt(this.fixed_type)===i.FIX_TYPE.bottom||this.fixed_type===i.FIX_TYPE.auto&&this.t()>t.h()-t.dH()/2},i.prototype.get_icon=function(t,e){var n,i,r,o,s,a,c;return c=/^(fa|md|mb|ci)\-/,i=c.test(this.icon),r=(this.icon||"").replace(c,""),s=i?this.icon.split("-")[0]:"fa",a="mb"===s?"icon":s,o=a+"-"+r,n=s+" "+o,!MB.isPhantom()&&t&&"fa-spinner"===o&&(n+=" is-spinning"),'<span class="icon '+n+'" style="'+e+'">'+("md"===s?r:"")+"</span>"},i}(Spine.Model)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;this.Widgetstate=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.configure("Widgetstate","screen_cid","name","text","icon","top","left","width","height","cid","fs","br","bs","is","ha","va","image","z","th","lh","o","ds","sc","bg","tc","bc","bo","i","td","f","ts","tsc","p","destroyed","ro","gid","timestamp","padding","ls","checked","numeric","tt_placement","tt_offset","tt_arrow_size","v","fixed","fixed_type","ani_name","ani_delay","ani_count","ani_duration","screenstate_cid","widget_cid","input_type","slt","slw","clip","filter","locked"),n.include(Spine.Model.Dirty),n.extend(Spine.Model.Ajax),n.serverCount=function(){return this.records.reduce(function(t,e){return t+="d"!==e.screenstate_cid[0]?1:0},0)},n.prototype.load=function(t){if(n.__super__.load.call(this,t),"default"!==this.screenstate_cid&&(this.screen_cid=null),"label"===this.name&&/\n/.test(this.text))return this.name="text_view",this.lsave()},n}(Widget)}.call(this),function(){var t,e,n,i,r,o,s;e='<svg xmlns="http://www.w3.org/2000/svg" width="17" height="12"><path d="M1.25 6.5h1a1 1 0 0 1 1 1V10a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V7.5a1 1 0 0 1 1-1zM5.75 5h1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm4.5-2h1a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4.5-2h1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z" fill-rule="evenodd"/></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="12"><path d="M8.007 2.787a8.64 8.64 0 0 1 5.953 2.379c.12.118.314.116.433-.004l1.156-1.166a.322.322 0 0 0-.003-.456 10.897 10.897 0 0 0-15.08 0 .322.322 0 0 0-.003.456L1.62 5.162c.119.12.312.122.433.004a8.641 8.641 0 0 1 5.954-2.379zm0 3.796c1.217 0 2.391.452 3.294 1.27a.31.31 0 0 0 .433-.006l1.155-1.167a.322.322 0 0 0-.005-.459 7.16 7.16 0 0 0-9.752 0 .322.322 0 0 0-.005.46l1.155 1.166a.31.31 0 0 0 .433.006 4.907 4.907 0 0 1 3.292-1.27zm2.219 2.784a.314.314 0 0 0-.01-.457 3.422 3.422 0 0 0-4.42 0 .314.314 0 0 0-.009.457l1.998 2.016a.312.312 0 0 0 .443 0l1.998-2.016z" fill-rule="nonzero"/></svg>',t='<svg xmlns="http://www.w3.org/2000/svg" width="25" height="12"><path d="M2.667 1.333C1.747 1.333 1 2.08 1 3v6c0 .92.746 1.667 1.667 1.667h16.666C20.253 10.667 21 9.92 21 9V3c0-.92-.746-1.667-1.667-1.667H2.667zm0-1h16.666A2.667 2.667 0 0 1 22 3v6a2.667 2.667 0 0 1-2.667 2.667H2.667A2.667 2.667 0 0 1 0 9V3A2.667 2.667 0 0 1 2.667.333z" opacity=".35"/><path d="M23 4v4a2.17 2.17 0 0 0 0-4" opacity=".4"/><rect x="2" y="2.333" width="18" height="7.333" rx="1.333"/></svg>',i={},MB.v.multiline=function(t){var e,n,i,r,o;if(/^<p>/.test(t))return e=t.replace(/\n/g,"");for(e="",r=t.split(/\n/),n=0,i=r.length;n<i;n++)o=r[n],o||(o=" "),e+="<p>"+o+"</p>";return e},i.text_field=i.navigation_bar=i.nav_bar=function(t){return'<span class="text">'+t.text+"</span>"},i.mtext_input=function(t,e){var n;return n=/p$/.test(e)?"":'readonly="readonly"','<input type="'+t.input_type+'" placeholder="'+t.text+'" '+n+"></input>"},i.mtextarea=function(t,e){var n,i,r,o;return n=/p$/.test(e)?"":'readonly="readonly"',i=Math.round(t.padding*t.s()/100),o=Math.round(i-(t.lh-t.fs)/2),o<0&&(o=0),r="padding:"+o+"px "+i+"px;",'<textarea style="'+r+'" placeholder="'+t.text+'" '+n+"></textarea>"},i.mcheckbox2=function(t){var e;return e=t.checked?'checked="true"':"",'<input type="checkbox" '+e+"></input>"},i.mfile_input=function(t,e){var n;return n=/p$/.test(e)?"onclick='MB.config.fileSelecting = true;'":"",'<input type="file" '+n+"></input>"},i.mradiobutton=function(t){var e;return e=t.checked?'checked="true"':"",'<input type="radio" name="'+t.gid+'" '+e+"></input>"},i.mselect=function(t){var e,n;return n=function(){var n,i,r,o;for(r=t.text.split(/\n/),o=[],n=0,i=r.length;n<i;n++)e=r[n],o.push("<option>"+e+"</option>");return o}().join(""),"<select>"+n+"</select>"},i.button=function(t){return'<div class="button-wrapper">\n '+(t.icon?t.get_icon(!0,"font-size:"+t.iS()+"px;"):"")+'\n <span class="text">'+t.text+"</span>\n</div>"},i.hr=function(t){var e;return e=t.h()-10*t.s()/100,e<1&&(e=1),'<span style="border-top-width: '+e+'px;"></span>'},i.ve=function(t){var e;return e=t.w()-10*t.s()/100,e<1&&(e=1),'<span style="border-left-width: '+e+'px;"></span>'},i.triangleb=function(t){var e,n,i;return i=[[t.width/2,0],[t.width,t.height],[0,t.height]],e="M "+function(){var t,e,r;for(r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(n.join(" "));return r}().join(" L ")+" Z",'<svg xmlns="http://www.w3.org/2000/svg"><path d="'+e+'"></path></svg>'},i.triangletl=function(t){var e,n,i;return i=[[0,0],[t.width,0],[0,t.height]],e="M "+function(){var t,e,r;for(r=[],t=0,e=i.length;t<e;t++)n=i[t],r.push(n.join(" "));return r}().join(" L ")+" Z",'<svg xmlns="http://www.w3.org/2000/svg"><path d="'+e+'"></path></svg>'},i.lr=i.tab_bar=i.rectangle=function(){return"<span></span>"},i.image_view=function(t){var e,n,i,r,o,s;return i=t.p?"auto":"100%",o="",t.image&&("i"===t.image[0]&&t.image.indexOf("images")===-1?(e=Asset.find(t.image),e&&(e.raw||e.image)&&(o="src='"+(e.image||e.raw)+"'")):o="src='"+t.image+"'"),o?(r="none",n="block"):(n="none",r="flex"),s="height:"+i+";display:"+n+";",t.filter.trim()&&(s+="filter:"+t.filter.trim()+";-webkit-filter:"+t.filter.trim()+";"),'<div class="image-wrapper">\n <span style="background-color:'+t.bg+";display:"+r+';">\n <i class="icon-widget-img"></i>\n </span>\n <div class="wrapper">\n <img draggable="false" '+o+' style="'+s+'"/>\n </div>\n</div>'},i.webpage=function(t){return'<div class="webpage-wrapper">\n <span class="text">'+t.text+'</span>\n <p class="notice">'+I18N.https_only+'</p>\n <object class="iframe" type="text/html"></object>\n</div>'},i.video_view=function(){return'<span><i class="fa fa-play-circle-o"></i></span>'},i.keyboard=function(t){var e,n,i,r;return e=MB.project().device,r=t.numeric?"n":"r",n=t.cs().orientation,i="images/keyboards/"+e+"_"+r+"_"+n+".png",'<img draggable="false" src=\''+i+'\' class="keyboard-img" alt="keyboard"/>'},i.iphone_keyboard=function(t){var e,n,i;return i=t.numeric?"n":"r",e=t.cs().orientation,n="images/keyboards/iphone_"+i+"_"+e+".png",'<img draggable="false" src=\''+n+'\' class="keyboard-img" alt="keyboard"/>'},i.ipad_keyboard=function(t){var e,n,i;return i=t.numeric?"n":"r",e=t.cs().orientation,n="images/keyboards/ipad_"+i+"_"+e+".png",'<img draggable="false" src=\''+n+'\' class="keyboard-img" alt="keyboard"/>'},i.android_keyboard=function(t){var e,n,i;return i=t.numeric?"n":"r",e=t.cs().orientation,n="images/keyboards/android_"+i+"_"+e+".png",'<img draggable="false" src=\''+n+'\' class="keyboard-img" alt="keyboard"/>'},i.map_view=function(){return'<div class="image design">\n <img draggable="false" src="'+MB.staticMap()+'"/>\n</div>'},i.search_bar=function(t,e){var n;return n=/p$/.test(e)?"":'readonly="readonly"','<div>\n <div class="text_edit">\n <input type="text" '+n+' placeholder="'+t.text+'"></input>\n </div>\n <i class="fa fa-search"></i>\n</div>'},i.status_bar=function(t){var e,n,i;return t.tc?(n="background-color:"+t.tc+";",e="border-color:"+t.tc+";",i="color:"+t.tc):n=e=i="",'<div>\n <div class="signal" style="'+i+'">\n <div class="ball"></div>\n <div class="ball"></div>\n <div class="ball"></div>\n <div class="ball"></div>\n <div class="ball"></div>\n </div>\n <div class="carrier">\n <span class="text">'+t.text+'</span>\n </div>\n <div class="time">\n 12:00<span class="meridian"> AM</span>\n </div>\n <div class="wifi md">wifi</div>\n <div class="battery">\n <div class="body" style="'+e+'">\n <div class="inner" style="'+n+'"></div>\n </div>\n <div class="head" style="'+n+'"></div>\n </div>\n</div>'},i.ios_status_bar=function(i){return'<div class="iOS-StatusBar" style="color: '+i.tc+';">\n <div class="StatusBarSignal">'+e+'</div>\n <div class="StatusBarWifi">'+n+'</div>\n <div class="StatusBarTime">12:00</div>\n <div class="StatusBarBattery">'+t+"</div>\n</div>"},i.iphone_x_status_bar=function(i){return'<div class="iPhoneX-StatusBar" style="color: '+i.tc+';">\n <div class="StatusBarTime">12:00</div>\n <div class="StatusBarSignal">'+e+'</div>\n <div class="StatusBarWifi">'+n+'</div>\n <div class="StatusBarBattery">'+t+"</div>\n</div>"},i.android_status_bar=function(t){return'<div class="Android-StatusBar" style="color: '+t.tc+';">\n <div class="StatusBarWifi icon md">signal_wifi_4_bar</div>\n <div class="StatusBarSignal icon md">signal_cellular_4_bar</div>\n <div class="StatusBarBattery icon md">battery_full</div>\n <div class="StatusBarTime">12:00</div>\n</div>'},i.ios_switch=function(t){var e;return e=t.checked?'checked="true"':"",'<label class="iOS-Switch">\n <input type="checkbox" '+e+' />\n <span class="CheckState"></span>\n</label>'},i["switch"]=i.ios_switch,i.android_switch=function(t){var e;return e=t.checked?'checked="true"':"",'<label class="Android-Switch">\n <input type="checkbox" '+e+' />\n <span class="CheckState"></span>\n</label>'},i.ios_check=function(t){var e;return e=t.checked?'checked="true"':"",'<label class="iOS-Check">\n <input type="checkbox" '+e+' />\n\n <span class="CheckState">\n <svg xmlns="http://www.w3.org/2000/svg" width="13" height="8" viewBox="0 0 13 8"><path d="M1 4.5L4.5 8l8-8" /></svg>\n </span>\n</label>'},i.android_check=function(t){var e;return e=t.checked?'checked="true"':"",'<label class="Android-Check">\n <input type="checkbox" '+e+' />\n\n <span class="CheckState">\n <svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10"><path d="M5 10L0 5.192l1.4-1.346L5 7.308 12.6 0 14 1.346" /></svg>\n </span>\n</label>'},i.android_radio=function(t){var e;return e=t.checked?'checked="true"':"",'<label class="Android-Radio">\n <input type="radio" name="'+t.gid+'" '+e+' />\n <span class="CheckState"></span>\n</label>'},i.tab_item=function(t){return'<div class="wrapper">\n '+i.icon_button(t)+'\n <span class="text">'+t.text+"</span>\n</div>"},i.pg=function(t){var e,n;return n=Link.find(t.gid),e=n?n.gesture:"tap",'<i class="icon-gesture-'+e+'"></i>'},i.icon_button=function(t,e){var n;return n="font-size:"+t.iS()+"px;",t.get_icon(e,n)},i.label=function(t){var e;return e=t.text,/<p>/.test(t.text)||(e="<p>"+e+"</p>"),e},i.circle_rect=i.rounded_rect=i.text_view=function(t){var e;return e="padding: "+t.paddingS()+"px;",'<div class="text" style="'+e+'">'+MB.v.multiline(t.text)+"</div>"},s=function(t){var e,n,i;n="";for(e in t)i=t[e],n+=e+":"+i+";";return n},i.sticky=function(t){var e,n,i,r,o,a,c,l,u;return r=t.l()<160,i=t.bg||"#fffbba",l=t.slt,t.slt<20?l=20:t.slt>t.height-20&&(l=t.height-20),a=(t.slt-l)*t.s()/100,n={top:(t.slt<=t.top-20?a:"")+"px",height:Math.abs(a)+"px"},o={top:a+"px"},c={top:l*t.s()/100+"px",width:t.slw*t.s()/100+"px","border-color":i},e={left:(r?"100%":"")+"px",right:(r?"":"100%")+"px","background-color":i,cursor:"pointer"},u={"background-image":"linear-gradient(135deg, "+i+" 25%, transparent 25%, transparent 100%), linear-gradient(45deg, transparent 75%, "+i+" 75%, "+i+" 100%)"},'<div>\n <div class="text">'+MB.v.multiline(t.text)+'</div>\n <div class="sideline" style="'+s(c)+'">\n <div class="box" style="'+s(n)+'"></div>\n <div class="line" style="'+s(o)+'">\n <div class="arrow" style="'+s(e)+'"></div>\n </div>\n </div>\n <div class="sawtooth" style="'+s(u)+'"></div>\n</div>'},i.mtooltip=function(t){var e,n,i,r;return e={top:"border-bottom-color",bottom:"border-top-color",left:"border-right-color",right:"border-left-color"},n=e[t.tt_placement],i="top"===t.tt_placement||"bottom"===t.tt_placement?"left:"+t.ttOffset()+"px":"top:"+t.ttOffset()+"px",r="padding: "+t.paddingS()+"px;",t.text&&"middle"===t.va&&(r+="margin-top: "+(0-t.textHeight()/2)+"px;"),'<div>\n <div class="arrow1 arrow '+t.tt_placement+'" style="border-width:'+t.arrowSize()+"px;"+t.tt_placement+":"+(0-t.arrowSize())+"px;"+n+":"+(t.bc||"#aaa")+";"+i+';"></div>\n <div class="arrow2 arrow '+t.tt_placement+'" style="border-width:'+t.arrowSize()+"px;"+t.tt_placement+":"+(0-t.arrowSize()+t.bS())+"px;"+n+":"+(t.bg||"white")+";"+i+';"></div>\n <div class="text" style="'+r+'">'+MB.v.multiline(t.text)+"</div>\n</div>"},MB.l.getMaterialShadow=function(t,e){var n,i,r;return n=t>15?(15+t)/100:(12+3*t)/100,i=(23+t)/100,r="0 "+t+"px "+2*t+"px rgba("+e.r+","+e.g+","+e.b+","+n+"), 0 "+2*t+"px "+2*t+"px rgba("+e.r+","+e.g+","+e.b+","+i+")"},MB.widgetStyle=function(t,e){var n,i,r,o,s,a,c,l,u,d;return null==e&&(e=""),n=t.inspectables(),l=[]," "!==t.zoomable&&(u=t.w(),r=t.h(),"mtooltip"===t.name&&("top"===t.tt_placement||"bottom"===t.tt_placement?r-=t.arrowSize():u-=t.arrowSize()),t.isFullWidth()||l.push("width:"+u+"px"),l.push("height:"+r+"px")),"mtooltip"===t.name&&(o=function(){var e,n,r,o;for(r=["top","right","bottom","left"],o=[],e=0,n=r.length;e<n;e++)i=r[e],i===t.tt_placement?o.push(t.arrowSize()+"px"):o.push("0");return o}(),l.push("margin: "+o.join(" "))),"pg"===t.name&&e||(l.push("left:"+t.l()+"px"),l.push("top:"+t.t()+"px")),t.tc&&n.indexOf("tc")!==-1&&l.push("color:"+t.tc),t.bg&&n.indexOf("bg")!==-1&&l.push("background-color:"+t.bg),t.bc&&n.indexOf("bc")!==-1&&l.push("border-color:"+t.bc),t.ds>0&&(c=MB.currentProject.isAndroid()?MB.l.getMaterialShadow(t.ds,MB.hex2rgb(t.sc)):"0 0 "+t.ds+"px "+t.sc,"icon_button"===t.name?l.push("text-shadow: "+c):l.push("box-shadow: "+c)),t.ts>0&&l.push("text-shadow: 0 0 "+t.ts+"px "+t.tsc),n.indexOf("ro")!==-1&&(l.push("transform: rotate("+t.ro+"deg)"),l.push("-webkit-transform: rotate("+t.ro+"deg)")),t.clip&&n.indexOf("clip")!==-1&&(l.push("clip-path: "+t.clip),l.push("-webkit-clip-path: "+t.clip)),n.indexOf("fs")!==-1&&t.fS()>0&&l.push("font-size:"+t.fS()+"px"),n.indexOf("padding")!==-1&&"mtextarea"!==t.name&&l.push("padding:"+t.paddingS()+"px"),n.indexOf("br")!==-1&&l.push("border-radius:"+t.bR()+"px"),n.indexOf("bs")!==-1&&l.push("border-width:"+t.bS()+"px"),n.indexOf("ls")!==-1&&l.push("border-style:"+t.lineStyle()),n.indexOf("ha")!==-1&&"label"!==t.name&&l.push("text-align:"+t.ha),n.indexOf("lh")!==-1&&l.push("line-height:"+t.lH()+"px"),l.push("font-weight:"+(t.bo?"bold":"normal")),l.push("font-style:"+(t.i?"italic":"normal")),!MB.isPhantom()&&"none"!==t.ani_name&&e&&(t.ani_delay&&"0"!==t.ani_delay&&l.push("animation-delay: "+t.ani_delay),l.push("animation-iteration-count: "+t.ani_count),t.ani_duration&&"0"!==t.ani_duration&&l.push("animation-duration: "+t.ani_duration)),d=t.fixed&&t.v?Widget.MAXZ+t.z:t.z,t.v?(s=n.indexOf("o")!==-1?t.o/100:"",t.fixed&&/(p|pgh|pgf)$/.test(e)&&(s=0)):s=e?0:.4,!t.v&&e&&(a="none"),l.push("z-index:"+d),""!==s&&l.push("opacity:"+s),a&&l.push("pointer-events:"+a),l},MB.widgetClassName=function(t,e){var n,i;return null==e&&(e=""),n="widget "+t.name,t.inspectables().indexOf("ha")!==-1&&(n+=" h"+t.ha),t.inspectables().indexOf("va")!==-1&&(n+=" v"+t.va),"normal"!==t.td&&(n+=" td"+t.td),"pg"===t.name&&(n+=" s"+t.icon),"switch"===t.name&&t.checked&&(n+=" checked"),e&&(i=Link.find(t.gid))&&t.v&&(n+=" clickable"),!MB.isPhantom()&&"none"!==t.ani_name&&e&&t.v&&(n+=" animated "+t.ani_name),"sticky"===t.name&&(n+=t.l()>160?" rsticky":" lsticky",t.slt<20?n+=" tsticky":t.slt>t.height-20&&(n+=" bsticky")),n},MB.widget=function(t,e){var n,r,o,s,a,c;return null==e&&(e=""),n=MB.widgetClassName(t,e),c=MB.widgetStyle(t,e),e&&(o=Link.find(t.gid))&&t.v&&(s=o.cid,r="tap"!==o.gesture?o.gesture:"",a="<div class='region gesture "+r+"'></div>"),'<div class="'+n+'" id="widget'+t.cid+e+'" data-cid="'+t.cid+'" data-link_cid="'+(s||"")+'" style="'+c.join(";")+'">\n '+i[t.name](t,e)+"\n "+(a||"")+"\n</div>"},MB.PanelState=function(t,e){var n,i,r,o,s,a,c,l;for(o="state"+t.panel_cid+t.cid+"p",i="pstate state",e&&(i+=" active"),n=t.bgimage?"background-image:url("+t.getRealBgImage()+");":"",r="",c=t.cwidgets(),s=0,a=c.length;s<a;s++)l=c[s],"sticky"!==l.name&&("pg"===l.name&&(l.top=l.left=null),r+=MB.widget(l,t.panel_cid+"p"));return'<div id="'+o+'" class="'+i+'" data-cid="'+t.cid+'" style="background-color:'+t.bgcolor+";width:"+t.w()+"px;height:"+t.h()+"px;"+n+'"><div class="pwidgets"><div class="pscontainer">'+r+"</div></div></div>"},o=function(t){var e,n,i,r,o;return o=t.fixed&&t.v?Widget.MAXZ+t.z:t.z,i=t.v&&!t.fixed?1:0,r="top:"+t.t()+"px;left:"+t.l()+"px;width:"+t.w()+"px;height:"+t.h()+"px;z-index:"+o+";opacity:"+i+";",t.v&&(n=t.mainState())&&(e=n.width>t.width||n.height>t.height,e&&(r+="pointer-events:auto;")),r},MB.PanelPreview=function(t){var e,n,i,r,s,a,c,l;return l=o(t),e="ppanel panel",(r=Link.find(t.gid))&&t.v?(e+=" clickable",s=r.cid,i="tap"!==r.gesture?r.gesture:"",a="<div class='region gesture "+i+"'></div>"):(n="",s=null,a=""),c=t.mainState(),c.panel_cid=t.cid,'<div id="panel'+t.cid+'p" class="'+e+'" data-cid="'+t.cid+'" data-link_cid="'+s+'" style="'+l+'">\n <div class="fixed"></div>\n '+MB.PanelState(c,!0)+"\n "+a+"\n</div>"},MB.PanelProjectFlow=function(t){var e;return e=t.mainState(),e.panel_cid=t.cid,'<div id="panel'+t.cid+'p" class="panel" data-cid="'+t.cid+'" style="'+o(t)+'">\n '+r(e)+"\n</div>"},r=function(t){var e,n,i,r,o,s,a,c,l;for(r="state"+t.panel_cid+t.cid+"p",n="pstate state active",e=t.bgimage?"background-image:url("+t.getRealBgImage()+");":"",i="",a=t.cwidgets(),o=0,s=a.length;o<s;o++)l=a[o],"sticky"!==(c=l.name)&&"pg"!==c&&"lr"!==c&&(i+=MB.widget(l,t.panel_cid));return'<div id="'+r+'" class="'+n+'" data-cid="'+t.cid+'" style="background-color:'+t.bgcolor+";width:"+t.w()+"px;height:"+t.h()+"px;"+e+'"><div class="pwidgets"><div class="pscontainer">'+i+"</div></div></div>"}}.call(this),function(){this.AutoSaver=function(){function t(){$("body").on("queue:add",function(t){return function(e,n,i){return t.add(n,i)}}(this)),$("body").on("queue:save",function(t){return function(){return t.save()}}(this)),this.queue=[],this.setup(),setInterval(function(t){return function(){return t.save(),MB.refreshCoWorkers&&MB.refreshCoWorkers()}}(this),2e4)}return t.prototype.add=function(t,e){var n,i,r,o;for(o=this.queue,i=0,r=o.length;i<r;i++)if(n=o[i],n.cid===t.cid&&!n.saving&&n.constructor===t.constructor)return void(n.destroyed=e);return this.queue.push(t),MB.setSaveQueue&&MB.setSaveQueue()},t.prototype.save=function(){var t,e,n,i;if(0===this.queue.length)return void(MB.setSaving&&MB.setSaving(!1));if(i=this.queue[0],!(i.saving&&(n=i.saveAt+$.ajaxSettings.timeout+6e4,new Date<n))){i.saving=!0,i.saveAt=(new Date).valueOf(),MB.setSaving&&MB.setSaving();try{return i.constructor.exists(i.cid)?i.constructor===Asset?(t=i.constructor.find(i.cid),t.id=null,t.save()):i.constructor.find(i.cid).save():i.destroyed&&i.constructor!==Asset?i.destroy():i.save()}catch(t){return e=t,this.queue.shift(),this.save()}}},t.prototype.pushObject=function(t){var e,n,i,r,o,s;if(r=MB.project(),r&&!r.combo&&(r.template&&(r=Project.find(r.host_cid)),r&&r.channels&&(n=r.channels.filter(function(t){return t!==MB.user.channel}),n.length>0&&(t.constructor===Widget?(s="Widget",e=Widget.find(t.cid)?"update":"destroy"):t.constructor===Widgetstate?"default"===t.screenstate_cid?(s="Widget",t=Widget.find(t.widget_cid),t&&(e="update")):(s="Widgetstate",e="update"):t.constructor===Link?(s="Link",e=Link.find(t.cid)?"update":"destroy"):t.constructor===Screen?(s="Screen",e=Screen.find(t.cid)?"update":"destroy"):t.constructor===Screenstate?(s="Screenstate",e=Screenstate.find(t.cid)?"update":"destroy"):t.constructor===Panel?(s="Panel",e=Panel.find(t.cid)?"update":"destroy"):t.constructor===Panelstate&&("default"===t.screenstate_cid?(s="Panel",t=Panel.find(t.panel_cid),t&&(e="update")):(s="Panelstate",e="update")),e))))return"Panel"===s&&(o=Template.find(t.template_cid),o&&(i={template_token:o.access_token})),MB.pusher.pusher.send({data:{event:"collaboration",action:e,t:s,from:{id:MB.user.id,name:MB.user.name,avatar:MB.user.avatar},to:r.cid,object:t,extras:i},expiration_interval:60,channels:n})},t.prototype.setup=function(){return MB.myXhr=$.ajaxSettings.xhr(),MB.myXhr.upload&&MB.myXhr.upload.addEventListener("progress",function(t){return function(e){var n,i;if(n=Math.floor(100*e.loaded/e.total),100!==n)return i="("+n+"% "+t.queue.length+" "+I18N.unsaved+")",$("#last_saved .progress").text(i)}}(this),!1),$.ajaxSettings.xhr=function(){return MB.myXhr},$.ajaxSetup({timeout:6e4}),window.onbeforeunload=function(t){return function(){var e;if(t.queue.length)return MB.isLegacyElectron()?(e=MB.confirm({title:I18N.warning,desc:I18N.data_lost_warning}),!e||void 0):I18N.data_lost_warning}}(this),window.onerror=function(t,e,n,i,r){var o,s;if(!MB.config.ignoreError.test(t)&&r&&r.stack)return o=(MB.currentProject||{cid:"none"}).cid,s=(MB.currentScreen||{cid:"none"}).cid,console.error(r)},$(document).on("ajaxComplete",function(t){return function(e,n,i){var r,o;if(t.resetReloadTimer(),200===n.status||422===n.status){if(!n.responseJSON||!n.responseJSON.cid)return;return(o=MB.currentProject)&&(o.updated_at=(new Date).toISOString(),o.lsave(!1)),t.queue[0]&&(t.queue[0].saving=!1,r=t.queue.shift(),t.pushObject(r),MB.setSaveQueue&&MB.setSaveQueue()),t.save()}if(0===n.status?(MB.alert({title:I18N.error_happened,desc:I18N.network_error}),$.ajaxSettings.timeout<12e4&&$.ajaxSetup({timeout:2*$.ajaxSettings.timeout}),MB.ga("send","event","saving","saving timeout",i.url+"("+i.type+")("+i.data+")("+MB.user.email+")")):new URLSearchParams(i.data).get("NO_ERROR_ALERT")||(MB.alert({desc:I18N.unknown_error.replace(/%s/i,n.status),isHTML:!0}).then(function(){return location.reload()}),MB.ga("send","event","saving","saving error: "+n.status,n.status+": "+i.url+"("+i.type+")("+i.data+")("+MB.user.email+")")),t.queue[0])return MB.setSaving&&MB.setSaving(!1),t.queue[0].saving=!1}}(this))},t.prototype.resetReloadTimer=function(){return this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){return MB.alert({desc:I18N.new_version_detected,isHTML:!0}).then(function(){return location.reload()})},216e5)},t}()}.call(this),function(){this.WidgetManager=function(){function t(){}return t.remove=function(t){var e;if(Widget.exists(t))return e=Widget.find(t),e.ldestroy()},t.newImageView=function(t,e,n,i){var r,o,s,a,c;return c=t.width,r=t.height,c>i.width&&(r=Math.round(r*(i.width/c)),c=i.width),s=MB.scale()/100,o="image_view",a=new Widget({name:o,top:Math.round(n/s),left:Math.round(e/s),width:c,height:r,bs:MB.COMPONENTS[o].bs,br:MB.COMPONENTS[o].br,image:t.cid,screen_cid:i.cid,cid:"w"+Math.uuid(10,16)+(new Date).valueOf(),z:i.maxZ()+1}),a.lsave(),ScreenManager.updateWidgetList(),a},t.renderText=function(t,e){var n;if(e&&(n=e.getElementsByClassName("text")[0]))return t.richedit?n.innerHTML=MB.v.multiline(t.text):n.innerHTML=""+t.text},t.renderExtras=function(t,e,n){var i;if(e)return i="_render_"+t.name,"function"==typeof this[i]?this[i](t,e,n):void 0},t._render_label=function(t,e){var n;return n=t.text,/<p>/.test(t.text)||(n="<p>"+n+"</p>"),e.innerHTML=n},t._render_text_align=function(t,e){return e.className=e.className.replace(/v(middle|top|bottom)/,"v"+t.va)},t._render_text_view=function(t,e){var n;return e.style.clipPath=t.clip,e.style.webkitClipPath=t.clip,n=e.getElementsByClassName("text")[0],n.style.padding=t.paddingS()+"px",this._render_text_align(t,e)},t._render_rounded_rect=function(t,e){if(t.text)return this._render_text_align(t,e)},t._render_circle_rect=function(t,e){if(t.text)return this._render_text_align(t,e)},t._render_hr=function(t,e){var n,i;return i=e.getElementsByTagName("span")[0],n=t.h()-10,n<1&&(n=1),i.style.borderTopWidth=n+"px"},t._render_ve=function(t,e){var n,i;return i=e.getElementsByTagName("span")[0],n=t.w()-10,n<1&&(n=1),i.style.borderLeftWidth=n+"px"},t._render_triangleb=function(t,e){var n,i,r,o;return r=e.getElementsByTagName("path")[0],o=[[(t.w()-1)/2,0],[t.w()-1,t.h()-1],[0,t.h()-1]],n="M "+function(){var t,e,n;for(n=[],t=0,e=o.length;t<e;t++)i=o[t],n.push(i.join(" "));return n}().join(" L ")+" Z",r.setAttribute("d",n)},t._render_triangletl=function(t,e){var n,i,r,o;return r=e.getElementsByTagName("path")[0],o=[[0,0],[t.w()-1,0],[0,t.h()-1]],n="M "+function(){var t,e,n;for(n=[],t=0,e=o.length;t<e;t++)i=o[t],n.push(i.join(" "));return n}().join(" L ")+" Z",r.setAttribute("d",n)},t._render_status_bar=function(t,e){var n,i,r,o,s,a,c;for(i=e.getElementsByClassName("body")[0],s=e.getElementsByClassName("inner")[0],r=e.getElementsByClassName("head")[0],c=e.getElementsByClassName("ball"),o=0,a=c.length;o<a;o++)n=c[o],n.style.backgroundColor=t.tc;return i.style.borderColor=t.tc,s.style.backgroundColor=t.tc,r.style.backgroundColor=t.tc},t._render_icon_button=function(t,e){var n;if(n=e.querySelector(".icon"))return n.insertAdjacentHTML("afterend",t.get_icon(!0,"font-size:"+t.iS()+"px;")),
|
|
n.remove()},t._render_button=function(t,e){return this._render_icon_button(t,e)},t._render_tab_item=function(t,e){return this._render_icon_button(t,e)},t._render_image_view=function(t,e){var n,i,r,o;return e.style.clipPath=t.clip,e.style.webkitClipPath=t.clip,t.image?("i"===t.image[0]&&t.image.indexOf("images")===-1?(n=Asset.find(t.image),n&&(o=n.raw||n.image)):o=t.image,i=e.getElementsByTagName("img")[0],o&&i.src!==o&&(i.src=o),i.style.filter=t.filter.trim(),i.style.webkitFilter=t.filter.trim(),i.style.display=null,r=e.getElementsByTagName("span")[0],r.style.display="none"):(i=e.getElementsByTagName("img")[0],i.style.display="none",r=e.getElementsByTagName("span")[0],r.style.display=null)},t._render_webpage=function(t,e){var n;if(n=$(e).find(".iframe"),n[0]&&n.attr("data")!==t.text)return n.attr("data",MB.unescape(t.text))},t._render_switch=function(t,e){return t.checked?e.classList.add("checked"):e.classList.remove("checked")},t._render_mtooltip=function(t,e){var n,i,r,o,s,a,c,l,u,d;for(r=e.querySelectorAll(".arrow"),c=0,l=r.length;c<l;c++)o=r[c],o.classList.remove("top","right","bottom","left"),o.classList.add(t.tt_placement),o.style.borderWidth=t.arrowSize()+"px",o.style.borderColor="transparent",o.style.left=o.style.top=o.style.bottom=o.style.right=null;return n=e.querySelector(".arrow1"),i=e.querySelector(".arrow2"),n.style[t.tt_placement]=0-t.arrowSize()+"px",i.style[t.tt_placement]=0-t.arrowSize()+t.bS()+"px",s={top:"borderBottomColor",bottom:"borderTopColor",left:"borderRightColor",right:"borderLeftColor"},a=s[t.tt_placement],n.style[a]=t.bc||"#aaa",i.style[a]=t.bg||"white","top"===t.tt_placement||"bottom"===t.tt_placement?(e.style.height=t.h()-t.arrowSize()+"px",n.style.left=i.style.left=t.ttOffset()+"px"):(e.style.width=t.w()-t.arrowSize()+"px",n.style.top=i.style.top=t.ttOffset()+"px"),u=function(){var e,n,i,r;for(i=["top","right","bottom","left"],r=[],e=0,n=i.length;e<n;e++)a=i[e],a===t.tt_placement?r.push(t.tt_arrow_size+"px"):r.push("0");return r}(),e.style.margin=u.join(" "),d=e.getElementsByClassName("text")[0],d.style.padding=t.paddingS()+"px",this._render_text_align(t,e),"middle"===t.va?d.style.marginTop=0-t.textHeight()/2+"px":d.style.marginTop="0px"},t._render_mtext_input=function(t,e){var n;return n=e.getElementsByTagName("input")[0],n.placeholder=t.text},t._render_mtextarea=function(t,e){var n,i,r;return n=e.getElementsByTagName("textarea")[0],i=Math.round(t.padding),r=Math.round(i-(t.lh-t.fs)/2),r<0&&(r=0),n.placeholder=t.text,n.style.padding=r+"px "+i+"px"},t._render_mcheckbox2=function(t,e){var n;return n=e.getElementsByTagName("input")[0],n.checked=t.checked},t._render_mradiobutton=function(t,e){var n;return n=e.getElementsByTagName("input")[0],n.checked=t.checked},t._render_mselect=function(t,e){var n,i;return i=function(){var e,i,r,o;for(r=t.text.split(/\n/),o=[],e=0,i=r.length;e<i;e++)n=r[e],o.push("<option>"+n+"</option>");return o}().join(""),e.innerHTML="<select>"+i+"</select>"},t.transform=function(t,e,n,i){var r,o;if(i.className=MB.widgetClassName(n,"p").replace("animated",""),o=i.style,e.fs!==n.fs&&(o.fontSize=n.fS()+"px"),e.bs!==n.bs&&(o.borderWidth=n.bs+"px"),e.br!==n.br&&(o.borderRadius=n.bR()+"px"),e.lh!==n.lh&&(o.lineHeight=n.lH()+"px"),e.padding!==n.padding&&(o.padding=n.paddingS()+"px"),n.bg!==e.bg&&(o.backgroundColor=n.bg),n.tc!==e.tc&&(o.color=n.tc),n.bc!==e.bc&&(o.borderColor=n.bc),n.ls!==e.ls&&(o.borderStyle=n.lineStyle()),n.bo!==e.bo&&(o.fontWeight=n.bo?"bold":"normal"),n.i!==e.i&&(o.fontStyle=n.i?"italic":"normal"),n.ds===e.ds&&n.sc===e.sc||(r=MB.currentProject.isAndroid()?MB.l.getMaterialShadow(n.ds,MB.hex2rgb(n.sc)):"0 0 "+n.ds+"px "+n.sc,"icon_button"!==n.name?o.boxShadow=r:o.textShadow=r),n.ts===e.ts&&n.tsc===e.tsc||(o.textShadow="0 0 "+n.ts+"px "+n.tsc),"label"===n.name&&(n.ha!==e.ha&&(o.justifyContent={left:"flex-start",center:"center",right:"flex-end"}[n.ha]),n.va!==e.va&&(o.alignItems={top:"flex-start",middle:"center",bottom:"flex-end"}[n.va])),MB.isPhantom()||"none"===n.ani_name||("0"!==n.ani_delay&&(o.animationDelay=n.ani_delay),o.animationIterationCount=n.ani_count,"0"!==n.ani_duration&&(o.animationDuration=n.ani_duration)),n.ro!==e.ro)return o.transform="rotate("+n.ro+"deg)"},t}()}.call(this),function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};this.ScreenManager=function(){function e(){var t;t=$("#design"),t.on("slider:update",function(){return MB.renderFixedSlider&&MB.renderFixedSlider()}),this.initCanvasDnd()}return e.sortScreens=function(t){var e;return e=function(t){return t.children().forEach(function(t,n){return t.position!==n+1&&(t.position=n+1,t.lsave()),e(t)})},t.rootScreens().forEach(function(t,n){return t.position!==n+1&&(t.position=n+1,t.lsave()),e(t)})},e.fixBadScreen=function(e){var n,i,r,o;for(n=[e.cid],o=[];i=Screen.find(e.parent_cid);)r=i.cid,t.call(n,r)>=0?(e.parent_cid=null,o.push(e.lsave())):(e=i,o.push(n.push(e.cid)));return o},e.activate=function(t){var e;return e=Screen.find(t.cid),MB.currentScreen=e,MB.action("selection:clear:state"),e.setState("default"),MB.action("entry:activate:screen",{screen:e}),MB.action("statepanel:set:global",{isGlobalActive:!0}),MB.action("entry:reset:canvas:offset"),this.updateWidgetList()},e.updateWidgetList=function(){var t,e,n,i,r,o;for(r=Screen.find(MB.currentScreen.cid),r._widgetsByName=null,r.lsave(!1),o=[],i=r.citems(),e=0,n=i.length;e<n;e++)t=i[e],t._isPanelWidget=!1,t.setState(r.state_cid,!0),"panel"===t.name?t.valid()&&(o.push(t.dup()),t.ct().cscreens().forEach(function(t){return t.cwidgets().forEach(function(t){var e;return e=t.dup(),e._isPanelWidget=!0,o.push(e)})})):o.push(t.dup());return MB.renderLinks(),MB.action("update:widget:all",{widgetList:o})},e.updateStateHeight=function(t){var e,n,i,r;return n=Screen.find(t),e=n.cid+"default",MB.getIsGlobalActive()?(r=n.cscreenstates(),r.push(Screenstate.find(e))):(i="default"===n.state_cid?e:n.state_cid,r=[Screenstate.find(i)]),r.forEach(function(t){if(t)return t.hh=n.hh,t.fh=n.fh,t.lsave(t.cid!==e)})},e.newScreen=function(t,e,n,i,r,o,s){var a;return null==s&&(s=!0),a=new Screen({cid:"s"+Math.uuid(10,16)+(new Date).valueOf(),name:e,position:n,parent_cid:i,project_cid:t.cid,orientation:r,bgcolor:t.template?"transparent":MB.config.screenBg}),a.lsave(),o&&!t.template&&a.setup(null),this.activate(a),s&&MB.action("rightnav:edit:screen",{cid:a.cid}),MB.renderScreenList(),a},e.updateOrientation=function(){var t,e,n,i,r,o;for(r=Screen.find(MB.currentScreen.cid),n="portrait"===r.orient()?"landscape":"portrait",r.setOrientation(n),r.lsave(),i=r.cwidgets(),t=0,e=i.length;t<e;t++)o=i[t],o.isFullWidth()&&(o.width=r.width,"keyboard"===o.name&&(o.height=r.kbDH()),o.lsave());return MB.action("set:current:screen",{screen:r}),this.updateWidgetList()},e.prototype.initCanvasDnd=function(){return $("#design").on("dragleave","#screens",function(){return $(".canvas").removeClass("hover")}),$("#design").on("dragover","#screens",function(t){return t.stopPropagation(),t.preventDefault(),$("#canvas").addClass("hover"),t.originalEvent.dataTransfer.dropEffect="copy"}),$("#design").on("drop","#screens",function(t){var e,n,i,r,o;if(t.stopPropagation(),t.preventDefault(),$("#canvas").removeClass("hover"),!MB.globalStateAlert())return MB.action("entry:clear:selection"),r=MB.scale()/100,n=t.originalEvent.pageX-MB.canvasLeft(),o=t.originalEvent.pageY-MB.canvasTop(),e=t.originalEvent.dataTransfer.files,i=Screen.find(MB.currentScreen.cid),MB.createAssetFromFiles(e,function(t){var e;return e=WidgetManager.newImageView(t,n,o,i),o+=t.height*r,MB.trigger("undoStack:add",[null,[e.dup()]]),MB.action("selection:select:items",{cids:[e.cid]})})})},e.updateSize=function(t,e,n){var i,r,o,s,a,c,l,u,d;if(u=Screen.find(MB.currentScreen.cid),i=[u.dup()],a=u.height,u.height+=e,s=Math.round(100*u.dH()/MB.scale()),MB.project().template||MB.project().combo)u.width+=t,u.height<10&&(u.height=10),u.width<10&&(u.width=10);else for(u.height<s&&(e=s-a,u.height=s),l=u.cwidgets(),r=0,o=l.length;r<o;r++)d=l[r],d.inFooter()&&d.top&&(d.top+=e,d.lsave());return u.lsave(),c=MB.project(),"project"!==c.type()&&c.updatePanelSize(u.width,u.height),n&&$("body").trigger("undoStack:add",[i,[u.dup()]]),this.updateWidgetList(),MB.action("set:current:screen",{screen:u})},e}()}.call(this),function(){this.PanelManager=function(){function t(){}return t.remove=function(t,e){var n;if(null==e&&(e=!0),n=Panel.find(t))return n.ldestroy(e)},t}()}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;e={},t=function(){function t(){MB.setRunnerExtra(e),this.scrollSync=new e.ScrollSync,this.timeoutBucket=new e.TimeoutBucket,this.eventBucket=new e.EventBucket,this.runnerUtil=new e.RunnerUtil,this.transitionUtil=new e.TransitionUtil,this.clearCallbackBucket={},this.mode="default",MB.isMobile()?this.eventBucket.bindMobile({onOrientationChange:function(t){return function(){return setTimeout(function(){return t.reload()},100)}}(this)}):this.eventBucket.bindDesktop({onAppMouseDown:function(t){return function(e,n){var i,r,o,s;if("immersive"===t.mode)return!0;if(i=$(e.target).closest(".map_view .image"),r=$(e.target).closest(".ppanel"),i.length)o=s=i[0];else{if(!r.length)return!0;o=s=r[0]}return!($(o).width()<o.scrollWidth||$(s).height()<s.scrollHeight)||(n.vScrollTarget=s,n.hScrollTarget=o,n.top=s.scrollTop,n.left=o.scrollLeft,!1)}}(this),onAppMouseMove:function(t,e,n){var i,r,o,s,a,c;return i=e.hScrollTarget,s=e.vScrollTarget,o=e.top,r=e.left,a=e.x,c=e.y,!n.down||(t.preventDefault(),i&&(i.scrollLeft=Math.min(r-t.clientX+a,i.scrollWidth-$(i).width())),s?s.scrollTop=Math.min(o-t.clientY+c,s.scrollHeight-$(s).height()):void 0)}}),window.addEventListener("message",function(t){return function(e){var n;try{if(n=JSON.parse(e.data),"back"===n.event)return t.backPrev()}catch(t){}}}(this),!1)}return t.prototype.init=function(){var t;return MB.trackPageView("/workspace/app/preview"),$("#simulator .splash").css("background-color",this.home.bg()),$("#app").show(),this.runnerUtil.setupSplash(this.home,$("#simulator .splash img")),this.project.setup(),this.setupPG(),this.currentScreen=this.currentMenu=null,this.renderScreen(),t=setTimeout(function(t){return function(){if($("#gs").show(),$("#simulator .splash").hide(),$("#splash").hide(),t.reload(),"function"==typeof MB.onload&&MB.onload(),MB.messageBucket)return MB.messageBucket.send("ready",JSON.stringify(MB.currentProject.cscreens()))}}(this),1e3),MB.webpackInterface.checkLocationHash(),this.clearCallbackBucket.init=function(){return clearTimeout(t)}},t.prototype.clear=function(){var t,e,n;this.timerFired=!1,n=this.clearCallbackBucket;for(e in n)(t=n[e])();return this.timeoutBucket.clear()},t.prototype.loadScreen=function(t){var e,n,i,r;if(this.currentMenu)return void this.closeMenu(function(e){return function(){return e.loadScreen(t)}}(this));if($(".pcanvas.active").data("cid")!==t&&(this.currentScreen=this.currentMenu=null,i=Screen.find(t)))return this.timeoutBucket.clear(),e=$(".pcanvas.active"),n=$("#pscreen"+i.cid),r=this.getTransition(i.cid,"none",!0),this.prepareTransition(i.cid,r),this.transitionUtil.doTransition("none",e,n,new Link)},t.prototype.backPrev=function(){var t;return this.home.cid===$(".pcanvas.active").data("cid")&&MB.messageBucket?void MB.messageBucket.send("exit"):(t=new Link({target_cid:"prev",transition:"none"}),this.j(t))},t.prototype.closeMenu=function(t){var e,n,i;return n=$("#pscreen"+this.currentScreen),e=$("#pscreen"+this.currentMenu),i=function(i){return function(){return i.transitionUtil.hideScreen(e),e.removeClass("drawer ldrawer rdrawer"),n.removeClass("menu lmenu rmenu"),i.doneTransition(n),i.currentScreen=i.currentMenu=null,$.nextTick(function(){if("function"==typeof t)return t()})}}(this),n.hasClass("menu")?(n.transitionEnd(i),n.enableTransition("0.3s"),n.translateX(0)):e.hasClass("drawer")?(e.transitionEnd(i),e.enableTransition("0.3s"),e.hasClass("ldrawer")?e.translateX(0-this.transitionUtil.activeWidth()):e.translateX(this.transitionUtil.activeWidth())):void 0},t.prototype.pj=function(t,e){var n,i,r,o,s,a,c,l,u,d,h;if("immersive"!==this.mode&&this.eventBucket.isCoolDown()&&!this.timerFired){if(n=$(t.target).closest(".clickable"),r=$(t.target).closest(".ppanel"),i=$(t.target).closest(".pcanvas"),"shake"===e&&(i=this.currentMenu?$("#pscreen"+this.currentMenu):$(".pcanvas.active")),this.currentMenu&&i.data("cid")!==this.currentMenu&&!$(t.target).closest("#gh, #gf").length)return this.closeMenu();if(r.length){if(this.panelEventHandler(t,e))return}else if(n.length&&(c=Link.find(n.attr("data-link_cid")),c&&c.gesture===e))return this.j(c);if(o=i.data("cid"),u=Screen.find(o)){for(l=Widget.records,s=0,a=l.length;s<a;s++)if(d=l[s],d.screen_cid===u.cid&&"pg"===d.name&&(h=d.getState(u.state_cid),h.gid&&(c=Link.find(h.gid))&&c.gesture===e))return this.j(c);if(!this.eventBucket.mouseState.moved)return"hold"===e&&MB.messageBucket&&!window.parent.webkit?void MB.messageBucket.send("settings"):MB.project()._highlight?this.highlightClickables():void 0}}},t.prototype.panelEventHandler=function(t,e){var n,i,r,o,s,a,c,l,u,d,h,p;if(i=$(t.target).closest(".clickable"),n=$(t.target).closest(".ppanel"),r=n.find(".pstate.active"),o=n.data("cid"),l=Panel.find(o),i.length){if(c=Link.find(i.attr("data-link_cid")),!c)return!1;if("prev"===c.target_cid)return this.j(c),!0;if(c.gesture===e){if(n[0]===i[0])this.j(c);else if($("#pscreen"+c.target_cid).length)this.j(c);else{if(l.timerFired)return!1;h="#"+n.attr("id").replace(/pg[h|f]$/,"p"),this.panelWJ(c,$(h)),$("#panel"+o+"pgh").length&&this.panelWJ(c,$("#panel"+o+"pgh")),$("#panel"+o+"pgf").length&&this.panelWJ(c,$("#panel"+o+"pgf"))}return!0}}if(d=Screen.find(r.data("cid")),!d)return!1;for(u=d.cwidgets(),s=0,a=u.length;s<a;s++)if(p=u[s],"pg"===p.name&&(c=Link.find(p.gid),p.icon===e&&c))return!l.timerFired&&(h="#"+n.attr("id").replace(/pg[h|f]$/,"p"),this.panelWJ(c,$(h)),$("#panel"+o+"pgh").length&&this.panelWJ(c,$("#panel"+o+"pgh")),$("#panel"+o+"pgf").length&&this.panelWJ(c,$("#panel"+o+"pgf")),!0);return!1},t.prototype.highlightClickables=function(){var t;return t=$(".pcanvas.active .region, #gs .region, #gh .region, #gf .region"),t.show(),$(".pcanvas.active .pg").css({display:"flex",opacity:.8}),this.hightTimer=setTimeout(function(){return t.hide(),$(".pcanvas.active .pg").css("opacity","0").hide()},400)},t.prototype.j=function(t){var e,n,i,r,o,s;if(t&&t.target_cid!==MB.currentScreen.cid){if(this.timeoutBucket.clear(),o=t.screen_cid,n=t.target_cid,s=t.transition,this.currentMenu)return void(n===$(".pcanvas.active").data("cid")?this.closeMenu():t.targetstate_cid?this.stateTransition(t):this.closeMenu(function(e){return function(){return e.j(t)}}(this)));if(t.targetstate_cid)return this.stateTransition(t);if(n&&("prev"===n||$("#pscreen"+n).length)){if("prev"===n){if(r=$(".pcanvas.active").data("prev"),!r)return;if(n=r.pop(),!n)return;$(".pcanvas.active").data("prev",r)}else r=$("#pscreen"+n).data("prev"),r||(r=[]),r.push($(".pcanvas.active").data("cid")),$("#pscreen"+n).data("prev",r);return e=$(".pcanvas.active"),i=$("#pscreen"+n),s=this.getTransition(n,s,t.reset),this.prepareTransition(n,s),this.transitionUtil.doTransition(s,e,i,t)}}},t.prototype.panelWJ=function(t,e){var n,i,r;if(t&&(n=t.target_cid,r=t.transition,i=e.data("cid"),n))return this.preparePanelTransition(n,r,e,function(o){return function(){var s,a;return s=e.find(".pstate.active"),a=e.find("#state"+i+n+"p"),o.transitionUtil.doTransition(r,s,a,t)}}(this))},t.prototype.prepareTransition=function(t,e){var n,i,r,o,s,a,c,l,u;if(this.timerFired=!0,n=$(".pcanvas.active").removeClass("top drawer ldrawer rdrawer"),n.find(".pstate").css("transition","none"),i=$("#pscreen"+t),i.show(),u=Screen.find(t),this.renderWidgets(u),"leftmenu"!==e&&"rightmenu"!==e&&"leftdrawer"!==e&&"rightdrawer"!==e||(this.currentScreen=n.data("cid"),this.currentMenu=t,e.indexOf("menu")!==-1&&($(".pcanvas.active .widgets")[0].scrollTop=0)),"slideleft"!==e&&"slideright2"!==e&&"slideright"!==e&&"slideleft2"!==e&&this.runnerUtil.setScreenBg(n),"slideright"!==e&&"slideleft"!==e&&"slidebottom"!==e&&"slidetop"!==e&&this.runnerUtil.setScreenBg(i),this.transitionUtil.transitionHandler(e,n,i,this.transitionUtil.activeWidth()-1,this.transitionUtil.activeHeight()-1),$("#gf .keyboard").hide(),$(".pcanvas.active .sheader").css("height",0),$(".pcanvas.active .sfooter").css("height",0),"slideright"!==e&&"slideleft"!==e&&"none"!==e&&($("#gh").css("top",0-$("#gh").height()),$("#gf").css("bottom",0-$("#gf").height())),$("#pscreen"+u.cid+" .panel").length){for(c=u.cpanels(),l=[],o=0,s=c.length;o<s;o++)a=c[o],(r=$("#panel"+a.cid+"p")[0])&&this.activatePanelMainState(a,r,"p"),(r=$("#panel"+a.cid+"pgh")[0])&&this.activatePanelMainState(a,r,"pgh"),(r=$("#panel"+a.cid+"pgf")[0])?l.push(this.activatePanelMainState(a,r,"pgf")):l.push(void 0);return l}},t.prototype.preparePanelTransition=function(t,e,n,i){var r,o,s,a,c;return null==i&&(i=null),"leftmenu"!==e&&"rightmenu"!==e&&"leftdrawer"!==e&&"rightdrawer"!==e||(e="none"),a=n.data("cid"),s=Panel.find(a),c=Screen.find(t),o=n.find("#state"+a+t+"p"),o.length||(c.panel_cid=s.cid,n[0].innerHTML+=MB.PanelState(c,!1),o=n.find("#state"+a+t+"p")),r=n.find(".pstate.active"),o.show(),o.enableTransition("10ms"),i&&"function"==typeof i&&("popin"===e||"slidebottom"===e||"topin"===e||"slidetop"===e||"slideright"===e||"slideleft2"===e||"slideleft"===e||"slideright2"===e?o.transitionEnd(function(){return i()}):setTimeout(function(){return i()},10)),setTimeout(function(t){return function(){return t.transitionUtil.transitionHandler(e,r,o,n.width()-1,n.height()-1)}}(this))},t.prototype.doneTransition=function(t){var e,n,i,r;return t.removeClass("menu lmenu rmenu"),t.zindex(""),t.disableTransition(),t.hasClass("state")?(this.setupPanelLinks(t),this.setupPanelAnimationAndFixed(t),n=Panel.find(t.closest(".ppanel").data("cid")),i=Screen.find(t.data("cid")),this.setupPanelTimers(n,i),n.timerFired=!1,void n.lsave(!1)):(r=Screen.find(t.data("cid")),this.setupBackground(t,r),this.setupPageTimers(r),this.setupFixedWidgets(r),MB.isStandAlone()&&this.setupStatusBar(r),MB.isAndroid()&&this.setupPageGesture(r),this.timerFired=!1,MB.currentScreen=r,MB.webpackInterface.updateCurrentScreenRunner(r),MB.isMobile()?(e=t.find(".animated"),e.css({animationName:"noop",visibility:"hidden"}),setTimeout(function(){return e.css({animationName:"",visibility:""})})):this.scrollSync.init($(".pcanvas.active .widgets")[0],$("#sticky-container")[0]),setTimeout(function(t){return function(){var e,n,i,o,s,a;for(o=r.clinks(),s=[],e=0,i=o.length;e<i;e++)n=o[e],n.target_cid&&"prev"!==n.target_cid&&(a=Screen.find(n.target_cid),a&&a.project_cid===r.project_cid?(t.renderWidgets(a),s.push($("#pscreen"+a.cid).enableTransition("10ms"))):s.push(void 0));return s}}(this),10))},t.prototype.getTransition=function(t,e,n){var i;return i=Screen.find(t),i.orient()!==MB.currentScreen.orient()&&(e="none"),n&&(MB.webpackInterface.updateScreenStateCid(i,"default"),this.resetScreen(t)),e},t.prototype.resetScreen=function(t){return $("#pscreen"+t+" .scontainer").html('<div class="sheader"></div><div class="sfooter"></div>'),setTimeout(function(){var e;return e=$("#pscreen"+t).find(".widgets, .pwidgets")[0],e&&(e.scrollTop=0)},100)},t.prototype.clearCanvas=function(){var t,e,n,i,r;for($(".scontainer").html('<div class="sheader"></div><div class="sfooter"></div>'),$("#gh").html(""),$("#gf").html(""),$("#gs").html(""),i=$(".pcanvas .widgets"),r=[],e=0,n=i.length;e<n;e++)t=i[e],r.push(t.scrollTop=0);return r},t.prototype.reload=function(){var t,e;return this.timerFired?void $.nextTick(function(t){return function(){return t.reload()}}(this)):this.currentMenu?void this.closeMenu(function(t){return function(){return t.reload()}}(this)):(t=$(".pcanvas.active").data("cid"),Screen.exists(t)?(e=Screen.find(t),this.clearCanvas(),this.prepareTransition(t,"none"),this.doneTransition($(".pcanvas.active"))):void 0)},t.prototype.transformItem=function(t,e,n,i,r){var o,s,a,c,l,u,d,h,p;return d=i.style,d.transition=r,e.width!==n.width&&(d.width=n.w()+"px"),e.height!==n.height&&(d.height=n.h()+"px"),h=n.t(),n.fixed?n.isBottomFixed(t)&&(h=MB.isOddIOS()&&this.runnerUtil.deviceOrient()===t.orient()?$("#simulator").height()-(t.h()-h)+MB.COMPONENTS.status_bar.height:$("#simulator").height()-(t.h()-h)):/gf$/.test(i.id)&&(o=n.t()+n.h(),s=0===t.footerHeight()?Number.MAX_VALUE:Math.floor(t.h()-t.footerHeight()),o>=s&&h<t.h()&&(h-=s)),!n.fixed||e.fixed||/gh$/.test(i.id)?!n.fixed&&e.fixed&&/gh$/.test(i.id)&&(h-=$(".pcanvas.active .widgets")[0].scrollTop):h+=$(".pcanvas.active .widgets")[0].scrollTop,h!==e.t()&&(d.top=h+"px"),e.l()!==n.l()&&(d.left=n.l()+"px"),n.v?(l=n.o/100,p=n.fixed?Widget.MAXZ+n.z:n.z):(l=0,p=n.z),"panel"===n.name?n.v&&(c=n.mainState())?(a=c.width>n.width||c.height>n.height,u=a?"auto":""):u="":u=n.v?"":"none",d.zIndex=p,d.opacity=l,d.pointerEvents=u},t.prototype.transformWidget=function(t,e,n,i,r){return this.transformItem(t,e,n,i,r),WidgetManager.transform(t,e,n,i,r)},t.prototype.activatePanelMainState=function(t,e,n){var i,r,o;return this.timeoutBucket.clearTimeoutByKey(t.cid),o=t.mainState(),$("#panel"+t.cid+n+" .state").disableTransition(),r=$(e).find("#state"+t.cid+o.cid+"p"),r.length||(o.panel_cid=t.cid,e.innerHTML+=MB.PanelState(o,!1),r=$(e).find("#state"+t.cid+o.cid+"p"),MB.runner.setupPanelLinks(r)),i=$(e).find(".state.active"),i.css("transform",""),i.removeClass("active top"),MB.runner.transitionUtil.hideScreen(i),MB.runner.setupPanelAnimationAndFixed(r),r.css("transform",""),r.addClass("active top"),r.show()},t.prototype.transformPanel=function(t,e,n,i,r,o){if(this.transformItem(t,e,n,i,r),n.mainState().cid!==e.mainState().cid)return this.activatePanelMainState(n,i,o),this.setupPanelTimers(n,n.mainState())},t.prototype.stateTransition=function(t){var e,n,i,r,o,s,a,c,l,u,d;if(r=Screen.find(t.screen_cid),r.state_cid!==t.targetstate_cid)return c=t.targetstate_cid,u=t.ani_duration+" "+(t.ani_delay||"0s")+" "+(t.ani_easing||"linear"),a=Screenstate.find(c),d=[],Widget.select(function(t){var e,n,i,o,s;return t.screen_cid===r.cid&&("sticky"!==t.name&&(s=Widgetstate.find(r.state_cid+t.cid),o=Widgetstate.find(c+t.cid),s||o?(s&&(s.screen_cid=r.cid),o&&(o.screen_cid=r.cid),s||(s=t),o||(o=t),(e=$("#widget"+t.cid+"p")[0])&&MB.runner.transformWidget(r,s,o,e,u),(n=$("#widget"+t.cid+"pgf")[0])&&MB.runner.transformWidget(r,s,o,n,u),(i=$("#widget"+t.cid+"pgh")[0])&&MB.runner.transformWidget(r,s,o,i,u),d.push([s,o,e,i,n]),!1):void 0))}),i=[],Panel.select(function(t){var e,n,o,s,a;if(t.screen_cid===r.cid&&(a=Panelstate.find(r.state_cid+t.cid),s=Panelstate.find(c+t.cid),a||s))return s&&(s.cid=t.cid),a||(a=t),s||(s=t),(e=$("#panel"+t.cid+"p")[0])&&MB.runner.transformPanel(r,a,s,e,u,"p"),(o=$("#panel"+t.cid+"pgh")[0])&&MB.runner.transformPanel(r,a,s,o,u,"pgh"),(n=$("#panel"+t.cid+"pgf")[0])&&MB.runner.transformPanel(r,a,s,n,u,"pgf"),i.push([a,s,e,o,n]),!1}),n=r.headerHeight(),e=r.footerHeight(),r.setState(c,!0),MB.webpackInterface.updateScreenStateCid(r,c),this.timerFired=!1,s=d.sort(function(t,e){return t[1].timestamp-e[1].timestamp}),o=i.sort(function(t,e){return t[1].timestamp-e[1].timestamp}),this.timeoutBucket.setTimeout("stateTimer",function(t){return function(){var i,a,c,l,u,h,p,f,g,m,v,y,b,_,w,x,S;for(u=r.headerHeight(),c=r.footerHeight(),n!==u&&($("#gh").css("height",u),$(".pcanvas.active .scontainer > .sheader").css("height",u)),e!==c&&($("#gf").css("height",c),$(".pcanvas.active .scontainer > .sfooter").css("height",c)),s=d.sort(function(t,e){return t[1].timestamp-e[1].timestamp}),p=0,m=s.length;p<m;p++)h=s[p],_=h[0],S=h[1],i=h[2],l=h[3],a=h[4],"none"!==S.ani_name&&(i&&(i.className+=" animated"),l&&(l.className+=" animated"),a&&(a.className+=" animated")),_.text!==S.text&&(WidgetManager.renderText(S,i),WidgetManager.renderText(S,a),WidgetManager.renderText(S,l)),WidgetManager.renderExtras(S,i,"p"),WidgetManager.renderExtras(S,l,"p"),WidgetManager.renderExtras(S,a,"p");for(w=s.concat(o),x=[],f=0,v=w.length;f<v;f++)h=w[f],b=h[0],y=h[1],i=h[2],l=h[3],a=h[4],g=Link.find(y.gid),g&&(g.targetstate_cid&&g.sourcestate_cid===y.screenstate_cid||g.target_cid)?(y.v&&(i&&t.setupWidgetLink($(i),g),l&&t.setupWidgetLink($(l),g),a&&t.setupWidgetLink($(a),g)),g.timer>0&&(!g.targetstate_cid||g.sourcestate_cid===y.screenstate_cid)?x.push(t.pageTimer(g)):x.push(void 0)):x.push($(i).removeClass("clickable"));return x}}(this),0),l=1e3*(parseFloat(t.ani_duration)+parseFloat(t.ani_delay||"0")),this.timeoutBucket.setTimeout("stateTimer2",function(t){return function(){var e,n,i,a,c,l,u,d,h,p,f,g,m,v;for(u=r.headerHeight(),a=r.footerHeight(),m=s.concat(o),v=[],h=0,p=m.length;h<p;h++)d=m[h],g=d[0],f=d[1],n=d[2],l=d[3],i=d[4],!g.fixed&&f.fixed?(l&&l.remove(),l=t.runnerUtil.cloneFixed(r,f,$(n))[0],$("#gs")[0].appendChild(l)):g.fixed&&!f.fixed&&($(n).show(),l&&l.remove(),l=null),!f.fixed&&n?(f.t()<u&&!l?(l=$(n).clone()[0],l.id=n.id+"gh",$("#gh")[0].appendChild(l)):f.t()>=u&&l&&(l.remove(),l=null,$(n).show()),e=f.t()+f.h(),c=0===r.footerHeight()?Number.MAX_VALUE:Math.floor(r.h()-r.footerHeight()),e>=c?(i||(i=$(n).clone()[0],i.id=i.id+"gf",$("#gf")[0].appendChild(i)),$(i).disableTransition(),$(i).enableTransition(),v.push(i.style.top=f.t()-c+"px")):e<c&&i?($(n).show(),i.remove(),v.push(i=null)):v.push(void 0)):v.push(void 0);return v}}(this),l)},t.prototype.setupWidgetLink=function(t,e){var n,i;if(i=this.currentMenu?Screen.find(this.currentMenu):Screen.find($(".pcanvas.active").data("cid")),!(e.target_cid===i.cid||e.targetstate_cid&&e.targetstate_cid===i.state_cid))return t.addClass("clickable"),t.attr("data-link_cid",e.cid),t.find(".region").length?void 0:(n="tap"!==e.gesture?e.gesture:"",t.append("<div class='region gesture "+n+"'></div>"))},t.prototype.setupPanelLinks=function(t){var e,n,i,r,o,s,a,c,l,u,d,h,p,f;for(u=Link.findAllByAttribute("screen_cid",t.data("cid")),n=0,o=u.length;n<o;n++)r=u[n],h=t[0].id.replace(t.data("cid"),r.target_cid),$("#"+h).enableTransition("10ms");for(l=t[0].parentElement.dataset.cid,p=Link.findAllByAttribute("state_cid",t.data("cid")),i=0,s=p.length;i<s;i++)for(r=p[i],d=r.cwidgets(),c=0,a=d.length;c<a;c++)f=d[c],f.v&&(e=t.find("#widget"+f.cid+l+"p"),this.setupWidgetLink(e,r));return setTimeout(function(t){return function(){var e,n,i,o;for(i=[],n=0,e=p.length;n<e;n++)r=p[n],o=Screen.find(r.target_cid),o?(t.renderWidgets(o),i.push($("#pscreen"+o.cid).enableTransition("10ms"))):i.push(void 0);return i}}(this),100)},t.prototype.setupPanelAnimationAndFixed=function(t){var e,n,i,r,o,s,a,c,l,u;for(o=t[0].parentElement,n=o.getElementsByClassName("fixed")[0],s=o.dataset.cid,l=Screen.find(t.data("cid")),n.innerHTML="",a=l.cwidgets(),c=[],i=0,r=a.length;i<r;i++)u=a[i],e=t.find("#widget"+u.cid+s+"p"),u.fixed&&(e=this.runnerUtil.cloneFixed(l,u,e,!1),n.appendChild(e[0])),"webpage"===u.name&&u.text?c.push(this.runnerUtil.setObjectUrl(e.find(".iframe")[0],u.text.replace(/&/g,"&"))):c.push(void 0);return c},t.prototype.setupFixedWidgets=function(t){var e,n,i,r,o,s,a,c,l,u,d,h,p,f,g,m,v,y,b,_,w,x,S,M,k,T,B,C,E,A,j,P,L;for(p=t.headerHeight(),c=t.footerHeight(),$("#gh").css("height",p).css("top",0).html(""),$("#gf").css("height",c).css("bottom",0).html(""),$(".pcanvas.active .scontainer > .sheader").css("height",p),$(".pcanvas.active .scontainer > .sfooter").css("height",c),(E=t.sb())?$("#gs").html(MB.widget(E,"p")):$("#gs").html(""),l=0===c?Number.MAX_VALUE:Math.floor(t.h()-c),h=document.createDocumentFragment(),d=document.createDocumentFragment(),u=document.createDocumentFragment(),m=function(){var e,n,i,r;for(i=t.citems(),r=[],e=0,n=i.length;e<n;e++)f=i[e],["sticky","pg"].indexOf(f.name)===-1&&r.push(f);return r}(),T=[],L=[],v=0,b=m.length;v<b;v++)f=m[v],"status_bar"!==f.name&&("panel"===f.name&&T.push(f),"webpage"===f.name&&L.push(f),A=f.t(),i="panel"===f.name?$("#panel"+f.cid+"p"):$("#widget"+f.cid+"p"),s=Math.floor(A+i.outerHeight()),"image_view"===f.name&&(/.gif$/.test(f.image)||(r=Asset.find(f.image))&&/.gif$/.test(r.image))&&(g=i.find("img")[0],g.src=g.src),f.fixed?(h.appendChild(this.runnerUtil.cloneFixed(t,f,i)[0]),i.removeClass("animated")):(A<p&&(e=i.clone(),e.attr("id",e.attr("id")+"gh"),d.appendChild(e[0])),s>=l&&A<t.h()&&(e=i.clone(),e.attr("id",e.attr("id")+"gf"),e.css("top",A-l),u.appendChild(e[0]))));for($("#gs")[0].appendChild(h),$("#gh")[0].appendChild(d),$("#gf")[0].appendChild(u),C=["p","pgh","pgf"],y=0,_=C.length;y<_;y++){for(B=C[y],S=0,w=T.length;S<w;S++)k=T[S],(a=document.getElementById("panel"+k.cid+B))&&(o=$(a).find(".state.active"),this.setupPanelLinks(o),this.setupPanelAnimationAndFixed(o));for(M=0,x=L.length;M<x;M++)P=L[M],(a=document.getElementById("widget"+P.cid+B))&&(n=$(a).find(".iframe")[0],j=P.text?P.text.replace(/&/g,"&"):"about:blank",this.runnerUtil.setObjectUrl(n,j))}return $("#gf .keyboard").show()},t.prototype.setupStatusBar=function(t){var e,n,i;if(e=$("#gs .status_bar").removeClass("standalone light"),window.innerHeight>window.innerWidth&&(e.addClass("standalone"),!(n=t.sb())||n.th&&"light"!==n.th||e.addClass("light")),MB.isIOS9()&&this.runnerUtil.deviceOrient()===t.orient())return i=MB.COMPONENTS.status_bar.height,$("#app").css({top:0-i,height:window.innerHeight+i})},t.prototype.setupPG=function(){var t;return this.hammertime=new e.Hammer($("#app")[0],{touchAction:"auto",inputClass:MB.isMobile()?e.Hammer.TouchInput:null}),this.hammertime.get("swipe").set({direction:e.Hammer.DIRECTION_ALL,velocity:.05,threshold:50}),this.hammertime.on("swipeleft",function(t){return function(e){return setTimeout(function(){return t.pj(e,"left")})}}(this)),this.hammertime.on("swiperight",function(t){return function(e){return setTimeout(function(){return t.pj(e,"right")})}}(this)),this.hammertime.on("swipeup",function(t){return function(e){return setTimeout(function(){return t.pj(e,"up")})}}(this)),this.hammertime.on("swipedown",function(t){return function(e){return setTimeout(function(){return t.pj(e,"down")})}}(this)),this.hammertime.on("press",function(t){return function(e){return setTimeout(function(){return t.pj(e,"hold")})}}(this)),this.hammertime.on("tap",function(t){return function(e){var n;if(1===e.tapCount){if(n=$(e.target).closest(".widget"),n.hasClass("switch"))return n.toggleClass("checked"),void setTimeout(function(){if(n.hasClass("clickable"))return t.pj(e,"tap")},250);setTimeout(function(){return t.pj(e,"tap")})}if(2===e.tapCount)return t.eventBucket.resetCoolDown(),t.hightTimer&&clearTimeout(t.hightTimer),setTimeout(function(){return t.pj(e,"dtap")})}}(this)),t=new Shake({threshold:15}),t.start(),window.addEventListener("shake",function(t){return function(e){return setTimeout(function(){return t.pj(e,"shake")})}}(this),!1)},t.prototype.setupPageGesture=function(t){var e,n,i,r,o,s;for(e=[],o=t.clinks(),n=0,r=o.length;n<r;n++)i=o[n],"left"!==i.gesture&&"right"!==i.gesture||e.indexOf("pan-y")===-1&&e.push("pan-y"),"up"!==i.gesture&&"down"!==i.gesture||e.indexOf("pan-x")===-1&&e.push("pan-x");return s=e.length?e.join(" "):"auto",this.hammertime.touchAction.actions=s,$(".pcanvas.active .widgets").css("touch-action",s)},t.prototype.pageTimer=function(t){return this.timeoutBucket.setTimeout(t.cid,function(e){return function(){if(!e.timerFired&&(e.timerFired=!0,"immersive"!==e.mode))return e.j(t)}}(this),1e3*t.timer)},t.prototype.panelTimer=function(t,e){if(Screen.find(t.target_cid))return this.timeoutBucket.setTimeout(e.cid,function(n){return function(){if(!e.timerFired&&!n.timerFired&&(e.timerFired=!0,e.lsave(!1),"immersive"!==n.mode))return n.panelWJ(t,$("#panel"+e.cid+"p")),$("#panel"+e.cid+"pgh").length&&n.panelWJ(t,$("#panel"+e.cid+"pgh")),$("#panel"+e.cid+"pgf").length?n.panelWJ(t,$("#panel"+e.cid+"pgf")):void 0}}(this),1e3*t.timer)},t.prototype.setupPanelTimers=function(t,e){var n,i,r,o,s,a,c,l,u;if(e||(n=$("#panel"+t.cid+"p .pstate.active").data("cid"),e=Screen.find(n)),e){for(this.timeoutBucket.clearTimeoutByKey(t.cid),t.timerFired=!1,t.lsave(!1),c=e.clinks(),i=0,o=c.length;i<o;i++)a=c[i],a.timer>0&&this.panelTimer(a,t);for(l=Link.findAllByAttribute("state_cid",e.cid),u=[],r=0,s=l.length;r<s;r++)a=l[r],a.timer>0&&u.push(this.pageTimer(a));return u}},t.prototype.setupPageTimers=function(t,e){var n,i,r,o,s,a,c,l,u,d;if(null==e&&(e="default"),"immersive"!==this.mode){for(this.timeoutBucket.clear(),l=t.cwidgets(),i=0,s=l.length;i<s;i++)n=l[i],e&&n.setState(e,!1),o=Link.find(n.gid),o&&o.timer>0&&(!o.targetstate_cid||o.sourcestate_cid===e)&&this.pageTimer(o);for(u=t.cpanels(),d=[],r=0,a=u.length;r<a;r++)c=u[r],d.push(this.setupPanelTimers(c));return d}},t.prototype.setupBackground=function(t,e){var n;if(n=e.bg(),$("#app").css({"background-color":n,"background-image":e.bgimage?"url("+e.getRealBgImage()+")":""
|
|
}),$(".pcanvas.active .sheader, .pcanvas.active .sfooter").css("background-color",n),e.bgimage&&$(".pcanvas.active .sheader").css("background-image","url("+e.getRealBgImage()+")"),!t.hasClass("drawer"))return t.css({"background-image":"","background-color":"transparent"})},t.prototype.renderScreen=function(){var t,e,n,i,r,o,s,a;for(a="",r=this.project.cscreens(),t=0,n=r.length;t<n;t++)s=r[t],a+=this.runnerUtil.screenPreview(s);for($("#app").append(a),o=this.project.cscreens(),e=0,i=o.length;e<i;e++)s=o[e],s.cid!==this.home.cid&&this.transitionUtil.hideScreen("#pscreen"+s.cid);return $("#pscreen"+this.home.cid).addClass("active"),this.renderWidgets(this.home)},t.prototype.renderWidgets=function(t){var e,n,i,r,o,s,a,c,l,u,d,h,p;if(!$("#pscreen"+t.cid+" .widget").length){for(p=new Date,t.setState("default",!0),d=t.citems(),s=0,c=d.length;s<c;s++)o=d[s],o.setState("default",!0);for(u=document.getElementById("pscreen"+t.cid),e=u.getElementsByClassName("scontainer")[0],n="",h=t.citems(),a=0,l=h.length;a<l;a++)if(o=h[a],"sticky"!==o.name)if("panel"===o.name)o.valid()&&(n+=MB.PanelPreview(o));else{if("pg"===o.name){if(!/^l/.test(o.gid))continue;o.top=o.left=null}r=MB.widget(o,"p"),n+=r}return e.innerHTML+=n,e.style.height=t.h()+"px",MB.isMobile()||(this.scrollSync.init($(".pcanvas.active .widgets")[0],$("#sticky-container")[0]),$("#pscreen"+t.cid+" .widgets").onScroll(this.scrollSync.delaySync),$("#pscreen"+t.cid+" .widgets").perfectScrollbar({suppressScrollX:!0,handlers:["click-rail","drag-scrollbar","wheel","touch"]})),i=new Date,i-p>500?MB.ga("send","event","performance","render("+(i-p)+")("+t.cid+")("+MB.project().model+")("+navigator.userAgent+")"):void 0}},t}(),this.DesignerRunner=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.render=function(t,e){return this.project=Project.find(t)||Template.find(t)||Combo.find(t),this.project?($("body").data("scale",100),this.home=Screen.find(e),this.home.setState("default",!0),this.init()):MB.webpackInterface.navigateTo("/workspace/apps")},e}(t),this.SharingRunner=function(t){function e(t){this.project=t,e.__super__.constructor.apply(this,arguments),MB.isIOS()&&this.disableRubberBand()}return n(e,t),e.prototype.disableRubberBand=function(){return document.body.ontouchstart=function(t){return function(e){return t.touchStartY=e.touches[0].screenY}}(this),document.body.ontouchmove=function(t){return function(e){var n;if(!$(e.target).closest(".ppanel").length)return n=$(e.target).closest(".widgets")[0],!n||e.touches[0].screenY>t.touchStartY&&0===n.scrollTop||e.touches[0].screenY<t.touchStartY&&n.scrollTop===n.scrollHeight-$(n).height()?e.preventDefault():void 0}}(this)},e.prototype.render=function(){return MB.currentScreen=this.home=this.project.homeScreen(),$("body").data("scale",100),(MB.isMobile()||MB.isEmbedded())&&(this.project.scale=100,this.project.lsave(!1)),MB.webpackInterface.renderPreview(document.querySelector("#workspace")),setTimeout(function(t){return function(){return $("#workspace").show(),t.init()}}(this),100)},e}(t)}.call(this),function(){this.Pusher=function(){function t(){var t,e,n,i;/modao.cc/.test(window.MBServer)?(e="zr0zakpglowydpzdfm9biewf3e1mv43ykz24ieu20vb8s3bl",n="0qbkbb3sxie08vnnac8ns2bz86lu9m8oam4wlvynh3mu3n08",i="cn"):(e="mw2fpdz5dqyge9ag4u9oxj6bvmx6fs1m3zq6po8dy36zkl8v",n="b3jezh7100lhusvjy7mzktticqzkrx7yj7y7j04lon7ct9c9",i="us"),this.open=!1,this.subscribed=[],this.pusher=AV.push({appId:e,appKey:n,region:i});try{this.pusher.open(function(t){return function(){return t.open=!0}}(this)),this.pusher.subscribe([MB.user.channel],function(){return console.log("\u8ba2\u9605\u6210\u529f\uff01")})}catch(t){}this.pusher.on("close",function(t){return function(){return t.open=!1}}(this)),this.pusher.on("open",function(t){return function(){return t.open=!0,t.onOpen&&t.onOpen(),t.onOpen=null}}(this)),this.pusher.on("message",function(t){return function(e){return t.onReceive(e)}}(this)),this.pusher.on("error",function(t){return function(){return t.open=!1}}(this)),t=$("#notification"),t.on("click",".icon-times, .ask_later",function(){return t.removeClass("active"),t.find(".request_permission").remove(),$("body").removeClass("notification-show")})}return t.prototype.subscribe=function(t){if(this.subscribed.indexOf(t)===-1)return this.subscribed.push(t)},t.prototype.onReceive=function(t){var e,n,i;if(t._channel===MB.user.channel)switch(t.event){case"notification":return MB.notifier&&this.handleNotification(t);case"collaboration":if("Project"===t.t)return this.updateProject(t.action,t.object);if("Team"===t.t)return this.updateTeam(t.action,t.object);if("Collaborator"===t.t)return this.updateCollaborator(t.action,t.object);if(t.from.id===MB.user.id)return;switch(t.t){case"Asset":return this.updateAsset(t.action,t.object);case"PointComments::Thread":return MB.webpackInterface&&MB.webpackInterface.pushData("comment-threads",t.action,t.object);case"PointComments::Comment":return MB.webpackInterface&&MB.webpackInterface.pushData("comments",t.action,t.object);default:if(MB.pusher.subscribed.indexOf(t.to)===-1)return;if(MB.f.inSharing)return;switch(t.t){case"Widget":this.updateWidget(t.action,t.object);break;case"Link":this.updateLink(t.action,t.object);break;case"Screen":this.updateScreen(t.action,t.object);break;case"Panel":this.updatePanel(t.action,t.object,t.extras);break;case"Screenstate":this.updateScreenstate(t.action,t.object);break;case"Widgetstate":this.updateWidgetstate(t.action,t.object);break;case"Panelstate":this.updatePanelstate(t.action,t.object)}if(n="Screen"===t.t?t.object.cid:t.object.screen_cid,!n&&t.object.screenstate_cid&&(i=Screenstate.find(t.object.screenstate_cid),i&&(n=i.screen_cid)),!t.from.id)return;return e=CoWorker.find(t.from.id),e||(e=new CoWorker({cid:t.from.id,name:t.from.name,avatar:t.from.avatar})),e.screen_cid=n,e.last_seen=new Date,e.save(),MB.renderCoWorkers&&MB.renderCoWorkers()}}},t.prototype.handleNotification=function(t){var e,n;if(!(t._channel!==MB.user.channel||t._expired||"new_thread_comment"===t.event_type&&MB.commentModeOn))return n={icon:"/images/mockingbot-logo80x80.png",body:t.message},MB.notifier.notify(I18N.got_message,n,1e4,function(e){var n;return e.preventDefault(),n=window,n.focus(),MB.notification.markRead(t.id,function(){return MB.notification.gotoDataUrl(t.url,n,t.need_reload,t.need_new_win)}),this.close()},void 0,function(e){return function(){return e.notifyFallback(t)}}(this)),e=$("#header .notifications-dropdown")[0],e?(ReactDOM.unmountComponentAtNode(e),MB.renderNotifications(e)):void 0},t.prototype.notifyFallback=function(t){if($("#notification").addClass("active"),$("#notification .request_permission_message").hide(),$("#notification .message").text(t.message),setTimeout(function(){return $("#notification").removeClass("active")},1e4),t.url)return $("#notification .message").off("click"),$("#notification .message").on("click",function(e){return e.preventDefault(),MB.notification.markRead(t.id,function(){return MB.notification.gotoDataUrl(t.url,window,t.need_reload,t.need_new_win)})})},t.prototype.updateWidget=function(t,e){var n,i;if(n=MB.getCurrentScreen(),"update"===t){if(i=Widget.find(e.cid),i?i.refresh(e):(i=new Widget,i.load(e),i.lsave(!1)),n===i.screen_cid)return ScreenManager.updateWidgetList()}else if("destroy"===t){if(i=Widget.find(e.cid),!i)return;if(i.ldestroy(!1),n===i.screen_cid)return ScreenManager.updateWidgetList(),MB.action("selection:unselect:items",{cids:[i.cid]})}},t.prototype.updatePanel=function(t,e,n){var i,r;if(i=MB.getCurrentScreen(),"update"===t){if(r=Panel.find(e.cid),!r)return $.ajax({type:"GET",url:"/app/"+n.template_token+".json",success:function(t){if(Template.refresh([t.project]),Screen.refresh(t.screens),Widget.refresh(t.widgets),Link.refresh(t.links),MB.pusher.subscribe(t.project.cid),r=new Panel,r.load(e),r.lsave(!1),MB.renderTemplateList(),i===r.screen_cid)return ScreenManager.updateWidgetList()}});if(r.refresh(e),i===r.screen_cid)return ScreenManager.updateWidgetList()}else if("destroy"===t){if(r=Panel.find(e.cid),!r)return;return i===r.screen_cid?(PanelManager.remove(r.cid,!1),MB.action("selection:unselect:items",{cids:[r.cid]}),ScreenManager.updateWidgetList()):r.ldestroy(!1)}},t.prototype.updateLink=function(t,e){var n,i;if(n=MB.getCurrentScreen(),"update"===t)i=Link.find(e.cid),i?i.refresh(e):(i=new Link,i.load(e),i.lsave(!1));else if("destroy"===t){if(i=Link.find(e.cid),!i)return;i.ldestroy(!1)}if(i&&n===i.screen_cid)return MB.renderLinks()},t.prototype.updateScreen=function(t,e){var n,i;if("update"===t){if(n=Screen.find(e.cid),n?(n.refresh(e),MB.currentScreen.cid===n.cid&&(MB.action("set:current:screen",{screen:n}),$("#design").trigger("slider:update"))):(n=new Screen,n.load(e),n.lsave(!1)),MB.currentProject&&MB.currentProject.cid===n.project_cid)return i=MB.currentProject.cscreens(),MB.action("update:screens:all",{screens:i})}else if("destroy"===t){if(n=Screen.find(e.cid),!n)return;if(n.ldestroy(!1),MB.currentProject&&MB.currentProject.cid===n.project_cid)return MB.action("entry:remove:from:screen-history",{cids:[n.cid]})}},t.prototype.updateProject=function(t,e){var n,i,r;if(!MB.f.inSharing)return"update"===t&&((n=Project.find(e.cid))?n.duplicating&&(i=n.screens_count,n.refresh(e),n.screens_count=i):(n=new Project,n.load(e),n.screens_count||(n.screens_count=2),n.lsave(!1)),MB.webpackInterface.refreshAll(),n.duplicating||$("#notification").removeClass("active"),MB.f.isDuplicatingDemo&&!n.duplicating&&(MB.f.isDuplicatingDemo=!1,MB.webpackInterface.navigateTo("/workspace/apps/"+n.cid))),"destroy"===t&&((n=Project.find(e.cid))?MB.webpackInterface.deleteProjectByCid(n.cid):(r=Template.find(e.cid))&&(r.ldestroy(!1),MB.renderTemplateList())),$(".timeago").timeago()},t.prototype.updateTeam=function(t,e){var n;if(!MB.f.inSharing)return"update"===t&&(n=Team.find(e.cid),n?n.refresh(e):(n=new Team,n.load(e),n.lsave(!1)),MB.webpackInterface.refreshAll()),"destroy"===t&&(n=Team.find(e.cid))?MB.webpackInterface.deleteTeamByCid(n.cid):void 0},t.prototype.updateCollaborator=function(t,e){var n,i,r;if(MB.f.inSharing){if("update"===t&&(n=Collaborator.find(e.cid),n?n.refresh(e):(n=new Collaborator,n.load(e),n.lsave(!1)),n.updateHostChannel(t),MB.webpackInterface.store.dispatch({type:"entry:state:init"})),"destroy"===t){if(n=Collaborator.find(e.cid),!n)return;if(n.updateHostChannel(t),n.ldestroy(!1),n.user_id===MB.user.id)return n.project_cid&&(i=Project.find(n.project_cid)),window.location.reload()}}else if("update"===t&&(n=Collaborator.find(e.cid),n?n.refresh(e):(n=new Collaborator,n.load(e),n.lsave(!1)),n.updateHostChannel(t),MB.webpackInterface.refreshAll()),"destroy"===t){if(n=Collaborator.find(e.cid),!n)return;if(n.updateHostChannel(t),n.ldestroy(!1),n.user_id===MB.user.id&&(n.project_cid&&(i=Project.find(n.project_cid)),i&&MB.webpackInterface.deleteProjectByCid(i.cid),n.team_cid&&(r=Team.find(n.team_cid)),r))return MB.webpackInterface.deleteTeamByCid(r.cid)}},t.prototype.updateScreenstate=function(t,e){var n,i;if(n=Screen.find(MB.currentScreen.cid),"update"===t){if(i=Screenstate.find(e.cid),i?i.refresh(e):(i=new Screenstate,i.load(e),i.lsave(!1)),n&&n.cid===i.screen_cid)return MB.renderStateList()}else if("destroy"===t){if(i=Screenstate.find(e.cid),!i)return;if(i.ldestroy(!1),n&&n.cid===i.screen_cid)return n.state_cid===i.cid&&(n.setState("default",!0),MB.action("set:current:screen",{screen:n}),ScreenManager.updateWidgetList()),MB.renderStateList()}},t.prototype.updateWidgetstate=function(t,e){var n,i,r;if(n=Screen.find(MB.currentScreen.cid),"update"===t&&(r=Widgetstate.find(e.cid),r?r.refresh(e):(r=new Widgetstate,r.load(e),r.lsave(!1)),n&&n.state_cid===r.screenstate_cid&&(i=Widget.find(r.widget_cid),i.screenstate_cid===r.screenstate_cid)))return i.restore(r),i.lsave(!1),ScreenManager.updateWidgetList()},t.prototype.updateAsset=function(t,e){var n;if(!MB.f.inSharing)return"create"===t?(n=new Asset,n.load(e),n.lsave(!1)):void 0},t.prototype.updatePanelstate=function(t,e){var n,i,r;if(r=Screen.find(MB.currentScreen.cid),"update"===t&&(i=Panelstate.find(e.cid),i?i.refresh(e):(i=new Panelstate,i.load(e),i.lsave(!1)),r&&r.state_cid===i.screenstate_cid&&(n=Panel.find(i.panel_cid),n.screenstate_cid===i.screenstate_cid)))return n.restore(i),n.lsave(!1),ScreenManager.updateWidgetList()},t}()}.call(this),function(){}.call(this);
|