markuapad 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 316d18031a5570d01ac9973a417023d1ec4380bf
4
- data.tar.gz: 95367ba8d9e3dade3faf25a9685c52f8d09efc7a
3
+ metadata.gz: 39facd4bc2fcd3c30322a2dc46ab8470a2bd9ad2
4
+ data.tar.gz: 278b071dfafe9e7853944d053f82d1a9c6bd1811
5
5
  SHA512:
6
- metadata.gz: 6255e449bbaec22dfef8da51a8eab318e8649e13509176a1b072e81607d426dc20caa9475c4690692836232f77aafb6c6529fee5297516a2614315d5ea1b8f78
7
- data.tar.gz: 9677c509653e5cbec3ea495e64f3245aaf42ef085ebfc6d92ea60247963c38dfc0b2fe441631262cb83b914bdf350507bcd33141dd1d0631b03ef76f88602a6f
6
+ metadata.gz: 0b1334fb1073b3d67b024158b21cabb7ffd059eb18a142252ea9e2c80658ad5e4f8bf44fad39448ebbcc2b9d53e1eb07e7fddf33f04c19c8a7f00ca676001c59
7
+ data.tar.gz: 993de87397b50db5fa30945698399ff0b3eb8e4dc5899002229afb0c1c25812027b8856653ff9dd04759c7134aa3ab677924666329274d7d0e2711aa7a12125c
@@ -36,7 +36,7 @@ var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer
36
36
  },function(e,t){ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=" .ace-xcode .ace_gutter { background: #e8e8e8; color: #333 } .ace-xcode .ace_print-margin { width: 1px; background: #e8e8e8 } .ace-xcode { background-color: #FFFFFF; color: #000000 } .ace-xcode .ace_cursor { color: #000000 } .ace-xcode .ace_marker-layer .ace_selection { background: #B5D5FF } .ace-xcode.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; border-radius: 2px } .ace-xcode .ace_marker-layer .ace_step { background: rgb(198, 219, 174) } .ace-xcode .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF } .ace-xcode .ace_marker-layer .ace_active-line { background: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_gutter-active-line { background-color: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_marker-layer .ace_selected-word { border: 1px solid #B5D5FF } .ace-xcode .ace_constant.ace_language, .ace-xcode .ace_keyword, .ace-xcode .ace_meta, .ace-xcode .ace_variable.ace_language { color: #C800A4 } .ace-xcode .ace_invisible { color: #BFBFBF } .ace-xcode .ace_constant.ace_character, .ace-xcode .ace_constant.ace_other { color: #275A5E } .ace-xcode .ace_constant.ace_numeric { color: #3A00DC } .ace-xcode .ace_entity.ace_other.ace_attribute-name, .ace-xcode .ace_support.ace_constant, .ace-xcode .ace_support.ace_function { color: #450084 } .ace-xcode .ace_fold { background-color: #C800A4; border-color: #000000 } .ace-xcode .ace_entity.ace_name.ace_tag, .ace-xcode .ace_support.ace_class, .ace-xcode .ace_support.ace_type { color: #790EAD } .ace-xcode .ace_storage { color: #C900A4 } .ace-xcode .ace_string { color: #DF0002 } .ace-xcode .ace_comment { color: #008E00 } .ace-xcode .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y }";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(240),d=r(u),p={manuscript_update:"Manuscript Updated.",file_save:"Saved.",image_create:"Image Created.",file_delete:"File Deleted"},h=function(e){function t(e){var n=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={flash:null},this.unsub=d["default"].flash.listen(function(e,t){clearInterval(n.timer),n.setState({flash:{type:e,message:t}}),n.timer=setTimeout(function(){n.setState({flash:null})},5e3)})}return o(t,e),a(t,[{key:"render",value:function(){var e=this;return c["default"].createElement("nav",{className:"toolbar"},c["default"].createElement("h3",{className:"book-title"},this.props.bookTitle),c["default"].createElement("ul",{className:"actions"},c["default"].createElement("li",null,c["default"].createElement("a",{className:"progressMessage "+(this.props.inProgress?"active":"")},this.props.inProgress?c["default"].createElement("i",{className:"fa fa-refresh fa-spin"}):null," ",p[this.props.progressType]||"Working...")),this.state.flash?c["default"].createElement("li",{onClick:function(){return e.setState({flash:null})},key:this.state.flash.type},c["default"].createElement("a",{className:""+this.state.flash.type},this.state.flash.message)):null,this.props.enablePreview?[c["default"].createElement("li",{key:"toggleLive"},c["default"].createElement("a",{className:this.props.inLiveMode?"active":"",onClick:this.props.toggleLiveMode},c["default"].createElement("i",{className:"fa fa-columns"})," Live Mode")),c["default"].createElement("li",{key:"preview"},c["default"].createElement("a",{className:this.props.inLiveMode?"disabled":"",onClick:this.props.onGeneratePreview},c["default"].createElement("i",{className:"fa fa-play"})," Preview"))]:null))}}]),t}(c["default"].Component);h.propTypes={enablePreview:c["default"].PropTypes.bool.isRequired,inProgress:c["default"].PropTypes.bool.isRequired,progressType:c["default"].PropTypes.string,inLiveMode:c["default"].PropTypes.bool.isRequired,toggleLiveMode:c["default"].PropTypes.func.isRequired,onGeneratePreview:c["default"].PropTypes.func.isRequired,bookTitle:c["default"].PropTypes.string.isRequired},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(241),o=r(i),a=o["default"].createActions({flash:{}});t["default"]=a,e.exports=t["default"]},function(e,t,n){var r=n(242);r.connect=n(256),r.connectFilter=n(258),r.ListenerMixin=n(257),r.listenTo=n(259),r.listenToMany=n(260),e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={version:{"reflux-core":"0.2.1"}};r.ActionMethods=n(243),r.ListenerMethods=n(244),r.PublisherMethods=n(254),r.StoreMethods=n(253),r.createAction=n(255),r.createStore=n(249);var i=n(248).staticJoinCreator;r.joinTrailing=r.all=i("last"),r.joinLeading=i("first"),r.joinStrict=i("strict"),r.joinConcat=i("all");var o=r.utils=n(245);r.EventEmitter=o.EventEmitter,r.Promise=o.Promise,r.createActions=function(){var e=function(e,t){Object.keys(e).forEach(function(n){var i=e[n];t[n]=r.createAction(i)})};return function(t){var n={};return t instanceof Array?t.forEach(function(t){o.isObject(t)?e(t,n):n[t]=r.createAction(t)}):e(t,n),n}}(),r.setEventEmitter=function(e){r.EventEmitter=o.EventEmitter=e},r.setPromise=function(e){r.Promise=o.Promise=e},r.setPromiseFactory=function(e){o.createPromise=e},r.nextTick=function(e){o.nextTick=e},r.use=function(e){e(r)},r.__keep=n(250),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5"),t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245),i=n(248).instanceJoinCreator,o=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},a=function s(e){var t={};for(var n in e){var i=e[n],a=o(i),l=s(a);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t<r.length;t++)if(n=r[t],n===e||n.hasListener&&n.hasListener(e))return!0;return!1},listenToMany:function(e){var t=a(e);for(var n in t){var i=r.callbackName(n),o=this[i]?i:this[n]?n:void 0;o&&this.listenTo(t[n],o,this[i+"Default"]||this[o+"Default"]||o)}},validateListening:function(e){return e===this?"Listener is not able to listen to itself":r.isFunction(e.listen)?e.hasListener&&e.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:e+" is missing a listen method"},listenTo:function(e,t,n){var i,o,a,s=this.subscriptions=this.subscriptions||[];return r.throwIf(this.validateListening(e)),this.fetchInitialState(e,n),i=e.listen(this[t]||t,this),o=function(){var e=s.indexOf(a);r.throwIf(-1===e,"Tried to remove listen already gone from subscriptions list!"),s.splice(e,1),i()},a={stop:o,listenable:e},s.push(a),a},stopListeningTo:function(e){for(var t,n=0,i=this.subscriptions||[];n<i.length;n++)if(t=i[n],t.listenable===e)return t.stop(),r.throwIf(-1!==i.indexOf(t),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var e,t=this.subscriptions||[];e=t.length;)t[0].stop(),r.throwIf(t.length!==e-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(e,t){t=t&&this[t]||t;var n=this;if(r.isFunction(t)&&r.isFunction(e.getInitialState)){var i=e.getInitialState();i&&r.isFunction(i.then)?i.then(function(){t.apply(n,arguments)}):t.call(this,i)}},joinTrailing:i("last"),joinLeading:i("first"),joinConcat:i("all"),joinStrict:i("strict")}},function(module,exports,__webpack_require__){(function(setImmediate){"use strict";function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function callbackName(e,t){return t=t||"on",t+exports.capitalize(e)}function checkEnv(target){var flag=void 0;try{eval(target)&&(flag=!0)}catch(e){flag=!1}environment[callbackName(target,"has")]=flag}function isObject(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function extend(e){if(!isObject(e))return e;for(var t,n,r=1,i=arguments.length;i>r;r++){t=arguments[r];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}else e[n]=t[n]}return e}function isFunction(e){return"function"==typeof e}function object(e,t){for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function isArguments(e){return"object"==typeof e&&"callee"in e&&"number"==typeof e.length}function throwIf(e,t){if(e)throw Error(t||e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=capitalize,exports.callbackName=callbackName,exports.isObject=isObject,exports.extend=extend,exports.isFunction=isFunction,exports.object=object,exports.isArguments=isArguments,exports.throwIf=throwIf;var environment={};exports.environment=environment,checkEnv("setImmediate"),checkEnv("Promise"),exports.EventEmitter=__webpack_require__(247),environment.hasSetImmediate?exports.nextTick=function(e){setImmediate(e)}:exports.nextTick=function(e){setTimeout(e,0)},environment.hasPromise?(exports.Promise=Promise,exports.createPromise=function(e){return new exports.Promise(e)}):(exports.Promise=null,exports.createPromise=function(){})}).call(exports,__webpack_require__(246).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(75).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:s.call(arguments,1);return l[n]=!0,o(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(246).setImmediate,n(246).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);d>c;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;h>c;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;default:if(!l)for(p=1,l=new Array(d-1);d>p;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var l=0,c=a.length;c>l;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&s.push(a[l]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return function(){var r,i=n.subscriptions,o=i?i.indexOf(e):-1;for(l.throwIf(-1===o,"Tried to remove join already gone from subscriptions list!"),r=0;r<t.length;r++)t[r]();i.splice(o,1)}}function i(e){e.listenablesEmitted=new Array(e.numberOfListenables),e.args=new Array(e.numberOfListenables)}function o(e,t){return function(){var n=c.call(arguments);if(t.listenablesEmitted[e])switch(t.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":t.args[e]=n;break;case"all":t.args[e].push(n)}else t.listenablesEmitted[e]=!0,t.args[e]="all"===t.strategy?[n]:n;a(t)}}function a(e){for(var t=0;t<e.numberOfListenables;t++)if(!e.listenablesEmitted[t])return;e.callback.apply(e.listener,e.args),i(e)}var s=n(249),l=n(245),c=Array.prototype.slice,u={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};t.staticJoinCreator=function(e){return function(){var t=c.call(arguments);return s({init:function(){this[u[e]].apply(this,t.concat("triggerAsync"))}})}},t.instanceJoinCreator=function(e){return function(){l.throwIf(arguments.length<2,"Cannot create a join with less than 2 listenables!");var t,n,a=c.call(arguments),s=a.pop(),u=a.length,d={numberOfListenables:u,callback:this[s]||s,listener:this,strategy:e},p=[];for(t=0;u>t;t++)l.throwIf(this.validateListening(a[t]));for(t=0;u>t;t++)p.push(a[t].listen(o(t,d),this));return i(d),n={listenable:a},n.stop=r(n,p,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){"use strict";var r=n(245),i=n(250),o=n(251),a=n(252),s={preEmit:1,shouldEmit:1};e.exports=function(e){function t(){var t,n=0;if(this.subscriptions=[],this.emitter=new r.EventEmitter,this.eventLabel="change",a(this,e),this.init&&r.isFunction(this.init)&&this.init(),this.listenables)for(t=[].concat(this.listenables);n<t.length;n++)this.listenToMany(t[n])}var l=n(253),c=n(254),u=n(244);e=e||{};for(var d in l)if(!s[d]&&(c[d]||u[d]))throw new Error("Cannot override API method "+d+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var p in e)if(!s[p]&&(c[p]||u[p]))throw new Error("Cannot override API method "+p+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");e=o(e),r.extend(t.prototype,u,c,l,e);var h=new t;return i.createdStores.push(h),h}},function(e,t){"use strict";t.createdStores=[],t.createdActions=[],t.reset=function(){for(;t.createdStores.length;)t.createdStores.pop();for(;t.createdActions.length;)t.createdActions.pop()}},function(e,t,n){"use strict";var r=n(245);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t){"use strict";e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245);e.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(e,t){t=t||this;var n=function(n){i||e.apply(t,n)},r=this,i=!1;return this.emitter.addListener(this.eventLabel,n),function(){i=!0,r.emitter.removeListener(r.eventLabel,n)}},promise:function(e){var t=this,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,o){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,o),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var a=e.completed.listen(function(e){a(),s(),i(e)}),s=e.failed.listen(function(e){a(),s(),o(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){"use strict";var r=n(245),i=n(243),o=n(254),a=n(250),s={preEmit:1,shouldEmit:1},l=function c(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i)if(!s[t]&&o[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&o[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,u={};l<e.children.length;l++){var d=e.children[l];u[d]=c(d)}var p=r.extend({eventLabel:"action",emitter:new r.EventEmitter,_isAction:!0},o,i,e),h=function f(){var e=f.sync?"trigger":r.environment.hasPromise?"triggerPromise":"triggerAsync";return f[e].apply(f,arguments)};return r.extend(h,u,p),a.createdActions.push(h),h};e.exports=l},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t){return{getInitialState:function(){return o.isFunction(e.getInitialState)?void 0===t?e.getInitialState():o.object([t],[e.getInitialState()]):{}},componentDidMount:function(){o.extend(this,r);var n=this,i=void 0===t?this.setState:function(e){("undefined"==typeof n.isMounted||n.isMounted()===!0)&&n.setState(o.object([t],[e]))};this.listenTo(e,i)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(245),i=n(244);e.exports=r.extend({componentWillUnmount:i.stopListeningToAll},i)},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t,n){return n=o.isFunction(t)?t:n,{getInitialState:function(){if(o.isFunction(e.getInitialState)){if(o.isFunction(t))return n.call(this,e.getInitialState());var r=n.call(this,e.getInitialState());return"undefined"!=typeof r?o.object([t],[r]):{}}return{}},componentDidMount:function(){o.extend(this,r);var i=this,a=function(e){if(o.isFunction(t))i.setState(n.call(i,e));else{var r=n.call(i,e);i.setState(o.object([t],[r]))}};this.listenTo(e,a)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(244);e.exports=function(e,t,n){return{componentDidMount:function(){for(var i in r)if(this[i]!==r[i]){if(this[i])throw"Can't have other property '"+i+"' when using Reflux.listenTo!";this[i]=r[i]}this.listenTo(e,t,n)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){var r=n(244);e.exports=function(e){return{componentDidMount:function(){for(var t in r)if(this[t]!==r[t]){if(this[t])throw"Can't have other property '"+t+"' when using Reflux.listenToMany!";this[t]=r[t]}this.listenToMany(e)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(2),d=r(u),p=n(262),h=r(p),f=n(238),m=r(f),g=n(341),v=r(g),y=n(263),b=n(240),w=r(b),k=n(3),x=r(k);d["default"].string=x["default"];var E=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={files:[],closed:!1,fileMode:"manuscript",busy:!1},this.toggleClose=this.toggleClose.bind(this),this.newFile=this.newFile.bind(this),this.createFile=this.createFile.bind(this),this.createImageFile=this.createImageFile.bind(this),this.listManuscript=this.listManuscript.bind(this),this.onDeleteFile=this.onDeleteFile.bind(this),this.onChangeMode=this.onChangeMode.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.listCode=this.listCode.bind(this),this.listManuscript=this.listManuscript.bind(this),this.listImage=this.listImage.bind(this),this.moveFile=this.moveFile.bind(this),this.saveManuscript=this.saveManuscript.bind(this),m["default"].onDelete(this.onFileDeleted)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.listManuscript()}},{key:"componentDidUpdate",value:function(e,t){t.fileMode&&t.fileMode!==this.state.fileMode&&this["list"+d["default"].string.capitalize(this.state.fileMode)]()}},{key:"onFileDeleted",value:function(){this.props.onChangeFile(null)}},{key:"listManuscript",value:function(){var e=this;this.busy(!0),m["default"].listFiles(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listImage",value:function(){var e=this;this.busy(!0),m["default"].listImages(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listCode",value:function(){var e=this;this.busy(!0),m["default"].listCode(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"busy",value:function(e){this.setState({busy:e})}},{key:"free",value:function(){this.setState({busy:!1})}},{key:"toggleClose",value:function(e){this.setState({closed:!this.state.closed})}},{key:"onChangeMode",value:function(e){this.setState({fileMode:e})}},{key:"createImageFile",value:function(e){var t=this,n=this.refs.imageFile.getDOMNode();return m["default"].newImage(n,function(){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)]()}),e.stopPropagation(),e.preventDefault(),!1}},{key:"createFile",value:function(e){var t=this,n=this.refs.filename.getDOMNode();-1!==this.props.blacklistedFiles.indexOf(n.value.toLowerCase())?w["default"].flash("error","You may not create a file with the name "+n.value+" as it is a reserved file."):m["default"]["new"](n.value,this.state.fileMode,"",function(e,r){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)](),t.props.onChangeFile(r)}),e.stopPropagation(),e.preventDefault()}},{key:"newFile",value:function(e){this.setState({creatingFile:!this.state.creatingFile})}},{key:"onDeleteFile",value:function(e){m["default"]["delete"](e.filename,this.state.fileMode,this["list"+d["default"].string.capitalize(this.state.fileMode)])}},{key:"saveManuscript",value:function(){"manuscript"===this.state.fileMode&&m["default"].saveManuscript(this.state.files)}},{key:"moveFile",value:function(e,t){var n=d["default"].clone(this.state.files),r=n.indexOf(e),i=n.indexOf(t);n.splice(r,1),n.splice(i,0,e),this.setState({files:n})}},{key:"renderFileCreator",value:function(){if(this.state.creatingFile){if("image"===this.state.fileMode){var e=c["default"].createElement("form",{onSubmit:this.createImageFile,className:"file-name"},c["default"].createElement("input",{type:"file",ref:"imageFile"}),c["default"].createElement("button",null,"Submit")),t=c["default"].createElement("p",null,"Sorry, image uploads are not supported");return m["default"].supportsImageUploads()?e:t}return c["default"].createElement("form",{onSubmit:this.createFile,className:"file-name"},c["default"].createElement("input",{type:"text",ref:"filename",placeholder:"Type a filename..."}),c["default"].createElement("button",null,"Create"))}}},{key:"renderFilesList",value:function(){var e=this;return this.state.busy?c["default"].createElement("i",{className:"busy-indicator fa fa-spin fa-2x fa-circle-o-notch"}):c["default"].createElement("ul",{className:"files-list"},d["default"].map(this.state.files,function(t,n){return c["default"].createElement(h["default"],{saveManuscript:e.saveManuscript,moveFile:e.moveFile,key:n,fileMode:e.state.fileMode,onDeleteFile:e.onDeleteFile,onChangeFile:e.props.onChangeFile,onPreviewImage:e.props.onPreviewImage,isCurrent:e.props.currentFile===t,file:t})}))}},{key:"render",value:function(){var e="file-browser "+(this.state.closed?"closed":"open"),t="new-file"+(this.state.creatingFile?" active":"");return c["default"].createElement("section",{className:e},c["default"].createElement("ul",{className:"file-types-list"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"manuscript")},c["default"].createElement("h4",{className:"title"+("manuscript"===this.state.fileMode?" selected":"")},"files"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"image")},c["default"].createElement("h4",{className:"title"+("image"===this.state.fileMode?" selected":"")},"images"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"code")},c["default"].createElement("h4",{className:"title"+("code"===this.state.fileMode?" selected":"")},"code")))),c["default"].createElement("div",{className:t,onClick:this.newFile},c["default"].createElement("i",{className:"fa fa-plus"}," ")),this.renderFileCreator(),this.renderFilesList(),c["default"].createElement("button",{className:"close-button",onClick:this.toggleClose},c["default"].createElement("span",null)))}}]),t}(c["default"].Component);E.propTypes={projectRoot:c["default"].PropTypes.string.isRequired,onChangeFile:c["default"].PropTypes.func.isRequired,currentFile:c["default"].PropTypes.string,blacklistedFiles:c["default"].PropTypes.array.isRequired},t["default"]=y.DragDropContext(v["default"])(E),
37
37
  e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(73),s=r(a),l=n(263),c={beginDrag:function(e){return e.file}},u={hover:function(e,t){var n=t.getItem();n!==e.file&&e.moveFile(n,e.file)},drop:function(e,t){e.saveManuscript()}},d=function(){function e(e){i(this,t),this.onDelete=this.onDelete.bind(this),this.onChange=this.onChange.bind(this)}o(e,[{key:"onDelete",value:function(e){confirm("Are you sure you want to delete this file?")&&this.props.onDeleteFile(this.props.file),e.stopPropagation(),e.preventDefault()}},{key:"onChange",value:function(e){"image"===this.props.file.type?this.props.onPreviewImage(this.props.file):this.props.onChangeFile(this.props.file)}},{key:"getFileIconClass",value:function(){switch(this.props.fileMode){case"manuscript":return"fa-file-o";case"images":return"fa-file-image";case"code":return"fa-code"}}},{key:"render",value:function(){var e="files-list-item"+(this.props.isCurrent?" current":"")+(this.props.file.parent?" child":"")+(this.props.isDragging?" dragging":"");return this.props.connectDragSource(this.props.connectDropTarget(s["default"].createElement("li",{className:e,onClick:this.onChange},s["default"].createElement("a",null,s["default"].createElement("i",{className:"fa "+this.getFileIconClass()})," ",this.props.file.filename),s["default"].createElement("button",{onClick:this.onDelete},s["default"].createElement("i",{className:"fa fa-times"})))))}}]);var t=e;return e=l.DragSource("file",c,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}})(e)||e,e=l.DropTarget("file",u,function(e){return{connectDropTarget:e.dropTarget()}})(e)||e}();t["default"]=d,d.propTypes={file:s["default"].PropTypes.object.isRequired,fileMode:s["default"].PropTypes.string.isRequired,moveFile:s["default"].PropTypes.func.isRequired,saveManuscript:s["default"].PropTypes.func.isRequired,isCurrent:s["default"].PropTypes.bool.isRequired,onDeleteFile:s["default"].PropTypes.func.isRequired,onChangeFile:s["default"].PropTypes.func.isRequired,onPreviewImage:s["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(264);t.DragDropContext=r(i);var o=n(310);t.DragLayer=r(o);var a=n(321);t.DragSource=r(a);var s=n(336);t.DropTarget=r(s),"production"!==e.env.NODE_ENV&&Object.defineProperty(t,"default",{get:function(){console.error("React DnD does not provide a default export. You are probably missing the curly braces in the import statement. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export")}})}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){g["default"].apply(void 0,["DragDropContext","backend"].concat(l.call(arguments))),"object"==typeof e&&"function"==typeof e["default"]&&(e=e["default"]),f["default"]("function"==typeof e,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var t={dragDropManager:new p.DragDropManager(e)};return function(e){var n=e.displayName||e.name||"Component";return function(r){function a(){i(this,a),r.apply(this,arguments)}return o(a,r),a.prototype.getDecoratedComponentInstance=function(){return this.refs.child},a.prototype.getManager=function(){return t.dragDropManager},a.prototype.getChildContext=function(){return t},a.prototype.render=function(){return d["default"].createElement(e,s({},this.props,{ref:"child"}))},c(a,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+n+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),a}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=n(265),h=n(280),f=r(h),m=n(309),g=r(m);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(266);t.DragDropManager=r(i);var o=n(305);t.DragSource=r(o);var a=n(306);t.DropTarget=r(a);var s=n(307);t.createTestBackend=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(267),s=i(a),l=n(269),c=i(l),u=n(271),d=r(u),p=n(301),h=i(p),f=n(302),m=(i(f),function(){function e(t){o(this,e);var n=s["default"](c["default"]);this.store=n,this.monitor=new h["default"](n),this.registry=this.monitor.registry,this.backend=t(this),n.subscribe(this.handleRefCountChange.bind(this))}return e.prototype.handleRefCountChange=function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var r=e.apply(t,arguments);"undefined"!=typeof r&&n(r)}}var t=this,n=this.store.dispatch;return Object.keys(d).filter(function(e){return"function"==typeof d[e]}).reduce(function(t,n){return t[n]=e(d[n]),t},{})},e}());t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(){return c}function r(e){return u.push(e),function(){var t=u.indexOf(e);u.splice(t,1)}}function i(e){if(!a["default"](e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=l(c,e)}finally{d=!1}return u.slice().forEach(function(e){return e()}),e}function o(e){l=e,i({type:s.INIT})}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,c=t,u=[],d=!1;return i({type:s.INIT}),{dispatch:i,subscribe:r,getState:n,replaceReducer:o}}t.__esModule=!0,t["default"]=i;var o=n(268),a=r(o),s={INIT:"@@redux/INIT"};t.ActionTypes=s},function(e,t){"use strict";function n(e){if(!e||"object"!=typeof e)return!1;var t="function"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}t.__esModule=!0,t["default"]=n;var r=function(e){return Function.prototype.toString.call(e)};e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(270),o=r(i),a=n(281),s=r(a),l=n(295),c=r(l),u=n(296),d=r(u);t["default"]=function(e,t){return void 0===e&&(e={}),{dirtyHandlerIds:d["default"](e.dirtyHandlerIds,t,e.dragOperation),dragOffset:o["default"](e.dragOffset,t),refCount:c["default"](e.refCount,t),dragOperation:s["default"](e.dragOperation,t)}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return e===t?!0:e&&t&&e.x===t.x&&e.y===t.y}function i(e,t){switch(void 0===e&&(e=c),t.type){case l.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case l.HOVER:return r(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case l.END_DRAG:case l.DROP:return c;default:return e}}function o(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function a(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i,t.getSourceClientOffset=o,t.getDifferenceFromInitialOffset=a;var l=n(271),c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.publishSource,r=void 0===n?!0:n,i=t.clientOffset,o=void 0===i?null:i,a=t.getSourceClientOffset;p["default"](f["default"](e),"Expected sourceIds to be an array.");var s=this.getMonitor(),l=this.getRegistry();p["default"](!s.isDragging(),"Cannot call beginDrag while dragging.");for(var c=0;c<e.length;c++)p["default"](l.getSource(e[c]),"Expected sourceIds to be registered.");for(var u=null,c=e.length-1;c>=0;c--)if(s.canDragSource(e[c])){u=e[c];break}if(null!==u){var d=null;o&&(p["default"]("function"==typeof a,"When clientOffset is provided, getSourceClientOffset must be a function."),d=a(u));var h=l.getSource(u),m=h.beginDrag(s,u);p["default"](g["default"](m),"Item must be an object."),l.pinSource(u);var y=l.getSourceType(u);return{type:v,itemType:y,item:m,sourceId:u,clientOffset:o,sourceClientOffset:d,isSourcePublic:r}}}function o(e){var t=this.getMonitor();if(t.isDragging())return{type:y}}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.clientOffset,r=void 0===n?null:n;p["default"](f["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var i=this.getMonitor(),o=this.getRegistry();p["default"](i.isDragging(),"Cannot call hover while not dragging."),p["default"](!i.didDrop(),"Cannot call hover after drop.");for(var a=i.getItemType(),s=0;s<e.length;s++){var l=e[s];p["default"](e.lastIndexOf(l)===s,"Expected targetIds to be unique in the passed array.");var c=o.getTarget(l);p["default"](c,"Expected targetIds to be registered.");var d=o.getTargetType(l);u["default"](d,a)&&c.hover(i,l)}return{type:b,targetIds:e,clientOffset:r}}function s(){var e=this,t=this.getMonitor(),n=this.getRegistry();p["default"](t.isDragging(),"Cannot call drop while not dragging."),p["default"](!t.didDrop(),"Cannot call drop twice during one drag operation.");var r=t.getTargetIds().filter(t.canDropOnTarget,t);r.reverse(),r.forEach(function(r,i){var o=n.getTarget(r),a=o.drop(t,r);p["default"]("undefined"==typeof a||g["default"](a),"Drop result must either be an object or undefined."),"undefined"==typeof a&&(a=0===i?{}:t.getDropResult()),e.store.dispatch({type:w,dropResult:a})})}function l(){var e=this.getMonitor(),t=this.getRegistry();p["default"](e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId(),r=t.getSource(n,!0);return r.endDrag(e,n),t.unpinSource(),{type:k}}t.__esModule=!0,t.beginDrag=i,t.publishDragSource=o,t.hover=a,t.drop=s,t.endDrag=l;var c=n(272),u=r(c),d=n(280),p=r(d),h=n(273),f=r(h),m=n(277),g=r(m),v="dnd-core/BEGIN_DRAG";t.BEGIN_DRAG=v;var y="dnd-core/PUBLISH_DRAG_SOURCE";t.PUBLISH_DRAG_SOURCE=y;var b="dnd-core/HOVER";t.HOVER=b;var w="dnd-core/DROP";t.DROP=w;var k="dnd-core/END_DRAG";t.END_DRAG=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return a["default"](e)?e.some(function(e){return e===t}):e===t}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){var r=n(274),i=n(279),o=n(278),a="[object Array]",s=Object.prototype,l=s.toString,c=r(Array,"isArray"),u=c||function(e){return o(e)&&i(e.length)&&l.call(e)==a};e.exports=u},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=n(275);e.exports=r},function(e,t,n){function r(e){return null==e?!1:i(e)?u.test(l.call(e)):o(e)&&a.test(e)}var i=n(276),o=n(278),a=/^\[object .+?Constructor\]$/,s=Object.prototype,l=Function.prototype.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return i(e)&&s.call(e)==o}var i=n(277),o="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){(function(t){"use strict";var n=function(e,n,r,i,o,a,s,l){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,i,o,a,s,l],d=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return u[d++]}))}throw c.framesToPop=1,c}};e.exports=n}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){switch(void 0===e&&(e=u),t.type){case a.BEGIN_DRAG:return o({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case a.HOVER:return o({},e,{targetIds:t.targetIds});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case s.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:o({},e,{targetIds:c["default"](e.targetIds,t.targetId)});case a.DROP:return o({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case a.END_DRAG:return o({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i;var a=n(271),s=n(282),l=n(283),c=r(l),u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.exports=t["default"]},function(e,t){"use strict";function n(e){return{type:a,sourceId:e}}function r(e){return{type:s,targetId:e}}function i(e){return{type:l,sourceId:e}}function o(e){return{type:c,targetId:e}}t.__esModule=!0,t.addSource=n,t.addTarget=r,t.removeSource=i,t.removeTarget=o;var a="dnd-core/ADD_SOURCE";t.ADD_SOURCE=a;var s="dnd-core/ADD_TARGET";t.ADD_TARGET=s;var l="dnd-core/REMOVE_SOURCE";t.REMOVE_SOURCE=l;var c="dnd-core/REMOVE_TARGET";t.REMOVE_TARGET=c},function(e,t,n){var r=n(284),i=n(291),o=n(294),a=o(function(e,t){return i(e)?r(e,t):[]});e.exports=a},function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var l=-1,c=i,u=!0,d=u&&t.length>=s?a(t):null,p=t.length;d&&(c=o,u=!1,t=d);e:for(;++l<n;){var h=e[l];if(u&&h===h){for(var f=p;f--;)if(t[f]===h)continue e;r.push(h)}else c(t,h,0)<0&&r.push(h)}return r}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=n(286);e.exports=r},function(e,t){function n(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}e.exports=n},function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=n(277);e.exports=r},function(e,t,n){(function(t){function r(e){return s&&a?new i(e):null}var i=n(289),o=n(274),a=o(t,"Set"),s=o(Object,"create");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=n(290),o=n(274),a=o(t,"Set"),s=o(Object,"create");r.prototype.push=i,e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=n(277);e.exports=r},function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=n(292),o=n(279);e.exports=r},function(e,t,n){var r=n(293),i=r("length");e.exports=i},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t){function n(e,t){if("function"!=typeof e)throw new TypeError(r);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var r="Expected a function",i=Math.max;e.exports=n},function(e,t,n){"use strict";function r(e,t){switch(void 0===e&&(e=0),t.type){case i.ADD_SOURCE:case i.ADD_TARGET:return e+1;case i.REMOVE_SOURCE:case i.REMOVE_TARGET:return e-1;default:return e}}t.__esModule=!0,t["default"]=r;var i=n(282);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){switch(void 0===e&&(e=p),t.type){case u.HOVER:break;case d.ADD_SOURCE:case d.ADD_TARGET:case d.REMOVE_TARGET:case d.REMOVE_SOURCE:return p;case u.BEGIN_DRAG:case u.PUBLISH_DRAG_SOURCE:case u.END_DRAG:case u.DROP:default:return h}var r=t.targetIds,i=n.targetIds,o=s["default"](r,i),a=!1;if(0===o.length){for(var l=0;l<r.length;l++)if(r[l]!==i[l]){a=!0;break}}else a=!0;if(!a)return p;var c=i[i.length-1],f=r[r.length-1];return c!==f&&(c&&o.push(c),f&&o.push(f)),o}function o(e,t){return e===p?!1:e===h||"undefined"==typeof t?!0:c["default"](t,e).length>0}t.__esModule=!0,t["default"]=i,t.areDirty=o;var a=n(297),s=r(a),l=n(300),c=r(l),u=n(271),d=n(282),p=[],h=[]},function(e,t,n){function r(){for(var e=-1,t=arguments.length;++e<t;){var n=arguments[e];if(s(n))var r=r?i(o(r,n),o(n,r)):n}return r?a(r):[]}var i=n(298),o=n(284),a=n(299),s=n(291);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){function r(e,t){var n=-1,r=i,l=e.length,c=!0,u=c&&l>=s,d=u?a():null,p=[];d?(r=o,c=!1):(u=!1,d=t?[]:p);e:for(;++n<l;){var h=e[n],f=t?t(h,n,e):h;if(c&&h===h){for(var m=d.length;m--;)if(d[m]===f)continue e;t&&d.push(f),p.push(h)}else r(d,f,0)<0&&((t||u)&&d.push(f),p.push(h))}return p}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){var r=n(285),i=n(287),o=n(288),a=n(291),s=n(294),l=s(function(e){for(var t=e.length,n=t,s=Array(f),l=r,c=!0,u=[];n--;){var d=e[n]=a(d=e[n])?d:[];s[n]=c&&d.length>=120?o(n&&d):null}var p=e[0],h=-1,f=p?p.length:0,m=s[0];e:for(;++h<f;)if(d=p[h],(m?i(m,d):l(u,d,0))<0){for(var n=t;--n;){var g=s[n];if((g?i(g,d):l(e[n],d,0))<0)continue e}m&&m.push(d),u.push(d)}return u});e.exports=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(280),a=r(o),s=n(272),l=r(s),c=n(273),u=r(c),d=n(302),p=r(d),h=n(270),f=n(296),m=function(){function e(t){i(this,e),this.store=t,this.registry=new p["default"](t)}return e.prototype.subscribeToStateChange=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=n.handlerIds;a["default"]("function"==typeof e,"listener must be a function."),a["default"]("undefined"==typeof r||u["default"](r),"handlerIds, when specified, must be an array of strings.");var i=function(){f.areDirty(t.store.getState().dirtyHandlerIds,r)&&e()};return this.store.subscribe(i)},e.prototype.subscribeToOffsetChange=function(e){var t=this;a["default"]("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)},e.prototype.canDragSource=function(e){var t=this.registry.getSource(e);return a["default"](t,"Expected to find a valid source."),this.isDragging()?!1:t.canDrag(this,e)},e.prototype.canDropOnTarget=function(e){var t=this.registry.getTarget(e);if(a["default"](t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return l["default"](n,r)&&t.canDrop(this,e)},e.prototype.isDragging=function(){return Boolean(this.getItemType())},e.prototype.isDraggingSource=function(e){var t=this.registry.getSource(e,!0);if(a["default"](t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n!==r?!1:t.isDragging(this,e)},e.prototype.isOverTarget=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.shallow,r=void 0===n?!1:n;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),o=this.getItemType();if(!l["default"](i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var s=a.indexOf(e);return r?s===a.length-1:s>-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return h.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return h.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&e.constructor===Symbol?"symbol":typeof e}function a(e){p["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),p["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),p["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function s(e){p["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),p["default"]("function"==typeof e.hover,"Expected hover to be a function."),p["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function l(e,t){return t&&g["default"](e)?void e.forEach(function(e){return l(e,!1)}):void p["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":o(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function c(e){var t=y["default"]().toString();switch(e){case w.SOURCE:return"S"+t;case w.TARGET:return"T"+t;default:p["default"](!1,"Unknown role: "+e)}}function u(e){switch(e[0]){case"S":return w.SOURCE;case"T":return w.TARGET;default:p["default"](!1,"Cannot parse handler ID: "+e)}}t.__esModule=!0;var d=n(280),p=r(d),h=n(303),f=r(h),m=n(273),g=r(m),v=n(304),y=r(v),b=n(282),w=f["default"]({SOURCE:null,TARGET:null}),k=function(){function e(t){i(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){l(e),a(t);var n=this.addHandler(w.SOURCE,e,t);return this.store.dispatch(b.addSource(n)),n},e.prototype.addTarget=function(e,t){l(e,!0),s(t);var n=this.addHandler(w.TARGET,e,t);return this.store.dispatch(b.addTarget(n)),n},e.prototype.addHandler=function(e,t,n){var r=c(e);return this.types[r]=t,this.handlers[r]=n,r},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})},e.prototype.getSource=function(e,t){p["default"](this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r},e.prototype.getTarget=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return p["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=u(e);return t===w.SOURCE},e.prototype.isTargetId=function(e){var t=u(e);return t===w.TARGET},e.prototype.removeSource=function(e){p["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(b.removeSource(e)),delete this.handlers[e],delete this.types[e]},e.prototype.removeTarget=function(e){p["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(b.removeTarget(e)),delete this.handlers[e],delete this.types[e]},e.prototype.pinSource=function(e){var t=this.getSource(e);p["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){p["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();t["default"]=k,e.exports=t["default"]},function(e,t){"use strict";var n=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=n},function(e,t){"use strict";function n(){return r++}t.__esModule=!0,t["default"]=n;var r=0;e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new l(e)}t.__esModule=!0,t["default"]=o;var a=n(308),s=r(a),l=function(){function e(t){i(this,e),this.actions=t.getActions()}return e.prototype.setup=function(){this.didCallSetup=!0},e.prototype.teardown=function(){this.didCallTeardown=!0},e.prototype.connectDragSource=function(){return s["default"]},e.prototype.connectDragPreview=function(){return s["default"]},e.prototype.connectDropTarget=function(){return s["default"]},e.prototype.simulateBeginDrag=function(e,t){this.actions.beginDrag(e,t)},e.prototype.simulatePublishDragSource=function(){this.actions.publishDragSource()},e.prototype.simulateHover=function(e,t){this.actions.hover(e,t)},e.prototype.simulateDrop=function(){this.actions.drop()},e.prototype.simulateEndDrag=function(){this.actions.endDrag()},e}();e.exports=t["default"]},function(e,t){function n(){}e.exports=n},function(e,t,n){(function(n){"use strict";function r(e,t){if("production"!==n.env.NODE_ENV){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;r>o;o++)i[o-2]=arguments[o];for(var a=0;a<i.length;a++){var s=i[a];if(s&&s.prototype&&s.prototype.render)return void console.error("You seem to be applying the arguments in the wrong order. "+("It should be "+e+"("+t+")(Component), not the other way around. ")+"Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order")}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return k["default"].apply(void 0,["DragLayer","collect[, options]"].concat(l.call(arguments))),b["default"]("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html",e),b["default"](v["default"](t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html',t),function(n){var r=t.arePropsEqual,a=void 0===r?m["default"]:r,l=n.displayName||n.name||"Component";return function(t){function r(e,n){i(this,r),t.call(this,e),this.handleChange=this.handleChange.bind(this),this.manager=n.dragDropManager,b["default"]("object"==typeof this.manager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",l,l),this.state=this.getCurrentState()}return o(r,t),r.prototype.getDecoratedComponentInstance=function(){return this.refs.child},r.prototype.shouldComponentUpdate=function(e,t){return!a(e,this.props)||!h["default"](t,this.state)},c(r,null,[{key:"DecoratedComponent",value:n,enumerable:!0},{key:"displayName",value:"DragLayer("+l+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),r.prototype.componentDidMount=function(){var e=this.manager.getMonitor();this.unsubscribe=e.subscribeToOffsetChange(this.handleChange)},r.prototype.componentWillUnmount=function(){this.unsubscribe()},r.prototype.handleChange=function(){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)},r.prototype.getCurrentState=function(){
38
38
  var t=this.manager.getMonitor();return e(t)},r.prototype.render=function(){return d["default"].createElement(n,s({},this.props,this.state,{ref:"child"}))},r}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=(n(265),n(311)),h=r(p),f=n(312),m=r(f),g=n(313),v=r(g),y=n(280),b=r(y),w=n(309),k=r(w);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;var a=e[n[o]],s=t[n[o]];if(a!==s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o]))return!1;var a=e[n[o]],s=t[n[o]];if(a!==s||"object"==typeof a||"object"==typeof s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){var t;if(!a(e)||u.call(e)!=s||o(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=n(314),o=n(319),a=n(278),s="[object Object]",l=Object.prototype,c=l.hasOwnProperty,u=l.toString;e.exports=r},function(e,t,n){function r(e,t){return i(e,t,o)}var i=n(315),o=n(318);e.exports=r},function(e,t,n){var r=n(316),i=r();e.exports=i},function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,l=e?s:-1;e?l--:++l<s;){var c=a[l];if(n(o[c],c,o)===!1)break}return t}}var i=n(317);e.exports=r},function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=n(277);e.exports=r},function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||i(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,d=Array(t),p=t>0;++r<t;)d[r]=r+"";for(var h in e)p&&a(h,t)||"constructor"==h&&(c||!u.call(e,h))||d.push(h);return d}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(277),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)&&i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}var i=n(291),o=n(278),a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;e.exports=r},function(e,t){function n(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var r=/^\d+$/,i=9007199254740991;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DragSource","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(331),y=r(v),b=n(332),w=r(b),k=n(333),x=r(k),E=n(334),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.DecoratedComponent,n=e.createHandler,i=e.createMonitor,s=e.createConnector,h=e.registerHandler,m=e.containerDisplayName,v=e.getType,b=e.collect,k=e.options,E=k.arePropsEqual,_=void 0===E?g["default"]:E,C=t.displayName||t.name||"Component";return function(e){function g(t,r){o(this,g),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),w["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=i(this.manager),this.handler=n(this.handlerMonitor),this.disposable=new p.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState()}return a(g,e),g.prototype.getHandlerId=function(){return this.handlerId},g.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},g.prototype.shouldComponentUpdate=function(e,t){return!_(e,this.props)||!f["default"](t,this.state)},c(g,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:m+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),g.prototype.componentWillReceiveProps=function(e){_(e,this.props)||(this.receiveProps(e),this.handleChange())},g.prototype.componentWillUnmount=function(){this.disposable.dispose()},g.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},g.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=h(e,this.handler,this.manager),n=t.handlerId,r=t.unregister,i=s(this.manager.getBackend()),o=x["default"](i,n),a=o.handlerConnector,l=o.disposable;this.handlerId=n,this.handlerConnector=a,this.handlerMonitor.receiveHandlerId(n);var c=this.manager.getMonitor(),u=c.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new p.CompositeDisposable(new p.Disposable(u),new p.Disposable(r),l))}},g.prototype.handleChange=function(){var e=this.getCurrentState();f["default"](e,this.state)||this.setState(e)},g.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},g.prototype.getCurrentState=function(){var e=b(this.handlerConnector,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&w["default"](y["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",m,C,e),e},g.prototype.render=function(){return d["default"].createElement(t,l({},this.props,this.state,{ref:this.handleChildRef}))},g}(u.Component)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=s;var u=n(73),d=i(u),p=n(323),h=n(311),f=i(h),m=n(312),g=i(m),v=n(313),y=i(v),b=n(280),w=i(b),k=n(328),x=i(k);e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};t.__esModule=!0;var i=n(324),o=r(i);t.isDisposable=o["default"];var a=n(325),s=r(a);t.Disposable=s["default"];var l=n(326),c=r(l);t.CompositeDisposable=c["default"];var u=n(327),d=r(u);t.SerialDisposable=d["default"]},function(e,t){"use strict";function n(e){return Boolean(e&&"function"==typeof e.dispose)}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.__esModule=!0;var i=function(){},o=function(){function e(t){n(this,e),this.isDisposed=!1,this.action=t||i}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},r(e,null,[{key:"empty",enumerable:!0,value:{dispose:i}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];i(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var o=0;o<n.length;o++)if(!a["default"](n[o]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return-1===t?!1:(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;e>n;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(var n=0;e>n;n++)t[n].dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){i(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=new s.CompositeDisposable,r={};return Object.keys(e).forEach(function(i){var o=a["default"](t,e[i]),s=o.disposable,l=o.ref;n.add(s),r[i]=function(){return l}}),{disposable:n,handlerConnector:r}}t.__esModule=!0,t["default"]=i;var o=n(329),a=r(o),s=n(323);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(s,d){if(u.isValidElement(s)){var p=s;return l["default"](p,function(e){return n(e,d)})}var h=u.findDOMNode(s);if(h!==i||!a["default"](o,d)){if(i=h,o=d,!h)return void r.setDisposable(null);var f=t(e,h,d);r.setDisposable(new c.Disposable(f))}}var r=new c.SerialDisposable,i=null,o=null;return{ref:n,disposable:r}}t.__esModule=!0,t["default"]=i;var o=n(311),a=r(o),s=n(330),l=r(s),c=n(323),u=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=e.ref;return a["default"]("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),s.cloneElement(e,{ref:function(e){t(e),n&&n(e)}})}t.__esModule=!0,t["default"]=i;var o=n(280),a=r(o),s=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeSource(o)}var i=n.getRegistry(),o=i.addSource(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),p.forEach(function(t){l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return e.canDrag?e.canDrag(this.props,this.monitor):!0},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"](u["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrag","beginDrag","canDrag","isDragging","endDrag"],p=["beginDrag"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new u(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=!1,u=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){s["default"](!l,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{l=!1}},e.prototype.isDragging=function(){s["default"](!c,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return c=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{c=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dragSource:e.connectDragSource.bind(e),dragPreview:e.connectDragPreview.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return"string"==typeof e||"symbol"==typeof e||t&&a["default"](e)&&e.every(function(e){return i(e,!1)})}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(337),y=r(v),b=n(338),w=r(b),k=n(339),x=r(k),E=n(340),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeTarget(o)}var i=n.getRegistry(),o=i.addTarget(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return e.canDrop?e.canDrop(this.props,this.monitor):!0},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"]("undefined"==typeof t||u["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrop","hover","drop"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new c(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){s["default"](!l,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return l=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{l=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dropTarget:e.connectDropTarget.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return _||(_=new Image,_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),_}function l(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function c(e){var t=T[e],n=t.exposeProperty,r=t.matchesTypes,s=t.getData;return function(e){function t(){i(this,t),e.call(this),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return o(t,e),t.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=s(e,r)},t.prototype.beginDrag=function(){return this.item},t}(h.DragSource)}function u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(T).filter(function(e){var n=T[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}function d(e){return new S(e)}t.__esModule=!0;var p;t.getEmptyImage=s,t["default"]=d;var h=n(265),f=n(342),m=r(f),g=n(345),v=n(352),y=n(311),b=r(y),w=n(354),k=r(w),x=n(280),E=r(x),_=void 0,C={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__",TEXT:"__NATIVE_TEXT__"};t.NativeTypes=C;var T=(p={},a(p,C.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(p,C.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return l(e,t,"").split("\n")}}),a(p,C.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return l(e,t,"")}}),p),S=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new m["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this)}return e.prototype.setup=function(){"undefined"!=typeof window&&(E["default"](!this.constructor.isSetUp,"Cannot have two HTML5 backends at the same time."),this.constructor.isSetUp=!0,window.addEventListener("dragstart",this.handleTopDragStart),window.addEventListener("dragstart",this.handleTopDragStartCapture,!0),window.addEventListener("dragend",this.handleTopDragEndCapture,!0),window.addEventListener("dragenter",this.handleTopDragEnter),window.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.addEventListener("dragover",this.handleTopDragOver),window.addEventListener("dragover",this.handleTopDragOverCapture,!0),window.addEventListener("drop",this.handleTopDrop),window.addEventListener("drop",this.handleTopDropCapture,!0))},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,window.removeEventListener("dragstart",this.handleTopDragStart),window.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),window.removeEventListener("dragend",this.handleTopDragEndCapture,!0),window.removeEventListener("dragenter",this.handleTopDragEnter),window.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.removeEventListener("dragover",this.handleTopDragOver),window.removeEventListener("dragover",this.handleTopDragOverCapture,!0),window.removeEventListener("drop",this.handleTopDrop),window.removeEventListener("drop",this.handleTopDropCapture,!0),this.clearCurrentDragSourceNode())},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var i=function(t){return r.handleDragStart(t,e)},o=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return k["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return k["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return v.getElementClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(C).some(function(t){return C[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=c(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])},e.prototype.endDragNativeItem=function(){this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||(this.actions.endDrag(),this.clearCurrentDragSourceNode())},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=v.getElementClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return this.currentDragSourceNode?(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0):!1},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return e?this.currentDragSourceNodeOffsetChanged?!0:(this.currentDragSourceNodeOffsetChanged=!b["default"](v.getElementClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged):!1},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=v.getEventClientOffset(e);
39
- this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t);if(h&&h.data){var f="data:"+h.mimetype.string+";base64,"+h.data;e=e.replace(a,'src="'+f)}else o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
39
+ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t),f=void 0;h?(h.data?f="data:"+h.mimetype.string+";base64,"+h.data:h.url&&(f=h.url),e=e.replace(a,'src="'+f)):o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
40
40
  * jQuery JavaScript Library v2.1.4
41
41
  * http://jquery.com/
42
42
  *
@@ -61,8 +61,8 @@ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceC
61
61
  */
62
62
  function(e){function t(e,t,n,r){var i,o,a,s,l,c,d,h,f,m;if((t?t.ownerDocument||t:$)!==L&&R(t),t=t||L,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&N){if(11!==s&&(i=ye.exec(e)))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return J.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&k.getElementsByClassName)return J.apply(n,t.getElementsByClassName(a)),n}if(k.qsa&&(!M||!M.test(e))){if(h=d=j,f=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+p(c[l]);f=be.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return J.apply(n,f.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return S(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>x.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[j]=!0,e}function i(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)x.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[z,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[j]||(t[j]={}),(s=l[r])&&s[0]===z&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function f(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[j]&&(i=v(i)),o&&!o[j]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,p=[],h=[],f=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,p,e,s,l),b=n?o||(r?e:f||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?ee(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(f,b.length):b),o?o(null,a,b,l):J.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=x.relative[e[0].type],a=o||x.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),u=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];i>s;s++)if(n=x.relative[e[s].type])u=[h(f(u),n)];else{if(n=x.filter[e[s].type].apply(null,e[s].matches),n[j]){for(r=++s;i>r&&!x.relative[e[r].type];r++);return v(s>1&&f(u),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}u.push(n)}return f(u)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,c){var u,d,p,h=0,f="0",m=r&&[],v=[],y=A,b=r||o&&x.find.TAG("*",c),w=z+=null==y?1:Math.random()||.1,k=b.length;for(c&&(A=a!==L&&a);f!==k&&null!=(u=b[f]);f++){if(o&&u){for(d=0;p=e[d++];)if(p(u,a,s)){l.push(u);break}c&&(z=w)}i&&((u=!p&&u)&&h--,r&&m.push(u))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,v,a,s);if(r){if(h>0)for(;f--;)m[f]||v[f]||(v[f]=X.call(l));v=g(v)}J.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(l)}return c&&(z=w,A=y),m};return i?r(a):a}var w,k,x,E,_,C,T,S,A,F,D,R,L,O,N,M,I,B,P,j="sizzle"+1*new Date,$=e.document,z=0,W=0,V=n(),U=n(),H=n(),q=function(e,t){return e===t&&(D=!0),0},G=1<<31,K={}.hasOwnProperty,Y=[],X=Y.pop,Q=Y.push,J=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ce=new RegExp("^"+ne+"*,"+ne+"*"),ue=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(ae),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,we=/'|\\/g,ke=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ee=function(){R()};try{J.apply(Y=Z.call($.childNodes),$.childNodes),Y[$.childNodes.length].nodeType}catch(_e){J={apply:Y.length?function(e,t){Q.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}k=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},R=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:$;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,O=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),N=!_(r),k.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),k.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),k.getElementsByClassName=ve.test(r.getElementsByClassName),k.getById=i(function(e){return O.appendChild(e).id=j,!r.getElementsByName||!r.getElementsByName(j).length}),k.getById?(x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){return e.getAttribute("id")===t}}):(delete x.find.ID,x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),x.find.TAG=k.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):k.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},x.find.CLASS=k.getElementsByClassName&&function(e,t){return N?t.getElementsByClassName(e):void 0},I=[],M=[],(k.qsa=ve.test(r.querySelectorAll))&&(i(function(e){O.appendChild(e).innerHTML="<a id='"+j+"'></a><select id='"+j+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+j+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||M.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(k.matchesSelector=ve.test(B=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&i(function(e){k.disconnectedMatch=B.call(e,"div"),B.call(e,"[s!='']:x"),I.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),I=I.length&&new RegExp(I.join("|")),t=ve.test(O.compareDocumentPosition),P=t||ve.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!k.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===$&&P($,e)?-1:t===r||t.ownerDocument===$&&P($,t)?1:F?ee(F,e)-ee(F,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:F?ee(F,e)-ee(F,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===$?-1:c[i]===$?1:0},r):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&R(e),n=n.replace(de,"='$1']"),k.matchesSelector&&N&&(!I||!I.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||k.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&R(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&R(e);var n=x.attrHandle[t.toLowerCase()],r=n&&K.call(x.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:k.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!k.detectDuplicates,F=!k.sortStable&&e.slice(0),e.sort(q),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return F=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},x=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ke,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ke,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ke,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){for(u=g[j]||(g[j]={}),c=u[e]||[],h=c[0]===z&&c[1],p=c[0]===z&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(p=h=0)||f.pop();)if(1===d.nodeType&&++p&&d===t){u[e]=[z,h,p];break}}else if(y&&(c=(t[j]||(t[j]={}))[e])&&c[0]===z)p=c[1];else for(;(d=++h&&d&&d[m]||(p=h=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++p||(y&&((d[j]||(d[j]={}))[e]=[z,p]),d!==t)););return p-=i,p===r||p%r===0&&p/r>=0}}},PSEUDO:function(e,n){var i,o=x.pseudos[e]||x.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[j]?o(n):o.length>1?(i=[e,e,"",n],x.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=T(e.replace(le,"$1"));return i[j]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ke,xe),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ke,xe).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},x.pseudos.nth=x.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})x.pseudos[w]=l(w);return d.prototype=x.filters=x.pseudos,x.setFilters=new d,C=t.tokenize=function(e,n){var r,i,o,a,s,l,c,u=U[e+" "];if(u)return n?0:u.slice(0);for(s=e,l=[],c=x.preFilter;s;){(!r||(i=ce.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ue.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(a in x.filter)!(i=fe[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):U(e,l).slice(0)},T=t.compile=function(e,t){var n,r=[],i=[],o=H[e+" "];if(!o){for(t||(t=C(e)),n=t.length;n--;)o=y(t[n]),o[j]?r.push(o):i.push(o);o=H(e,b(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&C(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&k.getById&&9===t.nodeType&&N&&x.relative[o[1].type]){if(t=(x.find.ID(a.matches[0].replace(ke,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!x.relative[s=a.type]);)if((l=x.find[s])&&(r=l(a.matches[0].replace(ke,xe),be.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return J.apply(n,r),n;break}}return(c||T(e,d))(r,t,!N,n,be.test(e)&&u(t.parentNode)||t),n},k.sortStable=j.split("").sort(q).join("")===j,k.detectDuplicates=!!D,R(),k.sortDetached=i(function(e){return 1&e.compareDocumentPosition(L.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),k.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);re.find=le,re.expr=le.selectors,re.expr[":"]=re.expr.pseudos,re.unique=le.uniqueSort,re.text=le.getText,re.isXMLDoc=le.isXML,re.contains=le.contains;var ce=re.expr.match.needsContext,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;re.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?re.find.matchesSelector(r,e)?[r]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},re.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(re(e).filter(function(){for(t=0;n>t;t++)if(re.contains(i[t],this))return!0}));for(t=0;n>t;t++)re.find(e,i[t],r);return r=this.pushStack(n>1?re.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(s(this,e||[],!1))},not:function(e){return this.pushStack(s(this,e||[],!0))},is:function(e){return!!s(this,"string"==typeof e&&ce.test(e)?re(e):e||[],!1).length}});var pe,he=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,fe=re.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:he.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),ue.test(n[1])&&re.isPlainObject(t))for(n in t)re.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=te.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=te,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(re):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))};fe.prototype=re.fn,pe=re(te);var me=/^(?:parents|prev(?:Until|All))/,ge={children:!0,contents:!0,next:!0,prev:!0};re.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&re(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),re.fn.extend({has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(re.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?re(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&re.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?re.unique(o):o)},index:function(e){return e?"string"==typeof e?X.call(re(e),this[0]):X.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.unique(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,n){return re.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,n){return re.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return re.dir(e,"previousSibling",n)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return e.contentDocument||re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(n,r){var i=re.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=re.filter(r,i)),this.length>1&&(ge[e]||re.unique(i),me.test(e)&&i.reverse()),this.pushStack(i)}});var ve=/\S+/g,ye={};re.Callbacks=function(e){e="string"==typeof e?ye[e]||c(e):re.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(c){for(t=e.memory&&c,n=!0,a=i||0,i=0,o=s.length,r=!0;s&&o>a;a++)if(s[a].apply(c[0],c[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,s&&(l?l.length&&u(l.shift()):t?s=[]:d.disable())},d={add:function(){if(s){var n=s.length;!function a(t){re.each(t,function(t,n){var r=re.type(n);"function"===r?e.unique&&d.has(n)||s.push(n):n&&n.length&&"string"!==r&&a(n)})}(arguments),r?o=s.length:t&&(i=n,u(t))}return this},remove:function(){return s&&re.each(arguments,function(e,t){for(var n;(n=re.inArray(t,s,n))>-1;)s.splice(n,1),r&&(o>=n&&o--,a>=n&&a--)}),this},has:function(e){return e?re.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],o=0,this},disable:function(){return s=l=t=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,t||d.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!s||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],r?l.push(t):u(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(n){re.each(t,function(t,o){var a=re.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,r):r}},i={};return r.pipe=r.then,re.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=G.call(arguments),a=o.length,s=1!==a||e&&re.isFunction(e.promise)?a:0,l=1===s?e:re.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?G.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&re.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}});var be;re.fn.ready=function(e){return re.ready.promise().done(e),this},re.extend({isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){(e===!0?--re.readyWait:re.isReady)||(re.isReady=!0,e!==!0&&--re.readyWait>0||(be.resolveWith(te,[re]),re.fn.triggerHandler&&(re(te).triggerHandler("ready"),re(te).off("ready"))))}}),re.ready.promise=function(e){return be||(be=re.Deferred(),"complete"===te.readyState?setTimeout(re.ready):(te.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",u,!1))),be.promise(e)},re.ready.promise();var we=re.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===re.type(n)){i=!0;for(s in n)re.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,re.isFunction(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(re(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):o};re.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},d.uid=1,d.accepts=re.acceptData,d.prototype={key:function(e){if(!d.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=d.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,re.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(re.isEmptyObject(o))re.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,re.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),a=this.cache[o];if(void 0===t)this.cache[o]={};else{re.isArray(t)?r=t.concat(t.map(re.camelCase)):(i=re.camelCase(t),t in a?r=[t,i]:(r=i,r=r in a?[r]:r.match(ve)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(e){return!re.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ke=new d,xe=new d,Ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;re.extend({hasData:function(e){return xe.hasData(e)||ke.hasData(e)},data:function(e,t,n){return xe.access(e,t,n)},removeData:function(e,t){xe.remove(e,t)},_data:function(e,t,n){return ke.access(e,t,n)},_removeData:function(e,t){ke.remove(e,t)}}),re.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=xe.get(o),1===o.nodeType&&!ke.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=re.camelCase(r.slice(5)),p(o,r,i[r])));ke.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){xe.set(this,e)}):we(this,function(t){var n,r=re.camelCase(e);if(o&&void 0===t){if(n=xe.get(o,e),void 0!==n)return n;if(n=xe.get(o,r),void 0!==n)return n;if(n=p(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=xe.get(this,r);xe.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&xe.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){xe.remove(this,e)})}}),re.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ke.get(e,t),n&&(!r||re.isArray(n)?r=ke.access(e,t,re.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),r=n.length,i=n.shift(),o=re._queueHooks(e,t),a=function(){re.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ke.get(e,n)||ke.access(e,n,{empty:re.Callbacks("once memory").add(function(){ke.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?re.queue(this[0],e):void 0===t?this:this.each(function(){var n=re.queue(this,e,t);re._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=re.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ke.get(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Ce=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)},Ae=/^(?:checkbox|radio)$/i;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ee.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ee.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Fe="undefined";ee.focusinBubbles="onfocusin"in n;var De=/^key/,Re=/^(?:mouse|pointer|contextmenu)|click/,Le=/^(?:focusinfocus|focusoutblur)$/,Oe=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.get(e);if(g)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=re.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return typeof re!==Fe&&re.event.triggered!==t.type?re.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(ve)||[""],c=t.length;c--;)s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h&&(d=re.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=re.event.special[h]||{},u=re.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&re.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,f,a)!==!1||e.addEventListener&&e.addEventListener(h,a,!1)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),re.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.hasData(e)&&ke.get(e);if(g&&(l=g.events)){for(t=(t||"").match(ve)||[""],c=t.length;c--;)if(s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h){for(d=re.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,p=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)u=p[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||re.removeEvent(e,h,g.handle),delete l[h])}else for(h in l)re.event.remove(e,h+t[c],n,r,!0);re.isEmptyObject(l)&&(delete g.handle,ke.remove(e,"events"))}},trigger:function(e,t,r,i){var o,a,s,l,c,u,d,p=[r||te],h=Z.call(e,"type")?e.type:e,f=Z.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!Le.test(h+re.event.triggered)&&(h.indexOf(".")>=0&&(f=h.split("."),h=f.shift(),f.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[re.expando]?e:new re.Event(h,"object"==typeof e&&e),
63
63
  e.isTrigger=i?2:3,e.namespace=f.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:re.makeArray(t,[e]),d=re.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!re.isWindow(r)){for(l=d.delegateType||h,Le.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||te)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)e.type=o>1?l:d.bindType||h,u=(ke.get(a,"events")||{})[e.type]&&ke.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&re.acceptData(a)&&(e.result=u.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),t)!==!1||!re.acceptData(r)||c&&re.isFunction(r[h])&&!re.isWindow(r)&&(s=r[c],s&&(r[c]=null),re.event.triggered=h,r[h](),re.event.triggered=void 0,s&&(r[c]=s)),e.result}},dispatch:function(e){e=re.event.fix(e);var t,n,r,i,o,a=[],s=G.call(arguments),l=(ke.get(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(a=re.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((re.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)o=t[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?re(i,this).index(l)>=0:re.find(i,this,null,[l]).length),r[i]&&r.push(o);r.length&&a.push({elem:l,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||te,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[re.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Re.test(i)?this.mouseHooks:De.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new re.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=te),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&re.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=re.extend(new re.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?re.event.trigger(i,null,t):re.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},re.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},re.Event=function(e,t){return this instanceof re.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:f):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),void(this[re.expando]=!0)):new re.Event(e,t)},re.Event.prototype={isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!re.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ee.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ke.access(r,t);i||r.addEventListener(e,n,!0),ke.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ke.access(r,t)-1;i?ke.access(r,t,i):(r.removeEventListener(e,n,!0),ke.remove(r,t))}}}),re.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(a in e)this.on(a,t,n,e[a],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=f;else if(!r)return this;return 1===i&&(o=r,r=function(e){return re().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=re.guid++)),this.each(function(){re.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,re(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=f),this.each(function(){re.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?re.event.trigger(e,t,n,!0):void 0}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Me=/<([\w:]+)/,Ie=/<|&#?\w+;/,Be=/<(?:script|style|link)/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,We={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};We.optgroup=We.option,We.tbody=We.tfoot=We.colgroup=We.caption=We.thead,We.th=We.td,re.extend({clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=re.contains(e.ownerDocument,e);if(!(ee.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(a=k(s),o=k(e),r=0,i=o.length;i>r;r++)x(o[r],a[r]);if(t)if(n)for(o=o||k(e),a=a||k(s),r=0,i=o.length;i>r;r++)w(o[r],a[r]);else w(e,s);return a=k(s,"script"),a.length>0&&b(a,!l&&k(e,"script")),s},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,c,u=t.createDocumentFragment(),d=[],p=0,h=e.length;h>p;p++)if(i=e[p],i||0===i)if("object"===re.type(i))re.merge(d,i.nodeType?[i]:i);else if(Ie.test(i)){for(o=o||u.appendChild(t.createElement("div")),a=(Me.exec(i)||["",""])[1].toLowerCase(),s=We[a]||We._default,o.innerHTML=s[1]+i.replace(Ne,"<$1></$2>")+s[2],c=s[0];c--;)o=o.lastChild;re.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(t.createTextNode(i));for(u.textContent="",p=0;i=d[p++];)if((!r||-1===re.inArray(i,r))&&(l=re.contains(i.ownerDocument,i),o=k(u.appendChild(i),"script"),l&&b(o),n))for(c=0;i=o[c++];)je.test(i.type||"")&&n.push(i);return u},cleanData:function(e){for(var t,n,r,i,o=re.event.special,a=0;void 0!==(n=e[a]);a++){if(re.acceptData(n)&&(i=n[ke.expando],i&&(t=ke.cache[i]))){if(t.events)for(r in t.events)o[r]?re.event.remove(n,r):re.removeEvent(n,r,t.handle);ke.cache[i]&&delete ke.cache[i]}delete xe.cache[n[xe.expando]]}}}),re.fn.extend({text:function(e){return we(this,function(e){return void 0===e?re.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?re.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||re.cleanData(k(n)),n.parentNode&&(t&&re.contains(n.ownerDocument,n)&&b(k(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(k(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return we(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!We[(Me.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ne,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(re.cleanData(k(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,re.cleanData(k(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=K.apply([],e);var n,r,i,o,a,s,l=0,c=this.length,u=this,d=c-1,p=e[0],h=re.isFunction(p);if(h||c>1&&"string"==typeof p&&!ee.checkClone&&Pe.test(p))return this.each(function(n){var r=u.eq(n);h&&(e[0]=p.call(this,n,r.html())),r.domManip(e,t)});if(c&&(n=re.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=re.map(k(n,"script"),v),o=i.length;c>l;l++)a=n,l!==d&&(a=re.clone(a,!0,!0),o&&re.merge(i,k(a,"script"))),t.call(this[l],a,l);if(o)for(s=i[i.length-1].ownerDocument,re.map(i,y),l=0;o>l;l++)a=i[l],je.test(a.type||"")&&!ke.access(a,"globalEval")&&re.contains(s,a)&&(a.src?re._evalUrl&&re._evalUrl(a.src):re.globalEval(a.textContent.replace(ze,"")))}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var n,r=[],i=re(e),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),re(i[a])[t](n),Y.apply(r,n.get());return this.pushStack(r)}});var Ve,Ue={},He=/^margin/,qe=new RegExp("^("+Ce+")(?!px)[a-z%]+$","i"),Ge=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):n.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=n.getComputedStyle(a,null);t="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var t,r,i=te.documentElement,o=te.createElement("div"),a=te.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ee.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),n.getComputedStyle&&re.extend(ee,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,t=a.appendChild(te.createElement("div"));return t.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(n.getComputedStyle(t,null).marginRight),i.removeChild(o),a.removeChild(t),e}}))}(),re.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+Ce+")(.*)$","i"),Xe=new RegExp("^([+-])=("+Ce+")","i"),Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"},Ze=["Webkit","O","Moz","ms"];re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=C(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=re.camelCase(t),l=e.style;return t=re.cssProps[s]||(re.cssProps[s]=S(l,s)),a=re.cssHooks[t]||re.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t]:(o=typeof n,"string"===o&&(i=Xe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(re.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||re.cssNumber[s]||(n+="px"),ee.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=re.camelCase(t);return t=re.cssProps[s]||(re.cssProps[s]=S(e.style,s)),a=re.cssHooks[t]||re.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=C(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),n===!0||re.isNumeric(o)?o||0:i):i}}),re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,n,r){return n?Ke.test(re.css(e,"display"))&&0===e.offsetWidth?re.swap(e,Qe,function(){return D(e,t,r)}):D(e,t,r):void 0},set:function(e,n,r){var i=r&&Ge(e);return A(e,n,r?F(e,t,r,"border-box"===re.css(e,"boxSizing",!1,i),i):0)}}}),re.cssHooks.marginRight=T(ee.reliableMarginRight,function(e,t){return t?re.swap(e,{display:"inline-block"},C,[e,"marginRight"]):void 0}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Te[r]+t]=o[r]||o[r-2]||o[0];return i}},He.test(e)||(re.cssHooks[e+t].set=A)}),re.fn.extend({css:function(e,t){return we(this,function(e,t,n){var r,i,o={},a=0;if(re.isArray(t)){for(r=Ge(e),i=t.length;i>a;a++)o[t[a]]=re.css(e,t[a],!1,r);return o}return void 0!==n?re.style(e,t,n):re.css(e,t)},e,t,arguments.length>1)},show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?re(this).show():re(this).hide()})}}),re.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(re.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.fx=L.prototype.init,re.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=new RegExp("^(?:([+-])=|)("+Ce+")([a-z%]*)$","i"),it=/queueHooks$/,ot=[I],at={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rt.exec(t),o=i&&i[3]||(re.cssNumber[e]?"":"px"),a=(re.cssNumber[e]||"px"!==o&&+r)&&rt.exec(re.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,re.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};re.Animation=re.extend(P,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],at[n]=at[n]||[],at[n].unshift(t)},prefilter:function(e,t){t?ot.unshift(e):ot.push(e)}}),re.speed=function(e,t,n){var r=e&&"object"==typeof e?re.extend({},e):{complete:n||!n&&t||re.isFunction(e)&&e,duration:e,easing:n&&t||t&&!re.isFunction(t)&&t};return r.duration=re.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in re.fx.speeds?re.fx.speeds[r.duration]:re.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){re.isFunction(r.old)&&r.old.call(this),r.queue&&re.dequeue(this,r.queue)},r},re.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=re.isEmptyObject(e),o=re.speed(t,n,r),a=function(){var t=P(this,re.extend({},e),o);(i||ke.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=re.timers,a=ke.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&it.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&re.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ke.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=re.timers,a=r?r.length:0;for(n.finish=!0,re.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),re.each(["toggle","show","hide"],function(e,t){var n=re.fn[t];re.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,r,i)}}),re.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),re.timers=[],re.fx.tick=function(){var e,t=0,n=re.timers;for(et=re.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||re.fx.stop(),et=void 0},re.fx.timer=function(e){re.timers.push(e),e()?re.fx.start():re.timers.pop()},re.fx.interval=13,re.fx.start=function(){tt||(tt=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(tt),tt=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fn.delay=function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=te.createElement("input"),t=te.createElement("select"),n=t.appendChild(te.createElement("option"));e.type="checkbox",ee.checkOn=""!==e.value,ee.optSelected=n.selected,t.disabled=!0,ee.optDisabled=!n.disabled,e=te.createElement("input"),e.value="t",e.type="radio",ee.radioValue="t"===e.value}();var st,lt,ct=re.expr.attrHandle;re.fn.extend({attr:function(e,t){return we(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Fe?re.prop(e,t,n):(1===o&&re.isXMLDoc(e)||(t=t.toLowerCase(),r=re.attrHooks[t]||(re.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=re.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void re.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ve);if(o&&1===e.nodeType)for(;n=o[i++];)r=re.propFix[n]||n,re.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!ee.radioValue&&"radio"===t&&re.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return t===!1?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||re.find.attr;ct[t]=function(e,t,r){var i,o;return r||(o=ct[t],ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ct[t]=o),i}});var ut=/^(?:input|select|textarea|button)$/i;re.fn.extend({prop:function(e,t){return we(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})}}),re.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!re.isXMLDoc(e),o&&(t=re.propFix[t]||t,i=re.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||ut.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),ee.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this});var dt=/[\t\r\n\f]/g;re.fn.extend({addClass:function(e){var t,n,r,i,o,a,s="string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=re.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0===arguments.length||"string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?re.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=re(this),o=e.match(ve)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Fe||"boolean"===n)&&(this.className&&ke.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ke.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(dt," ").indexOf(t)>=0)return!0;return!1}});var pt=/\r/g;re.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,re(this).val()):e,null==i?i="":"number"==typeof i?i+="":re.isArray(i)&&(i=re.map(i,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=re.valHooks[i.type]||re.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(pt,""):null==n?"":n)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:re.trim(re.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],(n.selected||l===i)&&(ee.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!re.nodeName(n.parentNode,"optgroup"))){if(t=re(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=re.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=re.inArray(r.value,o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){return re.isArray(t)?e.checked=re.inArray(re(e).val(),t)>=0:void 0}},ee.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ht=re.now(),ft=/\?/;re.parseJSON=function(e){return JSON.parse(e+"")},re.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&re.error("Invalid XML: "+e),t};var mt=/#.*$/,gt=/([?&])_=[^&]*/,vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,yt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,bt=/^(?:GET|HEAD)$/,wt=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,xt={},Et={},_t="*/".concat("*"),Ct=n.location.href,Tt=kt.exec(Ct.toLowerCase())||[];re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct,type:"GET",isLocal:yt.test(Tt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,re.ajaxSettings),t):z(re.ajaxSettings,e)},ajaxPrefilter:j(xt),ajaxTransport:j(Et),ajax:function(e,t){function n(e,t,n,a){var l,u,v,y,w,x=t;2!==b&&(b=2,s&&clearTimeout(s),r=void 0,o=a||"",k.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(y=W(d,k,n)),y=V(d,y,k,l),l?(d.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(re.lastModified[i]=w),w=k.getResponseHeader("etag"),w&&(re.etag[i]=w)),204===e||"HEAD"===d.type?x="nocontent":304===e?x="notmodified":(x=y.state,u=y.data,v=y.error,l=!v)):(v=x,(e||!x)&&(x="error",0>e&&(e=0))),k.status=e,k.statusText=(t||x)+"",l?f.resolveWith(p,[u,x,k]):f.rejectWith(p,[k,x,v]),k.statusCode(g),g=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[k,d,l?u:v]),m.fireWith(p,[k,x]),c&&(h.trigger("ajaxComplete",[k,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,c,u,d=re.ajaxSetup({},t),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?re(p):re.event,f=re.Deferred(),m=re.Callbacks("once memory"),g=d.statusCode||{},v={},y={},b=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=vt.exec(o);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(f.promise(k).complete=m.add,k.success=k.done,k.error=k.fail,d.url=((e||d.url||Ct)+"").replace(mt,"").replace(wt,Tt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(ve)||[""],null==d.crossDomain&&(l=kt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Tt[1]&&l[2]===Tt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Tt[3]||("http:"===Tt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),$(xt,d,t,k),2===b)return k;c=re.event&&d.global,c&&0===re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!bt.test(d.type),i=d.url,d.hasContent||(d.data&&(i=d.url+=(ft.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=gt.test(i)?i.replace(gt,"$1_="+ht++):i+(ft.test(i)?"&":"?")+"_="+ht++)),d.ifModified&&(re.lastModified[i]&&k.setRequestHeader("If-Modified-Since",re.lastModified[i]),re.etag[i]&&k.setRequestHeader("If-None-Match",re.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&k.setRequestHeader("Content-Type",d.contentType),k.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)k.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(p,k,d)===!1||2===b))return k.abort();w="abort";for(u in{success:1,error:1,complete:1})k[u](d[u]);if(r=$(Et,d,t,k)){k.readyState=1,c&&h.trigger("ajaxSend",[k,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){k.abort("timeout")},d.timeout));try{b=1,r.send(v,n)}catch(x){if(!(2>b))throw x;n(-1,x)}}else n(-1,"No Transport");return k},getJSON:function(e,t,n){return re.get(e,t,n,"json")},getScript:function(e,t){return re.get(e,void 0,t,"script")}}),re.each(["get","post"],function(e,t){re[t]=function(e,n,r,i){return re.isFunction(n)&&(i=i||r,r=n,n=void 0),re.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),re._evalUrl=function(e){return re.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},re.fn.extend({wrapAll:function(e){var t;return re.isFunction(e)?this.each(function(t){re(this).wrapAll(e.call(this,t))}):(this[0]&&(t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e);
64
- })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e&&e.data?"data:"+e.mimetype.string+";base64,"+e.data:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();
65
- return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
64
+ })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e?e.data?"data:"+e.mimetype.string+";base64,"+e.data:e.url?e.url:null:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":
65
+ for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
66
66
  * async
67
67
  * https://github.com/caolan/async
68
68
  *
@@ -36,7 +36,7 @@ var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer
36
36
  },function(e,t){ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=" .ace-xcode .ace_gutter { background: #e8e8e8; color: #333 } .ace-xcode .ace_print-margin { width: 1px; background: #e8e8e8 } .ace-xcode { background-color: #FFFFFF; color: #000000 } .ace-xcode .ace_cursor { color: #000000 } .ace-xcode .ace_marker-layer .ace_selection { background: #B5D5FF } .ace-xcode.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; border-radius: 2px } .ace-xcode .ace_marker-layer .ace_step { background: rgb(198, 219, 174) } .ace-xcode .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF } .ace-xcode .ace_marker-layer .ace_active-line { background: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_gutter-active-line { background-color: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_marker-layer .ace_selected-word { border: 1px solid #B5D5FF } .ace-xcode .ace_constant.ace_language, .ace-xcode .ace_keyword, .ace-xcode .ace_meta, .ace-xcode .ace_variable.ace_language { color: #C800A4 } .ace-xcode .ace_invisible { color: #BFBFBF } .ace-xcode .ace_constant.ace_character, .ace-xcode .ace_constant.ace_other { color: #275A5E } .ace-xcode .ace_constant.ace_numeric { color: #3A00DC } .ace-xcode .ace_entity.ace_other.ace_attribute-name, .ace-xcode .ace_support.ace_constant, .ace-xcode .ace_support.ace_function { color: #450084 } .ace-xcode .ace_fold { background-color: #C800A4; border-color: #000000 } .ace-xcode .ace_entity.ace_name.ace_tag, .ace-xcode .ace_support.ace_class, .ace-xcode .ace_support.ace_type { color: #790EAD } .ace-xcode .ace_storage { color: #C900A4 } .ace-xcode .ace_string { color: #DF0002 } .ace-xcode .ace_comment { color: #008E00 } .ace-xcode .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y }";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(240),d=r(u),p={manuscript_update:"Manuscript Updated.",file_save:"Saved.",image_create:"Image Created.",file_delete:"File Deleted"},h=function(e){function t(e){var n=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={flash:null},this.unsub=d["default"].flash.listen(function(e,t){clearInterval(n.timer),n.setState({flash:{type:e,message:t}}),n.timer=setTimeout(function(){n.setState({flash:null})},5e3)})}return o(t,e),a(t,[{key:"render",value:function(){var e=this;return c["default"].createElement("nav",{className:"toolbar"},c["default"].createElement("h3",{className:"book-title"},this.props.bookTitle),c["default"].createElement("ul",{className:"actions"},c["default"].createElement("li",null,c["default"].createElement("a",{className:"progressMessage "+(this.props.inProgress?"active":"")},this.props.inProgress?c["default"].createElement("i",{className:"fa fa-refresh fa-spin"}):null," ",p[this.props.progressType]||"Working...")),this.state.flash?c["default"].createElement("li",{onClick:function(){return e.setState({flash:null})},key:this.state.flash.type},c["default"].createElement("a",{className:""+this.state.flash.type},this.state.flash.message)):null,this.props.enablePreview?[c["default"].createElement("li",{key:"toggleLive"},c["default"].createElement("a",{className:this.props.inLiveMode?"active":"",onClick:this.props.toggleLiveMode},c["default"].createElement("i",{className:"fa fa-columns"})," Live Mode")),c["default"].createElement("li",{key:"preview"},c["default"].createElement("a",{className:this.props.inLiveMode?"disabled":"",onClick:this.props.onGeneratePreview},c["default"].createElement("i",{className:"fa fa-play"})," Preview"))]:null))}}]),t}(c["default"].Component);h.propTypes={enablePreview:c["default"].PropTypes.bool.isRequired,inProgress:c["default"].PropTypes.bool.isRequired,progressType:c["default"].PropTypes.string,inLiveMode:c["default"].PropTypes.bool.isRequired,toggleLiveMode:c["default"].PropTypes.func.isRequired,onGeneratePreview:c["default"].PropTypes.func.isRequired,bookTitle:c["default"].PropTypes.string.isRequired},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(241),o=r(i),a=o["default"].createActions({flash:{}});t["default"]=a,e.exports=t["default"]},function(e,t,n){var r=n(242);r.connect=n(256),r.connectFilter=n(258),r.ListenerMixin=n(257),r.listenTo=n(259),r.listenToMany=n(260),e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={version:{"reflux-core":"0.2.1"}};r.ActionMethods=n(243),r.ListenerMethods=n(244),r.PublisherMethods=n(254),r.StoreMethods=n(253),r.createAction=n(255),r.createStore=n(249);var i=n(248).staticJoinCreator;r.joinTrailing=r.all=i("last"),r.joinLeading=i("first"),r.joinStrict=i("strict"),r.joinConcat=i("all");var o=r.utils=n(245);r.EventEmitter=o.EventEmitter,r.Promise=o.Promise,r.createActions=function(){var e=function(e,t){Object.keys(e).forEach(function(n){var i=e[n];t[n]=r.createAction(i)})};return function(t){var n={};return t instanceof Array?t.forEach(function(t){o.isObject(t)?e(t,n):n[t]=r.createAction(t)}):e(t,n),n}}(),r.setEventEmitter=function(e){r.EventEmitter=o.EventEmitter=e},r.setPromise=function(e){r.Promise=o.Promise=e},r.setPromiseFactory=function(e){o.createPromise=e},r.nextTick=function(e){o.nextTick=e},r.use=function(e){e(r)},r.__keep=n(250),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5"),t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245),i=n(248).instanceJoinCreator,o=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},a=function s(e){var t={};for(var n in e){var i=e[n],a=o(i),l=s(a);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t<r.length;t++)if(n=r[t],n===e||n.hasListener&&n.hasListener(e))return!0;return!1},listenToMany:function(e){var t=a(e);for(var n in t){var i=r.callbackName(n),o=this[i]?i:this[n]?n:void 0;o&&this.listenTo(t[n],o,this[i+"Default"]||this[o+"Default"]||o)}},validateListening:function(e){return e===this?"Listener is not able to listen to itself":r.isFunction(e.listen)?e.hasListener&&e.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:e+" is missing a listen method"},listenTo:function(e,t,n){var i,o,a,s=this.subscriptions=this.subscriptions||[];return r.throwIf(this.validateListening(e)),this.fetchInitialState(e,n),i=e.listen(this[t]||t,this),o=function(){var e=s.indexOf(a);r.throwIf(-1===e,"Tried to remove listen already gone from subscriptions list!"),s.splice(e,1),i()},a={stop:o,listenable:e},s.push(a),a},stopListeningTo:function(e){for(var t,n=0,i=this.subscriptions||[];n<i.length;n++)if(t=i[n],t.listenable===e)return t.stop(),r.throwIf(-1!==i.indexOf(t),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var e,t=this.subscriptions||[];e=t.length;)t[0].stop(),r.throwIf(t.length!==e-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(e,t){t=t&&this[t]||t;var n=this;if(r.isFunction(t)&&r.isFunction(e.getInitialState)){var i=e.getInitialState();i&&r.isFunction(i.then)?i.then(function(){t.apply(n,arguments)}):t.call(this,i)}},joinTrailing:i("last"),joinLeading:i("first"),joinConcat:i("all"),joinStrict:i("strict")}},function(module,exports,__webpack_require__){(function(setImmediate){"use strict";function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function callbackName(e,t){return t=t||"on",t+exports.capitalize(e)}function checkEnv(target){var flag=void 0;try{eval(target)&&(flag=!0)}catch(e){flag=!1}environment[callbackName(target,"has")]=flag}function isObject(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function extend(e){if(!isObject(e))return e;for(var t,n,r=1,i=arguments.length;i>r;r++){t=arguments[r];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}else e[n]=t[n]}return e}function isFunction(e){return"function"==typeof e}function object(e,t){for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function isArguments(e){return"object"==typeof e&&"callee"in e&&"number"==typeof e.length}function throwIf(e,t){if(e)throw Error(t||e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=capitalize,exports.callbackName=callbackName,exports.isObject=isObject,exports.extend=extend,exports.isFunction=isFunction,exports.object=object,exports.isArguments=isArguments,exports.throwIf=throwIf;var environment={};exports.environment=environment,checkEnv("setImmediate"),checkEnv("Promise"),exports.EventEmitter=__webpack_require__(247),environment.hasSetImmediate?exports.nextTick=function(e){setImmediate(e)}:exports.nextTick=function(e){setTimeout(e,0)},environment.hasPromise?(exports.Promise=Promise,exports.createPromise=function(e){return new exports.Promise(e)}):(exports.Promise=null,exports.createPromise=function(){})}).call(exports,__webpack_require__(246).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(75).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:s.call(arguments,1);return l[n]=!0,o(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(246).setImmediate,n(246).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);d>c;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;h>c;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;default:if(!l)for(p=1,l=new Array(d-1);d>p;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var l=0,c=a.length;c>l;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&s.push(a[l]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return function(){var r,i=n.subscriptions,o=i?i.indexOf(e):-1;for(l.throwIf(-1===o,"Tried to remove join already gone from subscriptions list!"),r=0;r<t.length;r++)t[r]();i.splice(o,1)}}function i(e){e.listenablesEmitted=new Array(e.numberOfListenables),e.args=new Array(e.numberOfListenables)}function o(e,t){return function(){var n=c.call(arguments);if(t.listenablesEmitted[e])switch(t.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":t.args[e]=n;break;case"all":t.args[e].push(n)}else t.listenablesEmitted[e]=!0,t.args[e]="all"===t.strategy?[n]:n;a(t)}}function a(e){for(var t=0;t<e.numberOfListenables;t++)if(!e.listenablesEmitted[t])return;e.callback.apply(e.listener,e.args),i(e)}var s=n(249),l=n(245),c=Array.prototype.slice,u={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};t.staticJoinCreator=function(e){return function(){var t=c.call(arguments);return s({init:function(){this[u[e]].apply(this,t.concat("triggerAsync"))}})}},t.instanceJoinCreator=function(e){return function(){l.throwIf(arguments.length<2,"Cannot create a join with less than 2 listenables!");var t,n,a=c.call(arguments),s=a.pop(),u=a.length,d={numberOfListenables:u,callback:this[s]||s,listener:this,strategy:e},p=[];for(t=0;u>t;t++)l.throwIf(this.validateListening(a[t]));for(t=0;u>t;t++)p.push(a[t].listen(o(t,d),this));return i(d),n={listenable:a},n.stop=r(n,p,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){"use strict";var r=n(245),i=n(250),o=n(251),a=n(252),s={preEmit:1,shouldEmit:1};e.exports=function(e){function t(){var t,n=0;if(this.subscriptions=[],this.emitter=new r.EventEmitter,this.eventLabel="change",a(this,e),this.init&&r.isFunction(this.init)&&this.init(),this.listenables)for(t=[].concat(this.listenables);n<t.length;n++)this.listenToMany(t[n])}var l=n(253),c=n(254),u=n(244);e=e||{};for(var d in l)if(!s[d]&&(c[d]||u[d]))throw new Error("Cannot override API method "+d+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var p in e)if(!s[p]&&(c[p]||u[p]))throw new Error("Cannot override API method "+p+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");e=o(e),r.extend(t.prototype,u,c,l,e);var h=new t;return i.createdStores.push(h),h}},function(e,t){"use strict";t.createdStores=[],t.createdActions=[],t.reset=function(){for(;t.createdStores.length;)t.createdStores.pop();for(;t.createdActions.length;)t.createdActions.pop()}},function(e,t,n){"use strict";var r=n(245);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t){"use strict";e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245);e.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(e,t){t=t||this;var n=function(n){i||e.apply(t,n)},r=this,i=!1;return this.emitter.addListener(this.eventLabel,n),function(){i=!0,r.emitter.removeListener(r.eventLabel,n)}},promise:function(e){var t=this,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,o){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,o),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var a=e.completed.listen(function(e){a(),s(),i(e)}),s=e.failed.listen(function(e){a(),s(),o(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){"use strict";var r=n(245),i=n(243),o=n(254),a=n(250),s={preEmit:1,shouldEmit:1},l=function c(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i)if(!s[t]&&o[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&o[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,u={};l<e.children.length;l++){var d=e.children[l];u[d]=c(d)}var p=r.extend({eventLabel:"action",emitter:new r.EventEmitter,_isAction:!0},o,i,e),h=function f(){var e=f.sync?"trigger":r.environment.hasPromise?"triggerPromise":"triggerAsync";return f[e].apply(f,arguments)};return r.extend(h,u,p),a.createdActions.push(h),h};e.exports=l},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t){return{getInitialState:function(){return o.isFunction(e.getInitialState)?void 0===t?e.getInitialState():o.object([t],[e.getInitialState()]):{}},componentDidMount:function(){o.extend(this,r);var n=this,i=void 0===t?this.setState:function(e){("undefined"==typeof n.isMounted||n.isMounted()===!0)&&n.setState(o.object([t],[e]))};this.listenTo(e,i)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(245),i=n(244);e.exports=r.extend({componentWillUnmount:i.stopListeningToAll},i)},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t,n){return n=o.isFunction(t)?t:n,{getInitialState:function(){if(o.isFunction(e.getInitialState)){if(o.isFunction(t))return n.call(this,e.getInitialState());var r=n.call(this,e.getInitialState());return"undefined"!=typeof r?o.object([t],[r]):{}}return{}},componentDidMount:function(){o.extend(this,r);var i=this,a=function(e){if(o.isFunction(t))i.setState(n.call(i,e));else{var r=n.call(i,e);i.setState(o.object([t],[r]))}};this.listenTo(e,a)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(244);e.exports=function(e,t,n){return{componentDidMount:function(){for(var i in r)if(this[i]!==r[i]){if(this[i])throw"Can't have other property '"+i+"' when using Reflux.listenTo!";this[i]=r[i]}this.listenTo(e,t,n)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){var r=n(244);e.exports=function(e){return{componentDidMount:function(){for(var t in r)if(this[t]!==r[t]){if(this[t])throw"Can't have other property '"+t+"' when using Reflux.listenToMany!";this[t]=r[t]}this.listenToMany(e)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(2),d=r(u),p=n(262),h=r(p),f=n(238),m=r(f),g=n(341),v=r(g),y=n(263),b=n(240),w=r(b),k=n(3),x=r(k);d["default"].string=x["default"];var E=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={files:[],closed:!1,fileMode:"manuscript",busy:!1},this.toggleClose=this.toggleClose.bind(this),this.newFile=this.newFile.bind(this),this.createFile=this.createFile.bind(this),this.createImageFile=this.createImageFile.bind(this),this.listManuscript=this.listManuscript.bind(this),this.onDeleteFile=this.onDeleteFile.bind(this),this.onChangeMode=this.onChangeMode.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.listCode=this.listCode.bind(this),this.listManuscript=this.listManuscript.bind(this),this.listImage=this.listImage.bind(this),this.moveFile=this.moveFile.bind(this),this.saveManuscript=this.saveManuscript.bind(this),m["default"].onDelete(this.onFileDeleted)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.listManuscript()}},{key:"componentDidUpdate",value:function(e,t){t.fileMode&&t.fileMode!==this.state.fileMode&&this["list"+d["default"].string.capitalize(this.state.fileMode)]()}},{key:"onFileDeleted",value:function(){this.props.onChangeFile(null)}},{key:"listManuscript",value:function(){var e=this;this.busy(!0),m["default"].listFiles(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listImage",value:function(){var e=this;this.busy(!0),m["default"].listImages(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listCode",value:function(){var e=this;this.busy(!0),m["default"].listCode(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"busy",value:function(e){this.setState({busy:e})}},{key:"free",value:function(){this.setState({busy:!1})}},{key:"toggleClose",value:function(e){this.setState({closed:!this.state.closed})}},{key:"onChangeMode",value:function(e){this.setState({fileMode:e})}},{key:"createImageFile",value:function(e){var t=this,n=this.refs.imageFile.getDOMNode();return m["default"].newImage(n,function(){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)]()}),e.stopPropagation(),e.preventDefault(),!1}},{key:"createFile",value:function(e){var t=this,n=this.refs.filename.getDOMNode();-1!==this.props.blacklistedFiles.indexOf(n.value.toLowerCase())?w["default"].flash("error","You may not create a file with the name "+n.value+" as it is a reserved file."):m["default"]["new"](n.value,this.state.fileMode,"",function(e,r){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)](),t.props.onChangeFile(r)}),e.stopPropagation(),e.preventDefault()}},{key:"newFile",value:function(e){this.setState({creatingFile:!this.state.creatingFile})}},{key:"onDeleteFile",value:function(e){m["default"]["delete"](e.filename,this.state.fileMode,this["list"+d["default"].string.capitalize(this.state.fileMode)])}},{key:"saveManuscript",value:function(){"manuscript"===this.state.fileMode&&m["default"].saveManuscript(this.state.files)}},{key:"moveFile",value:function(e,t){var n=d["default"].clone(this.state.files),r=n.indexOf(e),i=n.indexOf(t);n.splice(r,1),n.splice(i,0,e),this.setState({files:n})}},{key:"renderFileCreator",value:function(){if(this.state.creatingFile){if("image"===this.state.fileMode){var e=c["default"].createElement("form",{onSubmit:this.createImageFile,className:"file-name"},c["default"].createElement("input",{type:"file",ref:"imageFile"}),c["default"].createElement("button",null,"Submit")),t=c["default"].createElement("p",null,"Sorry, image uploads are not supported");return m["default"].supportsImageUploads()?e:t}return c["default"].createElement("form",{onSubmit:this.createFile,className:"file-name"},c["default"].createElement("input",{type:"text",ref:"filename",placeholder:"Type a filename..."}),c["default"].createElement("button",null,"Create"))}}},{key:"renderFilesList",value:function(){var e=this;return this.state.busy?c["default"].createElement("i",{className:"busy-indicator fa fa-spin fa-2x fa-circle-o-notch"}):c["default"].createElement("ul",{className:"files-list"},d["default"].map(this.state.files,function(t,n){return c["default"].createElement(h["default"],{saveManuscript:e.saveManuscript,moveFile:e.moveFile,key:n,fileMode:e.state.fileMode,onDeleteFile:e.onDeleteFile,onChangeFile:e.props.onChangeFile,onPreviewImage:e.props.onPreviewImage,isCurrent:e.props.currentFile===t,file:t})}))}},{key:"render",value:function(){var e="file-browser "+(this.state.closed?"closed":"open"),t="new-file"+(this.state.creatingFile?" active":"");return c["default"].createElement("section",{className:e},c["default"].createElement("ul",{className:"file-types-list"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"manuscript")},c["default"].createElement("h4",{className:"title"+("manuscript"===this.state.fileMode?" selected":"")},"files"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"image")},c["default"].createElement("h4",{className:"title"+("image"===this.state.fileMode?" selected":"")},"images"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"code")},c["default"].createElement("h4",{className:"title"+("code"===this.state.fileMode?" selected":"")},"code")))),c["default"].createElement("div",{className:t,onClick:this.newFile},c["default"].createElement("i",{className:"fa fa-plus"}," ")),this.renderFileCreator(),this.renderFilesList(),c["default"].createElement("button",{className:"close-button",onClick:this.toggleClose},c["default"].createElement("span",null)))}}]),t}(c["default"].Component);E.propTypes={projectRoot:c["default"].PropTypes.string.isRequired,onChangeFile:c["default"].PropTypes.func.isRequired,currentFile:c["default"].PropTypes.string,blacklistedFiles:c["default"].PropTypes.array.isRequired},t["default"]=y.DragDropContext(v["default"])(E),
37
37
  e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(73),s=r(a),l=n(263),c={beginDrag:function(e){return e.file}},u={hover:function(e,t){var n=t.getItem();n!==e.file&&e.moveFile(n,e.file)},drop:function(e,t){e.saveManuscript()}},d=function(){function e(e){i(this,t),this.onDelete=this.onDelete.bind(this),this.onChange=this.onChange.bind(this)}o(e,[{key:"onDelete",value:function(e){confirm("Are you sure you want to delete this file?")&&this.props.onDeleteFile(this.props.file),e.stopPropagation(),e.preventDefault()}},{key:"onChange",value:function(e){"image"===this.props.file.type?this.props.onPreviewImage(this.props.file):this.props.onChangeFile(this.props.file)}},{key:"getFileIconClass",value:function(){switch(this.props.fileMode){case"manuscript":return"fa-file-o";case"images":return"fa-file-image";case"code":return"fa-code"}}},{key:"render",value:function(){var e="files-list-item"+(this.props.isCurrent?" current":"")+(this.props.file.parent?" child":"")+(this.props.isDragging?" dragging":"");return this.props.connectDragSource(this.props.connectDropTarget(s["default"].createElement("li",{className:e,onClick:this.onChange},s["default"].createElement("a",null,s["default"].createElement("i",{className:"fa "+this.getFileIconClass()})," ",this.props.file.filename),s["default"].createElement("button",{onClick:this.onDelete},s["default"].createElement("i",{className:"fa fa-times"})))))}}]);var t=e;return e=l.DragSource("file",c,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}})(e)||e,e=l.DropTarget("file",u,function(e){return{connectDropTarget:e.dropTarget()}})(e)||e}();t["default"]=d,d.propTypes={file:s["default"].PropTypes.object.isRequired,fileMode:s["default"].PropTypes.string.isRequired,moveFile:s["default"].PropTypes.func.isRequired,saveManuscript:s["default"].PropTypes.func.isRequired,isCurrent:s["default"].PropTypes.bool.isRequired,onDeleteFile:s["default"].PropTypes.func.isRequired,onChangeFile:s["default"].PropTypes.func.isRequired,onPreviewImage:s["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(264);t.DragDropContext=r(i);var o=n(310);t.DragLayer=r(o);var a=n(321);t.DragSource=r(a);var s=n(336);t.DropTarget=r(s),"production"!==e.env.NODE_ENV&&Object.defineProperty(t,"default",{get:function(){console.error("React DnD does not provide a default export. You are probably missing the curly braces in the import statement. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export")}})}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){g["default"].apply(void 0,["DragDropContext","backend"].concat(l.call(arguments))),"object"==typeof e&&"function"==typeof e["default"]&&(e=e["default"]),f["default"]("function"==typeof e,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var t={dragDropManager:new p.DragDropManager(e)};return function(e){var n=e.displayName||e.name||"Component";return function(r){function a(){i(this,a),r.apply(this,arguments)}return o(a,r),a.prototype.getDecoratedComponentInstance=function(){return this.refs.child},a.prototype.getManager=function(){return t.dragDropManager},a.prototype.getChildContext=function(){return t},a.prototype.render=function(){return d["default"].createElement(e,s({},this.props,{ref:"child"}))},c(a,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+n+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),a}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=n(265),h=n(280),f=r(h),m=n(309),g=r(m);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(266);t.DragDropManager=r(i);var o=n(305);t.DragSource=r(o);var a=n(306);t.DropTarget=r(a);var s=n(307);t.createTestBackend=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(267),s=i(a),l=n(269),c=i(l),u=n(271),d=r(u),p=n(301),h=i(p),f=n(302),m=(i(f),function(){function e(t){o(this,e);var n=s["default"](c["default"]);this.store=n,this.monitor=new h["default"](n),this.registry=this.monitor.registry,this.backend=t(this),n.subscribe(this.handleRefCountChange.bind(this))}return e.prototype.handleRefCountChange=function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var r=e.apply(t,arguments);"undefined"!=typeof r&&n(r)}}var t=this,n=this.store.dispatch;return Object.keys(d).filter(function(e){return"function"==typeof d[e]}).reduce(function(t,n){return t[n]=e(d[n]),t},{})},e}());t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(){return c}function r(e){return u.push(e),function(){var t=u.indexOf(e);u.splice(t,1)}}function i(e){if(!a["default"](e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=l(c,e)}finally{d=!1}return u.slice().forEach(function(e){return e()}),e}function o(e){l=e,i({type:s.INIT})}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,c=t,u=[],d=!1;return i({type:s.INIT}),{dispatch:i,subscribe:r,getState:n,replaceReducer:o}}t.__esModule=!0,t["default"]=i;var o=n(268),a=r(o),s={INIT:"@@redux/INIT"};t.ActionTypes=s},function(e,t){"use strict";function n(e){if(!e||"object"!=typeof e)return!1;var t="function"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}t.__esModule=!0,t["default"]=n;var r=function(e){return Function.prototype.toString.call(e)};e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(270),o=r(i),a=n(281),s=r(a),l=n(295),c=r(l),u=n(296),d=r(u);t["default"]=function(e,t){return void 0===e&&(e={}),{dirtyHandlerIds:d["default"](e.dirtyHandlerIds,t,e.dragOperation),dragOffset:o["default"](e.dragOffset,t),refCount:c["default"](e.refCount,t),dragOperation:s["default"](e.dragOperation,t)}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return e===t?!0:e&&t&&e.x===t.x&&e.y===t.y}function i(e,t){switch(void 0===e&&(e=c),t.type){case l.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case l.HOVER:return r(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case l.END_DRAG:case l.DROP:return c;default:return e}}function o(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function a(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i,t.getSourceClientOffset=o,t.getDifferenceFromInitialOffset=a;var l=n(271),c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.publishSource,r=void 0===n?!0:n,i=t.clientOffset,o=void 0===i?null:i,a=t.getSourceClientOffset;p["default"](f["default"](e),"Expected sourceIds to be an array.");var s=this.getMonitor(),l=this.getRegistry();p["default"](!s.isDragging(),"Cannot call beginDrag while dragging.");for(var c=0;c<e.length;c++)p["default"](l.getSource(e[c]),"Expected sourceIds to be registered.");for(var u=null,c=e.length-1;c>=0;c--)if(s.canDragSource(e[c])){u=e[c];break}if(null!==u){var d=null;o&&(p["default"]("function"==typeof a,"When clientOffset is provided, getSourceClientOffset must be a function."),d=a(u));var h=l.getSource(u),m=h.beginDrag(s,u);p["default"](g["default"](m),"Item must be an object."),l.pinSource(u);var y=l.getSourceType(u);return{type:v,itemType:y,item:m,sourceId:u,clientOffset:o,sourceClientOffset:d,isSourcePublic:r}}}function o(e){var t=this.getMonitor();if(t.isDragging())return{type:y}}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.clientOffset,r=void 0===n?null:n;p["default"](f["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var i=this.getMonitor(),o=this.getRegistry();p["default"](i.isDragging(),"Cannot call hover while not dragging."),p["default"](!i.didDrop(),"Cannot call hover after drop.");for(var a=i.getItemType(),s=0;s<e.length;s++){var l=e[s];p["default"](e.lastIndexOf(l)===s,"Expected targetIds to be unique in the passed array.");var c=o.getTarget(l);p["default"](c,"Expected targetIds to be registered.");var d=o.getTargetType(l);u["default"](d,a)&&c.hover(i,l)}return{type:b,targetIds:e,clientOffset:r}}function s(){var e=this,t=this.getMonitor(),n=this.getRegistry();p["default"](t.isDragging(),"Cannot call drop while not dragging."),p["default"](!t.didDrop(),"Cannot call drop twice during one drag operation.");var r=t.getTargetIds().filter(t.canDropOnTarget,t);r.reverse(),r.forEach(function(r,i){var o=n.getTarget(r),a=o.drop(t,r);p["default"]("undefined"==typeof a||g["default"](a),"Drop result must either be an object or undefined."),"undefined"==typeof a&&(a=0===i?{}:t.getDropResult()),e.store.dispatch({type:w,dropResult:a})})}function l(){var e=this.getMonitor(),t=this.getRegistry();p["default"](e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId(),r=t.getSource(n,!0);return r.endDrag(e,n),t.unpinSource(),{type:k}}t.__esModule=!0,t.beginDrag=i,t.publishDragSource=o,t.hover=a,t.drop=s,t.endDrag=l;var c=n(272),u=r(c),d=n(280),p=r(d),h=n(273),f=r(h),m=n(277),g=r(m),v="dnd-core/BEGIN_DRAG";t.BEGIN_DRAG=v;var y="dnd-core/PUBLISH_DRAG_SOURCE";t.PUBLISH_DRAG_SOURCE=y;var b="dnd-core/HOVER";t.HOVER=b;var w="dnd-core/DROP";t.DROP=w;var k="dnd-core/END_DRAG";t.END_DRAG=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return a["default"](e)?e.some(function(e){return e===t}):e===t}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){var r=n(274),i=n(279),o=n(278),a="[object Array]",s=Object.prototype,l=s.toString,c=r(Array,"isArray"),u=c||function(e){return o(e)&&i(e.length)&&l.call(e)==a};e.exports=u},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=n(275);e.exports=r},function(e,t,n){function r(e){return null==e?!1:i(e)?u.test(l.call(e)):o(e)&&a.test(e)}var i=n(276),o=n(278),a=/^\[object .+?Constructor\]$/,s=Object.prototype,l=Function.prototype.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return i(e)&&s.call(e)==o}var i=n(277),o="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){(function(t){"use strict";var n=function(e,n,r,i,o,a,s,l){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,i,o,a,s,l],d=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return u[d++]}))}throw c.framesToPop=1,c}};e.exports=n}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){switch(void 0===e&&(e=u),t.type){case a.BEGIN_DRAG:return o({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case a.HOVER:return o({},e,{targetIds:t.targetIds});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case s.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:o({},e,{targetIds:c["default"](e.targetIds,t.targetId)});case a.DROP:return o({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case a.END_DRAG:return o({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i;var a=n(271),s=n(282),l=n(283),c=r(l),u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.exports=t["default"]},function(e,t){"use strict";function n(e){return{type:a,sourceId:e}}function r(e){return{type:s,targetId:e}}function i(e){return{type:l,sourceId:e}}function o(e){return{type:c,targetId:e}}t.__esModule=!0,t.addSource=n,t.addTarget=r,t.removeSource=i,t.removeTarget=o;var a="dnd-core/ADD_SOURCE";t.ADD_SOURCE=a;var s="dnd-core/ADD_TARGET";t.ADD_TARGET=s;var l="dnd-core/REMOVE_SOURCE";t.REMOVE_SOURCE=l;var c="dnd-core/REMOVE_TARGET";t.REMOVE_TARGET=c},function(e,t,n){var r=n(284),i=n(291),o=n(294),a=o(function(e,t){return i(e)?r(e,t):[]});e.exports=a},function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var l=-1,c=i,u=!0,d=u&&t.length>=s?a(t):null,p=t.length;d&&(c=o,u=!1,t=d);e:for(;++l<n;){var h=e[l];if(u&&h===h){for(var f=p;f--;)if(t[f]===h)continue e;r.push(h)}else c(t,h,0)<0&&r.push(h)}return r}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=n(286);e.exports=r},function(e,t){function n(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}e.exports=n},function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=n(277);e.exports=r},function(e,t,n){(function(t){function r(e){return s&&a?new i(e):null}var i=n(289),o=n(274),a=o(t,"Set"),s=o(Object,"create");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=n(290),o=n(274),a=o(t,"Set"),s=o(Object,"create");r.prototype.push=i,e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=n(277);e.exports=r},function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=n(292),o=n(279);e.exports=r},function(e,t,n){var r=n(293),i=r("length");e.exports=i},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t){function n(e,t){if("function"!=typeof e)throw new TypeError(r);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var r="Expected a function",i=Math.max;e.exports=n},function(e,t,n){"use strict";function r(e,t){switch(void 0===e&&(e=0),t.type){case i.ADD_SOURCE:case i.ADD_TARGET:return e+1;case i.REMOVE_SOURCE:case i.REMOVE_TARGET:return e-1;default:return e}}t.__esModule=!0,t["default"]=r;var i=n(282);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){switch(void 0===e&&(e=p),t.type){case u.HOVER:break;case d.ADD_SOURCE:case d.ADD_TARGET:case d.REMOVE_TARGET:case d.REMOVE_SOURCE:return p;case u.BEGIN_DRAG:case u.PUBLISH_DRAG_SOURCE:case u.END_DRAG:case u.DROP:default:return h}var r=t.targetIds,i=n.targetIds,o=s["default"](r,i),a=!1;if(0===o.length){for(var l=0;l<r.length;l++)if(r[l]!==i[l]){a=!0;break}}else a=!0;if(!a)return p;var c=i[i.length-1],f=r[r.length-1];return c!==f&&(c&&o.push(c),f&&o.push(f)),o}function o(e,t){return e===p?!1:e===h||"undefined"==typeof t?!0:c["default"](t,e).length>0}t.__esModule=!0,t["default"]=i,t.areDirty=o;var a=n(297),s=r(a),l=n(300),c=r(l),u=n(271),d=n(282),p=[],h=[]},function(e,t,n){function r(){for(var e=-1,t=arguments.length;++e<t;){var n=arguments[e];if(s(n))var r=r?i(o(r,n),o(n,r)):n}return r?a(r):[]}var i=n(298),o=n(284),a=n(299),s=n(291);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){function r(e,t){var n=-1,r=i,l=e.length,c=!0,u=c&&l>=s,d=u?a():null,p=[];d?(r=o,c=!1):(u=!1,d=t?[]:p);e:for(;++n<l;){var h=e[n],f=t?t(h,n,e):h;if(c&&h===h){for(var m=d.length;m--;)if(d[m]===f)continue e;t&&d.push(f),p.push(h)}else r(d,f,0)<0&&((t||u)&&d.push(f),p.push(h))}return p}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){var r=n(285),i=n(287),o=n(288),a=n(291),s=n(294),l=s(function(e){for(var t=e.length,n=t,s=Array(f),l=r,c=!0,u=[];n--;){var d=e[n]=a(d=e[n])?d:[];s[n]=c&&d.length>=120?o(n&&d):null}var p=e[0],h=-1,f=p?p.length:0,m=s[0];e:for(;++h<f;)if(d=p[h],(m?i(m,d):l(u,d,0))<0){for(var n=t;--n;){var g=s[n];if((g?i(g,d):l(e[n],d,0))<0)continue e}m&&m.push(d),u.push(d)}return u});e.exports=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(280),a=r(o),s=n(272),l=r(s),c=n(273),u=r(c),d=n(302),p=r(d),h=n(270),f=n(296),m=function(){function e(t){i(this,e),this.store=t,this.registry=new p["default"](t)}return e.prototype.subscribeToStateChange=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=n.handlerIds;a["default"]("function"==typeof e,"listener must be a function."),a["default"]("undefined"==typeof r||u["default"](r),"handlerIds, when specified, must be an array of strings.");var i=function(){f.areDirty(t.store.getState().dirtyHandlerIds,r)&&e()};return this.store.subscribe(i)},e.prototype.subscribeToOffsetChange=function(e){var t=this;a["default"]("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)},e.prototype.canDragSource=function(e){var t=this.registry.getSource(e);return a["default"](t,"Expected to find a valid source."),this.isDragging()?!1:t.canDrag(this,e)},e.prototype.canDropOnTarget=function(e){var t=this.registry.getTarget(e);if(a["default"](t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return l["default"](n,r)&&t.canDrop(this,e)},e.prototype.isDragging=function(){return Boolean(this.getItemType())},e.prototype.isDraggingSource=function(e){var t=this.registry.getSource(e,!0);if(a["default"](t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n!==r?!1:t.isDragging(this,e)},e.prototype.isOverTarget=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.shallow,r=void 0===n?!1:n;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),o=this.getItemType();if(!l["default"](i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var s=a.indexOf(e);return r?s===a.length-1:s>-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return h.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return h.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&e.constructor===Symbol?"symbol":typeof e}function a(e){p["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),p["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),p["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function s(e){p["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),p["default"]("function"==typeof e.hover,"Expected hover to be a function."),p["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function l(e,t){return t&&g["default"](e)?void e.forEach(function(e){return l(e,!1)}):void p["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":o(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function c(e){var t=y["default"]().toString();switch(e){case w.SOURCE:return"S"+t;case w.TARGET:return"T"+t;default:p["default"](!1,"Unknown role: "+e)}}function u(e){switch(e[0]){case"S":return w.SOURCE;case"T":return w.TARGET;default:p["default"](!1,"Cannot parse handler ID: "+e)}}t.__esModule=!0;var d=n(280),p=r(d),h=n(303),f=r(h),m=n(273),g=r(m),v=n(304),y=r(v),b=n(282),w=f["default"]({SOURCE:null,TARGET:null}),k=function(){function e(t){i(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){l(e),a(t);var n=this.addHandler(w.SOURCE,e,t);return this.store.dispatch(b.addSource(n)),n},e.prototype.addTarget=function(e,t){l(e,!0),s(t);var n=this.addHandler(w.TARGET,e,t);return this.store.dispatch(b.addTarget(n)),n},e.prototype.addHandler=function(e,t,n){var r=c(e);return this.types[r]=t,this.handlers[r]=n,r},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})},e.prototype.getSource=function(e,t){p["default"](this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r},e.prototype.getTarget=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return p["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=u(e);return t===w.SOURCE},e.prototype.isTargetId=function(e){var t=u(e);return t===w.TARGET},e.prototype.removeSource=function(e){p["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(b.removeSource(e)),delete this.handlers[e],delete this.types[e]},e.prototype.removeTarget=function(e){p["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(b.removeTarget(e)),delete this.handlers[e],delete this.types[e]},e.prototype.pinSource=function(e){var t=this.getSource(e);p["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){p["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();t["default"]=k,e.exports=t["default"]},function(e,t){"use strict";var n=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=n},function(e,t){"use strict";function n(){return r++}t.__esModule=!0,t["default"]=n;var r=0;e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new l(e)}t.__esModule=!0,t["default"]=o;var a=n(308),s=r(a),l=function(){function e(t){i(this,e),this.actions=t.getActions()}return e.prototype.setup=function(){this.didCallSetup=!0},e.prototype.teardown=function(){this.didCallTeardown=!0},e.prototype.connectDragSource=function(){return s["default"]},e.prototype.connectDragPreview=function(){return s["default"]},e.prototype.connectDropTarget=function(){return s["default"]},e.prototype.simulateBeginDrag=function(e,t){this.actions.beginDrag(e,t)},e.prototype.simulatePublishDragSource=function(){this.actions.publishDragSource()},e.prototype.simulateHover=function(e,t){this.actions.hover(e,t)},e.prototype.simulateDrop=function(){this.actions.drop()},e.prototype.simulateEndDrag=function(){this.actions.endDrag()},e}();e.exports=t["default"]},function(e,t){function n(){}e.exports=n},function(e,t,n){(function(n){"use strict";function r(e,t){if("production"!==n.env.NODE_ENV){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;r>o;o++)i[o-2]=arguments[o];for(var a=0;a<i.length;a++){var s=i[a];if(s&&s.prototype&&s.prototype.render)return void console.error("You seem to be applying the arguments in the wrong order. "+("It should be "+e+"("+t+")(Component), not the other way around. ")+"Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order")}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return k["default"].apply(void 0,["DragLayer","collect[, options]"].concat(l.call(arguments))),b["default"]("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html",e),b["default"](v["default"](t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html',t),function(n){var r=t.arePropsEqual,a=void 0===r?m["default"]:r,l=n.displayName||n.name||"Component";return function(t){function r(e,n){i(this,r),t.call(this,e),this.handleChange=this.handleChange.bind(this),this.manager=n.dragDropManager,b["default"]("object"==typeof this.manager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",l,l),this.state=this.getCurrentState()}return o(r,t),r.prototype.getDecoratedComponentInstance=function(){return this.refs.child},r.prototype.shouldComponentUpdate=function(e,t){return!a(e,this.props)||!h["default"](t,this.state)},c(r,null,[{key:"DecoratedComponent",value:n,enumerable:!0},{key:"displayName",value:"DragLayer("+l+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),r.prototype.componentDidMount=function(){var e=this.manager.getMonitor();this.unsubscribe=e.subscribeToOffsetChange(this.handleChange)},r.prototype.componentWillUnmount=function(){this.unsubscribe()},r.prototype.handleChange=function(){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)},r.prototype.getCurrentState=function(){
38
38
  var t=this.manager.getMonitor();return e(t)},r.prototype.render=function(){return d["default"].createElement(n,s({},this.props,this.state,{ref:"child"}))},r}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=(n(265),n(311)),h=r(p),f=n(312),m=r(f),g=n(313),v=r(g),y=n(280),b=r(y),w=n(309),k=r(w);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;var a=e[n[o]],s=t[n[o]];if(a!==s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o]))return!1;var a=e[n[o]],s=t[n[o]];if(a!==s||"object"==typeof a||"object"==typeof s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){var t;if(!a(e)||u.call(e)!=s||o(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=n(314),o=n(319),a=n(278),s="[object Object]",l=Object.prototype,c=l.hasOwnProperty,u=l.toString;e.exports=r},function(e,t,n){function r(e,t){return i(e,t,o)}var i=n(315),o=n(318);e.exports=r},function(e,t,n){var r=n(316),i=r();e.exports=i},function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,l=e?s:-1;e?l--:++l<s;){var c=a[l];if(n(o[c],c,o)===!1)break}return t}}var i=n(317);e.exports=r},function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=n(277);e.exports=r},function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||i(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,d=Array(t),p=t>0;++r<t;)d[r]=r+"";for(var h in e)p&&a(h,t)||"constructor"==h&&(c||!u.call(e,h))||d.push(h);return d}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(277),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)&&i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}var i=n(291),o=n(278),a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;e.exports=r},function(e,t){function n(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var r=/^\d+$/,i=9007199254740991;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DragSource","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(331),y=r(v),b=n(332),w=r(b),k=n(333),x=r(k),E=n(334),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.DecoratedComponent,n=e.createHandler,i=e.createMonitor,s=e.createConnector,h=e.registerHandler,m=e.containerDisplayName,v=e.getType,b=e.collect,k=e.options,E=k.arePropsEqual,_=void 0===E?g["default"]:E,C=t.displayName||t.name||"Component";return function(e){function g(t,r){o(this,g),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),w["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=i(this.manager),this.handler=n(this.handlerMonitor),this.disposable=new p.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState()}return a(g,e),g.prototype.getHandlerId=function(){return this.handlerId},g.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},g.prototype.shouldComponentUpdate=function(e,t){return!_(e,this.props)||!f["default"](t,this.state)},c(g,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:m+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),g.prototype.componentWillReceiveProps=function(e){_(e,this.props)||(this.receiveProps(e),this.handleChange())},g.prototype.componentWillUnmount=function(){this.disposable.dispose()},g.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},g.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=h(e,this.handler,this.manager),n=t.handlerId,r=t.unregister,i=s(this.manager.getBackend()),o=x["default"](i,n),a=o.handlerConnector,l=o.disposable;this.handlerId=n,this.handlerConnector=a,this.handlerMonitor.receiveHandlerId(n);var c=this.manager.getMonitor(),u=c.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new p.CompositeDisposable(new p.Disposable(u),new p.Disposable(r),l))}},g.prototype.handleChange=function(){var e=this.getCurrentState();f["default"](e,this.state)||this.setState(e)},g.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},g.prototype.getCurrentState=function(){var e=b(this.handlerConnector,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&w["default"](y["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",m,C,e),e},g.prototype.render=function(){return d["default"].createElement(t,l({},this.props,this.state,{ref:this.handleChildRef}))},g}(u.Component)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=s;var u=n(73),d=i(u),p=n(323),h=n(311),f=i(h),m=n(312),g=i(m),v=n(313),y=i(v),b=n(280),w=i(b),k=n(328),x=i(k);e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};t.__esModule=!0;var i=n(324),o=r(i);t.isDisposable=o["default"];var a=n(325),s=r(a);t.Disposable=s["default"];var l=n(326),c=r(l);t.CompositeDisposable=c["default"];var u=n(327),d=r(u);t.SerialDisposable=d["default"]},function(e,t){"use strict";function n(e){return Boolean(e&&"function"==typeof e.dispose)}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.__esModule=!0;var i=function(){},o=function(){function e(t){n(this,e),this.isDisposed=!1,this.action=t||i}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},r(e,null,[{key:"empty",enumerable:!0,value:{dispose:i}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];i(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var o=0;o<n.length;o++)if(!a["default"](n[o]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return-1===t?!1:(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;e>n;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(var n=0;e>n;n++)t[n].dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){i(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=new s.CompositeDisposable,r={};return Object.keys(e).forEach(function(i){var o=a["default"](t,e[i]),s=o.disposable,l=o.ref;n.add(s),r[i]=function(){return l}}),{disposable:n,handlerConnector:r}}t.__esModule=!0,t["default"]=i;var o=n(329),a=r(o),s=n(323);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(s,d){if(u.isValidElement(s)){var p=s;return l["default"](p,function(e){return n(e,d)})}var h=u.findDOMNode(s);if(h!==i||!a["default"](o,d)){if(i=h,o=d,!h)return void r.setDisposable(null);var f=t(e,h,d);r.setDisposable(new c.Disposable(f))}}var r=new c.SerialDisposable,i=null,o=null;return{ref:n,disposable:r}}t.__esModule=!0,t["default"]=i;var o=n(311),a=r(o),s=n(330),l=r(s),c=n(323),u=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=e.ref;return a["default"]("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),s.cloneElement(e,{ref:function(e){t(e),n&&n(e)}})}t.__esModule=!0,t["default"]=i;var o=n(280),a=r(o),s=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeSource(o)}var i=n.getRegistry(),o=i.addSource(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),p.forEach(function(t){l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return e.canDrag?e.canDrag(this.props,this.monitor):!0},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"](u["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrag","beginDrag","canDrag","isDragging","endDrag"],p=["beginDrag"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new u(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=!1,u=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){s["default"](!l,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{l=!1}},e.prototype.isDragging=function(){s["default"](!c,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return c=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{c=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dragSource:e.connectDragSource.bind(e),dragPreview:e.connectDragPreview.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return"string"==typeof e||"symbol"==typeof e||t&&a["default"](e)&&e.every(function(e){return i(e,!1)})}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(337),y=r(v),b=n(338),w=r(b),k=n(339),x=r(k),E=n(340),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeTarget(o)}var i=n.getRegistry(),o=i.addTarget(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return e.canDrop?e.canDrop(this.props,this.monitor):!0},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"]("undefined"==typeof t||u["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrop","hover","drop"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new c(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){s["default"](!l,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return l=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{l=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dropTarget:e.connectDropTarget.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return _||(_=new Image,_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),_}function l(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function c(e){var t=T[e],n=t.exposeProperty,r=t.matchesTypes,s=t.getData;return function(e){function t(){i(this,t),e.call(this),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return o(t,e),t.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=s(e,r)},t.prototype.beginDrag=function(){return this.item},t}(h.DragSource)}function u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(T).filter(function(e){var n=T[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}function d(e){return new S(e)}t.__esModule=!0;var p;t.getEmptyImage=s,t["default"]=d;var h=n(265),f=n(342),m=r(f),g=n(345),v=n(352),y=n(311),b=r(y),w=n(354),k=r(w),x=n(280),E=r(x),_=void 0,C={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__",TEXT:"__NATIVE_TEXT__"};t.NativeTypes=C;var T=(p={},a(p,C.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(p,C.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return l(e,t,"").split("\n")}}),a(p,C.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return l(e,t,"")}}),p),S=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new m["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this)}return e.prototype.setup=function(){"undefined"!=typeof window&&(E["default"](!this.constructor.isSetUp,"Cannot have two HTML5 backends at the same time."),this.constructor.isSetUp=!0,window.addEventListener("dragstart",this.handleTopDragStart),window.addEventListener("dragstart",this.handleTopDragStartCapture,!0),window.addEventListener("dragend",this.handleTopDragEndCapture,!0),window.addEventListener("dragenter",this.handleTopDragEnter),window.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.addEventListener("dragover",this.handleTopDragOver),window.addEventListener("dragover",this.handleTopDragOverCapture,!0),window.addEventListener("drop",this.handleTopDrop),window.addEventListener("drop",this.handleTopDropCapture,!0))},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,window.removeEventListener("dragstart",this.handleTopDragStart),window.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),window.removeEventListener("dragend",this.handleTopDragEndCapture,!0),window.removeEventListener("dragenter",this.handleTopDragEnter),window.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.removeEventListener("dragover",this.handleTopDragOver),window.removeEventListener("dragover",this.handleTopDragOverCapture,!0),window.removeEventListener("drop",this.handleTopDrop),window.removeEventListener("drop",this.handleTopDropCapture,!0),this.clearCurrentDragSourceNode())},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var i=function(t){return r.handleDragStart(t,e)},o=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return k["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return k["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return v.getElementClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(C).some(function(t){return C[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=c(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])},e.prototype.endDragNativeItem=function(){this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||(this.actions.endDrag(),this.clearCurrentDragSourceNode())},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=v.getElementClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return this.currentDragSourceNode?(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0):!1},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return e?this.currentDragSourceNodeOffsetChanged?!0:(this.currentDragSourceNodeOffsetChanged=!b["default"](v.getElementClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged):!1},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=v.getEventClientOffset(e);
39
- this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t);if(h&&h.data){var f="data:"+h.mimetype.string+";base64,"+h.data;e=e.replace(a,'src="'+f)}else o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
39
+ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t),f=void 0;h?(h.data?f="data:"+h.mimetype.string+";base64,"+h.data:h.url&&(f=h.url),e=e.replace(a,'src="'+f)):o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
40
40
  * jQuery JavaScript Library v2.1.4
41
41
  * http://jquery.com/
42
42
  *
@@ -61,8 +61,8 @@ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceC
61
61
  */
62
62
  function(e){function t(e,t,n,r){var i,o,a,s,l,c,d,h,f,m;if((t?t.ownerDocument||t:$)!==L&&R(t),t=t||L,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&N){if(11!==s&&(i=ye.exec(e)))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return J.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&k.getElementsByClassName)return J.apply(n,t.getElementsByClassName(a)),n}if(k.qsa&&(!M||!M.test(e))){if(h=d=j,f=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+p(c[l]);f=be.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return J.apply(n,f.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return S(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>x.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[j]=!0,e}function i(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)x.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[z,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[j]||(t[j]={}),(s=l[r])&&s[0]===z&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function f(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[j]&&(i=v(i)),o&&!o[j]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,p=[],h=[],f=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,p,e,s,l),b=n?o||(r?e:f||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?ee(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(f,b.length):b),o?o(null,a,b,l):J.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=x.relative[e[0].type],a=o||x.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),u=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];i>s;s++)if(n=x.relative[e[s].type])u=[h(f(u),n)];else{if(n=x.filter[e[s].type].apply(null,e[s].matches),n[j]){for(r=++s;i>r&&!x.relative[e[r].type];r++);return v(s>1&&f(u),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}u.push(n)}return f(u)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,c){var u,d,p,h=0,f="0",m=r&&[],v=[],y=A,b=r||o&&x.find.TAG("*",c),w=z+=null==y?1:Math.random()||.1,k=b.length;for(c&&(A=a!==L&&a);f!==k&&null!=(u=b[f]);f++){if(o&&u){for(d=0;p=e[d++];)if(p(u,a,s)){l.push(u);break}c&&(z=w)}i&&((u=!p&&u)&&h--,r&&m.push(u))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,v,a,s);if(r){if(h>0)for(;f--;)m[f]||v[f]||(v[f]=X.call(l));v=g(v)}J.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(l)}return c&&(z=w,A=y),m};return i?r(a):a}var w,k,x,E,_,C,T,S,A,F,D,R,L,O,N,M,I,B,P,j="sizzle"+1*new Date,$=e.document,z=0,W=0,V=n(),U=n(),H=n(),q=function(e,t){return e===t&&(D=!0),0},G=1<<31,K={}.hasOwnProperty,Y=[],X=Y.pop,Q=Y.push,J=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ce=new RegExp("^"+ne+"*,"+ne+"*"),ue=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(ae),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,we=/'|\\/g,ke=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ee=function(){R()};try{J.apply(Y=Z.call($.childNodes),$.childNodes),Y[$.childNodes.length].nodeType}catch(_e){J={apply:Y.length?function(e,t){Q.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}k=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},R=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:$;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,O=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),N=!_(r),k.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),k.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),k.getElementsByClassName=ve.test(r.getElementsByClassName),k.getById=i(function(e){return O.appendChild(e).id=j,!r.getElementsByName||!r.getElementsByName(j).length}),k.getById?(x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){return e.getAttribute("id")===t}}):(delete x.find.ID,x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),x.find.TAG=k.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):k.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},x.find.CLASS=k.getElementsByClassName&&function(e,t){return N?t.getElementsByClassName(e):void 0},I=[],M=[],(k.qsa=ve.test(r.querySelectorAll))&&(i(function(e){O.appendChild(e).innerHTML="<a id='"+j+"'></a><select id='"+j+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+j+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||M.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(k.matchesSelector=ve.test(B=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&i(function(e){k.disconnectedMatch=B.call(e,"div"),B.call(e,"[s!='']:x"),I.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),I=I.length&&new RegExp(I.join("|")),t=ve.test(O.compareDocumentPosition),P=t||ve.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!k.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===$&&P($,e)?-1:t===r||t.ownerDocument===$&&P($,t)?1:F?ee(F,e)-ee(F,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:F?ee(F,e)-ee(F,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===$?-1:c[i]===$?1:0},r):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&R(e),n=n.replace(de,"='$1']"),k.matchesSelector&&N&&(!I||!I.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||k.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&R(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&R(e);var n=x.attrHandle[t.toLowerCase()],r=n&&K.call(x.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:k.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!k.detectDuplicates,F=!k.sortStable&&e.slice(0),e.sort(q),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return F=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},x=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ke,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ke,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ke,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){for(u=g[j]||(g[j]={}),c=u[e]||[],h=c[0]===z&&c[1],p=c[0]===z&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(p=h=0)||f.pop();)if(1===d.nodeType&&++p&&d===t){u[e]=[z,h,p];break}}else if(y&&(c=(t[j]||(t[j]={}))[e])&&c[0]===z)p=c[1];else for(;(d=++h&&d&&d[m]||(p=h=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++p||(y&&((d[j]||(d[j]={}))[e]=[z,p]),d!==t)););return p-=i,p===r||p%r===0&&p/r>=0}}},PSEUDO:function(e,n){var i,o=x.pseudos[e]||x.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[j]?o(n):o.length>1?(i=[e,e,"",n],x.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=T(e.replace(le,"$1"));return i[j]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ke,xe),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ke,xe).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},x.pseudos.nth=x.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})x.pseudos[w]=l(w);return d.prototype=x.filters=x.pseudos,x.setFilters=new d,C=t.tokenize=function(e,n){var r,i,o,a,s,l,c,u=U[e+" "];if(u)return n?0:u.slice(0);for(s=e,l=[],c=x.preFilter;s;){(!r||(i=ce.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ue.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(a in x.filter)!(i=fe[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):U(e,l).slice(0)},T=t.compile=function(e,t){var n,r=[],i=[],o=H[e+" "];if(!o){for(t||(t=C(e)),n=t.length;n--;)o=y(t[n]),o[j]?r.push(o):i.push(o);o=H(e,b(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&C(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&k.getById&&9===t.nodeType&&N&&x.relative[o[1].type]){if(t=(x.find.ID(a.matches[0].replace(ke,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!x.relative[s=a.type]);)if((l=x.find[s])&&(r=l(a.matches[0].replace(ke,xe),be.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return J.apply(n,r),n;break}}return(c||T(e,d))(r,t,!N,n,be.test(e)&&u(t.parentNode)||t),n},k.sortStable=j.split("").sort(q).join("")===j,k.detectDuplicates=!!D,R(),k.sortDetached=i(function(e){return 1&e.compareDocumentPosition(L.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),k.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);re.find=le,re.expr=le.selectors,re.expr[":"]=re.expr.pseudos,re.unique=le.uniqueSort,re.text=le.getText,re.isXMLDoc=le.isXML,re.contains=le.contains;var ce=re.expr.match.needsContext,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;re.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?re.find.matchesSelector(r,e)?[r]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},re.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(re(e).filter(function(){for(t=0;n>t;t++)if(re.contains(i[t],this))return!0}));for(t=0;n>t;t++)re.find(e,i[t],r);return r=this.pushStack(n>1?re.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(s(this,e||[],!1))},not:function(e){return this.pushStack(s(this,e||[],!0))},is:function(e){return!!s(this,"string"==typeof e&&ce.test(e)?re(e):e||[],!1).length}});var pe,he=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,fe=re.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:he.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),ue.test(n[1])&&re.isPlainObject(t))for(n in t)re.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=te.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=te,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(re):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))};fe.prototype=re.fn,pe=re(te);var me=/^(?:parents|prev(?:Until|All))/,ge={children:!0,contents:!0,next:!0,prev:!0};re.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&re(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),re.fn.extend({has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(re.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?re(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&re.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?re.unique(o):o)},index:function(e){return e?"string"==typeof e?X.call(re(e),this[0]):X.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.unique(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,n){return re.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,n){return re.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return re.dir(e,"previousSibling",n)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return e.contentDocument||re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(n,r){var i=re.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=re.filter(r,i)),this.length>1&&(ge[e]||re.unique(i),me.test(e)&&i.reverse()),this.pushStack(i)}});var ve=/\S+/g,ye={};re.Callbacks=function(e){e="string"==typeof e?ye[e]||c(e):re.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(c){for(t=e.memory&&c,n=!0,a=i||0,i=0,o=s.length,r=!0;s&&o>a;a++)if(s[a].apply(c[0],c[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,s&&(l?l.length&&u(l.shift()):t?s=[]:d.disable())},d={add:function(){if(s){var n=s.length;!function a(t){re.each(t,function(t,n){var r=re.type(n);"function"===r?e.unique&&d.has(n)||s.push(n):n&&n.length&&"string"!==r&&a(n)})}(arguments),r?o=s.length:t&&(i=n,u(t))}return this},remove:function(){return s&&re.each(arguments,function(e,t){for(var n;(n=re.inArray(t,s,n))>-1;)s.splice(n,1),r&&(o>=n&&o--,a>=n&&a--)}),this},has:function(e){return e?re.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],o=0,this},disable:function(){return s=l=t=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,t||d.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!s||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],r?l.push(t):u(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(n){re.each(t,function(t,o){var a=re.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,r):r}},i={};return r.pipe=r.then,re.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=G.call(arguments),a=o.length,s=1!==a||e&&re.isFunction(e.promise)?a:0,l=1===s?e:re.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?G.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&re.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}});var be;re.fn.ready=function(e){return re.ready.promise().done(e),this},re.extend({isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){(e===!0?--re.readyWait:re.isReady)||(re.isReady=!0,e!==!0&&--re.readyWait>0||(be.resolveWith(te,[re]),re.fn.triggerHandler&&(re(te).triggerHandler("ready"),re(te).off("ready"))))}}),re.ready.promise=function(e){return be||(be=re.Deferred(),"complete"===te.readyState?setTimeout(re.ready):(te.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",u,!1))),be.promise(e)},re.ready.promise();var we=re.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===re.type(n)){i=!0;for(s in n)re.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,re.isFunction(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(re(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):o};re.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},d.uid=1,d.accepts=re.acceptData,d.prototype={key:function(e){if(!d.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=d.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,re.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(re.isEmptyObject(o))re.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,re.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),a=this.cache[o];if(void 0===t)this.cache[o]={};else{re.isArray(t)?r=t.concat(t.map(re.camelCase)):(i=re.camelCase(t),t in a?r=[t,i]:(r=i,r=r in a?[r]:r.match(ve)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(e){return!re.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ke=new d,xe=new d,Ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;re.extend({hasData:function(e){return xe.hasData(e)||ke.hasData(e)},data:function(e,t,n){return xe.access(e,t,n)},removeData:function(e,t){xe.remove(e,t)},_data:function(e,t,n){return ke.access(e,t,n)},_removeData:function(e,t){ke.remove(e,t)}}),re.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=xe.get(o),1===o.nodeType&&!ke.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=re.camelCase(r.slice(5)),p(o,r,i[r])));ke.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){xe.set(this,e)}):we(this,function(t){var n,r=re.camelCase(e);if(o&&void 0===t){if(n=xe.get(o,e),void 0!==n)return n;if(n=xe.get(o,r),void 0!==n)return n;if(n=p(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=xe.get(this,r);xe.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&xe.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){xe.remove(this,e)})}}),re.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ke.get(e,t),n&&(!r||re.isArray(n)?r=ke.access(e,t,re.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),r=n.length,i=n.shift(),o=re._queueHooks(e,t),a=function(){re.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ke.get(e,n)||ke.access(e,n,{empty:re.Callbacks("once memory").add(function(){ke.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?re.queue(this[0],e):void 0===t?this:this.each(function(){var n=re.queue(this,e,t);re._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=re.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ke.get(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Ce=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)},Ae=/^(?:checkbox|radio)$/i;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ee.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ee.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Fe="undefined";ee.focusinBubbles="onfocusin"in n;var De=/^key/,Re=/^(?:mouse|pointer|contextmenu)|click/,Le=/^(?:focusinfocus|focusoutblur)$/,Oe=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.get(e);if(g)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=re.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return typeof re!==Fe&&re.event.triggered!==t.type?re.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(ve)||[""],c=t.length;c--;)s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h&&(d=re.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=re.event.special[h]||{},u=re.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&re.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,f,a)!==!1||e.addEventListener&&e.addEventListener(h,a,!1)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),re.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.hasData(e)&&ke.get(e);if(g&&(l=g.events)){for(t=(t||"").match(ve)||[""],c=t.length;c--;)if(s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h){for(d=re.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,p=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)u=p[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||re.removeEvent(e,h,g.handle),delete l[h])}else for(h in l)re.event.remove(e,h+t[c],n,r,!0);re.isEmptyObject(l)&&(delete g.handle,ke.remove(e,"events"))}},trigger:function(e,t,r,i){var o,a,s,l,c,u,d,p=[r||te],h=Z.call(e,"type")?e.type:e,f=Z.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!Le.test(h+re.event.triggered)&&(h.indexOf(".")>=0&&(f=h.split("."),h=f.shift(),f.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[re.expando]?e:new re.Event(h,"object"==typeof e&&e),
63
63
  e.isTrigger=i?2:3,e.namespace=f.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:re.makeArray(t,[e]),d=re.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!re.isWindow(r)){for(l=d.delegateType||h,Le.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||te)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)e.type=o>1?l:d.bindType||h,u=(ke.get(a,"events")||{})[e.type]&&ke.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&re.acceptData(a)&&(e.result=u.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),t)!==!1||!re.acceptData(r)||c&&re.isFunction(r[h])&&!re.isWindow(r)&&(s=r[c],s&&(r[c]=null),re.event.triggered=h,r[h](),re.event.triggered=void 0,s&&(r[c]=s)),e.result}},dispatch:function(e){e=re.event.fix(e);var t,n,r,i,o,a=[],s=G.call(arguments),l=(ke.get(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(a=re.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((re.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)o=t[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?re(i,this).index(l)>=0:re.find(i,this,null,[l]).length),r[i]&&r.push(o);r.length&&a.push({elem:l,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||te,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[re.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Re.test(i)?this.mouseHooks:De.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new re.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=te),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&re.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=re.extend(new re.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?re.event.trigger(i,null,t):re.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},re.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},re.Event=function(e,t){return this instanceof re.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:f):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),void(this[re.expando]=!0)):new re.Event(e,t)},re.Event.prototype={isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!re.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ee.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ke.access(r,t);i||r.addEventListener(e,n,!0),ke.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ke.access(r,t)-1;i?ke.access(r,t,i):(r.removeEventListener(e,n,!0),ke.remove(r,t))}}}),re.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(a in e)this.on(a,t,n,e[a],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=f;else if(!r)return this;return 1===i&&(o=r,r=function(e){return re().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=re.guid++)),this.each(function(){re.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,re(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=f),this.each(function(){re.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?re.event.trigger(e,t,n,!0):void 0}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Me=/<([\w:]+)/,Ie=/<|&#?\w+;/,Be=/<(?:script|style|link)/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,We={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};We.optgroup=We.option,We.tbody=We.tfoot=We.colgroup=We.caption=We.thead,We.th=We.td,re.extend({clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=re.contains(e.ownerDocument,e);if(!(ee.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(a=k(s),o=k(e),r=0,i=o.length;i>r;r++)x(o[r],a[r]);if(t)if(n)for(o=o||k(e),a=a||k(s),r=0,i=o.length;i>r;r++)w(o[r],a[r]);else w(e,s);return a=k(s,"script"),a.length>0&&b(a,!l&&k(e,"script")),s},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,c,u=t.createDocumentFragment(),d=[],p=0,h=e.length;h>p;p++)if(i=e[p],i||0===i)if("object"===re.type(i))re.merge(d,i.nodeType?[i]:i);else if(Ie.test(i)){for(o=o||u.appendChild(t.createElement("div")),a=(Me.exec(i)||["",""])[1].toLowerCase(),s=We[a]||We._default,o.innerHTML=s[1]+i.replace(Ne,"<$1></$2>")+s[2],c=s[0];c--;)o=o.lastChild;re.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(t.createTextNode(i));for(u.textContent="",p=0;i=d[p++];)if((!r||-1===re.inArray(i,r))&&(l=re.contains(i.ownerDocument,i),o=k(u.appendChild(i),"script"),l&&b(o),n))for(c=0;i=o[c++];)je.test(i.type||"")&&n.push(i);return u},cleanData:function(e){for(var t,n,r,i,o=re.event.special,a=0;void 0!==(n=e[a]);a++){if(re.acceptData(n)&&(i=n[ke.expando],i&&(t=ke.cache[i]))){if(t.events)for(r in t.events)o[r]?re.event.remove(n,r):re.removeEvent(n,r,t.handle);ke.cache[i]&&delete ke.cache[i]}delete xe.cache[n[xe.expando]]}}}),re.fn.extend({text:function(e){return we(this,function(e){return void 0===e?re.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?re.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||re.cleanData(k(n)),n.parentNode&&(t&&re.contains(n.ownerDocument,n)&&b(k(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(k(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return we(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!We[(Me.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ne,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(re.cleanData(k(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,re.cleanData(k(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=K.apply([],e);var n,r,i,o,a,s,l=0,c=this.length,u=this,d=c-1,p=e[0],h=re.isFunction(p);if(h||c>1&&"string"==typeof p&&!ee.checkClone&&Pe.test(p))return this.each(function(n){var r=u.eq(n);h&&(e[0]=p.call(this,n,r.html())),r.domManip(e,t)});if(c&&(n=re.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=re.map(k(n,"script"),v),o=i.length;c>l;l++)a=n,l!==d&&(a=re.clone(a,!0,!0),o&&re.merge(i,k(a,"script"))),t.call(this[l],a,l);if(o)for(s=i[i.length-1].ownerDocument,re.map(i,y),l=0;o>l;l++)a=i[l],je.test(a.type||"")&&!ke.access(a,"globalEval")&&re.contains(s,a)&&(a.src?re._evalUrl&&re._evalUrl(a.src):re.globalEval(a.textContent.replace(ze,"")))}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var n,r=[],i=re(e),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),re(i[a])[t](n),Y.apply(r,n.get());return this.pushStack(r)}});var Ve,Ue={},He=/^margin/,qe=new RegExp("^("+Ce+")(?!px)[a-z%]+$","i"),Ge=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):n.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=n.getComputedStyle(a,null);t="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var t,r,i=te.documentElement,o=te.createElement("div"),a=te.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ee.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),n.getComputedStyle&&re.extend(ee,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,t=a.appendChild(te.createElement("div"));return t.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(n.getComputedStyle(t,null).marginRight),i.removeChild(o),a.removeChild(t),e}}))}(),re.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+Ce+")(.*)$","i"),Xe=new RegExp("^([+-])=("+Ce+")","i"),Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"},Ze=["Webkit","O","Moz","ms"];re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=C(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=re.camelCase(t),l=e.style;return t=re.cssProps[s]||(re.cssProps[s]=S(l,s)),a=re.cssHooks[t]||re.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t]:(o=typeof n,"string"===o&&(i=Xe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(re.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||re.cssNumber[s]||(n+="px"),ee.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=re.camelCase(t);return t=re.cssProps[s]||(re.cssProps[s]=S(e.style,s)),a=re.cssHooks[t]||re.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=C(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),n===!0||re.isNumeric(o)?o||0:i):i}}),re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,n,r){return n?Ke.test(re.css(e,"display"))&&0===e.offsetWidth?re.swap(e,Qe,function(){return D(e,t,r)}):D(e,t,r):void 0},set:function(e,n,r){var i=r&&Ge(e);return A(e,n,r?F(e,t,r,"border-box"===re.css(e,"boxSizing",!1,i),i):0)}}}),re.cssHooks.marginRight=T(ee.reliableMarginRight,function(e,t){return t?re.swap(e,{display:"inline-block"},C,[e,"marginRight"]):void 0}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Te[r]+t]=o[r]||o[r-2]||o[0];return i}},He.test(e)||(re.cssHooks[e+t].set=A)}),re.fn.extend({css:function(e,t){return we(this,function(e,t,n){var r,i,o={},a=0;if(re.isArray(t)){for(r=Ge(e),i=t.length;i>a;a++)o[t[a]]=re.css(e,t[a],!1,r);return o}return void 0!==n?re.style(e,t,n):re.css(e,t)},e,t,arguments.length>1)},show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?re(this).show():re(this).hide()})}}),re.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(re.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.fx=L.prototype.init,re.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=new RegExp("^(?:([+-])=|)("+Ce+")([a-z%]*)$","i"),it=/queueHooks$/,ot=[I],at={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rt.exec(t),o=i&&i[3]||(re.cssNumber[e]?"":"px"),a=(re.cssNumber[e]||"px"!==o&&+r)&&rt.exec(re.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,re.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};re.Animation=re.extend(P,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],at[n]=at[n]||[],at[n].unshift(t)},prefilter:function(e,t){t?ot.unshift(e):ot.push(e)}}),re.speed=function(e,t,n){var r=e&&"object"==typeof e?re.extend({},e):{complete:n||!n&&t||re.isFunction(e)&&e,duration:e,easing:n&&t||t&&!re.isFunction(t)&&t};return r.duration=re.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in re.fx.speeds?re.fx.speeds[r.duration]:re.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){re.isFunction(r.old)&&r.old.call(this),r.queue&&re.dequeue(this,r.queue)},r},re.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=re.isEmptyObject(e),o=re.speed(t,n,r),a=function(){var t=P(this,re.extend({},e),o);(i||ke.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=re.timers,a=ke.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&it.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&re.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ke.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=re.timers,a=r?r.length:0;for(n.finish=!0,re.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),re.each(["toggle","show","hide"],function(e,t){var n=re.fn[t];re.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,r,i)}}),re.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),re.timers=[],re.fx.tick=function(){var e,t=0,n=re.timers;for(et=re.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||re.fx.stop(),et=void 0},re.fx.timer=function(e){re.timers.push(e),e()?re.fx.start():re.timers.pop()},re.fx.interval=13,re.fx.start=function(){tt||(tt=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(tt),tt=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fn.delay=function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=te.createElement("input"),t=te.createElement("select"),n=t.appendChild(te.createElement("option"));e.type="checkbox",ee.checkOn=""!==e.value,ee.optSelected=n.selected,t.disabled=!0,ee.optDisabled=!n.disabled,e=te.createElement("input"),e.value="t",e.type="radio",ee.radioValue="t"===e.value}();var st,lt,ct=re.expr.attrHandle;re.fn.extend({attr:function(e,t){return we(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Fe?re.prop(e,t,n):(1===o&&re.isXMLDoc(e)||(t=t.toLowerCase(),r=re.attrHooks[t]||(re.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=re.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void re.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ve);if(o&&1===e.nodeType)for(;n=o[i++];)r=re.propFix[n]||n,re.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!ee.radioValue&&"radio"===t&&re.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return t===!1?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||re.find.attr;ct[t]=function(e,t,r){var i,o;return r||(o=ct[t],ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ct[t]=o),i}});var ut=/^(?:input|select|textarea|button)$/i;re.fn.extend({prop:function(e,t){return we(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})}}),re.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!re.isXMLDoc(e),o&&(t=re.propFix[t]||t,i=re.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||ut.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),ee.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this});var dt=/[\t\r\n\f]/g;re.fn.extend({addClass:function(e){var t,n,r,i,o,a,s="string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=re.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0===arguments.length||"string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?re.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=re(this),o=e.match(ve)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Fe||"boolean"===n)&&(this.className&&ke.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ke.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(dt," ").indexOf(t)>=0)return!0;return!1}});var pt=/\r/g;re.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,re(this).val()):e,null==i?i="":"number"==typeof i?i+="":re.isArray(i)&&(i=re.map(i,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=re.valHooks[i.type]||re.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(pt,""):null==n?"":n)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:re.trim(re.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],(n.selected||l===i)&&(ee.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!re.nodeName(n.parentNode,"optgroup"))){if(t=re(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=re.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=re.inArray(r.value,o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){return re.isArray(t)?e.checked=re.inArray(re(e).val(),t)>=0:void 0}},ee.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ht=re.now(),ft=/\?/;re.parseJSON=function(e){return JSON.parse(e+"")},re.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&re.error("Invalid XML: "+e),t};var mt=/#.*$/,gt=/([?&])_=[^&]*/,vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,yt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,bt=/^(?:GET|HEAD)$/,wt=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,xt={},Et={},_t="*/".concat("*"),Ct=n.location.href,Tt=kt.exec(Ct.toLowerCase())||[];re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct,type:"GET",isLocal:yt.test(Tt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,re.ajaxSettings),t):z(re.ajaxSettings,e)},ajaxPrefilter:j(xt),ajaxTransport:j(Et),ajax:function(e,t){function n(e,t,n,a){var l,u,v,y,w,x=t;2!==b&&(b=2,s&&clearTimeout(s),r=void 0,o=a||"",k.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(y=W(d,k,n)),y=V(d,y,k,l),l?(d.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(re.lastModified[i]=w),w=k.getResponseHeader("etag"),w&&(re.etag[i]=w)),204===e||"HEAD"===d.type?x="nocontent":304===e?x="notmodified":(x=y.state,u=y.data,v=y.error,l=!v)):(v=x,(e||!x)&&(x="error",0>e&&(e=0))),k.status=e,k.statusText=(t||x)+"",l?f.resolveWith(p,[u,x,k]):f.rejectWith(p,[k,x,v]),k.statusCode(g),g=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[k,d,l?u:v]),m.fireWith(p,[k,x]),c&&(h.trigger("ajaxComplete",[k,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,c,u,d=re.ajaxSetup({},t),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?re(p):re.event,f=re.Deferred(),m=re.Callbacks("once memory"),g=d.statusCode||{},v={},y={},b=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=vt.exec(o);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(f.promise(k).complete=m.add,k.success=k.done,k.error=k.fail,d.url=((e||d.url||Ct)+"").replace(mt,"").replace(wt,Tt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(ve)||[""],null==d.crossDomain&&(l=kt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Tt[1]&&l[2]===Tt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Tt[3]||("http:"===Tt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),$(xt,d,t,k),2===b)return k;c=re.event&&d.global,c&&0===re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!bt.test(d.type),i=d.url,d.hasContent||(d.data&&(i=d.url+=(ft.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=gt.test(i)?i.replace(gt,"$1_="+ht++):i+(ft.test(i)?"&":"?")+"_="+ht++)),d.ifModified&&(re.lastModified[i]&&k.setRequestHeader("If-Modified-Since",re.lastModified[i]),re.etag[i]&&k.setRequestHeader("If-None-Match",re.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&k.setRequestHeader("Content-Type",d.contentType),k.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)k.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(p,k,d)===!1||2===b))return k.abort();w="abort";for(u in{success:1,error:1,complete:1})k[u](d[u]);if(r=$(Et,d,t,k)){k.readyState=1,c&&h.trigger("ajaxSend",[k,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){k.abort("timeout")},d.timeout));try{b=1,r.send(v,n)}catch(x){if(!(2>b))throw x;n(-1,x)}}else n(-1,"No Transport");return k},getJSON:function(e,t,n){return re.get(e,t,n,"json")},getScript:function(e,t){return re.get(e,void 0,t,"script")}}),re.each(["get","post"],function(e,t){re[t]=function(e,n,r,i){return re.isFunction(n)&&(i=i||r,r=n,n=void 0),re.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),re._evalUrl=function(e){return re.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},re.fn.extend({wrapAll:function(e){var t;return re.isFunction(e)?this.each(function(t){re(this).wrapAll(e.call(this,t))}):(this[0]&&(t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e);
64
- })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e&&e.data?"data:"+e.mimetype.string+";base64,"+e.data:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();
65
- return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
64
+ })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e?e.data?"data:"+e.mimetype.string+";base64,"+e.data:e.url?e.url:null:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":
65
+ for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
66
66
  * async
67
67
  * https://github.com/caolan/async
68
68
  *
@@ -36,7 +36,7 @@ var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer
36
36
  },function(e,t){ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=" .ace-xcode .ace_gutter { background: #e8e8e8; color: #333 } .ace-xcode .ace_print-margin { width: 1px; background: #e8e8e8 } .ace-xcode { background-color: #FFFFFF; color: #000000 } .ace-xcode .ace_cursor { color: #000000 } .ace-xcode .ace_marker-layer .ace_selection { background: #B5D5FF } .ace-xcode.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; border-radius: 2px } .ace-xcode .ace_marker-layer .ace_step { background: rgb(198, 219, 174) } .ace-xcode .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF } .ace-xcode .ace_marker-layer .ace_active-line { background: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_gutter-active-line { background-color: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_marker-layer .ace_selected-word { border: 1px solid #B5D5FF } .ace-xcode .ace_constant.ace_language, .ace-xcode .ace_keyword, .ace-xcode .ace_meta, .ace-xcode .ace_variable.ace_language { color: #C800A4 } .ace-xcode .ace_invisible { color: #BFBFBF } .ace-xcode .ace_constant.ace_character, .ace-xcode .ace_constant.ace_other { color: #275A5E } .ace-xcode .ace_constant.ace_numeric { color: #3A00DC } .ace-xcode .ace_entity.ace_other.ace_attribute-name, .ace-xcode .ace_support.ace_constant, .ace-xcode .ace_support.ace_function { color: #450084 } .ace-xcode .ace_fold { background-color: #C800A4; border-color: #000000 } .ace-xcode .ace_entity.ace_name.ace_tag, .ace-xcode .ace_support.ace_class, .ace-xcode .ace_support.ace_type { color: #790EAD } .ace-xcode .ace_storage { color: #C900A4 } .ace-xcode .ace_string { color: #DF0002 } .ace-xcode .ace_comment { color: #008E00 } .ace-xcode .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y }";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(240),d=r(u),p={manuscript_update:"Manuscript Updated.",file_save:"Saved.",image_create:"Image Created.",file_delete:"File Deleted"},h=function(e){function t(e){var n=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={flash:null},this.unsub=d["default"].flash.listen(function(e,t){clearInterval(n.timer),n.setState({flash:{type:e,message:t}}),n.timer=setTimeout(function(){n.setState({flash:null})},5e3)})}return o(t,e),a(t,[{key:"render",value:function(){var e=this;return c["default"].createElement("nav",{className:"toolbar"},c["default"].createElement("h3",{className:"book-title"},this.props.bookTitle),c["default"].createElement("ul",{className:"actions"},c["default"].createElement("li",null,c["default"].createElement("a",{className:"progressMessage "+(this.props.inProgress?"active":"")},this.props.inProgress?c["default"].createElement("i",{className:"fa fa-refresh fa-spin"}):null," ",p[this.props.progressType]||"Working...")),this.state.flash?c["default"].createElement("li",{onClick:function(){return e.setState({flash:null})},key:this.state.flash.type},c["default"].createElement("a",{className:""+this.state.flash.type},this.state.flash.message)):null,this.props.enablePreview?[c["default"].createElement("li",{key:"toggleLive"},c["default"].createElement("a",{className:this.props.inLiveMode?"active":"",onClick:this.props.toggleLiveMode},c["default"].createElement("i",{className:"fa fa-columns"})," Live Mode")),c["default"].createElement("li",{key:"preview"},c["default"].createElement("a",{className:this.props.inLiveMode?"disabled":"",onClick:this.props.onGeneratePreview},c["default"].createElement("i",{className:"fa fa-play"})," Preview"))]:null))}}]),t}(c["default"].Component);h.propTypes={enablePreview:c["default"].PropTypes.bool.isRequired,inProgress:c["default"].PropTypes.bool.isRequired,progressType:c["default"].PropTypes.string,inLiveMode:c["default"].PropTypes.bool.isRequired,toggleLiveMode:c["default"].PropTypes.func.isRequired,onGeneratePreview:c["default"].PropTypes.func.isRequired,bookTitle:c["default"].PropTypes.string.isRequired},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(241),o=r(i),a=o["default"].createActions({flash:{}});t["default"]=a,e.exports=t["default"]},function(e,t,n){var r=n(242);r.connect=n(256),r.connectFilter=n(258),r.ListenerMixin=n(257),r.listenTo=n(259),r.listenToMany=n(260),e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={version:{"reflux-core":"0.2.1"}};r.ActionMethods=n(243),r.ListenerMethods=n(244),r.PublisherMethods=n(254),r.StoreMethods=n(253),r.createAction=n(255),r.createStore=n(249);var i=n(248).staticJoinCreator;r.joinTrailing=r.all=i("last"),r.joinLeading=i("first"),r.joinStrict=i("strict"),r.joinConcat=i("all");var o=r.utils=n(245);r.EventEmitter=o.EventEmitter,r.Promise=o.Promise,r.createActions=function(){var e=function(e,t){Object.keys(e).forEach(function(n){var i=e[n];t[n]=r.createAction(i)})};return function(t){var n={};return t instanceof Array?t.forEach(function(t){o.isObject(t)?e(t,n):n[t]=r.createAction(t)}):e(t,n),n}}(),r.setEventEmitter=function(e){r.EventEmitter=o.EventEmitter=e},r.setPromise=function(e){r.Promise=o.Promise=e},r.setPromiseFactory=function(e){o.createPromise=e},r.nextTick=function(e){o.nextTick=e},r.use=function(e){e(r)},r.__keep=n(250),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5"),t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245),i=n(248).instanceJoinCreator,o=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},a=function s(e){var t={};for(var n in e){var i=e[n],a=o(i),l=s(a);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t<r.length;t++)if(n=r[t],n===e||n.hasListener&&n.hasListener(e))return!0;return!1},listenToMany:function(e){var t=a(e);for(var n in t){var i=r.callbackName(n),o=this[i]?i:this[n]?n:void 0;o&&this.listenTo(t[n],o,this[i+"Default"]||this[o+"Default"]||o)}},validateListening:function(e){return e===this?"Listener is not able to listen to itself":r.isFunction(e.listen)?e.hasListener&&e.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:e+" is missing a listen method"},listenTo:function(e,t,n){var i,o,a,s=this.subscriptions=this.subscriptions||[];return r.throwIf(this.validateListening(e)),this.fetchInitialState(e,n),i=e.listen(this[t]||t,this),o=function(){var e=s.indexOf(a);r.throwIf(-1===e,"Tried to remove listen already gone from subscriptions list!"),s.splice(e,1),i()},a={stop:o,listenable:e},s.push(a),a},stopListeningTo:function(e){for(var t,n=0,i=this.subscriptions||[];n<i.length;n++)if(t=i[n],t.listenable===e)return t.stop(),r.throwIf(-1!==i.indexOf(t),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var e,t=this.subscriptions||[];e=t.length;)t[0].stop(),r.throwIf(t.length!==e-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(e,t){t=t&&this[t]||t;var n=this;if(r.isFunction(t)&&r.isFunction(e.getInitialState)){var i=e.getInitialState();i&&r.isFunction(i.then)?i.then(function(){t.apply(n,arguments)}):t.call(this,i)}},joinTrailing:i("last"),joinLeading:i("first"),joinConcat:i("all"),joinStrict:i("strict")}},function(module,exports,__webpack_require__){(function(setImmediate){"use strict";function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function callbackName(e,t){return t=t||"on",t+exports.capitalize(e)}function checkEnv(target){var flag=void 0;try{eval(target)&&(flag=!0)}catch(e){flag=!1}environment[callbackName(target,"has")]=flag}function isObject(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function extend(e){if(!isObject(e))return e;for(var t,n,r=1,i=arguments.length;i>r;r++){t=arguments[r];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}else e[n]=t[n]}return e}function isFunction(e){return"function"==typeof e}function object(e,t){for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function isArguments(e){return"object"==typeof e&&"callee"in e&&"number"==typeof e.length}function throwIf(e,t){if(e)throw Error(t||e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=capitalize,exports.callbackName=callbackName,exports.isObject=isObject,exports.extend=extend,exports.isFunction=isFunction,exports.object=object,exports.isArguments=isArguments,exports.throwIf=throwIf;var environment={};exports.environment=environment,checkEnv("setImmediate"),checkEnv("Promise"),exports.EventEmitter=__webpack_require__(247),environment.hasSetImmediate?exports.nextTick=function(e){setImmediate(e)}:exports.nextTick=function(e){setTimeout(e,0)},environment.hasPromise?(exports.Promise=Promise,exports.createPromise=function(e){return new exports.Promise(e)}):(exports.Promise=null,exports.createPromise=function(){})}).call(exports,__webpack_require__(246).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(75).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:s.call(arguments,1);return l[n]=!0,o(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(246).setImmediate,n(246).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);d>c;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;h>c;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;default:if(!l)for(p=1,l=new Array(d-1);d>p;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var l=0,c=a.length;c>l;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&s.push(a[l]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return function(){var r,i=n.subscriptions,o=i?i.indexOf(e):-1;for(l.throwIf(-1===o,"Tried to remove join already gone from subscriptions list!"),r=0;r<t.length;r++)t[r]();i.splice(o,1)}}function i(e){e.listenablesEmitted=new Array(e.numberOfListenables),e.args=new Array(e.numberOfListenables)}function o(e,t){return function(){var n=c.call(arguments);if(t.listenablesEmitted[e])switch(t.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":t.args[e]=n;break;case"all":t.args[e].push(n)}else t.listenablesEmitted[e]=!0,t.args[e]="all"===t.strategy?[n]:n;a(t)}}function a(e){for(var t=0;t<e.numberOfListenables;t++)if(!e.listenablesEmitted[t])return;e.callback.apply(e.listener,e.args),i(e)}var s=n(249),l=n(245),c=Array.prototype.slice,u={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};t.staticJoinCreator=function(e){return function(){var t=c.call(arguments);return s({init:function(){this[u[e]].apply(this,t.concat("triggerAsync"))}})}},t.instanceJoinCreator=function(e){return function(){l.throwIf(arguments.length<2,"Cannot create a join with less than 2 listenables!");var t,n,a=c.call(arguments),s=a.pop(),u=a.length,d={numberOfListenables:u,callback:this[s]||s,listener:this,strategy:e},p=[];for(t=0;u>t;t++)l.throwIf(this.validateListening(a[t]));for(t=0;u>t;t++)p.push(a[t].listen(o(t,d),this));return i(d),n={listenable:a},n.stop=r(n,p,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){"use strict";var r=n(245),i=n(250),o=n(251),a=n(252),s={preEmit:1,shouldEmit:1};e.exports=function(e){function t(){var t,n=0;if(this.subscriptions=[],this.emitter=new r.EventEmitter,this.eventLabel="change",a(this,e),this.init&&r.isFunction(this.init)&&this.init(),this.listenables)for(t=[].concat(this.listenables);n<t.length;n++)this.listenToMany(t[n])}var l=n(253),c=n(254),u=n(244);e=e||{};for(var d in l)if(!s[d]&&(c[d]||u[d]))throw new Error("Cannot override API method "+d+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var p in e)if(!s[p]&&(c[p]||u[p]))throw new Error("Cannot override API method "+p+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");e=o(e),r.extend(t.prototype,u,c,l,e);var h=new t;return i.createdStores.push(h),h}},function(e,t){"use strict";t.createdStores=[],t.createdActions=[],t.reset=function(){for(;t.createdStores.length;)t.createdStores.pop();for(;t.createdActions.length;)t.createdActions.pop()}},function(e,t,n){"use strict";var r=n(245);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t){"use strict";e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245);e.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(e,t){t=t||this;var n=function(n){i||e.apply(t,n)},r=this,i=!1;return this.emitter.addListener(this.eventLabel,n),function(){i=!0,r.emitter.removeListener(r.eventLabel,n)}},promise:function(e){var t=this,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,o){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,o),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var a=e.completed.listen(function(e){a(),s(),i(e)}),s=e.failed.listen(function(e){a(),s(),o(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){"use strict";var r=n(245),i=n(243),o=n(254),a=n(250),s={preEmit:1,shouldEmit:1},l=function c(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i)if(!s[t]&&o[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&o[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,u={};l<e.children.length;l++){var d=e.children[l];u[d]=c(d)}var p=r.extend({eventLabel:"action",emitter:new r.EventEmitter,_isAction:!0},o,i,e),h=function f(){var e=f.sync?"trigger":r.environment.hasPromise?"triggerPromise":"triggerAsync";return f[e].apply(f,arguments)};return r.extend(h,u,p),a.createdActions.push(h),h};e.exports=l},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t){return{getInitialState:function(){return o.isFunction(e.getInitialState)?void 0===t?e.getInitialState():o.object([t],[e.getInitialState()]):{}},componentDidMount:function(){o.extend(this,r);var n=this,i=void 0===t?this.setState:function(e){("undefined"==typeof n.isMounted||n.isMounted()===!0)&&n.setState(o.object([t],[e]))};this.listenTo(e,i)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(245),i=n(244);e.exports=r.extend({componentWillUnmount:i.stopListeningToAll},i)},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t,n){return n=o.isFunction(t)?t:n,{getInitialState:function(){if(o.isFunction(e.getInitialState)){if(o.isFunction(t))return n.call(this,e.getInitialState());var r=n.call(this,e.getInitialState());return"undefined"!=typeof r?o.object([t],[r]):{}}return{}},componentDidMount:function(){o.extend(this,r);var i=this,a=function(e){if(o.isFunction(t))i.setState(n.call(i,e));else{var r=n.call(i,e);i.setState(o.object([t],[r]))}};this.listenTo(e,a)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(244);e.exports=function(e,t,n){return{componentDidMount:function(){for(var i in r)if(this[i]!==r[i]){if(this[i])throw"Can't have other property '"+i+"' when using Reflux.listenTo!";this[i]=r[i]}this.listenTo(e,t,n)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){var r=n(244);e.exports=function(e){return{componentDidMount:function(){for(var t in r)if(this[t]!==r[t]){if(this[t])throw"Can't have other property '"+t+"' when using Reflux.listenToMany!";this[t]=r[t]}this.listenToMany(e)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(2),d=r(u),p=n(262),h=r(p),f=n(238),m=r(f),g=n(341),v=r(g),y=n(263),b=n(240),w=r(b),k=n(3),x=r(k);d["default"].string=x["default"];var E=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={files:[],closed:!1,fileMode:"manuscript",busy:!1},this.toggleClose=this.toggleClose.bind(this),this.newFile=this.newFile.bind(this),this.createFile=this.createFile.bind(this),this.createImageFile=this.createImageFile.bind(this),this.listManuscript=this.listManuscript.bind(this),this.onDeleteFile=this.onDeleteFile.bind(this),this.onChangeMode=this.onChangeMode.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.listCode=this.listCode.bind(this),this.listManuscript=this.listManuscript.bind(this),this.listImage=this.listImage.bind(this),this.moveFile=this.moveFile.bind(this),this.saveManuscript=this.saveManuscript.bind(this),m["default"].onDelete(this.onFileDeleted)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.listManuscript()}},{key:"componentDidUpdate",value:function(e,t){t.fileMode&&t.fileMode!==this.state.fileMode&&this["list"+d["default"].string.capitalize(this.state.fileMode)]()}},{key:"onFileDeleted",value:function(){this.props.onChangeFile(null)}},{key:"listManuscript",value:function(){var e=this;this.busy(!0),m["default"].listFiles(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listImage",value:function(){var e=this;this.busy(!0),m["default"].listImages(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listCode",value:function(){var e=this;this.busy(!0),m["default"].listCode(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"busy",value:function(e){this.setState({busy:e})}},{key:"free",value:function(){this.setState({busy:!1})}},{key:"toggleClose",value:function(e){this.setState({closed:!this.state.closed})}},{key:"onChangeMode",value:function(e){this.setState({fileMode:e})}},{key:"createImageFile",value:function(e){var t=this,n=this.refs.imageFile.getDOMNode();return m["default"].newImage(n,function(){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)]()}),e.stopPropagation(),e.preventDefault(),!1}},{key:"createFile",value:function(e){var t=this,n=this.refs.filename.getDOMNode();-1!==this.props.blacklistedFiles.indexOf(n.value.toLowerCase())?w["default"].flash("error","You may not create a file with the name "+n.value+" as it is a reserved file."):m["default"]["new"](n.value,this.state.fileMode,"",function(e,r){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)](),t.props.onChangeFile(r)}),e.stopPropagation(),e.preventDefault()}},{key:"newFile",value:function(e){this.setState({creatingFile:!this.state.creatingFile})}},{key:"onDeleteFile",value:function(e){m["default"]["delete"](e.filename,this.state.fileMode,this["list"+d["default"].string.capitalize(this.state.fileMode)])}},{key:"saveManuscript",value:function(){"manuscript"===this.state.fileMode&&m["default"].saveManuscript(this.state.files)}},{key:"moveFile",value:function(e,t){var n=d["default"].clone(this.state.files),r=n.indexOf(e),i=n.indexOf(t);n.splice(r,1),n.splice(i,0,e),this.setState({files:n})}},{key:"renderFileCreator",value:function(){if(this.state.creatingFile){if("image"===this.state.fileMode){var e=c["default"].createElement("form",{onSubmit:this.createImageFile,className:"file-name"},c["default"].createElement("input",{type:"file",ref:"imageFile"}),c["default"].createElement("button",null,"Submit")),t=c["default"].createElement("p",null,"Sorry, image uploads are not supported");return m["default"].supportsImageUploads()?e:t}return c["default"].createElement("form",{onSubmit:this.createFile,className:"file-name"},c["default"].createElement("input",{type:"text",ref:"filename",placeholder:"Type a filename..."}),c["default"].createElement("button",null,"Create"))}}},{key:"renderFilesList",value:function(){var e=this;return this.state.busy?c["default"].createElement("i",{className:"busy-indicator fa fa-spin fa-2x fa-circle-o-notch"}):c["default"].createElement("ul",{className:"files-list"},d["default"].map(this.state.files,function(t,n){return c["default"].createElement(h["default"],{saveManuscript:e.saveManuscript,moveFile:e.moveFile,key:n,fileMode:e.state.fileMode,onDeleteFile:e.onDeleteFile,onChangeFile:e.props.onChangeFile,onPreviewImage:e.props.onPreviewImage,isCurrent:e.props.currentFile===t,file:t})}))}},{key:"render",value:function(){var e="file-browser "+(this.state.closed?"closed":"open"),t="new-file"+(this.state.creatingFile?" active":"");return c["default"].createElement("section",{className:e},c["default"].createElement("ul",{className:"file-types-list"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"manuscript")},c["default"].createElement("h4",{className:"title"+("manuscript"===this.state.fileMode?" selected":"")},"files"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"image")},c["default"].createElement("h4",{className:"title"+("image"===this.state.fileMode?" selected":"")},"images"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"code")},c["default"].createElement("h4",{className:"title"+("code"===this.state.fileMode?" selected":"")},"code")))),c["default"].createElement("div",{className:t,onClick:this.newFile},c["default"].createElement("i",{className:"fa fa-plus"}," ")),this.renderFileCreator(),this.renderFilesList(),c["default"].createElement("button",{className:"close-button",onClick:this.toggleClose},c["default"].createElement("span",null)))}}]),t}(c["default"].Component);E.propTypes={projectRoot:c["default"].PropTypes.string.isRequired,onChangeFile:c["default"].PropTypes.func.isRequired,currentFile:c["default"].PropTypes.string,blacklistedFiles:c["default"].PropTypes.array.isRequired},t["default"]=y.DragDropContext(v["default"])(E),
37
37
  e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(73),s=r(a),l=n(263),c={beginDrag:function(e){return e.file}},u={hover:function(e,t){var n=t.getItem();n!==e.file&&e.moveFile(n,e.file)},drop:function(e,t){e.saveManuscript()}},d=function(){function e(e){i(this,t),this.onDelete=this.onDelete.bind(this),this.onChange=this.onChange.bind(this)}o(e,[{key:"onDelete",value:function(e){confirm("Are you sure you want to delete this file?")&&this.props.onDeleteFile(this.props.file),e.stopPropagation(),e.preventDefault()}},{key:"onChange",value:function(e){"image"===this.props.file.type?this.props.onPreviewImage(this.props.file):this.props.onChangeFile(this.props.file)}},{key:"getFileIconClass",value:function(){switch(this.props.fileMode){case"manuscript":return"fa-file-o";case"images":return"fa-file-image";case"code":return"fa-code"}}},{key:"render",value:function(){var e="files-list-item"+(this.props.isCurrent?" current":"")+(this.props.file.parent?" child":"")+(this.props.isDragging?" dragging":"");return this.props.connectDragSource(this.props.connectDropTarget(s["default"].createElement("li",{className:e,onClick:this.onChange},s["default"].createElement("a",null,s["default"].createElement("i",{className:"fa "+this.getFileIconClass()})," ",this.props.file.filename),s["default"].createElement("button",{onClick:this.onDelete},s["default"].createElement("i",{className:"fa fa-times"})))))}}]);var t=e;return e=l.DragSource("file",c,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}})(e)||e,e=l.DropTarget("file",u,function(e){return{connectDropTarget:e.dropTarget()}})(e)||e}();t["default"]=d,d.propTypes={file:s["default"].PropTypes.object.isRequired,fileMode:s["default"].PropTypes.string.isRequired,moveFile:s["default"].PropTypes.func.isRequired,saveManuscript:s["default"].PropTypes.func.isRequired,isCurrent:s["default"].PropTypes.bool.isRequired,onDeleteFile:s["default"].PropTypes.func.isRequired,onChangeFile:s["default"].PropTypes.func.isRequired,onPreviewImage:s["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(264);t.DragDropContext=r(i);var o=n(310);t.DragLayer=r(o);var a=n(321);t.DragSource=r(a);var s=n(336);t.DropTarget=r(s),"production"!==e.env.NODE_ENV&&Object.defineProperty(t,"default",{get:function(){console.error("React DnD does not provide a default export. You are probably missing the curly braces in the import statement. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export")}})}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){g["default"].apply(void 0,["DragDropContext","backend"].concat(l.call(arguments))),"object"==typeof e&&"function"==typeof e["default"]&&(e=e["default"]),f["default"]("function"==typeof e,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var t={dragDropManager:new p.DragDropManager(e)};return function(e){var n=e.displayName||e.name||"Component";return function(r){function a(){i(this,a),r.apply(this,arguments)}return o(a,r),a.prototype.getDecoratedComponentInstance=function(){return this.refs.child},a.prototype.getManager=function(){return t.dragDropManager},a.prototype.getChildContext=function(){return t},a.prototype.render=function(){return d["default"].createElement(e,s({},this.props,{ref:"child"}))},c(a,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+n+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),a}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=n(265),h=n(280),f=r(h),m=n(309),g=r(m);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(266);t.DragDropManager=r(i);var o=n(305);t.DragSource=r(o);var a=n(306);t.DropTarget=r(a);var s=n(307);t.createTestBackend=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(267),s=i(a),l=n(269),c=i(l),u=n(271),d=r(u),p=n(301),h=i(p),f=n(302),m=(i(f),function(){function e(t){o(this,e);var n=s["default"](c["default"]);this.store=n,this.monitor=new h["default"](n),this.registry=this.monitor.registry,this.backend=t(this),n.subscribe(this.handleRefCountChange.bind(this))}return e.prototype.handleRefCountChange=function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var r=e.apply(t,arguments);"undefined"!=typeof r&&n(r)}}var t=this,n=this.store.dispatch;return Object.keys(d).filter(function(e){return"function"==typeof d[e]}).reduce(function(t,n){return t[n]=e(d[n]),t},{})},e}());t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(){return c}function r(e){return u.push(e),function(){var t=u.indexOf(e);u.splice(t,1)}}function i(e){if(!a["default"](e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=l(c,e)}finally{d=!1}return u.slice().forEach(function(e){return e()}),e}function o(e){l=e,i({type:s.INIT})}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,c=t,u=[],d=!1;return i({type:s.INIT}),{dispatch:i,subscribe:r,getState:n,replaceReducer:o}}t.__esModule=!0,t["default"]=i;var o=n(268),a=r(o),s={INIT:"@@redux/INIT"};t.ActionTypes=s},function(e,t){"use strict";function n(e){if(!e||"object"!=typeof e)return!1;var t="function"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}t.__esModule=!0,t["default"]=n;var r=function(e){return Function.prototype.toString.call(e)};e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(270),o=r(i),a=n(281),s=r(a),l=n(295),c=r(l),u=n(296),d=r(u);t["default"]=function(e,t){return void 0===e&&(e={}),{dirtyHandlerIds:d["default"](e.dirtyHandlerIds,t,e.dragOperation),dragOffset:o["default"](e.dragOffset,t),refCount:c["default"](e.refCount,t),dragOperation:s["default"](e.dragOperation,t)}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return e===t?!0:e&&t&&e.x===t.x&&e.y===t.y}function i(e,t){switch(void 0===e&&(e=c),t.type){case l.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case l.HOVER:return r(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case l.END_DRAG:case l.DROP:return c;default:return e}}function o(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function a(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i,t.getSourceClientOffset=o,t.getDifferenceFromInitialOffset=a;var l=n(271),c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.publishSource,r=void 0===n?!0:n,i=t.clientOffset,o=void 0===i?null:i,a=t.getSourceClientOffset;p["default"](f["default"](e),"Expected sourceIds to be an array.");var s=this.getMonitor(),l=this.getRegistry();p["default"](!s.isDragging(),"Cannot call beginDrag while dragging.");for(var c=0;c<e.length;c++)p["default"](l.getSource(e[c]),"Expected sourceIds to be registered.");for(var u=null,c=e.length-1;c>=0;c--)if(s.canDragSource(e[c])){u=e[c];break}if(null!==u){var d=null;o&&(p["default"]("function"==typeof a,"When clientOffset is provided, getSourceClientOffset must be a function."),d=a(u));var h=l.getSource(u),m=h.beginDrag(s,u);p["default"](g["default"](m),"Item must be an object."),l.pinSource(u);var y=l.getSourceType(u);return{type:v,itemType:y,item:m,sourceId:u,clientOffset:o,sourceClientOffset:d,isSourcePublic:r}}}function o(e){var t=this.getMonitor();if(t.isDragging())return{type:y}}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.clientOffset,r=void 0===n?null:n;p["default"](f["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var i=this.getMonitor(),o=this.getRegistry();p["default"](i.isDragging(),"Cannot call hover while not dragging."),p["default"](!i.didDrop(),"Cannot call hover after drop.");for(var a=i.getItemType(),s=0;s<e.length;s++){var l=e[s];p["default"](e.lastIndexOf(l)===s,"Expected targetIds to be unique in the passed array.");var c=o.getTarget(l);p["default"](c,"Expected targetIds to be registered.");var d=o.getTargetType(l);u["default"](d,a)&&c.hover(i,l)}return{type:b,targetIds:e,clientOffset:r}}function s(){var e=this,t=this.getMonitor(),n=this.getRegistry();p["default"](t.isDragging(),"Cannot call drop while not dragging."),p["default"](!t.didDrop(),"Cannot call drop twice during one drag operation.");var r=t.getTargetIds().filter(t.canDropOnTarget,t);r.reverse(),r.forEach(function(r,i){var o=n.getTarget(r),a=o.drop(t,r);p["default"]("undefined"==typeof a||g["default"](a),"Drop result must either be an object or undefined."),"undefined"==typeof a&&(a=0===i?{}:t.getDropResult()),e.store.dispatch({type:w,dropResult:a})})}function l(){var e=this.getMonitor(),t=this.getRegistry();p["default"](e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId(),r=t.getSource(n,!0);return r.endDrag(e,n),t.unpinSource(),{type:k}}t.__esModule=!0,t.beginDrag=i,t.publishDragSource=o,t.hover=a,t.drop=s,t.endDrag=l;var c=n(272),u=r(c),d=n(280),p=r(d),h=n(273),f=r(h),m=n(277),g=r(m),v="dnd-core/BEGIN_DRAG";t.BEGIN_DRAG=v;var y="dnd-core/PUBLISH_DRAG_SOURCE";t.PUBLISH_DRAG_SOURCE=y;var b="dnd-core/HOVER";t.HOVER=b;var w="dnd-core/DROP";t.DROP=w;var k="dnd-core/END_DRAG";t.END_DRAG=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return a["default"](e)?e.some(function(e){return e===t}):e===t}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){var r=n(274),i=n(279),o=n(278),a="[object Array]",s=Object.prototype,l=s.toString,c=r(Array,"isArray"),u=c||function(e){return o(e)&&i(e.length)&&l.call(e)==a};e.exports=u},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=n(275);e.exports=r},function(e,t,n){function r(e){return null==e?!1:i(e)?u.test(l.call(e)):o(e)&&a.test(e)}var i=n(276),o=n(278),a=/^\[object .+?Constructor\]$/,s=Object.prototype,l=Function.prototype.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return i(e)&&s.call(e)==o}var i=n(277),o="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){(function(t){"use strict";var n=function(e,n,r,i,o,a,s,l){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,i,o,a,s,l],d=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return u[d++]}))}throw c.framesToPop=1,c}};e.exports=n}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){switch(void 0===e&&(e=u),t.type){case a.BEGIN_DRAG:return o({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case a.HOVER:return o({},e,{targetIds:t.targetIds});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case s.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:o({},e,{targetIds:c["default"](e.targetIds,t.targetId)});case a.DROP:return o({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case a.END_DRAG:return o({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i;var a=n(271),s=n(282),l=n(283),c=r(l),u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.exports=t["default"]},function(e,t){"use strict";function n(e){return{type:a,sourceId:e}}function r(e){return{type:s,targetId:e}}function i(e){return{type:l,sourceId:e}}function o(e){return{type:c,targetId:e}}t.__esModule=!0,t.addSource=n,t.addTarget=r,t.removeSource=i,t.removeTarget=o;var a="dnd-core/ADD_SOURCE";t.ADD_SOURCE=a;var s="dnd-core/ADD_TARGET";t.ADD_TARGET=s;var l="dnd-core/REMOVE_SOURCE";t.REMOVE_SOURCE=l;var c="dnd-core/REMOVE_TARGET";t.REMOVE_TARGET=c},function(e,t,n){var r=n(284),i=n(291),o=n(294),a=o(function(e,t){return i(e)?r(e,t):[]});e.exports=a},function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var l=-1,c=i,u=!0,d=u&&t.length>=s?a(t):null,p=t.length;d&&(c=o,u=!1,t=d);e:for(;++l<n;){var h=e[l];if(u&&h===h){for(var f=p;f--;)if(t[f]===h)continue e;r.push(h)}else c(t,h,0)<0&&r.push(h)}return r}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=n(286);e.exports=r},function(e,t){function n(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}e.exports=n},function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=n(277);e.exports=r},function(e,t,n){(function(t){function r(e){return s&&a?new i(e):null}var i=n(289),o=n(274),a=o(t,"Set"),s=o(Object,"create");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=n(290),o=n(274),a=o(t,"Set"),s=o(Object,"create");r.prototype.push=i,e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=n(277);e.exports=r},function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=n(292),o=n(279);e.exports=r},function(e,t,n){var r=n(293),i=r("length");e.exports=i},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t){function n(e,t){if("function"!=typeof e)throw new TypeError(r);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var r="Expected a function",i=Math.max;e.exports=n},function(e,t,n){"use strict";function r(e,t){switch(void 0===e&&(e=0),t.type){case i.ADD_SOURCE:case i.ADD_TARGET:return e+1;case i.REMOVE_SOURCE:case i.REMOVE_TARGET:return e-1;default:return e}}t.__esModule=!0,t["default"]=r;var i=n(282);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){switch(void 0===e&&(e=p),t.type){case u.HOVER:break;case d.ADD_SOURCE:case d.ADD_TARGET:case d.REMOVE_TARGET:case d.REMOVE_SOURCE:return p;case u.BEGIN_DRAG:case u.PUBLISH_DRAG_SOURCE:case u.END_DRAG:case u.DROP:default:return h}var r=t.targetIds,i=n.targetIds,o=s["default"](r,i),a=!1;if(0===o.length){for(var l=0;l<r.length;l++)if(r[l]!==i[l]){a=!0;break}}else a=!0;if(!a)return p;var c=i[i.length-1],f=r[r.length-1];return c!==f&&(c&&o.push(c),f&&o.push(f)),o}function o(e,t){return e===p?!1:e===h||"undefined"==typeof t?!0:c["default"](t,e).length>0}t.__esModule=!0,t["default"]=i,t.areDirty=o;var a=n(297),s=r(a),l=n(300),c=r(l),u=n(271),d=n(282),p=[],h=[]},function(e,t,n){function r(){for(var e=-1,t=arguments.length;++e<t;){var n=arguments[e];if(s(n))var r=r?i(o(r,n),o(n,r)):n}return r?a(r):[]}var i=n(298),o=n(284),a=n(299),s=n(291);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){function r(e,t){var n=-1,r=i,l=e.length,c=!0,u=c&&l>=s,d=u?a():null,p=[];d?(r=o,c=!1):(u=!1,d=t?[]:p);e:for(;++n<l;){var h=e[n],f=t?t(h,n,e):h;if(c&&h===h){for(var m=d.length;m--;)if(d[m]===f)continue e;t&&d.push(f),p.push(h)}else r(d,f,0)<0&&((t||u)&&d.push(f),p.push(h))}return p}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){var r=n(285),i=n(287),o=n(288),a=n(291),s=n(294),l=s(function(e){for(var t=e.length,n=t,s=Array(f),l=r,c=!0,u=[];n--;){var d=e[n]=a(d=e[n])?d:[];s[n]=c&&d.length>=120?o(n&&d):null}var p=e[0],h=-1,f=p?p.length:0,m=s[0];e:for(;++h<f;)if(d=p[h],(m?i(m,d):l(u,d,0))<0){for(var n=t;--n;){var g=s[n];if((g?i(g,d):l(e[n],d,0))<0)continue e}m&&m.push(d),u.push(d)}return u});e.exports=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(280),a=r(o),s=n(272),l=r(s),c=n(273),u=r(c),d=n(302),p=r(d),h=n(270),f=n(296),m=function(){function e(t){i(this,e),this.store=t,this.registry=new p["default"](t)}return e.prototype.subscribeToStateChange=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=n.handlerIds;a["default"]("function"==typeof e,"listener must be a function."),a["default"]("undefined"==typeof r||u["default"](r),"handlerIds, when specified, must be an array of strings.");var i=function(){f.areDirty(t.store.getState().dirtyHandlerIds,r)&&e()};return this.store.subscribe(i)},e.prototype.subscribeToOffsetChange=function(e){var t=this;a["default"]("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)},e.prototype.canDragSource=function(e){var t=this.registry.getSource(e);return a["default"](t,"Expected to find a valid source."),this.isDragging()?!1:t.canDrag(this,e)},e.prototype.canDropOnTarget=function(e){var t=this.registry.getTarget(e);if(a["default"](t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return l["default"](n,r)&&t.canDrop(this,e)},e.prototype.isDragging=function(){return Boolean(this.getItemType())},e.prototype.isDraggingSource=function(e){var t=this.registry.getSource(e,!0);if(a["default"](t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n!==r?!1:t.isDragging(this,e)},e.prototype.isOverTarget=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.shallow,r=void 0===n?!1:n;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),o=this.getItemType();if(!l["default"](i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var s=a.indexOf(e);return r?s===a.length-1:s>-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return h.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return h.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&e.constructor===Symbol?"symbol":typeof e}function a(e){p["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),p["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),p["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function s(e){p["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),p["default"]("function"==typeof e.hover,"Expected hover to be a function."),p["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function l(e,t){return t&&g["default"](e)?void e.forEach(function(e){return l(e,!1)}):void p["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":o(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function c(e){var t=y["default"]().toString();switch(e){case w.SOURCE:return"S"+t;case w.TARGET:return"T"+t;default:p["default"](!1,"Unknown role: "+e)}}function u(e){switch(e[0]){case"S":return w.SOURCE;case"T":return w.TARGET;default:p["default"](!1,"Cannot parse handler ID: "+e)}}t.__esModule=!0;var d=n(280),p=r(d),h=n(303),f=r(h),m=n(273),g=r(m),v=n(304),y=r(v),b=n(282),w=f["default"]({SOURCE:null,TARGET:null}),k=function(){function e(t){i(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){l(e),a(t);var n=this.addHandler(w.SOURCE,e,t);return this.store.dispatch(b.addSource(n)),n},e.prototype.addTarget=function(e,t){l(e,!0),s(t);var n=this.addHandler(w.TARGET,e,t);return this.store.dispatch(b.addTarget(n)),n},e.prototype.addHandler=function(e,t,n){var r=c(e);return this.types[r]=t,this.handlers[r]=n,r},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})},e.prototype.getSource=function(e,t){p["default"](this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r},e.prototype.getTarget=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return p["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=u(e);return t===w.SOURCE},e.prototype.isTargetId=function(e){var t=u(e);return t===w.TARGET},e.prototype.removeSource=function(e){p["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(b.removeSource(e)),delete this.handlers[e],delete this.types[e]},e.prototype.removeTarget=function(e){p["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(b.removeTarget(e)),delete this.handlers[e],delete this.types[e]},e.prototype.pinSource=function(e){var t=this.getSource(e);p["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){p["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();t["default"]=k,e.exports=t["default"]},function(e,t){"use strict";var n=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=n},function(e,t){"use strict";function n(){return r++}t.__esModule=!0,t["default"]=n;var r=0;e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new l(e)}t.__esModule=!0,t["default"]=o;var a=n(308),s=r(a),l=function(){function e(t){i(this,e),this.actions=t.getActions()}return e.prototype.setup=function(){this.didCallSetup=!0},e.prototype.teardown=function(){this.didCallTeardown=!0},e.prototype.connectDragSource=function(){return s["default"]},e.prototype.connectDragPreview=function(){return s["default"]},e.prototype.connectDropTarget=function(){return s["default"]},e.prototype.simulateBeginDrag=function(e,t){this.actions.beginDrag(e,t)},e.prototype.simulatePublishDragSource=function(){this.actions.publishDragSource()},e.prototype.simulateHover=function(e,t){this.actions.hover(e,t)},e.prototype.simulateDrop=function(){this.actions.drop()},e.prototype.simulateEndDrag=function(){this.actions.endDrag()},e}();e.exports=t["default"]},function(e,t){function n(){}e.exports=n},function(e,t,n){(function(n){"use strict";function r(e,t){if("production"!==n.env.NODE_ENV){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;r>o;o++)i[o-2]=arguments[o];for(var a=0;a<i.length;a++){var s=i[a];if(s&&s.prototype&&s.prototype.render)return void console.error("You seem to be applying the arguments in the wrong order. "+("It should be "+e+"("+t+")(Component), not the other way around. ")+"Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order")}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return k["default"].apply(void 0,["DragLayer","collect[, options]"].concat(l.call(arguments))),b["default"]("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html",e),b["default"](v["default"](t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html',t),function(n){var r=t.arePropsEqual,a=void 0===r?m["default"]:r,l=n.displayName||n.name||"Component";return function(t){function r(e,n){i(this,r),t.call(this,e),this.handleChange=this.handleChange.bind(this),this.manager=n.dragDropManager,b["default"]("object"==typeof this.manager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",l,l),this.state=this.getCurrentState()}return o(r,t),r.prototype.getDecoratedComponentInstance=function(){return this.refs.child},r.prototype.shouldComponentUpdate=function(e,t){return!a(e,this.props)||!h["default"](t,this.state)},c(r,null,[{key:"DecoratedComponent",value:n,enumerable:!0},{key:"displayName",value:"DragLayer("+l+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),r.prototype.componentDidMount=function(){var e=this.manager.getMonitor();this.unsubscribe=e.subscribeToOffsetChange(this.handleChange)},r.prototype.componentWillUnmount=function(){this.unsubscribe()},r.prototype.handleChange=function(){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)},r.prototype.getCurrentState=function(){
38
38
  var t=this.manager.getMonitor();return e(t)},r.prototype.render=function(){return d["default"].createElement(n,s({},this.props,this.state,{ref:"child"}))},r}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=(n(265),n(311)),h=r(p),f=n(312),m=r(f),g=n(313),v=r(g),y=n(280),b=r(y),w=n(309),k=r(w);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;var a=e[n[o]],s=t[n[o]];if(a!==s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o]))return!1;var a=e[n[o]],s=t[n[o]];if(a!==s||"object"==typeof a||"object"==typeof s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){var t;if(!a(e)||u.call(e)!=s||o(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=n(314),o=n(319),a=n(278),s="[object Object]",l=Object.prototype,c=l.hasOwnProperty,u=l.toString;e.exports=r},function(e,t,n){function r(e,t){return i(e,t,o)}var i=n(315),o=n(318);e.exports=r},function(e,t,n){var r=n(316),i=r();e.exports=i},function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,l=e?s:-1;e?l--:++l<s;){var c=a[l];if(n(o[c],c,o)===!1)break}return t}}var i=n(317);e.exports=r},function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=n(277);e.exports=r},function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||i(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,d=Array(t),p=t>0;++r<t;)d[r]=r+"";for(var h in e)p&&a(h,t)||"constructor"==h&&(c||!u.call(e,h))||d.push(h);return d}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(277),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)&&i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}var i=n(291),o=n(278),a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;e.exports=r},function(e,t){function n(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var r=/^\d+$/,i=9007199254740991;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DragSource","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(331),y=r(v),b=n(332),w=r(b),k=n(333),x=r(k),E=n(334),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.DecoratedComponent,n=e.createHandler,i=e.createMonitor,s=e.createConnector,h=e.registerHandler,m=e.containerDisplayName,v=e.getType,b=e.collect,k=e.options,E=k.arePropsEqual,_=void 0===E?g["default"]:E,C=t.displayName||t.name||"Component";return function(e){function g(t,r){o(this,g),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),w["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=i(this.manager),this.handler=n(this.handlerMonitor),this.disposable=new p.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState()}return a(g,e),g.prototype.getHandlerId=function(){return this.handlerId},g.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},g.prototype.shouldComponentUpdate=function(e,t){return!_(e,this.props)||!f["default"](t,this.state)},c(g,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:m+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),g.prototype.componentWillReceiveProps=function(e){_(e,this.props)||(this.receiveProps(e),this.handleChange())},g.prototype.componentWillUnmount=function(){this.disposable.dispose()},g.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},g.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=h(e,this.handler,this.manager),n=t.handlerId,r=t.unregister,i=s(this.manager.getBackend()),o=x["default"](i,n),a=o.handlerConnector,l=o.disposable;this.handlerId=n,this.handlerConnector=a,this.handlerMonitor.receiveHandlerId(n);var c=this.manager.getMonitor(),u=c.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new p.CompositeDisposable(new p.Disposable(u),new p.Disposable(r),l))}},g.prototype.handleChange=function(){var e=this.getCurrentState();f["default"](e,this.state)||this.setState(e)},g.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},g.prototype.getCurrentState=function(){var e=b(this.handlerConnector,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&w["default"](y["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",m,C,e),e},g.prototype.render=function(){return d["default"].createElement(t,l({},this.props,this.state,{ref:this.handleChildRef}))},g}(u.Component)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=s;var u=n(73),d=i(u),p=n(323),h=n(311),f=i(h),m=n(312),g=i(m),v=n(313),y=i(v),b=n(280),w=i(b),k=n(328),x=i(k);e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};t.__esModule=!0;var i=n(324),o=r(i);t.isDisposable=o["default"];var a=n(325),s=r(a);t.Disposable=s["default"];var l=n(326),c=r(l);t.CompositeDisposable=c["default"];var u=n(327),d=r(u);t.SerialDisposable=d["default"]},function(e,t){"use strict";function n(e){return Boolean(e&&"function"==typeof e.dispose)}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.__esModule=!0;var i=function(){},o=function(){function e(t){n(this,e),this.isDisposed=!1,this.action=t||i}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},r(e,null,[{key:"empty",enumerable:!0,value:{dispose:i}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];i(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var o=0;o<n.length;o++)if(!a["default"](n[o]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return-1===t?!1:(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;e>n;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(var n=0;e>n;n++)t[n].dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){i(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=new s.CompositeDisposable,r={};return Object.keys(e).forEach(function(i){var o=a["default"](t,e[i]),s=o.disposable,l=o.ref;n.add(s),r[i]=function(){return l}}),{disposable:n,handlerConnector:r}}t.__esModule=!0,t["default"]=i;var o=n(329),a=r(o),s=n(323);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(s,d){if(u.isValidElement(s)){var p=s;return l["default"](p,function(e){return n(e,d)})}var h=u.findDOMNode(s);if(h!==i||!a["default"](o,d)){if(i=h,o=d,!h)return void r.setDisposable(null);var f=t(e,h,d);r.setDisposable(new c.Disposable(f))}}var r=new c.SerialDisposable,i=null,o=null;return{ref:n,disposable:r}}t.__esModule=!0,t["default"]=i;var o=n(311),a=r(o),s=n(330),l=r(s),c=n(323),u=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=e.ref;return a["default"]("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),s.cloneElement(e,{ref:function(e){t(e),n&&n(e)}})}t.__esModule=!0,t["default"]=i;var o=n(280),a=r(o),s=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeSource(o)}var i=n.getRegistry(),o=i.addSource(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),p.forEach(function(t){l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return e.canDrag?e.canDrag(this.props,this.monitor):!0},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"](u["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrag","beginDrag","canDrag","isDragging","endDrag"],p=["beginDrag"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new u(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=!1,u=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){s["default"](!l,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{l=!1}},e.prototype.isDragging=function(){s["default"](!c,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return c=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{c=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dragSource:e.connectDragSource.bind(e),dragPreview:e.connectDragPreview.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return"string"==typeof e||"symbol"==typeof e||t&&a["default"](e)&&e.every(function(e){return i(e,!1)})}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(337),y=r(v),b=n(338),w=r(b),k=n(339),x=r(k),E=n(340),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeTarget(o)}var i=n.getRegistry(),o=i.addTarget(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return e.canDrop?e.canDrop(this.props,this.monitor):!0},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"]("undefined"==typeof t||u["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrop","hover","drop"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new c(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){s["default"](!l,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return l=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{l=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dropTarget:e.connectDropTarget.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return _||(_=new Image,_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),_}function l(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function c(e){var t=T[e],n=t.exposeProperty,r=t.matchesTypes,s=t.getData;return function(e){function t(){i(this,t),e.call(this),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return o(t,e),t.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=s(e,r)},t.prototype.beginDrag=function(){return this.item},t}(h.DragSource)}function u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(T).filter(function(e){var n=T[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}function d(e){return new S(e)}t.__esModule=!0;var p;t.getEmptyImage=s,t["default"]=d;var h=n(265),f=n(342),m=r(f),g=n(345),v=n(352),y=n(311),b=r(y),w=n(354),k=r(w),x=n(280),E=r(x),_=void 0,C={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__",TEXT:"__NATIVE_TEXT__"};t.NativeTypes=C;var T=(p={},a(p,C.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(p,C.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return l(e,t,"").split("\n")}}),a(p,C.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return l(e,t,"")}}),p),S=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new m["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this)}return e.prototype.setup=function(){"undefined"!=typeof window&&(E["default"](!this.constructor.isSetUp,"Cannot have two HTML5 backends at the same time."),this.constructor.isSetUp=!0,window.addEventListener("dragstart",this.handleTopDragStart),window.addEventListener("dragstart",this.handleTopDragStartCapture,!0),window.addEventListener("dragend",this.handleTopDragEndCapture,!0),window.addEventListener("dragenter",this.handleTopDragEnter),window.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.addEventListener("dragover",this.handleTopDragOver),window.addEventListener("dragover",this.handleTopDragOverCapture,!0),window.addEventListener("drop",this.handleTopDrop),window.addEventListener("drop",this.handleTopDropCapture,!0))},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,window.removeEventListener("dragstart",this.handleTopDragStart),window.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),window.removeEventListener("dragend",this.handleTopDragEndCapture,!0),window.removeEventListener("dragenter",this.handleTopDragEnter),window.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.removeEventListener("dragover",this.handleTopDragOver),window.removeEventListener("dragover",this.handleTopDragOverCapture,!0),window.removeEventListener("drop",this.handleTopDrop),window.removeEventListener("drop",this.handleTopDropCapture,!0),this.clearCurrentDragSourceNode())},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var i=function(t){return r.handleDragStart(t,e)},o=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return k["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return k["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return v.getElementClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(C).some(function(t){return C[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=c(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])},e.prototype.endDragNativeItem=function(){this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||(this.actions.endDrag(),this.clearCurrentDragSourceNode())},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=v.getElementClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return this.currentDragSourceNode?(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0):!1},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return e?this.currentDragSourceNodeOffsetChanged?!0:(this.currentDragSourceNodeOffsetChanged=!b["default"](v.getElementClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged):!1},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=v.getEventClientOffset(e);
39
- this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t);if(h&&h.data){var f="data:"+h.mimetype.string+";base64,"+h.data;e=e.replace(a,'src="'+f)}else o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
39
+ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t),f=void 0;h?(h.data?f="data:"+h.mimetype.string+";base64,"+h.data:h.url&&(f=h.url),e=e.replace(a,'src="'+f)):o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
40
40
  * jQuery JavaScript Library v2.1.4
41
41
  * http://jquery.com/
42
42
  *
@@ -61,8 +61,8 @@ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceC
61
61
  */
62
62
  function(e){function t(e,t,n,r){var i,o,a,s,l,c,d,h,f,m;if((t?t.ownerDocument||t:$)!==L&&R(t),t=t||L,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&N){if(11!==s&&(i=ye.exec(e)))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return J.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&k.getElementsByClassName)return J.apply(n,t.getElementsByClassName(a)),n}if(k.qsa&&(!M||!M.test(e))){if(h=d=j,f=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+p(c[l]);f=be.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return J.apply(n,f.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return S(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>x.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[j]=!0,e}function i(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)x.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[z,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[j]||(t[j]={}),(s=l[r])&&s[0]===z&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function f(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[j]&&(i=v(i)),o&&!o[j]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,p=[],h=[],f=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,p,e,s,l),b=n?o||(r?e:f||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?ee(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(f,b.length):b),o?o(null,a,b,l):J.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=x.relative[e[0].type],a=o||x.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),u=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];i>s;s++)if(n=x.relative[e[s].type])u=[h(f(u),n)];else{if(n=x.filter[e[s].type].apply(null,e[s].matches),n[j]){for(r=++s;i>r&&!x.relative[e[r].type];r++);return v(s>1&&f(u),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}u.push(n)}return f(u)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,c){var u,d,p,h=0,f="0",m=r&&[],v=[],y=A,b=r||o&&x.find.TAG("*",c),w=z+=null==y?1:Math.random()||.1,k=b.length;for(c&&(A=a!==L&&a);f!==k&&null!=(u=b[f]);f++){if(o&&u){for(d=0;p=e[d++];)if(p(u,a,s)){l.push(u);break}c&&(z=w)}i&&((u=!p&&u)&&h--,r&&m.push(u))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,v,a,s);if(r){if(h>0)for(;f--;)m[f]||v[f]||(v[f]=X.call(l));v=g(v)}J.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(l)}return c&&(z=w,A=y),m};return i?r(a):a}var w,k,x,E,_,C,T,S,A,F,D,R,L,O,N,M,I,B,P,j="sizzle"+1*new Date,$=e.document,z=0,W=0,V=n(),U=n(),H=n(),q=function(e,t){return e===t&&(D=!0),0},G=1<<31,K={}.hasOwnProperty,Y=[],X=Y.pop,Q=Y.push,J=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ce=new RegExp("^"+ne+"*,"+ne+"*"),ue=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(ae),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,we=/'|\\/g,ke=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ee=function(){R()};try{J.apply(Y=Z.call($.childNodes),$.childNodes),Y[$.childNodes.length].nodeType}catch(_e){J={apply:Y.length?function(e,t){Q.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}k=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},R=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:$;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,O=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),N=!_(r),k.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),k.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),k.getElementsByClassName=ve.test(r.getElementsByClassName),k.getById=i(function(e){return O.appendChild(e).id=j,!r.getElementsByName||!r.getElementsByName(j).length}),k.getById?(x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){return e.getAttribute("id")===t}}):(delete x.find.ID,x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),x.find.TAG=k.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):k.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},x.find.CLASS=k.getElementsByClassName&&function(e,t){return N?t.getElementsByClassName(e):void 0},I=[],M=[],(k.qsa=ve.test(r.querySelectorAll))&&(i(function(e){O.appendChild(e).innerHTML="<a id='"+j+"'></a><select id='"+j+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+j+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||M.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(k.matchesSelector=ve.test(B=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&i(function(e){k.disconnectedMatch=B.call(e,"div"),B.call(e,"[s!='']:x"),I.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),I=I.length&&new RegExp(I.join("|")),t=ve.test(O.compareDocumentPosition),P=t||ve.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!k.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===$&&P($,e)?-1:t===r||t.ownerDocument===$&&P($,t)?1:F?ee(F,e)-ee(F,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:F?ee(F,e)-ee(F,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===$?-1:c[i]===$?1:0},r):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&R(e),n=n.replace(de,"='$1']"),k.matchesSelector&&N&&(!I||!I.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||k.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&R(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&R(e);var n=x.attrHandle[t.toLowerCase()],r=n&&K.call(x.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:k.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!k.detectDuplicates,F=!k.sortStable&&e.slice(0),e.sort(q),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return F=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},x=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ke,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ke,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ke,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){for(u=g[j]||(g[j]={}),c=u[e]||[],h=c[0]===z&&c[1],p=c[0]===z&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(p=h=0)||f.pop();)if(1===d.nodeType&&++p&&d===t){u[e]=[z,h,p];break}}else if(y&&(c=(t[j]||(t[j]={}))[e])&&c[0]===z)p=c[1];else for(;(d=++h&&d&&d[m]||(p=h=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++p||(y&&((d[j]||(d[j]={}))[e]=[z,p]),d!==t)););return p-=i,p===r||p%r===0&&p/r>=0}}},PSEUDO:function(e,n){var i,o=x.pseudos[e]||x.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[j]?o(n):o.length>1?(i=[e,e,"",n],x.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=T(e.replace(le,"$1"));return i[j]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ke,xe),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ke,xe).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},x.pseudos.nth=x.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})x.pseudos[w]=l(w);return d.prototype=x.filters=x.pseudos,x.setFilters=new d,C=t.tokenize=function(e,n){var r,i,o,a,s,l,c,u=U[e+" "];if(u)return n?0:u.slice(0);for(s=e,l=[],c=x.preFilter;s;){(!r||(i=ce.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ue.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(a in x.filter)!(i=fe[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):U(e,l).slice(0)},T=t.compile=function(e,t){var n,r=[],i=[],o=H[e+" "];if(!o){for(t||(t=C(e)),n=t.length;n--;)o=y(t[n]),o[j]?r.push(o):i.push(o);o=H(e,b(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&C(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&k.getById&&9===t.nodeType&&N&&x.relative[o[1].type]){if(t=(x.find.ID(a.matches[0].replace(ke,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!x.relative[s=a.type]);)if((l=x.find[s])&&(r=l(a.matches[0].replace(ke,xe),be.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return J.apply(n,r),n;break}}return(c||T(e,d))(r,t,!N,n,be.test(e)&&u(t.parentNode)||t),n},k.sortStable=j.split("").sort(q).join("")===j,k.detectDuplicates=!!D,R(),k.sortDetached=i(function(e){return 1&e.compareDocumentPosition(L.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),k.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);re.find=le,re.expr=le.selectors,re.expr[":"]=re.expr.pseudos,re.unique=le.uniqueSort,re.text=le.getText,re.isXMLDoc=le.isXML,re.contains=le.contains;var ce=re.expr.match.needsContext,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;re.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?re.find.matchesSelector(r,e)?[r]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},re.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(re(e).filter(function(){for(t=0;n>t;t++)if(re.contains(i[t],this))return!0}));for(t=0;n>t;t++)re.find(e,i[t],r);return r=this.pushStack(n>1?re.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(s(this,e||[],!1))},not:function(e){return this.pushStack(s(this,e||[],!0))},is:function(e){return!!s(this,"string"==typeof e&&ce.test(e)?re(e):e||[],!1).length}});var pe,he=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,fe=re.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:he.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),ue.test(n[1])&&re.isPlainObject(t))for(n in t)re.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=te.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=te,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(re):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))};fe.prototype=re.fn,pe=re(te);var me=/^(?:parents|prev(?:Until|All))/,ge={children:!0,contents:!0,next:!0,prev:!0};re.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&re(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),re.fn.extend({has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(re.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?re(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&re.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?re.unique(o):o)},index:function(e){return e?"string"==typeof e?X.call(re(e),this[0]):X.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.unique(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,n){return re.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,n){return re.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return re.dir(e,"previousSibling",n)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return e.contentDocument||re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(n,r){var i=re.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=re.filter(r,i)),this.length>1&&(ge[e]||re.unique(i),me.test(e)&&i.reverse()),this.pushStack(i)}});var ve=/\S+/g,ye={};re.Callbacks=function(e){e="string"==typeof e?ye[e]||c(e):re.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(c){for(t=e.memory&&c,n=!0,a=i||0,i=0,o=s.length,r=!0;s&&o>a;a++)if(s[a].apply(c[0],c[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,s&&(l?l.length&&u(l.shift()):t?s=[]:d.disable())},d={add:function(){if(s){var n=s.length;!function a(t){re.each(t,function(t,n){var r=re.type(n);"function"===r?e.unique&&d.has(n)||s.push(n):n&&n.length&&"string"!==r&&a(n)})}(arguments),r?o=s.length:t&&(i=n,u(t))}return this},remove:function(){return s&&re.each(arguments,function(e,t){for(var n;(n=re.inArray(t,s,n))>-1;)s.splice(n,1),r&&(o>=n&&o--,a>=n&&a--)}),this},has:function(e){return e?re.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],o=0,this},disable:function(){return s=l=t=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,t||d.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!s||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],r?l.push(t):u(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(n){re.each(t,function(t,o){var a=re.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,r):r}},i={};return r.pipe=r.then,re.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=G.call(arguments),a=o.length,s=1!==a||e&&re.isFunction(e.promise)?a:0,l=1===s?e:re.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?G.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&re.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}});var be;re.fn.ready=function(e){return re.ready.promise().done(e),this},re.extend({isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){(e===!0?--re.readyWait:re.isReady)||(re.isReady=!0,e!==!0&&--re.readyWait>0||(be.resolveWith(te,[re]),re.fn.triggerHandler&&(re(te).triggerHandler("ready"),re(te).off("ready"))))}}),re.ready.promise=function(e){return be||(be=re.Deferred(),"complete"===te.readyState?setTimeout(re.ready):(te.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",u,!1))),be.promise(e)},re.ready.promise();var we=re.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===re.type(n)){i=!0;for(s in n)re.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,re.isFunction(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(re(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):o};re.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},d.uid=1,d.accepts=re.acceptData,d.prototype={key:function(e){if(!d.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=d.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,re.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(re.isEmptyObject(o))re.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,re.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),a=this.cache[o];if(void 0===t)this.cache[o]={};else{re.isArray(t)?r=t.concat(t.map(re.camelCase)):(i=re.camelCase(t),t in a?r=[t,i]:(r=i,r=r in a?[r]:r.match(ve)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(e){return!re.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ke=new d,xe=new d,Ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;re.extend({hasData:function(e){return xe.hasData(e)||ke.hasData(e)},data:function(e,t,n){return xe.access(e,t,n)},removeData:function(e,t){xe.remove(e,t)},_data:function(e,t,n){return ke.access(e,t,n)},_removeData:function(e,t){ke.remove(e,t)}}),re.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=xe.get(o),1===o.nodeType&&!ke.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=re.camelCase(r.slice(5)),p(o,r,i[r])));ke.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){xe.set(this,e)}):we(this,function(t){var n,r=re.camelCase(e);if(o&&void 0===t){if(n=xe.get(o,e),void 0!==n)return n;if(n=xe.get(o,r),void 0!==n)return n;if(n=p(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=xe.get(this,r);xe.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&xe.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){xe.remove(this,e)})}}),re.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ke.get(e,t),n&&(!r||re.isArray(n)?r=ke.access(e,t,re.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),r=n.length,i=n.shift(),o=re._queueHooks(e,t),a=function(){re.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ke.get(e,n)||ke.access(e,n,{empty:re.Callbacks("once memory").add(function(){ke.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?re.queue(this[0],e):void 0===t?this:this.each(function(){var n=re.queue(this,e,t);re._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=re.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ke.get(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Ce=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)},Ae=/^(?:checkbox|radio)$/i;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ee.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ee.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Fe="undefined";ee.focusinBubbles="onfocusin"in n;var De=/^key/,Re=/^(?:mouse|pointer|contextmenu)|click/,Le=/^(?:focusinfocus|focusoutblur)$/,Oe=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.get(e);if(g)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=re.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return typeof re!==Fe&&re.event.triggered!==t.type?re.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(ve)||[""],c=t.length;c--;)s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h&&(d=re.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=re.event.special[h]||{},u=re.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&re.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,f,a)!==!1||e.addEventListener&&e.addEventListener(h,a,!1)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),re.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.hasData(e)&&ke.get(e);if(g&&(l=g.events)){for(t=(t||"").match(ve)||[""],c=t.length;c--;)if(s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h){for(d=re.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,p=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)u=p[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||re.removeEvent(e,h,g.handle),delete l[h])}else for(h in l)re.event.remove(e,h+t[c],n,r,!0);re.isEmptyObject(l)&&(delete g.handle,ke.remove(e,"events"))}},trigger:function(e,t,r,i){var o,a,s,l,c,u,d,p=[r||te],h=Z.call(e,"type")?e.type:e,f=Z.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!Le.test(h+re.event.triggered)&&(h.indexOf(".")>=0&&(f=h.split("."),h=f.shift(),f.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[re.expando]?e:new re.Event(h,"object"==typeof e&&e),
63
63
  e.isTrigger=i?2:3,e.namespace=f.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:re.makeArray(t,[e]),d=re.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!re.isWindow(r)){for(l=d.delegateType||h,Le.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||te)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)e.type=o>1?l:d.bindType||h,u=(ke.get(a,"events")||{})[e.type]&&ke.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&re.acceptData(a)&&(e.result=u.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),t)!==!1||!re.acceptData(r)||c&&re.isFunction(r[h])&&!re.isWindow(r)&&(s=r[c],s&&(r[c]=null),re.event.triggered=h,r[h](),re.event.triggered=void 0,s&&(r[c]=s)),e.result}},dispatch:function(e){e=re.event.fix(e);var t,n,r,i,o,a=[],s=G.call(arguments),l=(ke.get(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(a=re.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((re.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)o=t[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?re(i,this).index(l)>=0:re.find(i,this,null,[l]).length),r[i]&&r.push(o);r.length&&a.push({elem:l,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||te,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[re.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Re.test(i)?this.mouseHooks:De.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new re.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=te),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&re.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=re.extend(new re.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?re.event.trigger(i,null,t):re.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},re.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},re.Event=function(e,t){return this instanceof re.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:f):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),void(this[re.expando]=!0)):new re.Event(e,t)},re.Event.prototype={isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!re.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ee.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ke.access(r,t);i||r.addEventListener(e,n,!0),ke.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ke.access(r,t)-1;i?ke.access(r,t,i):(r.removeEventListener(e,n,!0),ke.remove(r,t))}}}),re.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(a in e)this.on(a,t,n,e[a],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=f;else if(!r)return this;return 1===i&&(o=r,r=function(e){return re().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=re.guid++)),this.each(function(){re.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,re(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=f),this.each(function(){re.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?re.event.trigger(e,t,n,!0):void 0}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Me=/<([\w:]+)/,Ie=/<|&#?\w+;/,Be=/<(?:script|style|link)/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,We={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};We.optgroup=We.option,We.tbody=We.tfoot=We.colgroup=We.caption=We.thead,We.th=We.td,re.extend({clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=re.contains(e.ownerDocument,e);if(!(ee.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(a=k(s),o=k(e),r=0,i=o.length;i>r;r++)x(o[r],a[r]);if(t)if(n)for(o=o||k(e),a=a||k(s),r=0,i=o.length;i>r;r++)w(o[r],a[r]);else w(e,s);return a=k(s,"script"),a.length>0&&b(a,!l&&k(e,"script")),s},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,c,u=t.createDocumentFragment(),d=[],p=0,h=e.length;h>p;p++)if(i=e[p],i||0===i)if("object"===re.type(i))re.merge(d,i.nodeType?[i]:i);else if(Ie.test(i)){for(o=o||u.appendChild(t.createElement("div")),a=(Me.exec(i)||["",""])[1].toLowerCase(),s=We[a]||We._default,o.innerHTML=s[1]+i.replace(Ne,"<$1></$2>")+s[2],c=s[0];c--;)o=o.lastChild;re.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(t.createTextNode(i));for(u.textContent="",p=0;i=d[p++];)if((!r||-1===re.inArray(i,r))&&(l=re.contains(i.ownerDocument,i),o=k(u.appendChild(i),"script"),l&&b(o),n))for(c=0;i=o[c++];)je.test(i.type||"")&&n.push(i);return u},cleanData:function(e){for(var t,n,r,i,o=re.event.special,a=0;void 0!==(n=e[a]);a++){if(re.acceptData(n)&&(i=n[ke.expando],i&&(t=ke.cache[i]))){if(t.events)for(r in t.events)o[r]?re.event.remove(n,r):re.removeEvent(n,r,t.handle);ke.cache[i]&&delete ke.cache[i]}delete xe.cache[n[xe.expando]]}}}),re.fn.extend({text:function(e){return we(this,function(e){return void 0===e?re.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?re.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||re.cleanData(k(n)),n.parentNode&&(t&&re.contains(n.ownerDocument,n)&&b(k(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(k(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return we(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!We[(Me.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ne,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(re.cleanData(k(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,re.cleanData(k(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=K.apply([],e);var n,r,i,o,a,s,l=0,c=this.length,u=this,d=c-1,p=e[0],h=re.isFunction(p);if(h||c>1&&"string"==typeof p&&!ee.checkClone&&Pe.test(p))return this.each(function(n){var r=u.eq(n);h&&(e[0]=p.call(this,n,r.html())),r.domManip(e,t)});if(c&&(n=re.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=re.map(k(n,"script"),v),o=i.length;c>l;l++)a=n,l!==d&&(a=re.clone(a,!0,!0),o&&re.merge(i,k(a,"script"))),t.call(this[l],a,l);if(o)for(s=i[i.length-1].ownerDocument,re.map(i,y),l=0;o>l;l++)a=i[l],je.test(a.type||"")&&!ke.access(a,"globalEval")&&re.contains(s,a)&&(a.src?re._evalUrl&&re._evalUrl(a.src):re.globalEval(a.textContent.replace(ze,"")))}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var n,r=[],i=re(e),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),re(i[a])[t](n),Y.apply(r,n.get());return this.pushStack(r)}});var Ve,Ue={},He=/^margin/,qe=new RegExp("^("+Ce+")(?!px)[a-z%]+$","i"),Ge=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):n.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=n.getComputedStyle(a,null);t="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var t,r,i=te.documentElement,o=te.createElement("div"),a=te.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ee.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),n.getComputedStyle&&re.extend(ee,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,t=a.appendChild(te.createElement("div"));return t.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(n.getComputedStyle(t,null).marginRight),i.removeChild(o),a.removeChild(t),e}}))}(),re.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+Ce+")(.*)$","i"),Xe=new RegExp("^([+-])=("+Ce+")","i"),Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"},Ze=["Webkit","O","Moz","ms"];re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=C(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=re.camelCase(t),l=e.style;return t=re.cssProps[s]||(re.cssProps[s]=S(l,s)),a=re.cssHooks[t]||re.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t]:(o=typeof n,"string"===o&&(i=Xe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(re.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||re.cssNumber[s]||(n+="px"),ee.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=re.camelCase(t);return t=re.cssProps[s]||(re.cssProps[s]=S(e.style,s)),a=re.cssHooks[t]||re.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=C(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),n===!0||re.isNumeric(o)?o||0:i):i}}),re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,n,r){return n?Ke.test(re.css(e,"display"))&&0===e.offsetWidth?re.swap(e,Qe,function(){return D(e,t,r)}):D(e,t,r):void 0},set:function(e,n,r){var i=r&&Ge(e);return A(e,n,r?F(e,t,r,"border-box"===re.css(e,"boxSizing",!1,i),i):0)}}}),re.cssHooks.marginRight=T(ee.reliableMarginRight,function(e,t){return t?re.swap(e,{display:"inline-block"},C,[e,"marginRight"]):void 0}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Te[r]+t]=o[r]||o[r-2]||o[0];return i}},He.test(e)||(re.cssHooks[e+t].set=A)}),re.fn.extend({css:function(e,t){return we(this,function(e,t,n){var r,i,o={},a=0;if(re.isArray(t)){for(r=Ge(e),i=t.length;i>a;a++)o[t[a]]=re.css(e,t[a],!1,r);return o}return void 0!==n?re.style(e,t,n):re.css(e,t)},e,t,arguments.length>1)},show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?re(this).show():re(this).hide()})}}),re.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(re.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.fx=L.prototype.init,re.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=new RegExp("^(?:([+-])=|)("+Ce+")([a-z%]*)$","i"),it=/queueHooks$/,ot=[I],at={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rt.exec(t),o=i&&i[3]||(re.cssNumber[e]?"":"px"),a=(re.cssNumber[e]||"px"!==o&&+r)&&rt.exec(re.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,re.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};re.Animation=re.extend(P,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],at[n]=at[n]||[],at[n].unshift(t)},prefilter:function(e,t){t?ot.unshift(e):ot.push(e)}}),re.speed=function(e,t,n){var r=e&&"object"==typeof e?re.extend({},e):{complete:n||!n&&t||re.isFunction(e)&&e,duration:e,easing:n&&t||t&&!re.isFunction(t)&&t};return r.duration=re.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in re.fx.speeds?re.fx.speeds[r.duration]:re.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){re.isFunction(r.old)&&r.old.call(this),r.queue&&re.dequeue(this,r.queue)},r},re.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=re.isEmptyObject(e),o=re.speed(t,n,r),a=function(){var t=P(this,re.extend({},e),o);(i||ke.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=re.timers,a=ke.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&it.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&re.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ke.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=re.timers,a=r?r.length:0;for(n.finish=!0,re.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),re.each(["toggle","show","hide"],function(e,t){var n=re.fn[t];re.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,r,i)}}),re.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),re.timers=[],re.fx.tick=function(){var e,t=0,n=re.timers;for(et=re.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||re.fx.stop(),et=void 0},re.fx.timer=function(e){re.timers.push(e),e()?re.fx.start():re.timers.pop()},re.fx.interval=13,re.fx.start=function(){tt||(tt=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(tt),tt=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fn.delay=function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=te.createElement("input"),t=te.createElement("select"),n=t.appendChild(te.createElement("option"));e.type="checkbox",ee.checkOn=""!==e.value,ee.optSelected=n.selected,t.disabled=!0,ee.optDisabled=!n.disabled,e=te.createElement("input"),e.value="t",e.type="radio",ee.radioValue="t"===e.value}();var st,lt,ct=re.expr.attrHandle;re.fn.extend({attr:function(e,t){return we(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Fe?re.prop(e,t,n):(1===o&&re.isXMLDoc(e)||(t=t.toLowerCase(),r=re.attrHooks[t]||(re.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=re.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void re.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ve);if(o&&1===e.nodeType)for(;n=o[i++];)r=re.propFix[n]||n,re.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!ee.radioValue&&"radio"===t&&re.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return t===!1?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||re.find.attr;ct[t]=function(e,t,r){var i,o;return r||(o=ct[t],ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ct[t]=o),i}});var ut=/^(?:input|select|textarea|button)$/i;re.fn.extend({prop:function(e,t){return we(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})}}),re.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!re.isXMLDoc(e),o&&(t=re.propFix[t]||t,i=re.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||ut.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),ee.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this});var dt=/[\t\r\n\f]/g;re.fn.extend({addClass:function(e){var t,n,r,i,o,a,s="string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=re.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0===arguments.length||"string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?re.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=re(this),o=e.match(ve)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Fe||"boolean"===n)&&(this.className&&ke.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ke.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(dt," ").indexOf(t)>=0)return!0;return!1}});var pt=/\r/g;re.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,re(this).val()):e,null==i?i="":"number"==typeof i?i+="":re.isArray(i)&&(i=re.map(i,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=re.valHooks[i.type]||re.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(pt,""):null==n?"":n)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:re.trim(re.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],(n.selected||l===i)&&(ee.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!re.nodeName(n.parentNode,"optgroup"))){if(t=re(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=re.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=re.inArray(r.value,o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){return re.isArray(t)?e.checked=re.inArray(re(e).val(),t)>=0:void 0}},ee.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ht=re.now(),ft=/\?/;re.parseJSON=function(e){return JSON.parse(e+"")},re.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&re.error("Invalid XML: "+e),t};var mt=/#.*$/,gt=/([?&])_=[^&]*/,vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,yt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,bt=/^(?:GET|HEAD)$/,wt=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,xt={},Et={},_t="*/".concat("*"),Ct=n.location.href,Tt=kt.exec(Ct.toLowerCase())||[];re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct,type:"GET",isLocal:yt.test(Tt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,re.ajaxSettings),t):z(re.ajaxSettings,e)},ajaxPrefilter:j(xt),ajaxTransport:j(Et),ajax:function(e,t){function n(e,t,n,a){var l,u,v,y,w,x=t;2!==b&&(b=2,s&&clearTimeout(s),r=void 0,o=a||"",k.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(y=W(d,k,n)),y=V(d,y,k,l),l?(d.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(re.lastModified[i]=w),w=k.getResponseHeader("etag"),w&&(re.etag[i]=w)),204===e||"HEAD"===d.type?x="nocontent":304===e?x="notmodified":(x=y.state,u=y.data,v=y.error,l=!v)):(v=x,(e||!x)&&(x="error",0>e&&(e=0))),k.status=e,k.statusText=(t||x)+"",l?f.resolveWith(p,[u,x,k]):f.rejectWith(p,[k,x,v]),k.statusCode(g),g=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[k,d,l?u:v]),m.fireWith(p,[k,x]),c&&(h.trigger("ajaxComplete",[k,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,c,u,d=re.ajaxSetup({},t),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?re(p):re.event,f=re.Deferred(),m=re.Callbacks("once memory"),g=d.statusCode||{},v={},y={},b=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=vt.exec(o);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(f.promise(k).complete=m.add,k.success=k.done,k.error=k.fail,d.url=((e||d.url||Ct)+"").replace(mt,"").replace(wt,Tt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(ve)||[""],null==d.crossDomain&&(l=kt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Tt[1]&&l[2]===Tt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Tt[3]||("http:"===Tt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),$(xt,d,t,k),2===b)return k;c=re.event&&d.global,c&&0===re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!bt.test(d.type),i=d.url,d.hasContent||(d.data&&(i=d.url+=(ft.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=gt.test(i)?i.replace(gt,"$1_="+ht++):i+(ft.test(i)?"&":"?")+"_="+ht++)),d.ifModified&&(re.lastModified[i]&&k.setRequestHeader("If-Modified-Since",re.lastModified[i]),re.etag[i]&&k.setRequestHeader("If-None-Match",re.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&k.setRequestHeader("Content-Type",d.contentType),k.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)k.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(p,k,d)===!1||2===b))return k.abort();w="abort";for(u in{success:1,error:1,complete:1})k[u](d[u]);if(r=$(Et,d,t,k)){k.readyState=1,c&&h.trigger("ajaxSend",[k,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){k.abort("timeout")},d.timeout));try{b=1,r.send(v,n)}catch(x){if(!(2>b))throw x;n(-1,x)}}else n(-1,"No Transport");return k},getJSON:function(e,t,n){return re.get(e,t,n,"json")},getScript:function(e,t){return re.get(e,void 0,t,"script")}}),re.each(["get","post"],function(e,t){re[t]=function(e,n,r,i){return re.isFunction(n)&&(i=i||r,r=n,n=void 0),re.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),re._evalUrl=function(e){return re.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},re.fn.extend({wrapAll:function(e){var t;return re.isFunction(e)?this.each(function(t){re(this).wrapAll(e.call(this,t))}):(this[0]&&(t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e);
64
- })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e&&e.data?"data:"+e.mimetype.string+";base64,"+e.data:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();
65
- return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
64
+ })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e?e.data?"data:"+e.mimetype.string+";base64,"+e.data:e.url?e.url:null:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":
65
+ for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
66
66
  * async
67
67
  * https://github.com/caolan/async
68
68
  *
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(368);n(387);var a=n(2),s=function(){},l=[{filename:"my-first-markuapad-book/book.txt",content:"chapter1.txt\nchapter2.txt"},{filename:"my-first-markuapad-book/manifest_files/chapter1.txt",in_sample:!1,content:"# Chapter 1\n\nHere is the first chapter"},{filename:"my-first-markuapad-book/manifest_files/chapter2.txt",in_sample:!1,content:"# Chapter 2\n\nHere is the second chapter"},{filename:"my-first-markuapad-book/manifest_code/sample.js",content:"function() {\n console.log('Hello, World!');\n}\n"}],c=[{filename:"my-first-markuapad-book/manifest_files",files:[{filename:"chapter1.txt"},{filename:"chapter2.txt"}]},{filename:"my-first-markuapad-book/manifest_code",files:[{filename:"sample.js"}]},{filename:"my-first-markuapad-book/manifest_images",files:[]}];if(!o.getCached("my-first-markuapad-book/manifest_files")){var u=!0,d=!1,p=void 0;try{for(var h,f=l[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var m=h.value,g=m.filename;m.filename=m.filename.substr(m.filename.lastIndexOf("/")+1),o.setCached(g,m)}}catch(v){d=!0,p=v}finally{try{!u&&f["return"]&&f["return"]()}finally{if(d)throw p}}var y=!0,b=!1,k=void 0;try{for(var w,x=c[Symbol.iterator]();!(y=(w=x.next()).done);y=!0){var m=w.value;o.setCached(m.filename,m.files)}}catch(v){b=!0,k=v}finally{try{!y&&x["return"]&&x["return"]()}finally{if(b)throw k}}}var E=function(){function e(t){r(this,e),this.projectRoot=t,this.onAddCallbacks=[],this.onDeleteCallbacks=[],this.onManuscriptChangeCallbacks=[],this.onProgressStartedCallbacks=[],this.onProgressCallbacks=[],this.onMergeConflictCallback=null,this.manifestFilesKey=this.projectRoot+"/manifest_files",this.manifestCodeKey=this.projectRoot+"/manifest_code",this.manifestImagesKey=this.projectRoot+"/manifest_images",this.supportsImageUploads=!0}return i(e,[{key:"getFilePrefix",value:function(e){return"manuscript"===e?this.manifestFilesKey:"code"===e?this.manifestCodeKey:"image"===e?this.manifestImagesKey:this.projectRoot}},{key:"get",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1],n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=o.getCached(this.getFilePrefix(n)+"/"+e);t(null,r&&r.content)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=o.getCached(this.getFilePrefix(t)+"/"+e);return n&&n.content}},{key:"listFiles",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestFilesKey),function(e){return a.extend(e,{type:"manuscript"})});e(null,t)}},{key:"listImages",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestImagesKey),function(e){return a.extend(e,{type:"image"})});e(null,t?a.map(t,function(e){return a.omit(e,"content")}):[])}},{key:"listCode",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestCodeKey),function(e){return a.extend(e,{type:"code"})});e(null,t?a.map(t,function(e){return a.omit(e,"content")}):[])}},{key:"save",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],r=arguments.length<=3||void 0===arguments[3]?s:arguments[3],i=this.getFilePrefix(t)+"/"+e,a=o.getCached(i);a.content=n,o.setCached(i,a),r(null)}},{key:"saveManuscript",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1];o.setCached(this.manifestFilesKey,e),o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(e,function(e){return e.filename}).join("\n")});var n=!0,r=!1,i=void 0;try{for(var l,c=this.onManuscriptChangeCallbacks[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var u=l.value;u(null)}}catch(d){r=!0,i=d}finally{try{!n&&c["return"]&&c["return"]()}finally{if(r)throw i}}t(null)}},{key:"newImage",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1];t("Images uploads don't work on markuapad.com")}},{key:"new",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],r=arguments.length<=3||void 0===arguments[3]?s:arguments[3],i={filename:e,content:n,type:t},l=this.getFilePrefix(t)+"/"+e,c="manuscript"===t?this.manifestFilesKey:this.manifestCodeKey,u=o.getCached(c).concat([a.omit(i,"content")]);o.setCached(l,i),o.setCached(c,u),"manuscript"===t&&o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(u,function(e){return e.filename}).join("\n")}),r(null,i);var d=!0,p=!1,h=void 0;try{for(var f,m=this.onAddCallbacks[Symbol.iterator]();!(d=(f=m.next()).done);d=!0){var g=f.value;g(i)}}catch(v){p=!0,h=v}finally{try{!d&&m["return"]&&m["return"]()}finally{if(p)throw h}}}},{key:"delete",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?s:arguments[2],r=void 0;r="manuscript"===t?this.manifestFilesKey:"image"===t?this.manifestImagesKey:this.manifestCodeKey;var i=o.getCached(r),l=this.getFilePrefix(t)+"/"+e;localStorage.removeItem(l),i=a.reject(i,function(t){return t.filename===e}),o.setCached(r,i),"manuscript"===t&&o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(i,function(e){return e.filename}).join("\n")}),n(null);var c=!0,u=!1,d=void 0;try{for(var p,h=this.onDeleteCallbacks[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var f=p.value;f(e)}}catch(m){u=!0,d=m}finally{try{!c&&h["return"]&&h["return"]()}finally{if(u)throw d}}}},{key:"setCursor",value:function(e,t){o.setCached("markuapad_cursor",{filename:e,position:t})}},{key:"onAdd",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onAddCallbacks.push(e)}},{key:"onDelete",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onDeleteCallbacks.push(e)}},{key:"onManuscriptChange",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onManuscriptChangeCallbacks.push(e)}},{key:"onProgress",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onProgressCallbacks.push(e)}},{key:"onProgressStarted",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onProgressStartedCallbacks.push(e)}},{key:"onMergeConflicts",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onMergeConflictCallback=e}}]),e}();window.ExampleFileAccessor=E},2:function(e,t,n){var r,i;(function(){function n(e){function t(t,n,r,i,o,a){for(;o>=0&&a>o;o+=e){var s=i?i[o]:o;r=n(r,t[s],s,t)}return r}return function(n,r,i,o){r=E(r,o,4);var a=!D(n)&&x.keys(n),s=(a||n).length,l=e>0?0:s-1;return arguments.length<3&&(i=n[a?a[l]:l],l+=e),t(n,r,i,a,l,s)}}function o(e){return function(t,n,r){n=_(n,r);for(var i=F(t),o=e>0?0:i-1;o>=0&&i>o;o+=e)if(n(t[o],o,t))return o;return-1}}function a(e,t,n){return function(r,i,o){var a=0,s=F(r);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=t(f.call(r,a,s),x.isNaN),o>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&s>o;o+=e)if(r[o]===i)return o;return-1}}function s(e,t){var n=M.length,r=e.constructor,i=x.isFunction(r)&&r.prototype||d,o="constructor";for(x.has(e,o)&&!x.contains(t,o)&&t.push(o);n--;)o=M[n],o in e&&e[o]!==i[o]&&!x.contains(t,o)&&t.push(o)}var l=this,c=l._,u=Array.prototype,d=Object.prototype,p=Function.prototype,h=u.push,f=u.slice,m=d.toString,g=d.hasOwnProperty,v=Array.isArray,y=Object.keys,b=p.bind,k=Object.create,w=function(){},x=function(e){return e instanceof x?e:this instanceof x?void(this._wrapped=e):new x(e)};"undefined"!=typeof e&&e.exports&&(t=e.exports=x),t._=x,x.VERSION="1.8.3";var E=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},_=function(e,t,n){return null==e?x.identity:x.isFunction(e)?E(e,t,n):x.isObject(e)?x.matcher(e):x.property(e)};x.iteratee=function(e,t){return _(e,t,1/0)};var C=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var o=arguments[i],a=e(o),s=a.length,l=0;s>l;l++){var c=a[l];t&&void 0!==n[c]||(n[c]=o[c])}return n}},T=function(e){if(!x.isObject(e))return{};if(k)return k(e);w.prototype=e;var t=new w;return w.prototype=null,t},S=function(e){return function(t){return null==t?void 0:t[e]}},A=Math.pow(2,53)-1,F=S("length"),D=function(e){var t=F(e);return"number"==typeof t&&t>=0&&A>=t};x.each=x.forEach=function(e,t,n){t=E(t,n);var r,i;if(D(e))for(r=0,i=e.length;i>r;r++)t(e[r],r,e);else{var o=x.keys(e);for(r=0,i=o.length;i>r;r++)t(e[o[r]],o[r],e)}return e},x.map=x.collect=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=Array(i),a=0;i>a;a++){var s=r?r[a]:a;o[a]=t(e[s],s,e)}return o},x.reduce=x.foldl=x.inject=n(1),x.reduceRight=x.foldr=n(-1),x.find=x.detect=function(e,t,n){var r;return r=D(e)?x.findIndex(e,t,n):x.findKey(e,t,n),void 0!==r&&-1!==r?e[r]:void 0},x.filter=x.select=function(e,t,n){var r=[];return t=_(t,n),x.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},x.reject=function(e,t,n){return x.filter(e,x.negate(_(t)),n)},x.every=x.all=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=0;i>o;o++){var a=r?r[o]:o;if(!t(e[a],a,e))return!1}return!0},x.some=x.any=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=0;i>o;o++){var a=r?r[o]:o;if(t(e[a],a,e))return!0}return!1},x.contains=x.includes=x.include=function(e,t,n,r){return D(e)||(e=x.values(e)),("number"!=typeof n||r)&&(n=0),x.indexOf(e,t,n)>=0},x.invoke=function(e,t){var n=f.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){var i=r?t:e[t];return null==i?i:i.apply(e,n)})},x.pluck=function(e,t){return x.map(e,x.property(t))},x.where=function(e,t){return x.filter(e,x.matcher(t))},x.findWhere=function(e,t){return x.find(e,x.matcher(t))},x.max=function(e,t,n){var r,i,o=-(1/0),a=-(1/0);if(null==t&&null!=e){e=D(e)?e:x.values(e);for(var s=0,l=e.length;l>s;s++)r=e[s],r>o&&(o=r)}else t=_(t,n),x.each(e,function(e,n,r){i=t(e,n,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=e,a=i)});return o},x.min=function(e,t,n){var r,i,o=1/0,a=1/0;if(null==t&&null!=e){e=D(e)?e:x.values(e);for(var s=0,l=e.length;l>s;s++)r=e[s],o>r&&(o=r)}else t=_(t,n),x.each(e,function(e,n,r){i=t(e,n,r),(a>i||i===1/0&&o===1/0)&&(o=e,a=i)});return o},x.shuffle=function(e){for(var t,n=D(e)?e:x.values(e),r=n.length,i=Array(r),o=0;r>o;o++)t=x.random(0,o),t!==o&&(i[o]=i[t]),i[t]=n[o];return i},x.sample=function(e,t,n){return null==t||n?(D(e)||(e=x.values(e)),e[x.random(e.length-1)]):x.shuffle(e).slice(0,Math.max(0,t))},x.sortBy=function(e,t,n){return t=_(t,n),x.pluck(x.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return e.index-t.index}),"value")};var R=function(e){return function(t,n,r){var i={};return n=_(n,r),x.each(t,function(r,o){var a=n(r,o,t);e(i,r,a)}),i}};x.groupBy=R(function(e,t,n){x.has(e,n)?e[n].push(t):e[n]=[t]}),x.indexBy=R(function(e,t,n){e[n]=t}),x.countBy=R(function(e,t,n){x.has(e,n)?e[n]++:e[n]=1}),x.toArray=function(e){return e?x.isArray(e)?f.call(e):D(e)?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return null==e?0:D(e)?e.length:x.keys(e).length},x.partition=function(e,t,n){t=_(t,n);var r=[],i=[];return x.each(e,function(e,n,o){(t(e,n,o)?r:i).push(e)}),[r,i]},x.first=x.head=x.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:x.initial(e,e.length-t)},x.initial=function(e,t,n){return f.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},x.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:x.rest(e,Math.max(0,e.length-t))},x.rest=x.tail=x.drop=function(e,t,n){return f.call(e,null==t||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var L=function(e,t,n,r){for(var i=[],o=0,a=r||0,s=F(e);s>a;a++){var l=e[a];if(D(l)&&(x.isArray(l)||x.isArguments(l))){t||(l=L(l,t,n));var c=0,u=l.length;for(i.length+=u;u>c;)i[o++]=l[c++]}else n||(i[o++]=l)}return i};x.flatten=function(e,t){return L(e,t,!1)},x.without=function(e){return x.difference(e,f.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=_(n,r));for(var i=[],o=[],a=0,s=F(e);s>a;a++){var l=e[a],c=n?n(l,a,e):l;t?(a&&o===c||i.push(l),o=c):n?x.contains(o,c)||(o.push(c),i.push(l)):x.contains(i,l)||i.push(l)}return i},x.union=function(){return x.uniq(L(arguments,!0,!0))},x.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=F(e);i>r;r++){var o=e[r];if(!x.contains(t,o)){for(var a=1;n>a&&x.contains(arguments[a],o);a++);a===n&&t.push(o)}}return t},x.difference=function(e){var t=L(arguments,!0,!0,1);return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){return x.unzip(arguments)},x.unzip=function(e){for(var t=e&&x.max(e,F).length||0,n=Array(t),r=0;t>r;r++)n[r]=x.pluck(e,r);return n},x.object=function(e,t){for(var n={},r=0,i=F(e);i>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.findIndex=o(1),x.findLastIndex=o(-1),x.sortedIndex=function(e,t,n,r){n=_(n,r,1);for(var i=n(t),o=0,a=F(e);a>o;){var s=Math.floor((o+a)/2);n(e[s])<i?o=s+1:a=s}return o},x.indexOf=a(1,x.findIndex,x.sortedIndex),x.lastIndexOf=a(-1,x.findLastIndex),x.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;r>o;o++,e+=n)i[o]=e;return i};var O=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=T(e.prototype),a=e.apply(o,i);return x.isObject(a)?a:o};x.bind=function(e,t){if(b&&e.bind===b)return b.apply(e,f.call(arguments,1));if(!x.isFunction(e))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return O(e,r,t,this,n.concat(f.call(arguments)))};return r},x.partial=function(e){var t=f.call(arguments,1),n=function(){for(var r=0,i=t.length,o=Array(i),a=0;i>a;a++)o[a]=t[a]===x?arguments[r++]:t[a];for(;r<arguments.length;)o.push(arguments[r++]);return O(e,n,this,this,o)};return n},x.bindAll=function(e){var t,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=x.bind(e[n],e);return e},x.memoize=function(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return x.has(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n},x.delay=function(e,t){var n=f.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=x.partial(x.delay,x,1),x.throttle=function(e,t,n){var r,i,o,a=null,s=0;n||(n={});var l=function(){s=n.leading===!1?0:x.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var c=x.now();s||n.leading!==!1||(s=c);var u=t-(c-s);return r=this,i=arguments,0>=u||u>t?(a&&(clearTimeout(a),a=null),s=c,o=e.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(l,u)),o}},x.debounce=function(e,t,n){var r,i,o,a,s,l=function(){var c=x.now()-a;t>c&&c>=0?r=setTimeout(l,t-c):(r=null,n||(s=e.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=x.now();var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(s=e.apply(o,i),o=i=null),s}},x.wrap=function(e,t){return x.partial(t,e)},x.negate=function(e){return function(){return!e.apply(this,arguments)}},x.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},x.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},x.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},x.once=x.partial(x.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];x.keys=function(e){if(!x.isObject(e))return[];if(y)return y(e);var t=[];for(var n in e)x.has(e,n)&&t.push(n);return N&&s(e,t),t},x.allKeys=function(e){if(!x.isObject(e))return[];var t=[];for(var n in e)t.push(n);return N&&s(e,t),t},x.values=function(e){for(var t=x.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=e[t[i]];return r},x.mapObject=function(e,t,n){t=_(t,n);for(var r,i=x.keys(e),o=i.length,a={},s=0;o>s;s++)r=i[s],a[r]=t(e[r],r,e);return a},x.pairs=function(e){for(var t=x.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=[t[i],e[t[i]]];return r},x.invert=function(e){for(var t={},n=x.keys(e),r=0,i=n.length;i>r;r++)t[e[n[r]]]=n[r];return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=C(x.allKeys),x.extendOwn=x.assign=C(x.keys),x.findKey=function(e,t,n){t=_(t,n);for(var r,i=x.keys(e),o=0,a=i.length;a>o;o++)if(r=i[o],t(e[r],r,e))return r},x.pick=function(e,t,n){var r,i,o={},a=e;if(null==a)return o;x.isFunction(t)?(i=x.allKeys(a),r=E(t,n)):(i=L(arguments,!1,!1,1),r=function(e,t,n){return t in n},a=Object(a));for(var s=0,l=i.length;l>s;s++){var c=i[s],u=a[c];r(u,c,a)&&(o[c]=u)}return o},x.omit=function(e,t,n){if(x.isFunction(t))t=x.negate(t);else{var r=x.map(L(arguments,!1,!1,1),String);t=function(e,t){return!x.contains(r,t)}}return x.pick(e,t,n)},x.defaults=C(x.allKeys,!0),x.create=function(e,t){var n=T(e);return t&&x.extendOwn(n,t),n},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e},x.isMatch=function(e,t){var n=x.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;r>o;o++){var a=n[o];if(t[a]!==i[a]||!(a in i))return!1}return!0};var I=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=m.call(e);if(i!==m.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var l=n.length;l--;)if(n[l]===e)return r[l]===t;if(n.push(e),r.push(t),o){if(l=e.length,l!==t.length)return!1;for(;l--;)if(!I(e[l],t[l],n,r))return!1}else{var c,u=x.keys(e);if(l=u.length,x.keys(t).length!==l)return!1;for(;l--;)if(c=u[l],!x.has(t,c)||!I(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0};x.isEqual=function(e,t){return I(e,t)},x.isEmpty=function(e){return null==e?!0:D(e)&&(x.isArray(e)||x.isString(e)||x.isArguments(e))?0===e.length:0===x.keys(e).length},x.isElement=function(e){return!(!e||1!==e.nodeType)},x.isArray=v||function(e){return"[object Array]"===m.call(e)},x.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},x.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){x["is"+e]=function(t){return m.call(t)==="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return x.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(x.isFunction=function(e){return"function"==typeof e||!1}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!==+e},x.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===m.call(e)},x.isNull=function(e){return null===e},x.isUndefined=function(e){return void 0===e},x.has=function(e,t){return null!=e&&g.call(e,t)},x.noConflict=function(){return l._=c,this},x.identity=function(e){return e},x.constant=function(e){return function(){return e}},x.noop=function(){},x.property=S,x.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},x.matcher=x.matches=function(e){return e=x.extendOwn({},e),function(t){return x.isMatch(t,e)}},x.times=function(e,t,n){var r=Array(Math.max(0,e));t=E(t,n,1);for(var i=0;e>i;i++)r[i]=t(i);return r},x.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},x.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},P=x.invert(B),j=function(e){var t=function(t){return e[t]},n="(?:"+x.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};x.escape=j(B),x.unescape=j(P),x.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),x.isFunction(r)?r.call(e):r};var $=0;x.uniqueId=function(e){var t=++$+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,W={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(e){return"\\"+W[e]};x.template=function(e,t,n){!t&&n&&(t=n),t=x.defaults({},t,x.templateSettings);var r=RegExp([(t.escape||z).source,(t.interpolate||z).source,(t.evaluate||z).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,a,s){return o+=e.slice(i,s).replace(U,V),i=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(s){throw s.source=o,s}var l=function(e){return a.call(this,e,x)},c=t.variable||"obj";return l.source="function("+c+"){\n"+o+"}",l},x.chain=function(e){var t=x(e);return t._chain=!0,t};var H=function(e,t){return e._chain?x(t).chain():t};x.mixin=function(e){x.each(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return h.apply(e,arguments),H(this,n.apply(x,e))}})},x.mixin(x),x.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=u[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],H(this,n)}}),x.each(["concat","join","slice"],function(e){var t=u[e];x.prototype[e]=function(){return H(this,t.apply(this._wrapped,arguments))}}),x.prototype.value=function(){return this._wrapped},x.prototype.valueOf=x.prototype.toJSON=x.prototype.value,x.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return x}.apply(t,r),!(void 0!==i&&(e.exports=i))}).call(this)},238:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},368:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t);if(h&&h.data){var f="data:"+h.mimetype.string+";base64,"+h.data;e=e.replace(a,'src="'+f)}else o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},387:function(e,t){}});
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(368);n(387);var a=n(2),s=function(){},l=[{filename:"my-first-markuapad-book/book.txt",content:"chapter1.txt\nchapter2.txt"},{filename:"my-first-markuapad-book/manifest_files/chapter1.txt",in_sample:!1,content:"# Chapter 1\n\nHere is the first chapter"},{filename:"my-first-markuapad-book/manifest_files/chapter2.txt",in_sample:!1,content:"# Chapter 2\n\nHere is the second chapter"},{filename:"my-first-markuapad-book/manifest_code/sample.js",content:"function() {\n console.log('Hello, World!');\n}\n"}],c=[{filename:"my-first-markuapad-book/manifest_files",files:[{filename:"chapter1.txt"},{filename:"chapter2.txt"}]},{filename:"my-first-markuapad-book/manifest_code",files:[{filename:"sample.js"}]},{filename:"my-first-markuapad-book/manifest_images",files:[]}];if(!o.getCached("my-first-markuapad-book/manifest_files")){var u=!0,d=!1,p=void 0;try{for(var h,f=l[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var m=h.value,g=m.filename;m.filename=m.filename.substr(m.filename.lastIndexOf("/")+1),o.setCached(g,m)}}catch(v){d=!0,p=v}finally{try{!u&&f["return"]&&f["return"]()}finally{if(d)throw p}}var y=!0,b=!1,k=void 0;try{for(var w,x=c[Symbol.iterator]();!(y=(w=x.next()).done);y=!0){var m=w.value;o.setCached(m.filename,m.files)}}catch(v){b=!0,k=v}finally{try{!y&&x["return"]&&x["return"]()}finally{if(b)throw k}}}var E=function(){function e(t){r(this,e),this.projectRoot=t,this.onAddCallbacks=[],this.onDeleteCallbacks=[],this.onManuscriptChangeCallbacks=[],this.onProgressStartedCallbacks=[],this.onProgressCallbacks=[],this.onMergeConflictCallback=null,this.manifestFilesKey=this.projectRoot+"/manifest_files",this.manifestCodeKey=this.projectRoot+"/manifest_code",this.manifestImagesKey=this.projectRoot+"/manifest_images",this.supportsImageUploads=!0}return i(e,[{key:"getFilePrefix",value:function(e){return"manuscript"===e?this.manifestFilesKey:"code"===e?this.manifestCodeKey:"image"===e?this.manifestImagesKey:this.projectRoot}},{key:"get",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1],n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=o.getCached(this.getFilePrefix(n)+"/"+e);t(null,r&&r.content)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=o.getCached(this.getFilePrefix(t)+"/"+e);return n&&n.content}},{key:"listFiles",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestFilesKey),function(e){return a.extend(e,{type:"manuscript"})});e(null,t)}},{key:"listImages",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestImagesKey),function(e){return a.extend(e,{type:"image"})});e(null,t?a.map(t,function(e){return a.omit(e,"content")}):[])}},{key:"listCode",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0],t=a.map(o.getCached(this.manifestCodeKey),function(e){return a.extend(e,{type:"code"})});e(null,t?a.map(t,function(e){return a.omit(e,"content")}):[])}},{key:"save",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],r=arguments.length<=3||void 0===arguments[3]?s:arguments[3],i=this.getFilePrefix(t)+"/"+e,a=o.getCached(i);a.content=n,o.setCached(i,a),r(null)}},{key:"saveManuscript",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1];o.setCached(this.manifestFilesKey,e),o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(e,function(e){return e.filename}).join("\n")});var n=!0,r=!1,i=void 0;try{for(var l,c=this.onManuscriptChangeCallbacks[Symbol.iterator]();!(n=(l=c.next()).done);n=!0){var u=l.value;u(null)}}catch(d){r=!0,i=d}finally{try{!n&&c["return"]&&c["return"]()}finally{if(r)throw i}}t(null)}},{key:"newImage",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?s:arguments[1];t("Images uploads don't work on markuapad.com")}},{key:"new",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?"":arguments[2],r=arguments.length<=3||void 0===arguments[3]?s:arguments[3],i={filename:e,content:n,type:t},l=this.getFilePrefix(t)+"/"+e,c="manuscript"===t?this.manifestFilesKey:this.manifestCodeKey,u=o.getCached(c).concat([a.omit(i,"content")]);o.setCached(l,i),o.setCached(c,u),"manuscript"===t&&o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(u,function(e){return e.filename}).join("\n")}),r(null,i);var d=!0,p=!1,h=void 0;try{for(var f,m=this.onAddCallbacks[Symbol.iterator]();!(d=(f=m.next()).done);d=!0){var g=f.value;g(i)}}catch(v){p=!0,h=v}finally{try{!d&&m["return"]&&m["return"]()}finally{if(p)throw h}}}},{key:"delete",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1],n=arguments.length<=2||void 0===arguments[2]?s:arguments[2],r=void 0;r="manuscript"===t?this.manifestFilesKey:"image"===t?this.manifestImagesKey:this.manifestCodeKey;var i=o.getCached(r),l=this.getFilePrefix(t)+"/"+e;localStorage.removeItem(l),i=a.reject(i,function(t){return t.filename===e}),o.setCached(r,i),"manuscript"===t&&o.setCached(this.projectRoot+"/book.txt",{filename:"book.txt",content:a.map(i,function(e){return e.filename}).join("\n")}),n(null);var c=!0,u=!1,d=void 0;try{for(var p,h=this.onDeleteCallbacks[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var f=p.value;f(e)}}catch(m){u=!0,d=m}finally{try{!c&&h["return"]&&h["return"]()}finally{if(u)throw d}}}},{key:"setCursor",value:function(e,t){o.setCached("markuapad_cursor",{filename:e,position:t})}},{key:"onAdd",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onAddCallbacks.push(e)}},{key:"onDelete",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onDeleteCallbacks.push(e)}},{key:"onManuscriptChange",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onManuscriptChangeCallbacks.push(e)}},{key:"onProgress",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onProgressCallbacks.push(e)}},{key:"onProgressStarted",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onProgressStartedCallbacks.push(e)}},{key:"onMergeConflicts",value:function(){var e=arguments.length<=0||void 0===arguments[0]?s:arguments[0];this.onMergeConflictCallback=e}}]),e}();window.ExampleFileAccessor=E},2:function(e,t,n){var r,i;(function(){function n(e){function t(t,n,r,i,o,a){for(;o>=0&&a>o;o+=e){var s=i?i[o]:o;r=n(r,t[s],s,t)}return r}return function(n,r,i,o){r=E(r,o,4);var a=!D(n)&&x.keys(n),s=(a||n).length,l=e>0?0:s-1;return arguments.length<3&&(i=n[a?a[l]:l],l+=e),t(n,r,i,a,l,s)}}function o(e){return function(t,n,r){n=_(n,r);for(var i=F(t),o=e>0?0:i-1;o>=0&&i>o;o+=e)if(n(t[o],o,t))return o;return-1}}function a(e,t,n){return function(r,i,o){var a=0,s=F(r);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=t(f.call(r,a,s),x.isNaN),o>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&s>o;o+=e)if(r[o]===i)return o;return-1}}function s(e,t){var n=M.length,r=e.constructor,i=x.isFunction(r)&&r.prototype||d,o="constructor";for(x.has(e,o)&&!x.contains(t,o)&&t.push(o);n--;)o=M[n],o in e&&e[o]!==i[o]&&!x.contains(t,o)&&t.push(o)}var l=this,c=l._,u=Array.prototype,d=Object.prototype,p=Function.prototype,h=u.push,f=u.slice,m=d.toString,g=d.hasOwnProperty,v=Array.isArray,y=Object.keys,b=p.bind,k=Object.create,w=function(){},x=function(e){return e instanceof x?e:this instanceof x?void(this._wrapped=e):new x(e)};"undefined"!=typeof e&&e.exports&&(t=e.exports=x),t._=x,x.VERSION="1.8.3";var E=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}},_=function(e,t,n){return null==e?x.identity:x.isFunction(e)?E(e,t,n):x.isObject(e)?x.matcher(e):x.property(e)};x.iteratee=function(e,t){return _(e,t,1/0)};var C=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var o=arguments[i],a=e(o),s=a.length,l=0;s>l;l++){var c=a[l];t&&void 0!==n[c]||(n[c]=o[c])}return n}},T=function(e){if(!x.isObject(e))return{};if(k)return k(e);w.prototype=e;var t=new w;return w.prototype=null,t},S=function(e){return function(t){return null==t?void 0:t[e]}},A=Math.pow(2,53)-1,F=S("length"),D=function(e){var t=F(e);return"number"==typeof t&&t>=0&&A>=t};x.each=x.forEach=function(e,t,n){t=E(t,n);var r,i;if(D(e))for(r=0,i=e.length;i>r;r++)t(e[r],r,e);else{var o=x.keys(e);for(r=0,i=o.length;i>r;r++)t(e[o[r]],o[r],e)}return e},x.map=x.collect=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=Array(i),a=0;i>a;a++){var s=r?r[a]:a;o[a]=t(e[s],s,e)}return o},x.reduce=x.foldl=x.inject=n(1),x.reduceRight=x.foldr=n(-1),x.find=x.detect=function(e,t,n){var r;return r=D(e)?x.findIndex(e,t,n):x.findKey(e,t,n),void 0!==r&&-1!==r?e[r]:void 0},x.filter=x.select=function(e,t,n){var r=[];return t=_(t,n),x.each(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r},x.reject=function(e,t,n){return x.filter(e,x.negate(_(t)),n)},x.every=x.all=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=0;i>o;o++){var a=r?r[o]:o;if(!t(e[a],a,e))return!1}return!0},x.some=x.any=function(e,t,n){t=_(t,n);for(var r=!D(e)&&x.keys(e),i=(r||e).length,o=0;i>o;o++){var a=r?r[o]:o;if(t(e[a],a,e))return!0}return!1},x.contains=x.includes=x.include=function(e,t,n,r){return D(e)||(e=x.values(e)),("number"!=typeof n||r)&&(n=0),x.indexOf(e,t,n)>=0},x.invoke=function(e,t){var n=f.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){var i=r?t:e[t];return null==i?i:i.apply(e,n)})},x.pluck=function(e,t){return x.map(e,x.property(t))},x.where=function(e,t){return x.filter(e,x.matcher(t))},x.findWhere=function(e,t){return x.find(e,x.matcher(t))},x.max=function(e,t,n){var r,i,o=-(1/0),a=-(1/0);if(null==t&&null!=e){e=D(e)?e:x.values(e);for(var s=0,l=e.length;l>s;s++)r=e[s],r>o&&(o=r)}else t=_(t,n),x.each(e,function(e,n,r){i=t(e,n,r),(i>a||i===-(1/0)&&o===-(1/0))&&(o=e,a=i)});return o},x.min=function(e,t,n){var r,i,o=1/0,a=1/0;if(null==t&&null!=e){e=D(e)?e:x.values(e);for(var s=0,l=e.length;l>s;s++)r=e[s],o>r&&(o=r)}else t=_(t,n),x.each(e,function(e,n,r){i=t(e,n,r),(a>i||i===1/0&&o===1/0)&&(o=e,a=i)});return o},x.shuffle=function(e){for(var t,n=D(e)?e:x.values(e),r=n.length,i=Array(r),o=0;r>o;o++)t=x.random(0,o),t!==o&&(i[o]=i[t]),i[t]=n[o];return i},x.sample=function(e,t,n){return null==t||n?(D(e)||(e=x.values(e)),e[x.random(e.length-1)]):x.shuffle(e).slice(0,Math.max(0,t))},x.sortBy=function(e,t,n){return t=_(t,n),x.pluck(x.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return e.index-t.index}),"value")};var R=function(e){return function(t,n,r){var i={};return n=_(n,r),x.each(t,function(r,o){var a=n(r,o,t);e(i,r,a)}),i}};x.groupBy=R(function(e,t,n){x.has(e,n)?e[n].push(t):e[n]=[t]}),x.indexBy=R(function(e,t,n){e[n]=t}),x.countBy=R(function(e,t,n){x.has(e,n)?e[n]++:e[n]=1}),x.toArray=function(e){return e?x.isArray(e)?f.call(e):D(e)?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return null==e?0:D(e)?e.length:x.keys(e).length},x.partition=function(e,t,n){t=_(t,n);var r=[],i=[];return x.each(e,function(e,n,o){(t(e,n,o)?r:i).push(e)}),[r,i]},x.first=x.head=x.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:x.initial(e,e.length-t)},x.initial=function(e,t,n){return f.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},x.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:x.rest(e,Math.max(0,e.length-t))},x.rest=x.tail=x.drop=function(e,t,n){return f.call(e,null==t||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var L=function(e,t,n,r){for(var i=[],o=0,a=r||0,s=F(e);s>a;a++){var l=e[a];if(D(l)&&(x.isArray(l)||x.isArguments(l))){t||(l=L(l,t,n));var c=0,u=l.length;for(i.length+=u;u>c;)i[o++]=l[c++]}else n||(i[o++]=l)}return i};x.flatten=function(e,t){return L(e,t,!1)},x.without=function(e){return x.difference(e,f.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=_(n,r));for(var i=[],o=[],a=0,s=F(e);s>a;a++){var l=e[a],c=n?n(l,a,e):l;t?(a&&o===c||i.push(l),o=c):n?x.contains(o,c)||(o.push(c),i.push(l)):x.contains(i,l)||i.push(l)}return i},x.union=function(){return x.uniq(L(arguments,!0,!0))},x.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=F(e);i>r;r++){var o=e[r];if(!x.contains(t,o)){for(var a=1;n>a&&x.contains(arguments[a],o);a++);a===n&&t.push(o)}}return t},x.difference=function(e){var t=L(arguments,!0,!0,1);return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){return x.unzip(arguments)},x.unzip=function(e){for(var t=e&&x.max(e,F).length||0,n=Array(t),r=0;t>r;r++)n[r]=x.pluck(e,r);return n},x.object=function(e,t){for(var n={},r=0,i=F(e);i>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.findIndex=o(1),x.findLastIndex=o(-1),x.sortedIndex=function(e,t,n,r){n=_(n,r,1);for(var i=n(t),o=0,a=F(e);a>o;){var s=Math.floor((o+a)/2);n(e[s])<i?o=s+1:a=s}return o},x.indexOf=a(1,x.findIndex,x.sortedIndex),x.lastIndexOf=a(-1,x.findLastIndex),x.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;r>o;o++,e+=n)i[o]=e;return i};var O=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=T(e.prototype),a=e.apply(o,i);return x.isObject(a)?a:o};x.bind=function(e,t){if(b&&e.bind===b)return b.apply(e,f.call(arguments,1));if(!x.isFunction(e))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return O(e,r,t,this,n.concat(f.call(arguments)))};return r},x.partial=function(e){var t=f.call(arguments,1),n=function(){for(var r=0,i=t.length,o=Array(i),a=0;i>a;a++)o[a]=t[a]===x?arguments[r++]:t[a];for(;r<arguments.length;)o.push(arguments[r++]);return O(e,n,this,this,o)};return n},x.bindAll=function(e){var t,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=x.bind(e[n],e);return e},x.memoize=function(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return x.has(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n},x.delay=function(e,t){var n=f.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=x.partial(x.delay,x,1),x.throttle=function(e,t,n){var r,i,o,a=null,s=0;n||(n={});var l=function(){s=n.leading===!1?0:x.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var c=x.now();s||n.leading!==!1||(s=c);var u=t-(c-s);return r=this,i=arguments,0>=u||u>t?(a&&(clearTimeout(a),a=null),s=c,o=e.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(l,u)),o}},x.debounce=function(e,t,n){var r,i,o,a,s,l=function(){var c=x.now()-a;t>c&&c>=0?r=setTimeout(l,t-c):(r=null,n||(s=e.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=x.now();var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(s=e.apply(o,i),o=i=null),s}},x.wrap=function(e,t){return x.partial(t,e)},x.negate=function(e){return function(){return!e.apply(this,arguments)}},x.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},x.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},x.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},x.once=x.partial(x.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];x.keys=function(e){if(!x.isObject(e))return[];if(y)return y(e);var t=[];for(var n in e)x.has(e,n)&&t.push(n);return N&&s(e,t),t},x.allKeys=function(e){if(!x.isObject(e))return[];var t=[];for(var n in e)t.push(n);return N&&s(e,t),t},x.values=function(e){for(var t=x.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=e[t[i]];return r},x.mapObject=function(e,t,n){t=_(t,n);for(var r,i=x.keys(e),o=i.length,a={},s=0;o>s;s++)r=i[s],a[r]=t(e[r],r,e);return a},x.pairs=function(e){for(var t=x.keys(e),n=t.length,r=Array(n),i=0;n>i;i++)r[i]=[t[i],e[t[i]]];return r},x.invert=function(e){for(var t={},n=x.keys(e),r=0,i=n.length;i>r;r++)t[e[n[r]]]=n[r];return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=C(x.allKeys),x.extendOwn=x.assign=C(x.keys),x.findKey=function(e,t,n){t=_(t,n);for(var r,i=x.keys(e),o=0,a=i.length;a>o;o++)if(r=i[o],t(e[r],r,e))return r},x.pick=function(e,t,n){var r,i,o={},a=e;if(null==a)return o;x.isFunction(t)?(i=x.allKeys(a),r=E(t,n)):(i=L(arguments,!1,!1,1),r=function(e,t,n){return t in n},a=Object(a));for(var s=0,l=i.length;l>s;s++){var c=i[s],u=a[c];r(u,c,a)&&(o[c]=u)}return o},x.omit=function(e,t,n){if(x.isFunction(t))t=x.negate(t);else{var r=x.map(L(arguments,!1,!1,1),String);t=function(e,t){return!x.contains(r,t)}}return x.pick(e,t,n)},x.defaults=C(x.allKeys,!0),x.create=function(e,t){var n=T(e);return t&&x.extendOwn(n,t),n},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e},x.isMatch=function(e,t){var n=x.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;r>o;o++){var a=n[o];if(t[a]!==i[a]||!(a in i))return!1}return!0};var I=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=m.call(e);if(i!==m.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var l=n.length;l--;)if(n[l]===e)return r[l]===t;if(n.push(e),r.push(t),o){if(l=e.length,l!==t.length)return!1;for(;l--;)if(!I(e[l],t[l],n,r))return!1}else{var c,u=x.keys(e);if(l=u.length,x.keys(t).length!==l)return!1;for(;l--;)if(c=u[l],!x.has(t,c)||!I(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0};x.isEqual=function(e,t){return I(e,t)},x.isEmpty=function(e){return null==e?!0:D(e)&&(x.isArray(e)||x.isString(e)||x.isArguments(e))?0===e.length:0===x.keys(e).length},x.isElement=function(e){return!(!e||1!==e.nodeType)},x.isArray=v||function(e){return"[object Array]"===m.call(e)},x.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},x.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){x["is"+e]=function(t){return m.call(t)==="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return x.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(x.isFunction=function(e){return"function"==typeof e||!1}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!==+e},x.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===m.call(e)},x.isNull=function(e){return null===e},x.isUndefined=function(e){return void 0===e},x.has=function(e,t){return null!=e&&g.call(e,t)},x.noConflict=function(){return l._=c,this},x.identity=function(e){return e},x.constant=function(e){return function(){return e}},x.noop=function(){},x.property=S,x.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},x.matcher=x.matches=function(e){return e=x.extendOwn({},e),function(t){return x.isMatch(t,e)}},x.times=function(e,t,n){var r=Array(Math.max(0,e));t=E(t,n,1);for(var i=0;e>i;i++)r[i]=t(i);return r},x.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},x.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},P=x.invert(B),j=function(e){var t=function(t){return e[t]},n="(?:"+x.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};x.escape=j(B),x.unescape=j(P),x.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),x.isFunction(r)?r.call(e):r};var $=0;x.uniqueId=function(e){var t=++$+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,W={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,V=function(e){return"\\"+W[e]};x.template=function(e,t,n){!t&&n&&(t=n),t=x.defaults({},t,x.templateSettings);var r=RegExp([(t.escape||z).source,(t.interpolate||z).source,(t.evaluate||z).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,a,s){return o+=e.slice(i,s).replace(U,V),i=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(s){throw s.source=o,s}var l=function(e){return a.call(this,e,x)},c=t.variable||"obj";return l.source="function("+c+"){\n"+o+"}",l},x.chain=function(e){var t=x(e);return t._chain=!0,t};var H=function(e,t){return e._chain?x(t).chain():t};x.mixin=function(e){x.each(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return h.apply(e,arguments),H(this,n.apply(x,e))}})},x.mixin(x),x.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=u[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],H(this,n)}}),x.each(["concat","join","slice"],function(e){var t=u[e];x.prototype[e]=function(){return H(this,t.apply(this._wrapped,arguments))}}),x.prototype.value=function(){return this._wrapped},x.prototype.valueOf=x.prototype.toJSON=x.prototype.value,x.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return x}.apply(t,r),!(void 0!==i&&(e.exports=i))}).call(this)},238:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},368:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t),f=void 0;h?(h.data?f="data:"+h.mimetype.string+";base64,"+h.data:h.url&&(f=h.url),e=e.replace(a,'src="'+f)):o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},387:function(e,t){}});
@@ -36,7 +36,7 @@ var m=e.renderer.$cursorLayer.getPixelPosition(r).left;f.style.left=m+e.renderer
36
36
  },function(e,t){ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText=" .ace-xcode .ace_gutter { background: #e8e8e8; color: #333 } .ace-xcode .ace_print-margin { width: 1px; background: #e8e8e8 } .ace-xcode { background-color: #FFFFFF; color: #000000 } .ace-xcode .ace_cursor { color: #000000 } .ace-xcode .ace_marker-layer .ace_selection { background: #B5D5FF } .ace-xcode.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; border-radius: 2px } .ace-xcode .ace_marker-layer .ace_step { background: rgb(198, 219, 174) } .ace-xcode .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF } .ace-xcode .ace_marker-layer .ace_active-line { background: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_gutter-active-line { background-color: rgba(0, 0, 0, 0.071) } .ace-xcode .ace_marker-layer .ace_selected-word { border: 1px solid #B5D5FF } .ace-xcode .ace_constant.ace_language, .ace-xcode .ace_keyword, .ace-xcode .ace_meta, .ace-xcode .ace_variable.ace_language { color: #C800A4 } .ace-xcode .ace_invisible { color: #BFBFBF } .ace-xcode .ace_constant.ace_character, .ace-xcode .ace_constant.ace_other { color: #275A5E } .ace-xcode .ace_constant.ace_numeric { color: #3A00DC } .ace-xcode .ace_entity.ace_other.ace_attribute-name, .ace-xcode .ace_support.ace_constant, .ace-xcode .ace_support.ace_function { color: #450084 } .ace-xcode .ace_fold { background-color: #C800A4; border-color: #000000 } .ace-xcode .ace_entity.ace_name.ace_tag, .ace-xcode .ace_support.ace_class, .ace-xcode .ace_support.ace_type { color: #790EAD } .ace-xcode .ace_storage { color: #C900A4 } .ace-xcode .ace_string { color: #DF0002 } .ace-xcode .ace_comment { color: #008E00 } .ace-xcode .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y }";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){n(this,e),this.fileAccessorDelegate=null}return r(e,[{key:"get",value:function(){var e;(e=this.fileAccessorDelegate).get.apply(e,arguments)}},{key:"getSync",value:function(){var e;return(e=this.fileAccessorDelegate).getSync.apply(e,arguments)}},{key:"listFiles",value:function(){var e;(e=this.fileAccessorDelegate).listFiles.apply(e,arguments)}},{key:"listImages",value:function(){var e;(e=this.fileAccessorDelegate).listImages.apply(e,arguments)}},{key:"listCode",value:function(){var e;(e=this.fileAccessorDelegate).listCode.apply(e,arguments)}},{key:"save",value:function(){var e;(e=this.fileAccessorDelegate).save.apply(e,arguments)}},{key:"saveManuscript",value:function(){var e;(e=this.fileAccessorDelegate).saveManuscript.apply(e,arguments)}},{key:"newImage",value:function(){var e;(e=this.fileAccessorDelegate).newImage.apply(e,arguments)}},{key:"new",value:function(){var e;(e=this.fileAccessorDelegate)["new"].apply(e,arguments)}},{key:"delete",value:function(){var e;(e=this.fileAccessorDelegate)["delete"].apply(e,arguments)}},{key:"isSetup",value:function(){null!==this.fileAccessorDelegate}},{key:"setup",value:function(e,t){this.fileAccessorDelegate=new e(t)}},{key:"setCursor",value:function(){var e;(e=this.fileAccessorDelegate).setCursor.apply(e,arguments)}},{key:"onDelete",value:function(){var e;(e=this.fileAccessorDelegate).onDelete.apply(e,arguments)}},{key:"onManuscriptChange",value:function(){var e;(e=this.fileAccessorDelegate).onManuscriptChange.apply(e,arguments)}},{key:"onAdd",value:function(){var e;(e=this.fileAccessorDelegate).onAdd.apply(e,arguments)}},{key:"onProgress",value:function(){var e;(e=this.fileAccessorDelegate).onProgress.apply(e,arguments)}},{key:"onProgressStarted",value:function(){var e;(e=this.fileAccessorDelegate).onProgressStarted.apply(e,arguments)}},{key:"supportsImageUploads",value:function(){return this.fileAccessorDelegate.supportsImageUploads}},{key:"onMergeConflicts",value:function(){var e;return(e=this.fileAccessorDelegate).onMergeConflicts.apply(e,arguments)}}]),e}();t["default"]=new i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(240),d=r(u),p={manuscript_update:"Manuscript Updated.",file_save:"Saved.",image_create:"Image Created.",file_delete:"File Deleted"},h=function(e){function t(e){var n=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={flash:null},this.unsub=d["default"].flash.listen(function(e,t){clearInterval(n.timer),n.setState({flash:{type:e,message:t}}),n.timer=setTimeout(function(){n.setState({flash:null})},5e3)})}return o(t,e),a(t,[{key:"render",value:function(){var e=this;return c["default"].createElement("nav",{className:"toolbar"},c["default"].createElement("h3",{className:"book-title"},this.props.bookTitle),c["default"].createElement("ul",{className:"actions"},c["default"].createElement("li",null,c["default"].createElement("a",{className:"progressMessage "+(this.props.inProgress?"active":"")},this.props.inProgress?c["default"].createElement("i",{className:"fa fa-refresh fa-spin"}):null," ",p[this.props.progressType]||"Working...")),this.state.flash?c["default"].createElement("li",{onClick:function(){return e.setState({flash:null})},key:this.state.flash.type},c["default"].createElement("a",{className:""+this.state.flash.type},this.state.flash.message)):null,this.props.enablePreview?[c["default"].createElement("li",{key:"toggleLive"},c["default"].createElement("a",{className:this.props.inLiveMode?"active":"",onClick:this.props.toggleLiveMode},c["default"].createElement("i",{className:"fa fa-columns"})," Live Mode")),c["default"].createElement("li",{key:"preview"},c["default"].createElement("a",{className:this.props.inLiveMode?"disabled":"",onClick:this.props.onGeneratePreview},c["default"].createElement("i",{className:"fa fa-play"})," Preview"))]:null))}}]),t}(c["default"].Component);h.propTypes={enablePreview:c["default"].PropTypes.bool.isRequired,inProgress:c["default"].PropTypes.bool.isRequired,progressType:c["default"].PropTypes.string,inLiveMode:c["default"].PropTypes.bool.isRequired,toggleLiveMode:c["default"].PropTypes.func.isRequired,onGeneratePreview:c["default"].PropTypes.func.isRequired,bookTitle:c["default"].PropTypes.string.isRequired},t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(241),o=r(i),a=o["default"].createActions({flash:{}});t["default"]=a,e.exports=t["default"]},function(e,t,n){var r=n(242);r.connect=n(256),r.connectFilter=n(258),r.ListenerMixin=n(257),r.listenTo=n(259),r.listenToMany=n(260),e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={version:{"reflux-core":"0.2.1"}};r.ActionMethods=n(243),r.ListenerMethods=n(244),r.PublisherMethods=n(254),r.StoreMethods=n(253),r.createAction=n(255),r.createStore=n(249);var i=n(248).staticJoinCreator;r.joinTrailing=r.all=i("last"),r.joinLeading=i("first"),r.joinStrict=i("strict"),r.joinConcat=i("all");var o=r.utils=n(245);r.EventEmitter=o.EventEmitter,r.Promise=o.Promise,r.createActions=function(){var e=function(e,t){Object.keys(e).forEach(function(n){var i=e[n];t[n]=r.createAction(i)})};return function(t){var n={};return t instanceof Array?t.forEach(function(t){o.isObject(t)?e(t,n):n[t]=r.createAction(t)}):e(t,n),n}}(),r.setEventEmitter=function(e){r.EventEmitter=o.EventEmitter=e},r.setPromise=function(e){r.Promise=o.Promise=e},r.setPromiseFactory=function(e){o.createPromise=e},r.nextTick=function(e){o.nextTick=e},r.use=function(e){e(r)},r.__keep=n(250),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5"),t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245),i=n(248).instanceJoinCreator,o=function(e){for(var t,n=0,r={};n<(e.children||[]).length;++n)t=e.children[n],e[t]&&(r[t]=e[t]);return r},a=function s(e){var t={};for(var n in e){var i=e[n],a=o(i),l=s(a);t[n]=i;for(var c in l){var u=l[c];t[n+r.capitalize(c)]=u}}return t};e.exports={hasListener:function(e){for(var t,n,r,i=0;i<(this.subscriptions||[]).length;++i)for(r=[].concat(this.subscriptions[i].listenable),t=0;t<r.length;t++)if(n=r[t],n===e||n.hasListener&&n.hasListener(e))return!0;return!1},listenToMany:function(e){var t=a(e);for(var n in t){var i=r.callbackName(n),o=this[i]?i:this[n]?n:void 0;o&&this.listenTo(t[n],o,this[i+"Default"]||this[o+"Default"]||o)}},validateListening:function(e){return e===this?"Listener is not able to listen to itself":r.isFunction(e.listen)?e.hasListener&&e.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:e+" is missing a listen method"},listenTo:function(e,t,n){var i,o,a,s=this.subscriptions=this.subscriptions||[];return r.throwIf(this.validateListening(e)),this.fetchInitialState(e,n),i=e.listen(this[t]||t,this),o=function(){var e=s.indexOf(a);r.throwIf(-1===e,"Tried to remove listen already gone from subscriptions list!"),s.splice(e,1),i()},a={stop:o,listenable:e},s.push(a),a},stopListeningTo:function(e){for(var t,n=0,i=this.subscriptions||[];n<i.length;n++)if(t=i[n],t.listenable===e)return t.stop(),r.throwIf(-1!==i.indexOf(t),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var e,t=this.subscriptions||[];e=t.length;)t[0].stop(),r.throwIf(t.length!==e-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(e,t){t=t&&this[t]||t;var n=this;if(r.isFunction(t)&&r.isFunction(e.getInitialState)){var i=e.getInitialState();i&&r.isFunction(i.then)?i.then(function(){t.apply(n,arguments)}):t.call(this,i)}},joinTrailing:i("last"),joinLeading:i("first"),joinConcat:i("all"),joinStrict:i("strict")}},function(module,exports,__webpack_require__){(function(setImmediate){"use strict";function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function callbackName(e,t){return t=t||"on",t+exports.capitalize(e)}function checkEnv(target){var flag=void 0;try{eval(target)&&(flag=!0)}catch(e){flag=!1}environment[callbackName(target,"has")]=flag}function isObject(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function extend(e){if(!isObject(e))return e;for(var t,n,r=1,i=arguments.length;i>r;r++){t=arguments[r];for(n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o)}else e[n]=t[n]}return e}function isFunction(e){return"function"==typeof e}function object(e,t){for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function isArguments(e){return"object"==typeof e&&"callee"in e&&"number"==typeof e.length}function throwIf(e,t){if(e)throw Error(t||e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.capitalize=capitalize,exports.callbackName=callbackName,exports.isObject=isObject,exports.extend=extend,exports.isFunction=isFunction,exports.object=object,exports.isArguments=isArguments,exports.throwIf=throwIf;var environment={};exports.environment=environment,checkEnv("setImmediate"),checkEnv("Promise"),exports.EventEmitter=__webpack_require__(247),environment.hasSetImmediate?exports.nextTick=function(e){setImmediate(e)}:exports.nextTick=function(e){setTimeout(e,0)},environment.hasPromise?(exports.Promise=Promise,exports.createPromise=function(e){return new exports.Promise(e)}):(exports.Promise=null,exports.createPromise=function(){})}).call(exports,__webpack_require__(246).setImmediate)},function(e,t,n){(function(e,r){function i(e,t){this._id=e,this._clearFn=t}var o=n(75).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,l={},c=0;t.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=arguments.length<2?!1:s.call(arguments,1);return l[n]=!0,o(function(){l[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(t,n(246).setImmediate,n(246).clearImmediate)},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if("function"==typeof u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);d>c;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,h=u.length;for(c=0;h>c;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;default:if(!l)for(p=1,l=new Array(d-1);d>p;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var l=0,c=a.length;c>l;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&s.push(a[l]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return function(){var r,i=n.subscriptions,o=i?i.indexOf(e):-1;for(l.throwIf(-1===o,"Tried to remove join already gone from subscriptions list!"),r=0;r<t.length;r++)t[r]();i.splice(o,1)}}function i(e){e.listenablesEmitted=new Array(e.numberOfListenables),e.args=new Array(e.numberOfListenables)}function o(e,t){return function(){var n=c.call(arguments);if(t.listenablesEmitted[e])switch(t.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":t.args[e]=n;break;case"all":t.args[e].push(n)}else t.listenablesEmitted[e]=!0,t.args[e]="all"===t.strategy?[n]:n;a(t)}}function a(e){for(var t=0;t<e.numberOfListenables;t++)if(!e.listenablesEmitted[t])return;e.callback.apply(e.listener,e.args),i(e)}var s=n(249),l=n(245),c=Array.prototype.slice,u={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};t.staticJoinCreator=function(e){return function(){var t=c.call(arguments);return s({init:function(){this[u[e]].apply(this,t.concat("triggerAsync"))}})}},t.instanceJoinCreator=function(e){return function(){l.throwIf(arguments.length<2,"Cannot create a join with less than 2 listenables!");var t,n,a=c.call(arguments),s=a.pop(),u=a.length,d={numberOfListenables:u,callback:this[s]||s,listener:this,strategy:e},p=[];for(t=0;u>t;t++)l.throwIf(this.validateListening(a[t]));for(t=0;u>t;t++)p.push(a[t].listen(o(t,d),this));return i(d),n={listenable:a},n.stop=r(n,p,this),this.subscriptions=(this.subscriptions||[]).concat(n),n}}},function(e,t,n){"use strict";var r=n(245),i=n(250),o=n(251),a=n(252),s={preEmit:1,shouldEmit:1};e.exports=function(e){function t(){var t,n=0;if(this.subscriptions=[],this.emitter=new r.EventEmitter,this.eventLabel="change",a(this,e),this.init&&r.isFunction(this.init)&&this.init(),this.listenables)for(t=[].concat(this.listenables);n<t.length;n++)this.listenToMany(t[n])}var l=n(253),c=n(254),u=n(244);e=e||{};for(var d in l)if(!s[d]&&(c[d]||u[d]))throw new Error("Cannot override API method "+d+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var p in e)if(!s[p]&&(c[p]||u[p]))throw new Error("Cannot override API method "+p+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");e=o(e),r.extend(t.prototype,u,c,l,e);var h=new t;return i.createdStores.push(h),h}},function(e,t){"use strict";t.createdStores=[],t.createdActions=[],t.reset=function(){for(;t.createdStores.length;)t.createdStores.pop();for(;t.createdActions.length;)t.createdActions.pop()}},function(e,t,n){"use strict";var r=n(245);e.exports=function(e){var t={init:[],preEmit:[],shouldEmit:[]},n=function i(e){var n={};return e.mixins&&e.mixins.forEach(function(e){r.extend(n,i(e))}),r.extend(n,e),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&t[n].push(e[n])}),n}(e);return t.init.length>1&&(n.init=function(){var e=arguments;t.init.forEach(function(t){t.apply(this,e)},this)}),t.preEmit.length>1&&(n.preEmit=function(){return t.preEmit.reduce(function(e,t){var n=t.apply(this,e);return void 0===n?e:[n]}.bind(this),arguments)}),t.shouldEmit.length>1&&(n.shouldEmit=function(){var e=arguments;return!t.shouldEmit.some(function(t){return!t.apply(this,e)},this)}),Object.keys(t).forEach(function(e){1===t[e].length&&(n[e]=t[e][0])}),n}},function(e,t){"use strict";e.exports=function(e,t){for(var n in t)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var r=Object.getOwnPropertyDescriptor(t,n);if(!r.value||"function"!=typeof r.value||!t.hasOwnProperty(n))continue;e[n]=t[n].bind(e)}else{var i=t[n];if("function"!=typeof i||!t.hasOwnProperty(n))continue;e[n]=i.bind(e)}return e}},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(245);e.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(e,t){t=t||this;var n=function(n){i||e.apply(t,n)},r=this,i=!1;return this.emitter.addListener(this.eventLabel,n),function(){i=!0,r.emitter.removeListener(r.eventLabel,n)}},promise:function(e){var t=this,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!n)throw new Error('Publisher must have "completed" and "failed" child publishers');e.then(function(e){return t.completed(e)},function(e){return t.failed(e)})},listenAndPromise:function(e,t){var n=this;t=t||this,this.willCallPromise=(this.willCallPromise||0)+1;var r=this.listen(function(){if(!e)throw new Error("Expected a function returning a promise but got "+e);var r=arguments,i=e.apply(t,r);return n.promise.call(n,i)},t);return function(){n.willCallPromise--,r.call(n)}},trigger:function(){var e=arguments,t=this.preEmit.apply(this,e);e=void 0===t?e:r.isArguments(t)?t:[].concat(t),this.shouldEmit.apply(this,e)&&this.emitter.emit(this.eventLabel,e)},triggerAsync:function(){var e=arguments,t=this;r.nextTick(function(){t.trigger.apply(t,e)})},triggerPromise:function(){var e=this,t=arguments,n=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,i=r.createPromise(function(i,o){if(e.willCallPromise)return void r.nextTick(function(){var n=e.promise;e.promise=function(t){return t.then(i,o),e.promise=n,e.promise.apply(e,arguments)},e.trigger.apply(e,t)});if(n)var a=e.completed.listen(function(e){a(),s(),i(e)}),s=e.failed.listen(function(e){a(),s(),o(e)});e.triggerAsync.apply(e,t),n||i()});return i}}},function(e,t,n){"use strict";var r=n(245),i=n(243),o=n(254),a=n(250),s={preEmit:1,shouldEmit:1},l=function c(e){e=e||{},r.isObject(e)||(e={actionName:e});for(var t in i)if(!s[t]&&o[t])throw new Error("Cannot override API method "+t+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var n in e)if(!s[n]&&o[n])throw new Error("Cannot override API method "+n+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");e.children=e.children||[],e.asyncResult&&(e.children=e.children.concat(["completed","failed"]));for(var l=0,u={};l<e.children.length;l++){var d=e.children[l];u[d]=c(d)}var p=r.extend({eventLabel:"action",emitter:new r.EventEmitter,_isAction:!0},o,i,e),h=function f(){var e=f.sync?"trigger":r.environment.hasPromise?"triggerPromise":"triggerAsync";return f[e].apply(f,arguments)};return r.extend(h,u,p),a.createdActions.push(h),h};e.exports=l},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t){return{getInitialState:function(){return o.isFunction(e.getInitialState)?void 0===t?e.getInitialState():o.object([t],[e.getInitialState()]):{}},componentDidMount:function(){o.extend(this,r);var n=this,i=void 0===t?this.setState:function(e){("undefined"==typeof n.isMounted||n.isMounted()===!0)&&n.setState(o.object([t],[e]))};this.listenTo(e,i)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(245),i=n(244);e.exports=r.extend({componentWillUnmount:i.stopListeningToAll},i)},function(e,t,n){var r=n(244),i=n(257),o=n(245);e.exports=function(e,t,n){return n=o.isFunction(t)?t:n,{getInitialState:function(){if(o.isFunction(e.getInitialState)){if(o.isFunction(t))return n.call(this,e.getInitialState());var r=n.call(this,e.getInitialState());return"undefined"!=typeof r?o.object([t],[r]):{}}return{}},componentDidMount:function(){o.extend(this,r);var i=this,a=function(e){if(o.isFunction(t))i.setState(n.call(i,e));else{var r=n.call(i,e);i.setState(o.object([t],[r]))}};this.listenTo(e,a)},componentWillUnmount:i.componentWillUnmount}}},function(e,t,n){var r=n(244);e.exports=function(e,t,n){return{componentDidMount:function(){for(var i in r)if(this[i]!==r[i]){if(this[i])throw"Can't have other property '"+i+"' when using Reflux.listenTo!";this[i]=r[i]}this.listenTo(e,t,n)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){var r=n(244);e.exports=function(e){return{componentDidMount:function(){for(var t in r)if(this[t]!==r[t]){if(this[t])throw"Can't have other property '"+t+"' when using Reflux.listenToMany!";this[t]=r[t]}this.listenToMany(e)},componentWillUnmount:r.stopListeningToAll}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(2),d=r(u),p=n(262),h=r(p),f=n(238),m=r(f),g=n(341),v=r(g),y=n(263),b=n(240),w=r(b),k=n(3),x=r(k);d["default"].string=x["default"];var E=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={files:[],closed:!1,fileMode:"manuscript",busy:!1},this.toggleClose=this.toggleClose.bind(this),this.newFile=this.newFile.bind(this),this.createFile=this.createFile.bind(this),this.createImageFile=this.createImageFile.bind(this),this.listManuscript=this.listManuscript.bind(this),this.onDeleteFile=this.onDeleteFile.bind(this),this.onChangeMode=this.onChangeMode.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.listCode=this.listCode.bind(this),this.listManuscript=this.listManuscript.bind(this),this.listImage=this.listImage.bind(this),this.moveFile=this.moveFile.bind(this),this.saveManuscript=this.saveManuscript.bind(this),m["default"].onDelete(this.onFileDeleted)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.listManuscript()}},{key:"componentDidUpdate",value:function(e,t){t.fileMode&&t.fileMode!==this.state.fileMode&&this["list"+d["default"].string.capitalize(this.state.fileMode)]()}},{key:"onFileDeleted",value:function(){this.props.onChangeFile(null)}},{key:"listManuscript",value:function(){var e=this;this.busy(!0),m["default"].listFiles(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listImage",value:function(){var e=this;this.busy(!0),m["default"].listImages(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"listCode",value:function(){var e=this;this.busy(!0),m["default"].listCode(function(t,n){e.busy(!1),t?console.error(t):e.setState({files:n})})}},{key:"busy",value:function(e){this.setState({busy:e})}},{key:"free",value:function(){this.setState({busy:!1})}},{key:"toggleClose",value:function(e){this.setState({closed:!this.state.closed})}},{key:"onChangeMode",value:function(e){this.setState({fileMode:e})}},{key:"createImageFile",value:function(e){var t=this,n=this.refs.imageFile.getDOMNode();return m["default"].newImage(n,function(){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)]()}),e.stopPropagation(),e.preventDefault(),!1}},{key:"createFile",value:function(e){var t=this,n=this.refs.filename.getDOMNode();-1!==this.props.blacklistedFiles.indexOf(n.value.toLowerCase())?w["default"].flash("error","You may not create a file with the name "+n.value+" as it is a reserved file."):m["default"]["new"](n.value,this.state.fileMode,"",function(e,r){n.value="",t.setState({creatingFile:!1}),t["list"+d["default"].string.capitalize(t.state.fileMode)](),t.props.onChangeFile(r)}),e.stopPropagation(),e.preventDefault()}},{key:"newFile",value:function(e){this.setState({creatingFile:!this.state.creatingFile})}},{key:"onDeleteFile",value:function(e){m["default"]["delete"](e.filename,this.state.fileMode,this["list"+d["default"].string.capitalize(this.state.fileMode)])}},{key:"saveManuscript",value:function(){"manuscript"===this.state.fileMode&&m["default"].saveManuscript(this.state.files)}},{key:"moveFile",value:function(e,t){var n=d["default"].clone(this.state.files),r=n.indexOf(e),i=n.indexOf(t);n.splice(r,1),n.splice(i,0,e),this.setState({files:n})}},{key:"renderFileCreator",value:function(){if(this.state.creatingFile){if("image"===this.state.fileMode){var e=c["default"].createElement("form",{onSubmit:this.createImageFile,className:"file-name"},c["default"].createElement("input",{type:"file",ref:"imageFile"}),c["default"].createElement("button",null,"Submit")),t=c["default"].createElement("p",null,"Sorry, image uploads are not supported");return m["default"].supportsImageUploads()?e:t}return c["default"].createElement("form",{onSubmit:this.createFile,className:"file-name"},c["default"].createElement("input",{type:"text",ref:"filename",placeholder:"Type a filename..."}),c["default"].createElement("button",null,"Create"))}}},{key:"renderFilesList",value:function(){var e=this;return this.state.busy?c["default"].createElement("i",{className:"busy-indicator fa fa-spin fa-2x fa-circle-o-notch"}):c["default"].createElement("ul",{className:"files-list"},d["default"].map(this.state.files,function(t,n){return c["default"].createElement(h["default"],{saveManuscript:e.saveManuscript,moveFile:e.moveFile,key:n,fileMode:e.state.fileMode,onDeleteFile:e.onDeleteFile,onChangeFile:e.props.onChangeFile,onPreviewImage:e.props.onPreviewImage,isCurrent:e.props.currentFile===t,file:t})}))}},{key:"render",value:function(){var e="file-browser "+(this.state.closed?"closed":"open"),t="new-file"+(this.state.creatingFile?" active":"");return c["default"].createElement("section",{className:e},c["default"].createElement("ul",{className:"file-types-list"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"manuscript")},c["default"].createElement("h4",{className:"title"+("manuscript"===this.state.fileMode?" selected":"")},"files"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"image")},c["default"].createElement("h4",{className:"title"+("image"===this.state.fileMode?" selected":"")},"images"))),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:d["default"].partial(this.onChangeMode,"code")},c["default"].createElement("h4",{className:"title"+("code"===this.state.fileMode?" selected":"")},"code")))),c["default"].createElement("div",{className:t,onClick:this.newFile},c["default"].createElement("i",{className:"fa fa-plus"}," ")),this.renderFileCreator(),this.renderFilesList(),c["default"].createElement("button",{className:"close-button",onClick:this.toggleClose},c["default"].createElement("span",null)))}}]),t}(c["default"].Component);E.propTypes={projectRoot:c["default"].PropTypes.string.isRequired,onChangeFile:c["default"].PropTypes.func.isRequired,currentFile:c["default"].PropTypes.string,blacklistedFiles:c["default"].PropTypes.array.isRequired},t["default"]=y.DragDropContext(v["default"])(E),
37
37
  e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(73),s=r(a),l=n(263),c={beginDrag:function(e){return e.file}},u={hover:function(e,t){var n=t.getItem();n!==e.file&&e.moveFile(n,e.file)},drop:function(e,t){e.saveManuscript()}},d=function(){function e(e){i(this,t),this.onDelete=this.onDelete.bind(this),this.onChange=this.onChange.bind(this)}o(e,[{key:"onDelete",value:function(e){confirm("Are you sure you want to delete this file?")&&this.props.onDeleteFile(this.props.file),e.stopPropagation(),e.preventDefault()}},{key:"onChange",value:function(e){"image"===this.props.file.type?this.props.onPreviewImage(this.props.file):this.props.onChangeFile(this.props.file)}},{key:"getFileIconClass",value:function(){switch(this.props.fileMode){case"manuscript":return"fa-file-o";case"images":return"fa-file-image";case"code":return"fa-code"}}},{key:"render",value:function(){var e="files-list-item"+(this.props.isCurrent?" current":"")+(this.props.file.parent?" child":"")+(this.props.isDragging?" dragging":"");return this.props.connectDragSource(this.props.connectDropTarget(s["default"].createElement("li",{className:e,onClick:this.onChange},s["default"].createElement("a",null,s["default"].createElement("i",{className:"fa "+this.getFileIconClass()})," ",this.props.file.filename),s["default"].createElement("button",{onClick:this.onDelete},s["default"].createElement("i",{className:"fa fa-times"})))))}}]);var t=e;return e=l.DragSource("file",c,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}})(e)||e,e=l.DropTarget("file",u,function(e){return{connectDropTarget:e.dropTarget()}})(e)||e}();t["default"]=d,d.propTypes={file:s["default"].PropTypes.object.isRequired,fileMode:s["default"].PropTypes.string.isRequired,moveFile:s["default"].PropTypes.func.isRequired,saveManuscript:s["default"].PropTypes.func.isRequired,isCurrent:s["default"].PropTypes.bool.isRequired,onDeleteFile:s["default"].PropTypes.func.isRequired,onChangeFile:s["default"].PropTypes.func.isRequired,onPreviewImage:s["default"].PropTypes.func.isRequired},e.exports=t["default"]},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(264);t.DragDropContext=r(i);var o=n(310);t.DragLayer=r(o);var a=n(321);t.DragSource=r(a);var s=n(336);t.DropTarget=r(s),"production"!==e.env.NODE_ENV&&Object.defineProperty(t,"default",{get:function(){console.error("React DnD does not provide a default export. You are probably missing the curly braces in the import statement. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export")}})}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){g["default"].apply(void 0,["DragDropContext","backend"].concat(l.call(arguments))),"object"==typeof e&&"function"==typeof e["default"]&&(e=e["default"]),f["default"]("function"==typeof e,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var t={dragDropManager:new p.DragDropManager(e)};return function(e){var n=e.displayName||e.name||"Component";return function(r){function a(){i(this,a),r.apply(this,arguments)}return o(a,r),a.prototype.getDecoratedComponentInstance=function(){return this.refs.child},a.prototype.getManager=function(){return t.dragDropManager},a.prototype.getChildContext=function(){return t},a.prototype.render=function(){return d["default"].createElement(e,s({},this.props,{ref:"child"}))},c(a,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+n+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),a}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=n(265),h=n(280),f=r(h),m=n(309),g=r(m);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var i=n(266);t.DragDropManager=r(i);var o=n(305);t.DragSource=r(o);var a=n(306);t.DropTarget=r(a);var s=n(307);t.createTestBackend=r(s)},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(267),s=i(a),l=n(269),c=i(l),u=n(271),d=r(u),p=n(301),h=i(p),f=n(302),m=(i(f),function(){function e(t){o(this,e);var n=s["default"](c["default"]);this.store=n,this.monitor=new h["default"](n),this.registry=this.monitor.registry,this.backend=t(this),n.subscribe(this.handleRefCountChange.bind(this))}return e.prototype.handleRefCountChange=function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var r=e.apply(t,arguments);"undefined"!=typeof r&&n(r)}}var t=this,n=this.store.dispatch;return Object.keys(d).filter(function(e){return"function"==typeof d[e]}).reduce(function(t,n){return t[n]=e(d[n]),t},{})},e}());t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(){return c}function r(e){return u.push(e),function(){var t=u.indexOf(e);u.splice(t,1)}}function i(e){if(!a["default"](e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,c=l(c,e)}finally{d=!1}return u.slice().forEach(function(e){return e()}),e}function o(e){l=e,i({type:s.INIT})}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var l=e,c=t,u=[],d=!1;return i({type:s.INIT}),{dispatch:i,subscribe:r,getState:n,replaceReducer:o}}t.__esModule=!0,t["default"]=i;var o=n(268),a=r(o),s={INIT:"@@redux/INIT"};t.ActionTypes=s},function(e,t){"use strict";function n(e){if(!e||"object"!=typeof e)return!1;var t="function"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&r(n)===r(Object)}t.__esModule=!0,t["default"]=n;var r=function(e){return Function.prototype.toString.call(e)};e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(270),o=r(i),a=n(281),s=r(a),l=n(295),c=r(l),u=n(296),d=r(u);t["default"]=function(e,t){return void 0===e&&(e={}),{dirtyHandlerIds:d["default"](e.dirtyHandlerIds,t,e.dragOperation),dragOffset:o["default"](e.dragOffset,t),refCount:c["default"](e.refCount,t),dragOperation:s["default"](e.dragOperation,t)}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return e===t?!0:e&&t&&e.x===t.x&&e.y===t.y}function i(e,t){switch(void 0===e&&(e=c),t.type){case l.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case l.HOVER:return r(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case l.END_DRAG:case l.DROP:return c;default:return e}}function o(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function a(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i,t.getSourceClientOffset=o,t.getDifferenceFromInitialOffset=a;var l=n(271),c={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.publishSource,r=void 0===n?!0:n,i=t.clientOffset,o=void 0===i?null:i,a=t.getSourceClientOffset;p["default"](f["default"](e),"Expected sourceIds to be an array.");var s=this.getMonitor(),l=this.getRegistry();p["default"](!s.isDragging(),"Cannot call beginDrag while dragging.");for(var c=0;c<e.length;c++)p["default"](l.getSource(e[c]),"Expected sourceIds to be registered.");for(var u=null,c=e.length-1;c>=0;c--)if(s.canDragSource(e[c])){u=e[c];break}if(null!==u){var d=null;o&&(p["default"]("function"==typeof a,"When clientOffset is provided, getSourceClientOffset must be a function."),d=a(u));var h=l.getSource(u),m=h.beginDrag(s,u);p["default"](g["default"](m),"Item must be an object."),l.pinSource(u);var y=l.getSourceType(u);return{type:v,itemType:y,item:m,sourceId:u,clientOffset:o,sourceClientOffset:d,isSourcePublic:r}}}function o(e){var t=this.getMonitor();if(t.isDragging())return{type:y}}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.clientOffset,r=void 0===n?null:n;p["default"](f["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var i=this.getMonitor(),o=this.getRegistry();p["default"](i.isDragging(),"Cannot call hover while not dragging."),p["default"](!i.didDrop(),"Cannot call hover after drop.");for(var a=i.getItemType(),s=0;s<e.length;s++){var l=e[s];p["default"](e.lastIndexOf(l)===s,"Expected targetIds to be unique in the passed array.");var c=o.getTarget(l);p["default"](c,"Expected targetIds to be registered.");var d=o.getTargetType(l);u["default"](d,a)&&c.hover(i,l)}return{type:b,targetIds:e,clientOffset:r}}function s(){var e=this,t=this.getMonitor(),n=this.getRegistry();p["default"](t.isDragging(),"Cannot call drop while not dragging."),p["default"](!t.didDrop(),"Cannot call drop twice during one drag operation.");var r=t.getTargetIds().filter(t.canDropOnTarget,t);r.reverse(),r.forEach(function(r,i){var o=n.getTarget(r),a=o.drop(t,r);p["default"]("undefined"==typeof a||g["default"](a),"Drop result must either be an object or undefined."),"undefined"==typeof a&&(a=0===i?{}:t.getDropResult()),e.store.dispatch({type:w,dropResult:a})})}function l(){var e=this.getMonitor(),t=this.getRegistry();p["default"](e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId(),r=t.getSource(n,!0);return r.endDrag(e,n),t.unpinSource(),{type:k}}t.__esModule=!0,t.beginDrag=i,t.publishDragSource=o,t.hover=a,t.drop=s,t.endDrag=l;var c=n(272),u=r(c),d=n(280),p=r(d),h=n(273),f=r(h),m=n(277),g=r(m),v="dnd-core/BEGIN_DRAG";t.BEGIN_DRAG=v;var y="dnd-core/PUBLISH_DRAG_SOURCE";t.PUBLISH_DRAG_SOURCE=y;var b="dnd-core/HOVER";t.HOVER=b;var w="dnd-core/DROP";t.DROP=w;var k="dnd-core/END_DRAG";t.END_DRAG=k},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return a["default"](e)?e.some(function(e){return e===t}):e===t}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){var r=n(274),i=n(279),o=n(278),a="[object Array]",s=Object.prototype,l=s.toString,c=r(Array,"isArray"),u=c||function(e){return o(e)&&i(e.length)&&l.call(e)==a};e.exports=u},function(e,t,n){function r(e,t){var n=null==e?void 0:e[t];return i(n)?n:void 0}var i=n(275);e.exports=r},function(e,t,n){function r(e){return null==e?!1:i(e)?u.test(l.call(e)):o(e)&&a.test(e)}var i=n(276),o=n(278),a=/^\[object .+?Constructor\]$/,s=Object.prototype,l=Function.prototype.toString,c=s.hasOwnProperty,u=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=r},function(e,t,n){function r(e){return i(e)&&s.call(e)==o}var i=n(277),o="[object Function]",a=Object.prototype,s=a.toString;e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){(function(t){"use strict";var n=function(e,n,r,i,o,a,s,l){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,i,o,a,s,l],d=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return u[d++]}))}throw c.framesToPop=1,c}};e.exports=n}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){switch(void 0===e&&(e=u),t.type){case a.BEGIN_DRAG:return o({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case a.HOVER:return o({},e,{targetIds:t.targetIds});case a.PUBLISH_DRAG_SOURCE:return o({},e,{isSourcePublic:!0});case s.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:o({},e,{targetIds:c["default"](e.targetIds,t.targetId)});case a.DROP:return o({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case a.END_DRAG:return o({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i;var a=n(271),s=n(282),l=n(283),c=r(l),u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};e.exports=t["default"]},function(e,t){"use strict";function n(e){return{type:a,sourceId:e}}function r(e){return{type:s,targetId:e}}function i(e){return{type:l,sourceId:e}}function o(e){return{type:c,targetId:e}}t.__esModule=!0,t.addSource=n,t.addTarget=r,t.removeSource=i,t.removeTarget=o;var a="dnd-core/ADD_SOURCE";t.ADD_SOURCE=a;var s="dnd-core/ADD_TARGET";t.ADD_TARGET=s;var l="dnd-core/REMOVE_SOURCE";t.REMOVE_SOURCE=l;var c="dnd-core/REMOVE_TARGET";t.REMOVE_TARGET=c},function(e,t,n){var r=n(284),i=n(291),o=n(294),a=o(function(e,t){return i(e)?r(e,t):[]});e.exports=a},function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var l=-1,c=i,u=!0,d=u&&t.length>=s?a(t):null,p=t.length;d&&(c=o,u=!1,t=d);e:for(;++l<n;){var h=e[l];if(u&&h===h){for(var f=p;f--;)if(t[f]===h)continue e;r.push(h)}else c(t,h,0)<0&&r.push(h)}return r}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){function r(e,t,n){if(t!==t)return i(e,n);for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var i=n(286);e.exports=r},function(e,t){function n(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i<r;){var o=e[i];if(o!==o)return i}return-1}e.exports=n},function(e,t,n){function r(e,t){var n=e.data,r="string"==typeof t||i(t)?n.set.has(t):n.hash[t];return r?0:-1}var i=n(277);e.exports=r},function(e,t,n){(function(t){function r(e){return s&&a?new i(e):null}var i=n(289),o=n(274),a=o(t,"Set"),s=o(Object,"create");e.exports=r}).call(t,function(){return this}())},function(e,t,n){(function(t){function r(e){var t=e?e.length:0;for(this.data={hash:s(null),set:new a};t--;)this.push(e[t])}var i=n(290),o=n(274),a=o(t,"Set"),s=o(Object,"create");r.prototype.push=i,e.exports=r}).call(t,function(){return this}())},function(e,t,n){function r(e){var t=this.data;"string"==typeof e||i(e)?t.set.add(e):t.hash[e]=!0}var i=n(277);e.exports=r},function(e,t,n){function r(e){return null!=e&&o(i(e))}var i=n(292),o=n(279);e.exports=r},function(e,t,n){var r=n(293),i=r("length");e.exports=i},function(e,t){function n(e){return function(t){return null==t?void 0:t[e]}}e.exports=n},function(e,t){function n(e,t){if("function"!=typeof e)throw new TypeError(r);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var r="Expected a function",i=Math.max;e.exports=n},function(e,t,n){"use strict";function r(e,t){switch(void 0===e&&(e=0),t.type){case i.ADD_SOURCE:case i.ADD_TARGET:return e+1;case i.REMOVE_SOURCE:case i.REMOVE_TARGET:return e-1;default:return e}}t.__esModule=!0,t["default"]=r;var i=n(282);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){switch(void 0===e&&(e=p),t.type){case u.HOVER:break;case d.ADD_SOURCE:case d.ADD_TARGET:case d.REMOVE_TARGET:case d.REMOVE_SOURCE:return p;case u.BEGIN_DRAG:case u.PUBLISH_DRAG_SOURCE:case u.END_DRAG:case u.DROP:default:return h}var r=t.targetIds,i=n.targetIds,o=s["default"](r,i),a=!1;if(0===o.length){for(var l=0;l<r.length;l++)if(r[l]!==i[l]){a=!0;break}}else a=!0;if(!a)return p;var c=i[i.length-1],f=r[r.length-1];return c!==f&&(c&&o.push(c),f&&o.push(f)),o}function o(e,t){return e===p?!1:e===h||"undefined"==typeof t?!0:c["default"](t,e).length>0}t.__esModule=!0,t["default"]=i,t.areDirty=o;var a=n(297),s=r(a),l=n(300),c=r(l),u=n(271),d=n(282),p=[],h=[]},function(e,t,n){function r(){for(var e=-1,t=arguments.length;++e<t;){var n=arguments[e];if(s(n))var r=r?i(o(r,n),o(n,r)):n}return r?a(r):[]}var i=n(298),o=n(284),a=n(299),s=n(291);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}e.exports=n},function(e,t,n){function r(e,t){var n=-1,r=i,l=e.length,c=!0,u=c&&l>=s,d=u?a():null,p=[];d?(r=o,c=!1):(u=!1,d=t?[]:p);e:for(;++n<l;){var h=e[n],f=t?t(h,n,e):h;if(c&&h===h){for(var m=d.length;m--;)if(d[m]===f)continue e;t&&d.push(f),p.push(h)}else r(d,f,0)<0&&((t||u)&&d.push(f),p.push(h))}return p}var i=n(285),o=n(287),a=n(288),s=200;e.exports=r},function(e,t,n){var r=n(285),i=n(287),o=n(288),a=n(291),s=n(294),l=s(function(e){for(var t=e.length,n=t,s=Array(f),l=r,c=!0,u=[];n--;){var d=e[n]=a(d=e[n])?d:[];s[n]=c&&d.length>=120?o(n&&d):null}var p=e[0],h=-1,f=p?p.length:0,m=s[0];e:for(;++h<f;)if(d=p[h],(m?i(m,d):l(u,d,0))<0){for(var n=t;--n;){var g=s[n];if((g?i(g,d):l(e[n],d,0))<0)continue e}m&&m.push(d),u.push(d)}return u});e.exports=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(280),a=r(o),s=n(272),l=r(s),c=n(273),u=r(c),d=n(302),p=r(d),h=n(270),f=n(296),m=function(){function e(t){i(this,e),this.store=t,this.registry=new p["default"](t)}return e.prototype.subscribeToStateChange=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=n.handlerIds;a["default"]("function"==typeof e,"listener must be a function."),a["default"]("undefined"==typeof r||u["default"](r),"handlerIds, when specified, must be an array of strings.");var i=function(){f.areDirty(t.store.getState().dirtyHandlerIds,r)&&e()};return this.store.subscribe(i)},e.prototype.subscribeToOffsetChange=function(e){var t=this;a["default"]("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)},e.prototype.canDragSource=function(e){var t=this.registry.getSource(e);return a["default"](t,"Expected to find a valid source."),this.isDragging()?!1:t.canDrag(this,e)},e.prototype.canDropOnTarget=function(e){var t=this.registry.getTarget(e);if(a["default"](t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return l["default"](n,r)&&t.canDrop(this,e)},e.prototype.isDragging=function(){return Boolean(this.getItemType())},e.prototype.isDraggingSource=function(e){var t=this.registry.getSource(e,!0);if(a["default"](t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n!==r?!1:t.isDragging(this,e)},e.prototype.isOverTarget=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.shallow,r=void 0===n?!1:n;if(!this.isDragging())return!1;var i=this.registry.getTargetType(e),o=this.getItemType();if(!l["default"](i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var s=a.indexOf(e);return r?s===a.length-1:s>-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return h.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return h.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&e.constructor===Symbol?"symbol":typeof e}function a(e){p["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),p["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),p["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function s(e){p["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),p["default"]("function"==typeof e.hover,"Expected hover to be a function."),p["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function l(e,t){return t&&g["default"](e)?void e.forEach(function(e){return l(e,!1)}):void p["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":o(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function c(e){var t=y["default"]().toString();switch(e){case w.SOURCE:return"S"+t;case w.TARGET:return"T"+t;default:p["default"](!1,"Unknown role: "+e)}}function u(e){switch(e[0]){case"S":return w.SOURCE;case"T":return w.TARGET;default:p["default"](!1,"Cannot parse handler ID: "+e)}}t.__esModule=!0;var d=n(280),p=r(d),h=n(303),f=r(h),m=n(273),g=r(m),v=n(304),y=r(v),b=n(282),w=f["default"]({SOURCE:null,TARGET:null}),k=function(){function e(t){i(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){l(e),a(t);var n=this.addHandler(w.SOURCE,e,t);return this.store.dispatch(b.addSource(n)),n},e.prototype.addTarget=function(e,t){l(e,!0),s(t);var n=this.addHandler(w.TARGET,e,t);return this.store.dispatch(b.addTarget(n)),n},e.prototype.addHandler=function(e,t,n){var r=c(e);return this.types[r]=t,this.handlers[r]=n,r},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})},e.prototype.getSource=function(e,t){p["default"](this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r},e.prototype.getTarget=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return p["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return p["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=u(e);return t===w.SOURCE},e.prototype.isTargetId=function(e){var t=u(e);return t===w.TARGET},e.prototype.removeSource=function(e){p["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(b.removeSource(e)),delete this.handlers[e],delete this.types[e]},e.prototype.removeTarget=function(e){p["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(b.removeTarget(e)),delete this.handlers[e],delete this.types[e]},e.prototype.pinSource=function(e){var t=this.getSource(e);p["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){p["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();t["default"]=k,e.exports=t["default"]},function(e,t){"use strict";var n=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=n},function(e,t){"use strict";function n(){return r++}t.__esModule=!0,t["default"]=n;var r=0;e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=function(){function e(){n(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new l(e)}t.__esModule=!0,t["default"]=o;var a=n(308),s=r(a),l=function(){function e(t){i(this,e),this.actions=t.getActions()}return e.prototype.setup=function(){this.didCallSetup=!0},e.prototype.teardown=function(){this.didCallTeardown=!0},e.prototype.connectDragSource=function(){return s["default"]},e.prototype.connectDragPreview=function(){return s["default"]},e.prototype.connectDropTarget=function(){return s["default"]},e.prototype.simulateBeginDrag=function(e,t){this.actions.beginDrag(e,t)},e.prototype.simulatePublishDragSource=function(){this.actions.publishDragSource()},e.prototype.simulateHover=function(e,t){this.actions.hover(e,t)},e.prototype.simulateDrop=function(){this.actions.drop()},e.prototype.simulateEndDrag=function(){this.actions.endDrag()},e}();e.exports=t["default"]},function(e,t){function n(){}e.exports=n},function(e,t,n){(function(n){"use strict";function r(e,t){if("production"!==n.env.NODE_ENV){for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;r>o;o++)i[o-2]=arguments[o];for(var a=0;a<i.length;a++){var s=i[a];if(s&&s.prototype&&s.prototype.render)return void console.error("You seem to be applying the arguments in the wrong order. "+("It should be "+e+"("+t+")(Component), not the other way around. ")+"Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order")}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return k["default"].apply(void 0,["DragLayer","collect[, options]"].concat(l.call(arguments))),b["default"]("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html",e),b["default"](v["default"](t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html',t),function(n){var r=t.arePropsEqual,a=void 0===r?m["default"]:r,l=n.displayName||n.name||"Component";return function(t){function r(e,n){i(this,r),t.call(this,e),this.handleChange=this.handleChange.bind(this),this.manager=n.dragDropManager,b["default"]("object"==typeof this.manager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",l,l),this.state=this.getCurrentState()}return o(r,t),r.prototype.getDecoratedComponentInstance=function(){return this.refs.child},r.prototype.shouldComponentUpdate=function(e,t){return!a(e,this.props)||!h["default"](t,this.state)},c(r,null,[{key:"DecoratedComponent",value:n,enumerable:!0},{key:"displayName",value:"DragLayer("+l+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),r.prototype.componentDidMount=function(){var e=this.manager.getMonitor();this.unsubscribe=e.subscribeToOffsetChange(this.handleChange)},r.prototype.componentWillUnmount=function(){this.unsubscribe()},r.prototype.handleChange=function(){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)},r.prototype.getCurrentState=function(){
38
38
  var t=this.manager.getMonitor();return e(t)},r.prototype.render=function(){return d["default"].createElement(n,s({},this.props,this.state,{ref:"child"}))},r}(u.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=Array.prototype.slice,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=a;var u=n(73),d=r(u),p=(n(265),n(311)),h=r(p),f=n(312),m=r(f),g=n(313),v=r(g),y=n(280),b=r(y),w=n(309),k=r(w);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;var a=e[n[o]],s=t[n[o]];if(a!==s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++){if(!i.call(t,n[o]))return!1;var a=e[n[o]],s=t[n[o]];if(a!==s||"object"==typeof a||"object"==typeof s)return!1}return!0}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){var t;if(!a(e)||u.call(e)!=s||o(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var i=n(314),o=n(319),a=n(278),s="[object Object]",l=Object.prototype,c=l.hasOwnProperty,u=l.toString;e.exports=r},function(e,t,n){function r(e,t){return i(e,t,o)}var i=n(315),o=n(318);e.exports=r},function(e,t,n){var r=n(316),i=r();e.exports=i},function(e,t,n){function r(e){return function(t,n,r){for(var o=i(t),a=r(t),s=a.length,l=e?s:-1;e?l--:++l<s;){var c=a[l];if(n(o[c],c,o)===!1)break}return t}}var i=n(317);e.exports=r},function(e,t,n){function r(e){return i(e)?e:Object(e)}var i=n(277);e.exports=r},function(e,t,n){function r(e){if(null==e)return[];l(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(o(e)||i(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,d=Array(t),p=t>0;++r<t;)d[r]=r+"";for(var h in e)p&&a(h,t)||"constructor"==h&&(c||!u.call(e,h))||d.push(h);return d}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(277),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e){return o(e)&&i(e)&&s.call(e,"callee")&&!l.call(e,"callee")}var i=n(291),o=n(278),a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;e.exports=r},function(e,t){function n(e,t){return e="number"==typeof e||r.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}var r=/^\d+$/,i=9007199254740991;e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DragSource","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(331),y=r(v),b=n(332),w=r(b),k=n(333),x=r(k),E=n(334),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.DecoratedComponent,n=e.createHandler,i=e.createMonitor,s=e.createConnector,h=e.registerHandler,m=e.containerDisplayName,v=e.getType,b=e.collect,k=e.options,E=k.arePropsEqual,_=void 0===E?g["default"]:E,C=t.displayName||t.name||"Component";return function(e){function g(t,r){o(this,g),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),w["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=i(this.manager),this.handler=n(this.handlerMonitor),this.disposable=new p.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState()}return a(g,e),g.prototype.getHandlerId=function(){return this.handlerId},g.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},g.prototype.shouldComponentUpdate=function(e,t){return!_(e,this.props)||!f["default"](t,this.state)},c(g,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:m+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:u.PropTypes.object.isRequired},enumerable:!0}]),g.prototype.componentWillReceiveProps=function(e){_(e,this.props)||(this.receiveProps(e),this.handleChange())},g.prototype.componentWillUnmount=function(){this.disposable.dispose()},g.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},g.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=h(e,this.handler,this.manager),n=t.handlerId,r=t.unregister,i=s(this.manager.getBackend()),o=x["default"](i,n),a=o.handlerConnector,l=o.disposable;this.handlerId=n,this.handlerConnector=a,this.handlerMonitor.receiveHandlerId(n);var c=this.manager.getMonitor(),u=c.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new p.CompositeDisposable(new p.Disposable(u),new p.Disposable(r),l))}},g.prototype.handleChange=function(){var e=this.getCurrentState();f["default"](e,this.state)||this.setState(e)},g.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},g.prototype.getCurrentState=function(){var e=b(this.handlerConnector,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&w["default"](y["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",m,C,e),e},g.prototype.render=function(){return d["default"].createElement(t,l({},this.props,this.state,{ref:this.handleChildRef}))},g}(u.Component)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t["default"]=s;var u=n(73),d=i(u),p=n(323),h=n(311),f=i(h),m=n(312),g=i(m),v=n(313),y=i(v),b=n(280),w=i(b),k=n(328),x=i(k);e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};t.__esModule=!0;var i=n(324),o=r(i);t.isDisposable=o["default"];var a=n(325),s=r(a);t.Disposable=s["default"];var l=n(326),c=r(l);t.CompositeDisposable=c["default"];var u=n(327),d=r(u);t.SerialDisposable=d["default"]},function(e,t){"use strict";function n(e){return Boolean(e&&"function"==typeof e.dispose)}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.__esModule=!0;var i=function(){},o=function(){function e(t){n(this,e),this.isDisposed=!1,this.action=t||i}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},r(e,null,[{key:"empty",enumerable:!0,value:{dispose:i}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];i(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var o=0;o<n.length;o++)if(!a["default"](n[o]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return-1===t?!1:(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;e>n;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(var n=0;e>n;n++)t[n].dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o=n(324),a=r(o),s=function(){function e(){i(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=new s.CompositeDisposable,r={};return Object.keys(e).forEach(function(i){var o=a["default"](t,e[i]),s=o.disposable,l=o.ref;n.add(s),r[i]=function(){return l}}),{disposable:n,handlerConnector:r}}t.__esModule=!0,t["default"]=i;var o=n(329),a=r(o),s=n(323);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){function n(s,d){if(u.isValidElement(s)){var p=s;return l["default"](p,function(e){return n(e,d)})}var h=u.findDOMNode(s);if(h!==i||!a["default"](o,d)){if(i=h,o=d,!h)return void r.setDisposable(null);var f=t(e,h,d);r.setDisposable(new c.Disposable(f))}}var r=new c.SerialDisposable,i=null,o=null;return{ref:n,disposable:r}}t.__esModule=!0,t["default"]=i;var o=n(311),a=r(o),s=n(330),l=r(s),c=n(323),u=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=e.ref;return a["default"]("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),s.cloneElement(e,{ref:function(e){t(e),n&&n(e)}})}t.__esModule=!0,t["default"]=i;var o=n(280),a=r(o),s=n(73);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeSource(o)}var i=n.getRegistry(),o=i.addSource(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),p.forEach(function(t){l["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return e.canDrag?e.canDrag(this.props,this.monitor):!0},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"](u["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrag","beginDrag","canDrag","isDragging","endDrag"],p=["beginDrag"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new u(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=!1,u=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){s["default"](!l,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{l=!1}},e.prototype.isDragging=function(){s["default"](!c,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return c=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{c=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dragSource:e.connectDragSource.bind(e),dragPreview:e.connectDragPreview.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return"string"==typeof e||"symbol"==typeof e||t&&a["default"](e)&&e.every(function(e){return i(e,!1)})}t.__esModule=!0,t["default"]=i;var o=n(273),a=r(o);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(o.call(arguments)));var i=e;"function"!=typeof e&&(u["default"](T["default"](e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',e),i=function(){return e}),u["default"](p["default"](t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',t);var a=w["default"](t);return u["default"]("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),u["default"](p["default"](r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',n),function(e){return g["default"]({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:y["default"],createMonitor:x["default"],createConnector:_["default"],DecoratedComponent:e,getType:i,collect:n,options:r})}}t.__esModule=!0;var o=Array.prototype.slice;t["default"]=i;var a=n(73),s=(r(a),n(311)),l=(r(s),n(312)),c=(r(l),n(280)),u=r(c),d=n(313),p=r(d),h=n(309),f=r(h),m=n(322),g=r(m),v=n(337),y=r(v),b=n(338),w=r(b),k=n(339),x=r(k),E=n(340),_=r(E),C=n(335),T=r(C);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){i.removeTarget(o)}var i=n.getRegistry(),o=i.addTarget(e,t);return{handlerId:o,unregister:r}}t.__esModule=!0,t["default"]=i;var o=n(280);r(o);e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){l["default"](d.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',d.join(", "),t),l["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){o(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return e.canDrop?e.canDrop(this.props,this.monitor):!0},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&l["default"]("undefined"==typeof t||u["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=n(280),l=i(s),c=n(313),u=i(c),d=["canDrop","hover","drop"];e.exports=t["default"]}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return new c(e)}t.__esModule=!0,t["default"]=o;var a=n(280),s=r(a),l=!1,c=function(){function e(t){i(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){s["default"](!l,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return l=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{l=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function n(e){return{dropTarget:e.connectDropTarget.bind(e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return _||(_=new Image,_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),_}function l(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function c(e){var t=T[e],n=t.exposeProperty,r=t.matchesTypes,s=t.getData;return function(e){function t(){i(this,t),e.call(this),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return o(t,e),t.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=s(e,r)},t.prototype.beginDrag=function(){return this.item},t}(h.DragSource)}function u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(T).filter(function(e){var n=T[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}function d(e){return new S(e)}t.__esModule=!0;var p;t.getEmptyImage=s,t["default"]=d;var h=n(265),f=n(342),m=r(f),g=n(345),v=n(352),y=n(311),b=r(y),w=n(354),k=r(w),x=n(280),E=r(x),_=void 0,C={FILE:"__NATIVE_FILE__",URL:"__NATIVE_URL__",TEXT:"__NATIVE_TEXT__"};t.NativeTypes=C;var T=(p={},a(p,C.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(p,C.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return l(e,t,"").split("\n")}}),a(p,C.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return l(e,t,"")}}),p),S=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new m["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this)}return e.prototype.setup=function(){"undefined"!=typeof window&&(E["default"](!this.constructor.isSetUp,"Cannot have two HTML5 backends at the same time."),this.constructor.isSetUp=!0,window.addEventListener("dragstart",this.handleTopDragStart),window.addEventListener("dragstart",this.handleTopDragStartCapture,!0),window.addEventListener("dragend",this.handleTopDragEndCapture,!0),window.addEventListener("dragenter",this.handleTopDragEnter),window.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.addEventListener("dragover",this.handleTopDragOver),window.addEventListener("dragover",this.handleTopDragOverCapture,!0),window.addEventListener("drop",this.handleTopDrop),window.addEventListener("drop",this.handleTopDropCapture,!0))},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,window.removeEventListener("dragstart",this.handleTopDragStart),window.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),window.removeEventListener("dragend",this.handleTopDragEndCapture,!0),window.removeEventListener("dragenter",this.handleTopDragEnter),window.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),window.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),window.removeEventListener("dragover",this.handleTopDragOver),window.removeEventListener("dragover",this.handleTopDragOverCapture,!0),window.removeEventListener("drop",this.handleTopDrop),window.removeEventListener("drop",this.handleTopDropCapture,!0),this.clearCurrentDragSourceNode())},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var i=function(t){return r.handleDragStart(t,e)},o=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",i),t.addEventListener("selectstart",o),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",i),t.removeEventListener("selectstart",o),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},i=function(t){return n.handleDragOver(t,e)},o=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("drop",o),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",i),t.removeEventListener("drop",o)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return k["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return k["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return v.getElementClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(C).some(function(t){return C[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=c(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])},e.prototype.endDragNativeItem=function(){this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||(this.actions.endDrag(),this.clearCurrentDragSourceNode())},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=v.getElementClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return this.currentDragSourceNode?(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0):!1},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return e?this.currentDragSourceNodeOffsetChanged?!0:(this.currentDragSourceNodeOffsetChanged=!b["default"](v.getElementClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged):!1},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=v.getEventClientOffset(e);
39
- this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t);if(h&&h.data){var f="data:"+h.mimetype.string+";base64,"+h.data;e=e.replace(a,'src="'+f)}else o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
39
+ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var i=e.dataTransfer,o=u(i);if(this.monitor.isDragging()){if("function"==typeof i.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],l=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,p=c.anchorY,h={anchorX:d,anchorY:p},f=v.getDragPreviewOffset(s,l,r,h);i.setDragImage(l,f.x,f.y)}try{i.setData("application/json",{})}catch(m){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(o)this.beginDragNativeItem(o);else{if(!(i.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=u(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){g.isFirefox()||this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:v.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:v.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){"function"==typeof e.target.dragDrop&&(e.preventDefault(),e.target.dragDrop())},e}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(343),a=r(o),s=n(283),l=r(s),c=function(){function e(){i(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a["default"](this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=l["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=c,e.exports=t["default"]},function(e,t,n){var r=n(344),i=n(299),o=n(294),a=o(function(e){return i(r(e,!1,!0))});e.exports=a},function(e,t,n){function r(e,t,n,c){c||(c=[]);for(var u=-1,d=e.length;++u<d;){var p=e[u];l(p)&&s(p)&&(n||a(p)||o(p))?t?r(p,t,n,c):i(c,p):n||(c[c.length]=p)}return c}var i=n(298),o=n(319),a=n(273),s=n(291),l=n(278);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(346),o=r(i),a=o["default"](function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=o["default"](function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,n){function r(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new r.Cache,n}var i=n(347),o="Expected a function";r.Cache=i,e.exports=r},function(e,t,n){function r(){this.__data__={}}var i=n(348),o=n(349),a=n(350),s=n(351);r.prototype["delete"]=i,r.prototype.get=o,r.prototype.has=a,r.prototype.set=s,e.exports=r},function(e,t){function n(e){return this.has(e)&&delete this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"==e?void 0:this.__data__[e]}e.exports=n},function(e,t){function n(e){return"__proto__"!=e&&i.call(this.__data__,e)}var r=Object.prototype,i=r.hasOwnProperty;e.exports=n},function(e,t){function n(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e.nodeType!==u&&(e=e.parentElement),!e)return null;var t=e.getBoundingClientRect(),n=t.top,r=t.left;return{x:r,y:n}}function o(e){return{x:e.clientX,y:e.clientY}}function a(e,t,n,r){var o="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=o?e:t,l=i(a),u={x:n.x-l.x,y:n.y-l.y},d=e.offsetWidth,p=e.offsetHeight,h=r.anchorX,f=r.anchorY,m=o?t.width:d,g=o?t.height:p;s.isSafari()&&o?(g/=window.devicePixelRatio,m/=window.devicePixelRatio):s.isFirefox()&&!o&&(g*=window.devicePixelRatio,m*=window.devicePixelRatio);var v=c["default"]([0,.5,1],[u.x,u.x/d*m,u.x+m-d]),y=c["default"]([0,.5,1],[u.y,u.y/p*g,u.y+g-p]),b=v(h),w=y(f);return s.isSafari()&&o&&(w+=(window.devicePixelRatio-1)*g),{x:b,y:w}}t.__esModule=!0,t.getElementClientOffset=i,t.getEventClientOffset=o,t.getDragPreviewOffset=a;var s=n(345),l=n(353),c=r(l),u=1},function(e,t){"use strict";function n(e,t){for(var n=e.length,r=[],i=0;n>i;i++)r.push(i);r.sort(function(t,n){return e[t]<e[n]?-1:1});var o=e,a=t;e=[],t=[];for(var i=0;n>i;i++)e.push(+o[r[i]]),t.push(+a[r[i]]);for(var s=[],l=[],c=[],u=void 0,d=void 0,i=0;n-1>i;i++)u=e[i+1]-e[i],d=t[i+1]-t[i],l.push(u),s.push(d),c.push(d/u);for(var p=[c[0]],i=0;i<l.length-1;i++){var h=c[i],f=c[i+1];if(0>=h*f)p.push(0);else{u=l[i];var m=l[i+1],g=u+m;p.push(3*g/((g+m)/h+(g+u)/f))}}p.push(c[c.length-1]);for(var v=[],y=[],b=void 0,i=0;i<p.length-1;i++){b=c[i];var w=p[i],k=1/l[i],g=w+p[i+1]-b-b;v.push((b-w-g)*k),y.push(g*k*k)}return function(n){var r=e.length-1;if(n===e[r])return t[r];for(var i=0,o=y.length-1,a=void 0;o>=i;){a=Math.floor(.5*(i+o));var s=e[a];if(n>s)i=a+1;else{if(!(s>n))return t[a];o=a-1}}r=Math.max(0,o);var l=n-e[r],c=l*l;return t[r]+p[r]*l+v[r]*c+y[r]*l*c}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){var r=n(355),i=n(365),o=n(366),a=o(r,i);e.exports=a},function(e,t,n){var r=n(356),i=n(359),o=n(361),a=o(function(e,t,n){return n?r(e,t,n):i(e,t)});e.exports=a},function(e,t,n){function r(e,t,n){for(var r=-1,o=i(t),a=o.length;++r<a;){var s=o[r],l=e[s],c=n(l,t[s],s,e,t);(c===c?c===l:l!==l)&&(void 0!==l||s in e)||(e[s]=c)}return e}var i=n(357);e.exports=r},function(e,t,n){var r=n(274),i=n(291),o=n(277),a=n(358),s=r(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?a(e):o(e)?s(e):[]}:a;e.exports=l},function(e,t,n){function r(e){for(var t=l(e),n=t.length,r=n&&e.length,c=!!r&&s(r)&&(o(e)||i(e)),d=-1,p=[];++d<n;){var h=t[d];(c&&a(h,r)||u.call(e,h))&&p.push(h)}return p}var i=n(319),o=n(273),a=n(320),s=n(279),l=n(318),c=Object.prototype,u=c.hasOwnProperty;e.exports=r},function(e,t,n){function r(e,t){return null==t?e:i(t,o(t),e)}var i=n(360),o=n(357);e.exports=r},function(e,t){function n(e,t,n){n||(n={});for(var r=-1,i=t.length;++r<i;){var o=t[r];n[o]=e[o]}return n}e.exports=n},function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,l=a>2?n[2]:void 0,c=a>1?n[a-1]:void 0;for("function"==typeof s?(s=i(s,c,5),a-=2):(s="function"==typeof c?c:void 0,a-=s?1:0),l&&o(n[0],n[1],l)&&(s=3>a?void 0:s,a=1);++r<a;){var u=n[r];u&&e(t,u,s)}return t})}var i=n(362),o=n(364),a=n(294);e.exports=r},function(e,t,n){function r(e,t,n){if("function"!=typeof e)return i;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)};case 5:return function(n,r,i,o,a){return e.call(t,n,r,i,o,a)}}return function(){return e.apply(t,arguments)}}var i=n(363);e.exports=r},function(e,t){function n(e){return e}e.exports=n},function(e,t,n){function r(e,t,n){if(!a(n))return!1;var r=typeof t;if("number"==r?i(n)&&o(t,n.length):"string"==r&&t in n){var s=n[t];return e===e?e===s:s!==s}return!1}var i=n(291),o=n(320),a=n(277);e.exports=r},function(e,t){function n(e,t){return void 0===e?t:e}e.exports=n},function(e,t,n){function r(e,t){return i(function(n){var r=n[0];return null==r?r:(n.push(t),e.apply(void 0,n))})}var i=n(294);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"render",value:function(){var e="preview "+this.props.previewState;return c["default"].createElement("section",{className:e},c["default"].createElement("header",{className:"container"},c["default"].createElement("button",{className:"close",onClick:this.props.onClosePreview},c["default"].createElement("i",{className:"fa fa-times fa-2x"}))),c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);d.propTypes={onClosePreview:c["default"].PropTypes.func.isRequired,html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(238),o=r(i),a=/src="images\/([\w,\s-]+\.(?:(?:png)|(?:jpg)|(?:jpeg)|(?:gif)|(?:bmp)))/,s=new RegExp(a.source,"g"),l=function(e,t){var n=e.match(s),r=!0,i=!1,l=void 0;try{for(var c,u=(n||[])[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var d=c.value,p=d.substr(d.lastIndexOf("/")+1),h=o["default"].getSync(p,"image",t),f=void 0;h?(h.data?f="data:"+h.mimetype.string+";base64,"+h.data:h.url&&(f=h.url),e=e.replace(a,'src="'+f)):o["default"].get(p,t,"image")}}catch(m){i=!0,l=m}finally{try{!r&&u["return"]&&u["return"]()}finally{if(i)throw l}}return e};t.fixImagePaths=l;var c=function(e,t){var n=void 0;if(!(n=localStorage.getItem(e)))return t;try{return n=JSON.parse(n)}catch(r){return n}};t.getCached=c;var u=function(e,t){return localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),t};t.setCached=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(368),d=n(370),p=r(d),h=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidUpdate",value:function(e,t){if(this.props.previewState!==e.previewState){var n=p["default"]("[data-markua-cursor-position='__markuaCursorPosition__']").get(0);n&&p["default"](c["default"].findDOMNode(this)).animate({scrollTop:n.offsetTop-100},200)}}},{key:"render",value:function(){return c["default"].createElement("section",{className:"live-preview "+this.props.previewState},c["default"].createElement("section",{className:"preloader"}),c["default"].createElement("section",{className:"previewWarnigs"}),c["default"].createElement("section",{className:"previewErrors"},this.props.previewErrors),c["default"].createElement("div",{ref:"content",dangerouslySetInnerHTML:{__html:u.fixImagePaths(this.props.html,this.forceUpdate.bind(this))},className:"container content"}))}}]),t}(c["default"].Component);h.propTypes={html:c["default"].PropTypes.string.isRequired,previewState:c["default"].PropTypes.string.isRequired,previewErrors:c["default"].PropTypes.string},t["default"]=h,e.exports=t["default"]},function(e,t,n){var r,i;/*!
40
40
  * jQuery JavaScript Library v2.1.4
41
41
  * http://jquery.com/
42
42
  *
@@ -61,8 +61,8 @@ this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceC
61
61
  */
62
62
  function(e){function t(e,t,n,r){var i,o,a,s,l,c,d,h,f,m;if((t?t.ownerDocument||t:$)!==L&&R(t),t=t||L,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&N){if(11!==s&&(i=ye.exec(e)))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&P(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return J.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&k.getElementsByClassName)return J.apply(n,t.getElementsByClassName(a)),n}if(k.qsa&&(!M||!M.test(e))){if(h=d=j,f=t,m=1!==s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+p(c[l]);f=be.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return J.apply(n,f.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return S(e.replace(le,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>x.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[j]=!0,e}function i(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)x.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[z,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[j]||(t[j]={}),(s=l[r])&&s[0]===z&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function f(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[j]&&(i=v(i)),o&&!o[j]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,p=[],h=[],f=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,p,e,s,l),b=n?o||(r?e:f||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?ee(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(f,b.length):b),o?o(null,a,b,l):J.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=x.relative[e[0].type],a=o||x.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),u=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];i>s;s++)if(n=x.relative[e[s].type])u=[h(f(u),n)];else{if(n=x.filter[e[s].type].apply(null,e[s].matches),n[j]){for(r=++s;i>r&&!x.relative[e[r].type];r++);return v(s>1&&f(u),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}u.push(n)}return f(u)}function b(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,l,c){var u,d,p,h=0,f="0",m=r&&[],v=[],y=A,b=r||o&&x.find.TAG("*",c),w=z+=null==y?1:Math.random()||.1,k=b.length;for(c&&(A=a!==L&&a);f!==k&&null!=(u=b[f]);f++){if(o&&u){for(d=0;p=e[d++];)if(p(u,a,s)){l.push(u);break}c&&(z=w)}i&&((u=!p&&u)&&h--,r&&m.push(u))}if(h+=f,i&&f!==h){for(d=0;p=n[d++];)p(m,v,a,s);if(r){if(h>0)for(;f--;)m[f]||v[f]||(v[f]=X.call(l));v=g(v)}J.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(l)}return c&&(z=w,A=y),m};return i?r(a):a}var w,k,x,E,_,C,T,S,A,F,D,R,L,O,N,M,I,B,P,j="sizzle"+1*new Date,$=e.document,z=0,W=0,V=n(),U=n(),H=n(),q=function(e,t){return e===t&&(D=!0),0},G=1<<31,K={}.hasOwnProperty,Y=[],X=Y.pop,Q=Y.push,J=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),le=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ce=new RegExp("^"+ne+"*,"+ne+"*"),ue=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(ae),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,we=/'|\\/g,ke=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ee=function(){R()};try{J.apply(Y=Z.call($.childNodes),$.childNodes),Y[$.childNodes.length].nodeType}catch(_e){J={apply:Y.length?function(e,t){Q.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}k=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},R=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:$;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,O=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),N=!_(r),k.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),k.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),k.getElementsByClassName=ve.test(r.getElementsByClassName),k.getById=i(function(e){return O.appendChild(e).id=j,!r.getElementsByName||!r.getElementsByName(j).length}),k.getById?(x.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){return e.getAttribute("id")===t}}):(delete x.find.ID,x.filter.ID=function(e){var t=e.replace(ke,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),x.find.TAG=k.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):k.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},x.find.CLASS=k.getElementsByClassName&&function(e,t){return N?t.getElementsByClassName(e):void 0},I=[],M=[],(k.qsa=ve.test(r.querySelectorAll))&&(i(function(e){O.appendChild(e).innerHTML="<a id='"+j+"'></a><select id='"+j+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+j+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||M.push(".#.+[+~]")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(k.matchesSelector=ve.test(B=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&i(function(e){k.disconnectedMatch=B.call(e,"div"),B.call(e,"[s!='']:x"),I.push("!=",ae)}),M=M.length&&new RegExp(M.join("|")),I=I.length&&new RegExp(I.join("|")),t=ve.test(O.compareDocumentPosition),P=t||ve.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!k.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===$&&P($,e)?-1:t===r||t.ownerDocument===$&&P($,t)?1:F?ee(F,e)-ee(F,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:F?ee(F,e)-ee(F,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===$?-1:c[i]===$?1:0},r):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&R(e),n=n.replace(de,"='$1']"),k.matchesSelector&&N&&(!I||!I.test(n))&&(!M||!M.test(n)))try{var r=B.call(e,n);if(r||k.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&R(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&R(e);var n=x.attrHandle[t.toLowerCase()],r=n&&K.call(x.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:k.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!k.detectDuplicates,F=!k.sortStable&&e.slice(0),e.sort(q),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return F=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},x=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ke,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(ke,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ke,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){for(u=g[j]||(g[j]={}),c=u[e]||[],h=c[0]===z&&c[1],p=c[0]===z&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(p=h=0)||f.pop();)if(1===d.nodeType&&++p&&d===t){u[e]=[z,h,p];break}}else if(y&&(c=(t[j]||(t[j]={}))[e])&&c[0]===z)p=c[1];else for(;(d=++h&&d&&d[m]||(p=h=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++p||(y&&((d[j]||(d[j]={}))[e]=[z,p]),d!==t)););return p-=i,p===r||p%r===0&&p/r>=0}}},PSEUDO:function(e,n){var i,o=x.pseudos[e]||x.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[j]?o(n):o.length>1?(i=[e,e,"",n],x.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=T(e.replace(le,"$1"));return i[j]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ke,xe),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ke,xe).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},x.pseudos.nth=x.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})x.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})x.pseudos[w]=l(w);return d.prototype=x.filters=x.pseudos,x.setFilters=new d,C=t.tokenize=function(e,n){var r,i,o,a,s,l,c,u=U[e+" "];if(u)return n?0:u.slice(0);for(s=e,l=[],c=x.preFilter;s;){(!r||(i=ce.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ue.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(le," ")}),s=s.slice(r.length));for(a in x.filter)!(i=fe[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):U(e,l).slice(0)},T=t.compile=function(e,t){var n,r=[],i=[],o=H[e+" "];if(!o){for(t||(t=C(e)),n=t.length;n--;)o=y(t[n]),o[j]?r.push(o):i.push(o);o=H(e,b(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&C(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&k.getById&&9===t.nodeType&&N&&x.relative[o[1].type]){if(t=(x.find.ID(a.matches[0].replace(ke,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!x.relative[s=a.type]);)if((l=x.find[s])&&(r=l(a.matches[0].replace(ke,xe),be.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return J.apply(n,r),n;break}}return(c||T(e,d))(r,t,!N,n,be.test(e)&&u(t.parentNode)||t),n},k.sortStable=j.split("").sort(q).join("")===j,k.detectDuplicates=!!D,R(),k.sortDetached=i(function(e){return 1&e.compareDocumentPosition(L.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),k.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);re.find=le,re.expr=le.selectors,re.expr[":"]=re.expr.pseudos,re.unique=le.uniqueSort,re.text=le.getText,re.isXMLDoc=le.isXML,re.contains=le.contains;var ce=re.expr.match.needsContext,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,de=/^.[^:#\[\.,]*$/;re.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?re.find.matchesSelector(r,e)?[r]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},re.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(re(e).filter(function(){for(t=0;n>t;t++)if(re.contains(i[t],this))return!0}));for(t=0;n>t;t++)re.find(e,i[t],r);return r=this.pushStack(n>1?re.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(s(this,e||[],!1))},not:function(e){return this.pushStack(s(this,e||[],!0))},is:function(e){return!!s(this,"string"==typeof e&&ce.test(e)?re(e):e||[],!1).length}});var pe,he=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,fe=re.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:he.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),ue.test(n[1])&&re.isPlainObject(t))for(n in t)re.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=te.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=te,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(re):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))};fe.prototype=re.fn,pe=re(te);var me=/^(?:parents|prev(?:Until|All))/,ge={children:!0,contents:!0,next:!0,prev:!0};re.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&re(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),re.fn.extend({has:function(e){var t=re(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(re.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=ce.test(e)||"string"!=typeof e?re(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&re.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?re.unique(o):o)},index:function(e){return e?"string"==typeof e?X.call(re(e),this[0]):X.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.unique(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,n){return re.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,n){return re.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return re.dir(e,"previousSibling",n)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return e.contentDocument||re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(n,r){var i=re.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=re.filter(r,i)),this.length>1&&(ge[e]||re.unique(i),me.test(e)&&i.reverse()),this.pushStack(i)}});var ve=/\S+/g,ye={};re.Callbacks=function(e){e="string"==typeof e?ye[e]||c(e):re.extend({},e);var t,n,r,i,o,a,s=[],l=!e.once&&[],u=function(c){for(t=e.memory&&c,n=!0,a=i||0,i=0,o=s.length,r=!0;s&&o>a;a++)if(s[a].apply(c[0],c[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,s&&(l?l.length&&u(l.shift()):t?s=[]:d.disable())},d={add:function(){if(s){var n=s.length;!function a(t){re.each(t,function(t,n){var r=re.type(n);"function"===r?e.unique&&d.has(n)||s.push(n):n&&n.length&&"string"!==r&&a(n)})}(arguments),r?o=s.length:t&&(i=n,u(t))}return this},remove:function(){return s&&re.each(arguments,function(e,t){for(var n;(n=re.inArray(t,s,n))>-1;)s.splice(n,1),r&&(o>=n&&o--,a>=n&&a--)}),this},has:function(e){return e?re.inArray(e,s)>-1:!(!s||!s.length)},empty:function(){return s=[],o=0,this},disable:function(){return s=l=t=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,t||d.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!s||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],r?l.push(t):u(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(n){re.each(t,function(t,o){var a=re.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,r):r}},i={};return r.pipe=r.then,re.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=G.call(arguments),a=o.length,s=1!==a||e&&re.isFunction(e.promise)?a:0,l=1===s?e:re.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?G.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&re.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}});var be;re.fn.ready=function(e){return re.ready.promise().done(e),this},re.extend({isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){(e===!0?--re.readyWait:re.isReady)||(re.isReady=!0,e!==!0&&--re.readyWait>0||(be.resolveWith(te,[re]),re.fn.triggerHandler&&(re(te).triggerHandler("ready"),re(te).off("ready"))))}}),re.ready.promise=function(e){return be||(be=re.Deferred(),"complete"===te.readyState?setTimeout(re.ready):(te.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",u,!1))),be.promise(e)},re.ready.promise();var we=re.access=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===re.type(n)){i=!0;for(s in n)re.access(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,re.isFunction(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(re(e),n)})),t))for(;l>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:c?t.call(e):l?t(e[0],n):o};re.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},d.uid=1,d.accepts=re.acceptData,d.prototype={key:function(e){if(!d.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=d.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,re.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(re.isEmptyObject(o))re.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,re.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),a=this.cache[o];if(void 0===t)this.cache[o]={};else{re.isArray(t)?r=t.concat(t.map(re.camelCase)):(i=re.camelCase(t),t in a?r=[t,i]:(r=i,r=r in a?[r]:r.match(ve)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(e){return!re.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ke=new d,xe=new d,Ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/([A-Z])/g;re.extend({hasData:function(e){return xe.hasData(e)||ke.hasData(e)},data:function(e,t,n){return xe.access(e,t,n)},removeData:function(e,t){xe.remove(e,t)},_data:function(e,t,n){return ke.access(e,t,n)},_removeData:function(e,t){ke.remove(e,t)}}),re.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=xe.get(o),1===o.nodeType&&!ke.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=re.camelCase(r.slice(5)),p(o,r,i[r])));ke.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){xe.set(this,e)}):we(this,function(t){var n,r=re.camelCase(e);if(o&&void 0===t){if(n=xe.get(o,e),void 0!==n)return n;if(n=xe.get(o,r),void 0!==n)return n;if(n=p(o,r,void 0),void 0!==n)return n}else this.each(function(){var n=xe.get(this,r);xe.set(this,r,t),-1!==e.indexOf("-")&&void 0!==n&&xe.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){xe.remove(this,e)})}}),re.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=ke.get(e,t),n&&(!r||re.isArray(n)?r=ke.access(e,t,re.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=re.queue(e,t),r=n.length,i=n.shift(),o=re._queueHooks(e,t),a=function(){re.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ke.get(e,n)||ke.access(e,n,{empty:re.Callbacks("once memory").add(function(){ke.remove(e,[t+"queue",n])})})}}),re.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?re.queue(this[0],e):void 0===t?this:this.each(function(){var n=re.queue(this,e,t);re._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=re.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ke.get(o[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Ce=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=["Top","Right","Bottom","Left"],Se=function(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)},Ae=/^(?:checkbox|radio)$/i;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ee.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ee.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Fe="undefined";ee.focusinBubbles="onfocusin"in n;var De=/^key/,Re=/^(?:mouse|pointer|contextmenu)|click/,Le=/^(?:focusinfocus|focusoutblur)$/,Oe=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.get(e);if(g)for(n.handler&&(o=n,n=o.handler,i=o.selector),n.guid||(n.guid=re.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return typeof re!==Fe&&re.event.triggered!==t.type?re.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(ve)||[""],c=t.length;c--;)s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h&&(d=re.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=re.event.special[h]||{},u=re.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&re.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=l[h])||(p=l[h]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,f,a)!==!1||e.addEventListener&&e.addEventListener(h,a,!1)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),re.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,p,h,f,m,g=ke.hasData(e)&&ke.get(e);if(g&&(l=g.events)){for(t=(t||"").match(ve)||[""],c=t.length;c--;)if(s=Oe.exec(t[c])||[],h=m=s[1],f=(s[2]||"").split(".").sort(),h){for(d=re.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,p=l[h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)u=p[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||re.removeEvent(e,h,g.handle),delete l[h])}else for(h in l)re.event.remove(e,h+t[c],n,r,!0);re.isEmptyObject(l)&&(delete g.handle,ke.remove(e,"events"))}},trigger:function(e,t,r,i){var o,a,s,l,c,u,d,p=[r||te],h=Z.call(e,"type")?e.type:e,f=Z.call(e,"namespace")?e.namespace.split("."):[];if(a=s=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!Le.test(h+re.event.triggered)&&(h.indexOf(".")>=0&&(f=h.split("."),h=f.shift(),f.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[re.expando]?e:new re.Event(h,"object"==typeof e&&e),
63
63
  e.isTrigger=i?2:3,e.namespace=f.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:re.makeArray(t,[e]),d=re.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!i&&!d.noBubble&&!re.isWindow(r)){for(l=d.delegateType||h,Le.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||te)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)e.type=o>1?l:d.bindType||h,u=(ke.get(a,"events")||{})[e.type]&&ke.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&re.acceptData(a)&&(e.result=u.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,i||e.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),t)!==!1||!re.acceptData(r)||c&&re.isFunction(r[h])&&!re.isWindow(r)&&(s=r[c],s&&(r[c]=null),re.event.triggered=h,r[h](),re.event.triggered=void 0,s&&(r[c]=s)),e.result}},dispatch:function(e){e=re.event.fix(e);var t,n,r,i,o,a=[],s=G.call(arguments),l=(ke.get(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(a=re.event.handlers.call(this,e,l),t=0;(i=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((re.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,a=[],s=t.delegateCount,l=e.target;if(s&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)o=t[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?re(i,this).index(l)>=0:re.find(i,this,null,[l]).length),r[i]&&r.push(o);r.length&&a.push({elem:l,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,o=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||te,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[re.expando])return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Re.test(i)?this.mouseHooks:De.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new re.Event(o),t=r.length;t--;)n=r[t],e[n]=o[n];return e.target||(e.target=te),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&re.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=re.extend(new re.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?re.event.trigger(i,null,t):re.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},re.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},re.Event=function(e,t){return this instanceof re.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:f):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),void(this[re.expando]=!0)):new re.Event(e,t)},re.Event.prototype={isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!re.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ee.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=ke.access(r,t);i||r.addEventListener(e,n,!0),ke.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=ke.access(r,t)-1;i?ke.access(r,t,i):(r.removeEventListener(e,n,!0),ke.remove(r,t))}}}),re.fn.extend({on:function(e,t,n,r,i){var o,a;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=void 0);for(a in e)this.on(a,t,n,e[a],i);return this}if(null==n&&null==r?(r=t,n=t=void 0):null==r&&("string"==typeof t?(r=n,n=void 0):(r=n,n=t,t=void 0)),r===!1)r=f;else if(!r)return this;return 1===i&&(o=r,r=function(e){return re().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=re.guid++)),this.each(function(){re.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,re(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=f),this.each(function(){re.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?re.event.trigger(e,t,n,!0):void 0}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Me=/<([\w:]+)/,Ie=/<|&#?\w+;/,Be=/<(?:script|style|link)/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^$|\/(?:java|ecma)script/i,$e=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,We={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};We.optgroup=We.option,We.tbody=We.tfoot=We.colgroup=We.caption=We.thead,We.th=We.td,re.extend({clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=re.contains(e.ownerDocument,e);if(!(ee.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(a=k(s),o=k(e),r=0,i=o.length;i>r;r++)x(o[r],a[r]);if(t)if(n)for(o=o||k(e),a=a||k(s),r=0,i=o.length;i>r;r++)w(o[r],a[r]);else w(e,s);return a=k(s,"script"),a.length>0&&b(a,!l&&k(e,"script")),s},buildFragment:function(e,t,n,r){for(var i,o,a,s,l,c,u=t.createDocumentFragment(),d=[],p=0,h=e.length;h>p;p++)if(i=e[p],i||0===i)if("object"===re.type(i))re.merge(d,i.nodeType?[i]:i);else if(Ie.test(i)){for(o=o||u.appendChild(t.createElement("div")),a=(Me.exec(i)||["",""])[1].toLowerCase(),s=We[a]||We._default,o.innerHTML=s[1]+i.replace(Ne,"<$1></$2>")+s[2],c=s[0];c--;)o=o.lastChild;re.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(t.createTextNode(i));for(u.textContent="",p=0;i=d[p++];)if((!r||-1===re.inArray(i,r))&&(l=re.contains(i.ownerDocument,i),o=k(u.appendChild(i),"script"),l&&b(o),n))for(c=0;i=o[c++];)je.test(i.type||"")&&n.push(i);return u},cleanData:function(e){for(var t,n,r,i,o=re.event.special,a=0;void 0!==(n=e[a]);a++){if(re.acceptData(n)&&(i=n[ke.expando],i&&(t=ke.cache[i]))){if(t.events)for(r in t.events)o[r]?re.event.remove(n,r):re.removeEvent(n,r,t.handle);ke.cache[i]&&delete ke.cache[i]}delete xe.cache[n[xe.expando]]}}}),re.fn.extend({text:function(e){return we(this,function(e){return void 0===e?re.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?re.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||re.cleanData(k(n)),n.parentNode&&(t&&re.contains(n.ownerDocument,n)&&b(k(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(re.cleanData(k(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return we(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!We[(Me.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ne,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(re.cleanData(k(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,re.cleanData(k(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=K.apply([],e);var n,r,i,o,a,s,l=0,c=this.length,u=this,d=c-1,p=e[0],h=re.isFunction(p);if(h||c>1&&"string"==typeof p&&!ee.checkClone&&Pe.test(p))return this.each(function(n){var r=u.eq(n);h&&(e[0]=p.call(this,n,r.html())),r.domManip(e,t)});if(c&&(n=re.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=re.map(k(n,"script"),v),o=i.length;c>l;l++)a=n,l!==d&&(a=re.clone(a,!0,!0),o&&re.merge(i,k(a,"script"))),t.call(this[l],a,l);if(o)for(s=i[i.length-1].ownerDocument,re.map(i,y),l=0;o>l;l++)a=i[l],je.test(a.type||"")&&!ke.access(a,"globalEval")&&re.contains(s,a)&&(a.src?re._evalUrl&&re._evalUrl(a.src):re.globalEval(a.textContent.replace(ze,"")))}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var n,r=[],i=re(e),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),re(i[a])[t](n),Y.apply(r,n.get());return this.pushStack(r)}});var Ve,Ue={},He=/^margin/,qe=new RegExp("^("+Ce+")(?!px)[a-z%]+$","i"),Ge=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):n.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=n.getComputedStyle(a,null);t="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var t,r,i=te.documentElement,o=te.createElement("div"),a=te.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ee.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),n.getComputedStyle&&re.extend(ee,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,t=a.appendChild(te.createElement("div"));return t.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(n.getComputedStyle(t,null).marginRight),i.removeChild(o),a.removeChild(t),e}}))}(),re.swap=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};var Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+Ce+")(.*)$","i"),Xe=new RegExp("^([+-])=("+Ce+")","i"),Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"},Ze=["Webkit","O","Moz","ms"];re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=C(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=re.camelCase(t),l=e.style;return t=re.cssProps[s]||(re.cssProps[s]=S(l,s)),a=re.cssHooks[t]||re.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t]:(o=typeof n,"string"===o&&(i=Xe.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(re.css(e,t)),o="number"),null!=n&&n===n&&("number"!==o||re.cssNumber[s]||(n+="px"),ee.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=re.camelCase(t);return t=re.cssProps[s]||(re.cssProps[s]=S(e.style,s)),a=re.cssHooks[t]||re.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=C(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),n===!0||re.isNumeric(o)?o||0:i):i}}),re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,n,r){return n?Ke.test(re.css(e,"display"))&&0===e.offsetWidth?re.swap(e,Qe,function(){return D(e,t,r)}):D(e,t,r):void 0},set:function(e,n,r){var i=r&&Ge(e);return A(e,n,r?F(e,t,r,"border-box"===re.css(e,"boxSizing",!1,i),i):0)}}}),re.cssHooks.marginRight=T(ee.reliableMarginRight,function(e,t){return t?re.swap(e,{display:"inline-block"},C,[e,"marginRight"]):void 0}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Te[r]+t]=o[r]||o[r-2]||o[0];return i}},He.test(e)||(re.cssHooks[e+t].set=A)}),re.fn.extend({css:function(e,t){return we(this,function(e,t,n){var r,i,o={},a=0;if(re.isArray(t)){for(r=Ge(e),i=t.length;i>a;a++)o[t[a]]=re.css(e,t[a],!1,r);return o}return void 0!==n?re.style(e,t,n):re.css(e,t)},e,t,arguments.length>1)},show:function(){return R(this,!0)},hide:function(){return R(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?re(this).show():re(this).hide()})}}),re.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(re.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.fx=L.prototype.init,re.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=new RegExp("^(?:([+-])=|)("+Ce+")([a-z%]*)$","i"),it=/queueHooks$/,ot=[I],at={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=rt.exec(t),o=i&&i[3]||(re.cssNumber[e]?"":"px"),a=(re.cssNumber[e]||"px"!==o&&+r)&&rt.exec(re.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,re.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};re.Animation=re.extend(P,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],at[n]=at[n]||[],at[n].unshift(t)},prefilter:function(e,t){t?ot.unshift(e):ot.push(e)}}),re.speed=function(e,t,n){var r=e&&"object"==typeof e?re.extend({},e):{complete:n||!n&&t||re.isFunction(e)&&e,duration:e,easing:n&&t||t&&!re.isFunction(t)&&t};return r.duration=re.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in re.fx.speeds?re.fx.speeds[r.duration]:re.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){re.isFunction(r.old)&&r.old.call(this),r.queue&&re.dequeue(this,r.queue)},r},re.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=re.isEmptyObject(e),o=re.speed(t,n,r),a=function(){var t=P(this,re.extend({},e),o);(i||ke.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=re.timers,a=ke.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&it.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&re.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=ke.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=re.timers,a=r?r.length:0;for(n.finish=!0,re.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),re.each(["toggle","show","hide"],function(e,t){var n=re.fn[t];re.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(N(t,!0),e,r,i)}}),re.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),re.timers=[],re.fx.tick=function(){var e,t=0,n=re.timers;for(et=re.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||re.fx.stop(),et=void 0},re.fx.timer=function(e){re.timers.push(e),e()?re.fx.start():re.timers.pop()},re.fx.interval=13,re.fx.start=function(){tt||(tt=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(tt),tt=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fn.delay=function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=te.createElement("input"),t=te.createElement("select"),n=t.appendChild(te.createElement("option"));e.type="checkbox",ee.checkOn=""!==e.value,ee.optSelected=n.selected,t.disabled=!0,ee.optDisabled=!n.disabled,e=te.createElement("input"),e.value="t",e.type="radio",ee.radioValue="t"===e.value}();var st,lt,ct=re.expr.attrHandle;re.fn.extend({attr:function(e,t){return we(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===Fe?re.prop(e,t,n):(1===o&&re.isXMLDoc(e)||(t=t.toLowerCase(),r=re.attrHooks[t]||(re.expr.match.bool.test(t)?lt:st)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=re.find.attr(e,t),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void re.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(ve);if(o&&1===e.nodeType)for(;n=o[i++];)r=re.propFix[n]||n,re.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!ee.radioValue&&"radio"===t&&re.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),lt={set:function(e,t,n){return t===!1?re.removeAttr(e,n):e.setAttribute(n,n),n}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||re.find.attr;ct[t]=function(e,t,r){var i,o;return r||(o=ct[t],ct[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,ct[t]=o),i}});var ut=/^(?:input|select|textarea|button)$/i;re.fn.extend({prop:function(e,t){return we(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[re.propFix[e]||e]})}}),re.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return o=1!==a||!re.isXMLDoc(e),o&&(t=re.propFix[t]||t,i=re.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||ut.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),ee.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this});var dt=/[\t\r\n\f]/g;re.fn.extend({addClass:function(e){var t,n,r,i,o,a,s="string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):" ")){for(o=0;i=t[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=re.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,i,o,a,s=0===arguments.length||"string"==typeof e&&e,l=0,c=this.length;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(ve)||[];c>l;l++)if(n=this[l],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(dt," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=e?re.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(n){re(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=re(this),o=e.match(ve)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(n===Fe||"boolean"===n)&&(this.className&&ke.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ke.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(dt," ").indexOf(t)>=0)return!0;return!1}});var pt=/\r/g;re.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=re.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,re(this).val()):e,null==i?i="":"number"==typeof i?i+="":re.isArray(i)&&(i=re.map(i,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=re.valHooks[i.type]||re.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(pt,""):null==n?"":n)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:re.trim(re.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],(n.selected||l===i)&&(ee.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!re.nodeName(n.parentNode,"optgroup"))){if(t=re(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,r,i=e.options,o=re.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=re.inArray(r.value,o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){return re.isArray(t)?e.checked=re.inArray(re(e).val(),t)>=0:void 0}},ee.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var ht=re.now(),ft=/\?/;re.parseJSON=function(e){return JSON.parse(e+"")},re.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&re.error("Invalid XML: "+e),t};var mt=/#.*$/,gt=/([?&])_=[^&]*/,vt=/^(.*?):[ \t]*([^\r\n]*)$/gm,yt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,bt=/^(?:GET|HEAD)$/,wt=/^\/\//,kt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,xt={},Et={},_t="*/".concat("*"),Ct=n.location.href,Tt=kt.exec(Ct.toLowerCase())||[];re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct,type:"GET",isLocal:yt.test(Tt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,re.ajaxSettings),t):z(re.ajaxSettings,e)},ajaxPrefilter:j(xt),ajaxTransport:j(Et),ajax:function(e,t){function n(e,t,n,a){var l,u,v,y,w,x=t;2!==b&&(b=2,s&&clearTimeout(s),r=void 0,o=a||"",k.readyState=e>0?4:0,l=e>=200&&300>e||304===e,n&&(y=W(d,k,n)),y=V(d,y,k,l),l?(d.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(re.lastModified[i]=w),w=k.getResponseHeader("etag"),w&&(re.etag[i]=w)),204===e||"HEAD"===d.type?x="nocontent":304===e?x="notmodified":(x=y.state,u=y.data,v=y.error,l=!v)):(v=x,(e||!x)&&(x="error",0>e&&(e=0))),k.status=e,k.statusText=(t||x)+"",l?f.resolveWith(p,[u,x,k]):f.rejectWith(p,[k,x,v]),k.statusCode(g),g=void 0,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[k,d,l?u:v]),m.fireWith(p,[k,x]),c&&(h.trigger("ajaxComplete",[k,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,c,u,d=re.ajaxSetup({},t),p=d.context||d,h=d.context&&(p.nodeType||p.jquery)?re(p):re.event,f=re.Deferred(),m=re.Callbacks("once memory"),g=d.statusCode||{},v={},y={},b=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!a)for(a={};t=vt.exec(o);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)g[t]=[g[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(f.promise(k).complete=m.add,k.success=k.done,k.error=k.fail,d.url=((e||d.url||Ct)+"").replace(mt,"").replace(wt,Tt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(ve)||[""],null==d.crossDomain&&(l=kt.exec(d.url.toLowerCase()),d.crossDomain=!(!l||l[1]===Tt[1]&&l[2]===Tt[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Tt[3]||("http:"===Tt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),$(xt,d,t,k),2===b)return k;c=re.event&&d.global,c&&0===re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!bt.test(d.type),i=d.url,d.hasContent||(d.data&&(i=d.url+=(ft.test(i)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=gt.test(i)?i.replace(gt,"$1_="+ht++):i+(ft.test(i)?"&":"?")+"_="+ht++)),d.ifModified&&(re.lastModified[i]&&k.setRequestHeader("If-Modified-Since",re.lastModified[i]),re.etag[i]&&k.setRequestHeader("If-None-Match",re.etag[i])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&k.setRequestHeader("Content-Type",d.contentType),k.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)k.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(p,k,d)===!1||2===b))return k.abort();w="abort";for(u in{success:1,error:1,complete:1})k[u](d[u]);if(r=$(Et,d,t,k)){k.readyState=1,c&&h.trigger("ajaxSend",[k,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){k.abort("timeout")},d.timeout));try{b=1,r.send(v,n)}catch(x){if(!(2>b))throw x;n(-1,x)}}else n(-1,"No Transport");return k},getJSON:function(e,t,n){return re.get(e,t,n,"json")},getScript:function(e,t){return re.get(e,void 0,t,"script")}}),re.each(["get","post"],function(e,t){re[t]=function(e,n,r,i){return re.isFunction(n)&&(i=i||r,r=n,n=void 0),re.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),re._evalUrl=function(e){return re.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},re.fn.extend({wrapAll:function(e){var t;return re.isFunction(e)?this.each(function(t){re(this).wrapAll(e.call(this,t))}):(this[0]&&(t=re(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(n){re(this).wrapAll(t?e.call(this,n):e);
64
- })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e&&e.data?"data:"+e.mimetype.string+";base64,"+e.data:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();
65
- return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
64
+ })},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var St=/%20/g,At=/\[\]$/,Ft=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Rt=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var n,r=[],i=function(e,t){t=re.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){i(this.name,this.value)});else for(n in e)U(n,e[n],t,i);return r.join("&").replace(St,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&Rt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=re(this).val();return null==n?null:re.isArray(n)?re.map(n,function(e){return{name:t.name,value:e.replace(Ft,"\r\n")}}):{name:t.name,value:n.replace(Ft,"\r\n")}}).get()}}),re.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Lt=0,Ot={},Nt={0:200,1223:204},Mt=re.ajaxSettings.xhr();n.attachEvent&&n.attachEvent("onunload",function(){for(var e in Ot)Ot[e]()}),ee.cors=!!Mt&&"withCredentials"in Mt,ee.ajax=Mt=!!Mt,re.ajaxTransport(function(e){var t;return ee.cors||Mt&&!e.crossDomain?{send:function(n,r){var i,o=e.xhr(),a=++Lt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete Ot[a],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(Nt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=Ot[a]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=re("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),te.head.appendChild(t[0])},abort:function(){n&&n()}}}});var It=[],Bt=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=It.pop()||re.expando+"_"+ht++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(e,t,r){var i,o,a,s=e.jsonp!==!1&&(Bt.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bt.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=re.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Bt,"$1"+i):e.jsonp!==!1&&(e.url+=(ft.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||re.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always(function(){n[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,It.push(i)),a&&re.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),re.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||te;var r=ue.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=re.buildFragment([e],t,i),i&&i.length&&re(i).remove(),re.merge([],r.childNodes))};var Pt=re.fn.load;re.fn.load=function(e,t,n){if("string"!=typeof e&&Pt)return Pt.apply(this,arguments);var r,i,o,a=this,s=e.indexOf(" ");return s>=0&&(r=re.trim(e.slice(s)),e=e.slice(0,s)),re.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&re.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?re("<div>").append(re.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,o||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var jt=n.document.documentElement;re.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,c,u=re.css(e,"position"),d=re(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return t=o.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Fe&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-t.clientTop,left:i.left+n.pageXOffset-t.clientLeft}):i},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(r=e.offset()),r.top+=re.css(e[0],"borderTopWidth",!0),r.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-re.css(n,"marginTop",!0),left:t.left-r.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||jt;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||jt})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var r="pageYOffset"===t;re.fn[e]=function(i){return we(this,function(e,i,o){var a=H(e);return void 0===o?a?a[t]:e[i]:void(a?a.scrollTo(r?n.pageXOffset:o,r?o:n.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=T(ee.pixelPosition,function(e,n){return n?(n=C(e,t),qe.test(n)?re(e).position()[t]+"px":n):void 0})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){re.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return we(this,function(t,n,r){var i;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===r?re.css(t,n,a):re.style(t,n,r,a)},t,o?r:void 0,o,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,r=[],i=function(){return re}.apply(t,r),!(void 0!==i&&(e.exports=i));var $t=n.jQuery,zt=n.$;return re.noConflict=function(e){return n.$===re&&(n.$=zt),e&&n.jQuery===re&&(n.jQuery=$t),re},typeof o===Fe&&(n.jQuery=n.$=re),re})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"componentDidMount",value:function(){this.grabImageData()}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.grabImageData()}},{key:"grabImageData",value:function(){d["default"].get(this.props.file.filename,this.forceUpdate.bind(this),"image")}},{key:"getSelectedImageDataURI",value:function(){var e=d["default"].getSync(this.props.file.filename,"image");return e?e.data?"data:"+e.mimetype.string+";base64,"+e.data:e.url?e.url:null:null}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h1",null,this.props.file.filename),c["default"].createElement("div",{className:"modal-content"},c["default"].createElement("img",{src:this.getSelectedImageDataURI()})))))}}]),t}(c["default"].Component);p.propTypes={file:c["default"].PropTypes.object.isRequired,onClose:c["default"].PropTypes.func.isRequired},t["default"]=p,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(73),c=r(l),u=n(238),d=r(u),p=n(2),h=r(p),f=function(e,t){return"\n\n================================= "+e+" version of "+t+" =================================\n\n"},m=function(e){function t(){var e=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments),this.state={currentConflictIndex:0},this.resolveConflict=function(t){var n=e.props.conflicts[e.state.currentConflictIndex];switch(t){case"client":break;case"server":d["default"].save(n.filename,"manuscript",n.serverVersion);break;case"both":d["default"].save(n.filename,"manuscript",f("Local",n.filename)+n.clientVersion+f("Server",n.filename)+n.serverVersion)}e.state.currentConflictIndex+1>=e.props.conflicts.length?e.props.onClose():e.setState({currentConflictIndex:e.state.currentConflictIndex+1})}}return o(t,e),a(t,[{key:"renderCurrentConflict",value:function(){return c["default"].createElement("div",{className:"conflict-wrapper"},c["default"].createElement("section",{className:"conflict-content client-version"},c["default"].createElement("h6",null,"Your local copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].clientVersion)),c["default"].createElement("section",{className:"conflict-content server-version"},c["default"].createElement("h6",null,"Server copy"),c["default"].createElement("pre",null,this.props.conflicts[this.state.currentConflictIndex].serverVersion)))}},{key:"render",value:function(){return c["default"].createElement("div",{className:"modal merge-conflicts-modal"},c["default"].createElement("div",{className:"modal-fade-screen"},c["default"].createElement("div",{className:"modal-inner"},c["default"].createElement("div",{className:"modal-close",onClick:this.props.onClose}),c["default"].createElement("h4",null,"Conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename),c["default"].createElement("p",{className:"conflict-explanation"},"Uh oh! You have conflicting changes for ",this.props.conflicts[this.state.currentConflictIndex].filename,". This probably happened because you were using the writing tools without an active internet connection. To resolve this, review the differences here, and select the option you want at the bottom. If you choose to 'keep both', then we will combine the two versions into one file so you can manually merge them."),this.renderCurrentConflict(),c["default"].createElement("ul",{className:"conflict-actions"},c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"client")},"Keep local version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"server")},"Keep remote version")),c["default"].createElement("li",null,c["default"].createElement("a",{onClick:h["default"].partial(this.resolveConflict,"both")},"Keep both versions"))))))}}],[{key:"propTypes",value:{conflicts:c["default"].PropTypes.array.isRequired,onClose:c["default"].PropTypes.func.isRequired},enumerable:!0}]),t}(c["default"].Component);t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(374),s=r(a),l=n(378),c=r(l),u=n(381),d=r(u),p=n(384),h=r(p),f=n(376),m=n(2);m.string=n(3);var g=n(385),v={fileAccessor:d["default"],tables:!0,breaks:!1,sanitize:!1,silent:!1,highlight:null,langPrefix:"lang-",headerPrefix:"",debug:!1,bookType:"book"},y=function(){function e(t,n){void 0===t&&(t=null),i(this,e),this.projectPath=t,this.options=f(v,n),this.options.projectPath=t,this.fileAccessor=new this.options.fileAccessor(t),this.options.fileAccessor=this.fileAccessor}return o(e,[{key:"runSource",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this.options=m.extend(this.options,n),this.processChapters([e],t)}},{key:"run",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this.options=m.extend(this.options,t),g.waterfall([this.determineType.bind(this),this.loadBook.bind(this),this.loadChapters.bind(this),this.processChapters.bind(this)],function(t,n){return t?(console.log("Error when generating the markua document. ",t),e(t)):void e(t,n)})}},{key:"determineType",value:function(e){this.fileAccessor.get("book.txt",function(t,n){/ENOENT/.test(t)?e(null,"single"):e(null,"multi")},null)}},{key:"loadBook",value:function(e,t){"single"===e?t(null,e,[]):this.fileAccessor.get("book.txt",function(n,r){if(n)return t(n);var i=m.compact(r.split("\n"));t(null,e,i)},null)}},{key:"loadChapters",value:function(e,t,n){var r=this;"single"===e?this.fileAccessor.get("manuscript.txt",function(e,t){return e?n(e):void n(null,[t])},null):g.map(t,function(e,t){r.fileAccessor.get(e,function(n,i){r.options.cursor&&r.options.cursor.filename===e&&(i=m.string.splice(i,r.options.cursor.position+1,0,"{ data-markua-cursor-position: __markuaCursorPosition__ }")),t(null,i)})},n)}},{key:"processChapters",value:function(e,t){var n=this;g.map(m.compact(e),function(e,t){try{var r=s["default"].lex(e,n.options);t(null,c["default"].parse(r,n.options))}catch(i){console.error(i),t(i)}},function(e,n){t(null,n.join("\n"))})}}]),e}();y.WebFileAccessor=h["default"],t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.tokens=[],this.tokens.links={},this.options=t,this.rules=o.block.normal,this.warnings=[]}return i(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)}},{key:"token",value:function(e,t,n){var r=this,i=void 0;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.attribute.group.exec(e)){e=e.substring(i[0].length);for(var o=[],l=void 0;(l=s.compact(this.rules.attribute.value.exec(i[0]))).length;)o.push({key:l[1],value:l[2]});this.tokens.push({type:"attribute",attributes:o})}else if((i=this.rules.figure.exec(e))&&(e=e.substring(i[0].length),this.tokens.push({type:"figure",alt:i[2],image:i[3],caption:i[4]})),i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.rules["break"].exec(e)||this.warnings.push("Must be a newline after "+i[0]),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].split(RegExp(" *\\| *"));this.tokens.push(c)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.aside.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"aside_start"}),i=i[0].replace(/^ *A> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"aside_end"});else if(i=this.rules.blurb.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blurb_start"}),i=i[0].replace(/^ *B> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blurb_end"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.codeimport.exec(e)){e=e.substring(i[0].length);var d=i[1],p=i[2],h=void 0,f=p?d+"."+p:d;(h=this.options.fileAccessor.getSync(f,"code"))?this.tokens.push({type:"code",lang:i[2]||"text",text:h}):this.warnings.push("Error: Cannot find file "+f)}else{if(i=this.rules.list.body.exec(e)){var m,g,v,y,b=function(){e=e.substring(i[0].length);var t=i[2],n=void 0;if(r.rules.list.number.exec(t))n="number";else if(r.rules.list.numeral.exec(t))n="numeral";else if(r.rules.list.alphabetized.exec(t))n="alphabetized";else if(r.rules.list.bullet.exec(t))n="bullet";else{if(!r.rules.list.definition.exec(t))return r.warnings.push("Undefined list type for "+e),"continue";n="definition"}r.tokens.push({type:"list_start",listType:n,start:t}),i=i[0].match(r.rules.item),m=null,g=!1,v=i.length,y=null;for(var o=function(e){var o=i[e],l=function(){var e=void 0;switch(C="List indices should be consecutive, automatically increasing near "+i[0],n){case"number":return e=r.rules.list.number.exec(o)&&parseInt(r.rules.list.number.exec(o)[1])||null,null!==m&&e!==1+m&&r.warnings.push(C),e;case"alphabetized":return e=r.rules.list.alphabetized.exec(o)&&r.rules.list.alphabetized.exec(o)[1]||null,null===m||a.characterIsNext(e,m)||r.warnings.push(C),e;case"numeral":return e=r.rules.list.numeral.exec(o)&&r.rules.list.numeral.exec(o)[2]||null,e&&(t=e=e.substr(0,e.length-1)),m&&a.decimalize(e)!==a.decimalize(m)+1&&r.warnings.push(C),e;case"bullet":return!0;case"definition":return y=s.compact(o.match(r.rules.bullet))[1],!0}}();if(!l)return r.warnings.push("Invalid list item at "+o),"continue";var c=o.length;o=o.replace(r.rules.bullet,""),~o.indexOf("\n ")&&(c-=o.length,o=o.replace(/^ {1,4}/gm,"")),r.tokens.push({type:"list_item_start",listType:n,bullet:"definition"===n?y:t}),r.token(o,!1,!0),r.tokens.push({type:"list_item_end"}),m=l},l=0;v>l;l++){o(l)}return r.tokens.push({type:"list_end"}),"continue"}();if("continue"===b)continue}if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){e=e.substring(i[0].length);for(var c={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(RegExp(" *\\| *")),align:i[2].replace(/^ *|\| *$/g,"").split(RegExp(" *\\| *")),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<c.align.length;u++)/^ *-+: *$/.test(c.align[u])?c.align[u]="right":/^ *:-+: *$/.test(c.align[u])?c.align[u]="center":/^ *:-+ *$/.test(c.align[u])?c.align[u]="left":c.align[u]=null;for(var u=0;u<c.cells.length;u++)c.cells[u]=c.cells[u].replace(/^ *\| *| *\| *$/g,"").split(RegExp(" *\\| *"));this.tokens.push(c)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"==i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}if(this.options.debug){var w=!0,k=!1,x=void 0;try{for(var E,_=this.warnings[Symbol.iterator]();!(w=(E=_.next()).done);w=!0){var C=E.value;console.warn(C)}}catch(T){k=!0,x=T}finally{try{!w&&_["return"]&&_["return"]()}finally{if(k)throw x}}this.warnings=[]}return this.tokens}}],[{key:"lex",value:function(t,n){var r=new e(n);return r.lex(t)}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(376),i=function(){};i.exec=i;var o=function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};t.escape=o;var a=function(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})};t.unescape=a;var s=function(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}};t.replace=s;var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:i,image:/^!\[(inside)\]\(href\)/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:i,text:/^(?:inlineAttr)?[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)(?:inlineAttr)?/};t.inline=l,l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*([\s\S]*?)(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=s(l.link)("inside",l._inside)("href",l._href)(),l.image=s(l.image)("inside",l._inside)("href",l._href)(),l.reflink=s(l.reflink)("inside",l._inside)(),l.normal=r({},l),l.gfm=r({},l.normal,{escape:s(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=r({},l.gfm,{br:s(l.br)("{2,}","*")(),text:s(l.gfm.text)("{2,}","*")()});var c={newline:/^\n+/,fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,hr:/^( *[-]){3} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+) */,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*)+/,aside:/^( *A>[^\n]+(\n(?!def)[^\n]+)*)+/,blurb:/^( *B>[^\n]+(\n(?!def)[^\n]+)*)+/,codeimport:/^<<\(([^\n\)\.]+)(?:\.([\S]+))?\)/,list:{body:/^( *)(bull) (?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|[\t-\r \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$)/,definition:/^(?:(?:([^\n]*)(?:\n:(?: *))))/,number:/^([0-9]+)(?:\.|\))/,alphabetized:/^([A-Za-z]+)(?:[\)\.])/,numeral:/^(?=[XVI])M*(?:(C)[MD]|D?C{0,3})(?:X[CL]|L?X{0,3})(I[XV]|V?I{0,3}(?:\)|\.))/i,bullet:/^\*/},def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|blockquote))+)\n*/,figure:/^((?:figure+\n?)+)\n*/,text:/^[^\n]+/,"break":/^ *[\n]{2,}/,attribute:{group:/^attributeGroup/,inlineGroup:/(?:{)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+)))(?:(?: *, *)(?: *(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s])+))(?:: *)(?:("(?:[^\s"]|[ ])+")|('(?:[^\s']|[ ])+')|((?:[^\s,])+))))*(?: *)(?:})(?: *)/,value:/(?: *(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+))(?:: *)(?:(?:"((?:[^\s"]|[ ])+)")|(?:'((?:[^\s']|[ ])+)')|((?:[^\s])+)))/g},number:/([0-9]+)/};t.block=c,c.figure=s(c.figure)(/figure/g,l.image)(),c.bullet=/(?:attribute)?(?:(\*)|([0-9A-Za-z\u017F\u212A]+)(?:\)|\.)|((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\n(?::)))( *)/i,c.bullet=s(c.bullet)(/attribute/g,c.attribute.group)(),c.item=/^( *)(bull) (?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*(?:\n(?!\1bull )(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)*/,c.item=s(c.item,"gm")(/bull/g,c.bullet)(),c.list.body=s(c.list.body)(/bull/g,c.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+c.def.source+")")(),c.blockquote=s(c.blockquote)("def",c.def)(),c.paragraph=s(c.paragraph)("heading",c.heading)("blockquote",c.blockquote)(),c.attribute.group=s(c.attribute.group)(/attributeGroup/g,c.attribute.inlineGroup)(),c.normal=r({},c),l.normal.attribute=c.attribute,l.normal.text=s(l.normal.text)(/inlineAttr/g,c.normal.attribute.inlineGroup)();var u={1:"chapter",2:"section",3:"sub-section",4:"sub-sub-section",5:"sub-sub-sub-section",6:"sub-sub-sub-sub-section"};t.HEADING_BOOK_CLASS_MAP=u;var d={1:"part",2:"chapter",3:"section",4:"sub-section",5:"sub-sub-section",6:"sub-sub-sub-section"};t.HEADING_MULTI_PART_CLASS_MAP=d;var p={1:"section",2:"sub-section",3:"sub-sub-section",4:"sub-sub-sub-section",5:"sub-sub-sub-sub-section",6:"sub-sub-sub-sub-sub-section"};t.HEADING_DOCUMENT_CLASS_MAP=p},function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var r,i,o=n(e),a=1;a<arguments.length;a++){r=arguments[a],i=Object.keys(Object(r));for(var s=0;s<i.length;s++)o[i[s]]=r[i[s]]}return o}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.ALPHABET=n;var r=function(e,t){return n[n.indexOf(e.toUpperCase())-1]===t.toUpperCase()};t.characterIsNext=r;var i=function(e){var t,n=Math.floor(e),r="",i=0,o=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];for((this-n||1>n)&&(n=0);n;){for(t=o[i];n>=t;)n-=t,r+=a[i];++i}return r};t.romanize=i;var o=function(e){var t,n,r=e.toUpperCase().replace(/ +/g,""),i=r.length,o=0,a=0,s={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};if(/^[MDCLXVI)(]+$/.test(r)){for(;i>a;)n=s[r.charAt(a++)],t=s[r.charAt(a)]||0,t-n>0&&(n*=-1),o+=n;return o}return NaN};t.decimalize=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(379),s=r(a),l=n(380),c=r(l),u=n(2),d=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,e),this.options=t,this.tokens=[],this.token=null,this.renderer=new s["default"],this.renderer.options=this.options}return o(e,[{key:"parse",value:function(e){this.inline=new c["default"](e.links,this.options),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t}},{key:"next",value:function(){return this.token=this.tokens.pop()}},{key:"peek",value:function(){return this.tokens[this.tokens.length-1]||0}},{key:"parseText",value:function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}},{key:"tok",value:function(){var e=u.clone(this.attributes);switch("attribute"!==this.token.type&&(this.attributes=null),this.token.type){case"space":return"";case"hr":return this.renderer.hr(e);case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text,e);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,e);case"attribute":var t="";if(this.attributes){var n=void 0;(n=u.find(this.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.attributes=this.token.attributes):(n=u.find(this.token.attributes,function(e){return"data-markua-cursor-position"===e.key?e:null}))?(t=this.renderer.span("",[n]),this.token.attributes=this.attributes):(t=this.renderer.paragraph("{ "+u.map(this.attributes,function(e){return e.key+": "+e.value}).join(",")+" }"),this.attributes=this.token.attributes)}else this.attributes=this.token.attributes;return t;case"figure":return this.renderer.figure(this.token.alt,this.token.image,this.token.caption,e);case"table":var r,i,o,a,s,l="",c="";for(o="",r=0;r<this.token.header.length;r++)a={header:!0,align:this.token.align[r]},o+=this.renderer.tablecell(this.inline.output(this.token.header[r]),{header:!0,align:this.token.align[r]});for(l+=this.renderer.tablerow(o),r=0;r<this.token.cells.length;r++){for(i=this.token.cells[r],o="",s=0;s<i.length;s++)o+=this.renderer.tablecell(this.inline.output(i[s]),{header:!1,align:this.token.align[s]});c+=this.renderer.tablerow(o)}return this.renderer.table(l,c,e);case"aside_start":for(var c="";"aside_end"!==this.next().type;)c+=this.tok();return this.renderer.aside(c,e);case"blurb_start":
65
+ for(var c="";"blurb_end"!==this.next().type;)c+=this.tok();return this.renderer.blurb(c,e);case"blockquote_start":for(var c="";"blockquote_end"!==this.next().type;)c+=this.tok();return this.renderer.blockquote(c,e);case"list_start":for(var c="",d=this.token.listType,p=this.token.start;"list_end"!==this.next().type;)c+=this.tok();return this.renderer.list(c,d,p,e);case"list_item_start":for(var c="",h=this.token.listType,f=this.token.bullet;"list_item_end"!==this.next().type;)c+="text"===this.token.type?this.parseText():this.tok();return"definition"===h?this.renderer.definitionListItem(c,f,e):this.renderer.listitem(c,e);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text),e);case"text":return this.renderer.paragraph(this.parseText(),e)}}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(375),a=n(377),s=n(2),l=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,e),this.options=t}return i(e,[{key:"getHeadingClass",value:function(e){switch(this.options.bookType){case"book":return o.HEADING_BOOK_CLASS_MAP[e];case"multi-part-book":return o.HEADING_MULTI_PART_CLASS_MAP[e];case"document":return o.HEADING_DOCUMENT_CLASS_MAP[e];default:return""}}},{key:"convertAttributes",value:function(e,t){if(!e)return t?' class="'+t+'"':"";var n=" ";return e=s.extend({},s.object(s.pluck(e,"key"),s.pluck(e,"value"))),t&&(n+=e["class"]?'class="'+t+" "+e["class"]+'" ':'class="'+t+'"',delete e["class"]),s.each(s.keys(e),function(t,r){n+=" "+t+'="'+e[t]+'"'}),n}},{key:"code",value:function(e,t,n,r){r&&r.lang&&(t=r.lang,delete r.lang);var i=this.convertAttributes(r);if(this.options.highlight){var a=this.options.highlight(e,t);null!==a&&a!==e&&(n=!0,e=a)}return t?"<pre"+i+'><code class="'+this.options.langPrefix+o.escape(t,!0)+'">'+(n?e:o.escape(e,!0))+"\n</code></pre>\n":"<pre"+i+"><code>"+(n?e:o.escape(e,!0))+"\n</code></pre>"}},{key:"aside",value:function(e,t){var n=this.convertAttributes(t,"aside");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blurb",value:function(e,t){var n=this.convertAttributes(t,"blurb");return"<div"+n+">\n"+e+"</div>\n"}},{key:"blockquote",value:function(e,t){var n=this.convertAttributes(t);return"<blockquote"+n+">\n"+e+"</blockquote>\n"}},{key:"figure",value:function(e,t,n,r){var i=r||{},o=i.align,a=i.alt,l=i.caption;r=s.omit(r,"align","alt","caption");var c="figure";c+=o?" "+o:"",a=e||a||"",l=n||l;var u=this.convertAttributes(r,c),d="<div"+u+">\n "+this.image(t,null,a)+"\n"+this.caption(l)+"</div>\n";return d}},{key:"caption",value:function(e,t){var n=this.convertAttributes(t,"caption");return e?" <p"+n+">"+e+"</p>\n":""}},{key:"heading",value:function(e,t,n,r){var i=void 0;r&&r.id?(i=r.id,delete r.id):i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-");var o=this.convertAttributes(r,this.getHeadingClass(t));return"<h"+t+(""+o)+(" id="+i+">")+e+"</h"+t+">\n"}},{key:"hr",value:function(e){var t=this.convertAttributes(e);return"<hr"+t+">\n"}},{key:"list",value:function(e,t,n,r){var i,o="",s="";switch(n=n.substr(0,n.length-1),t){case"bullet":i="ul";break;case"alphabetized":i="ol",o=' type="'+(n===n.toUpperCase()?"A":"a")+'"',s="A"===n.toUpperCase()?"":' start="'+(a.ALPHABET.indexOf(n.toUpperCase())+1)+'"';break;case"definition":i="dl";break;case"numeral":i="ol",o=' type="'+(n===n.toUpperCase()?"I":"i")+'"',s=(n=a.decimalize(n)||0)&&1!==n?' start="'+n+'"':"";break;case"number":i="ol",s=n&&"1"!==n?' start="'+n+'"':"";break;default:i="ol"}var l=this.convertAttributes(r);return"<"+i+o+s+l+">\n"+e+"</"+i+">\n"}},{key:"definitionListItem",value:function(e,t,n){var r=this.convertAttributes(n);return"<dt"+r+">"+t+"</dt>\n<dd>"+e+"</dd>\n"}},{key:"listitem",value:function(e,t){var n=this.convertAttributes(t);return"<li"+n+">"+e+"</li>\n"}},{key:"paragraph",value:function(e,t){e=e.replace(/\n/g,"<br/>\n");var n=this.convertAttributes(t);return"<p"+n+">"+e+"</p>\n"}},{key:"table",value:function(e,t,n){var r=this.convertAttributes(n);return"<table"+r+">\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"}},{key:"tablerow",value:function(e,t){var n=this.convertAttributes(t);return"<tr"+n+">\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t,n){var r=t.header?"th":"td",i=t.align?"<"+r+' style="text-align: '+t.align+'">':"<"+r+">";return i+e+"</"+r+">\n"}},{key:"strong",value:function(e,t){var n=this.convertAttributes(t);return"<strong"+n+">"+e+"</strong>"}},{key:"em",value:function(e,t){var n=this.convertAttributes(t);return"<em"+n+">"+e+"</em>"}},{key:"codespan",value:function(e,t){var n=this.convertAttributes(t);return"<code"+n+">"+e+"</code>"}},{key:"span",value:function(e,t){var n=this.convertAttributes(t);return"<span"+n+">"+e+"</span>"}},{key:"br",value:function(){return"<br>"}},{key:"del",value:function(e,t){var n=this.convertAttributes(t);return"<del"+n+">"+e+"</del>"}},{key:"link",value:function(e,t,n,r){var i=this.convertAttributes(r);if(this.options.sanitize){try{var a=decodeURIComponent(o.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===a.indexOf("javascript:")||0===a.indexOf("vbscript:"))return""}var l="<a"+i+' href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>"}},{key:"image",value:function(e,t,n,r){var i=this.convertAttributes(r);/http:|https:/.test(e)||(e="images/"+e);var o="<img"+i+' src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+="/>"}}]),e}();t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(375),s=n(379),l=r(s),c=n(2),u=function(){function e(t,n){if(i(this,e),this.options=n,this.links=t,this.rules=a.inline.normal,this.attributeSet=null,this.prevAttributeSet=null,this.renderer=new l["default"],!this.links)throw new Error("Tokens array requires a `links` property.")}return o(e,[{key:"output",value:function(e){for(var t=void 0,n=void 0,r=void 0,i=void 0,o="";e;)if(this.prevAttributeSet||(this.attributeSet=null),this.prevAttributeSet=null,t=this.rules.escape.exec(e))e=e.substring(t[0].length),o+=t[1];else if(t=this.rules.autolink.exec(e))e=e.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?t[1].substring(7):t[1],i="mailto:"+r):(r=a.escape(t[1]),i=r),o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(this.rules.attribute.inlineGroup.exec(e))for(this.attributeSet=[];t=this.rules.attribute.inlineGroup.exec(e);){var s=e.search(this.rules.attribute.inlineGroup);t[0].length;e=c.string.splice(e,s,t[0].length);for(var l=[],u=void 0;(u=c.compact(this.rules.attribute.value.exec(t[0]))).length;)l.push({key:u[1],value:u[2]});this.attributeSet.push({attributes:l,index:s}),this.prevAttributeSet=!0}else if(this.inLink||!(t=this.rules.url.exec(e))){if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,o+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(e))||(t=this.rules.nolink.exec(e))){if(e=e.substring(t[0].length),n=(t[2]||t[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()],!n||!n.href){o+=t[0].charAt(0),e=t[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(t,n),this.inLink=!1}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),o+=this.renderer.strong(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),o+=this.renderer.em(this.output(t[2]||t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),o+=this.renderer.codespan(a.escape(t[2],!0),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),o+=this.renderer.br();else if(t=this.rules.del.exec(e))e=e.substring(t[0].length),o+=this.renderer.del(this.output(t[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);else if(t=this.rules.text.exec(e))if(this.attributeSet&&this.attributeSet.length)for(var d=void 0,p=t[0];d=this.attributeSet.shift();){var h=p.substr(0,d.index),f=p.substr(d.index);if(f.length){var m=f.substr(0,f.indexOf(" "));o+=a.escape(this.smartypants(h)),o+=this.renderer.span(a.escape(this.smartypants(m)),d.attributes),e=e.substring(h.length+m.length),p=p.substring(h.length+m.length)}else o+=this.renderer.span(a.escape(this.smartypants(h)),d.attributes),e=e.substring(h.length),p=p.substring(h.length)}else o+=a.escape(this.smartypants(t[0])),e=e.substring(t[0].length);else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(t[0].length),r=a.escape(t[1]),i=r,o+=this.renderer.link(i,null,r,this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes);if(this.attributeSet&&this.attributeSet.length)throw new Error("need to attach attrs to the previous element, we have left-over non-applied attributes");return o}},{key:"outputLink",value:function(e,t){var n=a.escape(t.href),r=t.title?a.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes):this.renderer.image(n,r,a.escape(e[1]),this.attributeSet&&this.attributeSet.length&&this.attributeSet.shift().attributes)}},{key:"smartypants",value:function(e){return e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}}],[{key:"output",value:function(t,n,r){return new e(n,r).output(t)}}]),e}();u.rules=a.inline,t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a,s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},c=n(382),u=r(c),d=n(383);try{a=n(!function(){var e=new Error('Cannot find module "fs"');throw e.code="MODULE_NOT_FOUND",e}())}catch(p){console.log("fs is not available in this env")}var h=function(e){function t(){i(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),s(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){a.readFile(d.join(this.projectPath,e),{encoding:"utf8"},function(e,n){return e?t(e):void t(null,n)})}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return a.readFileSync(d.join(this.getFilePrefix(t),e),{encoding:"utf8"}).toString()}}]),t}(u["default"]);t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){n(this,e),this.projectPath=t}return r(e,[{key:"get",value:function(e){console.log("Override me!")}}]),e}();t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};t.resolve=function(){for(var t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,i="/"===a.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+t||"."},t.normalize=function(e){var i=t.isAbsolute(e),o="/"===a(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,l=0;a>l;l++)if(i[l]!==o[l]){s=l;break}for(var c=[],l=s;l<i.length;l++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){var t=o(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},t.basename=function(e,t){var n=o(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}}).call(t,n(75))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;s=c=l=void 0,r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var l=s.get;return void 0===l?void 0:l.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return void 0;e=c,t=o,n=a,r=!0}},l=n(382),c=r(l),u=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),a(t,[{key:"getFilePrefix",value:function(e){return"code"===e?this.projectPath+"/code":this.projectPath}},{key:"get",value:function(e,t){var n=arguments.length<=2||void 0===arguments[2]?"manuscript":arguments[2],r=window.fileData[this.getFilePrefix(n)+"/"+e];t(null,r)}},{key:"getSync",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"manuscript":arguments[1];return window.fileData[this.getFilePrefix(t)+"/"+e]}}]),t}(c["default"]);t["default"]=u,e.exports=t["default"]},function(e,t,n){var r,i;(function(n,o){/*!
66
66
  * async
67
67
  * https://github.com/caolan/async
68
68
  *
@@ -1,3 +1,3 @@
1
1
  module Markuapad
2
- VERSION = '0.2.8'
2
+ VERSION = '0.2.9'
3
3
  end
@@ -18,10 +18,15 @@ class ImageModal extends React.Component {
18
18
  getSelectedImageDataURI() {
19
19
  let imageFile = FileAccessor.getSync(this.props.file.filename, "image")
20
20
 
21
- if (!imageFile || !imageFile.data)
21
+ if (!imageFile)
22
22
  return null
23
23
 
24
- return `data:${imageFile.mimetype.string};base64,${imageFile.data}`
24
+ if (imageFile.data)
25
+ return `data:${imageFile.mimetype.string};base64,${imageFile.data}`
26
+ else if (imageFile.url)
27
+ return imageFile.url
28
+ else
29
+ return null
25
30
  }
26
31
 
27
32
  render() {
@@ -46,4 +51,4 @@ ImageModal.propTypes = {
46
51
  onClose: React.PropTypes.func.isRequired
47
52
  }
48
53
 
49
- export default ImageModal;
54
+ export default ImageModal;
@@ -7,16 +7,18 @@ export let fixImagePaths = (htmlString, rerun) => {
7
7
  let matches = htmlString.match(allImageTagFixRegex);
8
8
 
9
9
  for (let match of matches || []) {
10
- // Get the base64 url for the image
11
10
  let key = match.substr(match.lastIndexOf("/") + 1)
12
11
  let file = FileAccessor.getSync(key, "image", rerun);
12
+ let uri;
13
13
 
14
- if (!file || !file.data) {
14
+ if (!file) {
15
15
  FileAccessor.get(key, rerun, "image");
16
16
  continue;
17
+ } else if (file.data) {
18
+ uri = `data:${file.mimetype.string};base64,${file.data}`
19
+ } else if (file.url) {
20
+ uri = file.url
17
21
  }
18
-
19
- let uri = `data:${file.mimetype.string};base64,${file.data}`
20
22
  htmlString = htmlString.replace(imageTagFixRegex, `src="${uri}`)
21
23
  }
22
24
  return htmlString;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markuapad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Braden Simpson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-10 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler