kaiwa/clientapp/libraries/stanza.io.js

8 lines
223 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t){if("function"==typeof bootstrap)bootstrap("xmpp",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeXMPP=t}else"undefined"!=typeof window?window.XMPP=t():global.XMPP=t()}(function(){var t;return function(t,e,n){function r(n,o){if(!e[n]){if(!t[n]){var a="function"==typeof require&&require;if(!o&&a)return a(n,!0);if(i)return i(n,!0);throw new Error("Cannot find module '"+n+"'")}var s=e[n]={exports:{}};t[n][0].call(s.exports,function(e){var i=t[n][1][e];return r(i?i:e)},s,s.exports)}return e[n].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){n.Message=t("./lib/stanza/message"),n.Presence=t("./lib/stanza/presence"),n.Iq=t("./lib/stanza/iq"),n.Client=t("./lib/client"),n.crypto=t("crypto"),n.createClient=function(e){var r=new n.Client(e);return r.use(t("./lib/plugins/disco")),r.use(t("./lib/plugins/chatstates")),r.use(t("./lib/plugins/delayed")),r.use(t("./lib/plugins/forwarding")),r.use(t("./lib/plugins/carbons")),r.use(t("./lib/plugins/time")),r.use(t("./lib/plugins/mam")),r.use(t("./lib/plugins/receipts")),r.use(t("./lib/plugins/idle")),r.use(t("./lib/plugins/correction")),r.use(t("./lib/plugins/attention")),r.use(t("./lib/plugins/version")),r.use(t("./lib/plugins/invisible")),r.use(t("./lib/plugins/muc")),r.use(t("./lib/plugins/pubsub")),r.use(t("./lib/plugins/avatar")),r.use(t("./lib/plugins/private")),r.use(t("./lib/plugins/bookmarks")),r}},{"./lib/client":2,"./lib/plugins/attention":4,"./lib/plugins/avatar":5,"./lib/plugins/bookmarks":6,"./lib/plugins/carbons":7,"./lib/plugins/chatstates":8,"./lib/plugins/correction":9,"./lib/plugins/delayed":10,"./lib/plugins/disco":11,"./lib/plugins/forwarding":12,"./lib/plugins/idle":13,"./lib/plugins/invisible":14,"./lib/plugins/mam":15,"./lib/plugins/muc":16,"./lib/plugins/private":17,"./lib/plugins/pubsub":18,"./lib/plugins/receipts":19,"./lib/plugins/time":20,"./lib/plugins/version":21,"./lib/stanza/iq":35,"./lib/stanza/message":37,"./lib/stanza/presence":39,crypto:63}],2:[function(t,e){function n(t){var e=this;r.call(this),this.config=t||{},this.jid=new p,this._idPrefix=a.v4(),this._idCount=0,this.timeoutMonitor=null,this.negotiatedFeatures={},this.featureOrder=["sasl","streamManagement","bind","streamManagement","session"],this.features={},this.conn=new h,this.conn.on("*",function(t,n){e.emit(t,n)}),this.on("streamFeatures",function(t){var n=[function(e){e(null,t)}],r=["setup"];e.featureOrder.forEach(function(i){t._extensions[i]&&!e.negotiatedFeatures[i]&&(n.push(function(t,n){!e.negotiatedFeatures[i]&&e.features[i]?e.features[i](t,n):n(null,t)}),r.push(i))}),o.waterfall(n,function(t){"restart"===t?e.conn.restart():"disconnect"===t&&e.disconnect()})}),this.features.sasl=function(t,n){var r=m.create(t.sasl.mechanisms);e.on("sasl:success","sasl",function(){e.negotiatedFeatures.sasl=!0,e.releaseGroup("sasl"),e.emit("auth:success"),n("restart")}),e.on("sasl:challenge","sasl",function(t){r.challenge(t.value),e.send(new u.Response({value:r.response(e.getCredentials())})),r.cache&&(i.each(r.cache,function(t,n){e.config.credentials[n]=btoa(t)}),e.emit("credentials:update",e.config.credentials)),n()}),e.on("sasl:failure","sasl",function(){e.releaseGroup("sasl"),e.emit("auth:failed"),n("disconnect")}),e.on("sasl:abort","sasl",function(){e.releaseGroup("sasl"),e.emit("auth:failed"),n("disconnect")});var o={mechanism:r.name};r.clientFirst&&(o.value=r.response(e.getCredentials())),e.send(new u.Auth(o))},this.features.bind=function(t,n){e.sendIq({type:"set",bind:{resource:e.config.resource}},function(r,i){e.negotiatedFeatures.bind=!0,e.emit("session:bound",i.bind.jid),e.jid=new p(i.bind.jid),t._extensions.session||(e.sessionStarted=!0,e.emit("session:started",i.bind.jid)),n(null,t)})},this.features.session=function(t,n){e.sendIq({type:"set",session:{}},function(){e.negotiatedFeatures.session=!0,e.sessionStarted=!0,e.emit("session:started",e.jid),n(null,t)})},this.features.streamManagement=function(t,n){e.on("stream:management:enabled","sm",function(r){e.conn.sm.enabled(r),e.negotiatedFeatures.streamManagement=!0,e.on("stream:management:ack","connection",function(t){e.conn.sm.process(t)}),e.on("stream:management:request","connection",function(){e.conn.sm.ack()}),e.releaseGroup("sm"),n(null,t)}),e.on("stream:management:resumed","sm",function(r){e.conn.sm.enabled(r),e.negotiatedFeatures.streamManagement=!0,e.negotiatedFeatures.bind=!0,e.sessionStarted=!0,e.on("stream:management:ack","connection",function(t){e.conn.sm.process(t)}),e.on("stream:management:request","connection",function(){e.conn.sm.ack()}),e.releaseGroup("sm"),n(null,t)}),e.on("stream:management:failed","sm",function(){e.conn.sm.failed(),e.emit("session:end"),e.releaseGroup("session"),e.releaseGroup("sm"),n(null,t)}),e.conn.sm.id?e.conn.sm.id&&e.conn.sm.allowResume?e.conn.sm.resume():n(null,t):e.negotiatedFeatures.bind?e.conn.sm.enable():n(null,t)},this.on("disconnected",function(){e.sessionStarted=!1,e.negotiatedFeatures.sasl=!1,e.negotiatedFeatures.streamManagement=!1,e.negotiatedFeatures.bind=!1,e.negotiatedFeatures.session=!1,e.releaseGroup("connection")}),this.on("iq:set:roster",function(t){e.emit("roster:update",t),e.sendIq({id:t.id,type:"result"})}),this.on("iq",function(t){var n=t.type,r=Object.keys(t._extensions),o=t.xml.childNodes,a=0;if(i.each(o,function(t){1===t.nodeType&&(a+=1)}),"get"===t.type||"set"===t.type){if(1!=a)return e.sendIq({id:t.id,type:"error",error:{type:"modify",condition:"bad-request"}});if(!r.length)return e.sendIq({id:t.id,type:"error",error:{type:"cancel",condition:"feature-not-implemented"}});var s="iq:"+n+":"+r[0];e.callbacks[s]?e.emit(s,t):e.sendIq({id:t.id,type:"error",error:{type:"cancel",condition:"feature-not-implemented"}})}}),this.on("message",function(t){Object.keys(t.$body).length&&("chat"===t.type||"normal"===t.type?e.emit("chat",t):"groupchat"===t.type&&e.emit("groupchat",t))}),this.on("presence",function(t){var n=t.type||"available";e.emit(n,t)})}var r=t("wildemitter"),i=t("underscore"),o=t("async"),a=t("node-uuid"),s=t("paddle"),u=t("./stanza/sasl"),c=t("./stanza/message"),f=t("./stanza/presence"),l=t("./stanza/iq"),p=t("./jid"),h=t("./websocket"),d=t("hostmeta"),m=t("saslmechanisms");m=new m,m.use(t("sasl-external")),m.use(t("sasl-scram-sha-1")),m.use(t("sasl-digest-md5")),m.use(t("sasl-plain")),m.use(t("sasl-anonymous")),t("./stanza/stream"),t("./stanza/sm"),t("./stanza/roster"),t("./stanza/error"),t("./stanza/streamError"),t("./stanza/streamFeatures"),t("./stanza/bind"),t("./stanza/session"),n.prototype=Object.create(r.prototype,{constructor:{value:n}}),n.prototype.__defineGetter__("stream",function(){return this.conn?this.conn.stream:void 0}),n.prototype.use=function(t){t(this)},n.prototype.nextId=function(){return this._idPrefix+"-"+(this._idCount++).toString(16)},n.prototype.discoverBindings=function(t,e){d(t,function(t,n){if(t)return e(t,[]);var r=[],i=n.links||[];i.forEach(function(t){t.href&&"urn:xmpp:altconnect:websocket"===t.rel&&r.push(t.href)}),e(!1,r)})},n.prototype.getCredentials=function(){var t=this.config.credentials||{},e=new p(this.config.jid),n=t.username||e.local,r=t.server||e.domain,o={username:n,password:this.config.password,server:r,host:r,realm:r,serviceType:"xmpp",serviceName:r},a=i.extend(o,t),s=["saltedPassword","clientKey","serverKey"];return s.forEach(function(t){a[t]&&(a[t]=atob(a[t]))}),a},n.prototype.connect=function(t){var e=this;return i.extend(e.config,t||{}),e.timeoutMonitor||(e.timeoutMonitor=new s.Paddle(e.config.timeout||15),e.timeoutMonitor.start()),e.config.wsURL?e.conn.connect(e.config):(e.discoverBindings(e.config.server,function(t,n){!t&&n.length?(e.config.wsURL=n[0],e.conn.connect(e.config)):e.disconnect()}),void 0)},n.prototype.disconnect=function(){this.timeoutMonitor&&(this.timeoutMonitor.stop(),this.timeoutMonitor=null),this.sessionStarted&&(this.emit("session:end"),this.releaseGroup("session")),this.sessionStarted=!1,this.releaseGroup("connection"),this.conn&&this.conn.disconnect()},n.prototype.send=function(t){this.conn.send(t)},n.prototype.sendMessage=function(t){t=t||{},t.id||(t.id=this.nextId());var e=new c(t);return this.emit("message:sent",e),this.send(e),t.id},n.prototype.sendPresence=function(t){return t=t||{},t.id||(t.id=this.nextId()),this.send(new f(t)),t.id},n.prototype.sendIq=function(t,e){var n=this;t=t||{},e=e||function(){},t.id||(t.id=this.nextId());var r=!1,i=function(t,n){r||(r=!0,e(t,n))};if("get"===t.type||"set"===t.type){var o=this.timeoutMonitor.insure(function(){i({type:"error",error:{condition:"timeout"}},null)}),a=new p(t.to),s={};s[""]=!0,s[a.full]=!0,s[a.bare]=!0,s[a.domain]=!0,s[n.jid.bare]=!0,s[n.jid.domain]=!0;var u=function(e){var r=e.from;s[r.full]&&(o.check_in(),n.off("id:"+t.id,u),e._extensions.error?i(e,null):i(null,e))};this.on("id:"+t.id,"session",u)}return this.send(new l(t)),t.id},n.prototype.getRoster=function(t){var e=this;t=t||function(){},this.sendIq({type:"get",roster:{ver:e.config.rosterVer}},function(n,r){return n?t(n):("result"===r.type&&r.roster.ver&&(e.config.rosterVer=r.roster.ver,e.emit("roster:ver",r.roster.ver)),t(null,r),void 0)})},n.prototype.updateRosterItem=function(t,e){this.sendIq({type:"set",roster:{items:[t]}},e)},n.prototype.removeRosterItem=function(t,e){this.updateRosterItem({jid:t,subscription:"remove"},e)},n.prototype.subscribe=function(t){this.sendPresence({type:"subscribe",to:t})},n.prototype.unsubscribe=function(t){this.sendPresence({type:"unsubscribe",to:t})},n.prototype.acceptSubscription=function(t){this.sendPresence({type:"subscribed",to:t})},n.prototype.denySubscription=function(t){this.sendPresence({type:"unsubscribed",to:t})},n.prototype.JID=function(t){return new p(t)},e.exports=n},{"./jid":3,"./stanza/bind":24,"./stanza/error":32,"./stanza/iq":35,"./stanza/message":37,"./stanza/presence":39,"./stanza/roster":43,"./stanza/sasl":45,"./stanza/session":46,"./stanza/sm":47,"./stanza/stream":48,"./stanza/streamError":49,"./stanza/streamFeatures":50,"./websocket":55,async:56,hostmeta:70,"node-uuid":82,paddle:83,"sasl-anonymous":85,"sasl-digest-md5":87,"sasl-external":89,"sasl-plain":91,"sasl-scram-sha-1":93,saslmechanisms:95,underscore:96,wildemitter:97}],3:[function(t,e){function n(t){t=t||"","string"==typeof t?(this.jid=t,this.parts={}):(this.jid=t.jid,this.parts=t.parts)}n.prototype={constructor:{value:n},toString:function(){return this.jid},get full(){return this.jid},get bare(){if(this.parts.bare)return this.parts.bare;var t=this.jid.indexOf("/");return this.parts.bare=t>0?this.jid.slice(0,t):this.jid,this.parts.bare},get resource(){if(this.parts.resource)return this.parts.resource;var t=this.jid.indexOf("/");return this.parts.resource=t>0?this.jid.slice(t+1):"",this.parts.resource},get local(){if(this.parts.local)return this.parts.local;var t=this.bare,e=t.indexOf("@");return this.parts.local=e>0?t.slice(0,e):t,this.parts.local},get domain(){if(this.parts.domain)return this.parts.domain;var t=this.bare,e=t.indexOf("@");return this.parts.domain=e>0?t.slice(e+1):t,this.parts.domain}},e.exports=n},{}],4:[function(t,e){e.exports=function(t){t.disco.addFeature("urn:xmpp:attention:0"),t.getAttention=function(e,n){n=n||{},n.to=e,n.type="headline",n.attention=!0,t.sendMessage(n)},t.on("message",function(e){e._extensions._attention&&t.emit("attention",e)})}},{}],5:[function(t,e){t("../stanza/avatar"),e.exports=function(t){t.disco.addFeature("urn:xmpp:avatar:metadata+notify"),t.on("pubsubEvent",function(e){e.event._extensions.updated&&"urn:xmpp:avatar:metadata"===e.event.updated.node&&t.emit("avatar",{jid:e.from,avatars:e.event.updated.published[0].avatars})}),t.publishAvatar=function(e,n,r){t.publish("","urn:xmpp:avatar:data",{id:e,avatarData:n},r)},t.useAvatars=function(e,n){t.publish("","urn:xmpp:avatar:metadata",{id:"current",avatars:e},n)},t.getAvatar=function(e,n,r){t.getItem(e,"urn:xmpp:avatar:data",n,r)}}},{"../stanza/avatar":23}],6:[function(t,e){t("../stanza/bookmarks"),e.exports=function(t){t.getBookmarks=function(t){this.getPrivateData({bookmarks:{}},t)},t.setBookmarks=function(t,e){this.setPrivateData({bookmarks:t},e)}}},{"../stanza/bookmarks":25}],7:[function(t,e){t("../stanza/carbons"),e.exports=function(t){t.disco.addFeature("urn:xmpp:carbons:2"),t.enableCarbons=function(t){this.sendIq({type:"set",enableCarbons:!0},t)},t.disableCarbons=function(t){this.sendIq({type:"set",disableCarbons:!0},t)},t.on("message",function(e){return e._extensions.carbonSent?t.emit("carbon:sent",e):e._extensions.carbonReceived?t.emit("carbon:received",e):void 0})}},{"../stanza/carbons":27}],8:[function(t,e){t("../stanza/chatstates"),e.exports=function(t){t.disco.addFeature("http://jabber.org/protocol/chatstates"),t.on("message",function(e){e.chatState&&t.emit("chatState",{to:e.to,from:e.from,chatState:e.chatState})})}},{"../stanza/chatstates":28}],9:[function(t,e){e.exports=function(t){t.disco.addFeature("urn:xmpp:message-correct:0"),t.on("message",function(e){e.replace&&(t.emit("replace",e),t.emit("replace:"+e.id,e))})}},{}],10:[function(t,e){t("../stanza/delayed"),e.exports=function(t){t.disco.addFeature("urn:xmpp:delay")}},{"../stanza/delayed":30}],11:[function(t,e){function n(t,e,n){"sha-1"===e&&(e="sha1");var i=r(t,e);return i&&i==n}function r(t,e){var n="",r=t.features.sort(),i=[],u={},c=[];o.forEach(t.identities,function(t){i.push([t.category||"",t.type||"",t.lang||"",t.name||""].join("/"))});var f=i.length,l=r.length;if(i=o.unique(i,!0),r=o.unique(r,!0),l!=r.length||f!=i.length)return!1;n+=i.join("<")+"<",n+=r.join("<")+"<";var p=!1;if(o.forEach(t.extensions,function(t){for(var e=t.fields,n=0,r=e.length;r>n;n++)if("FORM_TYPE"==e[n].name&&"hidden"==e[n].type){var i=e[n].value;return u[i]?(p=!0,void 0):(u[i]=t,c.push(i),void 0)}}),p)return!1;c.sort(),o.forEach(c,function(t){var e=u[t],r={},i=[];n+="<"+t,o.forEach(e.fields,function(t){var e=t.name;if("FORM_TYPE"!=e){var n=t.value||"";"object"!=typeof n&&(n=n.split("\n")),r[e]=n.sort(),i.push(e)}}),i.sort(),o.forEach(i,function(t){n+="<"+t,o.forEach(r[t],function(t){n+="<"+t})})}),"sha-1"===e&&(e="sha1");var h=a.createHash(e).update(s.encode(n)).digest("base64"),d=4-h.length%4;4===d&&(d=0);for(var m=0;d>m;m++)h+="=";return h}function i(){this.features={},this.identities={},this.extensions={},this.items={},this.caps={}}var o=t("underscore"),a=t("crypto");t("../stanza/disco"),t("../stanza/caps");var s={encode:function(t){return unescape(encodeURIComponent(t))},decode:function(t){return decodeURIComponent(escape(t))}};i.prototype={constructor:{value:i},addFeature:function(t,e){e=e||"",this.features[e]||(this.features[e]=[]),this.features[e].push(t)},addIdentity:function(t,e){e=e||"",this.identities[e]||(this.identities[e]=[]),this.identities[e].push(t)},addItem:function(t,e){e=e||"",this.items[e]||(this.items[e]=[]),this.items[e].push(t)},addExtension:function(t,e){e=e||"",this.extensions[e]||(this.extensions[e]=[]),this.extensions[e].push(t)}},e.exports=function(t){t.disco=new i(t),t.disco.addFeature("http://jabber.org/protocol/disco#info"),t.disco.addIdentity({category:"client",type:"web"}),t.getDiscoInfo=function(t,e,n){this.sendIq({to:t,type:"get",discoInfo:{node:e}},n)},t.getDiscoItems=function(t,e,n){this.sendIq({to:t,type:"get",discoItems:{node:e}},n)},t.updateCaps=function(){var e=this.config.capsNode||"https://stanza.io",n=JSON.parse(JSON.stringify({identities:this.disco.identities[""],features:this.disco.features[""],extensions:this.disco.extensions[""]})),i=r(n,"sha-1");return this.disco.caps={node:e,hash:"sha-1",ver:i},e=e+"#"+i,this.disco.features[e]=n.features,this.disco.identities[e]=n.identities,this.disco.extensions[e]=n.extensions,t.getCurrentCaps()},t.getCurrentCaps=function(){var e=t.disco.caps;if(!e.ver)return{ver:null,discoInfo:null};var n=e.node+"#"+e.ver;return{ver:e.ver,discoInfo:{identities:t.disco.identities[n],features:t.disco.features[n],extensions:t.disco.extensions[n]}}},t.on("presence",function(e){e._extensions.caps&&t.emit("disco:caps",e)}),t.on("iq:get:discoInfo",function(e){var n=e.discoInfo.node,r=e.discoInfo.node;n===t.disco.caps.node+"#"+t.disco.caps.ver&&(r=n,n=""),t.sendIq(e.resultReply({discoInfo:{node:r,identities:t.disco.identities[n]||[],features:t.disco.features[n]||[],extensions:t.disco.extensions[n]||[]}}))}),t.on("iq:get:discoItems",function(e){var n=e.discoInfo.node;t.sendIq(e.resultReply({discoItems:{node:n,items:t.disco.items[n]||[]}}))}),t.verifyVerString=n,t.generateVerString=r}},{"../stanza/caps":26,"../stanza/disco":31,crypto:63,underscore:96}],12:[function(t,e){t("../stanza/forwarded"),e.exports=function(t){t.disco.addFeature("urn:xmpp:forward:0")}},{"../stanza/forwarded":33}],13:[function(t,e){t("../stanza/idle"),e.exports=function(t){t.disco.addFeature("urn:xmpp:idle:0")}},{"../stanza/idle":34}],14:[function(t,e){t("../stanza/visibility"),e.exports=function(t){t.goInvisible=function(){this.sendIq({type:"set",invisible:!0})},t.goVisible=function(){this.sendIq({type:"set",visible:!0})}}},{"../stanza/visibility":54}],15:[function(t,e){t("../stanza/mam"),e.exports=function(t){t.disco.addFeature("urn:xmpp:mam:tmp"),t.getHistory=function(t,e){var n=this,r=this.nextId();t=t||{},t.queryid=r;var i=[];this.on("mam:"+r,"session",function(t){i.push(t)}),e=e||function(){},this.sendIq({type:"get",id:r,mamQuery:t},function(t,o){t?e(t):(n.off("mam:"+r),o.mamQuery.results=i,e(null,o))})},t.getHistoryPreferences=function(e){t.sendIq({type:"get",mamPrefs:{}},e)},t.setHistoryPreferences=function(e,n){t.sendIq({type:"set",mamPrefs:e},n)},t.on("message",function(e){e._extensions.mam&&t.emit("mam:"+e.mam.queryid,e)})}},{"../stanza/mam":36}],16:[function(t,e){t("../stanza/muc"),e.exports=function(t){t.joinRoom=function(t,e,n){n=n||{},n.to=t+"/"+e,n.caps=this.disco.caps,n.joinMuc=n.joinMuc||{},this.sendPresence(n)},t.leaveRoom=function(t,e,n){n=n||{},n.to=t+"/"+e,n.type="unavailable",this.sendPresence(n)}}},{"../stanza/muc":38}],17:[function(t,e){t("../stanza/private"),e.exports=function(t){t.getPrivateData=function(t,e){this.sendIq({type:"get",privateStorage:t},e)},t.setPrivateData=function(t,e){this.sendIq({type:"set",privateStorage:t},e)}}},{"../stanza/private":40}],18:[function(t,e){t("../stanza/pubsub"),e.exports=function(t){t.on("message",function(e){e._extensions.event&&t.emit("pubsubEvent",e)}),t.subscribeToNode=function(e,n,r){t.sendIq({type:"set",to:e,pubsub:{subscribe:{node:n.node,jid:n.jid||t.jid}}},r)},t.unsubscribeFromNode=function(e,n,r){t.sendIq({type:"set",to:e,pubsub:{unsubscribe:{node:n.node,jid:n.jid||t.jid.split("/")[0]}}},r)},t.publish=function(e,n,r,i){t.sendIq({type:"set",to:e,pubsub:{publish:{node:n,item:r}}},i)},t.getItem=function(e,n,r,i){t.sendIq({type:"get",to:e,pubsub:{retrieve:{node:n,item:r}}},i)},t.getItems=function(e,n,r,i){r=r||{},r.node=n,t.sendIq({type:"get",to:e,pubsub:{retrieve:{node:n,max:r.max},rsm:r.rsm}},i)},t.retract=function(e,n,r,i,o){t.sendIq({type:"set",to:e,pubsub:{retract:{node:n,notify:i,id:r}}},o)},t.purgeNode=function(e,n,r){t.sendIq({type:"set",to:e,pubsubOwner:{purge:n}},r)},t.deleteNode=function(e,n,r){t.sendIq({type:"set",to:e,pubsubOwner:{del:n}},r)},t.createNode=function(e,n,r,i){var o={type:"set",to:e,pubsubOwner:{create:n}};r&&(o.pubsubOwner.config={form:r}),t.sendIq(o,i)}}},{"../stanza/pubsub":41}],19:[function(t,e){t("../stanza/receipts"),e.exports=function(t){t.disco.addFeature("urn:xmpp:receipts"),t.on("message",function(e){var n={normal:!0,chat:!0,headline:!0};n[e.type]&&e.requestReceipt&&!e._extensions.receipt&&t.sendMessage({to:e.from,receipt:{id:e.id},id:e.id}),e._extensions.receipt&&t.emit("receipt:"+e.receipt.id)})}},{"../stanza/receipts":42}],20:[function(t,e){t("../stanza/time"),e.exports=function(t){t.disco.addFeature("urn:xmpp:time"),t.getTime=function(t,e){this.sendIq({to:t,type:"get",time:!0},e)},t.on("iq:get:time",function(e){var n=new Date;t.sendIq(e.resultReply({time:{utc:n,tzo:n.getTimezoneOffset()}}))})}},{"../stanza/time":51}],21:[function(t,e){t("../stanza/version"),e.exports=function(t){t.disco.addFeature("jabber:iq:version"),t.on("iq:get:version",function(e){t.sendIq(e.resultReply({version:t.config.version||{name:"stanza.io"}}))}),t.getSoftwareVersion=function(t,e){this.sendIq({to:t,type:"get",version:{}},e)}}},{"../stanza/version":53}],22:[function(t,e){function n(t,e){return(t%e+e)%e}function r(t){this.conn=t,this.id=!1,this.allowResume=!0,this.started=!1,this.lastAck=0,this.handled=0,this.windowSize=1,this.windowCount=0,this.unacked=[]}var i=t("./stanza/sm"),o=Math.pow(2,32);r.prototype={constructor:{value:r},enable:function(){var t=new i.Enable;t.resume=this.allowResume,this.conn.send(t),this.handled=0,this.started=!0},resume:function(){var t=new i.Resume({h:this.handled,previd:this.id});this.conn.send(t),this.started=!0},enabled:function(t){this.id=t.id},resumed:function(t){this.id=t.id,t.h&&this.process(t,!0)},failed:function(){this.started=!1,this.id=!1,this.lastAck=0,this.handled=0,this.windowCount=0,this.unacked=[]},ack:function(){this.conn.send(new i.Ack({h:this.handled}))},request:function(){this.conn.send(new i.Request)},process:function(t,e){for(var r=this,i=n(t.h-this.lastAck,o),a=0;i>a&&this.unacked.length>0;a++)this.conn.emit("stanza:acked",this.unacked.shift());if(e){var s=this.unacked;this.unacked=[],s.forEach(function(t){r.conn.send(t)})}this.lastAck=t.h},track:function(t){var e=t._name,n={message:!0,presence:!0,iq:!0};this.started&&n[e]&&(this.unacked.push(t),this.windowCount+=1,this.windowCount==this.windowSize&&(this.request(),this.windowCount=0))},handle:function(){this.started&&(this.handled=n(this.handled+1,o))}},e.exports=r},{"./stanza/sm":47}],23:[function(t,e){var n=t("underscore"),r=t("jxt"),i=t("./pubsub").Item,o=t("./pubsub").EventItem,a=e.exports=r.define({name:"avatar",namespace:"urn:xmpp:avatar:metadata",element:"info",fields:{id:r.attribute("id"),bytes:r.attribute("bytes"),height:r.attribute("height"),width:r.attribute("width"),type:r.attribute("type","image/png"),url:r.attribute("url")}}),s={get:function(){var t=r.find(this.xml,"urn:xmpp:avatar:metadata","metadata"),e=[];if(t.length){var i=r.find(t[0],"urn:xmpp:avatar:metadata","info");n.forEach(i,function(t){e.push(new a({},t))})}return e},set:function(t){var e=r.findOrCreate(this.xml,"urn:xmpp:avatar:metadata","metadata");r.setAttribute(e,"xmlns","urn:xmpp:avatar:metadata"),n.forEach(t,function(t){var n=new a(t);e.appendChild(n.xml)})}};r.add(i,"avatars",s),r.add(o,"avatars",s),r.add(i,"avatarData",r.subText("urn:xmpp:avatar:data","data")),r.add(o,"avatarData",r.subText("urn:xmpp:avatar:data","data"))},{"./pubsub":41,jxt:77,underscore:96}],24:[function(t,e){var n=t("jxt"),r=t("./iq"),i=t("./streamFeatures"),o=t("./util"),a="urn:ietf:params:xml:ns:xmpp-bind",s=e.exports=n.define({name:"bind",namespace:a,element:"bind",fields:{resource:n.subText(a,"resource"),jid:o.jidSub(a,"jid")}});n.extend(r,s),n.extend(i,s)},{"./iq":35,"./streamFeatures":50,"./util":52,jxt:77}],25:[function(t,e){var n=t("jxt"),r=t("./util"),i=t("./private"),o=n.define({name:"conference",namespace:"storage:bookmarks",element:"conference",fields:{name:n.attribute("name"),autoJoin:n.boolAttribute("autojoin"),jid:r.jidAttribute("jid"),nick:n.subText("storage:bookmarks","nick")}}),a=e.exports=n.define({name:"bookmarks",namespace:"storage:bookmarks",element:"storage"});n.extend(i,a),n.extend(a,o,"conferences")},{"./private":40,"./util":52,jxt:77}],26:[function(t,e){var n=t("jxt"),r=t("./presence"),i=t("./streamFeatures"),o=e.exports=n.define({name:"caps",namespace:"http://jabber.org/protocol/caps",element:"c",fields:{ver:n.attribute("ver"),node:n.attribute("node"),hash:n.attribute("hash"),ext:n.attribute("ext")}});n.extend(r,o),n.extend(i,o)},{"./presence":39,"./streamFeatures":50,jxt:77}],27:[function(t,e,n){var r=t("jxt"),i=t("./message"),o=t("./iq"),a=t("./forwarded");n.Sent=r.define({name:"carbonSent",eventName:"carbon:sent",namespace:"urn:xmpp:carbons:2",element:"sent"}),n.Received=r.define({name:"carbonReceived",eventName:"carbon:received",namespace:"urn:xmpp:carbons:2",element:"received"}),n.Private=r.define({name:"carbonPrivate",eventName:"carbon:private",namespace:"urn:xmpp:carbons:2",element:"private"}),n.Enable=r.define({name:"enableCarbons",namespace:"urn:xmpp:carbons:2",element:"enable"}),n.Disable=r.define({name:"disableCarbons",namespace:"urn:xmpp:carbons:2",element:"disable"}),r.extend(n.Sent,a),r.extend(n.Received,a),r.extend(i,n.Sent),r.extend(i,n.Received),r.extend(i,n.Private),r.extend(o,n.Enable),r.extend(o,n.Disable)},{"./forwarded":33,"./iq":35,"./message":37,jxt:77}],28:[function(t){var e=t("jxt"),n=t("./message"),r="http://jabber.org/protocol/chatstates",i=e.define({name:"chatStateActive",eventName:"chat:active",namespace:r,element:"active"}),o=e.define({name:"chatStateComposing",eventName:"chat:composing",namespace:r,element:"composing"}),a=e.define({name:"chatStatePaused",eventName:"chat:paused",namespace:r,element:"paused"}),s=e.define({name:"chatStateInactive",eventName:"chat:inactive",namespace:r,element:"inactive"}),u=e.define({name:"chatStateGone",eventName:"chat:gone",namespace:r,element:"gone"});e.extend(n,i),e.extend(n,o),e.extend(n,a),e.extend(n,s),e.extend(n,u),e.add(n,"chatState",{get:function(){for(var t=this,e=["Active","Composing","Paused","Inactive","Gone"],n=0;n<e.length;n++)if(t._extensions["chatState"+e[n]])return e[n].toLowerCase();return""},set:function(t){var e=this,n=["Active","Composing","Paused","Inactive","Gone"];n.forEach(function(t){e._extensions["chatState"+t]&&(e.xml.removeChild(e._extensions["chatState"+t].xml),delete e._extensions["chatState"+t])}),t&&this["chatState"+t.charAt(0).toUpperCase()+t.slice(1)]}})},{"./message":37,jxt:77}],29:[function(t,e,n){t("underscore");var r=t("jxt");t("./util");var i=t("./message");n.DataForm=r.define({name:"form",namespace:"jabber:x:data",element:"x",fields:{title:r.subText("jabber:x:data","title"),instructions:r.multiSubText("jabber:x:data","instructions"),type:r.attribute("type","form")}}),n.Field=r.define({name:"field",namespace:"jabber:x:data",element:"field",init:function(t){this._type=t.type||this.type},fields:{type:{get:function(){return r.getAttribute(this.xml,"type","text-single")},set:function(t){this._type=t,r.setAttribute(this.xml,"type",t)}},name:r.attribute("var"),desc:r.subText("desc"),required:r.boolSub("jabber:x:data","required"),label:r.attribute("label"),value:{get:function(){var t=r.getMultiSubText(this.xml,this._NS,"value");return"boolean"===this._type?"1"===t[0]||"true"===t[0]:t.length>1?"text-multi"===this._type?t.join("\n"):t:t[0]},set:function(t){"boolean"===this._type?r.setSubText(this.xml,this._NS,"value",t?"1":"0"):("text-multi"===this._type&&(t=t.split("\n")),r.setMultiSubText(this.xml,this._NS,"value",t))}},options:{get:function(){var t=this;return r.getMultiSubText(this.xml,this._NS,"option",function(e){return r.getSubText(e,t._NS,"value")})},set:function(t){var e=this;r.setMultiSubText(this.xml,this._NS,"option",t,function(t){var n=document.createElementNS(e._NS,"option"),r=document.createElementNS(e._NS,"value");n.appendChild(r),r.textContent=t,e.xml.appendChild(n)})}}}}),r.extend(i,n.DataForm)},{"./message":37,"./util":52,jxt:77,underscore:96}],30:[function(t,e){var n=t("jxt"),r=t("./message"),i=t("./presence"),o=t("./util"),a=e.exports=n.define({name:"delay",namespace:"urn:xmpp:delay",element:"delay",fields:{from:o.jidAttribute("from"),stamp:o.dateAttribute("stamp"),reason:n.text()}});n.extend(r,a),n.extend(i,a)},{"./message":37,"./presence":39,"./util":52,jxt:77}],31:[function(t,e,n){t("underscore");var r=t("jxt"),i=t("../jid"),o=t("./iq"),a=t("./rsm"),s=t("./dataforms").DataForm;n.DiscoInfo=r.define({name:"discoInfo",namespace:"http://jabber.org/protocol/disco#info",element:"query",fields:{node:r.attribute("node"),identities:{get:function(){var t=[],e=r.find(this.xml,this._NS,"identity");return e.forEach(function(e){t.push({category:r.getAttribute(e,"category"),type:r.getAttribute(e,"type"),lang:e.getAttributeNS(r.XML_NS,"lang"),name:r.getAttribute(e,"name")})}),t},set:function(t){var e=this,n=r.find(this.xml,this._NS,"identity");n.forEach(function(t){e.xml.removeChild(t)}),t.forEach(function(t){var n=document.createElementNS(e._NS,"identity");r.setAttribute(n,"category",t.category),r.setAttribute(n,"type",t.type),r.setAttribute(n,"name",t.name),t.lang&&n.setAttributeNS(r.XML_NS,"lang",t.lang),e.xml.appendChild(n)})}},features:{get:function(){var t=[],e=r.find(this.xml,this._NS,"feature");return e.forEach(function(e){t.push(e.getAttribute("var"))}),t},set:function(t){var e=this,n=r.find(this.xml,this._NS,"feature");n.forEach(function(t){e.xml.removeChild(t)}),t.forEach(function(t){var n=document.createElementNS(e._NS,"feature");n.setAttribute("var",t),e.xml.appendChild(n)})}}}}),n.DiscoItems=r.define({name:"discoItems",namespace:"http://jabber.org/protocol/disco#items",element:"query",fields:{node:r.attribute("node"),items:{get:function(){var t=[],e=r.find(this.xml,this._NS,"item");return e.forEach(function(e){t.push({jid:new i(r.getAttribute(e,"jid")),node:r.getAttribute(e,"node"),name:r.getAttribute(e,"name")})}),t},set:function(t){var e=this,n=r.find(this.xml,this._NS,"item");n.forEach(function(t){e.xml.removeChild(t)}),t.forEach(function(t){var n=document.createElementNS(e._NS,"item");r.setAttribute(n,"jid",t.jid.toString()),r.setAttribute(n,"node",t.node),r.setAttribute(n,"name",t.name),e.xml.appendChild(n)})}}}}),r.extend(o,n.DiscoInfo),r.extend(o,n.DiscoItems),r.extend(n.DiscoItems,a),r.extend(n.DiscoInfo,s,"extensions")},{"../jid":3,"./dataforms":29,"./iq":35,"./rsm":44,jxt:77,underscore:96}],32:[function(t,e){t("underscore");var n=t("jxt"),r=t("./util"),i=t("./message"),o=t("./presence"),a=t("./iq"),s="urn:ietf:params:xml:ns:xmpp-stanzas",u=["bad-request","conflict","feature-not-implemented","forbidden","gone","internal-server-error","item-not-found","jid-malformed","not-acceptable","not-allowed","not-authorized","payment-required","recipient-unavailable","redirect","registration-required","remote-server-not-found","remote-server-timeout","resource-constraint","service-unavailable","subscription-required","undefined-condition","unexpected-request"],c=e.exports=n.define({name:"error",namespace:"jabber:client",element:"error",fields:{lang:{get:function(){return(this.parent||{}).lang||""}},condition:{get:function(){var t=this,e=[];return u.forEach(function(r){var i=n.find(t.xml,s,r);i.length&&e.push(i[0].tagName)}),e[0]||""},set:function(t){var e=this;if(u.forEach(function(t){var r=n.find(e.xml,e._ERR_NS,t);r.length&&e.xml.removeChild(r[0])}),t){var r=document.createElementNS(this._ERR_NS,t);r.setAttribute("xmlns",this._ERR_NS),this.xml.appendChild(r)}}},gone:{get:function(){return n.getSubText(this.xml,s,"gone")},set:function(t){this.condition="gone",n.setSubText(this.xml,s,"gone",t)}},redirect:{get:function(){return n.getSubText(this.xml,s,"redirect")},set:function(t){this.condition="redirect",n.setSubText(this.xml,s,"redirect",t)}},code:n.attribute("code"),type:n.attribute("type"),by:r.jidAttribute("by"),$text:{get:function(){return n.getSubLangText(this.xml,s,"text",this.lang)}},text:{get:function(){var t=this.$text;return t[this.lang]||""},set:function(t){n.setSubLangText(this.xml,s,"text",t,this.lang)}}}});n.extend(i,c),n.extend(o,c),n.extend(a,c)},{"./iq":35,"./message":37,"./presence":39,"./util":52,jxt:77,underscore:96}],33:[function(t,e){var n=t("jxt"),r=t("./message"),i=t("./presence"),o=t("./iq"),a=t("./delayed"),s=e.exports=n.define({name:"forwarded",eventName:"forward",namespace:"urn:xmpp:forward:0",element:"forwarded"});n.extend(r,s),n.extend(s,r),n.extend(s,i),n.extend(s,o),n.extend(s,a)},{"./delayed":30,"./iq":35,"./message":37,"./presence":39,jxt:77}],34:[function(t,e){var n=t("jxt"),r=t("./util"),i=t("./presence"),o=e.exports=n.define({name:"idle",namespace:"urn:xmpp:idle:0",element:"idle",fields:{since:r.dateAttribute("since")}});n.extend(i,o)},{"./presence":39,"./util":52,jxt:77}],35:[function(t,e){var n=t("jxt"),r=t("./util"),i=e.exports=n.define({name:"iq",namespace:"jabber:client",element:"iq",topLevel:!0,fields:{lang:r.langAttribute(),id:n.attribute("id"),to:r.jidAttribute("to"),from:r.jidAttribute("from"),type:n.attribute("type")}});
i.prototype.resultReply=function(t){return t.to=this.from,t.id=this.id,t.type="result",new i(t)},i.prototype.errorReply=function(t){return t.to=this.from,t.id=this.id,t.type="error",new i(t)}},{"./util":52,jxt:77}],36:[function(t,e,n){var r=t("jxt"),i=t("./util"),o=t("./message"),a=t("./iq"),s=t("./forwarded"),u=t("./rsm"),c=t("../jid");n.MAMQuery=r.define({name:"mamQuery",namespace:"urn:xmpp:mam:tmp",element:"query",fields:{queryid:r.attribute("queryid"),start:i.dateSub("urn:xmpp:mam:tmp","start"),end:i.dateSub("urn:xmpp:mam:tmp","end"),"with":i.jidSub("urn:xmpp:mam:tmp","with")}}),n.Result=r.define({name:"mam",eventName:"mam:result",namespace:"urn:xmpp:mam:tmp",element:"result",fields:{queryid:r.attribute("queryid"),id:r.attribute("id")}}),n.Archived=r.define({name:"mamArchived",namespace:"urn:xmpp:mam:tmp",element:"archived",fields:{by:i.jidAttribute("by"),id:r.attribute("id")}}),n.Prefs=r.define({name:"mamPrefs",namespace:"urn:xmpp:mam:tmp",element:"prefs",fields:{defaultCondition:r.attribute("default"),always:{get:function(){var t=[],e=r.find(this.xml,this._NS,"always");if(0===e.length)return t;e=e[0];var n=r.getMultiSubText(e,this._NS,"jid");return n.forEach(function(e){t.push(new c(e.textContent))}),t},set:function(t){if(t.length>0){var e=r.find(this.xml,this._NS,"always");r.setMultiSubText(e,this._NS,"jid",t)}}},never:{get:function(){var t=[],e=r.find(this.xml,this._NS,"always");if(0===e.length)return t;e=e[0];var n=r.getMultiSubText(e,this._NS,"jid");return n.forEach(function(e){t.push(new c(e.textContent))}),t},set:function(t){if(t.length>0){var e=r.find(this.xml,this._NS,"never");r.setMultiSubText(e,this._NS,"jid",t)}}}}}),r.extend(o,n.Archived,"archived"),r.extend(a,n.MAMQuery),r.extend(a,n.Prefs),r.extend(o,n.Result),r.extend(n.Result,s),r.extend(n.MAMQuery,u)},{"../jid":3,"./forwarded":33,"./iq":35,"./message":37,"./rsm":44,"./util":52,jxt:77}],37:[function(t,e){t("underscore");var n=t("jxt"),r=t("./util");e.exports=n.define({name:"message",namespace:"jabber:client",element:"message",topLevel:!0,fields:{lang:r.langAttribute(),id:n.attribute("id"),to:r.jidAttribute("to"),from:r.jidAttribute("from"),type:n.attribute("type","normal"),thread:n.subText("jabber:client","thread"),parentThread:n.subAttribute("jabber:client","thread","parent"),$body:{get:function(){return n.getSubLangText(this.xml,this._NS,"body",this.lang)}},body:{get:function(){var t=this.$body;return t[this.lang]||""},set:function(t){n.setSubLangText(this.xml,this._NS,"body",t,this.lang)}},attention:n.boolSub("urn:xmpp:attention:0","attention"),replace:n.subAttribute("urn:xmpp:message-correct:0","replace","id")}})},{"./util":52,jxt:77,underscore:96}],38:[function(t,e,n){var r=t("jxt");t("./message");var i=t("./presence");t("./iq");var o="http://jabber.org/protocol/muc";n.MUCJoin=r.define({name:"joinMuc",namespace:o,element:"x",fields:{password:r.subText(o,"password"),history:{get:function(){var t={},e=r.find(this.xml,this._NS,"history");if(!e.length)return{};e=e[0];var n=e.getAttribute("maxchars")||"",i=e.getAttribute("maxstanas")||"",o=e.getAttribute("seconds")||"",a=e.getAttribute("since")||"";n&&(t.maxchars=parseInt(n,10)),i&&(t.maxstanzas=parseInt(i,10)),o&&(t.seconds=parseInt(o,10)),a&&(t.since=new Date(a))},set:function(t){var e=r.find(this.xml,this._NS,"history");if(e.length)for(var n=0;n<e.length;n++)this.xml.removeChild(e[n]);var i=document.createElementNS(this._NS,"history");this.xml.appendChild(i),t.maxchars&&i.setAttribute(""+t.maxchars),t.maxstanzas&&i.setAttribute(""+t.maxstanzas),t.seconds&&i.setAttribute(""+t.seconds),t.since&&i.setAttribute(t.since.toISOString())}}}}),r.extend(i,n.MUCJoin)},{"./iq":35,"./message":37,"./presence":39,jxt:77}],39:[function(t,e){t("underscore");var n=t("jxt"),r=t("./util");e.exports=n.define({name:"presence",namespace:"jabber:client",element:"presence",topLevel:!0,fields:{lang:r.langAttribute(),id:n.attribute("id"),to:r.jidAttribute("to"),from:r.jidAttribute("from"),priority:n.subText("jabber:client","priority","0"),show:n.subText("jabber:client","show"),type:{get:function(){return n.getAttribute(this.xml,"type","available")},set:function(t){"available"===t&&(t=!1),n.setAttribute(this.xml,"type",t)}},$status:{get:function(){return n.getSubLangText(this.xml,this._NS,"status",this.lang)}},status:{get:function(){var t=this.$status;return t[this.lang]||""},set:function(t){n.setSubLangText(this.xml,this._NS,"status",t,this.lang)}}}})},{"./util":52,jxt:77,underscore:96}],40:[function(t,e){var n=t("jxt"),r=t("./iq"),i=e.exports=n.define({name:"privateStorage",namespace:"jabber:iq:private",element:"query"});n.extend(r,i)},{"./iq":35,jxt:77}],41:[function(t,e,n){var r=t("underscore"),i=t("jxt"),o=t("./util"),a=t("./iq"),s=t("./message"),u=t("./dataforms").DataForm,c=t("./rsm");t("../jid");var f="http://jabber.org/protocol/pubsub",l="http://jabber.org/protocol/pubsub#owner",p="http://jabber.org/protocol/pubsub#event";n.Pubsub=i.define({name:"pubsub",namespace:"http://jabber.org/protocol/pubsub",element:"pubsub",fields:{publishOptions:{get:function(){var t=i.find(this.xml,this._NS,"publish-options");return t.length&&t[0].childNodes.length?new u({},t[0].childNodes[0]):void 0},set:function(t){var e=i.findOrCreate(this.xml,this._NS,"publish-options");if(t){var n=new u(t);e.appendChild(n.xml)}}}}}),n.PubsubOwner=i.define({name:"pubsubOwner",namespace:l,element:"pubsub",fields:{create:i.subAttribute(l,"create","node"),purge:i.subAttribute(l,"purge","node"),del:i.subAttribute(l,"delete","node"),redirect:{get:function(){var t=i.find(this.xml,this._NS,"delete");return t.length?i.getSubAttribute(t,this._NS,"redirect","uri"):""},set:function(t){var e=i.findOrCreate(this.xml,this._NS,"delete");i.setSubAttribute(e,this._NS,"redirect","uri",t)}}}}),n.Configure=i.define({name:"config",namespace:l,element:"configure",fields:{node:i.attribute("node")}}),n.Event=i.define({name:"event",namespace:p,element:"event"}),n.Subscribe=i.define({name:"subscribe",namespace:f,element:"subscribe",fields:{node:i.attribute("node"),jid:o.jidAttribute("jid")}}),n.Subscription=i.define({name:"subscription",namespace:f,element:"subscription",fields:{node:i.attribute("node"),jid:o.jidAttribute("jid"),subid:i.attribute("subid"),type:i.attribute("subscription")}}),n.Unsubscribe=i.define({name:"unsubscribe",namespace:f,element:"unsubscribe",fields:{node:i.attribute("node"),jid:o.jidAttribute("jid")}}),n.Publish=i.define({name:"publish",namespace:f,element:"publish",fields:{node:i.attribute("node")}}),n.Retract=i.define({name:"retract",namespace:f,element:"retract",fields:{node:i.attribute("node"),notify:i.boolAttribute("notify"),id:i.subAttribute(f,"item","id")}}),n.Retrieve=i.define({name:"retrieve",namespace:f,element:"items",fields:{node:i.attribute("node"),max:i.attribute("max_items")}}),n.Item=i.define({name:"item",namespace:f,element:"item",fields:{id:i.attribute("id")}}),n.EventItems=i.define({name:"updated",namespace:p,element:"items",fields:{node:i.attribute("node"),retracted:{get:function(){var t=[],e=i.find(this.xml,this._NS,"retract");return r.forEach(e,function(e){t.push(e.getAttribute("id"))}),t},set:function(t){var e=this;r.forEach(t,function(t){var n=document.createElementNS(e._NS,"retract");n.setAttribute("id",t),this.xml.appendChild(n)})}}}}),n.EventItem=i.define({name:"eventItem",namespace:p,element:"item",fields:{id:i.attribute("id"),node:i.attribute("node"),publisher:o.jidAttribute("publisher")}}),i.extend(n.Pubsub,n.Subscribe),i.extend(n.Pubsub,n.Unsubscribe),i.extend(n.Pubsub,n.Publish),i.extend(n.Pubsub,n.Retrieve),i.extend(n.Pubsub,n.Subscription),i.extend(n.PubsubOwner,n.Configure),i.extend(n.Publish,n.Item,"items"),i.extend(n.Retrieve,n.Item,"items"),i.extend(n.Configure,u),i.extend(n.Pubsub,c),i.extend(n.Event,n.EventItems),i.extend(n.EventItems,n.EventItem,"published"),i.extend(s,n.Event),i.extend(a,n.Pubsub),i.extend(a,n.PubsubOwner)},{"../jid":3,"./dataforms":29,"./iq":35,"./message":37,"./rsm":44,"./util":52,jxt:77,underscore:96}],42:[function(t,e){var n=t("jxt"),r=t("./message");n.add(r,"requestReceipt",n.boolSub("urn:xmpp:receipts","request"));var i=e.exports=n.define({name:"receipt",namespace:"urn:xmpp:receipts",element:"receipt",fields:{id:n.attribute("id")}});n.extend(r,i)},{"./message":37,jxt:77}],43:[function(t,e){t("underscore");var n=t("jxt"),r=t("./iq"),i=t("../jid"),o=e.exports=n.define({name:"roster",namespace:"jabber:iq:roster",element:"query",fields:{ver:{get:function(){return n.getAttribute(this.xml,"ver")},set:function(t){var e=""===t;n.setAttribute(this.xml,"ver",t,e)}},items:{get:function(){var t=this,e=n.find(this.xml,this._NS,"item");if(!e.length)return[];var r=[];return e.forEach(function(e){var o={jid:new i(n.getAttribute(e,"jid","")),name:n.getAttribute(e,"name",void 0),subscription:n.getAttribute(e,"subscription","none"),ask:n.getAttribute(e,"ask",void 0),groups:[]},a=n.find(e,t._NS,"group");a.forEach(function(t){o.groups.push(t.textContent)}),r.push(o)}),r},set:function(t){var e=this;t.forEach(function(t){var r=document.createElementNS(e._NS,"item");n.setAttribute(r,"jid",t.jid.toString()),n.setAttribute(r,"name",t.name),n.setAttribute(r,"subscription",t.subscription),n.setAttribute(r,"ask",t.ask),(t.groups||[]).forEach(function(t){var n=document.createElementNS(e._NS,"group");n.textContent=t,r.appendChild(n)}),e.xml.appendChild(r)})}}}});n.extend(r,o)},{"../jid":3,"./iq":35,jxt:77,underscore:96}],44:[function(t,e){var n=t("jxt"),r=t("./util"),i="http://jabber.org/protocol/rsm";e.exports=n.define({name:"rsm",namespace:i,element:"set",fields:{after:n.subText(i,"after"),before:{get:function(){return n.getSubText(this.xml,this._NS,"before")},set:function(t){t===!0?n.findOrCreate(this.xml,this._NS,"before"):n.setSubText(this.xml,this._NS,"before",t)}},count:r.numberSub(i,"count"),first:n.subText(i,"first"),firstIndex:n.subAttribute(i,"first","index"),index:n.subText(i,"index"),last:n.subText(i,"last"),max:n.subText(i,"max")}})},{"./util":52,jxt:77}],45:[function(t,e,n){t("underscore");var r=t("jxt"),i=t("./util"),o=t("./streamFeatures"),a="urn:ietf:params:xml:ns:xmpp-sasl",s=["aborted","account-disabled","credentials-expired","encryption-required","incorrect-encoding","invalid-authzid","invalid-mechanism","malformed-request","mechanism-too-weak","not-authorized","temporary-auth-failure"];n.Mechanisms=r.define({name:"sasl",namespace:a,element:"mechanisms",fields:{mechanisms:r.multiSubText(a,"mechanism")}}),n.Auth=r.define({name:"saslAuth",eventName:"sasl:auth",namespace:a,element:"auth",topLevel:!0,fields:{value:i.b64Text(),mechanism:r.attribute("mechanism")}}),n.Challenge=r.define({name:"saslChallenge",eventName:"sasl:challenge",namespace:a,element:"challenge",topLevel:!0,fields:{value:i.b64Text()}}),n.Response=r.define({name:"saslResponse",eventName:"sasl:response",namespace:a,element:"response",topLevel:!0,fields:{value:i.b64Text()}}),n.Abort=r.define({name:"saslAbort",eventName:"sasl:abort",namespace:a,element:"abort",topLevel:!0}),n.Success=r.define({name:"saslSuccess",eventName:"sasl:success",namespace:a,element:"success",topLevel:!0,fields:{value:i.b64Text()}}),n.Failure=r.define({name:"saslFailure",eventName:"sasl:failure",namespace:a,element:"failure",topLevel:!0,fields:{lang:{get:function(){return this._lang||""},set:function(t){this._lang=t}},condition:{get:function(){var t=this,e=[];return s.forEach(function(n){var i=r.find(t.xml,a,n);i.length&&e.push(i[0].tagName)}),e[0]||""},set:function(t){var e=this;if(this._CONDITIONS.forEach(function(t){var n=r.find(e.xml,a,t);n.length&&e.xml.removeChild(n[0])}),t){var n=r.createElementNS(a,t);n.setAttribute("xmlns",a),this.xml.appendChild(n)}}},$text:{get:function(){return r.getSubLangText(this.xml,a,"text",this.lang)}},text:{get:function(){var t=this.$text;return t[this.lang]||""},set:function(t){r.setSubLangText(this.xml,a,"text",t,this.lang)}}}}),r.extend(o,n.Mechanisms)},{"./streamFeatures":50,"./util":52,jxt:77,underscore:96}],46:[function(t,e){var n=t("jxt"),r=t("./iq"),i=t("./streamFeatures"),o=e.exports=n.define({name:"session",namespace:"urn:ietf:params:xml:ns:xmpp-session",element:"session"});n.extend(i,o),n.extend(r,o)},{"./iq":35,"./streamFeatures":50,jxt:77}],47:[function(t,e,n){var r=t("jxt"),i=t("./util"),o=t("./streamFeatures"),a="urn:xmpp:sm:3";n.SMFeature=r.define({name:"streamManagement",namespace:a,element:"sm"}),n.Enable=r.define({name:"smEnable",eventName:"stream:management:enable",namespace:a,element:"enable",topLevel:!0,fields:{resume:r.boolAttribute("resume")}}),n.Enabled=r.define({name:"smEnabled",eventName:"stream:management:enabled",namespace:a,element:"enabled",topLevel:!0,fields:{id:r.attribute("id"),resume:r.boolAttribute("resume")}}),n.Resume=r.define({name:"smResume",eventName:"stream:management:resume",namespace:a,element:"resume",topLevel:!0,fields:{h:i.numberAttribute("h","0"),previd:r.attribute("previd")}}),n.Resumed=r.define({name:"smResumed",eventName:"stream:management:resumed",namespace:a,element:"resumed",topLevel:!0,fields:{h:i.numberAttribute("h","0"),previd:r.attribute("previd")}}),n.Failed=r.define({name:"smFailed",eventName:"stream:management:failed",namespace:a,element:"failed",topLevel:!0}),n.Ack=r.define({name:"smAck",eventName:"stream:management:ack",namespace:a,element:"a",topLevel:!0,fields:{h:i.numberAttribute("h","0")}}),n.Request=r.define({name:"smRequest",eventName:"stream:management:request",namespace:a,element:"r",topLevel:!0}),r.extend(o,n.SMFeature)},{"./streamFeatures":50,"./util":52,jxt:77}],48:[function(t,e){var n=t("jxt"),r=t("./util");e.exports=n.define({name:"stream",namespace:"http://etherx.jabber.org/streams",element:"stream",fields:{lang:{get:function(){return this.xml.getAttributeNS(n.XML_NS,"lang")||""},set:function(t){this.xml.setAttributeNS(n.XML_NS,"lang",t)}},id:n.attribute("id"),version:n.attribute("version","1.0"),to:r.jidAttribute("to"),from:r.jidAttribute("from")}})},{"./util":52,jxt:77}],49:[function(t,e){t("underscore");var n=t("jxt"),r="urn:ietf:params:xml:ns:xmpp-streams",i=["bad-format","bad-namespace-prefix","conflict","connection-timeout","host-gone","host-unknown","improper-addressing","internal-server-error","invalid-from","invalid-namespace","invalid-xml","not-authorized","not-well-formed","policy-violation","remote-connection-failed","reset","resource-constraint","restricted-xml","see-other-host","system-shutdown","undefined-condition","unsupported-encoding","unsupported-feature","unsupported-stanza-type","unsupported-version"];e.exports=n.define({name:"streamError",namespace:"http://etherx.jabber.org/streams",element:"error",topLevel:!0,fields:{lang:{get:function(){return this._lang||""},set:function(t){this._lang=t}},condition:{get:function(){var t=this,e=[];return i.forEach(function(i){var o=n.find(t.xml,r,i);o.length&&e.push(o[0].tagName)}),e[0]||""},set:function(t){var e=this;if(this._CONDITIONS.forEach(function(t){var i=n.find(e.xml,r,t);i.length&&e.xml.removeChild(i[0])}),t){var i=n.createElementNS(r,t);i.setAttribute("xmlns",r),this.xml.appendChild(i)}}},seeOtherHost:{get:function(){return n.getSubText(this.xml,r,"see-other-host")},set:function(t){this.condition="see-other-host",n.setSubText(this.xml,r,"see-other-host",t)}},$text:{get:function(){return n.getSubLangText(this.xml,r,"text",this.lang)}},text:{get:function(){var t=this.$text;return t[this.lang]||""},set:function(t){n.setSubLangText(this.xml,r,"text",t,this.lang)}}}})},{jxt:77,underscore:96}],50:[function(t,e){var n=t("jxt"),r=e.exports=n.define({name:"streamFeatures",namespace:"http://etherx.jabber.org/streams",element:"features",topLevel:!0,fields:{features:{get:function(){return this._extensions}}}}),i=n.define({name:"rosterVersioning",namespace:"urn:xmpp:features:rosterver",element:"ver"}),o=n.define({name:"subscriptionPreApproval",namespace:"urn:xmpp:features:pre-approval",element:"sub"});n.extend(r,i),n.extend(r,o)},{jxt:77}],51:[function(t,e){var n=t("jxt"),r=t("./util"),i=t("./iq"),o=e.exports=n.define({name:"time",namespace:"urn:xmpp:time",element:"time",fields:{utc:r.dateSub("urn:xmpp:time","utc"),tzo:{get:function(){var t,e,r,i=-1,o=n.getSubText(this.xml,this._NS,"tzo");return o?("-"===o.charAt(0)&&(i=1,o=o.slice(1)),t=o.split(":"),e=parseInt(t[0],10),r=parseInt(t[1],10),(60*e+r)*i):0},set:function(t){var e,r,i="-";"number"==typeof t?(0>t&&(t=-t,i="+"),e=t/60,r=t%60,i+=(10>e?"0":"")+e+":"+(10>r?"0":"")+r):i=t,n.setSubText(this.xml,this._NS,"tzo",i)}}}});n.extend(i,o)},{"./iq":35,"./util":52,jxt:77}],52:[function(t,e,n){var r=t("jxt"),i=t("../jid"),o="http://www.w3.org/XML/1998/namespace";n.langAttribute=r.field(function(t){return t.getAttributeNS(o,"lang")||""},function(t,e){t.setAttributeNS(o,"lang",e)}),n.jidAttribute=r.field(function(t,e){return new i(r.getAttribute(t,e))},function(t,e,n){r.setAttribute(t,e,(n||"").toString())}),n.jidSub=r.field(function(t,e,n){return new i(r.getSubText(t,e,n))},function(t,e,n,i){r.setSubText(t,e,n,(i||"").toString())}),n.b64Text=r.field(function(t){return t.textContent&&"="!=t.textContent?atob(t.textContent):""},function(t,e){t.textContent=btoa(e)||"="}),n.dateAttribute=r.field(function(t,e){return new Date(r.getAttribute(t,e)||Date.now())},function(t,e,n){n&&r.setAttribute(t,e,n.toISOString())}),n.dateSub=r.field(function(t,e,n){return new Date(r.getSubText(t,e,n)||Date.now())},function(t,e,n,i){i&&r.setSubText(t,e,n,i.toISOString())}),n.numberAttribute=r.field(function(t,e,n){return parseInt(r.getAttribute(t,e,n),10)},function(t,e,n){r.setAttribute(t,e,n.toString())}),n.numberSub=r.field(function(t,e,n,i){return parseInt(r.getSubText(t,e,n,i),10)},function(t,e,n,i){r.setSubText(t,e,n,i.toString())})},{"../jid":3,jxt:77}],53:[function(t,e){var n=t("jxt"),r=t("./iq"),i="jabber:iq:version",o=e.exports=n.define({name:"version",namespace:i,element:"query",fields:{name:n.subText(i,"name"),version:n.subText(i,"version"),os:n.subText(i,"os")}});n.extend(r,o)},{"./iq":35,jxt:77}],54:[function(t){var e=t("jxt"),n=t("./iq");e.add(n,"visible",e.boolSub("urn:xmpp:invisible:0","visible")),e.add(n,"invisible",e.boolSub("urn:xmpp:invisible:0","invisible"))},{"./iq":35,jxt:77}],55:[function(t,e){function n(){function t(t){var e=[n.streamStart,t,n.streamEnd].join("");return e}function e(t){for(var e=n.parser.parseFromString(t,"application/xml").childNodes,r=0;r<e.length;r++)if(1===e[r].nodeType)return e[r]}var n=this;i.call(this),n.sm=new s(n),n.sendQueue=o.queue(function(t,e){n.conn&&(n.emit("raw:outgoing",t),n.sm.track(t),"string"!=typeof t&&(t=t.toString()),n.conn.send(t)),e()},1),n.on("connected",function(){n.send(["<stream:stream",'xmlns:stream="http://etherx.jabber.org/streams"','xmlns="jabber:client"','version="'+(n.config.version||"1.0")+'"','xml:lang="'+(n.config.lang||"en")+'"','to="'+n.config.server+'">'].join(" "))}),n.on("raw:incoming",function(i){var o,s;if(i=i.trim(),i=i.replace(/^(\s*<\?.*\?>\s*)*/,""),""!==i){if(i.match(n.streamEnd))return n.disconnect();if(n.hasStream)try{o=new a({},e(t(i)))}catch(u){return n.disconnect()}else{var c=i.match(/^<(\S+:)?(\S+) /);n.streamStart=i,n.streamEnd="</"+(c[1]||"")+c[2]+">",s=!1;try{o=new a({},e(i+n.streamEnd))}catch(u){try{o=new a({},e(i)),s=!0}catch(f){return n.disconnect()}}n.hasStream=!0,n.stream=o,n.emit("stream:start",o)}r.each(o._extensions,function(t){t.lang||(t.lang=n.stream.lang),("message"===t._name||"presence"===t._name||"iq"===t._name)&&(n.sm.handle(t),n.emit("stanza",t)),n.emit(t._eventname||t._name,t),n.emit("stream:data",t),t.id&&n.emit("id:"+t.id,t)}),s&&n.emit("stream:end")}})}var r=t("underscore"),i=t("wildemitter"),o=t("async"),a=t("./stanza/stream");t("./stanza/message"),t("./stanza/presence"),t("./stanza/iq");var s=t("./sm");t("node-uuid"),n.prototype=Object.create(i.prototype,{constructor:{value:n}}),n.prototype.connect=function(t){var e=this;e.config=t,e.hasStream=!1,e.streamStart='<stream:stream xmlns:stream="http://etherx.jabber.org/streams">',e.streamEnd="</stream:stream>",e.parser=new DOMParser,e.serializer=new XMLSerializer,e.conn=new WebSocket(t.wsURL,"xmpp"),e.conn.onerror=function(t){return t.preventDefault(),e.emit("disconnected",e),!1},e.conn.onclose=function(){e.emit("disconnected",e)},e.conn.onopen=function(){e.sm.started=!1,e.emit("connected",e)},e.conn.onmessage=function(t){e.emit("raw:incoming",t.data)}},n.prototype.disconnect=function(){this.conn&&(this.hasStream&&(this.conn.send("</stream:stream>"),this.emit("raw:outgoing","</stream:stream>"),this.emit("stream:end")),this.hasStream=!1,this.conn.close(),this.stream=void 0,this.conn=void 0,this.sm.failed())},n.prototype.restart=function(){var t=this;t.hasStream=!1,t.send(["<stream:stream",'xmlns:stream="http://etherx.jabber.org/streams"','xmlns="jabber:client"','version="'+(t.config.version||"1.0")+'"','xml:lang="'+(t.config.lang||"en")+'"','to="'+t.config.server+'">'].join(" "))},n.prototype.send=function(t){this.sendQueue.push(t)},e.exports=n},{"./sm":22,"./stanza/iq":35,"./stanza/message":37,"./stanza/presence":39,"./stanza/stream":48,async:56,"node-uuid":82,underscore:96,wildemitter:97}],56:[function(e,n){var r=e("__browserify_process");!function(){function e(t){var e=!1;return function(){if(e)throw new Error("Callback was already called.");e=!0,t.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var s=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)return t.map(e);var n=[];return s(t,function(t,r,i){n.push(e(t,r,i))}),n},c=function(t,e,n){return t.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},f=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e};"undefined"!=typeof r&&r.nextTick?(a.nextTick=r.nextTick,a.setImmediate="undefined"!=typeof setImmediate?setImmediate:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,n,r){if(r=r||function(){},!t.length)return r();var i=0;s(t,function(o){n(o,e(function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length&&r(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)return n();var r=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){var i=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(e,n,r){if(r=r||function(){},!e.length||0>=t)return r();var i=0,o=0,a=0;!function s(){if(i>=e.length)return r();for(;t>a&&o<e.length;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})}()}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(e))}},h=function(t,e){return function(){var n=Array.prototype.slice.call(arguments);return e.apply(null,[l(t)].concat(n))}},d=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(e))}},m=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=p(m),a.mapSeries=d(m),a.mapLimit=function(t,e,n,r){return g(e)(t,n,r)};var g=function(t){return h(t,m)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){var i=u(t,function(t){return t}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;var v=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.filter=p(v),a.filterSeries=d(v),a.select=a.filter,a.selectSeries=a.filterSeries;var y=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.reject=p(y),a.rejectSeries=d(y);var b=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=p(b),a.detectSeries=d(b),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},function(){n(!1)})},a.any=a.some,a.every=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t||(n(!1),n=function(){}),r()})},function(){n(!0)})},a.all=a.every,a.sortBy=function(t,e,n){a.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){if(t)return n(t);var r=function(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0};n(null,u(e.sort(r),function(t){return t.value}))})},a.auto=function(t,e){e=e||function(){};var n=f(t);if(!n.length)return e(null);var r={},i=[],o=function(t){i.unshift(t)},u=function(t){for(var e=0;e<i.length;e+=1)if(i[e]===t)return i.splice(e,1),void 0},l=function(){s(i.slice(0),function(t){t()})};o(function(){f(r).length===n.length&&(e(null,r),e=function(){})}),s(n,function(n){var i=t[n]instanceof Function?[t[n]]:t[n],p=function(t){var i=Array.prototype.slice.call(arguments,1);if(i.length<=1&&(i=i[0]),t){var o={};s(f(r),function(t){o[t]=r[t]}),o[n]=i,e(t,o),e=function(){}}else r[n]=i,a.setImmediate(l)},h=i.slice(0,Math.abs(i.length-1))||[],d=function(){return c(h,function(t,e){return t&&r.hasOwnProperty(e)},!0)&&!r.hasOwnProperty(n)};if(d())i[i.length-1](p,r);else{var m=function(){d()&&(u(m),i[i.length-1](p,r))};o(m)}})},a.waterfall=function(t,e){if(e=e||function(){},t.constructor!==Array){var n=new Error("First argument to waterfall must be an array of functions");return e(n)}if(!t.length)return e();var r=function(t){return function(n){if(n)e.apply(null,arguments),e=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=t.next();o?i.push(r(o)):i.push(e),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var x=function(t,e,n){if(n=n||function(){},e.constructor===Array)t.map(e,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),e.call(null,t,n)})},n);else{var r={};t.each(f(e),function(t,n){e[t](function(e){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),r[t]=i,n(e)})},function(t){n(t,r)})}};a.parallel=function(t,e){x({map:a.map,each:a.each},t,e)},a.parallelLimit=function(t,e,n){x({map:g(e),each:l(e)},t,n)},a.series=function(t,e){if(e=e||function(){},t.constructor===Array)a.mapSeries(t,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);n.length<=1&&(n=n[0]),e.call(null,t,n)})},e);else{var n={};a.eachSeries(f(t),function(e,r){t[e](function(t){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),n[e]=i,r(t)})},function(t){e(t,n)})}},a.iterator=function(t){var e=function(n){var r=function(){return t.length&&t[n].apply(null,arguments),r.next()};return r.next=function(){return n<t.length-1?e(n+1):null},r};return e(0)},a.apply=function(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e.concat(Array.prototype.slice.call(arguments)))}};var w=function(t,e,n,r){var i=[];t(e,function(t,e){n(t,function(t,n){i=i.concat(n||[]),e(t)})},function(t){r(t,i)})};a.concat=p(w),a.concatSeries=d(w),a.whilst=function(t,e,n){t()?e(function(r){return r?n(r):(a.whilst(t,e,n),void 0)}):n()},a.doWhilst=function(t,e,n){t(function(r){return r?n(r):(e()?a.doWhilst(t,e,n):n(),void 0)})},a.until=function(t,e,n){t()?n():e(function(r){return r?n(r):(a.until(t,e,n),void 0)})},a.doUntil=function(t,e,n){t(function(r){return r?n(r):(e()?n():a.doUntil(t,e,n),void 0)})},a.queue=function(t,n){function r(t,e,r,i){e.constructor!==Array&&(e=[e]),s(e,function(e){var o={data:e,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===n&&t.saturated(),a.setImmediate(t.process)})}void 0===n&&(n=1);var i=0,o={tasks:[],concurrency:n,saturated:null,empty:null,drain:null,push:function(t,e){r(o,t,!1,e)},unshift:function(t,e){r(o,t,!0,e)},process:function(){if(i<o.concurrency&&o.tasks.length){var n=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var r=function(){i-=1,n.callback&&n.callback.apply(n,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},a=e(r);t(n.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,e){var n=!1,r=[],i={tasks:r,payload:e,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),s(t,function(t){r.push({data:t,callback:"function"==typeof n?n:null}),i.saturated&&r.length===e&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&i.drain(),void 0;var a="number"==typeof e?r.splice(0,e):r.splice(0),c=u(a,function(t){return t.data});i.empty&&i.empty(),n=!0,t(c,function(){n=!1;var t=arguments;s(a,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var _=function(t){return function(e){var n=Array.prototype.slice.call(arguments,1);e.apply(null,n.concat([function(e){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&s(n,function(e){console[t](e)}))}]))}};a.log=_("log"),a.dir=_("dir"),a.memoize=function(t,e){var n={},r={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in n?o.apply(null,n[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){n[a]=arguments;var t=r[a];delete r[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=n,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,e,n)},a.timesSeries=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,e,n)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var e=this,n=Array.prototype.slice.call(arguments),r=n.pop();a.reduce(t,n,function(t,n,r){n.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);r(t,e)}]))},function(t,n){r.apply(e,[t].concat(n))})}};var E=function(t,e){var n=function(){var n=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(e,function(t,e){t.apply(n,r.concat([e]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};a.applyEach=p(E),a.applyEachSeries=d(E),a.forever=function(t,e){function n(r){if(r){if(e)return e(r);throw r}t(n)}n()},"undefined"!=typeof t&&t.amd?t([],function(){return a}):"undefined"!=typeof n&&n.exports?n.exports=a:i.async=a}()},{__browserify_process:69}],57:[function(t,e){function n(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}function r(t,e){return void 0===e?""+e:"number"!=typeof e||!isNaN(e)&&isFinite(e)?"function"==typeof e||e instanceof RegExp?e.toString():e:e.toString()}function i(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function o(t,e,n,r,i){throw new g.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function a(t,e){t||o(t,!0,e,"==",g.ok)}function s(t,e){if(t===e)return!0;if(d.isBuffer(t)&&d.isBuffer(e)){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():"object"!=typeof t&&"object"!=typeof e?t==e:f(t,e)}function u(t){return null===t||void 0===t}function c(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function f(t,e){if(u(t)||u(e))return!1;if(t.prototype!==e.prototype)return!1;if(c(t))return c(e)?(t=m.call(t),e=m.call(e),s(t,e)):!1;try{var r,i,o=n(t),a=n(e)
}catch(f){return!1}if(o.length!=a.length)return!1;for(o.sort(),a.sort(),i=o.length-1;i>=0;i--)if(o[i]!=a[i])return!1;for(i=o.length-1;i>=0;i--)if(r=o[i],!s(t[r],e[r]))return!1;return!0}function l(t,e){return t&&e?e instanceof RegExp?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,n,r){var i;"string"==typeof n&&(r=n,n=null);try{e()}catch(a){i=a}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o("Missing expected exception"+r),!t&&l(i,n)&&o("Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var h=t("util"),d=t("buffer").Buffer,m=Array.prototype.slice,g=e.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var e=t.stackStartFunction||o;Error.captureStackTrace&&Error.captureStackTrace(this,e)},h.inherits(g.AssertionError,Error),g.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",i(JSON.stringify(this.actual,r),128),this.operator,i(JSON.stringify(this.expected,r),128)].join(" ")},g.fail=o,g.ok=a,g.equal=function(t,e,n){t!=e&&o(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){s(t,e)||o(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){s(t,e)&&o(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",g.notStrictEqual)},g.throws=function(){p.apply(this,[!0].concat(m.call(arguments)))},g.doesNotThrow=function(){p.apply(this,[!1].concat(m.call(arguments)))},g.ifError=function(t){if(t)throw t}},{buffer:61,util:59}],58:[function(t,e,n){function r(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}var i=t("__browserify_process");i.EventEmitter||(i.EventEmitter=function(){});var o=n.EventEmitter=i.EventEmitter,a="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},s=10;o.prototype.setMaxListeners=function(t){this._events||(this._events={}),this._events.maxListeners=t},o.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||a(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(a(e)){for(var n=Array.prototype.slice.call(arguments,1),r=e.slice(),i=0,o=r.length;o>i;i++)r[i].apply(this,n);return!0}return!1},o.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(a(this._events[t])){if(!this._events[t].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:s,n&&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())}this._events[t].push(e)}else this._events[t]=[this._events[t],e];else this._events[t]=e;return this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(t,e){var n=this;return n.on(t,function r(){n.removeListener(t,r),e.apply(this,arguments)}),this},o.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var n=this._events[t];if(a(n)){var i=r(n,e);if(0>i)return this;n.splice(i,1),0==n.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},o.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},o.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),a(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]},o.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?"function"==typeof t._events[e]?1:t._events[e].length:0}},{__browserify_process:69}],59:[function(t,e,n){function r(t){return Array.isArray(t)||"object"==typeof t&&"[object Array]"===Object.prototype.toString.call(t)}function i(t){"object"==typeof t&&"[object RegExp]"===Object.prototype.toString.call(t)}function o(t){return"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}t("events"),n.isArray=r,n.isDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(t,e,u,c){function f(t,u){if(t&&"function"==typeof t.inspect&&t!==n&&(!t.constructor||t.constructor.prototype!==t))return t.inspect(u);switch(typeof t){case"undefined":return p("undefined","undefined");case"string":var c="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p(c,"string");case"number":return p(""+t,"number");case"boolean":return p(""+t,"boolean")}if(null===t)return p("null","null");var h=a(t),d=e?s(t):h;if("function"==typeof t&&0===d.length){if(i(t))return p(""+t,"regexp");var m=t.name?": "+t.name:"";return p("[Function"+m+"]","special")}if(o(t)&&0===d.length)return p(t.toUTCString(),"date");var g,v,y;if(r(t)?(v="Array",y=["[","]"]):(v="Object",y=["{","}"]),"function"==typeof t){var b=t.name?": "+t.name:"";g=i(t)?" "+t:" [Function"+b+"]"}else g="";if(o(t)&&(g=" "+t.toUTCString()),0===d.length)return y[0]+g+y[1];if(0>u)return i(t)?p(""+t,"regexp"):p("[Object]","special");l.push(t);var x=d.map(function(e){var n,i;if(t.__lookupGetter__&&(t.__lookupGetter__(e)?i=t.__lookupSetter__(e)?p("[Getter/Setter]","special"):p("[Getter]","special"):t.__lookupSetter__(e)&&(i=p("[Setter]","special"))),h.indexOf(e)<0&&(n="["+e+"]"),i||(l.indexOf(t[e])<0?(i=null===u?f(t[e]):f(t[e],u-1),i.indexOf("\n")>-1&&(i=r(t)?i.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+i.split("\n").map(function(t){return" "+t}).join("\n"))):i=p("[Circular]","special")),"undefined"==typeof n){if("Array"===v&&e.match(/^\d+$/))return i;n=JSON.stringify(""+e),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=p(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=p(n,"string"))}return n+": "+i});l.pop();var w=0,_=x.reduce(function(t,e){return w++,e.indexOf("\n")>=0&&w++,t+e.length+1},0);return x=_>50?y[0]+(""===g?"":g+"\n ")+" "+x.join(",\n ")+" "+y[1]:y[0]+g+" "+x.join(", ")+" "+y[1]}var l=[],p=function(t,e){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[e];return r?"["+n[r][0]+"m"+t+"["+n[r][1]+"m":t};return c||(p=function(t){return t}),f(t,"undefined"==typeof u?2:u)},n.log=function(){},n.pump=null;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.hasOwnProperty.call(t,n)&&e.push(n);return e},u=Object.create||function(t,e){var n;if(null===t)n={__proto__:null};else{if("object"!=typeof t)throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var r=function(){};r.prototype=t,n=new r,n.__proto__=t}return"undefined"!=typeof e&&Object.defineProperties&&Object.defineProperties(n,e),n};n.inherits=function(t,e){t.super_=e,t.prototype=u(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})};var c=/%[sdj%]/g;n.format=function(t){if("string"!=typeof t){for(var e=[],r=0;r<arguments.length;r++)e.push(n.inspect(arguments[r]));return e.join(" ")}for(var r=1,i=arguments,o=i.length,a=String(t).replace(c,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":return JSON.stringify(i[r++]);default:return t}}),s=i[r];o>r;s=i[++r])a+=null===s||"object"!=typeof s?" "+s:" "+n.inspect(s);return a}},{events:58}],60:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],61:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);this.parent=this,this.offset=0;var o;if("number"==typeof n)this.length=i(e),this.offset=n;else{switch(o=typeof t){case"number":this.length=i(t);break;case"string":this.length=r.byteLength(t,e);break;case"object":this.length=i(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(a(t))for(var s=0;s<this.length;s++)this[s]=t instanceof r?t.readUInt8(s):t[s];else if("string"==o)this.length=this.write(t,0,e);else if("number"===o)for(var s=0;s<this.length;s++)this[s]=0}}function i(t){return t=~~Math.ceil(+t),0>t?0:t}function o(t){return(Array.isArray||function(t){return"[object Array]"=={}.toString.apply(t)})(t)}function a(t){return o(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function s(t){return 16>t?"0"+t.toString(16):t.toString(16)}function u(t){for(var e=[],n=0;n<t.length;n++)if(t.charCodeAt(n)<=127)e.push(t.charCodeAt(n));else for(var r=encodeURIComponent(t.charAt(n)).substr(1).split("%"),i=0;i<r.length;i++)e.push(parseInt(r[i],16));return e}function c(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}function f(e){return t("base64-js").toByteArray(e)}function l(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function p(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function h(t,e,n,r){var i=0;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+1<t.length,"Trying to read beyond buffer length")),e>=t.length?0:(n?(i=t[e]<<8,e+1<t.length&&(i|=t[e+1])):(i=t[e],e+1<t.length&&(i|=t[e+1]<<8)),i)}function d(t,e,n,r){var i=0;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+3<t.length,"Trying to read beyond buffer length")),e>=t.length?0:(n?(e+1<t.length&&(i=t[e+1]<<16),e+2<t.length&&(i|=t[e+2]<<8),e+3<t.length&&(i|=t[e+3]),i+=t[e]<<24>>>0):(e+2<t.length&&(i=t[e+2]<<16),e+1<t.length&&(i|=t[e+1]<<8),i|=t[e],e+3<t.length&&(i+=t[e+3]<<24>>>0)),i)}function m(t,e,n,r){var i,o;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+1<t.length,"Trying to read beyond buffer length")),o=h(t,e,n,r),i=32768&o,i?-1*(65535-o+1):o}function g(t,e,n,r){var i,o;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+3<t.length,"Trying to read beyond buffer length")),o=d(t,e,n,r),i=2147483648&o,i?-1*(4294967295-o+1):o}function v(e,n,r,i){return i||(I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(n+3<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,23,4)}function y(e,n,r,i){return i||(I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(n+7<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,52,8)}function b(t,e){I.ok("number"==typeof t,"cannot write a non-number as a number"),I.ok(t>=0,"specified a negative value for writing an unsigned value"),I.ok(e>=t,"value is larger than maximum value for type"),I.ok(Math.floor(t)===t,"value has a fractional component")}function x(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+1<t.length,"trying to write beyond buffer length"),b(e,65535));for(var o=0;o<Math.min(t.length-n,2);o++)t[n+o]=(e&255<<8*(r?1-o:o))>>>8*(r?1-o:o)}function w(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+3<t.length,"trying to write beyond buffer length"),b(e,4294967295));for(var o=0;o<Math.min(t.length-n,4);o++)t[n+o]=255&e>>>8*(r?3-o:o)}function _(t,e,n){I.ok("number"==typeof t,"cannot write a non-number as a number"),I.ok(e>=t,"value larger than maximum allowed value"),I.ok(t>=n,"value smaller than minimum allowed value"),I.ok(Math.floor(t)===t,"value has a fractional component")}function E(t,e,n){I.ok("number"==typeof t,"cannot write a non-number as a number"),I.ok(e>=t,"value larger than maximum allowed value"),I.ok(t>=n,"value smaller than minimum allowed value")}function S(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+1<t.length,"Trying to write beyond buffer length"),_(e,32767,-32768)),e>=0?x(t,e,n,r,i):x(t,65535+e+1,n,r,i)}function j(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+3<t.length,"Trying to write beyond buffer length"),_(e,2147483647,-2147483648)),e>=0?w(t,e,n,r,i):w(t,4294967295+e+1,n,r,i)}function k(e,n,r,i,o){o||(I.ok(void 0!==n&&null!==n,"missing value"),I.ok("boolean"==typeof i,"missing or invalid endian"),I.ok(void 0!==r&&null!==r,"missing offset"),I.ok(r+3<e.length,"Trying to write beyond buffer length"),E(n,3.4028234663852886e38,-3.4028234663852886e38)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,23,4)}function A(e,n,r,i,o){o||(I.ok(void 0!==n&&null!==n,"missing value"),I.ok("boolean"==typeof i,"missing or invalid endian"),I.ok(void 0!==r&&null!==r,"missing offset"),I.ok(r+7<e.length,"Trying to write beyond buffer length"),E(n,1.7976931348623157e308,-1.7976931348623157e308)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,52,8)}var I=t("assert");n.Buffer=r,n.SlowBuffer=r,r.poolSize=8192,n.INSPECT_MAX_BYTES=50,r.prototype.get=function(t){if(0>t||t>=this.length)throw new Error("oob");return this[t]},r.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this[t]=e},r.byteLength=function(t,e){switch(e||"utf8"){case"hex":return t.length/2;case"utf8":case"utf-8":return u(t).length;case"ascii":case"binary":return t.length;case"base64":return f(t).length;default:throw new Error("Unknown encoding")}},r.prototype.utf8Write=function(t,e,n){return r._charsWritten=l(u(t),this,e,n)},r.prototype.asciiWrite=function(t,e,n){return r._charsWritten=l(c(t),this,e,n)},r.prototype.binaryWrite=r.prototype.asciiWrite,r.prototype.base64Write=function(t,e,n){return r._charsWritten=l(f(t),this,e,n)},r.prototype.base64Slice=function(){var e=Array.prototype.slice.apply(this,arguments);return t("base64-js").fromByteArray(e)},r.prototype.utf8Slice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n="",r=0;r<t.length;)t[r]<=127?(e+=p(n)+String.fromCharCode(t[r]),n=""):n+="%"+t[r].toString(16),r++;return e+p(n)},r.prototype.asciiSlice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},r.prototype.binarySlice=r.prototype.asciiSlice,r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=s(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",i=t;e>i;i++)r+=s(this[i]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new r(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),(void 0===r||isNaN(r))&&(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);for(var o=[],a=n;r>a;a++)I.ok("undefined"!=typeof this[a],"copying undefined buffer bytes!"),o.push(this[a]);for(var a=e;a<e+o.length;a++)t[a]=o[a-e]},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");for(var r=e;n>r;r++)this[r]=t},r.isBuffer=function(t){return t instanceof r||t instanceof r},r.concat=function(t,e){if(!o(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===t.length)return new r(0);if(1===t.length)return t[0];if("number"!=typeof e){e=0;for(var n=0;n<t.length;n++){var i=t[n];e+=i.length}}for(var a=new r(e),s=0,n=0;n<t.length;n++){var i=t[n];i.copy(a,s),s+=i.length}return a},r.prototype.readUInt8=function(t,e){var n=this;return e||(I.ok(void 0!==t&&null!==t,"missing offset"),I.ok(t<n.length,"Trying to read beyond buffer length")),t>=n.length?void 0:n[t]},r.prototype.readUInt16LE=function(t,e){return h(this,t,!1,e)},r.prototype.readUInt16BE=function(t,e){return h(this,t,!0,e)},r.prototype.readUInt32LE=function(t,e){return d(this,t,!1,e)},r.prototype.readUInt32BE=function(t,e){return d(this,t,!0,e)},r.prototype.readInt8=function(t,e){var n,r=this;return e||(I.ok(void 0!==t&&null!==t,"missing offset"),I.ok(t<r.length,"Trying to read beyond buffer length")),t>=r.length?void 0:(n=128&r[t],n?-1*(255-r[t]+1):r[t])},r.prototype.readInt16LE=function(t,e){return m(this,t,!1,e)},r.prototype.readInt16BE=function(t,e){return m(this,t,!0,e)},r.prototype.readInt32LE=function(t,e){return g(this,t,!1,e)},r.prototype.readInt32BE=function(t,e){return g(this,t,!0,e)},r.prototype.readFloatLE=function(t,e){return v(this,t,!1,e)},r.prototype.readFloatBE=function(t,e){return v(this,t,!0,e)},r.prototype.readDoubleLE=function(t,e){return y(this,t,!1,e)},r.prototype.readDoubleBE=function(t,e){return y(this,t,!0,e)},r.prototype.writeUInt8=function(t,e,n){var r=this;n||(I.ok(void 0!==t&&null!==t,"missing value"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e<r.length,"trying to write beyond buffer length"),b(t,255)),e<r.length&&(r[e]=t)},r.prototype.writeUInt16LE=function(t,e,n){x(this,t,e,!1,n)},r.prototype.writeUInt16BE=function(t,e,n){x(this,t,e,!0,n)},r.prototype.writeUInt32LE=function(t,e,n){w(this,t,e,!1,n)},r.prototype.writeUInt32BE=function(t,e,n){w(this,t,e,!0,n)},r.prototype.writeInt8=function(t,e,n){var r=this;n||(I.ok(void 0!==t&&null!==t,"missing value"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e<r.length,"Trying to write beyond buffer length"),_(t,127,-128)),t>=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},r.prototype.writeInt16LE=function(t,e,n){S(this,t,e,!1,n)},r.prototype.writeInt16BE=function(t,e,n){S(this,t,e,!0,n)},r.prototype.writeInt32LE=function(t,e,n){j(this,t,e,!1,n)},r.prototype.writeInt32BE=function(t,e,n){j(this,t,e,!0,n)},r.prototype.writeFloatLE=function(t,e,n){k(this,t,e,!1,n)},r.prototype.writeFloatBE=function(t,e,n){k(this,t,e,!0,n)},r.prototype.writeDoubleLE=function(t,e,n){A(this,t,e,!1,n)},r.prototype.writeDoubleBE=function(t,e,n){A(this,t,e,!0,n)}},{"./buffer_ieee754":60,assert:57,"base64-js":62}],62:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}],63:[function(t,e,n){function r(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function i(t,e){for(var n in t)e(t[n],n)}var o=t("buffer").Buffer,a=t("./sha"),s=t("./sha256"),u=t("./rng"),c=t("./md5"),f={sha1:{hex:a.hex_sha1,base64:a.b64_sha1,binary:a.str_sha1},sha256:{hex:s.hex_sha256,base64:s.b64_sha256,binary:s.str_sha256},md5:{hex:c.hex_md5,base64:c.b64_md5,binary:c.bin_md5}},l={sha1:{hex:a.hex_hmac_sha1,base64:a.b64_hmac_sha1,binary:a.str_hmac_sha1},sha256:{hex:s.hex_hmac_sha256,base64:s.b64_hmac_sha256,binary:s.str_hmac_sha256},md5:{hex:c.hex_hmac_md5,base64:c.b64_hmac_md5,binary:c.bin_hmac_md5}};n.createHash=function(t){t=t||"sha1",f[t]||r("algorithm:",t,"is not yet supported");var e="",n=f[t];return{update:function(t){return e+=t,this},digest:function(i){i=i||"binary";var o;(o=n[i])||r("encoding:",i,"is not yet supported for algorithm",t);var a=o(e);return e=null,a}}},n.createHmac=function(t,e){l[t]||r("algorithm:",t,"is not yet supported"),"string"!=typeof e&&(e=e.toString("binary"));var n="",i=l[t];return{update:function(t){return n+=t,this},digest:function(o){o=o||"binary";var a;(a=i[o])||r("encoding:",o,"is not yet support for algorithm",t);var s=a(e,n);return n=null,s}}},n.randomBytes=function(t,e){if(!e||!e.call)return new o(u(t));try{e.call(this,void 0,new o(u(t)))}catch(n){e(n)}},i(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(t){n[t]=function(){r("sorry,",t,"is not implemented yet")}})},{"./md5":64,"./rng":65,"./sha":66,"./sha256":67,buffer:61}],64:[function(t,e,n){function r(t){return x(c(y(t),t.length*S))}function i(t){return w(c(y(t),t.length*S))}function o(t){return b(c(y(t),t.length*S))}function a(t,e){return x(m(t,e))}function s(t,e){return w(m(t,e))}function u(t,e){return b(m(t,e))}function c(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a<t.length;a+=16){var s=n,u=r,c=i,f=o;n=l(n,r,i,o,t[a+0],7,-680876936),o=l(o,n,r,i,t[a+1],12,-389564586),i=l(i,o,n,r,t[a+2],17,606105819),r=l(r,i,o,n,t[a+3],22,-1044525330),n=l(n,r,i,o,t[a+4],7,-176418897),o=l(o,n,r,i,t[a+5],12,1200080426),i=l(i,o,n,r,t[a+6],17,-1473231341),r=l(r,i,o,n,t[a+7],22,-45705983),n=l(n,r,i,o,t[a+8],7,1770035416),o=l(o,n,r,i,t[a+9],12,-1958414417),i=l(i,o,n,r,t[a+10],17,-42063),r=l(r,i,o,n,t[a+11],22,-1990404162),n=l(n,r,i,o,t[a+12],7,1804603682),o=l(o,n,r,i,t[a+13],12,-40341101),i=l(i,o,n,r,t[a+14],17,-1502002290),r=l(r,i,o,n,t[a+15],22,1236535329),n=p(n,r,i,o,t[a+1],5,-165796510),o=p(o,n,r,i,t[a+6],9,-1069501632),i=p(i,o,n,r,t[a+11],14,643717713),r=p(r,i,o,n,t[a+0],20,-373897302),n=p(n,r,i,o,t[a+5],5,-701558691),o=p(o,n,r,i,t[a+10],9,38016083),i=p(i,o,n,r,t[a+15],14,-660478335),r=p(r,i,o,n,t[a+4],20,-405537848),n=p(n,r,i,o,t[a+9],5,568446438),o=p(o,n,r,i,t[a+14],9,-1019803690),i=p(i,o,n,r,t[a+3],14,-187363961),r=p(r,i,o,n,t[a+8],20,1163531501),n=p(n,r,i,o,t[a+13],5,-1444681467),o=p(o,n,r,i,t[a+2],9,-51403784),i=p(i,o,n,r,t[a+7],14,1735328473),r=p(r,i,o,n,t[a+12],20,-1926607734),n=h(n,r,i,o,t[a+5],4,-378558),o=h(o,n,r,i,t[a+8],11,-2022574463),i=h(i,o,n,r,t[a+11],16,1839030562),r=h(r,i,o,n,t[a+14],23,-35309556),n=h(n,r,i,o,t[a+1],4,-1530992060),o=h(o,n,r,i,t[a+4],11,1272893353),i=h(i,o,n,r,t[a+7],16,-155497632),r=h(r,i,o,n,t[a+10],23,-1094730640),n=h(n,r,i,o,t[a+13],4,681279174),o=h(o,n,r,i,t[a+0],11,-358537222),i=h(i,o,n,r,t[a+3],16,-722521979),r=h(r,i,o,n,t[a+6],23,76029189),n=h(n,r,i,o,t[a+9],4,-640364487),o=h(o,n,r,i,t[a+12],11,-421815835),i=h(i,o,n,r,t[a+15],16,530742520),r=h(r,i,o,n,t[a+2],23,-995338651),n=d(n,r,i,o,t[a+0],6,-198630844),o=d(o,n,r,i,t[a+7],10,1126891415),i=d(i,o,n,r,t[a+14],15,-1416354905),r=d(r,i,o,n,t[a+5],21,-57434055),n=d(n,r,i,o,t[a+12],6,1700485571),o=d(o,n,r,i,t[a+3],10,-1894986606),i=d(i,o,n,r,t[a+10],15,-1051523),r=d(r,i,o,n,t[a+1],21,-2054922799),n=d(n,r,i,o,t[a+8],6,1873313359),o=d(o,n,r,i,t[a+15],10,-30611744),i=d(i,o,n,r,t[a+6],15,-1560198380),r=d(r,i,o,n,t[a+13],21,1309151649),n=d(n,r,i,o,t[a+4],6,-145523070),o=d(o,n,r,i,t[a+11],10,-1120210379),i=d(i,o,n,r,t[a+2],15,718787259),r=d(r,i,o,n,t[a+9],21,-343485551),n=g(n,s),r=g(r,u),i=g(i,c),o=g(o,f)}return Array(n,r,i,o)}function f(t,e,n,r,i,o){return g(v(g(g(e,t),g(r,o)),i),n)}function l(t,e,n,r,i,o,a){return f(e&n|~e&r,t,e,i,o,a)}function p(t,e,n,r,i,o,a){return f(e&r|n&~r,t,e,i,o,a)}function h(t,e,n,r,i,o,a){return f(e^n^r,t,e,i,o,a)}function d(t,e,n,r,i,o,a){return f(n^(e|~r),t,e,i,o,a)}function m(t,e){var n=y(t);n.length>16&&(n=c(n,t.length*S));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=c(r.concat(y(e)),512+e.length*S);return c(i.concat(a),640)}function g(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function v(t,e){return t<<e|t>>>32-e}function y(t){for(var e=Array(),n=(1<<S)-1,r=0;r<t.length*S;r+=S)e[r>>5]|=(t.charCodeAt(r/S)&n)<<r%32;return e}function b(t){for(var e="",n=(1<<S)-1,r=0;r<32*t.length;r+=S)e+=String.fromCharCode(t[r>>5]>>>r%32&n);return e}function x(t){for(var e=_?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(r%4)+4)+e.charAt(15&t[r>>2]>>8*(r%4));return n}function w(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="",r=0;r<4*t.length;r+=3)for(var i=(255&t[r>>2]>>8*(r%4))<<16|(255&t[r+1>>2]>>8*((r+1)%4))<<8|255&t[r+2>>2]>>8*((r+2)%4),o=0;4>o;o++)n+=8*r+6*o>32*t.length?E:e.charAt(63&i>>6*(3-o));return n}var _=0,E="=",S=8;n.hex_md5=r,n.b64_md5=i,n.bin_md5=o,n.hex_hmac_md5=a,n.b64_hmac_md5=s,n.bin_hmac_md5=u},{}],65:[function(t,e){!function(){var t,n,r=this;if(t=function(t){for(var e,e,n=new Array(t),r=0;t>r;r++)0==(3&r)&&(e=4294967296*Math.random()),n[r]=255&e>>>((3&r)<<3);return n},r.crypto&&crypto.getRandomValues){var i=new Uint32Array(4);n=function(t){var e=new Array(t);crypto.getRandomValues(i);for(var n=0;t>n;n++)e[n]=255&i[n>>2]>>>8*(3&n);return e}}e.exports=n||t}()},{}],66:[function(t,e,n){function r(t){return v(c(m(t),t.length*w))}function i(t){return y(c(m(t),t.length*w))}function o(t){return g(c(m(t),t.length*w))}function a(t,e){return v(p(t,e))}function s(t,e){return y(p(t,e))}function u(t,e){return g(p(t,e))}function c(t,e){t[e>>5]|=128<<24-e%32,t[(e+64>>9<<4)+15]=e;for(var n=Array(80),r=1732584193,i=-271733879,o=-1732584194,a=271733878,s=-1009589776,u=0;u<t.length;u+=16){for(var c=r,p=i,m=o,g=a,v=s,y=0;80>y;y++){n[y]=16>y?t[u+y]:d(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);var b=h(h(d(r,5),f(y,i,o,a)),h(h(s,n[y]),l(y)));s=a,a=o,o=d(i,30),i=r,r=b}r=h(r,c),i=h(i,p),o=h(o,m),a=h(a,g),s=h(s,v)}return Array(r,i,o,a,s)}function f(t,e,n,r){return 20>t?e&n|~e&r:40>t?e^n^r:60>t?e&n|e&r|n&r:e^n^r}function l(t){return 20>t?1518500249:40>t?1859775393:60>t?-1894007588:-899497514}function p(t,e){var n=m(t);n.length>16&&(n=c(n,t.length*w));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=c(r.concat(m(e)),512+e.length*w);return c(i.concat(a),672)}function h(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function d(t,e){return t<<e|t>>>32-e}function m(t){for(var e=Array(),n=(1<<w)-1,r=0;r<t.length*w;r+=w)e[r>>5]|=(t.charCodeAt(r/w)&n)<<32-w-r%32;return e}function g(t){for(var e="",n=(1<<w)-1,r=0;r<32*t.length;r+=w)e+=String.fromCharCode(t[r>>5]>>>32-w-r%32&n);return e}function v(t){for(var e=b?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(3-r%4)+4)+e.charAt(15&t[r>>2]>>8*(3-r%4));return n}function y(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="",r=0;r<4*t.length;r+=3)for(var i=(255&t[r>>2]>>8*(3-r%4))<<16|(255&t[r+1>>2]>>8*(3-(r+1)%4))<<8|255&t[r+2>>2]>>8*(3-(r+2)%4),o=0;4>o;o++)n+=8*r+6*o>32*t.length?x:e.charAt(63&i>>6*(3-o));return n}n.hex_sha1=r,n.b64_sha1=i,n.str_sha1=o,n.hex_hmac_sha1=a,n.b64_hmac_sha1=s,n.str_hmac_sha1=u;var b=0,x="=",w=8},{}],67:[function(t,e,n){function r(t){return E(w(_(t),t.length*l))}function i(t){return S(w(_(t),t.length*l))}function o(t){return c(w(_(t),t.length*l))}function a(t,e){return E(j(t,e))}function s(t,e){return S(j(t,e))}function u(t,e){return c(j(t,e))}function c(t){for(var e="",n=(1<<l)-1,r=0;r<32*t.length;r+=l)e+=String.fromCharCode(t[r>>5]>>>32-l-r%32&n);return e}n.hex_sha256=r,n.b64_sha256=i,n.str_sha256=o,n.hex_hmac_sha256=a,n.b64_hmac_sha256=s,n.str_hmac_sha256=u;var f=0,l=8,p=function(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n},h=function(t,e){return t>>>e|t<<32-e},d=function(t,e){return t>>>e},m=function(t,e,n){return t&e^~t&n},g=function(t,e,n){return t&e^t&n^e&n},v=function(t){return h(t,2)^h(t,13)^h(t,22)},y=function(t){return h(t,6)^h(t,11)^h(t,25)},b=function(t){return h(t,7)^h(t,18)^d(t,3)},x=function(t){return h(t,17)^h(t,19)^d(t,10)},w=function(t,e){var n,r,i,o,a,s,u,c,f,l,h,d,w=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),E=new Array(64);
t[e>>5]|=128<<24-e%32,t[(e+64>>9<<4)+15]=e;for(var f=0;f<t.length;f+=16){n=_[0],r=_[1],i=_[2],o=_[3],a=_[4],s=_[5],u=_[6],c=_[7];for(var l=0;64>l;l++)E[l]=16>l?t[l+f]:p(p(p(x(E[l-2]),E[l-7]),b(E[l-15])),E[l-16]),h=p(p(p(p(c,y(a)),m(a,s,u)),w[l]),E[l]),d=p(v(n),g(n,r,i)),c=u,u=s,s=a,a=p(o,h),o=i,i=r,r=n,n=p(h,d);_[0]=p(n,_[0]),_[1]=p(r,_[1]),_[2]=p(i,_[2]),_[3]=p(o,_[3]),_[4]=p(a,_[4]),_[5]=p(s,_[5]),_[6]=p(u,_[6]),_[7]=p(c,_[7])}return _},_=function(t){for(var e=Array(),n=(1<<l)-1,r=0;r<t.length*l;r+=l)e[r>>5]|=(t.charCodeAt(r/l)&n)<<24-r%32;return e},E=function(t){for(var e=f?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(3-r%4)+4)+e.charAt(15&t[r>>2]>>8*(3-r%4));return n},S=function(t){var e,n,r,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="",a=4*t.length,s="=";for(e=0;a>e;e+=3)for(r=(255&t[e>>2]>>8*(3-e%4))<<16|(255&t[e+1>>2]>>8*(3-(e+1)%4))<<8|255&t[e+2>>2]>>8*(3-(e+2)%4),n=0;4>n;n+=1)o+=8*e+6*n<=32*t.length?i.charAt(63&r>>6*(3-n)):s;return o},j=function(t,e){var n=_(t);n.length>16&&(n=w(n,t.length*l));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=w(r.concat(_(e)),512+e.length*l);return w(i.concat(a),768)}},{}],68:[function(t,e){t=function(t,e,n,r){function i(r){if(!n[r]){if(!e[r]){if(t)return t(r);throw new Error("Cannot find module '"+r+"'")}var o=n[r]={exports:{}};e[r][0](function(t){var n=e[r][1][t];return i(n?n:t)},o,o.exports)}return n[r].exports}for(var o=0;o<r.length;o++)i(r[o]);return i}("undefined"!=typeof t&&t,{1:[function(t,e){function n(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e}function r(t,e){return void 0===e?""+e:"number"!=typeof e||!isNaN(e)&&isFinite(e)?"function"==typeof e||e instanceof RegExp?e.toString():e:e.toString()}function i(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function o(t,e,n,r,i){throw new g.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function a(t,e){t||o(t,!0,e,"==",g.ok)}function s(t,e){if(t===e)return!0;if(d.isBuffer(t)&&d.isBuffer(e)){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():"object"!=typeof t&&"object"!=typeof e?t==e:f(t,e)}function u(t){return null===t||void 0===t}function c(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function f(t,e){if(u(t)||u(e))return!1;if(t.prototype!==e.prototype)return!1;if(c(t))return c(e)?(t=m.call(t),e=m.call(e),s(t,e)):!1;try{var r,i,o=n(t),a=n(e)}catch(f){return!1}if(o.length!=a.length)return!1;for(o.sort(),a.sort(),i=o.length-1;i>=0;i--)if(o[i]!=a[i])return!1;for(i=o.length-1;i>=0;i--)if(r=o[i],!s(t[r],e[r]))return!1;return!0}function l(t,e){return t&&e?e instanceof RegExp?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,n,r){var i;"string"==typeof n&&(r=n,n=null);try{e()}catch(a){i=a}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o("Missing expected exception"+r),!t&&l(i,n)&&o("Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var h=t("util"),d=t("buffer").Buffer,m=Array.prototype.slice,g=e.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var e=t.stackStartFunction||o;Error.captureStackTrace&&Error.captureStackTrace(this,e)},h.inherits(g.AssertionError,Error),g.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",i(JSON.stringify(this.actual,r),128),this.operator,i(JSON.stringify(this.expected,r),128)].join(" ")},g.AssertionError.__proto__=Error.prototype,g.fail=o,g.ok=a,g.equal=function(t,e,n){t!=e&&o(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){s(t,e)||o(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){s(t,e)&&o(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",g.notStrictEqual)},g.throws=function(){p.apply(this,[!0].concat(m.call(arguments)))},g.doesNotThrow=function(){p.apply(this,[!1].concat(m.call(arguments)))},g.ifError=function(t){if(t)throw t}},{util:2,buffer:3}],2:[function(t,e,n){function r(t){return t instanceof Array||Array.isArray(t)||t&&t!==Object.prototype&&r(t.__proto__)}function i(t){return t instanceof RegExp||"object"==typeof t&&"[object RegExp]"===Object.prototype.toString.call(t)}function o(t){if(t instanceof Date)return!0;if("object"!=typeof t)return!1;var e=Date.prototype&&s(Date.prototype),n=t.__proto__&&s(t.__proto__);return JSON.stringify(n)===JSON.stringify(e)}t("events"),n.isArray=r,n.isDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(t,e,u,c){function f(t,u){if(t&&"function"==typeof t.inspect&&t!==n&&(!t.constructor||t.constructor.prototype!==t))return t.inspect(u);switch(typeof t){case"undefined":return p("undefined","undefined");case"string":var c="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p(c,"string");case"number":return p(""+t,"number");case"boolean":return p(""+t,"boolean")}if(null===t)return p("null","null");var h=a(t),d=e?s(t):h;if("function"==typeof t&&0===d.length){if(i(t))return p(""+t,"regexp");var m=t.name?": "+t.name:"";return p("[Function"+m+"]","special")}if(o(t)&&0===d.length)return p(t.toUTCString(),"date");var g,v,y;if(r(t)?(v="Array",y=["[","]"]):(v="Object",y=["{","}"]),"function"==typeof t){var b=t.name?": "+t.name:"";g=i(t)?" "+t:" [Function"+b+"]"}else g="";if(o(t)&&(g=" "+t.toUTCString()),0===d.length)return y[0]+g+y[1];if(0>u)return i(t)?p(""+t,"regexp"):p("[Object]","special");l.push(t);var x=d.map(function(e){var n,i;if(t.__lookupGetter__&&(t.__lookupGetter__(e)?i=t.__lookupSetter__(e)?p("[Getter/Setter]","special"):p("[Getter]","special"):t.__lookupSetter__(e)&&(i=p("[Setter]","special"))),h.indexOf(e)<0&&(n="["+e+"]"),i||(l.indexOf(t[e])<0?(i=null===u?f(t[e]):f(t[e],u-1),i.indexOf("\n")>-1&&(i=r(t)?i.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+i.split("\n").map(function(t){return" "+t}).join("\n"))):i=p("[Circular]","special")),"undefined"==typeof n){if("Array"===v&&e.match(/^\d+$/))return i;n=JSON.stringify(""+e),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=p(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=p(n,"string"))}return n+": "+i});l.pop();var w=0,_=x.reduce(function(t,e){return w++,e.indexOf("\n")>=0&&w++,t+e.length+1},0);return x=_>50?y[0]+(""===g?"":g+"\n ")+" "+x.join(",\n ")+" "+y[1]:y[0]+g+" "+x.join(", ")+" "+y[1]}var l=[],p=function(t,e){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[e];return r?"["+n[r][0]+"m"+t+"["+n[r][1]+"m":t};return c||(p=function(t){return t}),f(t,"undefined"==typeof u?2:u)},n.log=function(){},n.pump=null;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.hasOwnProperty.call(t,n)&&e.push(n);return e},u=Object.create||function(t,e){var n;if(null===t)n={__proto__:null};else{if("object"!=typeof t)throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var r=function(){};r.prototype=t,n=new r,n.__proto__=t}return"undefined"!=typeof e&&Object.defineProperties&&Object.defineProperties(n,e),n};n.inherits=function(t,e){t.super_=e,t.prototype=u(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})};var c=/%[sdj%]/g;n.format=function(t){if("string"!=typeof t){for(var e=[],r=0;r<arguments.length;r++)e.push(n.inspect(arguments[r]));return e.join(" ")}for(var r=1,i=arguments,o=i.length,a=String(t).replace(c,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":return JSON.stringify(i[r++]);default:return t}}),s=i[r];o>r;s=i[++r])a+=null===s||"object"!=typeof s?" "+s:" "+n.inspect(s);return a}},{events:4}],5:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],6:[function(t,e){var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){if(t.source===window&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var e=n.shift();e()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){!function(t){function e(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}t.EventEmitter||(t.EventEmitter=function(){});var r=n.EventEmitter=t.EventEmitter,i="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=10;r.prototype.setMaxListeners=function(t){this._events||(this._events={}),this._events.maxListeners=t},r.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(i(e)){for(var n=Array.prototype.slice.call(arguments,1),r=e.slice(),o=0,a=r.length;a>o;o++)r[o].apply(this,n);return!0}return!1},r.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(i(this._events[t])){if(!this._events[t].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:o,n&&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())}this._events[t].push(e)}else this._events[t]=[this._events[t],e];else this._events[t]=e;return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){var n=this;return n.on(t,function r(){n.removeListener(t,r),e.apply(this,arguments)}),this},r.prototype.removeListener=function(t,n){if("function"!=typeof n)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var r=this._events[t];if(i(r)){var o=e(r,n);if(0>o)return this;r.splice(o,1),0==r.length&&delete this._events[t]}else this._events[t]===n&&delete this._events[t];return this},r.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},r.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),i(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}}(t("__browserify_process"))},{__browserify_process:6}],"buffer-browserify":[function(t,e){e.exports=t("q9TxCC")},{}],q9TxCC:[function(t,e,n){function r(t){this.length=t}function i(t){return 16>t?"0"+t.toString(16):t.toString(16)}function o(t){for(var e=[],n=0;n<t.length;n++)if(t.charCodeAt(n)<=127)e.push(t.charCodeAt(n));else for(var r=encodeURIComponent(t.charAt(n)).substr(1).split("%"),i=0;i<r.length;i++)e.push(parseInt(r[i],16));return e}function a(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}function s(e){return t("base64-js").toByteArray(e)}function u(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function c(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function f(t){return t=~~Math.ceil(+t),0>t?0:t}function l(t,e,n){if(!(this instanceof l))return new l(t,e,n);var i;if("number"==typeof n)this.length=f(e),this.parent=t,this.offset=n;else{switch(i=typeof t){case"number":this.length=f(t);break;case"string":this.length=l.byteLength(t,e);break;case"object":this.length=f(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(this.length>l.poolSize?(this.parent=new r(this.length),this.offset=0):((!N||N.length-N.used<this.length)&&h(),this.parent=N,this.offset=N.used,N.used+=this.length),p(t))for(var o=0;o<this.length;o++)this.parent[o+this.offset]=t instanceof l?t.readUInt8(o):t[o];else"string"==i&&(this.length=this.write(t,0,e))}}function p(t){return Array.isArray(t)||l.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function h(){N=new r(l.poolSize),N.used=0}function d(t,e,n,r){var i=0;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1<t.length,"Trying to read beyond buffer length")),e>=t.length?0:(n?(i=t.parent[t.offset+e]<<8,e+1<t.length&&(i|=t.parent[t.offset+e+1])):(i=t.parent[t.offset+e],e+1<t.length&&(i|=t.parent[t.offset+e+1]<<8)),i)}function m(t,e,n,r){var i=0;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+3<t.length,"Trying to read beyond buffer length")),e>=t.length?0:(n?(e+1<t.length&&(i=t.parent[t.offset+e+1]<<16),e+2<t.length&&(i|=t.parent[t.offset+e+2]<<8),e+3<t.length&&(i|=t.parent[t.offset+e+3]),i+=t.parent[t.offset+e]<<24>>>0):(e+2<t.length&&(i=t.parent[t.offset+e+2]<<16),e+1<t.length&&(i|=t.parent[t.offset+e+1]<<8),i|=t.parent[t.offset+e],e+3<t.length&&(i+=t.parent[t.offset+e+3]<<24>>>0)),i)}function g(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1<t.length,"Trying to read beyond buffer length")),o=d(t,e,n,r),i=32768&o,i?-1*(65535-o+1):o}function v(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+3<t.length,"Trying to read beyond buffer length")),o=m(t,e,n,r),i=2147483648&o,i?-1*(4294967295-o+1):o}function y(e,n,r,i){return i||(C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(n+3<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,23,4)}function b(e,n,r,i){return i||(C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(n+7<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,52,8)}function x(t,e){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(t>=0,"specified a negative value for writing an unsigned value"),C.ok(e>=t,"value is larger than maximum value for type"),C.ok(Math.floor(t)===t,"value has a fractional component")}function w(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1<t.length,"trying to write beyond buffer length"),x(e,65535));for(var o=0;o<Math.min(t.length-n,2);o++)t.parent[t.offset+n+o]=(e&255<<8*(r?1-o:o))>>>8*(r?1-o:o)}function _(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3<t.length,"trying to write beyond buffer length"),x(e,4294967295));for(var o=0;o<Math.min(t.length-n,4);o++)t.parent[t.offset+n+o]=255&e>>>8*(r?3-o:o)}function E(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value"),C.ok(Math.floor(t)===t,"value has a fractional component")}function S(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value")}function j(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1<t.length,"Trying to write beyond buffer length"),E(e,32767,-32768)),e>=0?w(t,e,n,r,i):w(t,65535+e+1,n,r,i)}function k(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3<t.length,"Trying to write beyond buffer length"),E(e,2147483647,-2147483648)),e>=0?_(t,e,n,r,i):_(t,4294967295+e+1,n,r,i)}function A(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+3<e.length,"Trying to write beyond buffer length"),S(n,3.4028234663852886e38,-3.4028234663852886e38)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,23,4)}function I(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+7<e.length,"Trying to write beyond buffer length"),S(n,1.7976931348623157e308,-1.7976931348623157e308)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,52,8)}var C=t("assert");n.INSPECT_MAX_BYTES=50,r.byteLength=function(t,e){switch(e||"utf8"){case"hex":return t.length/2;case"utf8":case"utf-8":return o(t).length;case"ascii":case"binary":return t.length;case"base64":return s(t).length;default:throw new Error("Unknown encoding")}},r.prototype.utf8Write=function(t,e,n){return r._charsWritten=u(o(t),this,e,n)},r.prototype.asciiWrite=function(t,e,n){return r._charsWritten=u(a(t),this,e,n)},r.prototype.binaryWrite=r.prototype.asciiWrite,r.prototype.base64Write=function(t,e,n){return r._charsWritten=u(s(t),this,e,n)},r.prototype.base64Slice=function(){var e=Array.prototype.slice.apply(this,arguments);return t("base64-js").fromByteArray(e)},r.prototype.utf8Slice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n="",r=0;r<t.length;)t[r]<=127?(e+=c(n)+String.fromCharCode(t[r]),n=""):n+="%"+t[r].toString(16),r++;return e+c(n)},r.prototype.asciiSlice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},r.prototype.binarySlice=r.prototype.asciiSlice,r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=i(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<SlowBuffer "+t.join(" ")+">"},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",o=t;e>o;o++)r+=i(this[o]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){for(var i=[],o=n;r>o;o++)C.ok("undefined"!=typeof this[o],"copying undefined buffer bytes!"),i.push(this[o]);for(var o=e;o<e+i.length;o++)t[o]=i[o-e]},r.prototype.fill=function(t,e,n){if(n>this.length)throw new Error("oob");if(e>n)throw new Error("oob");for(var r=e;n>r;r++)this[r]=t},n.SlowBuffer=r,n.Buffer=l,l.poolSize=8192;var N;l.isBuffer=function(t){return t instanceof l||t instanceof r},l.concat=function(t,e){if(!Array.isArray(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===t.length)return new l(0);if(1===t.length)return t[0];if("number"!=typeof e){e=0;for(var n=0;n<t.length;n++){var r=t[n];e+=r.length}}for(var i=new l(e),o=0,n=0;n<t.length;n++){var r=t[n];r.copy(i,o),o+=r.length}return i},l.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=i(this.parent[r+this.offset]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},l.prototype.get=function(t){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},l.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=e},l.prototype.write=function(t,e,n,i){if(isFinite(e))isFinite(n)||(i=n,n=void 0);else{var o=i;i=e,e=n,n=o}e=+e||0;var a=this.length-e;n?(n=+n,n>a&&(n=a)):n=a,i=String(i||"utf8").toLowerCase();var s;switch(i){case"hex":s=this.parent.hexWrite(t,this.offset+e,n);break;case"utf8":case"utf-8":s=this.parent.utf8Write(t,this.offset+e,n);break;case"ascii":s=this.parent.asciiWrite(t,this.offset+e,n);break;case"binary":s=this.parent.binaryWrite(t,this.offset+e,n);break;case"base64":s=this.parent.base64Write(t,this.offset+e,n);break;case"ucs2":case"ucs-2":s=this.parent.ucs2Write(t,this.offset+e,n);break;default:throw new Error("Unknown encoding")}return l._charsWritten=r._charsWritten,s},l.prototype.toString=function(t,e,n){switch(t=String(t||"utf8").toLowerCase(),"undefined"==typeof e||0>e?e=0:e>this.length&&(e=this.length),"undefined"==typeof n||n>this.length?n=this.length:0>n&&(n=0),e+=this.offset,n+=this.offset,t){case"hex":return this.parent.hexSlice(e,n);case"utf8":case"utf-8":return this.parent.utf8Slice(e,n);case"ascii":return this.parent.asciiSlice(e,n);case"binary":return this.parent.binarySlice(e,n);case"base64":return this.parent.base64Slice(e,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},l.byteLength=r.byteLength,l.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");return this.parent.fill(t,e+this.offset,n+this.offset)},l.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),r||(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n),this.parent.copy(t.parent,e+t.offset,n+this.offset,r+this.offset)},l.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this.parent,e-t,+t+this.offset)},l.prototype.utf8Slice=function(t,e){return this.toString("utf8",t,e)},l.prototype.binarySlice=function(t,e){return this.toString("binary",t,e)},l.prototype.asciiSlice=function(t,e){return this.toString("ascii",t,e)},l.prototype.utf8Write=function(t,e){return this.write(t,e,"utf8")},l.prototype.binaryWrite=function(t,e){return this.write(t,e,"binary")},l.prototype.asciiWrite=function(t,e){return this.write(t,e,"ascii")},l.prototype.readUInt8=function(t,e){var n=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t<n.length,"Trying to read beyond buffer length")),t>=n.length?void 0:n.parent[n.offset+t]},l.prototype.readUInt16LE=function(t,e){return d(this,t,!1,e)},l.prototype.readUInt16BE=function(t,e){return d(this,t,!0,e)},l.prototype.readUInt32LE=function(t,e){return m(this,t,!1,e)},l.prototype.readUInt32BE=function(t,e){return m(this,t,!0,e)},l.prototype.readInt8=function(t,e){var n,r=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t<r.length,"Trying to read beyond buffer length")),t>=r.length?void 0:(n=128&r.parent[r.offset+t],n?-1*(255-r.parent[r.offset+t]+1):r.parent[r.offset+t])},l.prototype.readInt16LE=function(t,e){return g(this,t,!1,e)},l.prototype.readInt16BE=function(t,e){return g(this,t,!0,e)},l.prototype.readInt32LE=function(t,e){return v(this,t,!1,e)},l.prototype.readInt32BE=function(t,e){return v(this,t,!0,e)},l.prototype.readFloatLE=function(t,e){return y(this,t,!1,e)},l.prototype.readFloatBE=function(t,e){return y(this,t,!0,e)},l.prototype.readDoubleLE=function(t,e){return b(this,t,!1,e)},l.prototype.readDoubleBE=function(t,e){return b(this,t,!0,e)},l.prototype.writeUInt8=function(t,e,n){var r=this;n||(C.ok(void 0!==t&&null!==t,"missing value"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e<r.length,"trying to write beyond buffer length"),x(t,255)),e<r.length&&(r.parent[r.offset+e]=t)},l.prototype.writeUInt16LE=function(t,e,n){w(this,t,e,!1,n)},l.prototype.writeUInt16BE=function(t,e,n){w(this,t,e,!0,n)},l.prototype.writeUInt32LE=function(t,e,n){_(this,t,e,!1,n)},l.prototype.writeUInt32BE=function(t,e,n){_(this,t,e,!0,n)},l.prototype.writeInt8=function(t,e,n){var r=this;n||(C.ok(void 0!==t&&null!==t,"missing value"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e<r.length,"Trying to write beyond buffer length"),E(t,127,-128)),t>=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},l.prototype.writeInt16LE=function(t,e,n){j(this,t,e,!1,n)},l.prototype.writeInt16BE=function(t,e,n){j(this,t,e,!0,n)},l.prototype.writeInt32LE=function(t,e,n){k(this,t,e,!1,n)},l.prototype.writeInt32BE=function(t,e,n){k(this,t,e,!0,n)},l.prototype.writeFloatLE=function(t,e,n){A(this,t,e,!1,n)},l.prototype.writeFloatBE=function(t,e,n){A(this,t,e,!0,n)},l.prototype.writeDoubleLE=function(t,e,n){I(this,t,e,!1,n)},l.prototype.writeDoubleBE=function(t,e,n){I(this,t,e,!0,n)},r.prototype.readUInt8=l.prototype.readUInt8,r.prototype.readUInt16LE=l.prototype.readUInt16LE,r.prototype.readUInt16BE=l.prototype.readUInt16BE,r.prototype.readUInt32LE=l.prototype.readUInt32LE,r.prototype.readUInt32BE=l.prototype.readUInt32BE,r.prototype.readInt8=l.prototype.readInt8,r.prototype.readInt16LE=l.prototype.readInt16LE,r.prototype.readInt16BE=l.prototype.readInt16BE,r.prototype.readInt32LE=l.prototype.readInt32LE,r.prototype.readInt32BE=l.prototype.readInt32BE,r.prototype.readFloatLE=l.prototype.readFloatLE,r.prototype.readFloatBE=l.prototype.readFloatBE,r.prototype.readDoubleLE=l.prototype.readDoubleLE,r.prototype.readDoubleBE=l.prototype.readDoubleBE,r.prototype.writeUInt8=l.prototype.writeUInt8,r.prototype.writeUInt16LE=l.prototype.writeUInt16LE,r.prototype.writeUInt16BE=l.prototype.writeUInt16BE,r.prototype.writeUInt32LE=l.prototype.writeUInt32LE,r.prototype.writeUInt32BE=l.prototype.writeUInt32BE,r.prototype.writeInt8=l.prototype.writeInt8,r.prototype.writeInt16LE=l.prototype.writeInt16LE,r.prototype.writeInt16BE=l.prototype.writeInt16BE,r.prototype.writeInt32LE=l.prototype.writeInt32LE,r.prototype.writeInt32BE=l.prototype.writeInt32BE,r.prototype.writeFloatLE=l.prototype.writeFloatLE,r.prototype.writeFloatBE=l.prototype.writeFloatBE,r.prototype.writeDoubleLE=l.prototype.writeDoubleLE,r.prototype.writeDoubleBE=l.prototype.writeDoubleBE},{assert:1,"./buffer_ieee754":5,"base64-js":7}],7:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}],8:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],3:[function(t,e,n){function r(t){this.length=t}function i(t){return 16>t?"0"+t.toString(16):t.toString(16)}function o(t){for(var e=[],n=0;n<t.length;n++)if(t.charCodeAt(n)<=127)e.push(t.charCodeAt(n));else for(var r=encodeURIComponent(t.charAt(n)).substr(1).split("%"),i=0;i<r.length;i++)e.push(parseInt(r[i],16));return e}function a(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}function s(e){return t("base64-js").toByteArray(e)
}function u(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function c(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function f(t){return t=~~Math.ceil(+t),0>t?0:t}function l(t,e,n){if(!(this instanceof l))return new l(t,e,n);var i;if("number"==typeof n)this.length=f(e),this.parent=t,this.offset=n;else{switch(i=typeof t){case"number":this.length=f(t);break;case"string":this.length=l.byteLength(t,e);break;case"object":this.length=f(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(this.length>l.poolSize?(this.parent=new r(this.length),this.offset=0):((!N||N.length-N.used<this.length)&&h(),this.parent=N,this.offset=N.used,N.used+=this.length),p(t))for(var o=0;o<this.length;o++)this.parent[o+this.offset]=t[o];else"string"==i&&(this.length=this.write(t,0,e))}}function p(t){return Array.isArray(t)||l.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function h(){N=new r(l.poolSize),N.used=0}function d(t,e,n,r){var i=0;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1<t.length,"Trying to read beyond buffer length")),n?(i=t.parent[t.offset+e]<<8,i|=t.parent[t.offset+e+1]):(i=t.parent[t.offset+e],i|=t.parent[t.offset+e+1]<<8),i}function m(t,e,n,r){var i=0;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+3<t.length,"Trying to read beyond buffer length")),n?(i=t.parent[t.offset+e+1]<<16,i|=t.parent[t.offset+e+2]<<8,i|=t.parent[t.offset+e+3],i+=t.parent[t.offset+e]<<24>>>0):(i=t.parent[t.offset+e+2]<<16,i|=t.parent[t.offset+e+1]<<8,i|=t.parent[t.offset+e],i+=t.parent[t.offset+e+3]<<24>>>0),i}function g(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1<t.length,"Trying to read beyond buffer length")),o=d(t,e,n,r),i=32768&o,i?-1*(65535-o+1):o}function v(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+3<t.length,"Trying to read beyond buffer length")),o=m(t,e,n,r),i=2147483648&o,i?-1*(4294967295-o+1):o}function y(e,n,r,i){return i||(C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(n+3<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,23,4)}function b(e,n,r,i){return i||(C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(n+7<e.length,"Trying to read beyond buffer length")),t("./buffer_ieee754").readIEEE754(e,n,r,52,8)}function x(t,e){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(t>=0,"specified a negative value for writing an unsigned value"),C.ok(e>=t,"value is larger than maximum value for type"),C.ok(Math.floor(t)===t,"value has a fractional component")}function w(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1<t.length,"trying to write beyond buffer length"),x(e,65535)),r?(t.parent[t.offset+n]=(65280&e)>>>8,t.parent[t.offset+n+1]=255&e):(t.parent[t.offset+n+1]=(65280&e)>>>8,t.parent[t.offset+n]=255&e)}function _(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3<t.length,"trying to write beyond buffer length"),x(e,4294967295)),r?(t.parent[t.offset+n]=255&e>>>24,t.parent[t.offset+n+1]=255&e>>>16,t.parent[t.offset+n+2]=255&e>>>8,t.parent[t.offset+n+3]=255&e):(t.parent[t.offset+n+3]=255&e>>>24,t.parent[t.offset+n+2]=255&e>>>16,t.parent[t.offset+n+1]=255&e>>>8,t.parent[t.offset+n]=255&e)}function E(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value"),C.ok(Math.floor(t)===t,"value has a fractional component")}function S(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value")}function j(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1<t.length,"Trying to write beyond buffer length"),E(e,32767,-32768)),e>=0?w(t,e,n,r,i):w(t,65535+e+1,n,r,i)}function k(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3<t.length,"Trying to write beyond buffer length"),E(e,2147483647,-2147483648)),e>=0?_(t,e,n,r,i):_(t,4294967295+e+1,n,r,i)}function A(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+3<e.length,"Trying to write beyond buffer length"),S(n,3.4028234663852886e38,-3.4028234663852886e38)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,23,4)}function I(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+7<e.length,"Trying to write beyond buffer length"),S(n,1.7976931348623157e308,-1.7976931348623157e308)),t("./buffer_ieee754").writeIEEE754(e,n,r,i,52,8)}var C=t("assert");n.INSPECT_MAX_BYTES=50,r.byteLength=function(t,e){switch(e||"utf8"){case"hex":return t.length/2;case"utf8":case"utf-8":return o(t).length;case"ascii":return t.length;case"base64":return s(t).length;default:throw new Error("Unknown encoding")}},r.prototype.utf8Write=function(t,e,n){return r._charsWritten=u(o(t),this,e,n)},r.prototype.asciiWrite=function(t,e,n){return r._charsWritten=u(a(t),this,e,n)},r.prototype.base64Write=function(t,e,n){return r._charsWritten=u(s(t),this,e,n)},r.prototype.base64Slice=function(){var e=Array.prototype.slice.apply(this,arguments);return t("base64-js").fromByteArray(e)},r.prototype.utf8Slice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n="",r=0;r<t.length;)t[r]<=127?(e+=c(n)+String.fromCharCode(t[r]),n=""):n+="%"+t[r].toString(16),r++;return e+c(n)},r.prototype.asciiSlice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=i(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<SlowBuffer "+t.join(" ")+">"},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",o=t;e>o;o++)r+=i(this[o]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){for(var i=[],o=n;r>o;o++)C.ok("undefined"!=typeof this[o],"copying undefined buffer bytes!"),i.push(this[o]);for(var o=e;o<e+i.length;o++)t[o]=i[o-e]},n.SlowBuffer=r,n.Buffer=l,l.poolSize=8192;var N;l.isBuffer=function(t){return t instanceof l||t instanceof r},l.concat=function(t,e){if(!Array.isArray(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===t.length)return new l(0);if(1===t.length)return t[0];if("number"!=typeof e){e=0;for(var n=0;n<t.length;n++){var r=t[n];e+=r.length}}for(var i=new l(e),o=0,n=0;n<t.length;n++){var r=t[n];r.copy(i,o),o+=r.length}return i},l.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=i(this.parent[r+this.offset]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},l.prototype.get=function(t){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},l.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=e},l.prototype.write=function(t,e,n,i){if(isFinite(e))isFinite(n)||(i=n,n=void 0);else{var o=i;i=e,e=n,n=o}e=+e||0;var a=this.length-e;n?(n=+n,n>a&&(n=a)):n=a,i=String(i||"utf8").toLowerCase();var s;switch(i){case"hex":s=this.parent.hexWrite(t,this.offset+e,n);break;case"utf8":case"utf-8":s=this.parent.utf8Write(t,this.offset+e,n);break;case"ascii":s=this.parent.asciiWrite(t,this.offset+e,n);break;case"binary":s=this.parent.binaryWrite(t,this.offset+e,n);break;case"base64":s=this.parent.base64Write(t,this.offset+e,n);break;case"ucs2":case"ucs-2":s=this.parent.ucs2Write(t,this.offset+e,n);break;default:throw new Error("Unknown encoding")}return l._charsWritten=r._charsWritten,s},l.prototype.toString=function(t,e,n){switch(t=String(t||"utf8").toLowerCase(),"undefined"==typeof e||0>e?e=0:e>this.length&&(e=this.length),"undefined"==typeof n||n>this.length?n=this.length:0>n&&(n=0),e+=this.offset,n+=this.offset,t){case"hex":return this.parent.hexSlice(e,n);case"utf8":case"utf-8":return this.parent.utf8Slice(e,n);case"ascii":return this.parent.asciiSlice(e,n);case"binary":return this.parent.binarySlice(e,n);case"base64":return this.parent.base64Slice(e,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},l.byteLength=r.byteLength,l.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");return this.parent.fill(t,e+this.offset,n+this.offset)},l.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),r||(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n),this.parent.copy(t.parent,e+t.offset,n+this.offset,r+this.offset)},l.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this.parent,e-t,+t+this.offset)},l.prototype.utf8Slice=function(t,e){return this.toString("utf8",t,e)},l.prototype.binarySlice=function(t,e){return this.toString("binary",t,e)},l.prototype.asciiSlice=function(t,e){return this.toString("ascii",t,e)},l.prototype.utf8Write=function(t,e){return this.write(t,e,"utf8")},l.prototype.binaryWrite=function(t,e){return this.write(t,e,"binary")},l.prototype.asciiWrite=function(t,e){return this.write(t,e,"ascii")},l.prototype.readUInt8=function(t,e){var n=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t<n.length,"Trying to read beyond buffer length")),n.parent[n.offset+t]},l.prototype.readUInt16LE=function(t,e){return d(this,t,!1,e)},l.prototype.readUInt16BE=function(t,e){return d(this,t,!0,e)},l.prototype.readUInt32LE=function(t,e){return m(this,t,!1,e)},l.prototype.readUInt32BE=function(t,e){return m(this,t,!0,e)},l.prototype.readInt8=function(t,e){var n,r=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t<r.length,"Trying to read beyond buffer length")),n=128&r.parent[r.offset+t],n?-1*(255-r.parent[r.offset+t]+1):r.parent[r.offset+t]},l.prototype.readInt16LE=function(t,e){return g(this,t,!1,e)},l.prototype.readInt16BE=function(t,e){return g(this,t,!0,e)},l.prototype.readInt32LE=function(t,e){return v(this,t,!1,e)},l.prototype.readInt32BE=function(t,e){return v(this,t,!0,e)},l.prototype.readFloatLE=function(t,e){return y(this,t,!1,e)},l.prototype.readFloatBE=function(t,e){return y(this,t,!0,e)},l.prototype.readDoubleLE=function(t,e){return b(this,t,!1,e)},l.prototype.readDoubleBE=function(t,e){return b(this,t,!0,e)},l.prototype.writeUInt8=function(t,e,n){var r=this;n||(C.ok(void 0!==t&&null!==t,"missing value"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e<r.length,"trying to write beyond buffer length"),x(t,255)),r.parent[r.offset+e]=t},l.prototype.writeUInt16LE=function(t,e,n){w(this,t,e,!1,n)},l.prototype.writeUInt16BE=function(t,e,n){w(this,t,e,!0,n)},l.prototype.writeUInt32LE=function(t,e,n){_(this,t,e,!1,n)},l.prototype.writeUInt32BE=function(t,e,n){_(this,t,e,!0,n)},l.prototype.writeInt8=function(t,e,n){var r=this;n||(C.ok(void 0!==t&&null!==t,"missing value"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e<r.length,"Trying to write beyond buffer length"),E(t,127,-128)),t>=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},l.prototype.writeInt16LE=function(t,e,n){j(this,t,e,!1,n)},l.prototype.writeInt16BE=function(t,e,n){j(this,t,e,!0,n)},l.prototype.writeInt32LE=function(t,e,n){k(this,t,e,!1,n)},l.prototype.writeInt32BE=function(t,e,n){k(this,t,e,!0,n)},l.prototype.writeFloatLE=function(t,e,n){A(this,t,e,!1,n)},l.prototype.writeFloatBE=function(t,e,n){A(this,t,e,!0,n)},l.prototype.writeDoubleLE=function(t,e,n){I(this,t,e,!1,n)},l.prototype.writeDoubleBE=function(t,e,n){I(this,t,e,!0,n)},r.prototype.readUInt8=l.prototype.readUInt8,r.prototype.readUInt16LE=l.prototype.readUInt16LE,r.prototype.readUInt16BE=l.prototype.readUInt16BE,r.prototype.readUInt32LE=l.prototype.readUInt32LE,r.prototype.readUInt32BE=l.prototype.readUInt32BE,r.prototype.readInt8=l.prototype.readInt8,r.prototype.readInt16LE=l.prototype.readInt16LE,r.prototype.readInt16BE=l.prototype.readInt16BE,r.prototype.readInt32LE=l.prototype.readInt32LE,r.prototype.readInt32BE=l.prototype.readInt32BE,r.prototype.readFloatLE=l.prototype.readFloatLE,r.prototype.readFloatBE=l.prototype.readFloatBE,r.prototype.readDoubleLE=l.prototype.readDoubleLE,r.prototype.readDoubleBE=l.prototype.readDoubleBE,r.prototype.writeUInt8=l.prototype.writeUInt8,r.prototype.writeUInt16LE=l.prototype.writeUInt16LE,r.prototype.writeUInt16BE=l.prototype.writeUInt16BE,r.prototype.writeUInt32LE=l.prototype.writeUInt32LE,r.prototype.writeUInt32BE=l.prototype.writeUInt32BE,r.prototype.writeInt8=l.prototype.writeInt8,r.prototype.writeInt16LE=l.prototype.writeInt16LE,r.prototype.writeInt16BE=l.prototype.writeInt16BE,r.prototype.writeInt32LE=l.prototype.writeInt32LE,r.prototype.writeInt32BE=l.prototype.writeInt32BE,r.prototype.writeFloatLE=l.prototype.writeFloatLE,r.prototype.writeFloatBE=l.prototype.writeFloatBE,r.prototype.writeDoubleLE=l.prototype.writeDoubleLE,r.prototype.writeDoubleBE=l.prototype.writeDoubleBE},{assert:1,"./buffer_ieee754":8,"base64-js":9}],9:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}]},{},[]),e.exports=t("buffer-browserify")},{}],69:[function(t,e){var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){if(t.source===window&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var e=n.shift();e()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],70:[function(t,e){function n(t,e){return o.init(this,e,t)}var r=t("./vendor/lodash"),i=t("async"),o=t("jxt"),a=t("xhr"),s=new DOMParser;n.prototype={constructor:{value:n},NS:"http://docs.oasis-open.org/ns/xri/xrd-1.0",EL:"XRD",toString:o.toString,toJSON:o.toJSON,get subject(){return o.getSubText(this.xml,this.NS,"Subject")},get expires(){return new Date(o.getSubText(this.xml,this.NS,"Expires"))},get aliases(){return o.getMultiSubText(this.xml,this.NS,"Alias")},get properties(){var t={},e=o.find(this.xml,this.NS,"Property");return r.each(e,function(e){var n=o.getAttribute(e,"type");t[n]=e.textContent}),t},get links(){var t=[],e=o.find(this.xml,this.NS,"Link");return r.each(e,function(e){var n={rel:o.getAttribute(e,"rel"),href:o.getAttribute(e,"href"),type:o.getAttribute(e,"type"),template:o.getAttribute(e,"template"),titles:o.getSubLangText(e,this.NS,"Title","default"),properties:{}},i=o.find(e,this.NS,"Property");r.each(i,function(t){var e=o.getAttribute(t,"type");n.properties[e]=t.textContent}),t.push(n)}),t}},e.exports=function(t,e){"string"==typeof t&&(t={host:t}),t=r.extend({ssl:!0,json:!0},t);var o=t.ssl?"https://":"http://";i.parallel({json:function(e){return t.json?(a({uri:o+t.host+"/.well-known/host-meta.json"},function(t,n,r){if(t)return e();try{e("completed",JSON.parse(r))}catch(i){e(null,{})}}),void 0):e(null,{})},xrd:function(e){a({uri:o+t.host+"/.well-known/host-meta"},function(t,r){if(t)return e(null,{});try{var i=s.parseFromString(r.body,"application/xml").childNodes[0],o=new n({},i);e("completed",o.toJSON())}catch(a){e(null,{})}})}},function(t,n){if(t){if(Object.keys(n.json).length)return e(!1,n.json);if(Object.keys(n.xrd).length)return e(!1,n.xrd)}e("no-host-meta",{})})}},{"./vendor/lodash":76,async:56,jxt:71,xhr:73}],71:[function(t,e,n){var r=t("./vendor/lodash"),i=new XMLSerializer,o="http://www.w3.org/XML/1998/namespace",a={},s={},u={},c=n.find=function(t,e,n){var i=t.querySelectorAll(n);return r.filter(i,function(n){return n.namespaceURI===e&&n.parentNode==t})};n.findOrCreate=function(t,e,n){var r=c(t,e,n);if(r.length)return r[0];var i=document.createElementNS(e,n);return t.appendChild(i),i},n.init=function(t,e,n){return t.xml=e||document.createElementNS(t.NS,t.EL),t.xml.parentNode&&t.xml.parentNode.namespaceURI===t.NS||t.xml.setAttribute("xmlns",t.NS),t._extensions={},r.each(t.xml.childNodes,function(e){var n=e.namespaceURI+"|"+e.localName,r=s[n];if(void 0!==r){var i=r.prototype._name;t._extensions[i]=new r(null,e),t._extensions[i].parent=t}}),r.extend(t,n),t},n.getSubText=function(t,e,n){var r=c(t,e,n);if(!r)return"";for(var i=0;i<r.length;i++)if(r[i].namespaceURI===e)return r[i].textContent||"";return""},n.getMultiSubText=function(t,e,n,r){var i=c(t,e,n),o=[];r=r||function(t){return t.textContent||""};for(var a=0;a<i.length;a++)i[a].namespaceURI===e&&o.push(r(i[a]));return o},n.getSubLangText=function(t,e,n,r){var i=c(t,e,n);if(!i)return{};for(var a,s,u={},f=[],l=0;l<i.length;l++)s=i[l],s.namespaceURI===e&&(a=s.getAttributeNS(o,"lang")||r,f.push(a),u[a]=s.textContent||"");return u},n.setSubText=function(t,e,n,r){var i=c(t,e,n);if(i.length){for(var o=0;o<i.length;o++)if(i[o].namespaceURI===e){if(r)return i[o].textContent=r,void 0;t.removeChild(i[o])}}else if(r){var a=document.createElementNS(e,n);a.textContent=r,t.appendChild(a)}},n.setMultiSubText=function(t,e,n,i,o){var a=c(t,e,n),s=[];o=o||function(r){var i=document.createElementNS(e,n);i.textContent=r,t.appendChild(i)},s="string"==typeof i?(i||"").split("\n"):i,r.forEach(a,function(e){t.removeChild(e)}),r.forEach(s,function(t){t&&o(t)})},n.setSubLangText=function(t,e,n,r,i){var a,s,u=c(t,e,n);if(u.length)for(var f=0;f<u.length;f++)a=u[f],a.namespaceURI===e&&t.removeChild(a);if("string"==typeof r)a=document.createElementNS(e,n),a.textContent=r,t.appendChild(a);else if("object"==typeof r)for(s in r)r.hasOwnProperty(s)&&(a=document.createElementNS(e,n),s!==i&&a.setAttributeNS(o,"lang",s),a.textContent=r[s],t.appendChild(a))},n.getAttribute=function(t,e,n){return t.getAttribute(e)||n||""},n.setAttribute=function(t,e,n,r){n||r?t.setAttribute(e,n):t.removeAttribute(e)},n.getBoolAttribute=function(t,e,n){var r=t.getAttribute(e)||n||"";return"true"===r||"1"===r},n.setBoolAttribute=function(t,e,n){n?t.setAttribute(e,"1"):t.removeAttribute(e)},n.getSubAttribute=function(t,e,n,r,i){var o=c(t,e,n);if(!o)return"";for(var a=0;a<o.length;a++)if(o[a].namespaceURI===e)return o[a].getAttribute(r)||i||"";return""},n.setSubAttribute=function(t,e,n,r,i){var o=c(t,e,n);if(o.length){for(var a=0;a<o.length;a++)if(o[a].namespaceURI===e){if(i)return o[a].setAttribute(r,i),void 0;o[a].removeAttribute(r)}}else i&&(n=document.createElementNS(e,n),n.setAttribute(r,i),t.appendChild(n))},n.toString=function(){return i.serializeToString(this.xml)},n.toJSON=function(){var t,e={},n={constructor:!0,NS:!0,EL:!0,toString:!0,toJSON:!0,_extensions:!0,prototype:!0,xml:!0,parent:!0,_name:!0};for(t in this._extensions)this._extensions[t].toJSON&&(e[t]=this._extensions[t].toJSON());for(t in this)if(!n[t]&&!(u[this.NS+"|"+this.EL]||{})[t]&&!this._extensions[t]&&"_"!==t[0]){var r=this[t];if("function"==typeof r)continue;var i=Object.prototype.toString.call(r);i.indexOf("Object")>=0?Object.keys(r).length>0&&(e[t]=r):i.indexOf("Array")>=0?r.length>0&&(e[t]=r):r&&(e[t]=r)}return e},n.extend=function(t,e){var i=t.prototype.NS+"|"+t.prototype.EL,o=e.prototype._name,a=e.prototype.NS+"|"+e.prototype.EL;s[a]=e,u[a]||(u[a]={}),u[i]||(u[i]={}),u[i][o]=e,t.prototype.__defineGetter__(o,function(){if(!this._extensions[o]){var t=n.find(this.xml,e.prototype.NS,e.prototype.EL);t.length?this._extensions[o]=new e(null,t[0]):(this._extensions[o]=new e,this.xml.appendChild(this._extensions[o].xml)),this._extensions[o].parent=this}return this._extensions[o]}),t.prototype.__defineSetter__(o,function(t){var e=this[o];r.extend(e,t)})},n.topLevel=function(t){var e=t.prototype.NS+"|"+t.prototype.EL;s[e]=t,a[e]=t},n.build=function(t){var e=a[t.namespaceURI+"|"+t.localName];return e?new e(null,t):void 0},n.XML_NS=o,n.TOP_LEVEL_LOOKUP=a,n.LOOKUP_EXT=u,n.LOOKUP=s},{"./vendor/lodash":72}],72:[function(e,n,r){var i=self;!function(e){function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function a(t){t.length=0,y.length<w&&y.push(t)}function s(t){var e=t.k;e&&s(e),t.b=t.k=t.object=t.number=t.string=null,b.length<w&&b.push(t)}function u(){}function c(){var t=b.pop()||{a:"",b:null,c:"",k:null,"false":!1,d:"",e:"",f:"","null":!1,number:null,object:null,push:null,g:null,string:null,h:"","true":!1,undefined:!1,i:!1,j:!1};t.g=E,t.b=t.c=t.f=t.h="",t.e="r",t.i=!0,t.j=!!ee;for(var e,n=0;e=arguments[n];n++)for(var r in e)t[r]=e[r];n=t.a,t.d=/^[^,]+/.exec(n)[0],e=Function,n="return function("+n+"){",r="var m,r="+t.d+",C="+t.e+";if(!r)return C;"+t.h+";",t.b?(r+="var s=r.length;m=-1;if("+t.b+"){",Y.unindexedChars&&(r+="if(q(r)){r=r.split('')}"),r+="while(++m<s){"+t.f+";}}else{"):Y.nonEnumArgs&&(r+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+t.f+";}}else{"),Y.enumPrototypes&&(r+="var E=typeof r=='function';"),Y.enumErrorProps&&(r+="var D=r===j||r instanceof Error;");var i=[];if(Y.enumPrototypes&&i.push('!(E&&m=="prototype")'),Y.enumErrorProps&&i.push('!(D&&(m=="message"||m=="name"))'),t.i&&t.j)r+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",i.length&&(r+="if("+i.join("&&")+"){"),r+=t.f+";",i.length&&(r+="}"),r+="}";else if(r+="for(m in r){",t.i&&i.push("l.call(r, m)"),i.length&&(r+="if("+i.join("&&")+"){"),r+=t.f+";",i.length&&(r+="}"),r+="}",Y.nonEnumShadows){for(r+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)r+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(r+="||(!v[m]&&r[m]!==y[m])"),r+="){"+t.f+"}";r+="}"}return(t.b||Y.nonEnumArgs)&&(r+="}"),r+=t.c+";return C",e=e("i,j,l,n,o,q,t,u,y,z,w,G,H,J",n+r+"}"),s(t),e(C,U,D,f,Z,d,ee,u,z,q,K,T,R,J)}function f(t){return J.call(t)==S}function l(t,e,n,r,i,s){var c=n===x;if("function"==typeof n&&!c){n=u.createCallback(n,r,2);var h=n(t,e);if("undefined"!=typeof h)return!!h}if(t===e)return 0!==t||1/t==1/e;var d=typeof t,m=typeof e;if(t===t&&(!t||"function"!=d&&"object"!=d)&&(!e||"function"!=m&&"object"!=m))return!1;if(null==t||null==e)return t===e;if(m=J.call(t),d=J.call(e),m==S&&(m=O),d==S&&(d=O),m!=d)return!1;switch(m){case A:case I:return+t==+e;case N:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case L:case T:return t==e+""}if(d=m==j,!d){if(D.call(t,"__wrapped__")||D.call(e,"__wrapped__"))return l(t.__wrapped__||t,e.__wrapped__||e,n,r,i,s);if(m!=O||!Y.nodeClass&&(o(t)||o(e)))return!1;var m=!Y.argsObject&&f(t)?Object:t.constructor,g=!Y.argsObject&&f(e)?Object:e.constructor;if(!(m==g||p(m)&&m instanceof m&&p(g)&&g instanceof g))return!1}for(g=!i,i||(i=y.pop()||[]),s||(s=y.pop()||[]),m=i.length;m--;)if(i[m]==t)return s[m]==e;var v=0,h=!0;if(i.push(t),s.push(e),d){if(m=t.length,v=e.length,h=v==t.length,!h&&!c)return h;for(;v--;)if(d=m,g=e[v],c)for(;d--&&!(h=l(t[d],g,n,r,i,s)););else if(!(h=l(t[v],g,n,r,i,s)))break;return h}return re(e,function(e,o,a){return D.call(a,o)?(v++,h=D.call(t,o)&&l(t[o],e,n,r,i,s)):void 0}),h&&!c&&re(t,function(t,e,n){return D.call(n,e)?h=-1<--v:void 0}),g&&(a(i),a(s)),h}function p(t){return"function"==typeof t}function h(t){return!(!t||!q[typeof t])}function d(t){return"string"==typeof t||J.call(t)==T}function m(t,e,n){var r=[];if(e=u.createCallback(e,n),Z(t)){n=-1;for(var i=t.length;++n<i;){var o=t[n];e(o,n,t)&&r.push(o)}}else ne(t,function(t,n,i){e(t,n,i)&&r.push(t)});return r}function g(t,e,n){if(e&&"undefined"==typeof n&&Z(t)){n=-1;for(var r=t.length;++n<r&&!1!==e(t[n],n,t););}else ne(t,e,n);return t}function v(t){return t}var y=[],b=[],x={},w=40,_=(_=/\bthis\b/)&&_.test(function(){return this})&&_,E="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),S="[object Arguments]",j="[object Array]",A="[object Boolean]",I="[object Date]",C="[object Error]",N="[object Number]",O="[object Object]",L="[object RegExp]",T="[object String]",q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B=q[typeof r]&&r,M=q[typeof n]&&n&&n.exports==B&&n,F=q[typeof i]&&i;!F||F.global!==F&&F.window!==F||(e=F);var U=Error.prototype,z=Object.prototype,R=String.prototype,F=RegExp("^"+(z.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),P=Function.prototype.toString,D=z.hasOwnProperty,W=z.propertyIsEnumerable,J=z.toString,G=F.test(G=J.bind)&&G,$=F.test($=Object.create)&&$,X=F.test(X=Array.isArray)&&X,H=F.test(H=Object.keys)&&H,$=F.test(e.attachEvent),V=G&&!/\n|true/.test(G+$),K={};K[j]=K[I]=K[N]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},K[A]=K[T]={constructor:!0,toString:!0,valueOf:!0},K[C]=K["[object Function]"]=K[L]={constructor:!0,toString:!0},K[O]={constructor:!0},function(){for(var t=E.length;t--;){var e,n=E[t];for(e in K)D.call(K,e)&&!D.call(K[e],n)&&(K[e][n]=!1)}}();var Y=u.support={};!function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);Y.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),Y.argsClass=f(arguments),Y.enumErrorProps=W.call(U,"message")||W.call(U,"name"),Y.enumPrototypes=W.call(t,"prototype"),Y.fastBind=G&&!V,Y.nonEnumArgs=0!=n,Y.nonEnumShadows=!/valueOf/.test(e),Y.unindexedChars="xx"!="x"[0]+Object("x")[0];try{Y.nodeClass=!(J.call(document)==O&&!({toString:0}+""))}catch(r){Y.nodeClass=!0}}(1);var Q={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},$={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},F={h:"if(!z[typeof r])return C;"+$.h,b:!1};Y.argsClass||(f=function(t){return t?D.call(t,"callee"):!1});var Z=X||function(t){return t?"object"==typeof t&&J.call(t)==j:!1},te=c({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),ee=H?function(t){return h(t)?Y.enumPrototypes&&"function"==typeof t||Y.nonEnumArgs&&t.length&&f(t)?te(t):H(t):[]}:te,ne=c($),X=c(Q,{h:Q.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),re=c($,F,{i:!1});p(/x/)&&(p=function(t){return"function"==typeof t&&"[object Function]"==J.call(t)}),u.assign=X,u.createCallback=function(t,e,n){if(null==t)return v;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=ee(t);return function(e){for(var n=i.length,r=!1;n--&&(r=l(e[i[n]],t[i[n]],x)););return r}}return"undefined"==typeof e||_&&!_.test(P.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}},u.filter=m,u.forEach=g,u.forIn=re,u.keys=ee,u.each=g,u.extend=X,u.select=m,u.identity=v,u.isArguments=f,u.isArray=Z,u.isEqual=l,u.isFunction=p,u.isObject=h,u.isString=d,u.VERSION="1.3.1","function"==typeof t&&"object"==typeof t.amd&&t.amd?(e._=u,t(function(){return u})):B&&!B.nodeType?M?(M.exports=u)._=u:B._=u:e._=u}(this)},{}],73:[function(t,e){function n(t,e){function n(){4===f.readyState&&i()}function i(){var t=null,n=f.statusCode=f.status,r=f.body=f.response||f.responseText||f.responseXML;if(0===n||n>=400&&600>n){var i=f.responseText||a[String(f.status).charAt(0)];t=new Error(i),t.statusCode=f.status}if(m)try{r=f.body=JSON.parse(r)}catch(o){}e(t,f,r)}function c(t){e(t,f)}"string"==typeof t&&(t={uri:t}),t=t||{},e=o(e);var f;t.cors?(f=new u,f.withCredentials=!0):f=new s;var l=f.url=t.uri,p=f.method=t.method||"GET",h=t.body||t.data,d=f.headers=t.headers||{},m=!1;return"json"in t&&(m=!0,d["Content-Type"]="application/json",h=JSON.stringify(t.json)),f.onreadystatechange=n,f.onload=i,f.onerror=c,f.onprogress=function(){},f.ontimeout=r,f.open(p,l),f.timeout="timeout"in t?t.timeout:5e3,f.setRequestHeader&&Object.keys(d).forEach(function(t){f.setRequestHeader(t,d[t])}),f.send(h),f}function r(){}var i=t("global/window"),o=t("once"),a={0:"Internal XMLHttpRequest Error",4:"4xx Client Error",5:"5xx Server Error"},s=i.XMLHttpRequest||r,u="withCredentials"in new s?i.XMLHttpRequest:i.XDomainRequest;
e.exports=n},{"global/window":74,once:75}],74:[function(t,e){var n=self;e.exports="undefined"!=typeof window?window:"undefined"!=typeof n?n:{}},{}],75:[function(t,e){function n(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}e.exports=n,n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0})})},{}],76:[function(e,n,r){var i=self;!function(e){function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function a(t){t.length=0,v.length<x&&v.push(t)}function s(t){var e=t.k;e&&s(e),t.b=t.k=t.object=t.number=t.string=null,y.length<x&&y.push(t)}function u(){}function c(){var t=y.pop()||{a:"",b:null,c:"",k:null,"false":!1,d:"",e:"",f:"","null":!1,number:null,object:null,push:null,g:null,string:null,h:"","true":!1,undefined:!1,i:!1,j:!1};t.g=_,t.b=t.c=t.f=t.h="",t.e="r",t.i=!0,t.j=!!te;for(var e,n=0;e=arguments[n];n++)for(var r in e)t[r]=e[r];n=t.a,t.d=/^[^,]+/.exec(n)[0],e=Function,n="return function("+n+"){",r="var m,r="+t.d+",C="+t.e+";if(!r)return C;"+t.h+";",t.b?(r+="var s=r.length;m=-1;if("+t.b+"){",K.unindexedChars&&(r+="if(q(r)){r=r.split('')}"),r+="while(++m<s){"+t.f+";}}else{"):K.nonEnumArgs&&(r+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+t.f+";}}else{"),K.enumPrototypes&&(r+="var E=typeof r=='function';"),K.enumErrorProps&&(r+="var D=r===j||r instanceof Error;");var i=[];if(K.enumPrototypes&&i.push('!(E&&m=="prototype")'),K.enumErrorProps&&i.push('!(D&&(m=="message"||m=="name"))'),t.i&&t.j)r+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",i.length&&(r+="if("+i.join("&&")+"){"),r+=t.f+";",i.length&&(r+="}"),r+="}";else if(r+="for(m in r){",t.i&&i.push("l.call(r, m)"),i.length&&(r+="if("+i.join("&&")+"){"),r+=t.f+";",i.length&&(r+="}"),r+="}",K.nonEnumShadows){for(r+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)r+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(r+="||(!v[m]&&r[m]!==y[m])"),r+="){"+t.f+"}";r+="}"}return(t.b||K.nonEnumArgs)&&(r+="}"),r+=t.c+";return C",e=e("i,j,l,n,o,q,t,u,y,z,w,G,H,J",n+r+"}"),s(t),e(I,F,P,f,Q,d,te,u,U,T,V,L,z,W)}function f(t){return W.call(t)==E}function l(t,e,n,r,i,s){var c=n===b;if("function"==typeof n&&!c){n=u.createCallback(n,r,2);var h=n(t,e);if("undefined"!=typeof h)return!!h}if(t===e)return 0!==t||1/t==1/e;var d=typeof t,m=typeof e;if(t===t&&(!t||"function"!=d&&"object"!=d)&&(!e||"function"!=m&&"object"!=m))return!1;if(null==t||null==e)return t===e;if(m=W.call(t),d=W.call(e),m==E&&(m=N),d==E&&(d=N),m!=d)return!1;switch(m){case j:case A:return+t==+e;case C:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case O:case L:return t==e+""}if(d=m==S,!d){if(P.call(t,"__wrapped__")||P.call(e,"__wrapped__"))return l(t.__wrapped__||t,e.__wrapped__||e,n,r,i,s);if(m!=N||!K.nodeClass&&(o(t)||o(e)))return!1;var m=!K.argsObject&&f(t)?Object:t.constructor,g=!K.argsObject&&f(e)?Object:e.constructor;if(!(m==g||p(m)&&m instanceof m&&p(g)&&g instanceof g))return!1}for(g=!i,i||(i=v.pop()||[]),s||(s=v.pop()||[]),m=i.length;m--;)if(i[m]==t)return s[m]==e;var y=0,h=!0;if(i.push(t),s.push(e),d){if(m=t.length,y=e.length,h=y==t.length,!h&&!c)return h;for(;y--;)if(d=m,g=e[y],c)for(;d--&&!(h=l(t[d],g,n,r,i,s)););else if(!(h=l(t[y],g,n,r,i,s)))break;return h}return ne(e,function(e,o,a){return P.call(a,o)?(y++,h=P.call(t,o)&&l(t[o],e,n,r,i,s)):void 0}),h&&!c&&ne(t,function(t,e,n){return P.call(n,e)?h=-1<--y:void 0}),g&&(a(i),a(s)),h}function p(t){return"function"==typeof t}function h(t){return!(!t||!T[typeof t])}function d(t){return"string"==typeof t||W.call(t)==L}function m(t,e,n){if(e&&"undefined"==typeof n&&Q(t)){n=-1;for(var r=t.length;++n<r&&!1!==e(t[n],n,t););}else ee(t,e,n);return t}function g(t){return t}var v=[],y=[],b={},x=40,w=(w=/\bthis\b/)&&w.test(function(){return this})&&w,_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),E="[object Arguments]",S="[object Array]",j="[object Boolean]",A="[object Date]",I="[object Error]",C="[object Number]",N="[object Object]",O="[object RegExp]",L="[object String]",T={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},q=T[typeof r]&&r,B=T[typeof n]&&n&&n.exports==q&&n,M=T[typeof i]&&i;!M||M.global!==M&&M.window!==M||(e=M);var F=Error.prototype,U=Object.prototype,z=String.prototype,M=RegExp("^"+(U.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),R=Function.prototype.toString,P=U.hasOwnProperty,D=U.propertyIsEnumerable,W=U.toString,J=M.test(J=W.bind)&&J,G=M.test(G=Object.create)&&G,$=M.test($=Array.isArray)&&$,X=M.test(X=Object.keys)&&X,G=M.test(e.attachEvent),H=J&&!/\n|true/.test(J+G),V={};V[S]=V[A]=V[C]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},V[j]=V[L]={constructor:!0,toString:!0,valueOf:!0},V[I]=V["[object Function]"]=V[O]={constructor:!0,toString:!0},V[N]={constructor:!0},function(){for(var t=_.length;t--;){var e,n=_[t];for(e in V)P.call(V,e)&&!P.call(V[e],n)&&(V[e][n]=!1)}}();var K=u.support={};!function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);K.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),K.argsClass=f(arguments),K.enumErrorProps=D.call(F,"message")||D.call(F,"name"),K.enumPrototypes=D.call(t,"prototype"),K.fastBind=J&&!H,K.nonEnumArgs=0!=n,K.nonEnumShadows=!/valueOf/.test(e),K.unindexedChars="xx"!="x"[0]+Object("x")[0];try{K.nodeClass=!(W.call(document)==N&&!({toString:0}+""))}catch(r){K.nodeClass=!0}}(1);var Y={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},G={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},M={h:"if(!z[typeof r])return C;"+G.h,b:!1};K.argsClass||(f=function(t){return t?P.call(t,"callee"):!1});var Q=$||function(t){return t?"object"==typeof t&&W.call(t)==S:!1},Z=c({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),te=X?function(t){return h(t)?K.enumPrototypes&&"function"==typeof t||K.nonEnumArgs&&t.length&&f(t)?Z(t):X(t):[]}:Z,ee=c(G),$=c(Y,{h:Y.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),ne=c(G,M,{i:!1});p(/x/)&&(p=function(t){return"function"==typeof t&&"[object Function]"==W.call(t)}),u.assign=$,u.createCallback=function(t,e,n){if(null==t)return g;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=te(t);return function(e){for(var n=i.length,r=!1;n--&&(r=l(e[i[n]],t[i[n]],b)););return r}}return"undefined"==typeof e||w&&!w.test(R.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}},u.forEach=m,u.forIn=ne,u.keys=te,u.each=m,u.extend=$,u.identity=g,u.isArguments=f,u.isArray=Q,u.isEqual=l,u.isFunction=p,u.isObject=h,u.isString=d,u.VERSION="1.3.1","function"==typeof t&&"object"==typeof t.amd&&t.amd?(e._=u,t(function(){return u})):q&&!q.nodeType?B?(B.exports=u)._=u:q._=u:e._=u}(this)},{}],77:[function(t,e){"use strict";var n=t("lodash"),r=t("./lib/core"),i=t("./lib/helpers"),o=t("./lib/types");e.exports=n.extend({},r,i,o)},{"./lib/core":78,"./lib/helpers":79,"./lib/types":80,lodash:81}],78:[function(t,e,n){"use strict";function r(t){var e=t.prototype._NS+"|"+t.prototype._EL;c[e]=t,l[e]=t}function i(t){return u.serializeToString(t)}function o(t){var e,n={},r={constructor:!0,_EL:!0,_NS:!0,_extensions:!0,_name:!0,parent:!0,prototype:!0,toJSON:!0,toString:!0,xml:!0};for(e in t._extensions)t._extensions[e].toJSON&&(n[e]=t._extensions[e].toJSON());for(e in t)if(!r[e]&&!(f[t._NS+"|"+t._EL]||{})[e]&&!t._extensions[e]&&"_"!==e[0]){var i=t[e];if("function"==typeof i)continue;var o=Object.prototype.toString.call(i);o.indexOf("Object")>=0?Object.keys(i).length>0&&(n[e]=i):o.indexOf("Array")>=0?i.length>0&&(n[e]=i):i&&(n[e]=i)}return n}var a=t("underscore");t("./helpers").find;var s=t("./types"),u=new XMLSerializer,c={},f={},l={};n.build=function(t){var e=l[t.namespaceURI+"|"+t.localName];return e?new e(null,t):void 0},n.extend=function(t,e,r){var i=t.prototype._NS+"|"+t.prototype._EL,o=e.prototype._name,a=e.prototype._NS+"|"+e.prototype._EL;c[a]=e,f[a]||(f[a]={}),f[i]||(f[i]={}),f[i][o]=e,n.add(t,o,s.extension(e)),r&&n.add(t,r,s.multiExtension(e))},n.add=function(t,e,n){n.get&&t.prototype.__defineGetter__(e,n.get),n.set&&t.prototype.__defineSetter__(e,n.set)},n.define=function(t){var e=function(e,n){var r=this;return r.xml=n||document.createElementNS(r._NS,r._EL),r.xml.parentNode&&r.xml.parentNode.namespaceURI===r._NS||r.xml.setAttribute("xmlns",r._NS),r._extensions={},a.each(r.xml.childNodes,function(t){var e=t.namespaceURI+"|"+t.localName,n=c[e];if(void 0!==n){var i=n.prototype._name;r._extensions[i]=new n(null,t),r._extensions[i].parent=r}}),a.extend(r,e),t.init&&t.init(e),r};e.prototype={constructor:{value:e},_name:t.name,_eventname:t.eventName,_NS:t.namespace,_EL:t.element,toString:function(){return i(this.xml)},toJSON:function(){return o(this)}};var s=Object.keys(t.fields||{});return s.forEach(function(r){n.add(e,r,t.fields[r])}),t.topLevel&&r(e),e}},{"./helpers":79,"./types":80,underscore:96}],79:[function(t,e,n){"use strict";var r=t("underscore"),i="http://www.w3.org/XML/1998/namespace";n.getParser=function(){return new DOMParser},n.createElement=function(t,e,r){var i=document.createElementNS(t,e);return r&&r!==t&&n.setAttribute(i,"xmlns",t),i};var o=n.find=function(t,e,n){var i=t.querySelectorAll(n);return r.filter(i,function(n){return n.namespaceURI===e&&n.parentNode==t})};n.findOrCreate=function(t,e,r){var i=n.find(t,e,r);if(i.length)return i[0];var o=n.createElement(e,r,t.namespaceURI);return t.appendChild(o),o},n.getAttribute=function(t,e,n){return t.getAttribute(e)||n||""},n.setAttribute=function(t,e,n,r){n||r?t.setAttribute(e,n):t.removeAttribute(e)},n.getBoolAttribute=function(t,e,n){var r=t.getAttribute(e)||n||"";return"true"===r||"1"===r},n.setBoolAttribute=function(t,e,n){n?t.setAttribute(e,"1"):t.removeAttribute(e)},n.getSubAttribute=function(t,e,n,r,i){var a=o(t,e,n);if(!a)return"";for(var s=0;s<a.length;s++)return a[s].getAttribute(r)||i||"";return""},n.setSubAttribute=function(t,e,r,i,a){var s=o(t,e,r);if(s.length)for(var u=0;u<s.length;u++){if(a)return s[u].setAttribute(i,a),void 0;s[u].removeAttribute(i)}else a&&(r=n.createElement(e,r,t.namespaceURI),r.setAttribute(i,a),t.appendChild(r))},n.getText=function(t){return t.textContent},n.setText=function(t,e){t.textContent=e},n.getSubText=function(t,e,n,r){var i=o(t,e,n);return r=r||"",i.length?i[0].textContent||r:r},n.setSubText=function(t,e,r,i){var a=o(t,e,r);if(a.length)for(var s=0;s<a.length;s++){if(i)return a[s].textContent=i,void 0;t.removeChild(a[s])}else if(i){var u=n.createElement(e,r,t.namespaceURI);u.textContent=i,t.appendChild(u)}},n.getMultiSubText=function(t,e,n,r){var i=o(t,e,n),a=[];r=r||function(t){return t.textContent||""};for(var s=0;s<i.length;s++)a.push(r(i[s]));return a},n.setMultiSubText=function(t,e,i,a,s){var u=o(t,e,i),c=[];s=s||function(r){var o=n.createElement(e,i,t.namespaceURI);o.textContent=r,t.appendChild(o)},c="string"==typeof a?(a||"").split("\n"):a,r.forEach(u,function(e){t.removeChild(e)}),r.forEach(c,function(t){t&&s(t)})},n.getSubLangText=function(t,e,n,r){var a=o(t,e,n);if(!a.length)return{};for(var s,u,c={},f=[],l=0;l<a.length;l++)u=a[l],s=u.getAttributeNS(i,"lang")||r,f.push(s),c[s]=u.textContent||"";return c},n.setSubLangText=function(t,e,r,a,s){var u,c,f=o(t,e,r);if(f.length)for(var l=0;l<f.length;l++)t.removeChild(f[l]);if("string"==typeof a)u=n.createElement(e,r,t.namespaceURI),u.textContent=a,t.appendChild(u);else if("object"==typeof a)for(c in a)a.hasOwnProperty(c)&&(u=n.createElement(e,r,t.namespaceURI),c!==s&&u.setAttributeNS(i,"lang",c),u.textContent=a[c],t.appendChild(u))},n.getBoolSub=function(t,e,n){var r=o(t,e,n);return!!r.length},n.setBoolSub=function(t,e,r,i){var a=o(t,e,r);if(a.length)for(var s=0;s<a.length;s++){if(i)return;t.removeChild(a[s])}else if(i){var u=n.createElement(e,r,t.namespaceURI);t.appendChild(u)}}},{underscore:96}],80:[function(t,e,n){"use strict";var r=t("underscore"),i=t("./helpers"),o=i.find,a=n.field=function(t,e){return function(){var n=r.toArray(arguments);return{get:function(){return t.apply(null,[this.xml].concat(n))},set:function(t){e.apply(null,[this.xml].concat(n).concat([t]))}}}};n.field=a,n.boolAttribute=a(i.getBoolAttribute,i.setBoolAttribute),n.subAttribute=a(i.getSubAttribute,i.setSubAttribute),n.text=a(i.getText,i.setText),n.subText=a(i.getSubText,i.setSubText),n.multiSubText=a(i.getMultiSubText,i.setMultiSubText),n.subLangText=a(i.getSubLangText,i.setSubLangText),n.boolSub=a(i.getBoolSub,i.setBoolSub),n.attribute=function(t,e){return{get:function(){return i.getAttribute(this.xml,t,e)},set:function(e){i.setAttribute(this.xml,t,e)}}},n.extension=function(t){return{get:function(){var e=t.prototype._name;if(!this._extensions[e]){var n=o(this.xml,t.prototype._NS,t.prototype._EL);n.length?this._extensions[e]=new t(null,n[0]):(this._extensions[e]=new t,this.xml.appendChild(this._extensions[e].xml)),this._extensions[e].parent=this}return this._extensions[e]},set:function(e){var n=this[t.prototype._name];r.extend(n,e)}}},n.multiExtension=function(t){return{get:function(){var e=o(this.xml,t.prototype._NS,t.prototype._EL),n=[];return r.forEach(e,function(e){n.push(new t({},e).toJSON())}),n},set:function(e){var n=this,i=o(this.xml,t.prototype._NS,t.prototype._EL);r.forEach(i,function(t){n.xml.removeChild(t)}),r.forEach(e,function(e){var r=new t(e);n.xml.appendChild(r.xml)})}}}},{"./helpers":79,underscore:96}],81:[function(e,n,r){var i=self;!function(){function e(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r<i;)if(t[r]===e)return r;return-1}function o(t,n){var r=typeof n;if(t=t.cache,"boolean"==r||null==n)return t[n]?0:-1;"number"!=r&&"string"!=r&&(r="object");var i="number"==r?n:_+n;return t=(t=t[r])&&t[i],"object"==r?t&&e(t,n)>-1?0:-1:t?0:-1}function a(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:_+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function s(t){return t.charCodeAt(0)}function u(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||"undefined"==typeof n)return 1;if(r>n||"undefined"==typeof r)return-1}return t.index-e.index}function c(t){var e=-1,n=t.length,r=t[0],i=t[0|n/2],o=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=p();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=p();for(u.array=t,u.cache=s,u.push=a;++e<n;)u.push(t[e]);return u}function f(t){return"\\"+K[t]}function l(){return b.pop()||[]}function p(){return x.pop()||{array:null,cache:null,configurable:!1,criteria:null,enumerable:!1,"false":!1,index:0,leading:!1,maxWait:0,"null":!1,number:null,object:null,push:null,string:null,trailing:!1,"true":!1,undefined:!1,value:null,writable:!1}}function h(){}function d(t){t.length=0,b.length<S&&b.push(t)}function m(t){var e=t.cache;e&&m(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,x.length<S&&x.push(t)}function g(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(0>i?0:i);++r<i;)o[r]=t[e+r];return o}function v(t){function n(t){return t&&"object"==typeof t&&!Hr(t)&&Er.call(t,"__wrapped__")?t:new r(t)}function r(t,e){this.__chain__=!!e,this.__wrapped__=t}function i(t,e,n,r,o){var a=t;if(n){if(a=n(a),"undefined"!=typeof a)return a;a=t}var s=Se(a);if(s){var u=Cr.call(a);if(!H[u])return a;var c=Hr(a)}if(!s||!e)return s?c?g(a):ei({},a):a;var f=Gr[u];switch(u){case P:case D:return new f(+a);case J:case X:return new f(a);case $:return f(a.source,N.exec(a))}var p=!r;r||(r=l()),o||(o=l());for(var h=r.length;h--;)if(r[h]==t)return o[h];return a=c?f(a.length):{},c&&(Er.call(t,"index")&&(a.index=t.index),Er.call(t,"input")&&(a.input=t.input)),r.push(t),o.push(a),(c?We:ii)(t,function(t,s){a[s]=i(t,e,n,r,o)}),p&&(d(r),d(o)),a}function a(t,e,n){if("function"!=typeof t)return Jn;if("undefined"==typeof e)return t;var r=t.__bindData__||$r.funcNames&&!t.name;if("undefined"==typeof r){var i=B&&wr.call(t);$r.funcNames||!i||O.test(i)||(r=!0),($r.funcNames||!r)&&(r=!$r.funcDecomp||B.test(i),Xr(t,r))}if(r!==!0&&r&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return In(t,e)}function b(t,e,n,r){for(var i=(r||0)-1,o=t?t.length:0,a=[];++i<o;){var s=t[i];if(s&&"object"==typeof s&&"number"==typeof s.length&&(Hr(s)||se(s))){e||(s=b(s,e,n));var u=-1,c=s.length,f=a.length;for(a.length+=c;++u<c;)a[f++]=s[u]}else n||a.push(s)}return a}function x(t,e,n,r,i,o){if(n){var a=n(t,e);if("undefined"!=typeof a)return!!a}if(t===e)return 0!==t||1/t==1/e;var s=typeof t,u=typeof e;if(!(t!==t||t&&V[s]||e&&V[u]))return!1;if(null==t||null==e)return t===e;var c=Cr.call(t),f=Cr.call(e);if(c==z&&(c=G),f==z&&(f=G),c!=f)return!1;switch(c){case P:case D:return+t==+e;case J:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case $:case X:return t==pr(e)}var p=c==R;if(!p){if(Er.call(t,"__wrapped__ ")||Er.call(e,"__wrapped__"))return x(t.__wrapped__||t,e.__wrapped__||e,n,r,i,o);if(c!=G)return!1;var h=t.constructor,m=e.constructor;if(h!=m&&!(Ee(h)&&h instanceof h&&Ee(m)&&m instanceof m))return!1}var g=!i;i||(i=l()),o||(o=l());for(var v=i.length;v--;)if(i[v]==t)return o[v]==e;var y=0;if(a=!0,i.push(t),o.push(e),p){if(v=t.length,y=e.length,a=y==t.length,!a&&!r)return a;for(;y--;){var b=v,w=e[y];if(r)for(;b--&&!(a=x(t[b],w,n,r,i,o)););else if(!(a=x(t[y],w,n,r,i,o)))break}return a}return ri(e,function(e,s,u){return Er.call(u,s)?(y++,a=Er.call(t,s)&&x(t[s],e,n,r,i,o)):void 0}),a&&!r&&ri(t,function(t,e,n){return Er.call(n,e)?a=--y>-1:void 0}),g&&(d(i),d(o)),a}function S(t,e,n,r,i){(Hr(e)?We:ii)(e,function(e,o){var a,s,u=e,c=t[o];if(e&&((s=Hr(e))||oi(e))){for(var f=r.length;f--;)if(a=r[f]==e){c=i[f];break}if(!a){var l;n&&(u=n(c,e),(l="undefined"!=typeof u)&&(c=u)),l||(c=s?Hr(c)?c:[]:oi(c)?c:{}),r.push(e),i.push(c),l||S(c,e,n,r,i)}}else n&&(u=n(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[o]=c})}function K(t,n,r){var i=-1,a=ie(),s=t?t.length:0,u=[],f=!n&&s>=E&&a===e,p=r||f?l():u;if(f){var h=c(p);h?(a=o,p=h):(f=!1,p=r?p:(d(p),u))}for(;++i<s;){var g=t[i],v=r?r(g,i,t):g;(n?!i||p[p.length-1]!==v:a(p,v)<0)&&((r||f)&&p.push(v),u.push(g))}return f?(d(p.array),m(p)):r&&d(p),u}function Q(t){return function(e,r,i){var o={};r=n.createCallback(r,i,3);var a=-1,s=e?e.length:0;if("number"==typeof s)for(;++a<s;){var u=e[a];t(o,u,r(u,a,e),e)}else ii(e,function(e,n,i){t(o,e,r(e,n,i),i)});return o}}function Z(t,e,n,r,i,o){var a=1&e,s=2&e,u=4&e,c=8&e,f=16&e,l=32&e,p=t;if(!s&&!Ee(t))throw new hr;f&&!n.length&&(e&=-17,f=n=!1),l&&!r.length&&(e&=-33,l=r=!1);var h=t&&t.__bindData__;if(h)return!a||1&h[1]||(h[4]=i),!a&&1&h[1]&&(e|=8),!u||4&h[1]||(h[5]=o),f&&jr.apply(h[2]||(h[2]=[]),n),l&&jr.apply(h[3]||(h[3]=[]),r),h[1]|=e,Z.apply(null,h);if(!a||s||u||l||!($r.fastBind||Lr&&f))m=function(){var h=arguments,d=a?i:this;if((u||f||l)&&(h=Dr.call(h),f&&Nr.apply(h,n),l&&jr.apply(h,r),u&&h.length<o))return e|=16,Z(t,c?e:-4&e,h,null,i,o);if(s&&(t=d[p]),this instanceof m){d=ee(t.prototype);var g=t.apply(d,h);return Se(g)?g:d}return t.apply(d,h)};else{if(f){var d=[i];jr.apply(d,n)}var m=f?Lr.apply(t,d):Lr.call(t,i)}return Xr(m,Dr.call(arguments)),m}function ee(t){return Se(t)?Tr(t):{}}function re(t){return Yr[t]}function ie(){var t=(t=n.indexOf)===pn?e:t;return t}function oe(t){var e,n;return t&&Cr.call(t)==G&&(e=t.constructor,!Ee(e)||e instanceof e)?(ri(t,function(t,e){n=e}),"undefined"==typeof n||Er.call(t,n)):!1}function ae(t){return Qr[t]}function se(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==z||!1}function ue(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),i(t,e,"function"==typeof n&&a(n,r,1))}function ce(t,e,n){return i(t,!0,"function"==typeof e&&a(e,n,1))}function fe(t,e,r){var i;return e=n.createCallback(e,r,3),ii(t,function(t,n,r){return e(t,n,r)?(i=n,!1):void 0}),i}function le(t,e,r){var i;return e=n.createCallback(e,r,3),he(t,function(t,n,r){return e(t,n,r)?(i=n,!1):void 0}),i}function pe(t,e,n){var r=[];ri(t,function(t,e){r.push(e,t)});var i=r.length;for(e=a(e,n,3);i--&&e(r[i--],r[i],t)!==!1;);return t}function he(t,e,n){var r=Kr(t),i=r.length;for(e=a(e,n,3);i--;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function de(t){var e=[];return ri(t,function(t,n){Ee(t)&&e.push(n)}),e.sort()}function me(t,e){return t?Er.call(t,e):!1}function ge(t){for(var e=-1,n=Kr(t),r=n.length,i={};++e<r;){var o=n[e];i[t[o]]=o}return i}function ve(t){return t===!0||t===!1||Cr.call(t)==P}function ye(t){return t?"object"==typeof t&&Cr.call(t)==D:!1}function be(t){return t?1===t.nodeType:!1}function xe(t){var e=!0;if(!t)return e;var n=Cr.call(t),r=t.length;return n==R||n==X||n==z||n==G&&"number"==typeof r&&Ee(t.splice)?!r:(ii(t,function(){return e=!1}),e)}function we(t,e,n,r){return x(t,e,"function"==typeof n&&a(n,r,2))}function _e(t){return Br(t)&&!Mr(parseFloat(t))}function Ee(t){return"function"==typeof t}function Se(t){return!(!t||!V[typeof t])}function je(t){return Ae(t)&&t!=+t}function ke(t){return null===t}function Ae(t){return"number"==typeof t||Cr.call(t)==J}function Ie(t){return t?"object"==typeof t&&Cr.call(t)==$:!1}function Ce(t){return"string"==typeof t||Cr.call(t)==X}function Ne(t){return"undefined"==typeof t}function Oe(t){var e=arguments,n=2;if(!Se(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=a(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=Dr.call(arguments,1,n),o=-1,s=l(),u=l();++o<n;)S(t,i[o],r,s,u);return d(s),d(u),t}function Le(t,e,r){var i=ie(),o="function"==typeof e,a={};if(o)e=n.createCallback(e,r,3);else var s=b(arguments,!0,!1,1);return ri(t,function(t,n,r){(o?!e(t,n,r):i(s,n)<0)&&(a[n]=t)}),a}function Te(t){for(var e=-1,n=Kr(t),r=n.length,i=ir(r);++e<r;){var o=n[e];i[e]=[o,t[o]]}return i}function qe(t,e,r){var i={};if("function"!=typeof e)for(var o=-1,a=b(arguments,!0,!1,1),s=Se(t)?a.length:0;++o<s;){var u=a[o];u in t&&(i[u]=t[u])}else e=n.createCallback(e,r,3),ri(t,function(t,n,r){e(t,n,r)&&(i[n]=t)});return i}function Be(t,e,n,r){var i=Hr(t);if(e=a(e,r,4),null==n)if(i)n=[];else{var o=t&&t.constructor,s=o&&o.prototype;n=ee(s)}return(i?We:ii)(t,function(t,r,i){return e(n,t,r,i)}),n}function Me(t){for(var e=-1,n=Kr(t),r=n.length,i=ir(r);++e<r;)i[e]=t[n[e]];return i}function Fe(t){for(var e=arguments,n=-1,r=b(e,!0,!1,1),i=e[2]&&e[2][e[1]]===t?1:r.length,o=ir(i);++n<i;)o[n]=t[r[n]];return o}function Ue(t,e,n){var r=-1,i=ie(),o=t?t.length:0,a=!1;return n=(0>n?Ur(0,o+n):n)||0,Hr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Ce(t)?t.indexOf(e,n):i(t,e,n))>-1:ii(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function ze(t,e,r){var i=!0;e=n.createCallback(e,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&(i=!!e(t[o],o,t)););else ii(t,function(t,n,r){return i=!!e(t,n,r)});return i}function Re(t,e,r){var i=[];e=n.createCallback(e,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a;){var s=t[o];e(s,o,t)&&i.push(s)}else ii(t,function(t,n,r){e(t,n,r)&&i.push(t)});return i}function Pe(t,e,r){e=n.createCallback(e,r,3);var i=-1,o=t?t.length:0;if("number"!=typeof o){var a;return ii(t,function(t,n,r){return e(t,n,r)?(a=t,!1):void 0}),a}for(;++i<o;){var s=t[i];if(e(s,i,t))return s}}function De(t,e,r){var i;return e=n.createCallback(e,r,3),Je(t,function(t,n,r){return e(t,n,r)?(i=t,!1):void 0}),i}function We(t,e,n){var r=-1,i=t?t.length:0;if(e=e&&"undefined"==typeof n?e:a(e,n,3),"number"==typeof i)for(;++r<i&&e(t[r],r,t)!==!1;);else ii(t,e);return t}function Je(t,e,n){var r=t?t.length:0;if(e=e&&"undefined"==typeof n?e:a(e,n,3),"number"==typeof r)for(;r--&&e(t[r],r,t)!==!1;);else{var i=Kr(t);r=i.length,ii(t,function(t,n,o){return n=i?i[--r]:--r,e(o[n],n,o)})}return t}function Ge(t,e){var n=Dr.call(arguments,2),r=-1,i="function"==typeof e,o=t?t.length:0,a=ir("number"==typeof o?o:0);return We(t,function(t){a[++r]=(i?e:t[e]).apply(t,n)}),a}function $e(t,e,r){var i=-1,o=t?t.length:0;if(e=n.createCallback(e,r,3),"number"==typeof o)for(var a=ir(o);++i<o;)a[i]=e(t[i],i,t);else a=[],ii(t,function(t,n,r){a[++i]=e(t,n,r)});return a}function Xe(t,e,r){var i=-1/0,o=i;if(!e&&Hr(t))for(var a=-1,u=t.length;++a<u;){var c=t[a];c>o&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);a>i&&(i=a,o=t)});return o}function He(t,e,r){var i=1/0,o=i;if(!e&&Hr(t))for(var a=-1,u=t.length;++a<u;){var c=t[a];o>c&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);i>a&&(i=a,o=t)});return o}function Ve(t,e){var n=-1,r=t?t.length:0;if("number"==typeof r)for(var i=ir(r);++n<r;)i[n]=t[n][e];return i||$e(t,e)}function Ke(t,e,n,r){if(!t)return n;var i=arguments.length<3;e=a(e,r,4);var o=-1,s=t.length;if("number"==typeof s)for(i&&(n=t[++o]);++o<s;)n=e(n,t[o],o,t);else ii(t,function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)});return n}function Ye(t,e,n,r){var i=arguments.length<3;return e=a(e,r,4),Je(t,function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)}),n}function Qe(t,e,r){return e=n.createCallback(e,r,3),Re(t,function(t,n,r){return!e(t,n,r)})}function Ze(t,e,n){var r=t?t.length:0;if("number"!=typeof r&&(t=Me(t)),null==e||n)return t?t[Xn(r-1)]:y;var i=tn(t);return i.length=zr(Ur(0,e),i.length),i}function tn(t){var e=-1,n=t?t.length:0,r=ir("number"==typeof n?n:0);return We(t,function(t){var n=Xn(++e);r[e]=r[n],r[n]=t}),r}function en(t){var e=t?t.length:0;return"number"==typeof e?e:Kr(t).length}function nn(t,e,r){var i;e=n.createCallback(e,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&!(i=e(t[o],o,t)););else ii(t,function(t,n,r){return!(i=e(t,n,r))});return!!i}function rn(t,e,r){var i=-1,o=t?t.length:0,a=ir("number"==typeof o?o:0);for(e=n.createCallback(e,r,3),We(t,function(t,n,r){var o=a[++i]=p();o.criteria=e(t,n,r),o.index=i,o.value=t}),o=a.length,a.sort(u);o--;){var s=a[o];a[o]=s.value,m(s)}return a}function on(t){return t&&"number"==typeof t.length?g(t):Me(t)}function an(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var i=t[e];i&&r.push(i)}return r}function sn(t){var n=-1,r=ie(),i=t?t.length:0,a=b(arguments,!0,!0,1),s=[],u=i>=E&&r===e;if(u){var f=c(a);f?(r=o,a=f):u=!1}for(;++n<i;){var l=t[n];r(a,l)<0&&s.push(l)}return u&&m(a),s}function un(t,e,r){var i=-1,o=t?t.length:0;for(e=n.createCallback(e,r,3);++i<o;)if(e(t[i],i,t))return i;return-1}function cn(t,e,r){var i=t?t.length:0;for(e=n.createCallback(e,r,3);i--;)if(e(t[i],i,t))return i;return-1}function fn(t,e,r){var i=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var a=-1;for(e=n.createCallback(e,r,3);++a<o&&e(t[a],a,t);)i++}else if(i=e,null==i||r)return t?t[0]:y;return g(t,0,zr(Ur(0,i),o))}function ln(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=r&&r[e]===t?null:e,e=!1),null!=n&&(t=$e(t,n,r)),b(t,e)}function pn(t,n,r){if("number"==typeof r){var i=t?t.length:0;r=0>r?Ur(0,i+r):r||0}else if(r){var o=wn(t,n);return t[o]===n?o:-1}return e(t,n,r)}function hn(t,e,r){var i=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var a=o;for(e=n.createCallback(e,r,3);a--&&e(t[a],a,t);)i++}else i=null==e||r?1:e||i;return g(t,0,zr(Ur(0,o-i),o))}function dn(t){for(var n=arguments,r=n.length,i=-1,a=l(),s=-1,u=ie(),f=t?t.length:0,p=[],h=l();++i<r;){var g=n[i];a[i]=u===e&&(g?g.length:0)>=E&&c(i?n[i]:h)}t:for(;++s<f;){var v=a[0];if(g=t[s],(v?o(v,g):u(h,g))<0){for(i=r,(v||h).push(g);--i;)if(v=a[i],(v?o(v,g):u(n[i],g))<0)continue t;p.push(g)}}for(;r--;)v=a[r],v&&m(v);return d(a),d(h),p}function mn(t,e,r){var i=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var a=o;for(e=n.createCallback(e,r,3);a--&&e(t[a],a,t);)i++}else if(i=e,null==i||r)return t?t[o-1]:y;return g(t,Ur(0,o-i))}function gn(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Ur(0,r+n):zr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function vn(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++n<r;)for(var o=-1,a=e[n];++o<i;)t[o]===a&&(Ir.call(t,o--,1),i--);return t}function yn(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,i=Ur(0,yr((e-t)/(n||1))),o=ir(i);++r<i;)o[r]=t,t+=n;return o}function bn(t,e,r){var i=-1,o=t?t.length:0,a=[];for(e=n.createCallback(e,r,3);++i<o;){var s=t[i];e(s,i,t)&&(a.push(s),Ir.call(t,i--,1),o--)}return a}function xn(t,e,r){if("number"!=typeof e&&null!=e){var i=0,o=-1,a=t?t.length:0;for(e=n.createCallback(e,r,3);++o<a&&e(t[o],o,t);)i++}else i=null==e||r?1:Ur(0,e);return g(t,i)}function wn(t,e,r,i){var o=0,a=t?t.length:o;for(r=r?n.createCallback(r,i,1):Jn,e=r(e);a>o;){var s=o+a>>>1;r(t[s])<e?o=s+1:a=s}return o}function _n(){return K(b(arguments,!0,!0))}function En(t,e,r,i){return"boolean"!=typeof e&&null!=e&&(i=r,r=i&&i[e]===t?null:e,e=!1),null!=r&&(r=n.createCallback(r,i,3)),K(t,e,r)}function Sn(t){return sn(t,Dr.call(arguments,1))}function jn(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?Xe(Ve(t,"length")):0,r=ir(0>n?0:n);++e<n;)r[e]=Ve(t,e);return r}function kn(t,e){for(var n=-1,r=t?t.length:0,i={};++n<r;){var o=t[n];e?i[o]=e[n]:o&&(i[o[0]]=o[1])}return i}function An(t,e){if(!Ee(e))throw new hr;return function(){return--t<1?e.apply(this,arguments):void 0}}function In(t,e){return arguments.length>2?Z(t,17,Dr.call(arguments,2),null,e):Z(t,1,null,null,e)}function Cn(t){for(var e=arguments.length>1?b(arguments,!0,!1,1):de(t),n=-1,r=e.length;++n<r;){var i=e[n];t[i]=Z(t[i],1,null,null,t)}return t}function Nn(t,e){return arguments.length>2?Z(e,19,Dr.call(arguments,2),null,t):Z(e,3,null,null,t)}function On(){for(var t=arguments,e=t.length;e--;)if(!Ee(t[e]))throw new hr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Ln(t,e,n){var r=typeof t;if(null==t||"function"==r)return a(t,e,n);if("object"!=r)return function(e){return e[t]};var i=Kr(t),o=i[0],s=t[o];return 1!=i.length||s!==s||Se(s)?function(e){for(var n=i.length,r=!1;n--&&(r=x(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}}function Tn(t,e){return e="number"==typeof e?e:+e||t.length,Z(t,4,null,null,null,e)}function qn(t,e,n){var r,i,o,a,s,u,c,f=0,l=!1,p=!0;if(!Ee(t))throw new hr;if(e=Ur(0,e)||0,n===!0){var h=!0;p=!1}else Se(n)&&(h=n.leading,l="maxWait"in n&&(Ur(e,n.maxWait)||0),p="trailing"in n?n.trailing:p);var d=function(){var n=e-(Sr()-a);if(0>=n){i&&br(i);var l=c;i=u=c=y,l&&(f=Sr(),o=t.apply(s,r))}else u=Ar(d,n)},m=function(){u&&br(u),i=u=c=y,(p||l!==e)&&(f=Sr(),o=t.apply(s,r))};return function(){if(r=arguments,a=Sr(),s=this,c=p&&(u||!h),l===!1)var n=h&&!u;else{i||h||(f=a);var g=l-(a-f);0>=g?(i&&(i=br(i)),f=a,o=t.apply(s,r)):i||(i=Ar(m,g))}return u||e===l||(u=Ar(d,e)),n&&(o=t.apply(s,r)),o}}function Bn(t){if(!Ee(t))throw new hr;var e=Dr.call(arguments,1);return Ar(function(){t.apply(y,e)},1)}function Mn(t,e){if(!Ee(t))throw new hr;var n=Dr.call(arguments,2);return Ar(function(){t.apply(y,n)},e)}function Fn(t,e){if(!Ee(t))throw new hr;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):_+arguments[0];return Er.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Un(t){var e,n;if(!Ee(t))throw new hr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function zn(t){return Z(t,16,Dr.call(arguments,1))}function Rn(t){return Z(t,32,null,Dr.call(arguments,1))}function Pn(t,e,n){var r=!0,i=!0;if(!Ee(t))throw new hr;n===!1?r=!1:Se(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),n=p(),n.leading=r,n.maxWait=e,n.trailing=i;var o=qn(t,e,n);return m(n),o}function Dn(t,e){if(!Ee(e))throw new hr;return function(){var n=[t];return jr.apply(n,arguments),e.apply(this,n)
}}function Wn(t){return null==t?"":pr(t).replace(ti,re)}function Jn(t){return t}function Gn(t,e){var i=t,o=!e||Ee(i);e||(i=r,e=t,t=n),We(de(e),function(n){var r=t[n]=e[n];o&&(i.prototype[n]=function(){var e=this.__wrapped__,n=[e];jr.apply(n,arguments);var o=r.apply(t,n);return e&&"object"==typeof e&&e===o?this:new i(o)})})}function $n(){return t._=gr,this}function Xn(t,e,n){var r=null==t,i=null==e;null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0;var o=Pr();return n||t%1||e%1?t+zr(o*(e-t+parseFloat("1e-"+((o+"").length-1))),e):t+xr(o*(e-t+1))}function Hn(t,e){if(t){var n=t[e];return Ee(n)?t[e]():n}}function Vn(t,e,r){var i=n.templateSettings;t||(t=""),r=ni({},r,i);var o,a=ni({},r.imports,i.imports),s=Kr(a),u=Me(a),c=0,l=r.interpolate||q,p="__p += '",h=lr((r.escape||q).source+"|"+l.source+"|"+(l===L?C:q).source+"|"+(r.evaluate||q).source+"|$","g");t.replace(h,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(c,s).replace(M,f),n&&(p+="' +\n__e("+n+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=s+e.length,e}),p+="';\n";var d=r.variable,m=d;m||(d="obj",p="with ("+d+") {\n"+p+"\n}\n"),p=(o?p.replace(k,""):p).replace(A,"$1").replace(I,"$1;"),p="function("+d+") {\n"+(m?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+U++ +"]")+"\n*/";try{var v=sr(s,"return "+p+g).apply(y,u)}catch(b){throw b.source=p,b}return e?v(e):(v.source=p,v)}function Kn(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=ir(t);for(e=a(e,n,1);++r<t;)i[r]=e(r);return i}function Yn(t){return null==t?"":pr(t).replace(Zr,ae)}function Qn(t){var e=++w;return pr(null==t?"":t)+e}function Zn(t){return t=new r(t),t.__chain__=!0,t}function tr(t,e){return e(t),t}function er(){return this.__chain__=!0,this}function nr(){return pr(this.__wrapped__)}function rr(){return this.__wrapped__}t=t?ne.defaults(Y.Object(),t,ne.pick(Y,F)):Y;var ir=t.Array,or=t.Boolean,ar=t.Date,sr=t.Function,ur=t.Math,cr=t.Number,fr=t.Object,lr=t.RegExp,pr=t.String,hr=t.TypeError,dr=[],mr=fr.prototype,gr=t._,vr=lr("^"+pr(mr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),yr=ur.ceil,br=t.clearTimeout,xr=ur.floor,wr=sr.prototype.toString,_r=vr.test(_r=fr.getPrototypeOf)&&_r,Er=mr.hasOwnProperty,Sr=vr.test(Sr=ar.now)&&Sr||function(){return+new ar},jr=dr.push,kr=t.setImmediate,Ar=t.setTimeout,Ir=dr.splice,Cr=mr.toString,Nr=dr.unshift,Or=function(){try{var t={},e=vr.test(e=fr.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),Lr=vr.test(Lr=Cr.bind)&&Lr,Tr=vr.test(Tr=fr.create)&&Tr,qr=vr.test(qr=ir.isArray)&&qr,Br=t.isFinite,Mr=t.isNaN,Fr=vr.test(Fr=fr.keys)&&Fr,Ur=ur.max,zr=ur.min,Rr=t.parseInt,Pr=ur.random,Dr=dr.slice,Wr=vr.test(t.attachEvent),Jr=Lr&&!/\n|true/.test(Lr+Wr),Gr={};Gr[R]=ir,Gr[P]=or,Gr[D]=ar,Gr[W]=sr,Gr[G]=fr,Gr[J]=cr,Gr[$]=lr,Gr[X]=pr,r.prototype=n.prototype;var $r=n.support={};$r.fastBind=Lr&&!Jr,$r.funcDecomp=!vr.test(t.WinRTError)&&B.test(v),$r.funcNames="string"==typeof sr.name,n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:L,variable:"",imports:{_:n}};var Xr=Or?function(t,e){var n=p();n.value=e,Or(t,"__bindData__",n),m(n)}:h,Hr=qr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==R||!1},Vr=function(t){var e,n=t,r=[];if(!n)return r;if(!V[typeof t])return r;for(e in n)Er.call(n,e)&&r.push(e);return r},Kr=Fr?function(t){return Se(t)?Fr(t):[]}:Vr,Yr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qr=ge(Yr),Zr=lr("("+Kr(Qr).join("|")+")","g"),ti=lr("["+Kr(Yr).join("")+"]","g"),ei=function(t,e,n){var r,i=t,o=i;if(!i)return o;var s=arguments,u=0,c="number"==typeof n?2:s.length;if(c>3&&"function"==typeof s[c-2])var f=a(s[--c-1],s[c--],2);else c>2&&"function"==typeof s[c-1]&&(f=s[--c]);for(;++u<c;)if(i=s[u],i&&V[typeof i])for(var l=-1,p=V[typeof i]&&Kr(i),h=p?p.length:0;++l<h;)r=p[l],o[r]=f?f(o[r],i[r]):i[r];return o},ni=function(t,e,n){var r,i=t,o=i;if(!i)return o;for(var a=arguments,s=0,u="number"==typeof n?2:a.length;++s<u;)if(i=a[s],i&&V[typeof i])for(var c=-1,f=V[typeof i]&&Kr(i),l=f?f.length:0;++c<l;)r=f[c],"undefined"==typeof o[r]&&(o[r]=i[r]);return o},ri=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!V[typeof i])return o;e=e&&"undefined"==typeof n?e:a(e,n,3);for(r in i)if(e(i[r],r,t)===!1)return o;return o},ii=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!V[typeof i])return o;e=e&&"undefined"==typeof n?e:a(e,n,3);for(var s=-1,u=V[typeof i]&&Kr(i),c=u?u.length:0;++s<c;)if(r=u[s],e(i[r],r,t)===!1)return o;return o},oi=function(t){if(!t||Cr.call(t)!=G)return!1;var e=t.valueOf,n="function"==typeof e&&(n=_r(e))&&_r(n);return n?t==n||_r(t)==n:oe(t)},ai=Q(function(t,e,n){Er.call(t,n)?t[n]++:t[n]=1}),si=Q(function(t,e,n){(Er.call(t,n)?t[n]:t[n]=[]).push(e)}),ui=Q(function(t,e,n){t[n]=e}),ci=Re;Jr&&te&&"function"==typeof kr&&(Bn=function(e){if(!Ee(e))throw new hr;return kr.apply(t,arguments)});var fi=8==Rr(j+"08")?Rr:function(t,e){return Rr(Ce(t)?t.replace(T,""):t,e||0)};return n.after=An,n.assign=ei,n.at=Fe,n.bind=In,n.bindAll=Cn,n.bindKey=Nn,n.chain=Zn,n.compact=an,n.compose=On,n.countBy=ai,n.createCallback=Ln,n.curry=Tn,n.debounce=qn,n.defaults=ni,n.defer=Bn,n.delay=Mn,n.difference=sn,n.filter=Re,n.flatten=ln,n.forEach=We,n.forEachRight=Je,n.forIn=ri,n.forInRight=pe,n.forOwn=ii,n.forOwnRight=he,n.functions=de,n.groupBy=si,n.indexBy=ui,n.initial=hn,n.intersection=dn,n.invert=ge,n.invoke=Ge,n.keys=Kr,n.map=$e,n.max=Xe,n.memoize=Fn,n.merge=Oe,n.min=He,n.omit=Le,n.once=Un,n.pairs=Te,n.partial=zn,n.partialRight=Rn,n.pick=qe,n.pluck=Ve,n.pull=vn,n.range=yn,n.reject=Qe,n.remove=bn,n.rest=xn,n.shuffle=tn,n.sortBy=rn,n.tap=tr,n.throttle=Pn,n.times=Kn,n.toArray=on,n.transform=Be,n.union=_n,n.uniq=En,n.values=Me,n.where=ci,n.without=Sn,n.wrap=Dn,n.zip=jn,n.zipObject=kn,n.collect=$e,n.drop=xn,n.each=We,n.eachRight=Je,n.extend=ei,n.methods=de,n.object=kn,n.select=Re,n.tail=xn,n.unique=En,n.unzip=jn,Gn(n),n.clone=ue,n.cloneDeep=ce,n.contains=Ue,n.escape=Wn,n.every=ze,n.find=Pe,n.findIndex=un,n.findKey=fe,n.findLast=De,n.findLastIndex=cn,n.findLastKey=le,n.has=me,n.identity=Jn,n.indexOf=pn,n.isArguments=se,n.isArray=Hr,n.isBoolean=ve,n.isDate=ye,n.isElement=be,n.isEmpty=xe,n.isEqual=we,n.isFinite=_e,n.isFunction=Ee,n.isNaN=je,n.isNull=ke,n.isNumber=Ae,n.isObject=Se,n.isPlainObject=oi,n.isRegExp=Ie,n.isString=Ce,n.isUndefined=Ne,n.lastIndexOf=gn,n.mixin=Gn,n.noConflict=$n,n.parseInt=fi,n.random=Xn,n.reduce=Ke,n.reduceRight=Ye,n.result=Hn,n.runInContext=v,n.size=en,n.some=nn,n.sortedIndex=wn,n.template=Vn,n.unescape=Yn,n.uniqueId=Qn,n.all=ze,n.any=nn,n.detect=Pe,n.findWhere=Pe,n.foldl=Ke,n.foldr=Ye,n.include=Ue,n.inject=Ke,ii(n,function(t,e){n.prototype[e]||(n.prototype[e]=function(){var e=[this.__wrapped__],i=this.__chain__;jr.apply(e,arguments);var o=t.apply(n,e);return i?new r(o,i):o})}),n.first=fn,n.last=mn,n.sample=Ze,n.take=fn,n.head=fn,ii(n,function(t,e){var i="sample"!==e;n.prototype[e]||(n.prototype[e]=function(e,n){var o=this.__chain__,a=t(this.__wrapped__,e,n);return o||null!=e&&(!n||i&&"function"==typeof e)?new r(a,o):a})}),n.VERSION="2.1.0",n.prototype.chain=er,n.prototype.toString=nr,n.prototype.value=rr,n.prototype.valueOf=rr,We(["join","pop","shift"],function(t){var e=dr[t];n.prototype[t]=function(){var t=this.__chain__,n=e.apply(this.__wrapped__,arguments);return t?new r(n,t):n}}),We(["push","reverse","sort","unshift"],function(t){var e=dr[t];n.prototype[t]=function(){return e.apply(this.__wrapped__,arguments),this}}),We(["concat","slice","splice"],function(t){var e=dr[t];n.prototype[t]=function(){return new r(e.apply(this.__wrapped__,arguments),this.__chain__)}}),n}var y,b=[],x=[],w=0,_=+new Date+"",E=75,S=40,j=" \f \n\r\u2028\u2029  ",k=/\b__p \+= '';/g,A=/\b(__p \+=) '' \+/g,I=/(__e\(.*?\)|\b__t\)) \+\n'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,N=/\w*$/,O=/^function[ \n\r\t]+\w/,L=/<%=([\s\S]+?)%>/g,T=RegExp("^["+j+"]*0+(?=.$)"),q=/($^)/,B=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,F=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],U=0,z="[object Arguments]",R="[object Array]",P="[object Boolean]",D="[object Date]",W="[object Function]",J="[object Number]",G="[object Object]",$="[object RegExp]",X="[object String]",H={};H[W]=!1,H[z]=H[R]=H[P]=H[D]=H[J]=H[G]=H[$]=H[X]=!0;var V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Y=V[typeof window]&&window||this,Q=V[typeof r]&&r&&!r.nodeType&&r,Z=V[typeof n]&&n&&!n.nodeType&&n,te=Z&&Z.exports===Q&&Q,ee=V[typeof i]&&i;!ee||ee.global!==ee&&ee.window!==ee||(Y=ee);var ne=v();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(Y._=ne,t(function(){return ne})):Q&&Z?te?(Z.exports=ne)._=ne:Q._=ne:Y._=ne}.call(this)},{}],82:[function(e,n){var r=e("__browserify_Buffer").Buffer;!function(){function i(t,e,n){var r=e&&n||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>i&&(e[r+i++]=g[t])});16>i;)e[r+i++]=0;return e}function o(t,e){var n=e||0,r=m;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}function a(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var a=null!=t.clockseq?t.clockseq:x,s=null!=t.msecs?t.msecs:(new Date).getTime(),u=null!=t.nsecs?t.nsecs:_+1,c=s-w+(u-_)/1e4;if(0>c&&null==t.clockseq&&(a=16383&a+1),(0>c||s>w)&&null==t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=s,_=u,x=a,s+=122192928e5;var f=(1e4*(268435455&s)+u)%4294967296;i[r++]=255&f>>>24,i[r++]=255&f>>>16,i[r++]=255&f>>>8,i[r++]=255&f;var l=268435455&1e4*(s/4294967296);i[r++]=255&l>>>8,i[r++]=255&l,i[r++]=16|15&l>>>24,i[r++]=255&l>>>16,i[r++]=128|a>>>8,i[r++]=255&a;for(var p=t.node||b,h=0;6>h;h++)i[r+h]=p[h];return e?e:o(i)}function s(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"==t?new d(16):null,t=null),t=t||{};var i=t.random||(t.rng||u)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],e)for(var a=0;16>a;a++)e[r+a]=i[a];return e||o(i)}var u,c=this;if("function"==typeof e)try{var f=e("crypto").randomBytes;u=f&&function(){return f(16)}}catch(l){}if(!u&&c.crypto&&crypto.getRandomValues){var p=new Uint8Array(16);u=function(){return crypto.getRandomValues(p),p}}if(!u){var h=new Array(16);u=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),h[e]=255&t>>>((3&e)<<3);return h}}for(var d="function"==typeof r?r:Array,m=[],g={},v=0;256>v;v++)m[v]=(v+256).toString(16).substr(1),g[m[v]]=v;var y=u(),b=[1|y[0],y[1],y[2],y[3],y[4],y[5]],x=16383&(y[6]<<8|y[7]),w=0,_=0,E=s;if(E.v1=a,E.v4=s,E.parse=i,E.unparse=o,E.BufferClass=d,c.define&&t.amd)t(function(){return E});else if("undefined"!=typeof n&&n.exports)n.exports=E;else{var S=c.uuid;E.noConflict=function(){return c.uuid=S,E},c.uuid=E}}()},{__browserify_Buffer:68,crypto:63}],83:[function(t,e,n){function r(t){c.call(this),this.registry=new Object,this.insureids=0,this.freq=void 0===t?5:t,this.run=!1,this.start()}function i(t,e,n,r){void 0===r&&(++this.insureids,this.insureids%=65e3,r=this.insureids),expiretime=Date.now()+1e3*e;var i=this,o={paddle:i,error_callback:t,args:n,id:r,timeout:expiretime,done:!1,check_in:function(){return this.paddle.check_in(this.id)}};return this.registry[r]=o,o}function o(t){return void 0!==t.id&&(t=t.id),t in this.registry?(this.emit("check_in",this.registry[t]),this.registry[t].done=!0,delete this.registry[t],!0):!1}function a(){var t=Date.now();for(var e in this.registry)t>this.registry[e].timeout&&(this.registry[e].error_callback.apply(this,this.registry[e].args),this.emit("timeout",this.registry[e]),delete this.registry[e]);this.run&&setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq)}function s(t){return void 0!==t&&(this.freq=t),this.run?!1:(this.run=!0,setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq),!0)}function u(){return this.run?(this.run=!1,!0):!0}var c=t("events").EventEmitter;r.super_=c,r.prototype=Object.create(c.prototype,{constructor:{value:r,enumerable:!1}}),r.prototype.insure=i,r.prototype.check_in=o,r.prototype.checkEnsures=a,r.prototype.start=s,r.prototype.stop=u,n.Paddle=r},{events:58}],84:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="ANONYMOUS",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.trace||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],85:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":84}],86:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto")):"function"==typeof t&&t.amd&&t(["exports","module","crypto"],o)}(this,function(t,e,n){function r(t){t=t||{},this._genNonce=t.genNonce||o(32)}function i(t){for(var e={},n=t.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;i>r;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function o(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}function a(t,e){return n.createHash("md5").update(t).digest(e||"hex")}r.prototype.name="DIGEST-MD5",r.prototype.clientFirst=!1,r.prototype.response=function(t){var e=t.serviceType+"/"+t.host;t.serviceName&&t.host!==t.serviceName&&(e+="/"+serviceName);var n,r,i,o=t.realm||this._realm||"",s=this._genNonce(),u="00000001",c="auth",f="";return f+='username="'+t.username+'"',o&&(f+=',realm="'+o+'"'),f+=',nonce="'+this._nonce+'"',f+=',cnonce="'+s+'"',f+=",nc="+u,f+=",qop="+c,f+=',digest-uri="'+e+'"',n=t.authzid?a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s+":"+t.authzid):a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s),"auth"==c?r=a("AUTHENTICATE:"+e):("auth-int"==c||"auth-conf"==c)&&(r=a("AUTHENTICATE:"+e+":00000000000000000000000000000000")),i=a(n+":"+this._nonce+":"+u+":"+s+":"+c+":"+r),f+=",response="+i,"utf-8"==this._charset&&(f+=",charset=utf-8"),t.authzid&&(f+='authzid="'+t.authzid+'"'),f},r.prototype.challenge=function(t){var e=i(t);return this._realm=e.realm,this._nonce=e.nonce,this._qop=(e.qop||"auth").split(","),this._stale=e.stale,this._maxbuf=parseInt(e.maxbuf)||65536,this._charset=e.charset,this._algo=e.algorithm,this._cipher=e.cipher,this._cipher&&this._cipher.split(","),this},t=e.exports=r})},{crypto:63}],87:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":86}],88:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="EXTERNAL",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.authzid||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],89:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":88}],90:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="PLAIN",n.prototype.clientFirst=!0,n.prototype.response=function(t){var e="";return e+=t.authzid||"",e+="\0",e+=t.username,e+="\0",e+=t.password},n.prototype.challenge=function(){return this},t=e.exports=n})},{}],91:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":90}],92:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto"),e("buffer")):"function"==typeof t&&t.amd&&t(["exports","module","crypto","buffer"],o)}(this,function(t,e,n,r){function i(t){t=t||{},this._genNonce=t.genNonce||l(32),this._stage=0}function o(t,e){return n.createHmac("sha1",t).update(e).digest("binary")}function a(t,e,n){for(var r=o(t,e+"\0\0\0"),i=r,a=0;n-1>a;a++)r=o(t,r),i=u(i,r);return i}function s(t){return n.createHash("sha1").update(t).digest("binary")}function u(t,e){t=new p(t,"binary"),e=new p(e,"binary");var n=Math.min(t.length,e.length);result=[];for(var r=0;n>r;r++)result.push(t[r]^e[r]);return result=new p(result,"binary"),result.toString("binary")}function c(t){for(var e=[],n="",r=0;r<t.length;r++)n=t[r],","===n?e.push("=2C"):"="===n?e.push("=3D"):e.push(n);return e.join("")}function f(t){for(var e={},n=t.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;i>r;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function l(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}var p=r.Buffer;i.prototype.name="SCRAM-SHA-1",i.prototype.clientFirst=!0,i.prototype.response=function(t){return h[this._stage](this,t)},i.prototype.challenge=function(t){var e=f(t);return this._salt=new p(e.s||"","base64").toString("binary"),this._iterationCount=parseInt(e.i,10),this._nonce=e.r,this._verifier=e.v,this._error=e.e,this._challenge=t,this};var h={};h[0]=function(t,e){t._cnonce=t._genNonce();var n="";e.authzid&&(n="a="+c(e.authzid)),t._gs2Header="n,"+n+",";var r="r="+t._cnonce,i="n="+c(e.username);t._clientFirstMessageBare=i+","+r;var o=t._gs2Header+t._clientFirstMessageBare;return t._stage=1,o},h[1]=function(t,e){var n=new p(t._gs2Header).toString("base64");t._clientFinalMessageWithoutProof="c="+n+",r="+t._nonce;var r,i,c;e.clientKey&&e.serverKey?(i=e.clientKey,c=e.serverKey):(r=e.saltedPassword||a(e.password,t._salt,t._iterationCount),i=o(r,"Client Key"),c=o(r,"Server Key"));var f=s(i),l=t._clientFirstMessageBare+","+t._challenge+","+t._clientFinalMessageWithoutProof,h=o(f,l),d=u(i,h),m=new p(d,"binary").toString("base64");t._serverSignature=o(c,l);var g=t._clientFinalMessageWithoutProof+",p="+m;return t._stage=2,t.cache={saltedPassword:r,clientKey:i,serverKey:c},g},h[2]=function(){return""},t=e.exports=i})},{buffer:61,crypto:63}],93:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":92}],94:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){this._mechs=[]}n.prototype.use=function(t,e){return e||(e=t,t=e.prototype.name),this._mechs.push({name:t,mech:e}),this},n.prototype.create=function(t){for(var e=0,n=this._mechs.length;n>e;e++)for(var r=0,i=t.length;i>r;r++){var o=this._mechs[e];if(o.name==t[r])return new o.mech}return null},t=e.exports=n})},{}],95:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/factory")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/factory"],o)}(this,function(t,e,n){t=e.exports=n,t.Factory=n})},{"./lib/factory":94}],96:[function(t,e,n){!function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,c=o.slice,f=o.concat,l=a.toString,p=a.hasOwnProperty,h=o.forEach,d=o.map,m=o.reduce,g=o.reduceRight,v=o.filter,y=o.every,b=o.some,x=o.indexOf,w=o.lastIndexOf,_=Array.isArray,E=Object.keys,S=s.bind,j=function(t){return t instanceof j?t:this instanceof j?(this._wrapped=t,void 0):new j(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=j),n._=j):t._=j,j.VERSION="1.5.2";var k=j.each=j.forEach=function(t,e,n){if(null!=t)if(h&&t.forEach===h)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a=j.keys(t),r=0,o=a.length;o>r;r++)if(e.call(n,t[a[r]],a[r],t)===i)return};j.map=j.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(k(t,function(t,i,o){r.push(e.call(n,t,i,o))}),r)};var A="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduce===m)return r&&(e=j.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(k(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(A);return n},j.reduceRight=j.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduceRight===g)return r&&(e=j.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=j.keys(t);o=a.length}if(k(t,function(s,u,c){u=a?a[--o]:--o,i?n=e.call(r,n,t[u],u,c):(n=t[u],i=!0)}),!i)throw new TypeError(A);return n},j.find=j.detect=function(t,e,n){var r;return I(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},j.filter=j.select=function(t,e,n){var r=[];return null==t?r:v&&t.filter===v?t.filter(e,n):(k(t,function(t,i,o){e.call(n,t,i,o)&&r.push(t)}),r)},j.reject=function(t,e,n){return j.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},j.every=j.all=function(t,e,n){e||(e=j.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(k(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var I=j.some=j.any=function(t,e,n){e||(e=j.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(k(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};j.contains=j.include=function(t,e){return null==t?!1:x&&t.indexOf===x?-1!=t.indexOf(e):I(t,function(t){return t===e})},j.invoke=function(t,e){var n=c.call(arguments,2),r=j.isFunction(e);return j.map(t,function(t){return(r?e:t[e]).apply(t,n)})},j.pluck=function(t,e){return j.map(t,function(t){return t[e]})},j.where=function(t,e,n){return j.isEmpty(e)?n?void 0:[]:j[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},j.findWhere=function(t,e){return j.where(t,e,!0)},j.max=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&j.isEmpty(t))return-1/0;var r={computed:-1/0,value:-1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a>r.computed&&(r={value:t,computed:a})}),r.value},j.min=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&j.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a<r.computed&&(r={value:t,computed:a})}),r.value},j.shuffle=function(t){var e,n=0,r=[];return k(t,function(t){e=j.random(n++),r[n-1]=r[e],r[e]=t}),r},j.sample=function(t,e,n){return arguments.length<2||n?t[j.random(t.length-1)]:j.shuffle(t).slice(0,Math.max(0,e))};var C=function(t){return j.isFunction(t)?t:function(e){return e[t]}};j.sortBy=function(t,e,n){var r=C(e);return j.pluck(j.map(t,function(t,e,i){return{value:t,index:e,criteria:r.call(n,t,e,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var N=function(t){return function(e,n,r){var i={},o=null==n?j.identity:C(n);return k(e,function(n,a){var s=o.call(r,n,a,e);t(i,s,n)}),i}};j.groupBy=N(function(t,e,n){(j.has(t,e)?t[e]:t[e]=[]).push(n)}),j.indexBy=N(function(t,e,n){t[e]=n}),j.countBy=N(function(t,e){j.has(t,e)?t[e]++:t[e]=1}),j.sortedIndex=function(t,e,n,r){n=null==n?j.identity:C(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var s=o+a>>>1;n.call(r,t[s])<i?o=s+1:a=s}return o},j.toArray=function(t){return t?j.isArray(t)?c.call(t):t.length===+t.length?j.map(t,j.identity):j.values(t):[]},j.size=function(t){return null==t?0:t.length===+t.length?t.length:j.keys(t).length},j.first=j.head=j.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:c.call(t,0,e)},j.initial=function(t,e,n){return c.call(t,0,t.length-(null==e||n?1:e))},j.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:c.call(t,Math.max(t.length-e,0))},j.rest=j.tail=j.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},j.compact=function(t){return j.filter(t,j.identity)};var O=function(t,e,n){return e&&j.every(t,j.isArray)?f.apply(n,t):(k(t,function(t){j.isArray(t)||j.isArguments(t)?e?u.apply(n,t):O(t,e,n):n.push(t)}),n)};j.flatten=function(t,e){return O(t,e,[])},j.without=function(t){return j.difference(t,c.call(arguments,1))},j.uniq=j.unique=function(t,e,n,r){j.isFunction(e)&&(r=n,n=e,e=!1);var i=n?j.map(t,n,r):t,o=[],a=[];return k(i,function(n,r){(e?r&&a[a.length-1]===n:j.contains(a,n))||(a.push(n),o.push(t[r]))}),o},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(t){var e=c.call(arguments,1);return j.filter(j.uniq(t),function(t){return j.every(e,function(e){return j.indexOf(e,t)>=0})})},j.difference=function(t){var e=f.apply(o,c.call(arguments,1));return j.filter(t,function(t){return!j.contains(e,t)})},j.zip=function(){for(var t=j.max(j.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=j.pluck(arguments,""+n);return e},j.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},j.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=j.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(x&&t.indexOf===x)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},j.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(w&&t.lastIndexOf===w)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},j.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o};var L=function(){};j.bind=function(t,e){var n,r;if(S&&t.bind===S)return S.apply(t,c.call(arguments,1));if(!j.isFunction(t))throw new TypeError;return n=c.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(c.call(arguments)));L.prototype=t.prototype;var i=new L;L.prototype=null;var o=t.apply(i,n.concat(c.call(arguments)));return Object(o)===o?o:i}},j.partial=function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},j.bindAll=function(t){var e=c.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return k(e,function(e){t[e]=j.bind(t[e],t)}),t},j.memoize=function(t,e){var n={};return e||(e=j.identity),function(){var r=e.apply(this,arguments);return j.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},j.delay=function(t,e){var n=c.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},j.defer=function(t){return j.delay.apply(j,[t,1].concat(c.call(arguments,1)))},j.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:new Date,a=null,o=t.apply(r,i)};return function(){var c=new Date;s||n.leading!==!1||(s=c);var f=e-(c-s);return r=this,i=arguments,0>=f?(clearTimeout(a),a=null,s=c,o=t.apply(r,i)):a||n.trailing===!1||(a=setTimeout(u,f)),o}},j.debounce=function(t,e,n){var r,i,o,a,s;return function(){o=this,i=arguments,a=new Date;var u=function(){var c=new Date-a;e>c?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i)))},c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i)),s}},j.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},j.wrap=function(t,e){return function(){var n=[t];return u.apply(n,arguments),e.apply(this,n)}},j.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},j.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},j.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)j.has(t,n)&&e.push(n);return e},j.values=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},j.pairs=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},j.invert=function(t){for(var e={},n=j.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},j.functions=j.methods=function(t){var e=[];for(var n in t)j.isFunction(t[n])&&e.push(n);return e.sort()},j.extend=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},j.pick=function(t){var e={},n=f.apply(o,c.call(arguments,1));return k(n,function(n){n in t&&(e[n]=t[n])}),e},j.omit=function(t){var e={},n=f.apply(o,c.call(arguments,1));for(var r in t)j.contains(n,r)||(e[r]=t[r]);return e},j.defaults=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},j.clone=function(t){return j.isObject(t)?j.isArray(t)?t.slice():j.extend({},t):t},j.tap=function(t,e){return e(t),t};var T=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof j&&(t=t._wrapped),e instanceof j&&(e=e._wrapped);var i=l.call(t);if(i!=l.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;var a=t.constructor,s=e.constructor;if(a!==s&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(s)&&s instanceof s))return!1;n.push(t),r.push(e);var u=0,c=!0;if("[object Array]"==i){if(u=t.length,c=u==e.length)for(;u--&&(c=T(t[u],e[u],n,r)););}else{for(var f in t)if(j.has(t,f)&&(u++,!(c=j.has(e,f)&&T(t[f],e[f],n,r))))break;if(c){for(f in e)if(j.has(e,f)&&!u--)break;c=!u}}return n.pop(),r.pop(),c};j.isEqual=function(t,e){return T(t,e,[],[])},j.isEmpty=function(t){if(null==t)return!0;if(j.isArray(t)||j.isString(t))return 0===t.length;for(var e in t)if(j.has(t,e))return!1;return!0},j.isElement=function(t){return!(!t||1!==t.nodeType)},j.isArray=_||function(t){return"[object Array]"==l.call(t)},j.isObject=function(t){return t===Object(t)},k(["Arguments","Function","String","Number","Date","RegExp"],function(t){j["is"+t]=function(e){return l.call(e)=="[object "+t+"]"}}),j.isArguments(arguments)||(j.isArguments=function(t){return!(!t||!j.has(t,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(t){return"function"==typeof t}),j.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},j.isNaN=function(t){return j.isNumber(t)&&t!=+t},j.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==l.call(t)},j.isNull=function(t){return null===t},j.isUndefined=function(t){return void 0===t},j.has=function(t,e){return p.call(t,e)},j.noConflict=function(){return t._=r,this},j.identity=function(t){return t},j.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},j.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var q={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};q.unescape=j.invert(q.escape);var B={escape:new RegExp("["+j.keys(q.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(q.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(t){j[t]=function(e){return null==e?"":(""+e).replace(B[t],function(e){return q[t][e]})}}),j.result=function(t,e){if(null==t)return void 0;var n=t[e];return j.isFunction(n)?n.call(t):n},j.mixin=function(t){k(j.functions(t),function(e){var n=j[e]=t[e];j.prototype[e]=function(){var t=[this._wrapped];
return u.apply(t,arguments),R.call(this,n.apply(j,t))}})};var M=0;j.uniqueId=function(t){var e=++M+"";return t?t+e:e},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(t,e,n){var r;n=j.defaults({},n,j.templateSettings);var i=new RegExp([(n.escape||F).source,(n.interpolate||F).source,(n.evaluate||F).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,r,i,s){return a+=t.slice(o,s).replace(z,function(t){return"\\"+U[t]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(a+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(n.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(e)return r(e,j);var u=function(t){return r.call(this,t,j)};return u.source="function("+(n.variable||"obj")+"){\n"+a+"}",u},j.chain=function(t){return j(t).chain()};var R=function(t){return this._chain?j(t).chain():t};j.mixin(j),k(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];j.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],R.call(this,n)}}),k(["concat","join","slice"],function(t){var e=o[t];j.prototype[t]=function(){return R.call(this,e.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this)},{}],97:[function(t,e){function n(){this.callbacks={}}e.exports=n,n.prototype.on=function(t){var e=3===arguments.length,n=e?arguments[1]:void 0,r=e?arguments[2]:arguments[1];return r._groupName=n,(this.callbacks[t]=this.callbacks[t]||[]).push(r),this},n.prototype.once=function(t){function e(){n.off(t,e),o.apply(this,arguments)}var n=this,r=3===arguments.length,i=r?arguments[1]:void 0,o=r?arguments[2]:arguments[1];return this.on(t,i,e),this},n.prototype.releaseGroup=function(t){var e,n,r,i;for(e in this.callbacks)for(i=this.callbacks[e],n=0,r=i.length;r>n;n++)i[n]._groupName===t&&(i.splice(n,1),n--,r--);return this},n.prototype.off=function(t,e){var n,r=this.callbacks[t];return r?1===arguments.length?(delete this.callbacks[t],this):(n=r.indexOf(e),r.splice(n,1),this):this},n.prototype.emit=function(t){var e,n,r=[].slice.call(arguments,1),i=this.callbacks[t],o=this.getWildcardCallbacks(t);if(i)for(e=0,n=i.length;n>e&&i[e];++e)i[e].apply(this,r);if(o)for(e=0,n=o.length;n>e&&o[e];++e)o[e].apply(this,[t].concat(r));return this},n.prototype.getWildcardCallbacks=function(t){var e,n,r=[];for(e in this.callbacks)n=e.split("*"),("*"===e||2===n.length&&t.slice(0,n[1].length)===n[1])&&(r=r.concat(this.callbacks[e]));return r}},{}]},{},[1])(1)});