var Webmo=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports={http:n(1),ws:n(8)}},function(t,e,n){var r=n(2),o=function(t){this.base="//"+(t||"webmo.local"),this.base+="/api",r.base=this.base,this._stepAngle=1.8};o.prototype.getStatus=function(){return r.get("/status")},o.prototype.rotate=function(t){return r.post("/rotate/forever",{speed:t})},o.prototype.rotateTo=function(t,e,n){var o={degree:t,absRange:e,speed:n,absolute:!0};return r.post("/rotate",o)},o.prototype.rotateBy=function(t,e){var n={degree:t,speed:e};return r.post("/rotate",n)},o.prototype.rotateToHome=function(){return r.post("/rotate/home",{})},o.prototype.stop=function(t,e){return t=t||!1,e=e||!1,r.post("/stop",{smooth:t,lock:e})},o.prototype.stopHard=function(){return r.post("/stop",{smooth:!1})},o.prototype.stopSoft=function(){return r.post("/stop",{smooth:!0})},o.prototype.lockHard=function(){return r.post("/stop",{smooth:!1})},o.prototype.lockSoft=function(){return r.post("/stop",{smooth:!0})},o.prototype.resetHome=function(){return r.post("/home/reset",{})},o.prototype.angleToStep=function(t){return t/this._stepAngle},o.prototype.stepToAngle=function(t){return t*this._stepAngle/128},o.prototype.getSpeedPerSecondByStep=function(t){return Math.pow(2,28)*t/Math.pow(10,9)*250},o.prototype.getSpeedPerSecondByAngle=function(t){return this.getSpeedPerSecondByStep(this.angleToStep(t))},t.exports=o},function(module,exports,__webpack_require__){/*! qwest 4.1.1 (https://github.com/pyrsmk/qwest) */ module.exports=function(){var global=window||this,pinkyswear=__webpack_require__(3),jparam=__webpack_require__(7),defaultXdrResponseType="json",defaultDataType="post",limit=null,requests=0,request_stack=[],getXHR=global.XMLHttpRequest?function(){return new global.XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},xhr2=""===getXHR().responseType,qwest=function(method,url,data,options,before){method=method.toUpperCase(),data=data||null,options=options||{};var nativeResponseParsing=!1,crossOrigin,xhr,xdr=!1,timeoutInterval,aborted=!1,attempts=0,headers={},mimeTypes={text:"*/*",xml:"text/xml",json:"application/json",post:"application/x-www-form-urlencoded"},accept={text:"*/*",xml:"application/xml; q=1.0, text/xml; q=0.8, */*; q=0.1",json:"application/json; q=1.0, text/*; q=0.8, */*; q=0.1"},i,j,serialized,response,sending=!1,delayed=!1,timeout_start,promise=pinkyswear(function(t){return t.abort=function(){xhr&&(xhr.abort(),--requests,aborted=!0)},t.send=function(){if(!sending){if(requests==limit)return void request_stack.push(t);if(++requests,sending=!0,timeout_start=(new Date).getTime(),xhr=getXHR(),crossOrigin&&("withCredentials"in xhr||!global.XDomainRequest||(xhr=new XDomainRequest,xdr=!0,"GET"!=method&&"POST"!=method&&(method="POST"))),xdr?xhr.open(method,url):(xhr.open(method,url,options.async,options.user,options.password),xhr2&&options.async&&(xhr.withCredentials=options.withCredentials)),!xdr)for(var e in headers)headers[e]&&xhr.setRequestHeader(e,headers[e]);if(xhr2&&"document"!=options.responseType&&"auto"!=options.responseType)try{xhr.responseType=options.responseType,nativeResponseParsing=xhr.responseType==options.responseType}catch(n){}xhr2||xdr?(xhr.onload=handleResponse,xhr.onerror=handleError):xhr.onreadystatechange=function(){4==xhr.readyState&&handleResponse()},"auto"!=options.responseType&&"overrideMimeType"in xhr&&xhr.overrideMimeType(mimeTypes[options.responseType]),before&&before(xhr),xdr?(xhr.onprogress=function(){},xhr.ontimeout=function(){},xhr.onerror=function(){},setTimeout(function(){xhr.send("GET"!=method?data:null)},0)):xhr.send("GET"!=method?data:null)}},t}),handleResponse=function(){var i,responseType;if(--requests,sending=!1,(new Date).getTime()-timeout_start>=options.timeout)return void(options.attempts&&++attempts==options.attempts?promise(!1,[new Error("Timeout ("+url+")"),xhr,response]):promise.send());request_stack.length&&request_stack.shift().send();try{if(nativeResponseParsing&&"response"in xhr&&null!==xhr.response)response=xhr.response;else if("document"==options.responseType){var frame=document.createElement("iframe");frame.style.display="none",document.body.appendChild(frame),frame.contentDocument.open(),frame.contentDocument.write(xhr.response),frame.contentDocument.close(),response=frame.contentDocument,document.body.removeChild(frame)}else{if(responseType=options.responseType,"auto"==responseType)if(xdr)responseType=defaultXdrResponseType;else{var ct=xhr.getResponseHeader("Content-Type")||"";responseType=ct.indexOf(mimeTypes.json)>-1?"json":ct.indexOf(mimeTypes.xml)>-1?"xml":"text"}switch(responseType){case"json":if(xhr.responseText.length)try{response="JSON"in global?JSON.parse(xhr.responseText):eval("("+xhr.responseText+")")}catch(e){throw"Error while parsing JSON body : "+e}break;case"xml":try{global.DOMParser?response=(new DOMParser).parseFromString(xhr.responseText,"text/xml"):(response=new ActiveXObject("Microsoft.XMLDOM"),response.async="false",response.loadXML(xhr.responseText))}catch(e){response=void 0}if(!response||!response.documentElement||response.getElementsByTagName("parsererror").length)throw"Invalid XML";break;default:response=xhr.responseText}}if("status"in xhr&&!/^2|1223/.test(xhr.status))throw xhr.status+" ("+xhr.statusText+")";promise(!0,[xhr,response])}catch(e){promise(!1,[e,xhr,response])}},handleError=function(t){--requests,promise(!1,[new Error("Connection aborted"),xhr,null])};switch(options.async="async"in options?!!options.async:!0,options.cache="cache"in options?!!options.cache:!1,options.dataType="dataType"in options?options.dataType.toLowerCase():defaultDataType,options.responseType="responseType"in options?options.responseType.toLowerCase():"auto",options.user=options.user||"",options.password=options.password||"",options.withCredentials=!!options.withCredentials,options.timeout="timeout"in options?parseInt(options.timeout,10):3e4,options.attempts="attempts"in options?parseInt(options.attempts,10):1,i=url.match(/\/\/(.+?)\//),crossOrigin=i&&(i[1]?i[1]!=location.host:!1),"ArrayBuffer"in global&&data instanceof ArrayBuffer?options.dataType="arraybuffer":"Blob"in global&&data instanceof Blob?options.dataType="blob":"Document"in global&&data instanceof Document?options.dataType="document":"FormData"in global&&data instanceof FormData&&(options.dataType="formdata"),options.dataType){case"json":data=null!==data?JSON.stringify(data):data;break;case"post":data=jparam(data)}if(options.headers){var format=function(t,e,n){return e+n.toUpperCase()};for(i in options.headers)headers[i.replace(/(^|-)([^-])/g,format)]=options.headers[i]}return"Content-Type"in headers||"GET"==method||options.dataType in mimeTypes&&mimeTypes[options.dataType]&&(headers["Content-Type"]=mimeTypes[options.dataType]),headers.Accept||(headers.Accept=options.responseType in accept?accept[options.responseType]:"*/*"),crossOrigin||"X-Requested-With"in headers||(headers["X-Requested-With"]="XMLHttpRequest"),options.cache||"Cache-Control"in headers||(headers["Cache-Control"]="no-cache"),"GET"==method&&data&&"string"==typeof data&&(url+=(/\?/.test(url)?"&":"?")+data),options.async&&promise.send(),promise},getNewPromise=function(t){var e=[],n=0,r=[];return pinkyswear(function(o){var i=function(t){return function(i,s,u,a){return++n,e.push(qwest(t,o.base+i,s,u,a).then(function(t,e){r.push(arguments),--n||o(!0,1==r.length?r[0]:[r])},function(){o(!1,arguments)})),o}};o.get=i("GET"),o.post=i("POST"),o.put=i("PUT"),o["delete"]=i("DELETE"),o["catch"]=function(t){return o.then(null,t)},o.map=function(t,e,n,r,o){return i(t.toUpperCase()).call(this,e,n,r,o)};for(var s in t)s in o||(o[s]=t[s]);return o.send=function(){for(var t=0,n=e.length;n>t;++t)e[t].send();return o},o.abort=function(){for(var t=0,n=e.length;n>t;++t)e[t].abort();return o},o})},q={base:"",get:function(){return getNewPromise(q).get.apply(this,arguments)},post:function(){return getNewPromise(q).post.apply(this,arguments)},put:function(){return getNewPromise(q).put.apply(this,arguments)},"delete":function(){return getNewPromise(q)["delete"].apply(this,arguments)},map:function(){return getNewPromise(q).map.apply(this,arguments)},xhr2:xhr2,limit:function(t){return limit=t,q},setDefaultXdrResponseType:function(t){return defaultXdrResponseType=t.toLowerCase(),q},setDefaultDataType:function(t){return defaultDataType=t.toLowerCase(),q},getOpenRequests:function(){return requests}};return q}()},function(t,e,n){(function(t,e,n){!function(t){function r(t){return"function"==typeof t}function o(t){return"object"==typeof t}function i(t){"undefined"!=typeof e?e(t):"undefined"!=typeof n&&n.nextTick?n.nextTick(t):setTimeout(t,0)}var s;t[0][t[1]]=function u(t){var e,n=[],a=[],p=function(t,r){return null==e&&null!=t&&(e=t,n=r,a.length&&i(function(){for(var t=0;t=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var n=p++,r=arguments.length<2?!1:u.call(arguments,1);return a[n]=!0,i(function(){a[n]&&(r?t.apply(null,r):t.call(null),e.clearImmediate(n))}),n},e.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(e,n(5).setImmediate,n(5).clearImmediate)},function(t,e){function n(){p=!1,s.length?a=s.concat(a):c=-1,a.length&&r()}function r(){if(!p){var t=setTimeout(n);p=!0;for(var e=a.length;e;){for(s=a,a=[];++c1)for(var n=1;ni;i++)n(t+"["+("object"==typeof r[i]?i:"")+"]",r[i],o);else if(r&&"[object Object]"===r.toString())for(u in r)r.hasOwnProperty(u)&&(t?n(t+"["+u+"]",r[u],o,e):n(u,r[u],o,e));else if(t)e(o,t,r);else for(u in r)e(o,u,r[u]);return o};return n("",t,[]).join("&").replace(/%20/g,"+")};"object"==typeof t&&"object"==typeof t.exports?t.exports=i:(r=[],o=function(){return i}.apply(e,r),!(void 0!==o&&(t.exports=o)))}(this)},function(t,e,n){var r=n(9).EventEmitter2,o=n(10),i=function(t){t=t||"webmo.local",this.host=t,this.stepDegree=1.8,this.onmessage=null,this._ws=new WebSocket("ws://"+t+":8080/"),this._ev=new r,this._ws.onopen=function(t){"function"==typeof this.onopen&&this.onopen(t),this._ev.emit("open")}.bind(this),this._ws.onmessage=function(t){var e=JSON.parse(t.data);"function"==typeof this.onmessage&&this.onmessage(e),this._ev.emit(e.type,e)}.bind(this),this._ws.onclose=function(t){"function"==typeof this.onclose&&this.onclose(),console.log("closed",t)}.bind(this),this._ws.onerror=function(t){"function"==typeof this.onerror&&this.onerror(),console.log("error!",t)}.bind(this)};i.prototype.getStatus=function(){var t=JSON.stringify({type:"status"});this._ws.send(t)},i.prototype.rotate=function(t,e){"object"==typeof t&&(e=t,t=void 0);var n=JSON.stringify({type:"rotate",speed:t});this._ws.send(n)},i.prototype.rotateTo=function(t,e,n){var r=JSON.stringify({type:"rotateTo",target:t,absRange:e,speed:n});return this._ws.send(r),o.Promise(function(t,e){this._ev.on("notice",function(e){"done"===e.msg&&"rotateTo"===e.func&&t(e)})}.bind(this))},i.prototype.rotateBy=function(t,e){var n=JSON.stringify({type:"rotateBy",diff:t,speed:e});return this._ws.send(n),o.Promise(function(t,e){this._ev.on("notice",function(e){"done"===e.msg&&"rotateBy"===e.func&&t(e)})}.bind(this))},i.prototype.rotateToHome=function(){console.log("not impl")},i.prototype.stopHard=function(){return this.stop(!0,!1)},i.prototype.stopSoft=function(){return this.stop(!1,!1)},i.prototype.stop=function(t,e){var n=JSON.stringify({type:"stop",smooth:t,lock:e});return this._ws.send(n),o.Promise(function(t,e){this._ev.on("notice",function(e){"done"===e.msg&&"stop"===e.func&&t(e)})}.bind(this))},i.prototype.lock=function(t){var e=JSON.stringify({type:"lock",smooth:t});this._ws.send(e)},i.prototype.unlock=function(){var t=JSON.stringify({type:"unlock"});this._ws.send(t)},i.prototype.tick=function(t){var e=JSON.stringify({type:"tick",timeMs:t});this._ws.send(e)},i.prototype.resetHome=function(){console.log("not impl")},i.prototype.degreeToStep=function(t){return t/this.stepDegree},i.prototype.stepToDegree=function(t){return t*this.stepDegree/128},i.prototype.getSpeedPerSecondByStep=function(t){return Math.pow(2,28)*t/Math.pow(10,9)*250},i.prototype.getSpeedPerSecondByDegree=function(t){return this.getSpeedPerSecondByStep(this.degreeToStep(t))},t.exports=i},function(t,e,n){var r;!function(o){function i(){this._events={},this._conf&&s.call(this,this._conf)}function s(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),t.maxListeners&&(this._events.maxListeners=t.maxListeners),t.wildcard&&(this.wildcard=t.wildcard),t.newListener&&(this.newListener=t.newListener),this.wildcard&&(this.listenerTree={}))}function u(t){this._events={},this.newListener=!1,s.call(this,t)}function a(t,e,n,r){if(!n)return[];var o,i,s,u,p,c,f,l=[],h=e.length,d=e[r],y=e[r+1];if(r===h&&n._listeners){if("function"==typeof n._listeners)return t&&t.push(n._listeners),[n];for(o=0,i=n._listeners.length;i>o;o++)t&&t.push(n._listeners[o]);return[n]}if("*"===d||"**"===d||n[d]){if("*"===d){for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&(l=l.concat(a(t,e,n[s],r+1)));return l}if("**"===d){f=r+1===h||r+2===h&&"*"===y,f&&n._listeners&&(l=l.concat(a(t,e,n,h)));for(s in n)"_listeners"!==s&&n.hasOwnProperty(s)&&("*"===s||"**"===s?(n[s]._listeners&&!f&&(l=l.concat(a(t,e,n[s],h))),l=l.concat(a(t,e,n[s],r))):l=s===y?l.concat(a(t,e,n[s],r+2)):l.concat(a(t,e,n[s],r)));return l}l=l.concat(a(t,e,n[d],r+1))}if(u=n["*"],u&&a(t,e,u,r+1),p=n["**"])if(h>r){p._listeners&&a(t,e,p,h);for(s in p)"_listeners"!==s&&p.hasOwnProperty(s)&&(s===y?a(t,e,p[s],r+2):s===d?a(t,e,p[s],r+1):(c={},c[s]=p[s],a(t,e,{"**":c},r+1)))}else p._listeners?a(t,e,p,h):p["*"]&&p["*"]._listeners&&a(t,e,p["*"],h);return l}function p(t,e){t="string"==typeof t?t.split(this.delimiter):t.slice();for(var n=0,r=t.length;r>n+1;n++)if("**"===t[n]&&"**"===t[n+1])return;for(var o=this.listenerTree,i=t.shift();i;){if(o[i]||(o[i]={}),o=o[i],0===t.length){if(o._listeners){if("function"==typeof o._listeners)o._listeners=[o._listeners,e];else if(c(o._listeners)&&(o._listeners.push(e),!o._listeners.warned)){var s=f;"undefined"!=typeof this._events.maxListeners&&(s=this._events.maxListeners),s>0&&o._listeners.length>s&&(o._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",o._listeners.length),console.trace&&console.trace())}}else o._listeners=e;return!0}i=t.shift()}return!0}var c=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},f=10;u.EventEmitter2=u,u.prototype.delimiter=".",u.prototype.setMaxListeners=function(t){this._events||i.call(this),this._events.maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t},u.prototype.event="",u.prototype.once=function(t,e){return this.many(t,1,e),this},u.prototype.many=function(t,e,n){function r(){0===--e&&o.off(t,r),n.apply(this,arguments)}var o=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");return r._origin=n,this.on(t,r),o},u.prototype.emit=function(){this._events||i.call(this);var t=arguments[0];if("newListener"===t&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var e=arguments.length,n=new Array(e-1),r=1;e>r;r++)n[r-1]=arguments[r];for(r=0,e=this._all.length;e>r;r++)this.event=t,this._all[r].apply(this,[t].concat(n))}if("error"===t&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var o;if(this.wildcard){o=[];var s="string"==typeof t?t.split(this.delimiter):t.slice();a.call(this,o,s,this.listenerTree,0)}else o=this._events[t];if("function"==typeof o){if(this.event=t,1===arguments.length)o.call(this);else if(arguments.length>1)switch(arguments.length){case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:for(var e=arguments.length,n=new Array(e-1),r=1;e>r;r++)n[r-1]=arguments[r];o.apply(this,n)}return!0}if(o){for(var e=arguments.length,n=new Array(e-1),r=1;e>r;r++)n[r-1]=arguments[r];for(var u=o.slice(),r=0,e=u.length;e>r;r++)this.event=t,u[r].apply(this,n);return u.length>0||!!this._all}return!!this._all},u.prototype.emitAsync=function(){this._events||i.call(this);var t=arguments[0];if("newListener"===t&&!this.newListener&&!this._events.newListener)return Promise.resolve([!1]);var e=[];if(this._all){for(var n=arguments.length,r=new Array(n-1),o=1;n>o;o++)r[o-1]=arguments[o];for(o=0,n=this._all.length;n>o;o++)this.event=t,e.push(this._all[o].apply(this,r))}if("error"===t&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");var s;if(this.wildcard){s=[];var u="string"==typeof t?t.split(this.delimiter):t.slice();a.call(this,s,u,this.listenerTree,0)}else s=this._events[t];if("function"==typeof s){if(this.event=t,1===arguments.length)e.push(s.call(this));else if(arguments.length>1)switch(arguments.length){case 2:e.push(s.call(this,arguments[1]));break;case 3:e.push(s.call(this,arguments[1],arguments[2]));break;default:for(var n=arguments.length,r=new Array(n-1),o=1;n>o;o++)r[o-1]=arguments[o];e.push(s.apply(this,r))}}else if(s){for(var n=arguments.length,r=new Array(n-1),o=1;n>o;o++)r[o-1]=arguments[o];for(var p=s.slice(),o=0,n=p.length;n>o;o++)this.event=t,e.push(p[o].apply(this,r))}return Promise.all(e)},u.prototype.on=function(t,e){if("function"==typeof t)return this.onAny(t),this;if("function"!=typeof e)throw new Error("on only accepts instances of Function");if(this._events||i.call(this),this.emit("newListener",t,e),this.wildcard)return p.call(this,t,e),this;if(this._events[t]){if("function"==typeof this._events[t])this._events[t]=[this._events[t],e];else if(c(this._events[t])&&(this._events[t].push(e),!this._events[t].warned)){var n=f;"undefined"!=typeof this._events.maxListeners&&(n=this._events.maxListeners),n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace&&console.trace())}}else this._events[t]=e;return this},u.prototype.onAny=function(t){if("function"!=typeof t)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(t),this},u.prototype.addListener=u.prototype.on,u.prototype.off=function(t,e){function n(t){if(t!==o){var e=Object.keys(t);for(var r in e){var i=e[r],s=t[i];s instanceof Function||"object"!=typeof s||(Object.keys(s).length>0&&n(t[i]),0===Object.keys(s).length&&delete t[i])}}}if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");var r,i=[];if(this.wildcard){var s="string"==typeof t?t.split(this.delimiter):t.slice();i=a.call(this,null,s,this.listenerTree,0)}else{if(!this._events[t])return this;r=this._events[t],i.push({_listeners:r})}for(var u=0;ul;l++)if(r[l]===e||r[l].listener&&r[l].listener===e||r[l]._origin&&r[l]._origin===e){f=l;break}if(0>f)continue;return this.wildcard?p._listeners.splice(f,1):this._events[t].splice(f,1),0===r.length&&(this.wildcard?delete p._listeners:delete this._events[t]),this.emit("removeListener",t,e),this}(r===e||r.listener&&r.listener===e||r._origin&&r._origin===e)&&(this.wildcard?delete p._listeners:delete this._events[t],this.emit("removeListener",t,e))}return n(this.listenerTree),this},u.prototype.offAny=function(t){var e,n=0,r=0;if(t&&this._all&&this._all.length>0){for(e=this._all,n=0,r=e.length;r>n;n++)if(t===e[n])return e.splice(n,1),this.emit("removeListenerAny",t),this}else{for(e=this._all,n=0,r=e.length;r>n;n++)this.emit("removeListenerAny",e[n]);this._all=[]}return this},u.prototype.removeListener=u.prototype.off,u.prototype.removeAllListeners=function(t){if(0===arguments.length)return!this._events||i.call(this),this;if(this.wildcard)for(var e="string"==typeof t?t.split(this.delimiter):t.slice(),n=a.call(this,null,e,this.listenerTree,0),r=0;r=Q&&ct>=r}function c(){if(U)try{throw new Error}catch(t){var e=t.stack.split("\n"),n=e[0].indexOf("@")>0?e[1]:e[2],r=a(n);if(!r)return;return G=r[0],r[1]}}function f(t,e,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e+" is deprecated, use "+n+" instead.",new Error("").stack),t.apply(t,arguments)}}function l(t){return t instanceof m?t:_(t)?E(t):R(t)}function h(){function t(t){e=t,i.source=t,Y(n,function(e,n){l.nextTick(function(){t.promiseDispatch.apply(t,n)})},void 0),n=void 0,r=void 0}var e,n=[],r=[],o=et(h.prototype),i=et(m.prototype);if(i.promiseDispatch=function(t,o,i){var s=K(arguments);n?(n.push(s),"when"===o&&i[1]&&r.push(i[1])):l.nextTick(function(){e.promiseDispatch.apply(e,s)})},i.valueOf=function(){if(n)return i;var t=g(e);return w(t)&&(e=t),t},i.inspect=function(){return e?e.inspect():{state:"pending"}},l.longStackSupport&&U)try{throw new Error}catch(s){i.stack=s.stack.substring(s.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(n){e||t(l(n))},o.fulfill=function(n){e||t(R(n))},o.reject=function(n){e||t(O(n))},o.notify=function(t){e||Y(r,function(e,n){l.nextTick(function(){n(t)})},void 0)},o}function d(t){if("function"!=typeof t)throw new TypeError("resolver must be a function.");var e=h();try{t(e.resolve,e.reject,e.notify)}catch(n){e.reject(n)}return e.promise}function y(t){return d(function(e,n){for(var r=0,o=t.length;o>r;r++)l(t[r]).then(e,n)})}function m(t,e,n){void 0===e&&(e=function(t){return O(new Error("Promise does not support operation: "+t))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=et(m.prototype);if(r.promiseDispatch=function(n,o,i){var s;try{s=t[o]?t[o].apply(r,i):e.call(r,o,i)}catch(u){s=O(u)}n&&n(s)},r.inspect=n,n){var o=n();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var t=n();return"pending"===t.state||"rejected"===t.state?r:t.value}}return r}function v(t,e,n,r){return l(t).then(e,n,r)}function g(t){if(w(t)){var e=t.inspect();if("fulfilled"===e.state)return e.value}return t}function w(t){return t instanceof m}function _(t){return r(t)&&"function"==typeof t.then}function T(t){return w(t)&&"pending"===t.inspect().state}function x(t){return!w(t)||"fulfilled"===t.inspect().state}function b(t){return w(t)&&"rejected"===t.inspect().state}function k(){st.length=0,ut.length=0,pt||(pt=!0)}function j(t,n){pt&&("object"==typeof e&&"function"==typeof e.emit&&l.nextTick.runAfter(function(){-1!==Z(ut,t)&&(e.emit("unhandledRejection",n,t),at.push(t))}),ut.push(t),n&&"undefined"!=typeof n.stack?st.push(n.stack):st.push("(no stack) "+n))}function S(t){if(pt){var n=Z(ut,t);-1!==n&&("object"==typeof e&&"function"==typeof e.emit&&l.nextTick.runAfter(function(){var r=Z(at,t);-1!==r&&(e.emit("rejectionHandled",st[n],t),at.splice(r,1))}),ut.splice(n,1),st.splice(n,1))}}function O(t){var e=m({when:function(e){return e&&S(this),e?e(t):this}},function(){return this},function(){return{state:"rejected",reason:t}});return j(e,t),e}function R(t){return m({when:function(){return t},get:function(e){return t[e]},set:function(e,n){t[e]=n},"delete":function(e){delete t[e]},post:function(e,n){return null===e||void 0===e?t.apply(void 0,n):t[e].apply(t,n)},apply:function(e,n){return t.apply(e,n)},keys:function(){return rt(t)}},void 0,function(){return{state:"fulfilled",value:t}})}function E(t){var e=h();return l.nextTick(function(){try{t.then(e.resolve,e.reject,e.notify)}catch(n){e.reject(n)}}),e.promise}function L(t){return m({isDef:function(){}},function(e,n){return N(t,e,n)},function(){return l(t).inspect()})}function A(t,e,n){return l(t).spread(e,n)}function P(t){return function(){function e(t,e){var s;if("undefined"==typeof StopIteration){try{s=n[t](e)}catch(u){return O(u)}return s.done?l(s.value):v(s.value,r,i)}try{s=n[t](e)}catch(u){return o(u)?l(u.value):O(u)}return v(s,r,i)}var n=t.apply(this,arguments),r=e.bind(e,"next"),i=e.bind(e,"throw");return r()}}function q(t){l.done(l.async(t)())}function D(t){throw new W(t)}function C(t){return function(){return A([this,M(arguments)],function(e,n){return t.apply(e,n)})}}function N(t,e,n){return l(t).dispatch(e,n)}function M(t){return v(t,function(t){var e=0,n=h();return Y(t,function(r,o,i){var s;w(o)&&"fulfilled"===(s=o.inspect()).state?t[i]=s.value:(++e,v(o,function(r){t[i]=r,0===--e&&n.resolve(t)},n.reject,function(t){n.notify({index:i,value:t})}))},void 0),0===e&&n.resolve(t),n.promise})}function I(t){if(0===t.length)return l.resolve();var e=l.defer(),n=0;return Y(t,function(r,o,i){function s(t){e.resolve(t)}function u(){n--,0===n&&e.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function a(t){e.notify({index:i,value:t})}var p=t[i];n++,v(p,s,u,a)},void 0),e.promise}function X(t){return v(t,function(t){return t=tt(t,l),v(M(tt(t,function(t){return v(t,$,$)})),function(){return t})})}function B(t){return l(t).allSettled()}function H(t,e){return l(t).then(void 0,void 0,e)}function F(t,e){return l(t).nodeify(e)}var U=!1;try{throw new Error}catch(J){U=!!J.stack}var G,W,Q=c(),$=function(){},V=function(){function t(){for(var t,e;o.next;)o=o.next,t=o.task,o.task=void 0,e=o.domain,e&&(o.domain=void 0,e.enter()),r(t,e);for(;p.length;)t=p.pop(),r(t);s=!1}function r(e,n){try{e()}catch(r){if(a)throw n&&n.exit(),setTimeout(t,0),n&&n.enter(),r;setTimeout(function(){throw r},0)}n&&n.exit()}var o={task:void 0,next:null},i=o,s=!1,u=void 0,a=!1,p=[];if(V=function(t){i=i.next={task:t,domain:a&&e.domain,next:null},s||(s=!0,u())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)a=!0,u=function(){e.nextTick(t)};else if("function"==typeof n)u="undefined"!=typeof window?n.bind(window,t):function(){n(t)};else if("undefined"!=typeof MessageChannel){var c=new MessageChannel;c.port1.onmessage=function(){u=f,c.port1.onmessage=t,t()};var f=function(){c.port2.postMessage(0)};u=function(){setTimeout(t,0),f()}}else u=function(){setTimeout(t,0)};return V.runAfter=function(t){p.push(t),s||(s=!0,u())},V}(),z=Function.call,K=t(Array.prototype.slice),Y=t(Array.prototype.reduce||function(t,e){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){e=this[n++];break}if(++n>=r)throw new TypeError}for(;r>n;n++)n in this&&(e=t(e,this[n],n));return e}),Z=t(Array.prototype.indexOf||function(t){for(var e=0;e2?t.resolve(K(arguments,1)):t.resolve(n)}},l.Promise=d,l.promise=d,d.race=y,d.all=M,d.reject=O,d.resolve=l,l.passByCopy=function(t){return t},m.prototype.passByCopy=function(){return this},l.join=function(t,e){return l(t).join(e)},m.prototype.join=function(t){return l([this,t]).spread(function(t,e){if(t===e)return t;throw new Error("Can't join: not the same: "+t+" "+e)})},l.race=y,m.prototype.race=function(){return this.then(l.race)},l.makePromise=m,m.prototype.toString=function(){return"[object Promise]"},m.prototype.then=function(t,e,n){function r(e){try{return"function"==typeof t?t(e):e}catch(n){return O(n)}}function o(t){if("function"==typeof e){i(t,u);try{return e(t)}catch(n){return O(n)}}return O(t)}function s(t){return"function"==typeof n?n(t):t}var u=this,a=h(),p=!1;return l.nextTick(function(){u.promiseDispatch(function(t){p||(p=!0,a.resolve(r(t)))},"when",[function(t){p||(p=!0,a.resolve(o(t)))}])}),u.promiseDispatch(void 0,"when",[void 0,function(t){var e,n=!1;try{e=s(t)}catch(r){if(n=!0,!l.onerror)throw r;l.onerror(r)}n||a.notify(e)}]),a.promise},l.tap=function(t,e){return l(t).tap(e)},m.prototype.tap=function(t){return t=l(t),this.then(function(e){return t.fcall(e).thenResolve(e)})},l.when=v,m.prototype.thenResolve=function(t){return this.then(function(){return t})},l.thenResolve=function(t,e){return l(t).thenResolve(e)},m.prototype.thenReject=function(t){return this.then(function(){throw t})},l.thenReject=function(t,e){return l(t).thenReject(e)},l.nearer=g,l.isPromise=w,l.isPromiseAlike=_,l.isPending=T,m.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=x,m.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=b,m.prototype.isRejected=function(){return"rejected"===this.inspect().state};var st=[],ut=[],at=[],pt=!0;l.resetUnhandledRejections=k,l.getUnhandledReasons=function(){return st.slice()},l.stopUnhandledRejectionTracking=function(){k(),pt=!1},k(),l.reject=O,l.fulfill=R,l.master=L,l.spread=A,m.prototype.spread=function(t,e){return this.all().then(function(e){return t.apply(void 0,e)},e)},l.async=P,l.spawn=q,l["return"]=D,l.promised=C,l.dispatch=N,m.prototype.dispatch=function(t,e){var n=this,r=h();return l.nextTick(function(){n.promiseDispatch(r.resolve,t,e)}),r.promise},l.get=function(t,e){return l(t).dispatch("get",[e])},m.prototype.get=function(t){return this.dispatch("get",[t])},l.set=function(t,e,n){return l(t).dispatch("set",[e,n])},m.prototype.set=function(t,e){return this.dispatch("set",[t,e])},l.del=l["delete"]=function(t,e){return l(t).dispatch("delete",[e])},m.prototype.del=m.prototype["delete"]=function(t){return this.dispatch("delete",[t])},l.mapply=l.post=function(t,e,n){return l(t).dispatch("post",[e,n])},m.prototype.mapply=m.prototype.post=function(t,e){return this.dispatch("post",[t,e])},l.send=l.mcall=l.invoke=function(t,e){return l(t).dispatch("post",[e,K(arguments,2)])},m.prototype.send=m.prototype.mcall=m.prototype.invoke=function(t){return this.dispatch("post",[t,K(arguments,1)])},l.fapply=function(t,e){return l(t).dispatch("apply",[void 0,e])},m.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},l["try"]=l.fcall=function(t){return l(t).dispatch("apply",[void 0,K(arguments,1)])},m.prototype.fcall=function(){return this.dispatch("apply",[void 0,K(arguments)])},l.fbind=function(t){var e=l(t),n=K(arguments,1);return function(){return e.dispatch("apply",[this,n.concat(K(arguments))])}},m.prototype.fbind=function(){var t=this,e=K(arguments);return function(){return t.dispatch("apply",[this,e.concat(K(arguments))])}},l.keys=function(t){return l(t).dispatch("keys",[])},m.prototype.keys=function(){return this.dispatch("keys",[])},l.all=M,m.prototype.all=function(){return M(this)},l.any=I,m.prototype.any=function(){return I(this)},l.allResolved=f(X,"allResolved","allSettled"),m.prototype.allResolved=function(){return X(this)},l.allSettled=B,m.prototype.allSettled=function(){return this.then(function(t){return M(tt(t,function(t){function e(){return t.inspect()}return t=l(t),t.then(e,e)}))})},l.fail=l["catch"]=function(t,e){return l(t).then(void 0,e)},m.prototype.fail=m.prototype["catch"]=function(t){return this.then(void 0,t)},l.progress=H,m.prototype.progress=function(t){return this.then(void 0,void 0,t)},l.fin=l["finally"]=function(t,e){return l(t)["finally"](e)},m.prototype.fin=m.prototype["finally"]=function(t){return t=l(t),this.then(function(e){return t.fcall().then(function(){return e})},function(e){return t.fcall().then(function(){throw e})})},l.done=function(t,e,n,r){return l(t).done(e,n,r)},m.prototype.done=function(t,n,r){var o=function(t){l.nextTick(function(){if(i(t,s),!l.onerror)throw t;l.onerror(t)})},s=t||n||r?this.then(t,n,r):this;"object"==typeof e&&e&&e.domain&&(o=e.domain.bind(o)),s.then(void 0,o)},l.timeout=function(t,e,n){return l(t).timeout(e,n)},m.prototype.timeout=function(t,e){var n=h(),r=setTimeout(function(){e&&"string"!=typeof e||(e=new Error(e||"Timed out after "+t+" ms"),e.code="ETIMEDOUT"),n.reject(e)},t);return this.then(function(t){clearTimeout(r),n.resolve(t)},function(t){clearTimeout(r),n.reject(t)},n.notify),n.promise},l.delay=function(t,e){return void 0===e&&(e=t,t=void 0),l(t).delay(e)},m.prototype.delay=function(t){return this.then(function(e){var n=h();return setTimeout(function(){n.resolve(e)},t),n.promise})},l.nfapply=function(t,e){return l(t).nfapply(e)},m.prototype.nfapply=function(t){var e=h(),n=K(t);return n.push(e.makeNodeResolver()),this.fapply(n).fail(e.reject),e.promise},l.nfcall=function(t){var e=K(arguments,1);return l(t).nfapply(e)},m.prototype.nfcall=function(){var t=K(arguments),e=h();return t.push(e.makeNodeResolver()),this.fapply(t).fail(e.reject),e.promise},l.nfbind=l.denodeify=function(t){var e=K(arguments,1);return function(){var n=e.concat(K(arguments)),r=h();return n.push(r.makeNodeResolver()),l(t).fapply(n).fail(r.reject),r.promise}},m.prototype.nfbind=m.prototype.denodeify=function(){var t=K(arguments);return t.unshift(this),l.denodeify.apply(void 0,t)},l.nbind=function(t,e){var n=K(arguments,2);return function(){function r(){return t.apply(e,arguments)}var o=n.concat(K(arguments)),i=h();return o.push(i.makeNodeResolver()),l(r).fapply(o).fail(i.reject),i.promise}},m.prototype.nbind=function(){var t=K(arguments,0);return t.unshift(this),l.nbind.apply(void 0,t)},l.nmapply=l.npost=function(t,e,n){return l(t).npost(e,n)},m.prototype.nmapply=m.prototype.npost=function(t,e){var n=K(e||[]),r=h();return n.push(r.makeNodeResolver()),this.dispatch("post",[t,n]).fail(r.reject),r.promise},l.nsend=l.nmcall=l.ninvoke=function(t,e){var n=K(arguments,2),r=h();return n.push(r.makeNodeResolver()),l(t).dispatch("post",[e,n]).fail(r.reject),r.promise},m.prototype.nsend=m.prototype.nmcall=m.prototype.ninvoke=function(t){var e=K(arguments,1),n=h();return e.push(n.makeNodeResolver()),this.dispatch("post",[t,e]).fail(n.reject),n.promise},l.nodeify=F,m.prototype.nodeify=function(t){return t?void this.then(function(e){l.nextTick(function(){t(null,e)})},function(e){l.nextTick(function(){t(e)})}):this},l.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var ct=c();return l})}).call(e,n(6),n(5).setImmediate)}]); //# sourceMappingURL=webmo.min.js.map