From 4e2b17407bc4f5a3fe298beefb4c8c00330278ff Mon Sep 17 00:00:00 2001 From: Pomax Date: Wed, 8 Feb 2017 09:07:57 -0800 Subject: [PATCH] pontoon? --- article.js | 10 +- components/App.jsx | 20 ++-- components/sections/bsplined/demonstrator.js | 38 +++++++ components/sections/bsplined/derived.js | 37 +++++++ components/sections/bsplined/index.js | 106 +++++++++++++++++++ 5 files changed, 198 insertions(+), 13 deletions(-) create mode 100644 components/sections/bsplined/demonstrator.js create mode 100644 components/sections/bsplined/derived.js create mode 100644 components/sections/bsplined/index.js diff --git a/article.js b/article.js index 4c08d43a..b13d15cf 100644 --- a/article.js +++ b/article.js @@ -1,5 +1,5 @@ -!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)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";var r=n(2),i=n(159),a=n(160);i.render(r.createElement(a,null),document.getElementById("article"))},function(e,t,n){"use strict";e.exports=n(3)},function(e,t,n){"use strict";var r=n(4),i=n(149),a=n(153),o=n(40),s=n(158),l={};o(l,a),o(l,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",i,i.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",i,i.renderToStaticMarkup)}),l.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,l.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i,e.exports=l},function(e,t,n){(function(t){"use strict";var r=n(6),i=n(7),a=n(72),o=n(46),s=n(29),l=n(19),u=n(51),c=n(55),h=n(147),d=n(92),p=n(148),f=n(26);a.inject();var m=l.measure("React","render",s.render),g={findDOMNode:d,render:m,unmountComponentAtNode:s.unmountComponentAtNode,version:h,unstable_batchedUpdates:c.batchedUpdates,unstable_renderSubtreeIntoContainer:p};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({CurrentOwner:r,InstanceHandles:o,Mount:s,Reconciler:u,TextComponent:i}),"production"!==t.env.NODE_ENV){var v=n(10);if(v.canUseDOM&&window.top===window.self){"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");var y=document.documentMode&&document.documentMode<8;"production"!==t.env.NODE_ENV?f(!y,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: '):void 0;for(var w=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],b=0;b1)for(var n=1;n"+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var i=o.getNode(this._rootNodeID);r.updateTextContent(i,n)}}},unmountComponent:function(){a.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=h}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var i=n(9),a=n(17),o=n(19),s=n(20),l=n(21),u=n(14),c={dangerouslyReplaceNodeWithMarkup:i.dangerouslyReplaceNodeWithMarkup,updateTextContent:l,processUpdates:function(e,n){for(var o,c=null,h=null,d=0;d when using tables, nesting tags like
,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",p,m):u(!1),c=c||{},c[m]=c[m]||[],c[m][p]=f,h=h||[],h.push(f)}var g;if(g=n.length&&"string"==typeof n[0]?i.dangerouslyRenderMarkup(n):n,h)for(var v=0;v]+)/,c="data-danger-index",h={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:"production"!==t.env.NODE_ENV?l(!1,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString for server rendering."):l(!1);for(var n,h={},d=0;d node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString()."):l(!1):void 0;var r;r="string"==typeof n?a(n,o)[0]:n,e.parentNode.replaceChild(r,e)}};e.exports=h}).call(t,n(5))},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,n){var i=u;u?void 0:"production"!==t.env.NODE_ENV?l(!1,"createNodesFromMarkup dummy not initialized"):l(!1);var a=r(e),c=a&&s(a);if(c){i.innerHTML=c[1]+e+c[2];for(var h=c[0];h--;)i=i.lastChild}else i.innerHTML=e;var d=i.getElementsByTagName("script");d.length&&(n?void 0:"production"!==t.env.NODE_ENV?l(!1,"createNodesFromMarkup(...): Unexpected ","
"],c=[3,"","
"],h=[1,'',""],d={"*":[1,"?

"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:l,option:l,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c},p=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];p.forEach(function(e){d[e]=h,s[e]=!0}),e.exports=r}).call(t,n(5))},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(18),i=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=i},function(e,t,n){(function(t){"use strict";var r=n(14),i=function(e){var n,i={};e instanceof Object&&!Array.isArray(e)?void 0:"production"!==t.env.NODE_ENV?r(!1,"keyMirror(...): Argument must be an object."):r(!1);for(n in e)e.hasOwnProperty(n)&&(i[n]=n);return i};e.exports=i}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function n(e,t,n){return n}var r={enableMeasure:!1,storedMeasure:n,measureMethods:function(e,n,i){if("production"!==t.env.NODE_ENV)for(var a in i)i.hasOwnProperty(a)&&(e[a]=r.measure(n,i[a],e[a]))},measure:function(e,n,i){if("production"!==t.env.NODE_ENV){var a=null,o=function(){return r.enableMeasure?(a||(a=r.storedMeasure(e,n,i)),a.apply(this,arguments)):i.apply(this,arguments)};return o.displayName=e+"_"+n,o}return i},injection:{injectMeasure:function(e){r.storedMeasure=e}}};e.exports=r}).call(t,n(5))},function(e,t,n){"use strict";var r=n(10),i=/^[ \r\n\t\f]/,a=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,o=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(o=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(o=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&a.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=o},function(e,t,n){"use strict";var r=n(10),i=n(22),a=n(20),o=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(o=function(e,t){a(e,i(t))})),e.exports=o},function(e,t){"use strict";function n(e){return i[e]}function r(e){return(""+e).replace(a,n)}var i={"&":"&",">":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return!!h.hasOwnProperty(e)||!c.hasOwnProperty(e)&&(u.test(e)?(h[e]=!0,!0):(c[e]=!0,"production"!==t.env.NODE_ENV?l(!1,"Invalid attribute name: `%s`",e):void 0,!1))}function i(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&t===!1}var a=n(24),o=n(19),s=n(25),l=n(26),u=/^[a-zA-Z_][\w\.\-]*$/,c={},h={};if("production"!==t.env.NODE_ENV)var d={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},p={},f=function(e){if(!(d.hasOwnProperty(e)&&d[e]||p.hasOwnProperty(e)&&p[e])){p[e]=!0;var n=e.toLowerCase(),r=a.isCustomAttribute(n)?n:a.getPossibleStandardName.hasOwnProperty(n)?a.getPossibleStandardName[n]:null;"production"!==t.env.NODE_ENV?l(null==r,"Unknown DOM property %s. Did you mean %s?",e,r):void 0}};var m={createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(a.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,n){var r=a.properties.hasOwnProperty(e)?a.properties[e]:null;if(r){if(i(r,n))return"";var o=r.attributeName;return r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?o+'=""':o+"="+s(n)}return a.isCustomAttribute(e)?null==n?"":e+"="+s(n):("production"!==t.env.NODE_ENV&&f(e),null)},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,n,r){var o=a.properties.hasOwnProperty(n)?a.properties[n]:null;if(o){var s=o.mutationMethod;if(s)s(e,r);else if(i(o,r))this.deleteValueForProperty(e,n);else if(o.mustUseAttribute){var l=o.attributeName,u=o.attributeNamespace;u?e.setAttributeNS(u,l,""+r):o.hasBooleanValue||o.hasOverloadedBooleanValue&&r===!0?e.setAttribute(l,""):e.setAttribute(l,""+r)}else{var c=o.propertyName;o.hasSideEffects&&""+e[c]==""+r||(e[c]=r)}}else a.isCustomAttribute(n)?m.setValueForAttribute(e,n,r):"production"!==t.env.NODE_ENV&&f(n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,n){var r=a.properties.hasOwnProperty(n)?a.properties[n]:null;if(r){var i=r.mutationMethod;if(i)i(e,void 0);else if(r.mustUseAttribute)e.removeAttribute(r.attributeName);else{var o=r.propertyName,s=a.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects&&""+e[o]===s||(e[o]=s)}}else a.isCustomAttribute(n)?e.removeAttribute(n):"production"!==t.env.NODE_ENV&&f(n)}};o.measureMethods(m,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=m}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e,t){return(e&t)===t}var i=n(14),a={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var n=a,o=e.Properties||{},l=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},h=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var d in o){s.properties.hasOwnProperty(d)?"production"!==t.env.NODE_ENV?i(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",d):i(!1):void 0;var p=d.toLowerCase(),f=o[d],m={attributeName:p,attributeNamespace:null,propertyName:d,mutationMethod:null,mustUseAttribute:r(f,n.MUST_USE_ATTRIBUTE),mustUseProperty:r(f,n.MUST_USE_PROPERTY),hasSideEffects:r(f,n.HAS_SIDE_EFFECTS),hasBooleanValue:r(f,n.HAS_BOOLEAN_VALUE),hasNumericValue:r(f,n.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(f,n.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(f,n.HAS_OVERLOADED_BOOLEAN_VALUE)};if(m.mustUseAttribute&&m.mustUseProperty?"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Cannot require using both attribute and property: %s",d):i(!1):void 0,!m.mustUseProperty&&m.hasSideEffects?"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Properties that have side effects must use property: %s",d):i(!1):void 0,m.hasBooleanValue+m.hasNumericValue+m.hasOverloadedBooleanValue<=1?void 0:"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",d):i(!1),"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[p]=d),u.hasOwnProperty(d)){var g=u[d];m.attributeName=g,"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[g]=d)}l.hasOwnProperty(d)&&(m.attributeNamespace=l[d]),c.hasOwnProperty(d)&&(m.propertyName=c[d]),h.hasOwnProperty(d)&&(m.mutationMethod=h[d]),s.properties[d]=m}}},o={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:"production"!==t.env.NODE_ENV?{}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t2?n-2:0),i=2;i when using tables, nesting tags like ,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",n,ee.getID(e)):B(!1)},_mountImageIntoNode:function(e,n,a,o){if(!n||n.nodeType!==W&&n.nodeType!==G&&n.nodeType!==H?"production"!==t.env.NODE_ENV?B(!1,"mountComponentIntoNode(...): Target container is not valid."):B(!1):void 0,a){var s=i(n);if(P.canReuseMarkup(e,s))return;var l=s.getAttribute(P.CHECKSUM_ATTR_NAME);s.removeAttribute(P.CHECKSUM_ATTR_NAME);var u=s.outerHTML;s.setAttribute(P.CHECKSUM_ATTR_NAME,l);var c=e;if("production"!==t.env.NODE_ENV){var h;n.nodeType===W?(h=document.createElement("div"),h.innerHTML=e,c=h.innerHTML):(h=document.createElement("iframe"),document.body.appendChild(h),h.contentDocument.write(e),c=h.contentDocument.documentElement.outerHTML,document.body.removeChild(h))}var d=r(c,u),p=" (client) "+c.substring(d-20,d+20)+"\n (server) "+u.substring(d-20,d+20);n.nodeType===G?"production"!==t.env.NODE_ENV?B(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",p):B(!1):void 0, -"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",p):void 0)}if(n.nodeType===G?"production"!==t.env.NODE_ENV?B(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):B(!1):void 0,o.useCreateElement){for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(e)}else z(n,e)},ownerDocumentContextKey:X,getReactRootID:a,getID:o,setID:l,getNode:u,getNodeFromInstance:c,isValid:h,purgeID:d};D.measureMethods(ee,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=ee}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,g)||(e[g]=f++,d[e[g]]={}),d[e[g]]}var i=n(31),a=n(32),o=n(33),s=n(38),l=n(19),u=n(39),c=n(40),h=n(41),d={},p=!1,f=0,m={topAbort:"abort",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},g="_reactListenersID"+String(Math.random()).slice(2),v=c({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,a=r(n),s=o.registrationNameDependencies[e],l=i.topLevelTypes,u=0;u-1?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):o(!1),!u.plugins[r]){n.extractEvents?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):o(!1),u.plugins[r]=n;var a=n.eventTypes;for(var c in a)i(a[c],n,c)?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",c,e):o(!1)}}}function i(e,n,r){u.eventNameDispatchConfigs.hasOwnProperty(r)?"production"!==t.env.NODE_ENV?o(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",r):o(!1):void 0,u.eventNameDispatchConfigs[r]=e;var i=e.phasedRegistrationNames;if(i){for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];a(l,n,r)}return!0}return!!e.registrationName&&(a(e.registrationName,n,r),!0)}function a(e,n,r){u.registrationNameModules[e]?"production"!==t.env.NODE_ENV?o(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):o(!1):void 0,u.registrationNameModules[e]=n,u.registrationNameDependencies[e]=n.eventTypes[r].dependencies}var o=n(14),s=null,l={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):o(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var n=!1;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];l.hasOwnProperty(i)&&l[i]===a||(l[i]?"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",i):o(!1):void 0,l[i]=a,n=!0)}n&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in l)l.hasOwnProperty(e)&&delete l[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=u}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function i(e){return e===y.topMouseMove||e===y.topTouchMove}function a(e){return e===y.topMouseDown||e===y.topTouchStart}function o(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=v.Mount.getNode(r),t?f.invokeGuardedCallbackWithCatch(i,n,e,r):f.invokeGuardedCallback(i,n,e,r),e.currentTarget=null}function s(e,n){var r=e._dispatchListeners,i=e._dispatchIDs;if("production"!==t.env.NODE_ENV&&d(e),Array.isArray(r))for(var a=0;a-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)&&console.debug("Download the React DevTools for a better development experience: https://fb.me/react-devtools");var y=document.documentMode&&document.documentMode<8;"production"!==t.env.NODE_ENV?f(!y,'Internet Explorer is running in compatibility mode; please add the following tag to your HTML to prevent this from happening: '):void 0;for(var w=[Array.isArray,Array.prototype.every,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.map,Date.now,Function.prototype.bind,Object.keys,String.prototype.split,String.prototype.trim,Object.create,Object.freeze],b=0;b1)for(var n=1;n"+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var i=o.getNode(this._rootNodeID);r.updateTextContent(i,n)}}},unmountComponent:function(){a.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=h}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e,t,n){var r=n>=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var i=n(9),a=n(17),o=n(19),s=n(20),l=n(21),u=n(14),c={dangerouslyReplaceNodeWithMarkup:i.dangerouslyReplaceNodeWithMarkup,updateTextContent:l,processUpdates:function(e,n){for(var o,c=null,h=null,d=0;d when using tables, nesting tags like ,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",p,m):u(!1),c=c||{},c[m]=c[m]||[],c[m][p]=f,h=h||[],h.push(f)}var g;if(g=n.length&&"string"==typeof n[0]?i.dangerouslyRenderMarkup(n):n,h)for(var v=0;v]+)/,c="data-danger-index",h={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:"production"!==t.env.NODE_ENV?l(!1,"dangerouslyRenderMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString for server rendering."):l(!1);for(var n,h={},d=0;d node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString()."):l(!1):void 0;var r;r="string"==typeof n?a(n,o)[0]:n,e.parentNode.replaceChild(r,e)}};e.exports=h}).call(t,n(5))},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,n){var i=u;u?void 0:"production"!==t.env.NODE_ENV?l(!1,"createNodesFromMarkup dummy not initialized"):l(!1);var a=r(e),c=a&&s(a);if(c){i.innerHTML=c[1]+e+c[2];for(var h=c[0];h--;)i=i.lastChild}else i.innerHTML=e;var d=i.getElementsByTagName("script");d.length&&(n?void 0:"production"!==t.env.NODE_ENV?l(!1,"createNodesFromMarkup(...): Unexpected ","
"],c=[3,"","
"],h=[1,'',""],d={"*":[1,"?

"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:l,option:l,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c},p=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];p.forEach(function(e){d[e]=h,s[e]=!0}),e.exports=r}).call(t,n(5))},function(e,t){"use strict";function n(e){return function(){return e}}function r(){}r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r=n(18),i=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=i},function(e,t,n){(function(t){"use strict";var r=n(14),i=function(e){var n,i={};e instanceof Object&&!Array.isArray(e)?void 0:"production"!==t.env.NODE_ENV?r(!1,"keyMirror(...): Argument must be an object."):r(!1);for(n in e)e.hasOwnProperty(n)&&(i[n]=n);return i};e.exports=i}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function n(e,t,n){return n}var r={enableMeasure:!1,storedMeasure:n,measureMethods:function(e,n,i){if("production"!==t.env.NODE_ENV)for(var a in i)i.hasOwnProperty(a)&&(e[a]=r.measure(n,i[a],e[a]))},measure:function(e,n,i){if("production"!==t.env.NODE_ENV){var a=null,o=function(){return r.enableMeasure?(a||(a=r.storedMeasure(e,n,i)),a.apply(this,arguments)):i.apply(this,arguments)};return o.displayName=e+"_"+n,o}return i},injection:{injectMeasure:function(e){r.storedMeasure=e}}};e.exports=r}).call(t,n(5))},function(e,t,n){"use strict";var r=n(10),i=/^[ \r\n\t\f]/,a=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,o=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(o=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(o=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&a.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=o},function(e,t,n){"use strict";var r=n(10),i=n(22),a=n(20),o=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(o=function(e,t){a(e,i(t))})),e.exports=o},function(e,t){"use strict";function n(e){return i[e]}function r(e){return(""+e).replace(a,n)}var i={"&":"&",">":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;e.exports=r},function(e,t,n){(function(t){"use strict";function r(e){return!!h.hasOwnProperty(e)||!c.hasOwnProperty(e)&&(u.test(e)?(h[e]=!0,!0):(c[e]=!0,"production"!==t.env.NODE_ENV?l(!1,"Invalid attribute name: `%s`",e):void 0,!1))}function i(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue&&isNaN(t)||e.hasPositiveNumericValue&&t<1||e.hasOverloadedBooleanValue&&t===!1}var a=n(24),o=n(19),s=n(25),l=n(26),u=/^[a-zA-Z_][\w\.\-]*$/,c={},h={};if("production"!==t.env.NODE_ENV)var d={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0},p={},f=function(e){if(!(d.hasOwnProperty(e)&&d[e]||p.hasOwnProperty(e)&&p[e])){p[e]=!0;var n=e.toLowerCase(),r=a.isCustomAttribute(n)?n:a.getPossibleStandardName.hasOwnProperty(n)?a.getPossibleStandardName[n]:null;"production"!==t.env.NODE_ENV?l(null==r,"Unknown DOM property %s. Did you mean %s?",e,r):void 0}};var m={createMarkupForID:function(e){return a.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(a.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,n){var r=a.properties.hasOwnProperty(e)?a.properties[e]:null;if(r){if(i(r,n))return"";var o=r.attributeName;return r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?o+'=""':o+"="+s(n)}return a.isCustomAttribute(e)?null==n?"":e+"="+s(n):("production"!==t.env.NODE_ENV&&f(e),null)},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,n,r){var o=a.properties.hasOwnProperty(n)?a.properties[n]:null;if(o){var s=o.mutationMethod;if(s)s(e,r);else if(i(o,r))this.deleteValueForProperty(e,n);else if(o.mustUseAttribute){var l=o.attributeName,u=o.attributeNamespace;u?e.setAttributeNS(u,l,""+r):o.hasBooleanValue||o.hasOverloadedBooleanValue&&r===!0?e.setAttribute(l,""):e.setAttribute(l,""+r)}else{var c=o.propertyName;o.hasSideEffects&&""+e[c]==""+r||(e[c]=r)}}else a.isCustomAttribute(n)?m.setValueForAttribute(e,n,r):"production"!==t.env.NODE_ENV&&f(n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,n){var r=a.properties.hasOwnProperty(n)?a.properties[n]:null;if(r){var i=r.mutationMethod;if(i)i(e,void 0);else if(r.mustUseAttribute)e.removeAttribute(r.attributeName);else{var o=r.propertyName,s=a.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects&&""+e[o]===s||(e[o]=s)}}else a.isCustomAttribute(n)?e.removeAttribute(n):"production"!==t.env.NODE_ENV&&f(n)}};o.measureMethods(m,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=m}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e,t){return(e&t)===t}var i=n(14),a={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var n=a,o=e.Properties||{},l=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},c=e.DOMPropertyNames||{},h=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var d in o){s.properties.hasOwnProperty(d)?"production"!==t.env.NODE_ENV?i(!1,"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.",d):i(!1):void 0;var p=d.toLowerCase(),f=o[d],m={attributeName:p,attributeNamespace:null,propertyName:d,mutationMethod:null,mustUseAttribute:r(f,n.MUST_USE_ATTRIBUTE),mustUseProperty:r(f,n.MUST_USE_PROPERTY),hasSideEffects:r(f,n.HAS_SIDE_EFFECTS),hasBooleanValue:r(f,n.HAS_BOOLEAN_VALUE),hasNumericValue:r(f,n.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(f,n.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(f,n.HAS_OVERLOADED_BOOLEAN_VALUE)};if(m.mustUseAttribute&&m.mustUseProperty?"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Cannot require using both attribute and property: %s",d):i(!1):void 0,!m.mustUseProperty&&m.hasSideEffects?"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Properties that have side effects must use property: %s",d):i(!1):void 0,m.hasBooleanValue+m.hasNumericValue+m.hasOverloadedBooleanValue<=1?void 0:"production"!==t.env.NODE_ENV?i(!1,"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s",d):i(!1),"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[p]=d),u.hasOwnProperty(d)){var g=u[d];m.attributeName=g,"production"!==t.env.NODE_ENV&&(s.getPossibleStandardName[g]=d)}l.hasOwnProperty(d)&&(m.attributeNamespace=l[d]),c.hasOwnProperty(d)&&(m.propertyName=c[d]),h.hasOwnProperty(d)&&(m.mutationMethod=h[d]),s.properties[d]=m}}},o={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:"production"!==t.env.NODE_ENV?{}:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t2?n-2:0),i=2;i when using tables, nesting tags like ,

, or , or using non-SVG elements in an parent. Try inspecting the child nodes of the element with React ID `%s`.",n,ee.getID(e)):B(!1)},_mountImageIntoNode:function(e,n,a,o){if(!n||n.nodeType!==W&&n.nodeType!==G&&n.nodeType!==H?"production"!==t.env.NODE_ENV?B(!1,"mountComponentIntoNode(...): Target container is not valid."):B(!1):void 0,a){var s=i(n);if(P.canReuseMarkup(e,s))return;var l=s.getAttribute(P.CHECKSUM_ATTR_NAME);s.removeAttribute(P.CHECKSUM_ATTR_NAME);var u=s.outerHTML;s.setAttribute(P.CHECKSUM_ATTR_NAME,l);var c=e;if("production"!==t.env.NODE_ENV){var h;n.nodeType===W?(h=document.createElement("div"),h.innerHTML=e,c=h.innerHTML):(h=document.createElement("iframe"),document.body.appendChild(h),h.contentDocument.write(e),c=h.contentDocument.documentElement.outerHTML,document.body.removeChild(h))}var d=r(c,u),p=" (client) "+c.substring(d-20,d+20)+"\n (server) "+u.substring(d-20,d+20); +n.nodeType===G?"production"!==t.env.NODE_ENV?B(!1,"You're trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s",p):B(!1):void 0,"production"!==t.env.NODE_ENV&&("production"!==t.env.NODE_ENV?F(!1,"React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:\n%s",p):void 0)}if(n.nodeType===G?"production"!==t.env.NODE_ENV?B(!1,"You're trying to render a component to the document but you didn't use server rendering. We can't do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering."):B(!1):void 0,o.useCreateElement){for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(e)}else z(n,e)},ownerDocumentContextKey:X,getReactRootID:a,getID:o,setID:l,getNode:u,getNodeFromInstance:c,isValid:h,purgeID:d};D.measureMethods(ee,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),e.exports=ee}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,g)||(e[g]=f++,d[e[g]]={}),d[e[g]]}var i=n(31),a=n(32),o=n(33),s=n(38),l=n(19),u=n(39),c=n(40),h=n(41),d={},p=!1,f=0,m={topAbort:"abort",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},g="_reactListenersID"+String(Math.random()).slice(2),v=c({},s,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(v.handleTopLevel),v.ReactEventListener=e}},setEnabled:function(e){v.ReactEventListener&&v.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!v.ReactEventListener||!v.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,a=r(n),s=o.registrationNameDependencies[e],l=i.topLevelTypes,u=0;u-1?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e):o(!1),!u.plugins[r]){n.extractEvents?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e):o(!1),u.plugins[r]=n;var a=n.eventTypes;for(var c in a)i(a[c],n,c)?void 0:"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",c,e):o(!1)}}}function i(e,n,r){u.eventNameDispatchConfigs.hasOwnProperty(r)?"production"!==t.env.NODE_ENV?o(!1,"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",r):o(!1):void 0,u.eventNameDispatchConfigs[r]=e;var i=e.phasedRegistrationNames;if(i){for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];a(l,n,r)}return!0}return!!e.registrationName&&(a(e.registrationName,n,r),!0)}function a(e,n,r){u.registrationNameModules[e]?"production"!==t.env.NODE_ENV?o(!1,"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e):o(!1):void 0,u.registrationNameModules[e]=n,u.registrationNameDependencies[e]=n.eventTypes[r].dependencies}var o=n(14),s=null,l={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."):o(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var n=!1;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];l.hasOwnProperty(i)&&l[i]===a||(l[i]?"production"!==t.env.NODE_ENV?o(!1,"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",i):o(!1):void 0,l[i]=a,n=!0)}n&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in l)l.hasOwnProperty(e)&&delete l[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=u}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function i(e){return e===y.topMouseMove||e===y.topTouchMove}function a(e){return e===y.topMouseDown||e===y.topTouchStart}function o(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=v.Mount.getNode(r),t?f.invokeGuardedCallbackWithCatch(i,n,e,r):f.invokeGuardedCallback(i,n,e,r),e.currentTarget=null}function s(e,n){var r=e._dispatchListeners,i=e._dispatchIDs;if("production"!==t.env.NODE_ENV&&d(e),Array.isArray(r))for(var a=0;a1?s-1:0),u=1;ut.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),a="undefined"==typeof t.end?i:Math.min(t.end,r);if(!n.extend&&i>a){var o=a;a=i,i=o}var s=u(e,i),l=u(e,a);if(s&&l){var h=document.createRange();h.setStart(s.node,s.offset),n.removeAllRanges(),i>a?(n.addRange(h),n.extend(l.node,l.offset)):(h.setEnd(l.node,l.offset),n.addRange(h))}}}var l=n(10),u=n(129),c=n(76),h=l.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:h?i:a,setOffsets:h?o:s};e.exports=d},function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var i=n(e),a=0,o=0;i;){if(3===i.nodeType){if(o=a+i.textContent.length,a<=t&&o>=t)return{node:i,offset:t-a};a=o}i=n(r(i))}}e.exports=i},function(e,t){"use strict";function n(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}e.exports=n},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&l.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function i(e,t){if(b||null==v||v!==c())return null;var n=r(v);if(!w||!p(w,n)){w=n;var i=u.getPooled(g.select,y,e,t);return i.type="select",i.target=v,o.accumulateTwoPhaseDispatches(i),i}return null}var a=n(31),o=n(74),s=n(10),l=n(127),u=n(78),c=n(130),h=n(83),d=n(80),p=n(118),f=a.topLevelTypes,m=s.canUseDOM&&"documentMode"in document&&document.documentMode<=11,g={select:{phasedRegistrationNames:{bubbled:d({onSelect:null}),captured:d({onSelectCapture:null})},dependencies:[f.topBlur,f.topContextMenu,f.topFocus,f.topKeyDown,f.topMouseDown,f.topMouseUp,f.topSelectionChange]}},v=null,y=null,w=null,b=!1,_=!1,x=d({onSelect:null}),E={eventTypes:g,extractEvents:function(e,t,n,r,a){if(!_)return null;switch(e){case f.topFocus:(h(t)||"true"===t.contentEditable)&&(v=t,y=n,w=null);break;case f.topBlur:v=null,y=null,w=null;break;case f.topMouseDown:b=!0;break;case f.topContextMenu:case f.topMouseUp:return b=!1,i(r,a);case f.topSelectionChange:if(m)break;case f.topKeyDown:case f.topKeyUp:return i(r,a)}return null},didPutListener:function(e,t,n){t===x&&(_=!0)}};e.exports=E},function(e,t){"use strict";var n=Math.pow(2,53),r={createReactRootIndex:function(){return Math.ceil(Math.random()*n)}};e.exports=r},function(e,t,n){(function(t){"use strict";var r=n(31),i=n(120),a=n(74),o=n(29),s=n(134),l=n(78),u=n(135),c=n(136),h=n(87),d=n(139),p=n(140),f=n(88),m=n(141),g=n(16),v=n(137),y=n(14),w=n(80),b=r.topLevelTypes,_={abort:{phasedRegistrationNames:{bubbled:w({onAbort:!0}),captured:w({onAbortCapture:!0})}},blur:{phasedRegistrationNames:{bubbled:w({onBlur:!0}),captured:w({onBlurCapture:!0})}},canPlay:{phasedRegistrationNames:{bubbled:w({onCanPlay:!0}),captured:w({onCanPlayCapture:!0})}},canPlayThrough:{phasedRegistrationNames:{bubbled:w({onCanPlayThrough:!0}),captured:w({onCanPlayThroughCapture:!0})}},click:{phasedRegistrationNames:{bubbled:w({onClick:!0}),captured:w({onClickCapture:!0})}},contextMenu:{phasedRegistrationNames:{bubbled:w({onContextMenu:!0}),captured:w({onContextMenuCapture:!0})}},copy:{phasedRegistrationNames:{bubbled:w({onCopy:!0}),captured:w({onCopyCapture:!0})}},cut:{phasedRegistrationNames:{bubbled:w({onCut:!0}),captured:w({onCutCapture:!0})}},doubleClick:{phasedRegistrationNames:{bubbled:w({onDoubleClick:!0}),captured:w({onDoubleClickCapture:!0})}},drag:{phasedRegistrationNames:{bubbled:w({onDrag:!0}),captured:w({onDragCapture:!0})}},dragEnd:{phasedRegistrationNames:{bubbled:w({onDragEnd:!0}),captured:w({onDragEndCapture:!0})}},dragEnter:{phasedRegistrationNames:{bubbled:w({onDragEnter:!0}),captured:w({onDragEnterCapture:!0})}},dragExit:{phasedRegistrationNames:{bubbled:w({onDragExit:!0}),captured:w({onDragExitCapture:!0})}},dragLeave:{phasedRegistrationNames:{bubbled:w({onDragLeave:!0}),captured:w({onDragLeaveCapture:!0})}},dragOver:{phasedRegistrationNames:{bubbled:w({onDragOver:!0}),captured:w({onDragOverCapture:!0})}},dragStart:{phasedRegistrationNames:{bubbled:w({onDragStart:!0}),captured:w({onDragStartCapture:!0})}},drop:{phasedRegistrationNames:{bubbled:w({onDrop:!0}),captured:w({onDropCapture:!0})}},durationChange:{phasedRegistrationNames:{bubbled:w({onDurationChange:!0}),captured:w({onDurationChangeCapture:!0})}},emptied:{phasedRegistrationNames:{bubbled:w({onEmptied:!0}),captured:w({onEmptiedCapture:!0})}},encrypted:{phasedRegistrationNames:{bubbled:w({onEncrypted:!0}),captured:w({onEncryptedCapture:!0})}},ended:{phasedRegistrationNames:{bubbled:w({onEnded:!0}),captured:w({onEndedCapture:!0})}},error:{phasedRegistrationNames:{bubbled:w({onError:!0}),captured:w({onErrorCapture:!0})}},focus:{phasedRegistrationNames:{bubbled:w({onFocus:!0}),captured:w({onFocusCapture:!0})}},input:{phasedRegistrationNames:{bubbled:w({onInput:!0}),captured:w({onInputCapture:!0})}},keyDown:{phasedRegistrationNames:{bubbled:w({onKeyDown:!0}),captured:w({onKeyDownCapture:!0})}},keyPress:{phasedRegistrationNames:{bubbled:w({onKeyPress:!0}),captured:w({onKeyPressCapture:!0})}},keyUp:{phasedRegistrationNames:{bubbled:w({onKeyUp:!0}),captured:w({onKeyUpCapture:!0})}},load:{phasedRegistrationNames:{bubbled:w({onLoad:!0}),captured:w({onLoadCapture:!0})}},loadedData:{phasedRegistrationNames:{bubbled:w({onLoadedData:!0}),captured:w({onLoadedDataCapture:!0})}},loadedMetadata:{phasedRegistrationNames:{bubbled:w({onLoadedMetadata:!0}),captured:w({onLoadedMetadataCapture:!0})}},loadStart:{phasedRegistrationNames:{bubbled:w({onLoadStart:!0}),captured:w({onLoadStartCapture:!0})}},mouseDown:{phasedRegistrationNames:{bubbled:w({onMouseDown:!0}),captured:w({onMouseDownCapture:!0})}},mouseMove:{phasedRegistrationNames:{bubbled:w({onMouseMove:!0}),captured:w({onMouseMoveCapture:!0})}},mouseOut:{phasedRegistrationNames:{bubbled:w({onMouseOut:!0}),captured:w({onMouseOutCapture:!0})}},mouseOver:{phasedRegistrationNames:{bubbled:w({onMouseOver:!0}),captured:w({onMouseOverCapture:!0})}},mouseUp:{phasedRegistrationNames:{bubbled:w({onMouseUp:!0}),captured:w({onMouseUpCapture:!0})}},paste:{phasedRegistrationNames:{bubbled:w({onPaste:!0}),captured:w({onPasteCapture:!0})}},pause:{phasedRegistrationNames:{bubbled:w({onPause:!0}),captured:w({onPauseCapture:!0})}},play:{phasedRegistrationNames:{bubbled:w({onPlay:!0}),captured:w({onPlayCapture:!0})}},playing:{phasedRegistrationNames:{bubbled:w({onPlaying:!0}),captured:w({onPlayingCapture:!0})}},progress:{phasedRegistrationNames:{bubbled:w({onProgress:!0}),captured:w({onProgressCapture:!0})}},rateChange:{phasedRegistrationNames:{bubbled:w({onRateChange:!0}),captured:w({onRateChangeCapture:!0})}},reset:{phasedRegistrationNames:{bubbled:w({onReset:!0}),captured:w({onResetCapture:!0})}},scroll:{phasedRegistrationNames:{bubbled:w({onScroll:!0}),captured:w({onScrollCapture:!0})}},seeked:{phasedRegistrationNames:{bubbled:w({onSeeked:!0}),captured:w({onSeekedCapture:!0})}},seeking:{phasedRegistrationNames:{bubbled:w({onSeeking:!0}),captured:w({onSeekingCapture:!0})}},stalled:{phasedRegistrationNames:{bubbled:w({onStalled:!0}),captured:w({onStalledCapture:!0})}},submit:{phasedRegistrationNames:{bubbled:w({onSubmit:!0}),captured:w({onSubmitCapture:!0})}},suspend:{phasedRegistrationNames:{bubbled:w({onSuspend:!0}),captured:w({onSuspendCapture:!0})}},timeUpdate:{phasedRegistrationNames:{bubbled:w({onTimeUpdate:!0}),captured:w({onTimeUpdateCapture:!0})}},touchCancel:{phasedRegistrationNames:{bubbled:w({onTouchCancel:!0}),captured:w({onTouchCancelCapture:!0})}},touchEnd:{phasedRegistrationNames:{bubbled:w({onTouchEnd:!0}),captured:w({onTouchEndCapture:!0})}},touchMove:{phasedRegistrationNames:{bubbled:w({onTouchMove:!0}),captured:w({onTouchMoveCapture:!0})}},touchStart:{phasedRegistrationNames:{bubbled:w({onTouchStart:!0}),captured:w({onTouchStartCapture:!0})}},volumeChange:{phasedRegistrationNames:{bubbled:w({onVolumeChange:!0}),captured:w({onVolumeChangeCapture:!0})}},waiting:{phasedRegistrationNames:{bubbled:w({onWaiting:!0}),captured:w({onWaitingCapture:!0})}},wheel:{phasedRegistrationNames:{bubbled:w({onWheel:!0}),captured:w({onWheelCapture:!0})}}},x={topAbort:_.abort,topBlur:_.blur,topCanPlay:_.canPlay,topCanPlayThrough:_.canPlayThrough,topClick:_.click,topContextMenu:_.contextMenu,topCopy:_.copy,topCut:_.cut,topDoubleClick:_.doubleClick,topDrag:_.drag,topDragEnd:_.dragEnd,topDragEnter:_.dragEnter,topDragExit:_.dragExit,topDragLeave:_.dragLeave,topDragOver:_.dragOver,topDragStart:_.dragStart,topDrop:_.drop,topDurationChange:_.durationChange,topEmptied:_.emptied,topEncrypted:_.encrypted,topEnded:_.ended,topError:_.error,topFocus:_.focus,topInput:_.input,topKeyDown:_.keyDown,topKeyPress:_.keyPress,topKeyUp:_.keyUp,topLoad:_.load,topLoadedData:_.loadedData,topLoadedMetadata:_.loadedMetadata,topLoadStart:_.loadStart,topMouseDown:_.mouseDown,topMouseMove:_.mouseMove,topMouseOut:_.mouseOut,topMouseOver:_.mouseOver,topMouseUp:_.mouseUp,topPaste:_.paste,topPause:_.pause,topPlay:_.play,topPlaying:_.playing,topProgress:_.progress,topRateChange:_.rateChange,topReset:_.reset,topScroll:_.scroll,topSeeked:_.seeked,topSeeking:_.seeking,topStalled:_.stalled,topSubmit:_.submit,topSuspend:_.suspend,topTimeUpdate:_.timeUpdate,topTouchCancel:_.touchCancel,topTouchEnd:_.touchEnd,topTouchMove:_.touchMove,topTouchStart:_.touchStart,topVolumeChange:_.volumeChange,topWaiting:_.waiting,topWheel:_.wheel};for(var E in x)x[E].dependencies=[E];var C=w({onClick:null}),k={},N={eventTypes:_,extractEvents:function(e,n,r,i,o){var g=x[e];if(!g)return null;var w;switch(e){case b.topAbort:case b.topCanPlay:case b.topCanPlayThrough:case b.topDurationChange:case b.topEmptied:case b.topEncrypted:case b.topEnded:case b.topError:case b.topInput:case b.topLoad:case b.topLoadedData:case b.topLoadedMetadata:case b.topLoadStart:case b.topPause:case b.topPlay:case b.topPlaying:case b.topProgress:case b.topRateChange:case b.topReset:case b.topSeeked:case b.topSeeking:case b.topStalled:case b.topSubmit:case b.topSuspend:case b.topTimeUpdate:case b.topVolumeChange:case b.topWaiting:w=l;break;case b.topKeyPress:if(0===v(i))return null;case b.topKeyDown:case b.topKeyUp:w=c;break;case b.topBlur:case b.topFocus:w=u;break;case b.topClick:if(2===i.button)return null;case b.topContextMenu:case b.topDoubleClick:case b.topMouseDown:case b.topMouseMove:case b.topMouseOut:case b.topMouseOver:case b.topMouseUp:w=h;break;case b.topDrag:case b.topDragEnd:case b.topDragEnter:case b.topDragExit:case b.topDragLeave:case b.topDragOver:case b.topDragStart:case b.topDrop:w=d;break;case b.topTouchCancel:case b.topTouchEnd:case b.topTouchMove:case b.topTouchStart:w=p;break;case b.topScroll:w=f;break;case b.topWheel:w=m;break;case b.topCopy:case b.topCut:case b.topPaste:w=s}w?void 0:"production"!==t.env.NODE_ENV?y(!1,"SimpleEventPlugin: Unhandled event type, `%s`.",e):y(!1);var _=w.getPooled(g,r,i,o);return a.accumulateTwoPhaseDispatches(_),_},didPutListener:function(e,t,n){if(t===C){var r=o.getNode(e);k[e]||(k[e]=i.listen(r,"click",g))}},willDeleteListener:function(e,t){t===C&&(k[e].remove(),delete k[e])}};e.exports=N}).call(t,n(5))},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(78),a={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(88),a={relatedTarget:null};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(88),a=n(137),o=n(138),s=n(89),l={key:o,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?a(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?a(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};i.augmentClass(r,l),e.exports=r},function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=n},function(e,t,n){"use strict";function r(e){if(e.key){var t=a[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?o[e.keyCode]||"Unidentified":""}var i=n(137),a={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(87),a={dataTransfer:null};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(88),a=n(89),o={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:a};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){i.call(this,e,t,n,r)}var i=n(87),a={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";var r=n(24),i=r.injection.MUST_USE_ATTRIBUTE,a={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},o={Properties:{clipPath:i,cx:i,cy:i,d:i,dx:i,dy:i,fill:i,fillOpacity:i,fontFamily:i,fontSize:i,fx:i,fy:i,gradientTransform:i,gradientUnits:i,markerEnd:i,markerMid:i,markerStart:i,offset:i,opacity:i,patternContentUnits:i,patternUnits:i,points:i,preserveAspectRatio:i,r:i,rx:i,ry:i,spreadMethod:i,stopColor:i,stopOpacity:i,stroke:i,strokeDasharray:i,strokeLinecap:i,strokeOpacity:i,strokeWidth:i,textAnchor:i,transform:i,version:i,viewBox:i,x1:i,x2:i,x:i,xlinkActuate:i,xlinkArcrole:i,xlinkHref:i,xlinkRole:i,xlinkShow:i,xlinkTitle:i,xlinkType:i,xmlBase:i,xmlLang:i,xmlSpace:i,y1:i,y2:i,y:i},DOMAttributeNamespaces:{xlinkActuate:a.xlink,xlinkArcrole:a.xlink,xlinkHref:a.xlink,xlinkRole:a.xlink,xlinkShow:a.xlink,xlinkTitle:a.xlink,xlinkType:a.xlink,xmlBase:a.xml,xmlLang:a.xml,xmlSpace:a.xml},DOMAttributeNames:{clipPath:"clip-path",fillOpacity:"fill-opacity",fontFamily:"font-family",fontSize:"font-size",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",patternContentUnits:"patternContentUnits",patternUnits:"patternUnits",preserveAspectRatio:"preserveAspectRatio",spreadMethod:"spreadMethod",stopColor:"stop-color",stopOpacity:"stop-opacity",strokeDasharray:"stroke-dasharray",strokeLinecap:"stroke-linecap",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",viewBox:"viewBox",xlinkActuate:"xlink:actuate", xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlLang:"xml:lang",xmlSpace:"xml:space"}};e.exports=o},function(e,t,n){"use strict";function r(e){return Math.floor(100*e)/100}function i(e,t,n){e[t]=(e[t]||0)+n}var a=n(24),o=n(144),s=n(29),l=n(19),u=n(145),c={_allMeasurements:[],_mountStack:[0],_injected:!1,start:function(){c._injected||l.injection.injectMeasure(c.measure),c._allMeasurements.length=0,l.enableMeasure=!0},stop:function(){l.enableMeasure=!1},getLastMeasurements:function(){return c._allMeasurements},printExclusive:function(e){e=e||c._allMeasurements;var t=o.getExclusiveSummary(e);console.table(t.map(function(e){return{"Component class name":e.componentName,"Total inclusive time (ms)":r(e.inclusive),"Exclusive mount time (ms)":r(e.exclusive),"Exclusive render time (ms)":r(e.render),"Mount time per instance (ms)":r(e.exclusive/e.count),"Render time per instance (ms)":r(e.render/e.count),Instances:e.count}}))},printInclusive:function(e){e=e||c._allMeasurements;var t=o.getInclusiveSummary(e);console.table(t.map(function(e){return{"Owner > component":e.componentName,"Inclusive time (ms)":r(e.time),Instances:e.count}})),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},getMeasurementsSummaryMap:function(e){var t=o.getInclusiveSummary(e,!0);return t.map(function(e){return{"Owner > component":e.componentName,"Wasted time (ms)":e.time,Instances:e.count}})},printWasted:function(e){e=e||c._allMeasurements,console.table(c.getMeasurementsSummaryMap(e)),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},printDOM:function(e){e=e||c._allMeasurements;var t=o.getDOMSummary(e);console.table(t.map(function(e){var t={};return t[a.ID_ATTRIBUTE_NAME]=e.id,t.type=e.type,t.args=JSON.stringify(e.args),t})),console.log("Total time:",o.getTotalTime(e).toFixed(2)+" ms")},_recordWrite:function(e,t,n,r){var i=c._allMeasurements[c._allMeasurements.length-1].writes;i[e]=i[e]||[],i[e].push({type:t,time:n,args:r})},measure:function(e,t,n){return function(){for(var r=arguments.length,a=Array(r),o=0;o"},h}}};e.exports=c},function(e,t,n){"use strict";function r(e){for(var t=0,n=0;n=u&&s.push(n[t]);return s.sort(function(e,t){return t.exclusive-e.exclusive}),s}function o(e,t){for(var n,r={},i=0;i "+d.current,r[n]=r[n]||{componentName:n,time:0,count:0},o.inclusive[h]&&(r[n].time+=o.inclusive[h]),o.counts[h]&&(r[n].count+=o.counts[h])}}var p=[];for(n in r)r[n].time>=u&&p.push(r[n]);return p.sort(function(e,t){return t.time-e.time}),p}function s(e){var t={},n=Object.keys(e.writes),r=l({},e.exclusive,e.inclusive);for(var i in r){for(var a=!1,o=0;o0&&(t[i]=!0)}return t}var l=n(40),u=1.2,c={_mountImageIntoNode:"set innerHTML",INSERT_MARKUP:"set innerHTML",MOVE_EXISTING:"move",REMOVE_NODE:"remove",SET_MARKUP:"set innerHTML",TEXT_CONTENT:"set textContent",setValueForProperty:"update attribute",setValueForAttribute:"update attribute",deleteValueForProperty:"remove attribute",setValueForStyles:"update styles",replaceNodeWithMarkup:"replace",updateTextContent:"set textContent"},h={getExclusiveSummary:a,getInclusiveSummary:o,getDOMSummary:i,getTotalTime:r};e.exports=h},function(e,t,n){"use strict";var r,i=n(146);r=i.now?function(){return i.now()}:function(){return Date.now()},e.exports=r},function(e,t,n){"use strict";var r,i=n(10);i.canUseDOM&&(r=window.performance||window.msPerformance||window.webkitPerformance),e.exports=r||{}},function(e,t){"use strict";e.exports="0.14.8"},function(e,t,n){"use strict";var r=n(29);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";var r=n(72),i=n(150),a=n(147);r.inject();var o={renderToString:i.renderToString,renderToStaticMarkup:i.renderToStaticMarkup,version:a};e.exports=o},function(e,t,n){(function(t){"use strict";function r(e){o.isValidElement(e)?void 0:"production"!==t.env.NODE_ENV?f(!1,"renderToString(): You must pass a valid ReactElement."):f(!1);var n;try{h.injection.injectBatchingStrategy(u);var r=s.createReactRootID();return n=c.getPooled(!1),n.perform(function(){var t=p(e,null),i=t.mountComponent(r,n,d);return l.addChecksumToMarkup(i)},null)}finally{c.release(n),h.injection.injectBatchingStrategy(a)}}function i(e){o.isValidElement(e)?void 0:"production"!==t.env.NODE_ENV?f(!1,"renderToStaticMarkup(): You must pass a valid ReactElement."):f(!1);var n;try{h.injection.injectBatchingStrategy(u);var r=s.createReactRootID();return n=c.getPooled(!0),n.perform(function(){var t=p(e,null);return t.mountComponent(r,n,d)},null)}finally{c.release(n),h.injection.injectBatchingStrategy(a)}}var a=n(93),o=n(43),s=n(46),l=n(49),u=n(151),c=n(152),h=n(55),d=n(59),p=n(63),f=n(14);e.exports={renderToString:r,renderToStaticMarkup:i}}).call(t,n(5))},function(e,t){"use strict";var n={isBatchingUpdates:!1,batchedUpdates:function(e){}};e.exports=n},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.reactMountReady=a.getPooled(null),this.useCreateElement=!1}var i=n(57),a=n(56),o=n(58),s=n(40),l=n(16),u={initialize:function(){this.reactMountReady.reset()},close:l},c=[u],h={getTransactionWrappers:function(){return c},getReactMountReady:function(){return this.reactMountReady},destructor:function(){a.release(this.reactMountReady),this.reactMountReady=null}};s(r.prototype,o.Mixin,h),i.addPoolingTo(r),e.exports=r},function(e,t,n){(function(t){"use strict";var r=n(111),i=n(124),a=n(123),o=n(154),s=n(43),l=n(155),u=n(108),c=n(147),h=n(40),d=n(157),p=s.createElement,f=s.createFactory,m=s.cloneElement;"production"!==t.env.NODE_ENV&&(p=l.createElement,f=l.createFactory,m=l.cloneElement);var g={Children:{map:r.map,forEach:r.forEach,count:r.count,toArray:r.toArray,only:d},Component:i,createElement:p,cloneElement:m,isValidElement:s.isValidElement,PropTypes:u,createClass:a.createClass,createFactory:f,createMixin:function(e){return e},DOM:o,version:c,__spread:h};e.exports=g}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(e){return"production"!==t.env.NODE_ENV?a.createFactory(e):i.createFactory(e)}var i=n(43),a=n(155),o=n(156),s=o({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);e.exports=s}).call(t,n(5))},function(e,t,n){(function(t){"use strict";function r(){if(d.current){var e=d.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function i(e,n){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=a("uniqueKey",e,n);null!==r&&("production"!==t.env.NODE_ENV?g(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s%s',r.parentOrOwner||"",r.childOwner||"",r.url||""):void 0)}}function a(e,t,n){var i=r();if(!i){var a="string"==typeof n?n:n.displayName||n.name;a&&(i=" Check the top-level render call using <"+a+">.")}var o=v[e]||(v[e]={});if(o[i])return null;o[i]=!0;var s={parentOrOwner:i,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==d.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function o(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n-1&&{to:s[e],title:o[s[e]].getDefaultProps().title};var t=this.props.next;return t=t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t; it will be ignored"):void 0,"production"!==r.env.NODE_ENV?c["default"]((e.routes||e.children)===(this.props.routes||this.props.children),"You cannot change ; it will be ignored"):void 0},t.prototype.componentWillUnmount=function(){this._unlisten&&this._unlisten()},t.prototype.render=function(){var e=this.state,n=e.location,r=e.routes,i=e.params,o=e.components,s=this.props,u=s.RoutingContext,c=s.createElement,h=a(s,["RoutingContext","createElement"]);return null==n?null:(Object.keys(t.propTypes).forEach(function(e){return delete h[e]}),d["default"].createElement(u,l({},h,{history:this.history,createElement:c,location:n,routes:r,params:i,components:o})))},t}(h.Component);C.propTypes={history:E,children:b.routes,routes:b.routes,RoutingContext:x.isRequired,createElement:x,onError:x,onUpdate:x,parseQueryString:x,stringifyQuery:x},C.defaultProps={RoutingContext:v["default"]},t["default"]=C,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){(function(t){"use strict";var n=function(){};"production"!==t.env.NODE_ENV&&(n=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i0&&"number"!=typeof e[0]))}function a(e,t,n){var a,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1; if(l(e))return!!l(t)&&(e=o.call(e),t=o.call(t),u(e,t,n));if(i(e)){if(!i(t))return!1;if(e.length!==t.length)return!1;for(a=0;a=0;a--)if(h[a]!=d[a])return!1;for(a=h.length-1;a>=0;a--)if(c=h[a],!u(e[c],t[c],n))return!1;return typeof e==typeof t}var o=Array.prototype.slice,s=n(177),l=n(178),u=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=i?n:r,t.supported=n,t.unsupported=r},function(e,t){"use strict";function n(e,t,n){function r(){o=!0,n.apply(this,arguments)}function i(){o||(a0?void 0:"production"!==e.env.NODE_ENV?p["default"](!1,'Missing splat #%s for path "%s"',l,t):p["default"](!1),null!=h&&(o+=encodeURI(h))):"("===u?a+=1:")"===u?a-=1:":"===u.charAt(0)?(c=u.substring(1),h=n[c],null!=h||a>0?void 0:"production"!==e.env.NODE_ENV?p["default"](!1,'Missing "%s" parameter for path "%s"',c,t):p["default"](!1),null!=h&&(o+=encodeURIComponent(h))):o+=u;return o.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=s,t.matchPattern=l,t.getParamNames=u,t.getParams=c,t.formatPattern=h;var d=n(169),p=r(d),f={}}).call(t,n(5))},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){for(var t in e)if(e.hasOwnProperty(t))return!0;return!1}function s(e){return function(){function t(e,t){var n=!(arguments.length<=2||void 0===arguments[2])&&arguments[2];return y["default"](e,t,n,S.location,S.routes,S.params)}function n(e){var t=e.pathname,n=e.query,r=e.state;return N.createLocation(N.createPath(t,n),r,h.REPLACE)}function i(e,t){P&&P.location===e?s(P,t):x["default"](C,e,function(n,r){n?t(n):r?s(l({},r,{location:e}),t):t()})}function s(e,t){var r=m["default"](S,e),i=r.leaveRoutes,a=r.enterRoutes;g.runLeaveHooks(i),g.runEnterHooks(a,e,function(r,i){r?t(r):i?t(null,n(i)):b["default"](e,function(n,r){n?t(n):t(null,null,S=l({},e,{components:r}))})})}function u(e){return e.__id__||(e.__id__=D++)}function d(e){return e.reduce(function(e,t){return e.push.apply(e,O[u(t)]),e},[])}function f(e,t){x["default"](C,e,function(n,r){if(null==r)return void t();P=l({},r,{location:e});for(var i=d(m["default"](S,P).leaveRoutes),a=void 0,o=0,s=i.length;null==a&&o=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return d.stringify(e).replace(/%20/g,"+")}function s(e){for(var t in e)if(e.hasOwnProperty(t)&&"object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t])return!0;return!1}function l(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=k(t.substring(1)),e[w]={search:t,searchBase:""}}return e}function n(e,t){var n,i=void 0;if(!t||""===(i=C(t)))return e;"production"!==r.env.NODE_ENV?h["default"](C!==o||!s(t),"useQueries does not stringify nested query objects by default; use a custom stringifyQuery function"):void 0,"string"==typeof e&&(e=g["default"](e));var a=e[w],l=void 0;l=a&&e.search===a.search?a.searchBase:e.search||"";var c=l+(l?"&":"?")+i;return u({},e,(n={search:c},n[w]={search:c,searchBase:l},n))}function i(e){return S.listenBefore(function(n,r){f["default"](e,t(n),r)})}function l(e){return S.listen(function(n){e(t(n))})}function c(e){S.push(n(e,e.query))}function d(e){S.replace(n(e,e.query))}function p(e,t){return S.createPath(n(e,t||e.query))}function m(e,t){return S.createHref(n(e,t||e.query))}function v(){return t(S.createLocation.apply(S,arguments))}function _(e,t,n){"string"==typeof t&&(t=g["default"](t)),c(u({state:e},t,{query:n}))}function x(e,t,n){"string"==typeof t&&(t=g["default"](t)),d(u({state:e},t,{query:n}))}var E=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],C=E.stringifyQuery,k=E.parseQueryString,N=a(E,["stringifyQuery","parseQueryString"]),S=e(N);return"function"!=typeof C&&(C=o),"function"!=typeof k&&(k=b),u({},S,{listenBefore:i,listen:l,push:c,replace:d,createPath:p,createHref:m,createLocation:v,pushState:y["default"](_,"pushState is deprecated; use push instead"),replaceState:y["default"](x,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t should not have a "'+t+'" prop')}t.__esModule=!0,t.falsy=r;var i=n(2),a=i.PropTypes.func,o=i.PropTypes.object,s=i.PropTypes.arrayOf,l=i.PropTypes.oneOfType,u=i.PropTypes.element,c=i.PropTypes.shape,h=i.PropTypes.string,d=c({listen:a.isRequired,pushState:a.isRequired,replaceState:a.isRequired,go:a.isRequired});t.history=d;var p=c({pathname:h.isRequired,search:h.isRequired,state:o,action:h.isRequired,key:h});t.location=p;var f=l([a,h]);t.component=f;var m=l([f,o]);t.components=m;var g=l([o,u]);t.route=g;var v=l([g,s(g)]);t.routes=v,t["default"]={falsy:r,history:d,location:p,component:f,components:m,route:g}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(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 s(e){return 0===e.button}function l(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function u(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t elements are for router configuration only and should not be rendered"):c["default"](!1)},t}(h.Component);w.propTypes={to:v.isRequired,query:y,state:y,onEnter:m.falsy,children:m.falsy},w.createRouteFromReactElement=function(e,t){t?t.indexRoute=f["default"].createRouteFromReactElement(e):"production"!==r.env.NODE_ENV?l["default"](!1,"An does not make sense at the root of your route config"):void 0},t["default"]=w,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(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)}t.__esModule=!0;var s=n(169),l=i(s),u=n(2),c=i(u),h=n(185),d=n(188),p=n(199),f=c["default"].PropTypes,m=f.string,g=f.object,v=function(e){function t(){a(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.render=function(){"production"!==r.env.NODE_ENV?l["default"](!1," elements are for router configuration only and should not be rendered"):l["default"](!1)},t}(u.Component);v.createRouteFromReactElement=function(e){var t=h.createRouteFromReactElement(e);return t.from&&(t.path=t.from),t.onEnter=function(e,n){var r=e.location,i=e.params,a=void 0;if("/"===t.to.charAt(0))a=d.formatPattern(t.to,i);else if(t.to){var o=e.routes.indexOf(t),s=v.getRoutePattern(e.routes,o-1),l=s.replace(/\/*$/,"/")+t.to;a=d.formatPattern(l,i)}else a=r.pathname;n(t.state||r.state,a,t.query||r.query)},t},v.getRoutePattern=function(e,t){for(var n="",r=t;r>=0;r--){var i=e[r],a=i.path||"";if(n=a.replace(/\/*$/,"/")+n,0===a.indexOf("/"))break}return"/"+n},v.propTypes={path:m,from:m,to:m.isRequired,query:g,state:g,onEnter:p.falsy,children:p.falsy},t["default"]=v,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(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)}t.__esModule=!0;var s=n(167),l=i(s),u=n(169),c=i(u),h=n(2),d=i(h),p=n(185),f=n(199),m=d["default"].PropTypes.func,g=function(e){function t(){a(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.render=function(){"production"!==r.env.NODE_ENV?c["default"](!1," elements are for router configuration only and should not be rendered"):c["default"](!1)},t}(h.Component);g.propTypes={path:f.falsy,component:f.component,components:f.components,getComponent:m,getComponents:m},g.createRouteFromReactElement=function(e,t){t?t.indexRoute=p.createRouteFromReactElement(e):"production"!==r.env.NODE_ENV?l["default"](!1,"An does not make sense at the root of your route config"):void 0},t["default"]=g,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(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)}t.__esModule=!0;var s=n(169),l=i(s),u=n(2),c=i(u),h=n(185),d=n(199),p=c["default"].PropTypes,f=p.string,m=p.func,g=function(e){function t(){a(this,t),e.apply(this,arguments)}return o(t,e),t.prototype.render=function(){"production"!==r.env.NODE_ENV?l["default"](!1," elements are for router configuration only and should not be rendered"):l["default"](!1)},t}(u.Component);g.createRouteFromReactElement=h.createRouteFromReactElement,g.propTypes={path:f,component:d.component,components:d.components,getComponent:m,getComponents:m},t["default"]=g,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(199),i={contextTypes:{history:r.history},componentWillMount:function(){this.history=this.context.history}};t["default"]=i,e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(2),o=i(a),s=n(169),l=i(s),u=o["default"].PropTypes.object,c={contextTypes:{history:u.isRequired,route:u},propTypes:{route:u},componentDidMount:function(){this.routerWillLeave?void 0:"production"!==r.env.NODE_ENV?l["default"](!1,"The Lifecycle mixin requires you to define a routerWillLeave method"):l["default"](!1);var e=this.props.route||this.context.route;e?void 0:"production"!==r.env.NODE_ENV?l["default"](!1,"The Lifecycle mixin must be used on either a) a or b) a descendant of a that uses the RouteContext mixin"):l["default"](!1),this._unlistenBeforeLeavingRoute=this.context.history.listenBeforeLeavingRoute(e,this.routerWillLeave)},componentWillUnmount:function(){this._unlistenBeforeLeavingRoute&&this._unlistenBeforeLeavingRoute()}};t["default"]=c,e.exports=t["default"]}).call(t,n(5))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(2),a=r(i),o=a["default"].PropTypes.object,s={propTypes:{route:o.isRequired},childContextTypes:{route:o.isRequired},getChildContext:function(){return{route:this.props.route}}};t["default"]=s,e.exports=t["default"]},function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n=e.routes,i=e.location,a=e.parseQueryString,s=e.stringifyQuery,u=e.basename;i?void 0:"production"!==r.env.NODE_ENV?l["default"](!1,"match needs a location"):l["default"](!1);var c=g({routes:p.createRoutes(n),parseQueryString:a,stringifyQuery:s,basename:u});"string"==typeof i&&(i=c.createLocation(i)),c.match(i,function(e,n,r){t(e,n,r&&o({},r,{history:c}))})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0&&t=0&&y= 0 and < %s, was %s",v.length,y):h["default"](!1);var w=a(v);return p}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return function(){function t(e){return b&&null==e.basename&&(0===e.pathname.indexOf(b)?(e.pathname=e.pathname.substring(b.length),e.basename=b,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!b)return e;"string"==typeof e&&(e=p["default"](e));var t=e.pathname,n="/"===b.slice(-1)?b:b+"/",r="/"===t.charAt(0)?t.slice(1):t,i=n+r;return o({},e,{pathname:i})}function r(e){return x.listenBefore(function(n,r){u["default"](e,t(n),r)})}function a(e){return x.listen(function(n){e(t(n))})}function l(e){x.push(n(e))}function c(e){x.replace(n(e))}function d(e){return x.createPath(n(e))}function f(e){return x.createHref(n(e))}function g(){return t(x.createLocation.apply(x,arguments))}function v(e,t){"string"==typeof t&&(t=p["default"](t)),l(o({state:e},t))}function y(e,t){"string"==typeof t&&(t=p["default"](t)),c(o({state:e},t))}var w=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=w.basename,_=i(w,["basename"]),x=e(_);if(null==b&&s.canUseDOM){var E=document.getElementsByTagName("base")[0];E&&(b=h["default"](E.href))}return o({},x,{listenBefore:r,listen:a,push:l,replace:c,createPath:d,createHref:f,createLocation:g,pushState:m["default"](v,"pushState is deprecated; use push instead"),replaceState:m["default"](y,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t-1){n.update();break}}else this.curve&&this.curve.update&&this.curve.update()}this.props.onMouseMove&&this.props.onMouseMove(e,this),this.dragging&&this.props.onMouseDrag&&this.props.onMouseDrag(e,this),this.props["static"]||this.playing||!this.props.draw||this.props.draw(this,this.curve)},mouseUp:function(e){return this.down=!1,this.movingPoint?(this.movingPoint=!1,this.mp=!1,void(this.props.onMouseUp&&this.props.onMouseUp(e,this))):void(this.props.onMouseUp&&this.props.onMouseUp(e,this))},onClick:function(e){o(e),this.mx=e.offsetX,this.my=e.offsetY,!this.dragging&&this.props.onClick&&this.props.onClick(e,this)},onKeyUp:function(e){this.props.onKeyUp&&(this.props.onKeyUp(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},onKeyDown:function(e){this.props.onKeyDown&&(this.props.onKeyDown(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},onKeyPress:function(e){this.props.onKeyPress&&(this.props.onKeyPress(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},reset:function(){this.refs.canvas.width=this.refs.canvas.width,this.ctx.strokeStyle="black",this.ctx.lineWidth=1,this.ctx.fillStyle="none",this.offset={x:0,y:0},this.colorSeed=0},setSize:function(e,t){this.defaultWidth=e,this.defaultHeight=t,this.refs.canvas.width=e,this.refs.canvas.height=t},setCurves:function(e){this.setCurve(e)},setCurve:function(e){var t=[];e=e instanceof Array?e:Array.prototype.slice.call(arguments),e.forEach(function(e){t=t.concat(e.points)}),this.curve=1===e.length?e[0]:e,this.lpts=t},getPanelWidth:function(){return this.defaultWidth},getPanelHeight:function(){return this.defaultHeight},getDefaultQuadratic:function(){return new this.Bezier(70,250,20,110,250,60)},getDefaultCubic:function(){return new this.Bezier(120,160,35,200,220,260,220,40)},toImage:function(){var e=this.refs.canvas.toDataURL(),t=new Image;return t.src=e,t},setPanelCount:function(e){var t=this.refs.canvas;t.width=e*this.defaultWidth},setOffset:function(e){this.offset=e},setColor:function(e){this.ctx.strokeStyle=e},getColor:function(){return this.ctx.strokeStyle||"black"},setWeight:function(e){this.ctx.lineWidth=e},noColor:function(e){this.ctx.strokeStyle="transparent"},setRandomColor:function(e){e="undefined"==typeof e?1:e;var t=this.colorSeed%360,n=1,r=.34;this.colorSeed+=87,this.ctx.strokeStyle=i.hsl(t,n,r).alpha(e).css()},setRandomFill:function(e){e="undefined"==typeof e?1:e;var t=this.colorSeed%360,n=1,r=.34;this.colorSeed+=87,this.ctx.fillStyle=i.hsl(t,n,r).alpha(e).css()},setFill:function(e){this.ctx.fillStyle=e},getFill:function(){return this.ctx.fillStyle||"transparent"},noFill:function(){this.ctx.fillStyle="transparent"},drawSkeleton:function(e,t,n){t=t||{x:0,y:0};var r=e.points;if(r.length>2){this.ctx.strokeStyle="lightgrey",this.drawLine(r[0],r[1],t);for(var i=r.length-2,a=1;a=0&&y= 0 and < %s, was %s",v.length,y):h["default"](!1);var w=a(v);return p}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return function(){function t(e){return b&&null==e.basename&&(0===e.pathname.indexOf(b)?(e.pathname=e.pathname.substring(b.length),e.basename=b,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!b)return e;"string"==typeof e&&(e=p["default"](e));var t=e.pathname,n="/"===b.slice(-1)?b:b+"/",r="/"===t.charAt(0)?t.slice(1):t,i=n+r;return o({},e,{pathname:i})}function r(e){return x.listenBefore(function(n,r){u["default"](e,t(n),r)})}function a(e){return x.listen(function(n){e(t(n))})}function l(e){x.push(n(e))}function c(e){x.replace(n(e))}function d(e){return x.createPath(n(e))}function f(e){return x.createHref(n(e))}function g(){return t(x.createLocation.apply(x,arguments))}function v(e,t){"string"==typeof t&&(t=p["default"](t)),l(o({state:e},t))}function y(e,t){"string"==typeof t&&(t=p["default"](t)),c(o({state:e},t))}var w=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=w.basename,_=i(w,["basename"]),x=e(_);if(null==b&&s.canUseDOM){var E=document.getElementsByTagName("base")[0];E&&(b=h["default"](E.href))}return o({},x,{listenBefore:r,listen:a,push:l,replace:c,createPath:d,createHref:f,createLocation:g,pushState:m["default"](v,"pushState is deprecated; use push instead"),replaceState:m["default"](y,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t-1){n.update();break}}else this.curve&&this.curve.update&&this.curve.update()}this.props.onMouseMove&&this.props.onMouseMove(e,this),this.dragging&&this.props.onMouseDrag&&this.props.onMouseDrag(e,this),this.props["static"]||this.playing||!this.props.draw||this.props.draw(this,this.curve)},mouseUp:function(e){return this.down=!1,this.movingPoint?(this.movingPoint=!1,this.mp=!1,void(this.props.onMouseUp&&this.props.onMouseUp(e,this))):void(this.props.onMouseUp&&this.props.onMouseUp(e,this))},onClick:function(e){o(e),this.mx=e.offsetX,this.my=e.offsetY,!this.dragging&&this.props.onClick&&this.props.onClick(e,this)},onKeyUp:function(e){this.props.onKeyUp&&(this.props.onKeyUp(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},onKeyDown:function(e){this.props.onKeyDown&&(this.props.onKeyDown(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},onKeyPress:function(e){this.props.onKeyPress&&(this.props.onKeyPress(e,this),!this.playing&&this.props.draw&&this.props.draw(this,this.curve))},reset:function(){this.refs.canvas.width=this.refs.canvas.width,this.ctx.strokeStyle="black",this.ctx.lineWidth=1,this.ctx.fillStyle="none",this.offset={x:0,y:0},this.colorSeed=0},setSize:function(e,t){this.defaultWidth=e,this.defaultHeight=t,this.refs.canvas.width=e,this.refs.canvas.height=t},setCurves:function(e){this.setCurve(e)},setCurve:function(e){var t=[];e=e instanceof Array?e:Array.prototype.slice.call(arguments),e.forEach(function(e){t=t.concat(e.points)}),this.curve=1===e.length?e[0]:e,this.lpts=t},getPanelWidth:function(){return this.defaultWidth},getPanelHeight:function(){return this.defaultHeight},getDefaultQuadratic:function(){return new this.Bezier(70,250,20,110,250,60)},getDefaultCubic:function(){return new this.Bezier(120,160,35,200,220,260,220,40)},toImage:function(){var e=this.refs.canvas.toDataURL(),t=new Image;return t.src=e,t},setPanelCount:function(e){var t=this.refs.canvas;t.width=e*this.defaultWidth},setOffset:function(e){this.offset=e},setColor:function(e){this.ctx.strokeStyle=e},getColor:function(){return this.ctx.strokeStyle||"black"},setWeight:function(e){this.ctx.lineWidth=e},noColor:function(e){this.ctx.strokeStyle="transparent"},setRandomColor:function(e){e="undefined"==typeof e?1:e;var t=this.colorSeed%360,n=1,r=.34;this.colorSeed+=87,this.ctx.strokeStyle=i.hsl(t,n,r).alpha(e).css()},setRandomFill:function(e){e="undefined"==typeof e?1:e;var t=this.colorSeed%360,n=1,r=.34;this.colorSeed+=87,this.ctx.fillStyle=i.hsl(t,n,r).alpha(e).css()},setFill:function(e){this.ctx.fillStyle=e},getFill:function(){return this.ctx.fillStyle||"transparent"},noFill:function(){this.ctx.fillStyle="transparent"},drawSkeleton:function(e,t,n){t=t||{x:0,y:0};var r=e.points;if(r.length>2){this.ctx.strokeStyle="lightgrey",this.drawLine(r[0],r[1],t);for(var i=r.length-2,a=1;a=i&&r<=a){var s=I.subdivide(this.getValues(),r),l=s[0],u=s[1],c=n||this.hasHandles(),h=this._segment1,d=this._segment2,p=this._path;c&&(h._handleOut.set(l[2]-l[0],l[3]-l[1]),d._handleIn.set(u[4]-u[6],u[5]-u[7]));var m=l[6],g=l[7],v=new T(new f(m,g),c&&new f(l[4]-m,l[5]-g),c&&new f(u[2]-m,u[3]-g));p?(p.insert(h._index+1,v),o=this.getNext()):(this._segment2=v,o=new I(v,d))}return o},split:function(e,t){return this._path?this._path.split(this._segment1._index,this._getParameter(e,t)):null},reversed:function(){return new I(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut.set(0,0),this._segment2._handleIn.set(0,0)},statics:{getValues:function(e,t,n){var r=e._point,i=e._handleOut,a=t._handleIn,o=t._point,s=[r._x,r._y,r._x+i._x,r._y+i._y,o._x+a._x,o._y+a._y,o._x,o._y];return n&&n._transformCoordinates(s,s,4),s},subdivide:function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7];t===o&&(t=.5);var h=1-t,d=h*n+t*i,p=h*r+t*a,f=h*i+t*s,m=h*a+t*l,g=h*s+t*u,v=h*l+t*c,y=h*d+t*f,w=h*p+t*m,b=h*f+t*g,_=h*m+t*v,x=h*y+t*b,E=h*w+t*_;return[[n,r,d,p,y,w,x,E],[x,E,b,_,g,v,u,c]]},solveCubic:function(e,t,n,r,i,a){var o=e[t],s=e[t+2],l=e[t+4],u=e[t+6],c=3*(s-o),h=3*(l-s)-c,p=u-o-c-h;return d.solveCubic(p,h,c,o-n,r,i,a)},getParameterOf:function(e,t){var n=new f(e[0],e[1]),r=new f(e[6],e[7]),i=1e-12,a=t.isClose(n,i)?0:t.isClose(r,i)?1:null;if(null!==a)return a;for(var o=[t.x,t.y],s=[],l=2e-7,u=0;u<2;u++)for(var c=I.solveCubic(e,u,o[u],s,0,1),h=0;h=0&&n<=1){var r=t.getDistance(I.getPoint(e,n),!0);if(r.999999999999?1:I.getParameterOf(e,new f(r+c*s,i+c*l))}for(var h=100,d=1/0,p=0,m=0;m<=h;m++)n(m/h);for(var g=1/(2*h);g>4e-7;)n(p-g)||n(p+g)||(g/=2);return p},getPart:function(e,t,n){var r=t>n;if(r){var i=t;t=n,n=i}return t>0&&(e=I.subdivide(e,t)[1]),n<1&&(e=I.subdivide(e,(n-t)/(1-t))[0]),r?[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]]:e},hasHandles:function(e){var t=d.isZero;return!(t(e[0]-e[2])&&t(e[1]-e[3])&&t(e[4]-e[6])&&t(e[5]-e[7]))},isFlatEnough:function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=3*i-2*n-l,h=3*a-2*r-u,d=3*o-2*l-n,p=3*s-2*u-r;return Math.max(c*c,d*d)+Math.max(h*h,p*p)<10*t*t},getArea:function(e){var t=e[0],n=e[1],r=e[6],i=e[7],a=(e[2]+t)/2,o=(e[3]+n)/2,s=(e[4]+e[6])/2,l=(e[5]+e[7])/2;return 6*((t-a)*(o+n)+(a-s)*(l+o)+(s-r)*(i+l))/10},getBounds:function(e){for(var t=e.slice(0,2),n=t.slice(),r=[0,0],i=0;i<2;i++)I._addBounds(e[i],e[i+2],e[i+4],e[i+6],i,0,t,n,r);return new y(t[0],t[1],n[0]-t[0],n[1]-t[1])},_addBounds:function(e,t,n,r,i,a,o,s,l){function u(e,t){var n=e-t,r=e+t;ns[i]&&(s[i]=r)}var c=3*(t-n)-e+r,h=2*(e+n)-4*t,p=t-e,f=d.solveQuadratic(c,h,p,l),m=4e-7,g=1-m;u(r,0);for(var v=0;v=0&&i<=1&&a<=0&&a>=-1}return!1},isLinear:function(e,t,n){var r=e.divide(3);return t.equals(r)&&n.negate().equals(r)}},function(e,t){this[t]=function(){var t=this._segment1,n=this._segment2;return e(n._point.subtract(t._point),t._handleOut,n._handleIn)},this.statics[t]=function(t){var n=t[0],r=t[1],i=t[6],a=t[7];return e(new f(i-n,a-r),new f(t[2]-n,t[3]-r),new f(t[4]-i,t[5]-a))}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},isCollinear:function(e){return e&&this.isStraight()&&e.isStraight()&&this.getLine().isCollinear(e.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAt(.5,!0).y)<1e-7},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAt(.5,!0).x)<1e-7}}),{beans:!1,getParameterAt:function(e,t){return I.getParameterAt(this.getValues(),e,t)},getParameterOf:function(){return I.getParameterOf(this.getValues(),f.read(arguments))},getLocationAt:function(e,t){var n=t?e:this.getParameterAt(e);return null!=n&&n>=0&&n<=1?new R(this,n):null},getLocationOf:function(){return this.getLocationAt(this.getParameterOf(f.read(arguments)),!0)},getOffsetOf:function(){var e=this.getLocationOf.apply(this,arguments);return e?e.getOffset():null},getNearestLocation:function(){var e=f.read(arguments),t=this.getValues(),n=I.getNearestParameter(t,e),r=I.getPoint(t,n);return new R(this,n,r,null,e.getDistance(r))},getNearestPoint:function(){return this.getNearestLocation.apply(this,arguments).getPoint()}},new function(){var e=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return s.each(e,function(e){this[e+"At"]=function(t,n){var r=this.getValues();return I[e](r,n?t:I.getParameterAt(r,t,0))}},{statics:{evaluateMethods:e}})},new function(){function e(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=9*(r-a)+3*(s-t),c=6*(t+a)-12*r,h=3*(r-t),d=9*(i-o)+3*(l-n),p=6*(n+o)-12*i,f=3*(i-n);return function(e){var t=(u*e+c)*e+h,n=(d*e+p)*e+f;return Math.sqrt(t*t+n*n)}}function t(e,t){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(t-e))))}function n(e,t,n,r){if(null==t||t<0||t>1)return null;var i,a,o=e[0],s=e[1],l=e[2],u=e[3],c=e[4],h=e[5],d=e[6],p=e[7],m=4e-7,g=1-m;if(0===n&&(tg)){var v=tg?(i=3*(d-c),a=3*(p-h)):(i=(3*b*t+2*w)*t+y,a=(3*E*t+2*x)*t+_),r){0===i&&0===a&&(tg)&&(i=c-l,a=h-u);var C=Math.sqrt(i*i+a*a);C&&(i/=C,a/=C)}if(3===n){var k=6*b*t+2*w,N=6*E*t+2*x,S=Math.pow(i*i+a*a,1.5);i=0!==S?(i*N-a*k)/S:0,a=0}}}return 2===n?new f(a,(-i)):new f(i,a)}return{statics:{getLength:function(n,r,i){if(r===o&&(r=0),i===o&&(i=1),0===r&&1===i&&I.isStraight(n)){var a=n[6]-n[0],s=n[7]-n[1];return Math.sqrt(a*a+s*s)}var l=e(n);return d.integrate(l,r,i,t(r,i))},getParameterAt:function(n,r,i){function a(e){return m+=d.integrate(h,i,e,t(i,e)),i=e,m-r}if(i===o&&(i=r<0?1:0),0===r)return i;var s=Math.abs,l=r>0,u=l?i:0,c=l?1:i,h=e(n),p=d.integrate(h,u,c,t(u,c));if(s(r-p)<1e-12)return l?c:u;if(s(r)>p)return null;var f=r/p,m=0;return d.findRoot(a,h,i+f,u,c,32,1e-12)},getPoint:function(e,t){return n(e,t,0,!1)},getTangent:function(e,t){return n(e,t,1,!0)},getWeightedTangent:function(e,t){return n(e,t,1,!1)},getNormal:function(e,t){return n(e,t,2,!0)},getWeightedNormal:function(e,t){return n(e,t,2,!1)},getCurvature:function(e,t){return n(e,t,3,!1).x}}}},new function(){function e(e,t,n,r,i,a,o,s,l,u,c){var h=t.startConnected,d=t.endConnected,p=4e-7,f=1-p;if(null==i&&(i=I.getParameterOf(n,a)),null!==i&&i>=(h?p:0)&&i<=(d?f:1)&&(null==l&&(l=I.getParameterOf(o,u)),null!==l&&l>=(d?p:0)&&l<=(h?f:1))){var m=t.renormalize;if(m){var g=m(i,l);i=g[0],l=g[1]}var v=new R(r,i,a||I.getPoint(n,i),c),y=new R(s,l,u||I.getPoint(o,l),c),w=v.getPath()===y.getPath()&&v.getIndex()>y.getIndex(),b=w?y:v,_=t.include;v._intersection=y,y._intersection=v,_&&!_(b)||R.insert(e,b,!0)}}function t(i,a,o,s,l,u,c,h,d,p,f,m,g){if(!(++g>=24)){var v,y,w=a[0],b=a[1],x=a[6],E=a[7],C=_.getSignedDistance,k=C(w,b,x,E,a[2],a[3]),N=C(w,b,x,E,a[4],a[5]),S=k*N>0?.75:4/9,P=S*Math.min(0,k,N),D=S*Math.max(0,k,N),O=C(w,b,x,E,i[0],i[1]),T=C(w,b,x,E,i[2],i[3]),M=C(w,b,x,E,i[4],i[5]),R=C(w,b,x,E,i[6],i[7]),L=n(O,T,M,R),A=L[0],B=L[1];if(null!=(v=r(A,B,P,D))&&null!=(y=r(A.reverse(),B.reverse(),P,D))){i=I.getPart(i,v,y);var z=y-v,V=c+(h-c)*v,j=c+(h-c)*y;if(f>.5&&z>.5)if(j-V>p-d){var F=I.subdivide(i,.5),q=V+(j-V)/2;t(a,F[0],s,o,l,u,d,p,V,q,z,!m,g),t(a,F[1],s,o,l,u,d,p,q,j,z,!m,g)}else{var F=I.subdivide(a,.5),q=d+(p-d)/2;t(F[0],i,s,o,l,u,d,q,V,j,z,!m,g),t(F[1],i,s,o,l,u,q,p,V,j,z,!m,g)}else if(Math.max(p-d,j-V)<1e-7){var U=V+(j-V)/2,W=d+(p-d)/2;i=o.getValues(),a=s.getValues(),e(l,u,m?a:i,m?s:o,m?W:U,null,m?i:a,m?o:s,m?U:W,null)}else z>1e-12&&t(a,i,s,o,l,u,d,p,V,j,z,!m,g)}}}function n(e,t,n,r){var i,a=[0,e],o=[1/3,t],s=[2/3,n],l=[1,r],u=t-(2*e+r)/3,c=n-(e+2*r)/3;if(u*c<0)i=[[a,o,l],[a,s,l]];else{var h=u/c;i=[h>=2?[a,o,l]:h<=.5?[a,s,l]:[a,o,s,l],[a,l]]}return(u||c)<0?i.reverse():i}function r(e,t,n,r){return e[0][1]r?i(t,!1,r):e[0][0]}function i(e,t,n){for(var r=e[0][0],i=e[0][1],a=1,o=e.length;a=n:l<=n)return l===n?s:r+(n-i)*(s-r)/(l-i);r=s,i=l}return null}function a(t,n,r,i,a,o){for(var s=I.isStraight(t),l=s?n:t,u=s?t:n,c=u[0],h=u[1],p=u[6],f=u[7],m=p-c,g=f-h,v=Math.atan2(-g,m),y=Math.sin(v),w=Math.cos(v),b=[],_=0;_<8;_+=2){var x=l[_]-c,E=l[_+1]-h;b.push(x*w-E*y,x*y+E*w)}for(var C=[],k=I.solveCubic(b,1,0,C,0,1),_=0;_d.CURVETIME_EPSILON)&&e(a,o,t,r,O,s?D:S,n,i,T,s?S:D)}}}function o(t,n,r,i,a,o){var s=_.intersect(t[0],t[1],t[6],t[7],n[0],n[1],n[6],n[7]);s&&e(a,o,t,r,null,s,n,i,null,s)}return{statics:{_getIntersections:function(n,r,i,s,l,u){if(!r)return I._getSelfIntersection(n,i,l,u);var c=n[0],h=n[1],d=n[6],p=n[7],m=r[0],g=r[1],v=r[6],y=r[7],w=(3*n[2]+c)/4,b=(3*n[3]+h)/4,_=(3*n[4]+d)/4,x=(3*n[5]+p)/4,E=(3*r[2]+m)/4,C=(3*r[3]+g)/4,k=(3*r[4]+v)/4,N=(3*r[5]+y)/4,S=Math.min,P=Math.max;if(!(P(c,w,_,d)>=S(m,E,k,v)&&S(c,w,_,d)<=P(m,E,k,v)&&P(h,b,x,p)>=S(g,C,N,y)&&S(h,b,x,p)<=P(g,C,N,y)))return l;if(!u.startConnected&&!u.endConnected){var D=I.getOverlaps(n,r);if(D){for(var O=0;O<2;O++){var T=D[O];e(l,u,n,i,T[0],null,r,s,T[1],null,!0)}return l}}var M=I.isStraight(n),R=I.isStraight(r),L=M&&R,A=1e-12,B=l.length;if((L?o:M||R?a:t)(n,r,i,s,l,u,0,1,0,1,0,!1,0),L&&l.length>B)return l;var z=new f(c,h),V=new f(d,p),j=new f(m,g),F=new f(v,y);return z.isClose(j,A)&&e(l,u,n,i,0,z,r,s,0,j),!u.startConnected&&z.isClose(F,A)&&e(l,u,n,i,0,z,r,s,1,F),!u.endConnected&&V.isClose(j,A)&&e(l,u,n,i,1,V,r,s,0,j),V.isClose(F,A)&&e(l,u,n,i,1,V,r,s,1,F),l},_getSelfIntersection:function(e,t,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],u=e[5],c=e[6],h=e[7],p=new _(i,a,c,h,(!1)),m=p.getSide(new f(o,s),!0),g=p.getSide(new f(l,u),!0);if(m===g){var v=(i-l)*(s-h)+(o-c)*(u-a);if(v*m>0)return n}var y=c-3*l+3*o-i,w=l-2*o+i,b=o-i,x=h-3*u+3*s-a,E=u-2*s+a,C=s-a,k=x*b-y*C,N=x*w-y*E,S=E*b-w*C;if(k*k-4*N*S<0){var P,D=[],O=d.solveCubic(y*y+x*x,3*(y*w+x*E),2*(w*w+E*E)+y*b+x*C,w*b+E*C,D,0,1);if(O>0){for(var T=0,M=0;TM&&(M=R,P=D[T])}var L=I.subdivide(e,P);r.endConnected=!0,r.renormalize=function(e,t){return[e*P,t*(1-P)+P]},I._getIntersections(L[0],L[1],t,t,n,r)}}return n},getOverlaps:function(e,t){function n(e){var t=e[6]-e[0],n=e[7]-e[1];return t*t+n*n}var r=Math.abs,i=4e-7,a=2e-7,o=I.isStraight(e),s=I.isStraight(t),l=o&&s;if(l){var u=n(e)a||d.getDistance(new f(h[6],h[7]))>a)return null}else if(o^s)return null;for(var p=[e,t],m=[],g=0,v=0;g<2&&m.length<2;g+=0===v?0:1,v=1^v){var y=I.getParameterOf(p[1^g],new f(p[g][0===v?0:6],p[g][0===v?1:7]));if(null!=y){var w=0===g?[v,y]:[y,v];(0===m.length||r(w[0]-m[0][0])>i&&r(w[1]-m[0][1])>i)&&m.push(w)}if(1===g&&0===m.length)break}if(2!==m.length)m=null;else if(!l){var b=I.getPart(e,m[0][0],m[1][0]),x=I.getPart(t,m[0][1],m[1][1]);(r(x[2]-b[2])>a||r(x[3]-b[3])>a||r(x[4]-b[4])>a||r(x[5]-b[5])>a)&&(m=null)}return m}}}}),R=s.extend({_class:"CurveLocation",beans:!0,initialize:function be(e,t,n,r,i){if(t>.9999996){var a=e.getNext();a&&(t=0,e=a)}this._id=p.get(be),this._setCurve(e),this._parameter=t,this._point=n||e.getPointAt(t,!0),this._overlap=r,this._distance=i,this._intersection=this._next=this._prev=null},_setCurve:function(e){var t=e._path;this._version=t?t._version:0,this._curve=e,this._segment=null,this._segment1=e._segment1,this._segment2=e._segment2},_setSegment:function(e){this._setCurve(e.getCurve()),this._segment=e,this._parameter=e===this._segment1?0:1,this._point=e._point.clone()},getSegment:function(){var e=this.getCurve(),t=this._segment;if(!t){var n=this.getParameter();0===n?t=e._segment1:1===n?t=e._segment2:null!=n&&(t=e.getPartLength(0,n)t&&et&&e<=c||e>=-c&&e=i&&n<=a||r>=i&&r<=a)return!this.isTouching();var o=this.getCurve(),s=o.getPrevious(),l=t.getCurve(),u=l.getPrevious(),c=Math.PI;if(!s||!u)return!1;var h=s.getTangentAt(a,!0).negate().getAngleInRadians(),d=o.getTangentAt(i,!0).getAngleInRadians(),p=u.getTangentAt(a,!0).negate().getAngleInRadians(),f=l.getTangentAt(i,!0).getAngleInRadians();return e(p,h,d)^e(f,h,d)&&e(p,d,h)^e(f,d,h)},isOverlap:function(){return!!this._overlap}},s.each(I.evaluateMethods,function(e){var t=e+"At";this[e]=function(){var e=this.getParameter(),n=this.getCurve();return null!=e&&n&&n[t](e,!0)}},{preserve:!0}),new function(){function e(e,t,n){function r(n,r){for(var a=n+r;a>=-1&&a<=i;a+=r){var o=e[(a%i+i)%i];if(!t.getPoint().isClose(o.getPoint(),2e-7))break;if(t.equals(o))return o}return null}for(var i=e.length,a=0,o=i-1;a<=o;){var s,l=a+o>>>1,u=e[l];if(n&&(s=t.equals(u)?u:r(l,-1)||r(l,1)))return t._overlap&&(s._overlap=s._intersection._overlap=!0),s;var c=t.getPath(),h=u.getPath(),d=c===h?t.getIndex()+t.getParameter()-(u.getIndex()+u.getParameter()):c._id-h._id;d<0?o=l-1:a=l+1}return e.splice(a,0,t),t}return{statics:{insert:e,expand:function(t){for(var n=t.slice(),r=0,i=t.length;r0?this.setSegments(t):(this._curves=o,this._selectedSegmentState=0,t||"string"!=typeof e||(this.setPathData(e),e=null)),this._initialize(!t&&e)},_equals:function(e){return this._closed===e._closed&&s.equals(this._segments,e._segments)},clone:function(e){var t=new A(C.NO_INSERT);return t.setSegments(this._segments),t._closed=this._closed,this._clockwise!==o&&(t._clockwise=this._clockwise),this._clone(t,e)},_changed:function _e(e){if(_e.base.call(this,e),8&e){var t=this._parent;if(t&&(t._currentPath=o),this._length=this._area=this._clockwise=this._monoCurves=o,16&e)this._version++;else if(this._curves)for(var n=0,r=this._curves.length;n0&&this._add(T.readAll(e)),t&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var e=this._curves,t=this._segments;if(!e){var n=this._countCurves();e=this._curves=new Array(n);for(var r=0;r0&&(n(d[0],!0),v.push("z")),v.join("")}},{isEmpty:function(){return 0===this._segments.length},_transformContent:function(e){for(var t=new Array(6),n=0,r=this._segments.length;n0?e-1:e},add:function(e){return arguments.length>1&&"number"!=typeof e?this._add(T.readAll(arguments)):this._add([T.read(arguments)])[0]},insert:function(e,t){return arguments.length>2&&"number"!=typeof t?this._add(T.readAll(arguments,1),e):this._add([T.read(arguments,1)],e)[0]},addSegment:function(){return this._add([T.read(arguments)])[0]},insertSegment:function(e){return this._add([T.read(arguments,1)],e)[0]},addSegments:function(e){return this._add(T.readAll(e))},insertSegments:function(e,t){return this._add(T.readAll(t),e)},removeSegment:function(e){return this.removeSegments(e,e+1)[0]||null},removeSegments:function(e,t,n){e=e||0,t=s.pick(t,this._segments.length);var r=this._segments,i=this._curves,a=r.length,o=r.splice(e,t-e),l=o.length;if(!l)return o;for(var u=0;u0&&t===a+(this._closed?1:0)?e-1:e,i=i.splice(d,l);n&&(o._curves=i.slice(1)),this._adjustCurves(d,d)}return this._changed(25),o},clear:"#removeSegments",hasHandles:function(){for(var e=this._segments,t=0,n=e.length;t=0},setClockwise:function(e){this.isClockwise()!=(e=!!e)&&this.reverse(),this._clockwise=e},isFullySelected:function(){var e=this._segments.length;return this._selected&&e>0&&this._selectedSegmentState===7*e},setFullySelected:function(e){e&&this._selectSegments(!0),this.setSelected(e)},setSelected:function xe(e){e||this._selectSegments(!1),xe.base.call(this,e)},_selectSegments:function(e){var t=this._segments.length;this._selectedSegmentState=e?7*t:0;for(var n=0;n0&&this.setSelected(!0)},flatten:function(e){for(var t=new z(this,64,.1),n=0,r=t.length/Math.ceil(t.length/e),i=t.length+(this._closed?-r:r)/2,a=[];n<=i;)a.push(new T(t.getPointAt(n))),n+=r;this.setSegments(a)},reduce:function(){for(var e=this.getCurves(),t=e.length-1;t>=0;t--){var n=e[t];n.hasHandles()||0!==n.getLength()&&!n.isCollinear(n.getNext())||n.remove()}return this},simplify:function(e){if(this._segments.length>2){var t=new V(this,e||2.5);this.setSegments(t.fit())}},split:function(e,t){if(null===t)return null;if(1===arguments.length){var n=e;if("number"==typeof n&&(n=this.getLocationAt(n)),!n)return null;e=n.index,t=n.parameter}var r=4e-7,i=1-r;t>=i&&(e++,t--);var a=this.getCurves();if(e>=0&&e=r&&a[e++].divide(t,!0);var o,s=this.removeSegments(e,this._segments.length,!0);return this._closed?(this.setClosed(!1),o=this):(o=new A(C.NO_INSERT),o.insertAbove(this,!0),this._clone(o)),o._add(s,0),this.addSegment(s[0]),o}return null},reverse:function(){this._segments.reverse();for(var e=0,t=this._segments.length;e0&&t._index0||E?0:null;if(null!==C&&(C>0?(s=m.getStrokeJoin(),l=m.getStrokeCap(),u=C*m.getMiterLimit(),b=w.add(new f(C,C))):s=l="round"),!t.ends||t.segments||y){if(t.segments||t.handles)for(var k=0;k1?o(h.getSegment())||(h=null):n(h.getPoint(),b)||(h=null)}if(!h&&"miter"===s&&v>1)for(var k=0;ke)return a.getLocationAt(e-l)}return n.length>0&&e<=this.getLength()?new R(n[n.length-1],1):null},getNearestLocation:function(){for(var e=f.read(arguments),t=this.getCurves(),n=1/0,r=null,i=0,a=t.length;i0&&r(d[0])}return{_draw:function(e,n,r){function i(e){return h[(e%d+d)%d]}var o=n.dontStart,s=n.dontFinish||n.clip,l=this.getStyle(),u=l.hasFill(),c=l.hasStroke(),h=l.getDashArray(),d=!a.support.nativeDash&&c&&h&&h.length;if(o||e.beginPath(),!o&&this._currentPath?e.currentPath=this._currentPath:(u||c&&!d||s)&&(t(e,this,r),this._closed&&e.closePath(),o||(this._currentPath=e.currentPath)),!s&&(u||c)&&(this._setStyles(e),u&&(e.fill(l.getWindingRule()),e.shadowColor="rgba(0,0,0,0)"),c)){if(d){o||e.beginPath();var p,f=new z(this,32,.25,r),m=f.length,g=-l.getDashOffset(),v=0;for(g%=m;g>0;)g-=i(v--)+i(v--);for(;g0||p>0)&&f.drawPart(e,Math.max(g,0),Math.max(p,0)),g=p+i(v++)}e.stroke()}},_drawSelected:function(n,r){n.beginPath(),t(n,this,r),n.stroke(),e(n,this._segments,r,a.settings.handleSize)}}},new function(){function e(e){var t=e.length,n=[],r=[],i=2;n[0]=e[0]/i;for(var a=1;a1&&(C*=O,k*=O,N=C*C,S=k*k),O=(N*S-N*D-S*P)/(N*D+S*P),E(O)<1e-12&&(O=0),O<0)throw new Error("Cannot create an arc with the given arguments");n=new f(C*x/k,-k*w/C).multiply((v===h?-1:1)*Math.sqrt(O)).rotate(m).add(d),a=(new b).translate(n).rotate(m).scale(C,k),i=a._inverseTransform(l),r=i.getDirectedAngle(a._inverseTransform(u)),!h&&r>0?r-=360:h&&r<0&&(r+=360)}if(t){var M=new _(l.add(t).divide(2),t.subtract(l).rotate(90),(!0)),I=new _(t.add(u).divide(2),u.subtract(t).rotate(90),(!0)),R=new _(l,u),L=R.getSide(t);if(n=M.intersect(I,!0),!n){if(!L)return this.lineTo(u);throw new Error("Cannot create an arc with the given arguments")}i=l.subtract(n),r=i.getDirectedAngle(u.subtract(n));var A=R.getSide(n);0===A?r=L*Math.abs(r):L===A&&(r+=r<0?360:-360)}for(var B=Math.abs(r),z=B>=360?4:Math.ceil(B/90),V=r/z,j=V*Math.PI/360,F=4/3*Math.sin(j)/(1+Math.cos(j)),q=[],U=0;U<=z;U++){var y=u,W=null;if(U0&&(s(e[0],p),s(e[e.length-1],p)),h},_getPenPadding:function(e,t){if(!t)return[e,e];var n=t.shiftless(),r=n.transform(new f(e,0)),i=n.transform(new f(0,e)),a=r.getAngleInRadians(),o=r.getLength(),s=i.getLength(),l=Math.sin(a),u=Math.cos(a),c=Math.tan(a),h=-Math.atan(s*c/o),d=Math.atan(s/(c*o));return[Math.abs(o*Math.cos(h)*u-s*Math.sin(h)*l),Math.abs(s*Math.sin(d)*u+o*Math.cos(d)*l)]},_addBevelJoin:function(e,t,n,r,i,a){var o=e.getCurve(),s=o.getPrevious(),l=o.getPointAt(0,!0),u=s.getNormalAt(1,!0),c=o.getNormalAt(0,!0),h=u.getDirectedAngle(c)<0?-n:n;if(u.setLength(h),c.setLength(h),a&&(i(l),i(l.add(u))),"miter"===t){var d=new _(l.add(u),new f((-u.y),u.x),(!0)).intersect(new _(l.add(c),new f((-c.y),c.x),(!0)),!0);if(d&&l.getDistance(d)<=r&&(i(d),!a))return}a||i(l.add(u)),i(l.add(c))},_addSquareCap:function(e,t,n,r,i){var a=e._point,o=e.getLocation(),s=o.getNormal().multiply(n);i&&(r(a.subtract(s)),r(a.add(s))),"square"===t&&(a=a.add(s.rotate(0===o.getParameter()?-90:90))),r(a.add(s)),r(a.subtract(s))},getHandleBounds:function(e,t,n,r,i,a){for(var o=new Array(6),s=1/0,l=-s,u=s,c=l,h=0,d=e.length;hl&&(l=x),Ec&&(c=C)}}return new y(s,u,l-s,c-u)},getRoughBounds:function(e,t,n,r){var i=n.hasStroke()?n.getStrokeWidth()/2:0,a=i;return i>0&&("miter"===n.getStrokeJoin()&&(a=i*n.getMiterLimit()),"square"===n.getStrokeCap()&&(a=Math.max(a,i*Math.sqrt(2)))),A.getHandleBounds(e,t,n,r,A._getPenPadding(i,r),A._getPenPadding(a,r))}}});A.inject({statics:new function(){function e(e,t,n){var r=s.getNamed(n),i=new A(r&&r.insert===!1&&C.NO_INSERT);return i._add(e),i._closed=t,i.set(r)}function t(t,n,i){for(var a=new Array(4),o=0;o<4;o++){var s=r[o];a[o]=new T(s._point.multiply(n).add(t),s._handleIn.multiply(n),s._handleOut.multiply(n))}return e(a,!0,i)}var n=.5522847498307936,r=[new T([-1,0],[0,n],[0,-n]),new T([0,-1],[-n,0],[n,0]),new T([1,0],[0,-n],[0,n]),new T([0,1],[n,0],[-n,0])];return{Line:function(){return e([new T(f.readNamed(arguments,"from")),new T(f.readNamed(arguments,"to"))],!1,arguments)},Circle:function(){var e=f.readNamed(arguments,"center"),n=s.readNamed(arguments,"radius");return t(e,new g(n),arguments)},Rectangle:function(){var t,r=y.readNamed(arguments,"rectangle"),i=g.readNamed(arguments,"radius",0,{readNull:!0}),a=r.getBottomLeft(!0),o=r.getTopLeft(!0),s=r.getTopRight(!0),l=r.getBottomRight(!0);if(!i||i.isZero())t=[new T(a),new T(o),new T(s),new T(l)];else{i=g.min(i,r.getSize(!0).divide(2));var u=i.width,c=i.height,h=u*n,d=c*n;t=[new T(a.add(u,0),null,[-h,0]),new T(a.subtract(0,c),[0,d]),new T(o.add(0,c),null,[0,-d]),new T(o.add(u,0),[-h,0],null),new T(s.subtract(u,0),null,[h,0]),new T(s.add(0,c),[0,-d],null),new T(l.subtract(0,c),null,[0,d]),new T(l.subtract(u,0),[h,0])]}return e(t,!0,arguments)},RoundRectangle:"#Rectangle",Ellipse:function(){var e=S._readEllipse(arguments);return t(e.center,e.radius,arguments)},Oval:"#Ellipse",Arc:function(){var e=f.readNamed(arguments,"from"),t=f.readNamed(arguments,"through"),n=f.readNamed(arguments,"to"),r=s.getNamed(arguments),i=new A(r&&r.insert===!1&&C.NO_INSERT);return i.moveTo(e),i.arcTo(t,n),i.set(r)},RegularPolygon:function(){for(var t=f.readNamed(arguments,"center"),n=s.readNamed(arguments,"sides"),r=s.readNamed(arguments,"radius"),i=360/n,a=!(n%3),o=new f(0,a?-r:r),l=a?-1:.5,u=new Array(n),c=0;c=0;r--){var i=t[r];i instanceof B&&(t.splice.apply(t,[r,1].concat(i.removeChildren())),i.remove())}t=Ee.base.call(this,e,t,n,A);for(var r=0,a=!n&&t&&t.length;r=0;t--){var n=e[t].reduce();n.isEmpty()&&e.splice(t,1)}if(0===e.length){var n=new A(C.NO_INSERT);return n.insertAbove(this),n.setStyle(this._style),this.remove(),n}return Ce.base.call(this)},isClockwise:function(){var e=this.getFirstChild();return e&&e.isClockwise()},setClockwise:function(e){this.isClockwise()!==!!e&&this.reverse()},getFirstSegment:function(){var e=this.getFirstChild();return e&&e.getFirstSegment()},getLastSegment:function(){var e=this.getLastChild();return e&&e.getLastSegment()},getCurves:function(){for(var e=this._children,t=[],n=0,r=e.length;n=0;h--){var d=l[h].split();d&&(a(d)&&d.getFirstSegment().setHandleIn(0,0),o.getLastSegment().setHandleOut(0,0))}return a(o),t(k,c,n,r)}function i(e,t){for(var n=e;n;){if(n===t)return;n=n._prev}for(;e._next&&e._next!==t;)e=e._next;if(!e._next){for(;t._prev;)t=t._prev;e._next=t,t._prev=e}}function a(e){for(var t,n,r=4e-7,a=1-r,o=!1,s=[],l=e.length-1;l>=0;l--){var u=e[l],c=u._curve,h=u._parameter,d=h;c!==t?o=!c.hasHandles():n>0&&(h/=n);var p;ha?p=c._segment2:(p=c.divide(h,!0,!0)._segment1,o&&s.push(p)),u._setSegment(p);var f=p._intersection,m=u._intersection;if(f){i(f,m);for(var g=f;g;)i(g._intersection,f),g=g._next}else p._intersection=m;t=c,n=d}for(var l=0,v=s.length;l0)for(var E=p.length-1;E>=0;E--){var C=I.getPoint(x,p[E]).y;Cg?g=C:C>w&&C-(1/0)&&(c=o(new f(l,g),t,!1,r)),v<1/0&&(h=o(new f(l,v),t,!1,r))}else for(var k,N,S=l-i,P=l+i,D=!1,b=0,_=t.length;b<_;b++){var O=t[b],x=O.values,T=O.winding;if(T&&(1===T&&u>=x[1]&&u<=x[7]||u>=x[7]&&u<=x[1])&&1===I.solveCubic(x,1,u,p,0,1)){var M=p[0];if(!(M>s&&D&&O.next!==t[b+1]||Ms&&O.previous===k)){var R=I.getPoint(x,M).x,L=I.getTangent(x,M).y,A=!1;d.isZero(L)&&!I.isStraight(x)||Ms&&L*I.getTangent(O.next.values,0).y<0?r&&R>=S&&R<=P&&(++c,++h,A=!0):R<=S?(c+=T,A=!0):R>=P&&(h+=T,A=!0),O.previous!==t[b-1]&&(D=M=0;E--)s[E].segment._winding=x}function l(e,t){function n(e,t){if(e._visited)return!1;if(!c)return!0;var n=e._winding,r=e._intersection;return r&&t&&h&&r.isOverlap()&&(n=h[n]||n),c(n)}function r(e){return e===o||e===s}function i(e,t){if(!e._next)return e;for(;e;){var i=e._segment,a=i.getNext(),o=a._intersection;if(r(a)||!i._visited&&!a._visited&&(!c||(!t||n(i))&&(!(t&&o&&o.isOverlap())&&n(a)||!t&&o&&n(o._segment))))return e;e=e._next}return null}function a(e,t){for(;e;){var n=e._segment;if(r(n))return n;e=e[t?"_next":"_prev"]}}for(var o,s,l=[],c=u[t],h={unite:{1:2},intersect:{2:1}}[t],p=0,f=e.length;pi?-1:1,previous:n,next:null};n&&(n.next=a),r.push(a),n=a}function t(t){if(0!==I.getLength(t)){var n=t[1],r=t[3],i=t[5],a=t[7];if(I.isStraight(t))e(t);else{var o=3*(r-i)-n+a,s=2*(n+i)-4*r,l=r-n,u=4e-7,c=1-u,h=[],p=d.solveQuadratic(o,s,l,h,u,c);if(0===p)e(t);else{h.sort();var f=h[0],m=I.subdivide(t,f);e(m[0]),p>1&&(f=(h[1]-f)/(1-f),m=I.subdivide(m[1],f),e(m[0])),e(m[1])}}}}var n,r=this._monoCurves;if(!r){r=this._monoCurves=[];for(var i=this.getCurves(),a=this._segments,o=0,s=i.length;o1){var l=a[a.length-1]._point,u=a[0]._point,c=l._x,h=l._y,p=u._x,f=u._y;t([c,h,c,h,p,f,p,f])}if(r.length>0){var m=r[0],g=r[r.length-1];m.previous=g,g.next=m}}return r},getInteriorPoint:function(){var e=this.getBounds(),t=e.getCenter(!0);if(!this.contains(t)){for(var n=this._getMonoCurves(),r=[],i=t.y,a=[],o=0,s=n.length;o=l[1]&&i<=l[7]||i>=l[7]&&i<=l[1])&&I.solveCubic(l,1,i,r,0,1)>0)for(var u=r.length-1;u>=0;u--)a.push(I.getPoint(l,r[u]).x);if(a.length>1)break}t.x=(a[0]+a[1])/2}return t},reorient:function(){return this.setClockwise(!0),this}}),B.inject({_getMonoCurves:function(){for(var e=this._children,t=[],n=0,r=e.length;n0){this.addChildren(e);for(var t=e[0].isClockwise(),n=1,r=e.length;n=0;o--)e[o].contains(i)&&a++;e[n].setClockwise(a%2===0&&t)}}return this}});var z=s.extend({_class:"PathIterator",initialize:function(e,t,n,r){function i(e,t){var n=I.getValues(e,t,r);s.push(n),a(n,e._index,0,1)}function a(e,t,r,i){if(i-r>c&&!I.isFlatEnough(e,n||.25)){var o=I.subdivide(e,.5),s=(r+i)/2;a(o[0],t,r,s),a(o[1],t,s,i)}else{var h=e[6]-e[0],d=e[7]-e[1],p=Math.sqrt(h*h+d*d);p>1e-6&&(u+=p,l.push({offset:u,value:i,index:t}))}}for(var o,s=[],l=[],u=0,c=1/(t||32),h=e._segments,d=h[0],p=1,f=h.length;p=e){this.index=t;var a=this.parts[t-1],o=a&&a.index==i.index?a.value:0,s=a?a.offset:0;return{value:o+(i.value-o)*(e-s)/(i.offset-s),index:i.index}}}var i=this.parts[this.parts.length-1];return{value:1,index:i.index}},drawPart:function(e,t,n){t=this.getParameterAt(t),n=this.getParameterAt(n);for(var r=t.index;r<=n.index;r++){var i=I.getPart(this.curves[r],r==t.index?t.value:0,r==n.index?n.value:1);r==t.index&&e.moveTo(i[0],i[1]),e.bezierCurveTo.apply(e,i.slice(2))}}},s.each(I.evaluateMethods,function(e){this[e+"At"]=function(t,n){var r=this.getParameterAt(t);return I[e](this.curves[r.index],r.value,n)}},{})),V=s.extend({initialize:function(e,t){for(var n,r=this.points=[],i=e._segments,a=0,o=i.length;a0?[new T(e[0])]:[];return t>1&&this.fitCubic(0,t-1,e[1].subtract(e[0]).normalize(),e[t-2].subtract(e[t-1]).normalize()),this.closed&&(n.shift(),n.pop()),n},fitCubic:function(e,t,n,r){if(t-e==1){var i=this.points[e],a=this.points[t],o=i.getDistance(a)/3;return void this.addCurve([i,i.add(n.normalize(o)),a.add(r.normalize(o)),a])}for(var s,l=this.chordLengthParameterize(e,t),u=Math.max(this.error,this.error*this.error),c=!0,h=0;h<=4;h++){var d=this.generateBezier(e,t,l,n,r),p=this.findMaxError(e,t,d,l);if(p.error=u)break;c=this.reparameterize(e,t,l,d),u=p.error}var f=this.points[s-1].subtract(this.points[s]),m=this.points[s].subtract(this.points[s+1]),g=f.add(m).divide(2).normalize();this.fitCubic(e,s,n,g),this.fitCubic(s,t,g.negate(),r)},addCurve:function(e){var t=this.segments[this.segments.length-1];t.setHandleOut(e[1].subtract(e[0])),this.segments.push(new T(e[3],e[2].subtract(e[3])))},generateBezier:function(e,t,n,r,i){for(var a=1e-12,o=this.points[e],s=this.points[t],l=[[0,0],[0,0]],u=[0,0],c=0,h=t-e+1;ca){var k=l[0][0]*u[1]-l[1][0]*u[0],N=u[0]*l[1][1]-u[1]*l[0][1];x=N/C,E=k/C}else{var S=l[0][0]+l[0][1],P=l[1][0]+l[1][1];x=E=Math.abs(S)>a?u[0]/S:Math.abs(P)>a?u[1]/P:0}var D,O,T=s.getDistance(o),M=a*T;if(xT*T&&(x=E=T/3,D=O=null)}return[o,o.add(D||r.normalize(x)),s.add(O||i.normalize(E)),s]},reparameterize:function(e,t,n,r){for(var i=e;i<=t;i++)n[i-e]=this.findRoot(r,this.points[i],n[i-e]);for(var i=1,a=n.length;i=a&&(a=u,i=o)}return{error:a,index:i}}}),j=C.extend({_class:"TextItem",_boundsSelected:!0,_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsGetter:"getBounds",initialize:function(e){this._content="",this._lines=[];var t=e&&s.isPlainObject(e)&&e.x===o&&e.y===o;this._initialize(t&&e,!t&&f.read(arguments))},_equals:function(e){return this._content===e._content},_clone:function ke(e,t,n){return e.setContent(this._content),ke.base.call(this,e,t,n)},getContent:function(){return this._content},setContent:function(e){this._content=""+e,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(265)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),F=j.extend({_class:"PointText",initialize:function(){j.apply(this,arguments)},clone:function(e){return this._clone(new F(C.NO_INSERT),e)},getPoint:function(){var e=this._matrix.getTranslation();return new m(e.x,e.y,this,"setPoint")},setPoint:function(){var e=f.read(arguments);this.translate(e.subtract(this._matrix.getTranslation()))},_draw:function(e){if(this._content){this._setStyles(e);var t=this._style,n=this._lines,r=t.getLeading(),i=e.shadowColor;e.font=t.getFontStyle(),e.textAlign=t.getJustification();for(var a=0,o=n.length;a1&&(l-=1),o[s]=6*l<1?a+6*(i-a)*l:2*l<1?i:3*l<2?a+(i-a)*(2/3-l)*6:a}return o},"rgb-gray":function(e,t,n){return[.2989*e+.587*t+.114*n]},"gray-rgb":function(e){return[e,e,e]},"gray-hsb":function(e){return[0,0,e]},"gray-hsl":function(e){return[0,0,e]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return s.each(n,function(e,t){r[t]=[],s.each(e,function(e,i){var a=s.capitalize(e),o=/^(hue|saturation)$/.test(e),l=r[t][i]="gradient"===e?function(e){var t=this._components[0];return e=U.read(Array.isArray(e)?e:arguments,0,{readNull:!0}),t!==e&&(t&&t._removeOwner(this),e&&e._addOwner(this)),e}:"gradient"===t?function(){return f.read(arguments,0,{readNull:"highlight"===e,clone:!0})}:function(e){return null==e||isNaN(e)?0:e};this["get"+a]=function(){return this._type===t||o&&/^hs[bl]$/.test(this._type)?this._components[i]:this._convert(t)[i]},this["set"+a]=function(e){this._type===t||o&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(t),this._properties=n[t],this._type=t),this._components[i]=l.call(this,e),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function l(t){var i,a,o,s,u=Array.prototype.slice,c=arguments,h=0;Array.isArray(t)&&(c=t,t=c[0]);var d=null!=t&&typeof t;if("string"===d&&t in n&&(i=t,t=c[1],Array.isArray(t)?(a=t,o=c[2]):(this.__read&&(h=1),c=u.call(c,1),d=typeof t)),!a){if(s="number"===d?c:"object"===d&&null!=t.length?t:null){i||(i=s.length>=3?"rgb":"gray");var f=n[i].length;o=s[f],this.__read&&(h+=s===arguments?f+(null!=o?1:0):1),s.length>f&&(s=u.call(s,0,f))}else if("string"===d)i="rgb",a=e(t),4===a.length&&(o=a[3],a.length--);else if("object"===d)if(t.constructor===l){if(i=t._type,a=t._components.slice(),o=t._alpha,"gradient"===i)for(var m=1,g=a.length;m1?1:e))}var n=this._convert("rgb"),r=e||null==this._alpha?1:this._alpha;return n=[t(n[0]),t(n[1]),t(n[2])],r<1&&n.push(r<0?0:r),e?"#"+((1<<24)+(n[0]<<16)+(n[1]<<8)+n[2]).toString(16).slice(1):(4==n.length?"rgba(":"rgb(")+n.join(",")+")"},toCanvasStyle:function(e){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var t,n=this._components,r=n[0],i=r._stops,a=n[1],o=n[2];if(r._radial){var s=o.getDistance(a),l=n[3];if(l){var u=l.subtract(a);u.getLength()>s&&(l=a.add(u.normalize(s-.1)))}var c=l||a;t=e.createRadialGradient(c.x,c.y,0,a.x,a.y,s)}else t=e.createLinearGradient(a.x,a.y,o.x,o.y);for(var h=0,d=i.length;h0&&!(t instanceof B))for(var r=0,s=n.length;r0},hasShadow:function(){return!!this.getShadowColor()&&this.getShadowBlur()>0},getView:function(){return this._project.getView()},getFontStyle:function(){var e=this.getFontSize();return this.getFontWeight()+" "+e+(/[a-z]/i.test(e+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function Ne(){var e=Ne.base.call(this),t=this.getFontSize();return/pt|em|%|px/.test(t)&&(t=this.getView().getPixelSize(t)),null!=e?e:1.2*t}}),H=new function(){function e(e,t,n,r){for(var i=["","webkit","moz","Moz","ms","o"],a=t[0].toUpperCase()+t.substring(1),o=0;o<6;o++){var s=i[o],l=s?s+a:t;if(l in e){if(!n)return e[l];e[l]=r;break}}}return{getStyles:function(e){var t=e&&9!==e.nodeType?e.ownerDocument:e,n=t&&t.defaultView;return n&&n.getComputedStyle(e,"")},getBounds:function(e,t){var n,r=e.ownerDocument,i=r.body,a=r.documentElement;try{n=e.getBoundingClientRect()}catch(o){n={left:0,top:0,width:0,height:0}}var s=n.left-(a.clientLeft||i.clientLeft||0),l=n.top-(a.clientTop||i.clientTop||0);if(!t){var u=r.defaultView;s+=u.pageXOffset||a.scrollLeft||i.scrollLeft,l+=u.pageYOffset||a.scrollTop||i.scrollTop}return new y(s,l,n.width,n.height)},getViewportBounds:function(e){var t=e.ownerDocument,n=t.defaultView,r=t.documentElement;return new y(0,0,n.innerWidth||r.clientWidth,n.innerHeight||r.clientHeight)},getOffset:function(e,t){return H.getBounds(e,t).getPoint()},getSize:function(e){return H.getBounds(e,!0).getSize()},isInvisible:function(e){return H.getSize(e).equals(new g(0,0))},isInView:function(e){return!H.isInvisible(e)&&H.getViewportBounds(e).intersects(H.getBounds(e,!0))},getPrefixed:function(t,n){return e(t,n)},setPrefixed:function(t,n,r){if("object"==typeof n)for(var i in n)e(t,i,!0,n[i]);else e(t,n,!0,r)}}},X={add:function(e,t){for(var n in t)for(var r=t[n],i=n.split(/[\s,]+/g),a=0,o=i.length;a=0;t--){var o=i[t],s=o[0],l=o[1];(!l||("true"==u.getAttribute(l,"keepalive")||a)&&H.isInView(l))&&(i.splice(t,1),s())}n&&(i.length?n(e):r=!1)}var t,n=H.getPrefixed(window,"requestAnimationFrame"),r=!1,i=[],a=!0;return X.add(window,{focus:function(){a=!0},blur:function(){a=!1}}),function(a,o){i.push([a,o]),n?r||(n(e),r=!0):t||(t=setInterval(e,1e3/60))}};var K=s.extend(l,{_class:"View",initialize:function Se(e,t){function n(e){return t[e]||parseInt(t.getAttribute(e),10)}function r(){var e=H.getSize(t);return e.isNaN()||e.isZero()?new g(n("width"),n("height")):e}this._project=e,this._scope=e._scope,this._element=t;var i;this._pixelRatio||(this._pixelRatio=window.devicePixelRatio||1),this._id=t.getAttribute("id"),null==this._id&&t.setAttribute("id",this._id="view-"+Se._id++),X.add(t,this._viewEvents);var a="none";if(H.setPrefixed(t.style,{userSelect:a,touchAction:a,touchCallout:a,contentZooming:a,userDrag:a,tapHighlightColor:"rgba(0,0,0,0)"}),u.hasAttribute(t,"resize")){var o=this;X.add(window,this._windowEvents={resize:function(){o.setViewSize(r())}})}if(this._setViewSize(i=r()),u.hasAttribute(t,"stats")&&"undefined"!=typeof Stats){this._stats=new Stats;var s=this._stats.domElement,l=s.style,c=H.getOffset(t);l.position="absolute",l.left=c.x+"px",l.top=c.y+"px",document.body.appendChild(s)}Se._views.push(this),Se._viewsById[this._id]=this,this._viewSize=i,(this._matrix=new b)._owner=this,this._zoom=1,Se._focused||(Se._focused=this),this._frameItems={},this._frameItemCount=0},remove:function(){return!!this._project&&(K._focused===this&&(K._focused=null),K._views.splice(K._views.indexOf(this),1),delete K._viewsById[this._id],this._project._view===this&&(this._project._view=null),X.remove(this._element,this._viewEvents),X.remove(window,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0)},_events:s.each(["onResize","onMouseDown","onMouseUp","onMouseMove"],function(e){this[e]={install:function(e){this._installEvent(e)},uninstall:function(e){this._uninstallEvent(e)}}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,_requestFrame:function(){var e=this;X.requestAnimationFrame(function(){e._requested=!1,e._animate&&(e._requestFrame(),e._handleFrame())},this._element),this._requested=!0},_handleFrame:function(){a=this._scope;var e=Date.now()/1e3,t=this._before?e-this._before:0;this._before=e,this._handlingFrame=!0,this.emit("frame",new s({delta:t,time:this._time+=t,count:this._count++})),this._stats&&this._stats.update(),this._handlingFrame=!1,this.update()},_animateItem:function(e,t){var n=this._frameItems;t?(n[e._id]={item:e,time:0,count:0},1===++this._frameItemCount&&this.on("frame",this._handleFrameItems)):(delete n[e._id],0===--this._frameItemCount&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(e){for(var t in this._frameItems){var n=this._frameItems[t];n.item.emit("frame",new s(e,{time:n.time+=e.delta,count:n.count++}))}},_update:function(){this._project._needsUpdate=!0,this._handlingFrame||(this._animate?this._handleFrame():this.update())},_changed:function(e){1&e&&(this._project._needsUpdate=!0)},_transform:function(e){this._matrix.concatenate(e),this._bounds=null,this._update()},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var e=this._viewSize;return new v(e.width,e.height,this,"setViewSize")},setViewSize:function(){var e=g.read(arguments),t=e.subtract(this._viewSize);t.isZero()||(this._viewSize.set(e.width,e.height),this._setViewSize(e),this._bounds=null,this.emit("resize",{size:e,delta:t}),this._update())},_setViewSize:function(e){var t=this._element;t.width=e.width,t.height=e.height},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new y(new f,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var e=f.read(arguments);this.scrollBy(e.subtract(this.getCenter()))},getZoom:function(){return this._zoom},setZoom:function(e){this._transform((new b).scale(e/this._zoom,this.getCenter())),this._zoom=e},isVisible:function(){return H.isInView(this._element)},scrollBy:function(){this._transform((new b).translate(f.read(arguments).negate()))},play:function(){this._animate=!0,this._requested||this._requestFrame()},pause:function(){this._animate=!1},draw:function(){this.update()},projectToView:function(){return this._matrix._transformPoint(f.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(f.read(arguments))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(e,t){return"string"==typeof t&&(t=document.getElementById(t)),new Y(e,t)}}},new function(){function e(e){var t=X.getTarget(e);return t.getAttribute&&K._viewsById[t.getAttribute("id")]}function t(e,t){return e.viewToProject(X.getOffset(t,e._element))}function n(){if(!K._focused||!K._focused.isVisible())for(var e=0,t=K._views.length;ethis._maxDistance&&(this._maxDistance=e)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(e){this._maxDistance=e,null!=this._minDistance&&null!=e&&er)t=this._point.add(l.normalize(r));else if(o)return!1}if(a&&t.equals(this._point))return!1}switch(this._lastPoint=i&&"mousemove"==e?t:this._point,this._point=t,e){case"mousedown":this._lastPoint=this._downPoint,this._downPoint=this._point,this._downCount++;break;case"mouseup":this._lastPoint=this._downPoint}return this._count=i?0:this._count+1,!0},_fireEvent:function(e,t){var n=a.project._removeSets;if(n){"mouseup"===e&&(n.mousedrag=null);var r=n[e];if(r){for(var i in r){var o=r[i];for(var s in n){var l=n[s];l&&l!=r&&delete l[o._id]}o.remove()}n[e]=null}}return this.responds(e)&&this.emit(e,new ee(this,e,t))},_handleEvent:function(e,t,n){a=this._scope;var r=!1;switch(e){case"mousedown":this._updateEvent(e,t,null,null,!0,!1,!1),r=this._fireEvent(e,n);break;case"mousedrag":for(var i=!1,o=!1;this._updateEvent(e,t,this.minDistance,this.maxDistance,!1,i,o);)r=this._fireEvent(e,n)||r,i=!0,o=!0;break;case"mouseup":!t.equals(this._point)&&this._updateEvent("mousedrag",t,this.minDistance,this.maxDistance,!1,!1,!1)&&(r=this._fireEvent("mousedrag",n)),this._updateEvent(e,t,null,this.maxDistance,!1,!1,!1),r=this._fireEvent(e,n)||r,this._updateEvent(e,t,null,null,!0,!1,!1),this._firstMove=!0;break;case"mousemove":for(;this._updateEvent(e,t,this.minDistance,this.maxDistance,this._firstMove,!0,!1);)r=this._fireEvent(e,n)||r,this._firstMove=!1}return r&&n.preventDefault(),r}}),{request:function(e,t,n,r){r=r===o||r;var i=new(window.ActiveXObject||XMLHttpRequest)("Microsoft.XMLHTTP");return i.open(e.toUpperCase(),t,r),"overrideMimeType"in i&&i.overrideMimeType("text/plain"),i.onreadystatechange=function(){if(4===i.readyState){var e=i.status;if(0!==e&&200!==e)throw new Error("Could not load "+t+" (Error "+e+")");n.call(i,i.responseText)}},i.send(null)}}),ne={canvases:[],getCanvas:function(e,t){var n,r=!0;"object"==typeof e&&(t=e.height,e=e.width),n=this.canvases.length?this.canvases.pop():document.createElement("canvas");var i=n.getContext("2d");return n.width===e&&n.height===t?r&&i.clearRect(0,0,e+1,t+1):(n.width=e,n.height=t),i.save(),n},getContext:function(e,t){return this.getCanvas(e,t).getContext("2d")},release:function(e){var t=e.canvas?e.canvas:e;t.getContext("2d").restore(),this.canvases.push(t)}},re=new function(){function e(e,t,n){return.2989*e+.587*t+.114*n}function t(t,n,r,i){var a=i-e(t,n,r);p=t+a,f=n+a,m=r+a;var i=e(p,f,m),o=g(p,f,m),s=v(p,f,m);if(o<0){var l=i-o;p=i+(p-i)*i/l,f=i+(f-i)*i/l,m=i+(m-i)*i/l}if(s>255){var u=255-i,c=s-i;p=i+(p-i)*u/c,f=i+(f-i)*u/c,m=i+(m-i)*u/c}}function n(e,t,n){return v(e,t,n)-g(e,t,n)}function r(e,t,n,r){var i,a=[e,t,n],o=v(e,t,n),s=g(e,t,n);s=s===e?0:s===t?1:2,o=o===e?0:o===t?1:2,i=0===g(s,o)?1===v(s,o)?2:1:0,a[o]>a[s]?(a[i]=(a[i]-a[s])*r/(a[o]-a[s]),a[o]=r):a[i]=a[o]=0,a[s]=0,p=a[0],f=a[1],m=a[2]}var i,a,o,l,u,c,h,d,p,f,m,g=Math.min,v=Math.max,y=Math.abs,w={multiply:function(){p=u*i/255,f=c*a/255,m=h*o/255},screen:function(){p=u+i-u*i/255,f=c+a-c*a/255,m=h+o-h*o/255},overlay:function(){p=u<128?2*u*i/255:255-2*(255-u)*(255-i)/255,f=c<128?2*c*a/255:255-2*(255-c)*(255-a)/255,m=h<128?2*h*o/255:255-2*(255-h)*(255-o)/255},"soft-light":function(){var e=i*u/255;p=e+u*(255-(255-u)*(255-i)/255-e)/255,e=a*c/255,f=e+c*(255-(255-c)*(255-a)/255-e)/255,e=o*h/255,m=e+h*(255-(255-h)*(255-o)/255-e)/255},"hard-light":function(){p=i<128?2*i*u/255:255-2*(255-i)*(255-u)/255,f=a<128?2*a*c/255:255-2*(255-a)*(255-c)/255,m=o<128?2*o*h/255:255-2*(255-o)*(255-h)/255},"color-dodge":function(){p=0===u?0:255===i?255:g(255,255*u/(255-i)),f=0===c?0:255===a?255:g(255,255*c/(255-a)),m=0===h?0:255===o?255:g(255,255*h/(255-o))},"color-burn":function(){p=255===u?255:0===i?0:v(0,255-255*(255-u)/i),f=255===c?255:0===a?0:v(0,255-255*(255-c)/a),m=255===h?255:0===o?0:v(0,255-255*(255-h)/o)},darken:function(){p=ui?u:i,f=c>a?c:a,m=h>o?h:o},difference:function(){p=u-i,p<0&&(p=-p),f=c-a,f<0&&(f=-f),m=h-o,m<0&&(m=-m)},exclusion:function(){p=u+i*(255-u-u)/255,f=c+a*(255-c-c)/255,m=h+o*(255-h-h)/255},hue:function(){r(i,a,o,n(u,c,h)),t(p,f,m,e(u,c,h))},saturation:function(){r(u,c,h,n(i,a,o)),t(p,f,m,e(u,c,h))},luminosity:function(){t(u,c,h,e(i,a,o))},color:function(){t(i,a,o,e(u,c,h))},add:function(){p=g(u+i,255),f=g(c+a,255),m=g(h+o,255)},subtract:function(){p=v(u-i,0),f=v(c-a,0),m=v(h-o,0)},average:function(){p=(u+i)/2,f=(c+a)/2,m=(h+o)/2},negation:function(){p=255-y(255-i-u),f=255-y(255-a-c),m=255-y(255-o-h)}},b=this.nativeModes=s.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(e){this[e]=!0},{}),_=ne.getContext(1,1);s.each(w,function(e,t){var n="darken"===t,r=!1;_.save();try{_.fillStyle=n?"#300":"#a00",_.fillRect(0,0,1,1),_.globalCompositeOperation=t,_.globalCompositeOperation===t&&(_.fillStyle=n?"#a00":"#300",_.fillRect(0,0,1,1),r=_.getImageData(0,0,1,1).data[0]!==n?170:51)}catch(i){}_.restore(),b[t]=r}),ne.release(_),this.process=function(e,t,n,r,s){var g=t.canvas,v="normal"===e;if(v||b[e])n.save(),n.setTransform(1,0,0,1,0,0),n.globalAlpha=r,v||(n.globalCompositeOperation=e),n.drawImage(g,s.x,s.y),n.restore();else{var y=w[e];if(!y)return;for(var _=n.getImageData(s.x,s.y,g.width,g.height),x=_.data,E=t.getImageData(0,0,g.width,g.height).data,C=0,k=x.length;C=3){s=e._closed?"polygon":"polyline";for(var c=[],h=0,d=l.length;h1||/z\S+/i.test(t)?new B(n):new A(n)}function c(n,r){var i,a=(e(n,"href",!0)||"").substring(1),o="radialgradient"===r;if(a)i=D[a].getGradient();else{for(var s=n.childNodes,l=[],u=0,c=s.length;u0;o-=e.step)a=o/100,a>1||(e.setRandomColor(),n={x:d.x+a*(p.x-d.x),y:d.y+a*(p.y-d.y)},r={x:p.x+a*(f.x-p.x),y:p.y+a*(f.y-p.y)},i={x:n.x+a*(r.x-n.x),y:n.y+a*(r.y-n.y)},m={x:0,y:0},e.drawCircle(n,3,m),e.drawCircle(r,3,m),e.setWeight(.5),e.drawLine(n,r,m),e.setWeight(1.5),e.drawLine(d,n,m),e.drawLine(p,r,m),e.setWeight(1),m.x+=c,e.drawCircle(n,3,m),e.drawCircle(r,3,m),e.setWeight(.5),e.drawLine(n,r,m),e.setWeight(1.5),e.drawLine(n,i,m),e.setWeight(1),e.drawCircle(i,3,m),m.x+=c,e.drawCircle(i,3,m),e.text(o+"%, or t = "+e.utils.round(a,2),{x:i.x+10+m.x,y:i.y+10+m.y}))},values:{38:1,40:-1},onKeyDown:function(e,t){var n=this.values[e.keyCode];n&&(e.preventDefault(),t.step+=n,t.step<1&&(t.step=1))},render:function(){return r.createElement("section",null,r.createElement(a,this.props),r.createElement("p",null,"Playing with the points for curves may have given you a feel for how Bézier curves behaves, but what ",r.createElement("em",null,"are")," Bézier curves, really? There are two ways to explain what a Bézier curve is, and they turn out to be the entirely equivalent, but one of them uses complicated maths, and the other uses really simple maths. So... let's start with the simple explanation:"),r.createElement("p",null,"Bezier curves are the result of ",r.createElement("a",{href:"https://en.wikipedia.org/wiki/Linear_interpolation"},"linear interpolations"),". That sounds complicated but you've been doing linear interpolation since you were very young: any time you had to point at something between two other things, you've been applying linear interpolation. It's simply \"picking a point between two, points\"."),r.createElement("p",null,"If we know the distance between those two points, and we want a new point that is, say, 20% the distance away from the first point (and thus 80% the distance away from the second point) then we can compute that really easily:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/75bb049d813d8ee084b076531823f2109cc1660f.svg",style:{width:"36.750150000000005rem",height:"6.37515rem"}})),r.createElement("p",null,"So let's look at that in action: the following graphic is interactive in that you can use your up and down arrow keys to increase or decrease the interpolation distance, to see what happens. We start with three points, which gives us two lines. Linear interpolation over those lines gives use two points, between which we can again perform linear interpolation, yielding a single point. And that point —and all points we can form in this way for all distances taken together— form our Bézier curve:"),r.createElement(i,{title:"Linear Interpolation leading to Bézier curves",setup:this.setup,draw:this.draw,onKeyDown:this.onKeyDown}),r.createElement("p",null,"And that brings us to the complicated maths: calculus."),r.createElement("p",null,'While it doesn\'t look like that\'s what we\'ve just done, we actually just drew a quadratic curve, in steps, rather than in a single go. One of the fascinating parts about Bézier curves is that they can both be described in terms of polynomial functions, as well as in terms of very simple interpolations of interpolations of [...]. That, in turn, means we can look at what these curves can do based on both "real maths" (by examining the functions, their derivatives, and all that stuff), as well as by looking at the "mechanical" composition (which tells us that a curve will never extend beyond the points we used to construct it, for instance)'),r.createElement("p",null,"So let's start looking at Bézier curves a bit more in depth. Their mathematical expressions, the properties we can derive from those, and the various things we can do to, and with, Bézier curves."))}});e.exports=o},function(e,t,n){"use strict";var r=n(2),i=n(215),a=n(223),o=n(226),s=r.createClass({displayName:"Explanation",statics:{keyHandlingOptions:{propName:"step",values:{38:.1,40:-.1},controller:function(e){e.step<.1&&(e.step=.1)}}},getDefaultProps:function(){return{title:"The mathematics of Bézier curves"}},setup:function(e){e.step=5},draw:function(e,t){var n=e.getPanelWidth(),r=n,i=n,a=r/2,o=i/2,s=a/2,l=o/2;e.reset(),e.setColor("black"),e.drawLine({x:0,y:o},{x:r,y:o}),e.drawLine({x:a,y:0},{x:a,y:i});for(var u,c={x:a,y:o},h=0;h<=e.step;h+=.1){u={x:s*Math.cos(h),y:l*Math.sin(h)},e.drawPoint(u,c);var d=h%1;(d<.05||d>.95)&&(e.text("t = "+Math.round(h),{x:c.x+1.25*s*Math.cos(h)-10,y:c.y+1.25*l*Math.sin(h)+5}),e.drawCircle(u,2,c))}},render:function(){return r.createElement("section",null,r.createElement(a,this.props),r.createElement("p",null,'Bézier curves are a form of "parametric" function. Mathematically speaking, parametric functions are cheats: a "function" is actually a well defined term representing a mapping from any number of inputs to a ',r.createElement("strong",null,"single")," output. Numbers go in, a single number comes out. Change the numbers that go in, and the number that comes out is still a single number. Parametric functions cheat. They basically say \"alright, well, we want multiple values coming out, so we'll just use more than one function\". An illustration: Let's say we have a function that maps some value, let's call it ",r.createElement("i",null,"x"),", to some other value, using some kind of number manipulation:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/785e792c343b71d4e674ac94d8800940b30917ac.svg",style:{width:"6.22485rem",height:"1.125rem"}})),r.createElement("p",null,"The notation ",r.createElement("i",null,"f(x)")," is the standard way to show that it's a function (by convention called ",r.createElement("i",null,"f")," if we're only listing one) and its output changes based on one variable (in this case, ",r.createElement("i",null,"x"),"). Change ",r.createElement("i",null,"x"),", and the output for ",r.createElement("i",null,"f(x)")," changes."),r.createElement("p",null,"So far so good. Now, let's look at parametric functions, and how they cheat. Let's take the following two functions:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/0dfe7562b43441e72201ff4cdd2e8b6e2e3ecb2d.svg",style:{width:"6.525rem",height:"2.6248500000000003rem"}})),r.createElement("p",null,"There's nothing really remarkable about them, they're just a sine and cosine function, but you'll notice the inputs have different names. If we change the value for ",r.createElement("i",null,"a"),", we're not going to change the output value for ",r.createElement("i",null,"f(b)"),", since ",r.createElement("i",null,"a")," isn't used in that function. Parametric functions cheat by changing that. In a parametric function all the different functions share a variable, like this:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/ed6f533530199d1e99b3319ba137c1327b0459c0.svg",style:{width:"7.349849999999999rem",height:"2.6248500000000003rem"}})),r.createElement("p",null,"Multiple functions, but only one variable. If we change the value for ",r.createElement("i",null,"t"),", we change the outcome of both ",r.createElement("i",null,"f",r.createElement("sub",null,"a"),"(t)")," and ",r.createElement("i",null,"f",r.createElement("sub",null,"b"),"(t)"),". You might wonder how that's useful, and the answer is actually pretty simple: if we change the labels ",r.createElement("i",null,"f",r.createElement("sub",null,"a"),"(t)")," and ",r.createElement("i",null,"f",r.createElement("sub",null,"b"),"(t)")," with what we usually mean with them for parametric curves, things might be a lot more obvious:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/ea632ea75d6a2aeb6fe69c07feb6e76f81884746.svg",style:{width:"5.77485rem",height:"2.6248500000000003rem"}})),r.createElement("p",null,"There we go. ",r.createElement("i",null,"x"),"/",r.createElement("i",null,"y")," coordinates, linked through some mystery value ",r.createElement("i",null,"t"),"."),r.createElement("p",null,"So, parametric curves don't define a ",r.createElement("i",null,"y")," coordinate in terms of an ",r.createElement("i",null,"x"),' coordinate, like normal functions do, but they instead link the values to a "control" variable. If we vary the value of ',r.createElement("i",null,"t"),", then with every change we get ",r.createElement("strong",null,"two")," values, which we can use as (",r.createElement("i",null,"x"),",",r.createElement("i",null,"y"),") coordinates in a graph. The above set of functions, for instance, generates points on a circle: We can range ",r.createElement("i",null,"t")," from negative to positive infinity, and the resulting (",r.createElement("i",null,"x"),",",r.createElement("i",null,"y"),") coordinates will always lie on a circle with radius 1 around the origin (0,0). If we plot it for ",r.createElement("i",null,"t")," from 0 to 5, we get this (use your up and down arrow keys to change the plot end value):"),r.createElement(i,{preset:"empty",title:"A (partial) circle: x=sin(t), y=cos(t)","static":!0,setup:this.setup,draw:this.draw,onKeyDown:this.props.onKeyDown}),r.createElement("p",null,"Bézier curves are (one in many classes of) parametric functions, and are characterised by using the same base function for all its dimensions. Unlike the above example, where the ",r.createElement("i",null,"x")," and ",r.createElement("i",null,"y"),' values use different functions (one uses a sine, the other a cosine), Bézier curves use the "binomial polynomial" for both ',r.createElement("i",null,"x")," and ",r.createElement("i",null,"y"),". So what are binomial polynomials?"),r.createElement("p",null,"You may remember polynomials from high school, where they're those sums that look like:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/3e8b26cf8833db7089d65e9c6b3953a3140bb19f.svg",style:{width:"14.32485rem",height:"1.20015rem"}})),r.createElement("p",null,"If they have a highest order term ",r.createElement("i",null,"x³")," they're called \"cubic\" polynomials, if it's",r.createElement("i",null,"x²")," it's a \"square\" polynomial, if it's just ",r.createElement("i",null,"x")," it's a line (and if there aren't even any terms with ",r.createElement("i",null,"x")," it's not a polynomial!)"),r.createElement("p",null,"Bézier curves are polynomials of ",r.createElement("i",null,"t"),", rather than ",r.createElement("i",null,"x"),", with the value for ",r.createElement("i",null,"t"),"fixed being between 0 and 1, with coefficients ",r.createElement("i",null,"a"),", ",r.createElement("i",null,"b"),' etc. taking the "binomial" form, which sounds fancy but is actually a pretty simple description for mixing values:'),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/24e915ab4c69b85951f1ea9018b0ece9e52a10dd.svg",style:{width:"24.89985rem",height:"4.1998500000000005rem"}})),r.createElement("p",null,"I know what you're thinking: that doesn't look too simple, but if we remove ",r.createElement("i",null,"t"),' and add in "times one", things suddenly look pretty easy. Check out these binomial terms:'),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/448d10d21afd49135055cf685fedf6c494984b53.svg",style:{width:"14.475150000000001rem",height:"5.175rem"}})),r.createElement("p",null,'Notice that 2 is the same as 1+1, and 3 is 2+1 and 1+2, and 6 is 3+3... As you can see, each time we go up a dimension, we simply start and end with 1, and everything in between is just "the two numbers above it, added together". Now ',r.createElement("i",null,"that's")," easy to remember."),r.createElement("p",null,"There's an equally simple way to figure out how the polynomial terms work: if we rename ",r.createElement("i",null,"(1-t)")," to ",r.createElement("i",null,"a")," and ",r.createElement("i",null,"t")," to ",r.createElement("i",null,"b"),", and remove the weights for a moment, we get this:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/87c7f5294b902def4ea56e8f6cf24265a37143b6.svg",style:{width:"20.84985rem",height:"3.825rem"}})),r.createElement("p",null,"It's basically just a sum of \"every combination of ",r.createElement("i",null,"a")," and ",r.createElement("i",null,"b"),'", progressively replacing ',r.createElement("i",null,"a"),"'s with ",r.createElement("i",null,"b"),"'s after every + sign. So that's actually pretty simple too. So now you know binomial polynomials, and just for completeness I'm going to show you the generic function for this:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/d79bf595a0911c17e2ac86d8806a0a8ab6ba7dfe.svg",style:{width:"20.39985rem",height:"3.90015rem"}})),r.createElement("p",null,"And that's the full description for Bézier curves. Σ in this function indicates that this is a series of additions (using the variable listed below the Σ, starting at ...= and ending at the value listed on top of the Σ)."),r.createElement("div",{className:"howtocode"},r.createElement("h3",null,"How to implement the basis function"),r.createElement("p",null,"We could naively implement the basis function as a mathematical construct, using the function as our guide, like this:"),r.createElement("pre",null,"function Bezier(n,t):","\n"," sum = 0","\n"," for(k=0; k= lut.length):","\n"," s = lut.length","\n"," nextRow = new array(size=s+1)","\n"," nextRow[0] = 1","\n"," for(i=1, prev=s-1; i<prev; i++):","\n"," nextRow[i] = lut[prev][i-1] + lut[prev][i]","\n"," nextRow[s] = 1","\n"," lut.add(nextRow)","\n"," return lut[n][k]"),r.createElement("p",null,"So what's going on here? First, we declare a lookup table with a size that's reasonably large enough to accommodate most lookups. Then, we declare a function to get us the values we need, and we make sure that if an n/k pair is requested that isn't in the LUT yet, we expand it first. Our basis function now looks like this:"),r.createElement("pre",null,"function Bezier(n,t):","\n"," sum = 0","\n"," for(k=0; k=n&&i.x<=t-n){this.drawLerpBox(e,t,n,i);var a=(i.x-n)/r;this.drawLerpPoint(e,(1-a)*(1-a),n,r,i),this.drawLerpPoint(e,2*(1-a)*a,n,r,i),this.drawLerpPoint(e,a*a,n,r,i)}this.drawFunction(e,"first term",{x:2*n,y:r},function(e){return{x:n+e*r,y:n+r*(1-e)*(1-e)}}),this.drawFunction(e,"second term",{x:t/2-1.5*n,y:t/2+n},function(e){return{x:n+e*r,y:n+2*r*(1-e)*e}}),this.drawFunction(e,"third term",{x:r-2.5*n,y:r},function(e){return{x:n+e*r,y:n+r*e*e}})},drawCubicLerp:function(e){e.reset();var t=e.getPanelWidth(),n=20,r=t-2*n;e.drawAxes(n,"t",0,1,"S","0%","100%");var i=e.hover;if(i&&i.x>=n&&i.x<=t-n){this.drawLerpBox(e,t,n,i);var a=(i.x-n)/r;this.drawLerpPoint(e,(1-a)*(1-a)*(1-a),n,r,i),this.drawLerpPoint(e,3*(1-a)*(1-a)*a,n,r,i), -this.drawLerpPoint(e,3*(1-a)*a*a,n,r,i),this.drawLerpPoint(e,a*a*a,n,r,i)}this.drawFunction(e,"first term",{x:2*n,y:r},function(e){return{x:n+e*r,y:n+r*(1-e)*(1-e)*(1-e)}}),this.drawFunction(e,"second term",{x:t/2-4*n,y:t/2},function(e){return{x:n+e*r,y:n+3*r*(1-e)*(1-e)*e}}),this.drawFunction(e,"third term",{x:t/2+2*n,y:t/2},function(e){return{x:n+e*r,y:n+3*r*(1-e)*e*e}}),this.drawFunction(e,"fourth term",{x:r-2.5*n,y:r},function(e){return{x:n+e*r,y:n+r*e*e*e}})},draw15thLerp:function(e){e.reset();var t=e.getPanelWidth(),n=20,r=t-2*n;e.drawAxes(n,"t",0,1,"S","0%","100%");var i,a=[1,15,105,455,1365,3003,5005,6435,6435,5005,3003,1365,455,105,15,1],o=e.hover;if(o&&o.x>=n&&o.x<=t-n)for(this.drawLerpBox(e,t,n,o),i=0;i<=15;i++){var s=(o.x-n)/r,l=a[i]*Math.pow(1-s,15-i)*Math.pow(s,i);this.drawLerpPoint(e,l,n,r,o)}for(i=0;i<=15;i++){var u=!1,c=!1;0===i&&(u="first term",c={x:n+5,y:r}),15===i&&(u="last term",c={x:t-3.5*n,y:r}),this.drawFunction(e,u,c,function(e){return{x:n+e*r,y:n+r*a[i]*Math.pow(1-e,15-i)*Math.pow(e,i)}})}},render:function(){return r.createElement("section",null,r.createElement(a,this.props),r.createElement("p",null,'Bézier curves are (like all "splines") interpolation functions, meaning they take a set of points, and generate values somewhere "between" those points. (One of the consequences of this is that you\'ll never be able to generate a point that lies outside the outline for the control points, commonly called the "hull" for the curve. Useful information!). In fact, we can visualize how each point contributes to the value generated by the function, so we can see which points are important, where, in the curve.'),r.createElement("p",null,'The following graphs show the interpolation functions for quadratic and cubic curves, with "S" being the strength of a point\'s contribution to the total sum of the Bézier function. Click or click-drag to see the interpolation percentages for each curve-defining point at a specific ',r.createElement("i",null,"t")," value."),r.createElement("div",{className:"figure"},r.createElement(i,{inline:!0,preset:"simple",title:"Quadratic interpolations",draw:this.drawQuadraticLerp}),r.createElement(i,{inline:!0,preset:"simple",title:"Cubic interpolations",draw:this.drawCubicLerp}),r.createElement(i,{inline:!0,preset:"simple",title:"15th order interpolations",draw:this.draw15thLerp})),r.createElement("p",null,"Also shown is the interpolation function for a 15",r.createElement("sup",null,"th")," order Bézier function. As you can see, the start and end point contribute considerably more to the curve's shape than any other point in the control point set."),r.createElement("p",null,'If we want to change the curve, we need to change the weights of each point, effectively changing the interpolations. The way to do this is about as straight forward as possible: just multiply each point with a value that changes its strength. These values are conventionally called "Weights", and we can add them to our original Bézier function:'),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/b98618f8061e9e58289abccc06a624a14561d40f.svg",style:{width:"23.70015rem",height:"3.90015rem"}})),r.createElement("p",null,'That looks complicated, but as it so happens, the "weights" are actually just the coordinate values we want our curve to have: for an ',r.createElement("i",null,"n",r.createElement("sup",null,"th"))," order curve, w",r.createElement("sub",null,"0")," is our start coordinate, w",r.createElement("sub",null,"n")," is our last coordinate, and everything in between is a controlling coordinate. Say we want a cubic curve that starts at (120,160), is controlled by (35,200) and (220,260) and ends at (220,40), we use this Bézier curve:"),r.createElement("p",null,r.createElement("img",{className:"LaTeX SVG",src:"images/latex/853858526831a7ef3eb170efe49de397bb4913a1.svg",style:{width:"32.025150000000004rem",height:"2.77515rem"}})),r.createElement("p",null,"Which gives us the curve we saw at the top of the article:"),r.createElement(i,{preset:"simple",title:"Our cubic Bézier curve",setup:this.drawCubic,draw:this.drawCurve}),r.createElement("p",null,"What else can we do with Bézier curves? Quite a lot, actually. The rest of this article covers a multitude of possible operations and algorithms that we can apply, and the tasks they achieve."),r.createElement("div",{className:"howtocode"},r.createElement("h3",null,"How to implement the weighted basis function"),r.createElement("p",null,"Given that we already know how to implement basis function, adding in the control points is remarkably easy:"),r.createElement("pre",null,"function Bezier(n,t,w[]):","\n"," sum = 0","\n"," for(k=0; k

- -