text: /* cos-js-sdk-v4 1.1.2 */
  ;(function(){var $=function(){function e(e){var t=e.length,n=D.type(e);return"function"!==n&&!D.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function t(e){var t=M[e]={};return D.each(e.match(P)||[],function(e,n){t[n]=!0}),t}function n(){q.addEventListener?(q.removeEventListener("DOMContentLoaded",r,!1),window.removeEventListener("load",r,!1)):(q.detachEvent("onreadystatechange",r),window.detachEvent("onload",r))}function r(){(q.addEventListener||"load"===event.type||"complete"===q.readyState)&&(n(),D.ready())}function a(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(B,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:$.test(n)?D.parseJSON(n):n)}catch(a){}D.data(e,t,n)}else n=void 0}return n}function i(e){var t;for(t in e)if(("data"!==t||!D.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(e,t,n,r){if(D.acceptData(e)){var a,i,o=D.expando,s=e.nodeType,c=s?D.cache:e,u=s?e[o]:e[o]&&o;if(u&&c[u]&&(r||c[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[o]=g.pop()||D.guid++:o),c[u]||(c[u]=s?{}:{toJSON:D.noop}),"object"!=typeof t&&"function"!=typeof t||(r?c[u]=D.extend(c[u],t):c[u].data=D.extend(c[u].data,t)),i=c[u],r||(i.data||(i.data={}),i=i.data),void 0!==n&&(i[D.camelCase(t)]=n),"string"==typeof t?(a=i[t],null==a&&(a=i[D.camelCase(t)])):a=i,a}}function s(e,t,n){if(D.acceptData(e)){var r,a,o=e.nodeType,s=o?D.cache:e,c=o?e[D.expando]:D.expando;if(s[c]){if(t&&(r=n?s[c]:s[c].data)){D.isArray(t)?t=t.concat(D.map(t,D.camelCase)):t in r?t=[t]:(t=D.camelCase(t),t=t in r?[t]:t.split(" ")),a=t.length;for(;a--;)delete r[t[a]];if(n?!i(r):!D.isEmptyObject(r))return}(n||(delete s[c].data,i(s[c])))&&(o?D.cleanData([e],!0):C.deleteExpando||s!=s.window?delete s[c]:s[c]=null)}}}function c(){return!0}function u(){return!1}function l(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,a=0,i=t.toLowerCase().match(P)||[];if(D.isFunction(n))for(;r=i[a++];)"+"===r.charAt(0)?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function d(e,t,n,r){function a(s){var c;return i[s]=!0,D.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(c=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),c}var i={},o=e===ce;return a(t.dataTypes[0])||!i["*"]&&a("*")}function f(e,t){var n,r,a=D.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((a[r]?e:n||(n={}))[r]=t[r]);return n&&D.extend(!0,e,n),e}function p(e,t,n){for(var r,a,i,o,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===a&&(a=e.mimeType||t.getResponseHeader("Content-Type"));if(a)for(o in s)if(s[o]&&s[o].test(a)){c.unshift(o);break}if(c[0]in n)i=c[0];else{for(o in n){if(!c[0]||e.converters[o+" "+c[0]]){i=o;break}r||(r=o)}i=i||r}if(i)return i!==c[0]&&c.unshift(i),n[i]}function h(e,t,n,r){var a,i,o,s,c,u={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)u[o.toLowerCase()]=e.converters[o];for(i=l.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!c&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=i,i=l.shift())if("*"===i)i=c;else if("*"!==c&&c!==i){if(o=u[c+" "+i]||u["* "+i],!o)for(a in u)if(s=a.split(" "),s[1]===i&&(o=u[c+" "+s[0]]||u["* "+s[0]])){o===!0?o=u[a]:u[a]!==!0&&(i=s[0],l.unshift(s[1]));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(d){return{state:"parsererror",error:o?d:"No conversion from "+c+" to "+i}}}return{state:"success",data:t}}function v(e,t,n,r){var a;if(D.isArray(t))D.each(t,function(t,a){n||fe.test(e)?r(e,a):v(e+"["+("object"==typeof a?t:"")+"]",a,n,r)});else if(n||"object"!==D.type(t))r(e,t);else for(a in t)v(e+"["+a+"]",t[a],n,r)}function y(){try{return new window.XMLHttpRequest}catch(e){}}function m(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}var g=[],x=g.slice,b=g.concat,w=g.push,j=g.indexOf,T={},E=T.toString,S=T.hasOwnProperty,C={},k="1.11.1 -css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-effects/support,-dimensions,-offset,-deprecated,-event-alias,-wrap",D=function(e,t){return new D.fn.init(e,t)},_=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,L=/^-ms-/,A=/-([\da-z])/gi,N=function(e,t){return t.toUpperCase()};D.fn=D.prototype={jquery:k,constructor:D,selector:"",length:0,toArray:function(){return x.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:x.call(this)},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return D.each(this,e,t)},map:function(e){return this.pushStack(D.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(x.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:w,sort:g.sort,splice:g.splice},D.extend=D.fn.extend=function(){var e,t,n,r,a,i,o=arguments[0]||{},s=1,c=arguments.length,u=!1;for("boolean"==typeof o&&(u=o,o=arguments[s]||{},s++),"object"==typeof o||D.isFunction(o)||(o={}),s===c&&(o=this,s--);s<c;s++)if(null!=(a=arguments[s]))for(r in a)e=o[r],n=a[r],o!==n&&(u&&n&&(D.isPlainObject(n)||(t=D.isArray(n)))?(t?(t=!1,i=e&&D.isArray(e)?e:[]):i=e&&D.isPlainObject(e)?e:{},o[r]=D.extend(u,i,n)):void 0!==n&&(o[r]=n));return o},D.extend({expando:"jQuery"+(k+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===D.type(e)},isArray:Array.isArray||function(e){return"array"===D.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!D.isArray(e)&&e-parseFloat(e)>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==D.type(e)||e.nodeType||D.isWindow(e))return!1;try{if(e.constructor&&!S.call(e,"constructor")&&!S.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(C.ownLast)for(t in e)return S.call(e,t);for(t in e);return void 0===t||S.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?T[E.call(e)]||"object":typeof e},globalEval:function(e){e&&D.trim(e)&&(window.execScript||function(e){window.eval.call(window,e)})(e)},camelCase:function(e){return e.replace(L,"ms-").replace(A,N)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(t,n,r){var a,i=0,o=t.length,s=e(t);if(r){if(s)for(;i<o&&(a=n.apply(t[i],r),a!==!1);i++);else for(i in t)if(a=n.apply(t[i],r),a===!1)break}else if(s)for(;i<o&&(a=n.call(t[i],i,t[i]),a!==!1);i++);else for(i in t)if(a=n.call(t[i],i,t[i]),a===!1)break;return t},trim:function(e){return null==e?"":(e+"").replace(_,"")},makeArray:function(t,n){var r=n||[];return null!=t&&(e(Object(t))?D.merge(r,"string"==typeof t?[t]:t):w.call(r,t)),r},inArray:function(e,t,n){var r;if(t){if(j)return j.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,r=0,a=e.length;r<n;)e[a++]=t[r++];if(n!==n)for(;void 0!==t[r];)e[a++]=t[r++];return e.length=a,e},grep:function(e,t,n){for(var r,a=[],i=0,o=e.length,s=!n;i<o;i++)r=!t(e[i],i),r!==s&&a.push(e[i]);return a},map:function(t,n,r){var a,i=0,o=t.length,s=e(t),c=[];if(s)for(;i<o;i++)a=n(t[i],i,r),null!=a&&c.push(a);else for(i in t)a=n(t[i],i,r),null!=a&&c.push(a);return b.apply([],c)},guid:1,proxy:function(e,t){var n,r,a;if("string"==typeof t&&(a=e[t],t=e,e=a),D.isFunction(e))return n=x.call(arguments,2),r=function(){return e.apply(t||this,n.concat(x.call(arguments)))},r.guid=e.guid=e.guid||D.guid++,r},now:function(){return+new Date},support:C}),D.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){T["[object "+t+"]"]=t.toLowerCase()});var O,q=window.document,H=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,F=D.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:H.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||O).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof D?t[0]:t,D.merge(this,D.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:q,!0)),rsingleTag.test(n[1])&&D.isPlainObject(t))for(n in t)D.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if(r=q.getElementById(n[2]),r&&r.parentNode){if(r.id!==n[2])return O.find(e);this.length=1,this[0]=r}return this.context=q,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):D.isFunction(e)?"undefined"!=typeof O.ready?O.ready(e):e(D):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),D.makeArray(e,this))};F.prototype=D.fn,O=D(q);var P=/\S+/g,M={};D.Callbacks=function(e){e="string"==typeof e?M[e]||t(e):D.extend({},e);var n,r,a,i,o,s,c=[],u=!e.once&&[],l=function(t){for(r=e.memory&&t,a=!0,o=s||0,s=0,i=c.length,n=!0;c&&o<i;o++)if(c[o].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,c&&(u?u.length&&l(u.shift()):r?c=[]:d.disable())},d={add:function(){if(c){var t=c.length;!function a(t){D.each(t,function(t,n){var r=D.type(n);"function"===r?e.unique&&d.has(n)||c.push(n):n&&n.length&&"string"!==r&&a(n)})}(arguments),n?i=c.length:r&&(s=t,l(r))}return this},remove:function(){return c&&D.each(arguments,function(e,t){for(var r;(r=D.inArray(t,c,r))>-1;)c.splice(r,1),n&&(r<=i&&i--,r<=o&&o--)}),this},has:function(e){return e?D.inArray(e,c)>-1:!(!c||!c.length)},empty:function(){return c=[],i=0,this},disable:function(){return c=u=r=void 0,this},disabled:function(){return!c},lock:function(){return u=void 0,r||d.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!c||a&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):l(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!a}};return d},D.extend({Deferred:function(e){var t=[["resolve","done",D.Callbacks("once memory"),"resolved"],["reject","fail",D.Callbacks("once memory"),"rejected"],["notify","progress",D.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var e=arguments;return D.Deferred(function(n){D.each(t,function(t,i){var o=D.isFunction(e[t])&&e[t];a[i[1]](function(){var e=o&&o.apply(this,arguments);e&&D.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?D.extend(e,r):r}},a={};return r.pipe=r.then,D.each(t,function(e,i){var o=i[2],s=i[3];r[i[1]]=o.add,s&&o.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),a[i[0]]=function(){return a[i[0]+"With"](this===a?r:this,arguments),this},a[i[0]+"With"]=o.fireWith}),r.promise(a),e&&e.call(a,a),a},when:function(e){var t,n,r,a=0,i=x.call(arguments),o=i.length,s=1!==o||e&&D.isFunction(e.promise)?o:0,c=1===s?e:D.Deferred(),u=function(e,n,r){return function(a){n[e]=this,r[e]=arguments.length>1?x.call(arguments):a,r===t?c.notifyWith(n,r):--s||c.resolveWith(n,r)}};if(o>1)for(t=new Array(o),n=new Array(o),r=new Array(o);a<o;a++)i[a]&&D.isFunction(i[a].promise)?i[a].promise().done(u(a,r,i)).fail(c.reject).progress(u(a,n,t)):--s;return s||c.resolveWith(r,i),c.promise()}});var W;D.fn.ready=function(e){return D.ready.promise().done(e),this},D.extend({isReady:!1,readyWait:1,holdReady:function(e){e?D.readyWait++:D.ready(!0)},ready:function(e){if(e===!0?!--D.readyWait:!D.isReady){if(!q.body)return setTimeout(D.ready);D.isReady=!0,e!==!0&&--D.readyWait>0||(W.resolveWith(q,[D]),D.fn.triggerHandler&&(D(q).triggerHandler("ready"),D(q).off("ready")))}}}),D.ready.promise=function(e){if(!W)if(W=D.Deferred(),"complete"===q.readyState)setTimeout(D.ready);else if(q.addEventListener)q.addEventListener("DOMContentLoaded",r,!1),window.addEventListener("load",r,!1);else{q.attachEvent("onreadystatechange",r),window.attachEvent("onload",r);var t=!1;try{t=null==window.frameElement&&q.documentElement}catch(a){}t&&t.doScroll&&!function i(){if(!D.isReady){try{t.doScroll("left")}catch(e){return setTimeout(i,50)}n(),D.ready()}}()}return W.promise(e)};var R,X="undefined";for(R in D(C))break;C.ownLast="0"!==R,C.inlineBlockNeedsLayout=!1,D(function(){var e,t,n,r;n=q.getElementsByTagName("body")[0],n&&n.style&&(t=q.createElement("div"),r=q.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==X&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",C.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(r))}),function(){var e=q.createElement("div");if(null==C.deleteExpando){C.deleteExpando=!0;try{delete e.test}catch(t){C.deleteExpando=!1}}e=null}(),D.acceptData=function(e){var t=D.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)};var $=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,B=/([A-Z])/g;D.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?D.cache[e[D.expando]]:e[D.expando],!!e&&!i(e)},data:function(e,t,n){return o(e,t,n)},removeData:function(e,t){return s(e,t)},_data:function(e,t,n){return o(e,t,n,!0)},_removeData:function(e,t){return s(e,t,!0)}}),D.fn.extend({data:function(e,t){var n,r,i,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(i=D.data(o),1===o.nodeType&&!D._data(o,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&(r=s[n].name,0===r.indexOf("data-")&&(r=D.camelCase(r.slice(5)),a(o,r,i[r])));D._data(o,"parsedAttrs",!0)}return i}return"object"==typeof e?this.each(function(){D.data(this,e)}):arguments.length>1?this.each(function(){D.data(this,e,t)}):o?a(o,e,D.data(o,e)):void 0},removeData:function(e){return this.each(function(){D.removeData(this,e)})}}),D.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=D._data(e,t),n&&(!r||D.isArray(n)?r=D._data(e,t,D.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=D.queue(e,t),r=n.length,a=n.shift(),i=D._queueHooks(e,t),o=function(){D.dequeue(e,t)};"inprogress"===a&&(a=n.shift(),r--),a&&("fx"===t&&n.unshift("inprogress"),delete i.stop,a.call(e,o,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return D._data(e,n)||D._data(e,n,{empty:D.Callbacks("once memory").add(function(){D._removeData(e,t+"queue"),D._removeData(e,n)})})}}),D.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?D.queue(this[0],e):void 0===t?this:this.each(function(){var n=D.queue(this,e,t);D._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&D.dequeue(this,e)})},dequeue:function(e){return this.each(function(){D.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,a=D.Deferred(),i=this,o=this.length,s=function(){--r||a.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)n=D._data(i[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),a.promise(t)}}),D.event={global:{},add:function(e,t,n,r,a){var i,o,s,c,u,l,d,f,p,h,v,y=D._data(e);if(y){for(n.handler&&(c=n,n=c.handler,a=c.selector),n.guid||(n.guid=D.guid++),(o=y.events)||(o=y.events={}),(l=y.handle)||(l=y.handle=function(e){return typeof D===X||e&&D.event.triggered===e.type?void 0:D.event.dispatch.apply(l.elem,arguments)},l.elem=e),t=(t||"").match(P)||[""],s=t.length;s--;)i=U.exec(t[s])||[],p=v=i[1],h=(i[2]||"").split(".").sort(),p&&(u=D.event.special[p]||{},p=(a?u.delegateType:u.bindType)||p,u=D.event.special[p]||{},d=D.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:a,needsContext:a&&D.expr.match.needsContext.test(a),namespace:h.join(".")},c),(f=o[p])||(f=o[p]=[],f.delegateCount=0,u.setup&&u.setup.call(e,r,h,l)!==!1||(e.addEventListener?e.addEventListener(p,l,!1):e.attachEvent&&e.attachEvent("on"+p,l))),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),a?f.splice(f.delegateCount++,0,d):f.push(d),D.event.global[p]=!0);e=null}},remove:function(e,t,n,r,a){var i,o,s,c,u,l,d,f,p,h,v,y=D.hasData(e)&&D._data(e);if(y&&(l=y.events)){for(t=(t||"").match(P)||[""],u=t.length;u--;)if(s=U.exec(t[u])||[],p=v=s[1],h=(s[2]||"").split(".").sort(),p){for(d=D.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,f=l[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=i=f.length;i--;)o=f[i],!a&&v!==o.origType||n&&n.guid!==o.guid||s&&!s.test(o.namespace)||r&&r!==o.selector&&("**"!==r||!o.selector)||(f.splice(i,1),o.selector&&f.delegateCount--,d.remove&&d.remove.call(e,o));c&&!f.length&&(d.teardown&&d.teardown.call(e,h,y.handle)!==!1||D.removeEvent(e,p,y.handle),delete l[p])}else for(p in l)D.event.remove(e,p+t[u],n,r,!0);D.isEmptyObject(l)&&(delete y.handle,D._removeData(e,"events"))}},trigger:function(e,t,n,r){var a,i,o,s,c,u,l,d=[n||q],f=S.call(e,"type")?e.type:e,p=S.call(e,"namespace")?e.namespace.split("."):[];if(o=u=n=n||q,3!==n.nodeType&&8!==n.nodeType&&!K.test(f+D.event.triggered)&&(f.indexOf(".")>=0&&(p=f.split("."),f=p.shift(),p.sort()),i=f.indexOf(":")<0&&"on"+f,e=e[D.expando]?e:new D.Event(f,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:D.makeArray(t,[e]),c=D.event.special[f]||{},r||!c.trigger||c.trigger.apply(n,t)!==!1)){if(!r&&!c.noBubble&&!D.isWindow(n)){for(s=c.delegateType||f,K.test(s+f)||(o=o.parentNode);o;o=o.parentNode)d.push(o),u=o;u===(n.ownerDocument||q)&&d.push(u.defaultView||u.parentWindow||window)}for(l=0;(o=d[l++])&&!e.isPropagationStopped();)e.type=l>1?s:c.bindType||f,a=(D._data(o,"events")||{})[e.type]&&D._data(o,"handle"),a&&a.apply(o,t),a=i&&o[i],a&&a.apply&&D.acceptData(o)&&(e.result=a.apply(o,t),e.result===!1&&e.preventDefault());if(e.type=f,!r&&!e.isDefaultPrevented()&&(!c._default||c._default.apply(d.pop(),t)===!1)&&D.acceptData(n)&&i&&n[f]&&!D.isWindow(n)){u=n[i],u&&(n[i]=null),D.event.triggered=f;try{n[f]()}catch(h){}D.event.triggered=void 0,u&&(n[i]=u)}return e.result}},dispatch:function(e){e=D.event.fix(e);var t,n,r,a,i,o=[],s=x.call(arguments),c=(D._data(this,"events")||{})[e.type]||[],u=D.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(o=D.event.handlers.call(this,e,c),t=0;(a=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,i=0;(r=a.handlers[i++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(r.namespace)||(e.handleObj=r,e.data=r.data,n=((D.event.special[r.origType]||{}).handle||r.handler).apply(a.elem,s),void 0!==n&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,a,i,o=[],s=t.delegateCount,c=e.target;if(s&&c.nodeType&&(!e.button||"click"!==e.type))for(;c!=this;c=c.parentNode||this)if(1===c.nodeType&&(c.disabled!==!0||"click"!==e.type)){for(a=[],i=0;i<s;i++)r=t[i],n=r.selector+" ",void 0===a[n]&&(a[n]=r.needsContext?D(n,this).index(c)>=0:D.find(n,this,null,[c]).length),a[n]&&a.push(r);a.length&&o.push({elem:c,handlers:a})}return s<t.length&&o.push({elem:this,handlers:t.slice(s)}),o},fix:function(e){if(e[D.expando])return e;var t,n,r,a=e.type,i=e,o=this.fixHooks[a];for(o||(this.fixHooks[a]=o=z.test(a)?this.mouseHooks:J.test(a)?this.keyHooks:{}),r=o.props?this.props.concat(o.props):this.props,e=new D.Event(i),t=r.length;t--;)n=r[t],e[n]=i[n];return e.target||(e.target=i.srcElement||q),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,i):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,a,i=t.button,o=t.fromElement;return null==e.pageX&&null!=t.clientX&&(r=e.target.ownerDocument||q,a=r.documentElement,n=r.body,e.pageX=t.clientX+(a&&a.scrollLeft||n&&n.scrollLeft||0)-(a&&a.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(a&&a.scrollTop||n&&n.scrollTop||0)-(a&&a.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),e.which||void 0===i||(e.which=1&i?1:2&i?3:4&i?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(D.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(e){return D.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var a=D.extend(new D.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?D.event.trigger(a,null,t):D.event.dispatch.call(t,a),a.isDefaultPrevented()&&n.preventDefault()}},D.removeEvent=q.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===X&&(e[r]=null),e.detachEvent(r,n))},D.Event=function(e,t){return this instanceof D.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?c:u):this.type=e,t&&D.extend(this,t),this.timeStamp=e&&e.timeStamp||D.now(),void(this[D.expando]=!0)):new D.Event(e,t)};var I=/^(?:input|select|textarea)$/i,J=/^key/,z=/^(?:mouse|pointer|contextmenu)|click/,K=/^(?:focusinfocus|focusoutblur)$/,U=/^([^.]*)(?:\.(.+)|)$/;D.Event.prototype={isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=c,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=c,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=c,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},C.submitBubbles||(D.event.special.submit={setup:function(){return!D.nodeName(this,"form")&&void D.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=D.nodeName(t,"input")||D.nodeName(t,"button")?t.form:void 0;n&&!D._data(n,"submitBubbles")&&(D.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),D._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&D.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!D.nodeName(this,"form")&&void D.event.remove(this,"._submit")}}),C.changeBubbles||(D.event.special.change={setup:function(){return I.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(D.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),D.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),D.event.simulate("change",this,e,!0)})),!1):void D.event.add(this,"beforeactivate._change",function(e){var t=e.target;I.test(t.nodeName)&&!D._data(t,"changeBubbles")&&(D.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||D.event.simulate("change",this.parentNode,e,!0)}),D._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return D.event.remove(this,"._change"),!I.test(this.nodeName)}}),C.focusinBubbles||D.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){D.event.simulate(t,e.target,D.event.fix(e),!0)};D.event.special[t]={setup:function(){var r=this.ownerDocument||this,a=D._data(r,t);a||r.addEventListener(e,n,!0),D._data(r,t,(a||0)+1)},teardown:function(){var r=this.ownerDocument||this,a=D._data(r,t)-1;a?D._data(r,t,a):(r.removeEventListener(e,n,!0),D._removeData(r,t))}}}),D.fn.extend({on:function(e,t,n,r,a){var i,o;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(i in e)this.on(i,t,n,e[i],a);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=u;else if(!r)return this;return 1===a&&(o=r,r=function(e){return D().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=D.guid++)),this.each(function(){D.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,a;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,D(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(a in e)this.off(a,t,e[a]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=u),this.each(function(){D.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){D.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return D.event.trigger(e,t,n,!0)}}),D.fn.delay=function(e,t){return e=D.fx?D.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})};var Y=D.now(),G=/\?/,V=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;D.parseJSON=function(e){if(window.JSON&&window.JSON.parse)return window.JSON.parse(e+"");var t,n=null,r=D.trim(e+"");return r&&!D.trim(r.replace(V,function(e,r,a,i){return t&&r&&(n=0),0===n?e:(t=a||r,n+=!i-!a,"")}))?Function("return "+r)():D.error("Invalid JSON: "+e)},D.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{window.DOMParser?(n=new DOMParser,t=n.parseFromString(e,"text/xml")):(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e))}catch(r){t=void 0}return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length||D.error("Invalid XML: "+e),t};var Q,Z,ee=/#.*$/,te=/([?&])_=[^&]*/,ne=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,re=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ae=/^(?:GET|HEAD)$/,ie=/^\/\//,oe=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,se={},ce={},ue="*/".concat("*");try{Z=location.href}catch(le){Z=q.createElement("a"),Z.href="",Z=Z.href}Q=oe.exec(Z.toLowerCase())||[],D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Z,type:"GET",isLocal:re.test(Q[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ue,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":D.parseJSON,"text xml":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?f(f(e,D.ajaxSettings),t):f(D.ajaxSettings,e)},ajaxPrefilter:l(se),ajaxTransport:l(ce),ajax:function(e,t){function n(e,t,n,r){var a,l,d,b,w,T=t;2!==j&&(j=2,s&&clearTimeout(s),u=void 0,o=r||"",E.readyState=e>0?4:0,a=e>=200&&e<300||304===e,n&&(b=p(f,E,n)),b=h(f,b,E,a),a?(f.ifModified&&(w=E.getResponseHeader("Last-Modified"),w&&(D.lastModified[i]=w),w=E.getResponseHeader("etag"),w&&(D.etag[i]=w)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=b.state,l=b.data,d=b.error,a=!d)):(d=T,!e&&T||(T="error",e<0&&(e=0))),E.status=e,E.statusText=(t||T)+"",a?m.resolveWith(v,[l,T,E]):m.rejectWith(v,[E,T,d]),E.statusCode(x),x=void 0,c&&y.trigger(a?"ajaxSuccess":"ajaxError",[E,f,a?l:d]),g.fireWith(v,[E,T]),c&&(y.trigger("ajaxComplete",[E,f]),--D.active||D.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,a,i,o,s,c,u,l,f=D.ajaxSetup({},t),v=f.context||f,y=f.context&&(v.nodeType||v.jquery)?D(v):D.event,m=D.Deferred(),g=D.Callbacks("once memory"),x=f.statusCode||{},b={},w={},j=0,T="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(2===j){if(!l)for(l={};t=ne.exec(o);)l[t[1].toLowerCase()]=t[2];t=l[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===j?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return j||(e=w[n]=w[n]||e,b[e]=t),this},overrideMimeType:function(e){return j||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(j<2)for(t in e)x[t]=[x[t],e[t]];else E.always(e[E.status]);return this},abort:function(e){var t=e||T;return u&&u.abort(t),n(0,t),this}};if(m.promise(E).complete=g.add,E.success=E.done,E.error=E.fail,f.url=((e||f.url||Z)+"").replace(ee,"").replace(ie,Q[1]+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=D.trim(f.dataType||"*").toLowerCase().match(P)||[""],null==f.crossDomain&&(r=oe.exec(f.url.toLowerCase()),f.crossDomain=!(!r||r[1]===Q[1]&&r[2]===Q[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(Q[3]||("http:"===Q[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=D.param(f.data,f.traditional)),d(se,f,t,E),2===j)return E;c=f.global,c&&0===D.active++&&D.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!ae.test(f.type),i=f.url,f.hasContent||(f.data&&(i=f.url+=(G.test(i)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=te.test(i)?i.replace(te,"$1_="+Y++):i+(G.test(i)?"&":"?")+"_="+Y++)),f.ifModified&&(D.lastModified[i]&&E.setRequestHeader("If-Modified-Since",D.lastModified[i]),D.etag[i]&&E.setRequestHeader("If-None-Match",D.etag[i])),(f.data&&f.hasContent&&f.contentType!==!1||t.contentType)&&E.setRequestHeader("Content-Type",f.contentType),E.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+ue+"; q=0.01":""):f.accepts["*"]);for(a in f.headers)E.setRequestHeader(a,f.headers[a]);if(f.beforeSend&&(f.beforeSend.call(v,E,f)===!1||2===j))return E.abort();T="abort";for(a in{success:1,error:1,complete:1})E[a](f[a]);if(u=d(ce,f,t,E)){E.readyState=1,c&&y.trigger("ajaxSend",[E,f]),f.async&&f.timeout>0&&(s=setTimeout(function(){E.abort("timeout")},f.timeout));try{j=1,u.send(b,n)}catch(S){if(!(j<2))throw S;n(-1,S)}}else n(-1,"No Transport");return E},getJSON:function(e,t,n){return D.get(e,t,n,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],function(e,t){D[t]=function(e,n,r,a){return D.isFunction(n)&&(a=a||r,r=n,n=void 0),D.ajax({url:e,type:t,dataType:a,data:n,success:r})}}),D.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){D.fn[t]=function(e){return this.on(t,e)}}),D._evalUrl=function(e){return D.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};var de=/%20/g,fe=/\[\]$/,pe=/\r?\n/g,he=/^(?:submit|button|image|reset|file)$/i,ve=/^(?:input|select|textarea|keygen)/i;D.param=function(e,t){var n,r=[],a=function(e,t){t=D.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=D.ajaxSettings&&D.ajaxSettings.traditional),D.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,function(){a(this.name,this.value)});else for(n in e)v(n,e[n],t,a);return r.join("&").replace(de,"+")},D.fn.extend({serialize:function(){return D.param(this.serializeArray());
  },serializeArray:function(){return this.map(function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&ve.test(this.nodeName)&&!he.test(e)&&(this.checked||!rcheckableType.test(e))}).map(function(e,t){var n=D(this).val();return null==n?null:D.isArray(n)?D.map(n,function(e){return{name:t.name,value:e.replace(pe,"\r\n")}}):{name:t.name,value:n.replace(pe,"\r\n")}}).get()}}),D.ajaxSettings.xhr=void 0!==window.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&y()||m()}:y;var ye=0,me={},ge=D.ajaxSettings.xhr();window.ActiveXObject&&D(window).on("unload",function(){for(var e in me)me[e](void 0,!0)}),C.cors=!!ge&&"withCredentials"in ge,ge=C.ajax=!!ge,ge&&D.ajaxTransport(function(e){if(!e.crossDomain||C.cors){var t;return{send:function(n,r){var a,i=e.xhr(),o=++ye;if(i.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)i[a]=e.xhrFields[a];e.mimeType&&i.overrideMimeType&&i.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(a in n)void 0!==n[a]&&i.setRequestHeader(a,n[a]+"");i.send(e.hasContent&&e.data||null),t=function(n,a){var s,c,u;if(t&&(a||4===i.readyState))if(delete me[o],t=void 0,i.onreadystatechange=D.noop,a)4!==i.readyState&&i.abort();else{u={},s=i.status,"string"==typeof i.responseText&&(u.text=i.responseText);try{c=i.statusText}catch(l){c=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=u.text?200:404}u&&r(s,c,u,i.getAllResponseHeaders())},e.async?4===i.readyState?setTimeout(t):i.onreadystatechange=me[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),D.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return D.globalEval(e),e}}}),D.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),D.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=q.head||D("head")[0]||q.documentElement;return{send:function(r,a){t=q.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||a(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var xe=[],be=/(=)\?(?=&|$)|\?\?/;return D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=xe.pop()||D.expando+"_"+Y++;return this[e]=!0,e}}),D.ajaxPrefilter("json jsonp",function(e,t,n){var r,a,i,o=e.jsonp!==!1&&(be.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&be.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=D.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(be,"$1"+r):e.jsonp!==!1&&(e.url+=(G.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return i||D.error(r+" was not called"),i[0]},e.dataTypes[0]="json",a=window[r],window[r]=function(){i=arguments},n.always(function(){window[r]=a,e[r]&&(e.jsonpCallback=t.jsonpCallback,xe.push(r)),i&&D.isFunction(a)&&a(i[0]),i=a=void 0}),"script"}),D.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||q;var r=rsingleTag.exec(e),a=!n&&[];return r?[t.createElement(r[1])]:(r=D.buildFragment([e],t,a),a&&a.length&&D(a).remove(),D.merge([],r.childNodes))},D}();
  "use strict";!function(r){function t(r,t,f){var s,c,E,d,b,g,v,A,F,w=0,R=[],B=0,U=!1,y=[],m=[],H=!1;if(f=f||{},s=f.encoding||"UTF8",F=f.numRounds||1,F!==parseInt(F,10)||1>F)throw Error("numRounds must a integer >= 1");if("SHA-1"!==r)throw Error("Chosen SHA variant is not supported");b=512,g=p,v=l,d=160,A=function(r){return r.slice()},E=i(t,s),c=h(r),this.setHMACKey=function(t,e,n){var o;if(!0===U)throw Error("HMAC key already set");if(!0===H)throw Error("Cannot set HMAC key after calling update");if(s=(n||{}).encoding||"UTF8",e=i(e,s)(t),t=e.binLen,e=e.value,o=b>>>3,n=o/4-1,o<t/8){for(e=v(e,t,0,h(r),d);e.length<=n;)e.push(0);e[n]&=4294967040}else if(o>t/8){for(;e.length<=n;)e.push(0);e[n]&=4294967040}for(t=0;t<=n;t+=1)y[t]=909522486^e[t],m[t]=1549556828^e[t];c=g(y,c),w=b,U=!0},this.update=function(r){var t,e,n,o=0,a=b>>>5;for(t=E(r,R,B),r=t.binLen,e=t.value,t=r>>>5,n=0;n<t;n+=a)o+b<=r&&(c=g(e.slice(n,n+a),c),o+=b);w+=o,R=e.slice(o>>>5),B=r%b,H=!0;var u=function(r){for(var t="",e=0;e<5;e++)for(var n=0;n<4;n++){var o=r[e]>>>8*n;o=255&o;var a=Number(o).toString(16);a=a.length<2?"0"+a:a,t+=a}return t};return u(c)},this.getHash=function(t,i){var f,s,p,l;if(!0===U)throw Error("Cannot call getHash after setting HMAC key");switch(p=u(i),t){case"HEX":f=function(r){return e(r,d,p)};break;case"B64":f=function(r){return n(r,d,p)};break;case"BYTES":f=function(r){return o(r,d)};break;case"ARRAYBUFFER":try{s=new ArrayBuffer(0)}catch(E){throw Error("ARRAYBUFFER not supported by this environment")}f=function(r){return a(r,d)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(l=v(R.slice(),B,w,A(c),d),s=1;s<F;s+=1)l=v(l,d,0,h(r),d);return f(l)},this.getHMAC=function(t,i){var f,s,p,l;if(!1===U)throw Error("Cannot call getHMAC without first setting HMAC key");switch(p=u(i),t){case"HEX":f=function(r){return e(r,d,p)};break;case"B64":f=function(r){return n(r,d,p)};break;case"BYTES":f=function(r){return o(r,d)};break;case"ARRAYBUFFER":try{f=new ArrayBuffer(0)}catch(E){throw Error("ARRAYBUFFER not supported by this environment")}f=function(r){return a(r,d)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return s=v(R.slice(),B,w,A(c),d),l=g(m,h(r)),l=v(s,d,b,l,d),f(l)}}function e(r,t,e){var n="";t/=8;var o,a;for(o=0;o<t;o+=1)a=r[o>>>2]>>>8*(3+o%4*-1),n+="0123456789abcdef".charAt(a>>>4&15)+"0123456789abcdef".charAt(15&a);return e.outputUpper?n.toUpperCase():n}function n(r,t,e){var n,o,a,u="",i=t/8;for(n=0;n<i;n+=3)for(o=n+1<i?r[n+1>>>2]:0,a=n+2<i?r[n+2>>>2]:0,a=(r[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(o>>>8*(3+(n+1)%4*-1)&255)<<8|a>>>8*(3+(n+2)%4*-1)&255,o=0;4>o;o+=1)u+=8*n+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-o)&63):e.b64Pad;return u}function o(r,t){var e,n,o="",a=t/8;for(e=0;e<a;e+=1)n=r[e>>>2]>>>8*(3+e%4*-1)&255,o+=String.fromCharCode(n);return o}function a(r,t){var e,n=t/8,o=new ArrayBuffer(n);for(e=0;e<n;e+=1)o[e]=r[e>>>2]>>>8*(3+e%4*-1)&255;return o}function u(r){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(r=r||{},t.outputUpper=r.outputUpper||!1,!0===r.hasOwnProperty("b64Pad")&&(t.b64Pad=r.b64Pad),"boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function i(r,t){var e;switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":e=function(r,t,e){var n,o,a,u,i,f=r.length;if(0!==f%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],e=e||0,i=e>>>3,n=0;n<f;n+=2){if(o=parseInt(r.substr(n,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(u=(n>>>1)+i,a=u>>>2;t.length<=a;)t.push(0);t[a]|=o<<8*(3+u%4*-1)}return{value:t,binLen:4*f+e}};break;case"TEXT":e=function(r,e,n){var o,a,u,i,f,s,c,h,p=0;if(e=e||[0],n=n||0,f=n>>>3,"UTF8"===t)for(h=3,u=0;u<r.length;u+=1)for(o=r.charCodeAt(u),a=[],128>o?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&r.charCodeAt(u)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),i=0;i<a.length;i+=1){for(c=p+f,s=c>>>2;e.length<=s;)e.push(0);e[s]|=a[i]<<8*(h+c%4*-1),p+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(h=2,u=0;u<r.length;u+=1){for(o=r.charCodeAt(u),"UTF16LE"===t&&(i=255&o,o=i<<8|o>>>8),c=p+f,s=c>>>2;e.length<=s;)e.push(0);e[s]|=o<<8*(h+c%4*-1),p+=2}return{value:e,binLen:8*p+n}};break;case"B64":e=function(r,t,e){var n,o,a,u,i,f,s,c=0;if(-1===r.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=r.indexOf("="),r=r.replace(/\=/g,""),-1!==o&&o<r.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],e=e||0,f=e>>>3,o=0;o<r.length;o+=4){for(i=r.substr(o,4),a=u=0;a<i.length;a+=1)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(i[a]),u|=n<<18-6*a;for(a=0;a<i.length-1;a+=1){for(s=c+f,n=s>>>2;t.length<=n;)t.push(0);t[n]|=(u>>>16-8*a&255)<<8*(3+s%4*-1),c+=1}}return{value:t,binLen:8*c+e}};break;case"BYTES":e=function(r,t,e){var n,o,a,u,i;for(t=t||[0],e=e||0,a=e>>>3,o=0;o<r.length;o+=1)n=r.charCodeAt(o),i=o+a,u=i>>>2,t.length<=u&&t.push(0),t[u]|=n<<8*(3+i%4*-1);return{value:t,binLen:8*r.length+e}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(n){throw Error("ARRAYBUFFER not supported by this environment")}e=function(r,t,e){var n,o,a,u;for(t=t||[0],e=e||0,o=e>>>3,n=0;n<r.byteLength;n+=1)u=n+o,a=u>>>2,t.length<=a&&t.push(0),t[a]|=r[n]<<8*(3+u%4*-1);return{value:t,binLen:8*r.byteLength+e}};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER")}return e}function f(r,t){return r<<t|r>>>32-t}function s(r,t){var e=(65535&r)+(65535&t);return((r>>>16)+(t>>>16)+(e>>>16)&65535)<<16|65535&e}function c(r,t,e,n,o){var a=(65535&r)+(65535&t)+(65535&e)+(65535&n)+(65535&o);return((r>>>16)+(t>>>16)+(e>>>16)+(n>>>16)+(o>>>16)+(a>>>16)&65535)<<16|65535&a}function h(r){var t=[];if("SHA-1"!==r)throw Error("No SHA variants supported");return t=[1732584193,4023233417,2562383102,271733878,3285377520]}function p(r,t){var e,n,o,a,u,i,h,p=[];for(e=t[0],n=t[1],o=t[2],a=t[3],u=t[4],h=0;80>h;h+=1)p[h]=16>h?r[h]:f(p[h-3]^p[h-8]^p[h-14]^p[h-16],1),i=20>h?c(f(e,5),n&o^~n&a,u,1518500249,p[h]):40>h?c(f(e,5),n^o^a,u,1859775393,p[h]):60>h?c(f(e,5),n&o^n&a^o&a,u,2400959708,p[h]):c(f(e,5),n^o^a,u,3395469782,p[h]),u=a,a=o,o=f(n,30),n=e,e=i;return t[0]=s(e,t[0]),t[1]=s(n,t[1]),t[2]=s(o,t[2]),t[3]=s(a,t[3]),t[4]=s(u,t[4]),t}function l(r,t,e,n){var o;for(o=(t+65>>>9<<4)+15;r.length<=o;)r.push(0);for(r[t>>>5]|=128<<24-t%32,t+=e,r[o]=4294967295&t,r[o-1]=t/4294967296|0,t=r.length,o=0;o<t;o+=16)n=p(r.slice(o,o+16),n);return n}"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(module.exports=t),exports=t):r.jsSHA=t}(this);
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&(define.amd||define.cmd)?define(t):e.CosCloud=t()}(this,function(){"use strict";function e(e){this.appid=e.appid,this.bucket=e.bucket,this.region=e.region,this.sha1CacheExpired=259200,this.uploadMaxThread=5,this.uploadMaxRetryTimes=3,this._uploadingThreadCount=0,this.tasks=[],e.getAppSign&&(this.getAppSign=t(e.getAppSign,this)),e.getAppSignOnce&&(this.getAppSignOnce=t(e.getAppSignOnce,this))}function t(e,t){return function(a){e.call(t,function(e){decodeURIComponent(e)===e&&(e=encodeURIComponent(e)),a(e)})}}function a(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function n(e,t){if(!e)return"";var a=this;return e=e.replace(/(^\/*)|(\/*$)/g,""),e="folder"==t?encodeURIComponent(e+"/").replace(/%2F/g,"/"):encodeURIComponent(e).replace(/%2F/g,"/"),a&&(a.path="/"+a.appid+"/"+a.bucket+"/"+e),e}function o(e){var t,a=$.Deferred(),n=new window.jsSHA("SHA-1","BYTES"),o=0,i=e.sliceSize,r=new FileReader,s=[],p=e.file,l=p.size;e.session&&(t=h(e.session));var u=function(e){s.push(e);var a=e.offset+"-"+e.datalen;return!t||!t[a]||e.datasha===t[a]};return r.onload=function(t){if("cancel"!==e.globalTask.state&&p&&!(p.length<1)){var d=n.update(this.content||this.result),f=o+i>l?l-o:i,g=o+f<l,h=g?d:n.getHash("HEX");if(!u({offset:o,datalen:f,datasha:h}))return void a.reject("sha1 not match");o+=f,e.onprogress(0,o/l),g?c.call(r,p.slice(o,Math.min(o+i,l))):a.resolve(s)}},c.call(r,p.slice(o,o+i)),r.onerror=function(){a.reject()},a.promise()}function i(e){var t=$.Deferred(),a=e.file,n=this,o=this.getCgiUrl(e.path,e.sign),i=new FormData,s=e.uploadparts;return i.append("uploadparts",JSON.stringify(s)),i.append("sha",e.sha),i.append("op","upload_slice_init"),i.append("filesize",a.size),i.append("slice_size",e.sliceSize),i.append("biz_attr",e.biz_attr),i.append("insertOnly",e.insertOnly),$.ajax({type:"POST",dataType:"JSON",url:o,data:i,success:function(a){if("cancel"!==e.globalTask.state)if(a=a||{},0==a.code){if(a.data.access_url)return void t.resolve(a);var o=a.data.session,i=parseInt(a.data.slice_size),s=a.data.offset||0;e.session=o,e.slice_size=i,e.offset=s,r.call(n,e).done(function(e){t.resolve(e)}).fail(function(e){t.reject(e)});for(var p,c={},l=1;l<e.uploadparts.length;l*=2)p=e.uploadparts[l-1],c[p.offset+"-"+p.datalen]=p.datasha;p=e.uploadparts[e.uploadparts.length-1],c[p.offset+"-"+p.datalen]=p.datasha,g(e.session,c,n.sha1CacheExpired)}else t.reject(a)},error:function(){t.reject()},processData:!1,contentType:!1}),t.promise()}function r(e){var t,a=this,n=e.file,o=$.Deferred(),i={opt:e,uploadingAjax:[],uploadingCount:0,currentIndex:0,chunkCount:Math.ceil(n.size/e.slice_size),chunks:[],loadedSize:0,uploadError:!1,onTaskProgress:function(a){var o=function(){t=0,e.onprogress&&e.onprogress(i.loadedSize/n.size,1)};if(a)clearTimeout(t),o();else{if(t)return;t=setTimeout(o,100)}}};!function(){var t,a={};if(e.listparts)for(t=0;t<e.listparts.length;t++)a[e.listparts[t].offset]=e.listparts[t];for(t=0;t<i.chunkCount;t++){var o=t*e.slice_size,r=Math.min(o+e.slice_size,n.size),s={start:o,end:r,size:r-o};a[o]?(i.loadedSize+=s.size,s.state="online"):s.state="waiting",i.chunks.push(s)}}();var r=function(){i.onTaskProgress(!0),o.resolve()},s=function(e,t){i.uploadError="error";for(var a=i.uploadingAjax.length-1;a>=0;a--){var n=i.uploadingAjax[a];n&&n.abort()}i.onTaskProgress(!0),o.reject(t)};e.globalTask.cancelRequests=function(){for(var e=i.uploadingAjax.length-1;e>=0;e--){var t=i.uploadingAjax[e];t&&t.abort()}};var p=function(){if("cancel"!==e.globalTask.state)for(;a._uploadingThreadCount<a.uploadMaxThread&&i.currentIndex<i.chunkCount;i.currentIndex++){var t=i.chunks[i.currentIndex];"waiting"===t.state&&!function(e){e.state="uploading",i.uploadingCount++,a._uploadingThreadCount++,v.call(a,i,e,function(t,n){i.uploadingCount--,a._uploadingThreadCount--,t?(e.state="error",s(t,n)):(e.state="success",i.uploadingCount<=0&&i.currentIndex>=i.chunkCount?r():p())})}(t)}};return p(),o.promise()}function s(e){var t=this,a=$.Deferred(),n=e.file;return t.getAppSign(function(o){e.sign=o;var i=t.getCgiUrl(e.path,e.sign),r=new FormData;r.append("op","upload_slice_list"),$.ajax({type:"POST",dataType:"JSON",url:i,data:r,success:function(t){if(t=t||{},0==t.code){e.session=t.data.session,e.slice_size=t.data.slice_size;var o=t.data.listparts||[];e.listparts=o;var i=o.length;if(i){var r=e.listparts[i-1],s=r.offset;if(s+e.slice_size>=n.size)return a.resolve(),a.promise();e.offset=s}a.resolve(t)}else a.reject(t)},error:function(){a.reject()},processData:!1,contentType:!1})}),a.promise()}function p(e){var t=this,a=$.Deferred(),n=e.file;return t.getAppSign(function(o){e.sign=o;var i=e.session,r=t.getCgiUrl(e.path,e.sign),s=new FormData;e.sha&&s.append("sha",e.sha),s.append("op","upload_slice_finish"),s.append("filesize",n.size),s.append("session",i),$.ajax({type:"POST",dataType:"JSON",url:r,data:s,success:function(e){e=e||{},0==e.code?a.resolve(e):a.reject(e)},error:function(){a.reject()},processData:!1,contentType:!1})}),a.promise()}function c(e){var t;FileReader.prototype.readAsBinaryString?t=FileReader.prototype.readAsBinaryString:FileReader.prototype.readAsArrayBuffer?t=function(e){var t="",a=this,n=new FileReader;n.onload=function(e){for(var o=new Uint8Array(n.result),i=o.byteLength,r=0;r<i;r++)t+=String.fromCharCode(o[r]);a.content=t,a.onload()},n.readAsArrayBuffer(e)}:console.error("FileReader not support readAsBinaryString"),t.call(this,e)}var l=524288,u=1048576,d=20971520;e.prototype.cosapi_cgi_url="//REGION.file.myqcloud.com/files/v2/",e.prototype.slice=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,e.prototype.sliceSize=3145728,e.prototype.getExpired=function(e){return(new Date).getTime()/1e3+(e||60)},e.prototype.getSliceSize=function(e){var t=u;return t=e<=l?l:e<=u?u:u},e.prototype.set=function(e){e&&(this.appid=e.appid,this.bucket=e.bucket,this.region=e.region,e.getAppSign&&(this.getAppSign=e.getAppSign),e.getAppSignOnce&&(this.getAppSignOnce=e.getAppSignOnce))},e.prototype.getCgiUrl=function(e,t){var a=this.region,n=this.bucket,o=this.cosapi_cgi_url;return o=o.replace("REGION",a),o+this.appid+"/"+n+"/"+e+"?sign="+t},e.prototype.getAppSign=function(e,t,a){var n=this.getExpired(),o=this.sign_url+"?sign_type=appSign&expired="+n+"&bucketName="+a;$.ajax({url:o,type:"GET",success:e,error:t})},e.prototype.getAppSignOnce=function(e,t,a,n){var o=this.sign_url+"?sign_type=appSign_once&path="+encodeURIComponent(a)+"&bucketName="+n;$.ajax({url:o,type:"GET",success:e,error:t})},e.prototype.updateFolder=function(e,t,a,o,i){o=n.call(this,o,"folder"),this.updateBase(e,t,a,o,i)},e.prototype.updateFile=function(e,t,a,o,i){o=n.call(this,o),this.updateBase(e,t,a,o,i)},e.prototype.updateBase=function(e,t,a,n,o,i,r){var s=this;s.getAppSignOnce(function(a){var p=s.getCgiUrl(n,a),c=new FormData;c.append("op","update"),o&&c.append("biz_attr",o),i&&c.append("authority",i),r&&(r=JSON.stringify(r),c.append("customHeaders",r)),$.ajax({type:"POST",url:p,processData:!1,contentType:!1,data:c,success:e,error:t})})},e.prototype.deleteFolder=function(e,t,a,o){o=n.call(this,o,"folder"),this.deleteBase(e,t,a,o)},e.prototype.deleteFile=function(e,t,a,o){o=n.call(this,o),this.deleteBase(e,t,a,o)},e.prototype.deleteBase=function(e,t,a,n){if("/"==n)return void t({code:10003,message:"不能删除Bucket"});var o=this;this.getAppSignOnce(function(a){var i=o.getCgiUrl(n,a),r=new FormData;r.append("op","delete"),$.ajax({type:"POST",url:i,data:r,processData:!1,contentType:!1,success:e,error:t})})},e.prototype.getFolderStat=function(e,t,a,o){o=n(o,"folder"),this.statBase(e,t,a,o)},e.prototype.getFileStat=function(e,t,a,o){o=n(o),this.statBase(e,t,a,o)},e.prototype.statBase=function(e,t,a,n){var o=this;this.getAppSign.call(o,function(a){var i=o.getCgiUrl(n,a),r={op:"stat"};$.ajax({url:i,type:"GET",data:r,success:e,error:t})})},e.prototype.createFolder=function(e,t,a,o,i){var r=this;this.getAppSign(function(a){o=n(o,"folder");var s=r.getCgiUrl(o,a),p=new FormData;p.append("op","create"),p.append("biz_attr",i||""),$.ajax({type:"POST",url:s,data:p,processData:!1,contentType:!1,success:e,error:t})})},e.prototype.copyFile=function(e,t,a,o,i,r){var s=this;this.getAppSign(function(a){o=n(o);var p=s.getCgiUrl(o,a),c=new FormData;c.append("op","copy"),c.append("dest_fileid",i),c.append("to_over_write",r),$.ajax({type:"POST",url:p,data:c,processData:!1,contentType:!1,success:e,error:t})})},e.prototype.moveFile=function(e,t,a,o,i,r){var s=this;this.getAppSign(function(a){o=n(o);var p=s.getCgiUrl(o,a),c=new FormData;c.append("op","move"),c.append("dest_fileid",i),c.append("to_over_write",r),$.ajax({type:"POST",url:p,data:c,processData:!1,contentType:!1,success:e,error:t})})},e.prototype.getFolderList=function(e,t,a,o,i,r,s,p,c){var l=this;o=n(o,"folder"),l.listBase(e,t,a,o,i,r,s,p)},e.prototype.listBase=function(e,t,a,n,o,i,r,s,p){var c=this;c.getAppSign(function(a){var p=c.getCgiUrl(n,a);o=o||20,r=r||0,s=s||"eListBoth";var l={op:"list",num:o,context:i,order:r,pattern:s};$.ajax({url:p,type:"GET",data:l,success:e,error:t})})},e.prototype.uploadFile=function(e,t,o,i,r,s,p,c){var l=this;if(s.size>d)return void l.sliceUploadFile(e,t,o,i,r,s,p,void 0,void 0,c);r=n(r);var u,f=a(),g={id:f,cancel:function(){u&&u.abort()}};this.tasks[f]=g,c&&"function"==typeof c&&c(f),l.getAppSign(function(a){var n=l.getCgiUrl(r,a),i=new FormData;i.append("op","upload"),i.append("fileContent",s),p>=0&&i.append("insertOnly",p),u=$.ajax({type:"POST",url:n,data:i,processData:!1,contentType:!1,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload.onprogress=function(e){var t=e.loaded/e.total;"function"==typeof o&&o(t,0)},e},success:e,error:t})})},e.prototype.sliceUploadFile=function(e,t,c,l,u,d,f,g,h,v){var y=a(),S={id:y,cancelRequests:null,cancel:function(){S.cancelRequests&&S.cancelRequests()}};this.tasks[y]=S,v&&"function"==typeof v&&v(y);var m=this;u=n(u),m.getAppSign(function(a){var n={};n.globalTask=S,"cancel"!==n.globalTask.state&&(g=m.getSliceSize(g),n.bucket=l,n.path=u,n.file=d,n.insertOnly=f,n.sliceSize=g||1048576,n.appid=m.appid,n.sign=a,n.biz_attr=h||"",n.onprogress=function(e,t){void 0===t&&(t=1),c(e,t)},s.call(m,n).always(function(a){if("cancel"!==n.globalTask.state){a=a||{};var s=a.data;if(s&&s.session){if(s.filesize!==n.file.size)return t({code:-1,message:"filesize not match"});var c=n.listparts||[];if(n.session=s.session,n.listparts=c,c&&c.length){var l=c.length;n.offset=c[l-1].offset}s.sha&&(n.onlineSha=s.sha.split("_")[0]),o.call(m,n).done(function(a){if("cancel"!==n.globalTask.state){n.uploadparts=a;var o=a.length;n.sha=a[o-1].datasha,r.call(m,n).done(function(){p.call(m,n).done(function(t){e(t)}).fail(function(e){t({code:-1,message:e&&e.message||"slice finish error"})})}).fail(function(e){t({code:-1,message:e&&e.message||"slice upload file error"})})}}).fail(function(e){t({code:-1,message:e||"get slice sha1 error"})})}else s&&s.access_url?("function"==typeof n.onprogress&&n.onprogress(1,0),e(a)):o.call(m,n).done(function(a){if("cancel"!==n.globalTask.state){n.uploadparts=a;var o=a.length;n.sha=a[o-1].datasha,i.call(m,n).done(function(a){if("cancel"!==n.globalTask.state){a=a||{};var o=a.data||{};o&&o.access_url?("function"==typeof n.onprogress&&n.onprogress(1,0),e(a)):p.call(m,n).done(function(t){e(t)}).fail(function(e){t({code:-1,message:e.message||"slice finish error"})})}}).fail(function(e){e=e||{},t({code:e.code||-1,message:e.message||"upload slice file error"})})}}).fail(function(){t({code:-1,message:"get slice sha1 error"})})}}))})},e.prototype.cancelTask=function(e){var t=this.tasks[e];t&&(t.state="cancel",t.cancel())};var f="_cos_sdk_sha1_",g=function(e,t,a){try{var n=JSON.parse(localStorage.getItem(f))||{}}catch(o){}var i=Date.now();t.update_time=i,n[e]=t;for(var r=localStorage.length-1;r>=0;r--){var s=localStorage.key(r),p=localStorage.getItem(s);i-p.update_time>a&&localStorage.removeItem(s)}localStorage.setItem(f,JSON.stringify(n))},h=function(e){try{var t=JSON.parse(localStorage.getItem(f))||{}}catch(a){}return t[e]},v=function(e,t,a){var n=this,o=new FormData,i=e.opt,r=i.file,s=i.slice_size,p=i.session,c=r.size,l=t.start,u=Math.min(l+s,c),d=n.slice.call(r,l,u),f=d.size,g=function(t){for(var a=e.uploadingAjax.length-1;a>=0;a--)t===e.uploadingAjax[a]&&e.uploadingAjax.splice(a,1)},h=0,v=function(t,a){e.loadedSize+=t-h,h=t,e.onTaskProgress&&e.onTaskProgress(a)},y=function(t){o.append("sliceSize",s),o.append("op","upload_slice_data"),o.append("session",p),o.append("offset",l),i.sha&&o.append("sha",i.sha),o.append("fileContent",d),n.getAppSign(function(a){i.sign=a;var r=n.getCgiUrl(i.path,i.sign),s=$.ajax({type:"POST",dataType:"JSON",url:r,data:o,xhr:function(){var t=$.ajaxSettings.xhr();return t.upload.onprogress=function(t){v(t.loaded),e.onTaskProgress&&e.onTaskProgress()},t},success:function(e){v(f,!0),e=e||{},0===e.code?t(null,e):t("error",e)},error:function(){v(0,!0),t("error")},complete:function(){g(s)},processData:!1,contentType:!1});e.uploadingAjax.push(s)})},S=function(t){"cancel"!==i.globalTask.state&&y(function(o,i){o?t>=n.uploadMaxRetryTimes||e.uploadError?a(o,i):S(t+1):a(o,i)})};S(1)};return e});})();