Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colonel-kurtz

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colonel-kurtz - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

addons/common/frame.jsx

19

addons/image/index.jsx

@@ -8,14 +8,8 @@ /**

import Field from '../common/field'
import Graphic from './graphic'
import Graphic from '../common/graphic'
import Frame from '../common/frame'
import React from 'react'
require('./style')
var Image = React.createClass({
propTypes: {
content : React.PropTypes.object.isRequired,
onChange : React.PropTypes.func.isRequired
},
getDefaultProps() {

@@ -32,7 +26,6 @@ return {

<div className="col-img">
<Graphic { ...this.props.content } />
<fieldset className="col-img-fieldset">
<Field label="Image Source" type="url" value={ src } name="image_src" onChange={ this._onSrcChange }/>
</fieldset>
<Field label="Image Source" type="url" value={ src } name="image_src" onChange={ this._onSrcChange }/>
<Frame open={ src }>
<Graphic src={ src } alt="" />
</Frame>
</div>

@@ -39,0 +32,0 @@ )

@@ -8,17 +8,11 @@ /**

import Field from '../common/field'
import Player from './player'
import Frame from '../common/frame'
import Graphic from '../common/graphic'
import React from 'react'
require('./style')
let YouTube = React.createClass({
propTypes: {
content : React.PropTypes.object.isRequired,
onChange : React.PropTypes.func.isRequired,
src : React.PropTypes.string
},
getDefaultProps() {
return {
baseUrl: "https://www.youtube.com/embed/",
content: {

@@ -30,2 +24,7 @@ video_id: ''

getSrc(id) {
var { baseUrl } = this.props
return id ? baseUrl + id : null
},
render() {

@@ -36,6 +35,6 @@ var { video_id } = this.props.content

<div className="col-youtube">
<fieldset className="col-youtube-fieldset">
<Field label="YouTube Video ID" value={ video_id } name="youtube_video_id" onChange={ this._onChange } autofocus/>
</fieldset>
<Player video_id={ video_id } />
<Field label="YouTube Video ID" value={ video_id } name="youtube_video_id" onChange={ this._onChange } autofocus/>
<Frame open={ video_id }>
<Graphic element="iframe" src={ this.getSrc(video_id) } />
</Frame>
</div>

@@ -42,0 +41,0 @@ )

@@ -1,2 +0,2 @@

module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(4),a=r(o),u=n(13),i=r(u),s=n(1),l=r(s);n(37);var c=l["default"].createClass({displayName:"Image",propTypes:{content:l["default"].PropTypes.object.isRequired,onChange:l["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{content:{src:""}}},render:function(){var t=this.props.content.src;return l["default"].createElement("div",{className:"col-img"},l["default"].createElement(i["default"],this.props.content),l["default"].createElement("fieldset",{className:"col-img-fieldset"},l["default"].createElement(a["default"],{label:"Image Source",type:"url",value:t,name:"image_src",onChange:this._onSrcChange})))},_onSrcChange:function(t){this.props.onChange({src:t.currentTarget.value})}});e["default"]=c,t.exports=e["default"]},1:function(t,e,n){t.exports=require("react")},4:function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u);n(6),e["default"]=i["default"].createClass({displayName:"field",getDefaultProps:function(){return{type:"text"}},render:function(){var t=this.props,e=t.label,n=t.name,r=t.type,u=o(t,["label","name","type"]);return i["default"].createElement("div",{className:"col-field"},i["default"].createElement("label",{className:"col-field-label",htmlFor:n||this.props.id},e),i["default"].createElement("input",a({className:"col-field-input",type:r},u,{name:n||this.props.id})))}}),t.exports=e["default"]},6:function(t,e,n){},13:function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(1),a=r(o),u=a["default"].createClass({displayName:"Graphic",render:function(){var t=this.props.src;return t?a["default"].createElement("figure",{className:"col-img-figure"},a["default"].createElement("img",{className:"col-img-graphic",src:t,alt:""})):null}});e["default"]=u,t.exports=e["default"]},37:function(t,e,n){}});
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}};t.__esModule=!0;var a=n(4),o=r(a),u=n(6),i=r(u),s=n(5),l=r(s),c=n(1),f=r(c),d=f["default"].createClass({displayName:"Image",getDefaultProps:function(){return{content:{src:""}}},render:function(){var e=this.props.content.src;return f["default"].createElement("div",{className:"col-img"},f["default"].createElement(o["default"],{label:"Image Source",type:"url",value:e,name:"image_src",onChange:this._onSrcChange}),f["default"].createElement(l["default"],{open:e},f["default"].createElement(i["default"],{src:e,alt:""})))},_onSrcChange:function(e){this.props.onChange({src:e.currentTarget.value})}});t["default"]=d,e.exports=t["default"]},function(e,t,n){e.exports=require("react")},function(e,t,n){e.exports=require("classnames")},,function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(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},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.__esModule=!0;var u=n(1),i=r(u);n(8),t["default"]=i["default"].createClass({displayName:"field",getDefaultProps:function(){return{type:"text"}},render:function(){var e=this.props,t=e.label,n=e.name,r=e.type,u=a(e,["label","name","type"]);return i["default"].createElement("div",{className:"col-field"},i["default"].createElement("label",{className:"col-field-label",htmlFor:n||this.props.id},t),i["default"].createElement("input",o({className:"col-field-input",type:r},u,{name:n||this.props.id})))}}),e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(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},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.__esModule=!0;var u=n(1),i=r(u),s=n(2),l=r(s),c=i["default"].createClass({displayName:"Frame",getDefaultProps:function(){return{element:"figure"}},render:function(){var e=this.props,t=e.element,n=e.children,r=e.open,u=a(e,["element","children","open"]),s=l["default"]("col-frame",{"col-frame-open":r});return i["default"].createElement(t,o({className:s},u),n)}});t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},a=function(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};t.__esModule=!0;var o=n(1),u=r(o),i=n(2),s=(r(i),u["default"].createClass({displayName:"Graphic",getDefaultProps:function(){return{className:"col-graphic",element:"img",src:null}},render:function(){var e=this.props,t=e.element,n=a(e,["element"]);return u["default"].createElement(t,n)}}));t["default"]=s,e.exports=t["default"]},,function(e,t,n){}]);
//# sourceMappingURL=image.js.map

@@ -1,4 +0,4 @@

module.exports=function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";var o=function(t){return t&&t.__esModule?t:{"default":t}},r=n(14),i=o(r),a=n(1),s=o(a);n(38);var u=s["default"].createClass({displayName:"Medium",propTypes:{content:s["default"].PropTypes.object.isRequired,onChange:s["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{content:{html:"",text:""},options:{buttons:["header1","header2","bold","italic","underline","anchor","quote","unorderedlist","orderedlist"],firstHeader:"h1",secondHeader:"h2",diffLeft:0,diffTop:-10,disableDoubleReturn:!0}}},shouldComponentUpdate:function(t,e){return!1},componentDidMount:function(){this.setState({editor:new i["default"](this.refs.editor.getDOMNode(),this.props.options)})},componentWillUnmount:function(){this.state.editor.deactivate()},render:function(){return s["default"].createElement("div",{className:"col-block-medium"},s["default"].createElement("div",{className:"col-medium",onBlur:this._onBlur,role:"textarea","aria-multiline":"true",ref:"editor",dangerouslySetInnerHTML:{__html:this.props.content.html}}),this.props.children)},_onBlur:function(){var t=this.refs.editor.getDOMNode();this.props.onChange({text:t.textContent,html:t.innerHTML})}});t.exports=u},1:function(t,e,n){t.exports=require("react")},14:function(t,e,n){"use strict";function o(t,e){return this.init(t,e)}t.exports=o,function(t,e){function n(t,e){var n;if(void 0===t)return e;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)===!1&&(t[n]=e[n]);return t}function r(t,e){for(var n=e.parentNode;null!==n;){if(n===t)return!0;n=n.parentNode}return!1}function i(){var t,e,n,o=this.options.contentWindow.getSelection();if(o.getRangeAt&&o.rangeCount){for(n=[],t=0,e=o.rangeCount;e>t;t+=1)n.push(o.getRangeAt(t));return n}return null}function a(t){var e,n,o=this.options.contentWindow.getSelection();if(t)for(o.removeAllRanges(),e=0,n=t.length;n>e;e+=1)o.addRange(t[e])}function s(){var t=this.options.ownerDocument.getSelection().anchorNode,e=t&&3===t.nodeType?t.parentNode:t;return e}function u(){var t,e,n,o,r="";if(void 0!==this.options.contentWindow.getSelection){if(e=this.options.contentWindow.getSelection(),e.rangeCount){for(o=this.options.ownerDocument.createElement("div"),t=0,n=e.rangeCount;n>t;t+=1)o.appendChild(e.getRangeAt(t).cloneContents());r=o.innerHTML}}else void 0!==this.options.ownerDocument.selection&&"Text"===this.options.ownerDocument.selection.type&&(r=this.options.ownerDocument.selection.createRange().htmlText);return r}function l(t){return!(!t||1!==t.nodeType)}o.prototype={defaults:{allowMultiParagraphSelection:!0,anchorInputPlaceholder:"Paste or type a link",anchorPreviewHideDelay:500,buttons:["bold","italic","underline","anchor","header1","header2","quote"],buttonLabels:!1,checkLinkFormat:!1,cleanPastedHTML:!1,delay:0,diffLeft:0,diffTop:-10,disableReturn:!1,disableDoubleReturn:!1,disableToolbar:!1,disableEditing:!1,elementsContainer:!1,contentWindow:t,ownerDocument:e,firstHeader:"h3",forcePlainText:!0,placeholder:"Type your text",secondHeader:"h4",targetBlank:!1,anchorTarget:!1,anchorButton:!1,anchorButtonClass:"btn",extensions:{},activeButtonClass:"medium-editor-button-active",firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last"},isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),init:function(t,o){return this.options=n(o,this.defaults),this.setElementSelection(t),0!==this.elements.length?(this.parentElements=["p","h1","h2","h3","h4","h5","h6","blockquote","pre"],this.options.elementsContainer||(this.options.elementsContainer=e.body),this.id=this.options.elementsContainer.querySelectorAll(".medium-editor-toolbar").length+1,this.setup()):void 0},setup:function(){this.events=[],this.isActive=!0,this.initElements().bindSelect().bindPaste().setPlaceholders().bindWindowActions().passInstance()},on:function(t,e,n,o){t.addEventListener(e,n,o),this.events.push([t,e,n,o])},off:function(t,e,n,o){var r,i=this.events.indexOf([t,e,n,o]);-1!==i&&(r=this.events.splice(i,1),r[0].removeEventListener(r[1],r[2],r[3]))},removeAllEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},initElements:function(){this.updateElementList();var t,e=!1;for(t=0;t<this.elements.length;t+=1)this.options.disableEditing||this.elements[t].getAttribute("data-disable-editing")||this.elements[t].setAttribute("contentEditable",!0),this.elements[t].getAttribute("data-placeholder")||this.elements[t].setAttribute("data-placeholder",this.options.placeholder),this.elements[t].setAttribute("data-medium-element",!0),this.bindParagraphCreation(t).bindReturn(t).bindTab(t),this.options.disableToolbar||this.elements[t].getAttribute("data-disable-toolbar")||(e=!0);return e&&this.initToolbar().bindButtons().bindAnchorForm().bindAnchorPreview(),this},setElementSelection:function(t){this.elementSelection=t,this.updateElementList()},updateElementList:function(){this.elements="string"==typeof this.elementSelection?this.options.ownerDocument.querySelectorAll(this.elementSelection):this.elementSelection,1===this.elements.nodeType&&(this.elements=[this.elements])},serialize:function(){var t,e,n={};for(t=0;t<this.elements.length;t+=1)e=""!==this.elements[t].id?this.elements[t].id:"element-"+t,n[e]={value:this.elements[t].innerHTML.trim()};return n},callExtensions:function(t){if(!(arguments.length<1)){var e,n,o=Array.prototype.slice.call(arguments,1);for(n in this.options.extensions)this.options.extensions.hasOwnProperty(n)&&(e=this.options.extensions[n],void 0!==e[t]&&e[t].apply(e,o))}},passInstance:function(){var t,e,n=this;for(e in n.options.extensions)n.options.extensions.hasOwnProperty(e)&&(t=n.options.extensions[e],t.parent&&(t.base=n));return n},bindParagraphCreation:function(t){var n=this;return this.on(this.elements[t],"keypress",function(t){var o,r=s.call(n);32===t.which&&(o=r.tagName.toLowerCase(),"a"===o&&e.execCommand("unlink",!1,null))}),this.on(this.elements[t],"keyup",function(t){var o,r,i=s.call(n);i&&i.getAttribute("data-medium-element")&&0===i.children.length&&!n.options.disableReturn&&!i.getAttribute("data-disable-return")&&e.execCommand("formatBlock",!1,"p"),13===t.which&&(i=s.call(n),o=i.tagName.toLowerCase(),r=n.getSelectionElement(),n.options.disableReturn||r.getAttribute("data-disable-return")||"li"===o||n.isListItemChild(i)||(t.shiftKey||e.execCommand("formatBlock",!1,"p"),"a"===o&&e.execCommand("unlink",!1,null)))}),this},isListItemChild:function(t){for(var e=t.parentNode,n=e.tagName.toLowerCase();-1===this.parentElements.indexOf(n)&&"div"!==n;){if("li"===n)return!0;if(e=e.parentNode,!e||!e.tagName)return!1;n=e.tagName.toLowerCase()}return!1},bindReturn:function(t){var e=this;return this.on(this.elements[t],"keypress",function(t){if(13===t.which)if(e.options.disableReturn||this.getAttribute("data-disable-return"))t.preventDefault();else if(e.options.disableDoubleReturn||this.getAttribute("data-disable-double-return")){var n=s.call(e);n&&"\n"===n.innerText&&t.preventDefault()}}),this},bindTab:function(t){var n=this;return this.on(this.elements[t],"keydown",function(t){if(9===t.which){var o=s.call(n).tagName.toLowerCase();"pre"===o&&(t.preventDefault(),e.execCommand("insertHtml",null," ")),"li"===o&&(t.preventDefault(),t.shiftKey?e.execCommand("outdent",t):e.execCommand("indent",t))}}),this},buttonTemplate:function(t){var e=this.getButtonLabels(this.options.buttonLabels),n={bold:'<button class="medium-editor-action medium-editor-action-bold" data-action="bold" data-element="b">'+e.bold+"</button>",italic:'<button class="medium-editor-action medium-editor-action-italic" data-action="italic" data-element="i">'+e.italic+"</button>",underline:'<button class="medium-editor-action medium-editor-action-underline" data-action="underline" data-element="u">'+e.underline+"</button>",strikethrough:'<button class="medium-editor-action medium-editor-action-strikethrough" data-action="strikethrough" data-element="strike">'+e.strikethrough+"</button>",superscript:'<button class="medium-editor-action medium-editor-action-superscript" data-action="superscript" data-element="sup">'+e.superscript+"</button>",subscript:'<button class="medium-editor-action medium-editor-action-subscript" data-action="subscript" data-element="sub">'+e.subscript+"</button>",anchor:'<button class="medium-editor-action medium-editor-action-anchor" data-action="anchor" data-element="a">'+e.anchor+"</button>",image:'<button class="medium-editor-action medium-editor-action-image" data-action="image" data-element="img">'+e.image+"</button>",header1:'<button class="medium-editor-action medium-editor-action-header1" data-action="append-'+this.options.firstHeader+'" data-element="'+this.options.firstHeader+'">'+e.header1+"</button>",header2:'<button class="medium-editor-action medium-editor-action-header2" data-action="append-'+this.options.secondHeader+'" data-element="'+this.options.secondHeader+'">'+e.header2+"</button>",quote:'<button class="medium-editor-action medium-editor-action-quote" data-action="append-blockquote" data-element="blockquote">'+e.quote+"</button>",orderedlist:'<button class="medium-editor-action medium-editor-action-orderedlist" data-action="insertorderedlist" data-element="ol">'+e.orderedlist+"</button>",unorderedlist:'<button class="medium-editor-action medium-editor-action-unorderedlist" data-action="insertunorderedlist" data-element="ul">'+e.unorderedlist+"</button>",pre:'<button class="medium-editor-action medium-editor-action-pre" data-action="append-pre" data-element="pre">'+e.pre+"</button>",indent:'<button class="medium-editor-action medium-editor-action-indent" data-action="indent" data-element="ul">'+e.indent+"</button>",outdent:'<button class="medium-editor-action medium-editor-action-outdent" data-action="outdent" data-element="ul">'+e.outdent+"</button>",justifyCenter:'<button class="medium-editor-action medium-editor-action-justifyCenter" data-action="justifyCenter" data-element="">'+e.justifyCenter+"</button>",justifyFull:'<button class="medium-editor-action medium-editor-action-justifyFull" data-action="justifyFull" data-element="">'+e.justifyFull+"</button>",justifyLeft:'<button class="medium-editor-action medium-editor-action-justifyLeft" data-action="justifyLeft" data-element="">'+e.justifyLeft+"</button>",justifyRight:'<button class="medium-editor-action medium-editor-action-justifyRight" data-action="justifyRight" data-element="">'+e.justifyRight+"</button>"};return n[t]||!1},getButtonLabels:function(t){var e,n,o={bold:"<b>B</b>",italic:"<b><i>I</i></b>",underline:"<b><u>U</u></b>",strikethrough:"<s>A</s>",superscript:"<b>x<sup>1</sup></b>",subscript:"<b>x<sub>1</sub></b>",anchor:"<b>#</b>",image:"<b>image</b>",header1:"<b>H1</b>",header2:"<b>H2</b>",quote:"<b>&ldquo;</b>",orderedlist:"<b>1.</b>",unorderedlist:"<b>&bull;</b>",pre:"<b>0101</b>",indent:"<b>&rarr;</b>",outdent:"<b>&larr;</b>",justifyCenter:"<b>C</b>",justifyFull:"<b>J</b>",justifyLeft:"<b>L</b>",justifyRight:"<b>R</b>"};if("fontawesome"===t?e={bold:'<i class="fa fa-bold"></i>',italic:'<i class="fa fa-italic"></i>',underline:'<i class="fa fa-underline"></i>',strikethrough:'<i class="fa fa-strikethrough"></i>',superscript:'<i class="fa fa-superscript"></i>',subscript:'<i class="fa fa-subscript"></i>',anchor:'<i class="fa fa-link"></i>',image:'<i class="fa fa-picture-o"></i>',quote:'<i class="fa fa-quote-right"></i>',orderedlist:'<i class="fa fa-list-ol"></i>',unorderedlist:'<i class="fa fa-list-ul"></i>',pre:'<i class="fa fa-code fa-lg"></i>',indent:'<i class="fa fa-indent"></i>',outdent:'<i class="fa fa-outdent"></i>',justifyCenter:'<i class="fa fa-align-center"></i>',justifyFull:'<i class="fa fa-align-justify"></i>',justifyLeft:'<i class="fa fa-align-left"></i>',justifyRight:'<i class="fa fa-align-right"></i>'}:"object"==typeof t&&(e=t),"object"==typeof e)for(n in e)e.hasOwnProperty(n)&&(o[n]=e[n]);return o},initToolbar:function(){return this.toolbar?this:(this.toolbar=this.createToolbar(),this.keepToolbarAlive=!1,this.anchorForm=this.toolbar.querySelector(".medium-editor-toolbar-form-anchor"),this.anchorInput=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-input"),this.anchorTarget=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-target"),this.anchorButton=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-button"),this.toolbarActions=this.toolbar.querySelector(".medium-editor-toolbar-actions"),this.anchorPreview=this.createAnchorPreview(),this)},createToolbar:function(){var t=e.createElement("div");return t.id="medium-editor-toolbar-"+this.id,t.className="medium-editor-toolbar",t.appendChild(this.toolbarButtons()),t.appendChild(this.toolbarFormAnchor()),this.options.elementsContainer.appendChild(t),t},toolbarButtons:function(){var t,n,o,r,i=this.options.buttons,a=e.createElement("ul");for(a.id="medium-editor-toolbar-actions",a.className="medium-editor-toolbar-actions clearfix",n=0;n<i.length;n+=1)this.options.extensions.hasOwnProperty(i[n])?(r=this.options.extensions[i[n]],o=void 0!==r.getButton?r.getButton():null):o=this.buttonTemplate(i[n]),o&&(t=e.createElement("li"),l(o)?t.appendChild(o):t.innerHTML=o,a.appendChild(t));return a},toolbarFormAnchor:function(){var t=e.createElement("div"),n=e.createElement("input"),o=e.createElement("label"),r=e.createElement("input"),i=e.createElement("label"),a=e.createElement("input"),s=e.createElement("a"),u=e.createElement("a");return s.setAttribute("href","#"),s.className="medium-editor-toobar-anchor-close",s.innerHTML="&times;",u.setAttribute("href","#"),u.className="medium-editor-toobar-anchor-save",u.innerHTML="&#10003;",n.setAttribute("type","text"),n.className="medium-editor-toolbar-anchor-input",n.setAttribute("placeholder",this.options.anchorInputPlaceholder),r.setAttribute("type","checkbox"),r.className="medium-editor-toolbar-anchor-target",o.innerHTML="Open in New Window?",o.insertBefore(r,o.firstChild),a.setAttribute("type","checkbox"),a.className="medium-editor-toolbar-anchor-button",i.innerHTML="Button",i.insertBefore(a,i.firstChild),t.className="medium-editor-toolbar-form-anchor",t.id="medium-editor-toolbar-form-anchor",t.appendChild(n),t.appendChild(u),t.appendChild(s),this.options.anchorTarget&&t.appendChild(o),this.options.anchorButton&&t.appendChild(i),t},bindSelect:function(){var t,n=this,o="";for(this.checkSelectionWrapper=function(t){return t&&n.clickingIntoArchorForm(t)?!1:(clearTimeout(o),void(o=setTimeout(function(){n.checkSelection()},n.options.delay)))},this.on(e.documentElement,"mouseup",this.checkSelectionWrapper),t=0;t<this.elements.length;t+=1)this.on(this.elements[t],"keyup",this.checkSelectionWrapper),this.on(this.elements[t],"blur",this.checkSelectionWrapper);return this},checkSelection:function(){var t,e;return this.keepToolbarAlive===!0||this.options.disableToolbar||(t=this.options.contentWindow.getSelection(),""===t.toString().trim()||this.options.allowMultiParagraphSelection===!1&&this.hasMultiParagraphs()||this.selectionInContentEditableFalse()?this.hideToolbarActions():(e=this.getSelectionElement(),!e||e.getAttribute("data-disable-toolbar")?this.hideToolbarActions():this.checkSelectionElement(t,e))),this},clickingIntoArchorForm:function(t){var e=this;return t.type&&"blur"===t.type.toLowerCase()&&t.relatedTarget&&t.relatedTarget===e.anchorInput?!0:!1},hasMultiParagraphs:function c(){var t=u.call(this).replace(/<[\S]+><\/[\S]+>/gim,""),c=t.match(/<(p|h[0-6]|blockquote)>([\s\S]*?)<\/(p|h[0-6]|blockquote)>/g);return c?c.length:0},checkSelectionElement:function(t,e){var n;for(this.selection=t,this.selectionRange=this.selection.getRangeAt(0),n=0;n<this.elements.length;n+=1)if(this.elements[n]===e)return void this.setToolbarButtonStates().setToolbarPosition().showToolbarActions();this.hideToolbarActions()},findMatchingSelectionParent:function(t){var e,n,o=this.options.contentWindow.getSelection();if(0===o.rangeCount)return!1;e=o.getRangeAt(0),n=e.commonAncestorContainer;do{if(1===n.nodeType){if(t(n))return n;if(n.getAttribute("data-medium-element"))return!1}n=n.parentNode}while(n);return!1},getSelectionElement:function(){return this.findMatchingSelectionParent(function(t){return t.getAttribute("data-medium-element")})},selectionInContentEditableFalse:function(){return this.findMatchingSelectionParent(function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")})},setToolbarPosition:function(){var t=50,e=this.options.contentWindow.getSelection(),n=e.getRangeAt(0),o=n.getBoundingClientRect(),r=this.options.diffLeft-this.toolbar.offsetWidth/2,i=(o.left+o.right)/2,a=this.toolbar.offsetWidth/2;return o.top<t?(this.toolbar.classList.add("medium-toolbar-arrow-over"),this.toolbar.classList.remove("medium-toolbar-arrow-under"),this.toolbar.style.top=t+o.bottom-this.options.diffTop+this.options.contentWindow.pageYOffset-this.toolbar.offsetHeight+"px"):(this.toolbar.classList.add("medium-toolbar-arrow-under"),this.toolbar.classList.remove("medium-toolbar-arrow-over"),this.toolbar.style.top=o.top+this.options.diffTop+this.options.contentWindow.pageYOffset-this.toolbar.offsetHeight+"px"),a>i?this.toolbar.style.left=r+a+"px":this.options.contentWindow.innerWidth-i<a?this.toolbar.style.left=this.options.contentWindow.innerWidth+r-a+"px":this.toolbar.style.left=r+i+"px",this.hideAnchorPreview(),this},setToolbarButtonStates:function(){var t,e=this.toolbarActions.querySelectorAll("button");for(t=0;t<e.length;t+=1)e[t].classList.remove(this.options.activeButtonClass);return this.checkActiveButtons(),this},checkActiveButtons:function(){for(var t=Array.prototype.slice.call(this.elements),e=this.getSelectedParentElement();void 0!==e.tagName&&-1===this.parentElements.indexOf(e.tagName.toLowerCase)&&(this.activateButton(e.tagName.toLowerCase()),this.callExtensions("checkState",e),-1===t.indexOf(e));)e=e.parentNode},activateButton:function(t){var e=this.toolbar.querySelector('[data-element="'+t+'"]');null!==e&&-1===e.className.indexOf(this.options.activeButtonClass)&&(e.className+=" "+this.options.activeButtonClass)},bindButtons:function(){var t,e=this.toolbar.querySelectorAll("button"),n=this,o=function(t){t.preventDefault(),t.stopPropagation(),void 0===n.selection&&n.checkSelection(),this.className.indexOf(n.options.activeButtonClass)>-1?this.classList.remove(n.options.activeButtonClass):this.className+=" "+n.options.activeButtonClass,this.hasAttribute("data-action")&&n.execAction(this.getAttribute("data-action"),t)};for(t=0;t<e.length;t+=1)this.on(e[t],"click",o);return this.setFirstAndLastItems(e),this},setFirstAndLastItems:function(t){return t.length>0&&(t[0].className+=" "+this.options.firstButtonClass,t[t.length-1].className+=" "+this.options.lastButtonClass),this},execAction:function(t,e){t.indexOf("append-")>-1?(this.execFormatBlock(t.replace("append-","")),this.setToolbarPosition(),this.setToolbarButtonStates()):"anchor"===t?this.triggerAnchorAction(e):"image"===t?this.options.ownerDocument.execCommand("insertImage",!1,this.options.contentWindow.getSelection()):(this.options.ownerDocument.execCommand(t,!1,null),this.setToolbarPosition())},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(){var t=null,e=this.selectionRange;return t=this.rangeSelectsSingleNode(e)?e.startContainer.childNodes[e.startOffset]:3===e.startContainer.nodeType?e.startContainer.parentNode:e.startContainer},triggerAnchorAction:function(){var t=this.getSelectedParentElement();return t.tagName&&"a"===t.tagName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):"block"===this.anchorForm.style.display?this.showToolbarActions():this.showAnchorForm(),this},execFormatBlock:function(t){var e=this.getSelectionData(this.selection.anchorNode);if("blockquote"===t&&e.el&&"blockquote"===e.el.parentNode.tagName.toLowerCase())return this.options.ownerDocument.execCommand("outdent",!1,null);if(e.tagName===t&&(t="p"),this.isIE){if("blockquote"===t)return this.options.ownerDocument.execCommand("indent",!1,t);t="<"+t+">"}return this.options.ownerDocument.execCommand("formatBlock",!1,t)},getSelectionData:function(t){var e;for(t&&t.tagName&&(e=t.tagName.toLowerCase());t&&-1===this.parentElements.indexOf(e);)t=t.parentNode,t&&t.tagName&&(e=t.tagName.toLowerCase());return{el:t,tagName:e}},getFirstChild:function(t){for(var e=t.firstChild;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},hideToolbarActions:function(){this.keepToolbarAlive=!1,void 0!==this.toolbar&&this.toolbar.classList.remove("medium-editor-toolbar-active")},showToolbarActions:function(){var t,e=this;this.anchorForm.style.display="none",this.toolbarActions.style.display="block",this.keepToolbarAlive=!1,clearTimeout(t),t=setTimeout(function(){e.toolbar&&!e.toolbar.classList.contains("medium-editor-toolbar-active")&&e.toolbar.classList.add("medium-editor-toolbar-active")},100)},saveSelection:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){this.savedSelection=i.call(this)}),restoreSelection:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){a.call(this,this.savedSelection)}),showAnchorForm:function(t){this.toolbarActions.style.display="none",this.saveSelection(),this.anchorForm.style.display="block",this.setToolbarPosition(),this.keepToolbarAlive=!0,this.anchorInput.focus(),this.anchorInput.value=t||""},bindAnchorForm:function(){var t=this.anchorForm.querySelector("a.medium-editor-toobar-anchor-close"),e=this.anchorForm.querySelector("a.medium-editor-toobar-anchor-save"),n=this;return this.on(this.anchorForm,"click",function(t){t.stopPropagation(),n.keepToolbarAlive=!0}),this.on(this.anchorInput,"keyup",function(t){var e,o=null;13===t.keyCode&&(t.preventDefault(),e=n.options.anchorTarget&&n.anchorTarget.checked?"_blank":"_self",n.options.anchorButton&&n.anchorButton.checked&&(o=n.options.anchorButtonClass),n.createLink(this,e,o))}),this.on(e,"click",function(t){var e,o=null;t.preventDefault(),e=n.options.anchorTarget&&n.anchorTarget.checked?"_blank":"_self",n.options.anchorButton&&n.anchorButton.checked&&(o=n.options.anchorButtonClass),n.createLink(n.anchorInput,e,o)},!0),this.on(this.anchorInput,"click",function(t){t.stopPropagation(),n.keepToolbarAlive=!0}),this.on(this.options.ownerDocument.body,"click",function(t){t.target===n.anchorForm||r(n.anchorForm,t.target)||r(n.toolbarActions,t.target)||(n.keepToolbarAlive=!1,n.checkSelection())},!0),this.on(this.options.ownerDocument.body,"focus",function(t){t.target===n.anchorForm||r(n.anchorForm,t.target)||r(n.toolbarActions,t.target)||(n.keepToolbarAlive=!1,n.checkSelection())},!0),this.on(t,"click",function(t){t.preventDefault(),n.showToolbarActions(),a.call(n,n.savedSelection)}),this},hideAnchorPreview:function(){this.anchorPreview.classList.remove("medium-editor-anchor-preview-active")},showAnchorPreview:function(t){if(this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||t.getAttribute("data-disable-preview"))return!0;var e,n,o,r=this,i=40,a=t.getBoundingClientRect(),s=(a.left+a.right)/2;return r.anchorPreview.querySelector("i").textContent=t.href,e=r.anchorPreview.offsetWidth/2,n=r.options.diffLeft-e,clearTimeout(o),o=setTimeout(function(){r.anchorPreview&&!r.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&r.anchorPreview.classList.add("medium-editor-anchor-preview-active")},100),r.observeAnchorPreview(t),r.anchorPreview.classList.add("medium-toolbar-arrow-over"),r.anchorPreview.classList.remove("medium-toolbar-arrow-under"),r.anchorPreview.style.top=Math.round(i+a.bottom-r.options.diffTop+this.options.contentWindow.pageYOffset-r.anchorPreview.offsetHeight)+"px",e>s?r.anchorPreview.style.left=n+e+"px":this.options.contentWindow.innerWidth-s<e?r.anchorPreview.style.left=this.options.contentWindow.innerWidth+n-e+"px":r.anchorPreview.style.left=n+s+"px",this},observeAnchorPreview:function(t){var e=this,n=(new Date).getTime(),o=!0,r=function(){n=(new Date).getTime(),o=!0},i=function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(o=!1)},a=setInterval(function(){if(o)return!0;var s=(new Date).getTime()-n;s>e.options.anchorPreviewHideDelay&&(e.hideAnchorPreview(),clearInterval(a),e.off(e.anchorPreview,"mouseover",r),e.off(e.anchorPreview,"mouseout",i),e.off(t,"mouseover",r),e.off(t,"mouseout",i))},200);this.on(e.anchorPreview,"mouseover",r),this.on(e.anchorPreview,"mouseout",i),this.on(t,"mouseover",r),this.on(t,"mouseout",i)},createAnchorPreview:function(){var t=this,e=this.options.ownerDocument.createElement("div");return e.id="medium-editor-anchor-preview-"+this.id,e.className="medium-editor-anchor-preview",e.innerHTML=this.anchorPreviewTemplate(),this.options.elementsContainer.appendChild(e),this.on(e,"click",function(){t.anchorPreviewClickHandler()}),e},anchorPreviewTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <i class="medium-editor-toolbar-anchor-preview-inner"></i></div>'},anchorPreviewClickHandler:function(t){if(this.activeAnchor){var e=this,n=this.options.ownerDocument.createRange(),o=this.options.contentWindow.getSelection();n.selectNodeContents(e.activeAnchor),o.removeAllRanges(),o.addRange(n),setTimeout(function(){e.activeAnchor&&e.showAnchorForm(e.activeAnchor.href),e.keepToolbarAlive=!1},100+e.options.delay)}this.hideAnchorPreview()},editorAnchorObserver:function(t){var e=this,n=!0,o=function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){n=!1,e.off(e.activeAnchor,"mouseout",o)});if(t.target&&"a"===t.target.tagName.toLowerCase()){if(!/href=["']\S+["']/.test(t.target.outerHTML)||/href=["']#\S+["']/.test(t.target.outerHTML))return!0;if(this.toolbar.classList.contains("medium-editor-toolbar-active"))return!0;this.activeAnchor=t.target,this.on(this.activeAnchor,"mouseout",o),setTimeout(function(){n&&e.showAnchorPreview(t.target)},e.options.delay)}},bindAnchorPreview:function(t){var e,n=this;for(this.editorAnchorObserverWrapper=function(t){n.editorAnchorObserver(t)},e=0;e<this.elements.length;e+=1)this.on(this.elements[e],"mouseover",this.editorAnchorObserverWrapper);return this},checkLinkFormat:function(t){var e=/^(https?|ftps?|rtmpt?):\/\/|mailto:/;return(e.test(t)?"":"http://")+t},setTargetBlank:function(t){var e;if(t=t||s.call(this),"a"===t.tagName.toLowerCase())t.target="_blank";else for(t=t.getElementsByTagName("a"),e=0;e<t.length;e+=1)t[e].target="_blank"},setButtonClass:function(t){var e,n,o=s.call(this),r=t.split(" ");if("a"===o.tagName.toLowerCase())for(n=0;n<r.length;n+=1)o.classList.add(r[n]);else for(o=o.getElementsByTagName("a"),e=0;e<o.length;e+=1)for(n=0;n<r.length;n+=1)o[e].classList.add(r[n])},createLink:function(t,e,n){var o,r;if(0===t.value.trim().length)return void this.hideToolbarActions();if(a.call(this,this.savedSelection),this.options.checkLinkFormat&&(t.value=this.checkLinkFormat(t.value)),this.options.ownerDocument.execCommand("createLink",!1,t.value),(this.options.targetBlank||"_blank"===e)&&this.setTargetBlank(),n&&this.setButtonClass(n),this.options.targetBlank||"_blank"===e||n)for(r=this.options.ownerDocument.createEvent("HTMLEvents"),r.initEvent("input",!0,!0,this.options.contentWindow),o=0;o<this.elements.length;o+=1)this.elements[o].dispatchEvent(r);this.checkSelection(),this.showToolbarActions(),t.value=""},bindWindowActions:function(){var t,e=this;return this.windowResizeHandler=function(){clearTimeout(t),t=setTimeout(function(){e.toolbar&&e.toolbar.classList.contains("medium-editor-toolbar-active")&&e.setToolbarPosition()},100)},this.on(this.options.contentWindow,"resize",this.windowResizeHandler),this},activate:function(){this.isActive||this.setup()},deactivate:function(){var t;if(this.isActive){for(this.isActive=!1,void 0!==this.toolbar&&(this.options.elementsContainer.removeChild(this.anchorPreview),this.options.elementsContainer.removeChild(this.toolbar),delete this.toolbar,delete this.anchorPreview),t=0;t<this.elements.length;t+=1)this.elements[t].removeAttribute("contentEditable"),this.elements[t].removeAttribute("data-medium-element");this.removeAllEvents()}},htmlEntities:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},bindPaste:function(){var t,e=this;for(this.pasteWrapper=function(t){var n,o,r="";if(this.classList.remove("medium-editor-placeholder"),!e.options.forcePlainText&&!e.options.cleanPastedHTML)return this;if(t.clipboardData&&t.clipboardData.getData&&!t.defaultPrevented){if(t.preventDefault(),e.options.cleanPastedHTML&&t.clipboardData.getData("text/html"))return e.cleanPaste(t.clipboardData.getData("text/html"));if(e.options.disableReturn||this.getAttribute("data-disable-return"))r=e.htmlEntities(t.clipboardData.getData("text/plain")),e.options.ownerDocument.execCommand("insertHTML",!1,r);else{for(n=t.clipboardData.getData("text/plain").split(/[\r\n]/g),o=0;o<n.length;o+=1)""!==n[o]&&(r+=navigator.userAgent.match(/firefox/i)&&0===o?e.htmlEntities(n[o]):"<p>"+e.htmlEntities(n[o])+"</p>");e.options.ownerDocument.execCommand("insertHTML",!1,r)}}},t=0;t<this.elements.length;t+=1)this.on(this.elements[t],"paste",this.pasteWrapper);return this},setPlaceholders:function(){var t,e=function(t){t.querySelector("img")||t.querySelector("blockquote")||""!==t.textContent.replace(/^\s+|\s+$/g,"")||t.classList.add("medium-editor-placeholder")},n=function(t){this.classList.remove("medium-editor-placeholder"),"keypress"!==t.type&&e(this)};for(t=0;t<this.elements.length;t+=1)e(this.elements[t]),this.on(this.elements[t],"blur",n),this.on(this.elements[t],"keypress",n);return this},cleanPaste:function(t){var e,n,o,r=this.getSelectionElement(),i=/<p|<br|<div/.test(t),a=[[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:bold[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a\s+href=(&quot;|&rdquo;|&ldquo;|“|”)([^&]+)(&quot;|&rdquo;|&ldquo;|“|”)&gt;/gi),'<a href="$2">']];for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(i)for(n=t.split("<br><br>"),this.pasteHTML("<p>"+n.join("</p><p>")+"</p>"),this.options.ownerDocument.execCommand("insertText",!1,"\n"),n=r.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch(o=n[e],o.tagName.toLowerCase()){case"a":this.options.targetBlank&&this.setTargetBlank(o);break;case"p":case"div":this.filterCommonBlocks(o);break;case"br":this.filterLineBreak(o)}else this.pasteHTML(t)},pasteHTML:function(t){var e,n,o,r,i=this.options.ownerDocument.createDocumentFragment();for(i.appendChild(this.options.ownerDocument.createElement("body")),r=i.querySelector("body"),r.innerHTML=t,this.cleanupSpans(r),e=r.querySelectorAll("*"),o=0;o<e.length;o+=1)n=e[o],n.removeAttribute("class"),n.removeAttribute("style"),n.removeAttribute("dir"),"meta"===n.tagName.toLowerCase()&&n.parentNode.removeChild(n);this.options.ownerDocument.execCommand("insertHTML",!1,r.innerHTML.replace(/&nbsp;/g," "))},isCommonBlock:function(t){return t&&("p"===t.tagName.toLowerCase()||"div"===t.tagName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.innerText)&&t.parentNode.removeChild(t);
module.exports=function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";var o=function(t){return t&&t.__esModule?t:{"default":t}},r=n(15),i=o(r),a=n(1),s=o(a);n(37);var u=s["default"].createClass({displayName:"Medium",propTypes:{content:s["default"].PropTypes.object.isRequired,onChange:s["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{content:{html:"",text:""},options:{buttons:["header1","header2","bold","italic","underline","anchor","quote","unorderedlist","orderedlist"],firstHeader:"h1",secondHeader:"h2",diffLeft:0,diffTop:-10,disableDoubleReturn:!0}}},shouldComponentUpdate:function(t,e){return!1},componentDidMount:function(){this.setState({editor:new i["default"](this.refs.editor.getDOMNode(),this.props.options)})},componentWillUnmount:function(){this.state.editor.deactivate()},render:function(){return s["default"].createElement("div",{className:"col-block-medium"},s["default"].createElement("div",{className:"col-medium",onBlur:this._onBlur,role:"textarea","aria-multiline":"true",ref:"editor",dangerouslySetInnerHTML:{__html:this.props.content.html}}),this.props.children)},_onBlur:function(){var t=this.refs.editor.getDOMNode();this.props.onChange({text:t.textContent,html:t.innerHTML})}});t.exports=u},1:function(t,e,n){t.exports=require("react")},15:function(t,e,n){"use strict";function o(t,e){return this.init(t,e)}t.exports=o,function(t,e){function n(t,e){var n;if(void 0===t)return e;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)===!1&&(t[n]=e[n]);return t}function r(t,e){for(var n=e.parentNode;null!==n;){if(n===t)return!0;n=n.parentNode}return!1}function i(){var t,e,n,o=this.options.contentWindow.getSelection();if(o.getRangeAt&&o.rangeCount){for(n=[],t=0,e=o.rangeCount;e>t;t+=1)n.push(o.getRangeAt(t));return n}return null}function a(t){var e,n,o=this.options.contentWindow.getSelection();if(t)for(o.removeAllRanges(),e=0,n=t.length;n>e;e+=1)o.addRange(t[e])}function s(){var t=this.options.ownerDocument.getSelection().anchorNode,e=t&&3===t.nodeType?t.parentNode:t;return e}function u(){var t,e,n,o,r="";if(void 0!==this.options.contentWindow.getSelection){if(e=this.options.contentWindow.getSelection(),e.rangeCount){for(o=this.options.ownerDocument.createElement("div"),t=0,n=e.rangeCount;n>t;t+=1)o.appendChild(e.getRangeAt(t).cloneContents());r=o.innerHTML}}else void 0!==this.options.ownerDocument.selection&&"Text"===this.options.ownerDocument.selection.type&&(r=this.options.ownerDocument.selection.createRange().htmlText);return r}function l(t){return!(!t||1!==t.nodeType)}o.prototype={defaults:{allowMultiParagraphSelection:!0,anchorInputPlaceholder:"Paste or type a link",anchorPreviewHideDelay:500,buttons:["bold","italic","underline","anchor","header1","header2","quote"],buttonLabels:!1,checkLinkFormat:!1,cleanPastedHTML:!1,delay:0,diffLeft:0,diffTop:-10,disableReturn:!1,disableDoubleReturn:!1,disableToolbar:!1,disableEditing:!1,elementsContainer:!1,contentWindow:t,ownerDocument:e,firstHeader:"h3",forcePlainText:!0,placeholder:"Type your text",secondHeader:"h4",targetBlank:!1,anchorTarget:!1,anchorButton:!1,anchorButtonClass:"btn",extensions:{},activeButtonClass:"medium-editor-button-active",firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last"},isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),init:function(t,o){return this.options=n(o,this.defaults),this.setElementSelection(t),0!==this.elements.length?(this.parentElements=["p","h1","h2","h3","h4","h5","h6","blockquote","pre"],this.options.elementsContainer||(this.options.elementsContainer=e.body),this.id=this.options.elementsContainer.querySelectorAll(".medium-editor-toolbar").length+1,this.setup()):void 0},setup:function(){this.events=[],this.isActive=!0,this.initElements().bindSelect().bindPaste().setPlaceholders().bindWindowActions().passInstance()},on:function(t,e,n,o){t.addEventListener(e,n,o),this.events.push([t,e,n,o])},off:function(t,e,n,o){var r,i=this.events.indexOf([t,e,n,o]);-1!==i&&(r=this.events.splice(i,1),r[0].removeEventListener(r[1],r[2],r[3]))},removeAllEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},initElements:function(){this.updateElementList();var t,e=!1;for(t=0;t<this.elements.length;t+=1)this.options.disableEditing||this.elements[t].getAttribute("data-disable-editing")||this.elements[t].setAttribute("contentEditable",!0),this.elements[t].getAttribute("data-placeholder")||this.elements[t].setAttribute("data-placeholder",this.options.placeholder),this.elements[t].setAttribute("data-medium-element",!0),this.bindParagraphCreation(t).bindReturn(t).bindTab(t),this.options.disableToolbar||this.elements[t].getAttribute("data-disable-toolbar")||(e=!0);return e&&this.initToolbar().bindButtons().bindAnchorForm().bindAnchorPreview(),this},setElementSelection:function(t){this.elementSelection=t,this.updateElementList()},updateElementList:function(){this.elements="string"==typeof this.elementSelection?this.options.ownerDocument.querySelectorAll(this.elementSelection):this.elementSelection,1===this.elements.nodeType&&(this.elements=[this.elements])},serialize:function(){var t,e,n={};for(t=0;t<this.elements.length;t+=1)e=""!==this.elements[t].id?this.elements[t].id:"element-"+t,n[e]={value:this.elements[t].innerHTML.trim()};return n},callExtensions:function(t){if(!(arguments.length<1)){var e,n,o=Array.prototype.slice.call(arguments,1);for(n in this.options.extensions)this.options.extensions.hasOwnProperty(n)&&(e=this.options.extensions[n],void 0!==e[t]&&e[t].apply(e,o))}},passInstance:function(){var t,e,n=this;for(e in n.options.extensions)n.options.extensions.hasOwnProperty(e)&&(t=n.options.extensions[e],t.parent&&(t.base=n));return n},bindParagraphCreation:function(t){var n=this;return this.on(this.elements[t],"keypress",function(t){var o,r=s.call(n);32===t.which&&(o=r.tagName.toLowerCase(),"a"===o&&e.execCommand("unlink",!1,null))}),this.on(this.elements[t],"keyup",function(t){var o,r,i=s.call(n);i&&i.getAttribute("data-medium-element")&&0===i.children.length&&!n.options.disableReturn&&!i.getAttribute("data-disable-return")&&e.execCommand("formatBlock",!1,"p"),13===t.which&&(i=s.call(n),o=i.tagName.toLowerCase(),r=n.getSelectionElement(),n.options.disableReturn||r.getAttribute("data-disable-return")||"li"===o||n.isListItemChild(i)||(t.shiftKey||e.execCommand("formatBlock",!1,"p"),"a"===o&&e.execCommand("unlink",!1,null)))}),this},isListItemChild:function(t){for(var e=t.parentNode,n=e.tagName.toLowerCase();-1===this.parentElements.indexOf(n)&&"div"!==n;){if("li"===n)return!0;if(e=e.parentNode,!e||!e.tagName)return!1;n=e.tagName.toLowerCase()}return!1},bindReturn:function(t){var e=this;return this.on(this.elements[t],"keypress",function(t){if(13===t.which)if(e.options.disableReturn||this.getAttribute("data-disable-return"))t.preventDefault();else if(e.options.disableDoubleReturn||this.getAttribute("data-disable-double-return")){var n=s.call(e);n&&"\n"===n.innerText&&t.preventDefault()}}),this},bindTab:function(t){var n=this;return this.on(this.elements[t],"keydown",function(t){if(9===t.which){var o=s.call(n).tagName.toLowerCase();"pre"===o&&(t.preventDefault(),e.execCommand("insertHtml",null," ")),"li"===o&&(t.preventDefault(),t.shiftKey?e.execCommand("outdent",t):e.execCommand("indent",t))}}),this},buttonTemplate:function(t){var e=this.getButtonLabels(this.options.buttonLabels),n={bold:'<button class="medium-editor-action medium-editor-action-bold" data-action="bold" data-element="b">'+e.bold+"</button>",italic:'<button class="medium-editor-action medium-editor-action-italic" data-action="italic" data-element="i">'+e.italic+"</button>",underline:'<button class="medium-editor-action medium-editor-action-underline" data-action="underline" data-element="u">'+e.underline+"</button>",strikethrough:'<button class="medium-editor-action medium-editor-action-strikethrough" data-action="strikethrough" data-element="strike">'+e.strikethrough+"</button>",superscript:'<button class="medium-editor-action medium-editor-action-superscript" data-action="superscript" data-element="sup">'+e.superscript+"</button>",subscript:'<button class="medium-editor-action medium-editor-action-subscript" data-action="subscript" data-element="sub">'+e.subscript+"</button>",anchor:'<button class="medium-editor-action medium-editor-action-anchor" data-action="anchor" data-element="a">'+e.anchor+"</button>",image:'<button class="medium-editor-action medium-editor-action-image" data-action="image" data-element="img">'+e.image+"</button>",header1:'<button class="medium-editor-action medium-editor-action-header1" data-action="append-'+this.options.firstHeader+'" data-element="'+this.options.firstHeader+'">'+e.header1+"</button>",header2:'<button class="medium-editor-action medium-editor-action-header2" data-action="append-'+this.options.secondHeader+'" data-element="'+this.options.secondHeader+'">'+e.header2+"</button>",quote:'<button class="medium-editor-action medium-editor-action-quote" data-action="append-blockquote" data-element="blockquote">'+e.quote+"</button>",orderedlist:'<button class="medium-editor-action medium-editor-action-orderedlist" data-action="insertorderedlist" data-element="ol">'+e.orderedlist+"</button>",unorderedlist:'<button class="medium-editor-action medium-editor-action-unorderedlist" data-action="insertunorderedlist" data-element="ul">'+e.unorderedlist+"</button>",pre:'<button class="medium-editor-action medium-editor-action-pre" data-action="append-pre" data-element="pre">'+e.pre+"</button>",indent:'<button class="medium-editor-action medium-editor-action-indent" data-action="indent" data-element="ul">'+e.indent+"</button>",outdent:'<button class="medium-editor-action medium-editor-action-outdent" data-action="outdent" data-element="ul">'+e.outdent+"</button>",justifyCenter:'<button class="medium-editor-action medium-editor-action-justifyCenter" data-action="justifyCenter" data-element="">'+e.justifyCenter+"</button>",justifyFull:'<button class="medium-editor-action medium-editor-action-justifyFull" data-action="justifyFull" data-element="">'+e.justifyFull+"</button>",justifyLeft:'<button class="medium-editor-action medium-editor-action-justifyLeft" data-action="justifyLeft" data-element="">'+e.justifyLeft+"</button>",justifyRight:'<button class="medium-editor-action medium-editor-action-justifyRight" data-action="justifyRight" data-element="">'+e.justifyRight+"</button>"};return n[t]||!1},getButtonLabels:function(t){var e,n,o={bold:"<b>B</b>",italic:"<b><i>I</i></b>",underline:"<b><u>U</u></b>",strikethrough:"<s>A</s>",superscript:"<b>x<sup>1</sup></b>",subscript:"<b>x<sub>1</sub></b>",anchor:"<b>#</b>",image:"<b>image</b>",header1:"<b>H1</b>",header2:"<b>H2</b>",quote:"<b>&ldquo;</b>",orderedlist:"<b>1.</b>",unorderedlist:"<b>&bull;</b>",pre:"<b>0101</b>",indent:"<b>&rarr;</b>",outdent:"<b>&larr;</b>",justifyCenter:"<b>C</b>",justifyFull:"<b>J</b>",justifyLeft:"<b>L</b>",justifyRight:"<b>R</b>"};if("fontawesome"===t?e={bold:'<i class="fa fa-bold"></i>',italic:'<i class="fa fa-italic"></i>',underline:'<i class="fa fa-underline"></i>',strikethrough:'<i class="fa fa-strikethrough"></i>',superscript:'<i class="fa fa-superscript"></i>',subscript:'<i class="fa fa-subscript"></i>',anchor:'<i class="fa fa-link"></i>',image:'<i class="fa fa-picture-o"></i>',quote:'<i class="fa fa-quote-right"></i>',orderedlist:'<i class="fa fa-list-ol"></i>',unorderedlist:'<i class="fa fa-list-ul"></i>',pre:'<i class="fa fa-code fa-lg"></i>',indent:'<i class="fa fa-indent"></i>',outdent:'<i class="fa fa-outdent"></i>',justifyCenter:'<i class="fa fa-align-center"></i>',justifyFull:'<i class="fa fa-align-justify"></i>',justifyLeft:'<i class="fa fa-align-left"></i>',justifyRight:'<i class="fa fa-align-right"></i>'}:"object"==typeof t&&(e=t),"object"==typeof e)for(n in e)e.hasOwnProperty(n)&&(o[n]=e[n]);return o},initToolbar:function(){return this.toolbar?this:(this.toolbar=this.createToolbar(),this.keepToolbarAlive=!1,this.anchorForm=this.toolbar.querySelector(".medium-editor-toolbar-form-anchor"),this.anchorInput=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-input"),this.anchorTarget=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-target"),this.anchorButton=this.anchorForm.querySelector("input.medium-editor-toolbar-anchor-button"),this.toolbarActions=this.toolbar.querySelector(".medium-editor-toolbar-actions"),this.anchorPreview=this.createAnchorPreview(),this)},createToolbar:function(){var t=e.createElement("div");return t.id="medium-editor-toolbar-"+this.id,t.className="medium-editor-toolbar",t.appendChild(this.toolbarButtons()),t.appendChild(this.toolbarFormAnchor()),this.options.elementsContainer.appendChild(t),t},toolbarButtons:function(){var t,n,o,r,i=this.options.buttons,a=e.createElement("ul");for(a.id="medium-editor-toolbar-actions",a.className="medium-editor-toolbar-actions clearfix",n=0;n<i.length;n+=1)this.options.extensions.hasOwnProperty(i[n])?(r=this.options.extensions[i[n]],o=void 0!==r.getButton?r.getButton():null):o=this.buttonTemplate(i[n]),o&&(t=e.createElement("li"),l(o)?t.appendChild(o):t.innerHTML=o,a.appendChild(t));return a},toolbarFormAnchor:function(){var t=e.createElement("div"),n=e.createElement("input"),o=e.createElement("label"),r=e.createElement("input"),i=e.createElement("label"),a=e.createElement("input"),s=e.createElement("a"),u=e.createElement("a");return s.setAttribute("href","#"),s.className="medium-editor-toobar-anchor-close",s.innerHTML="&times;",u.setAttribute("href","#"),u.className="medium-editor-toobar-anchor-save",u.innerHTML="&#10003;",n.setAttribute("type","text"),n.className="medium-editor-toolbar-anchor-input",n.setAttribute("placeholder",this.options.anchorInputPlaceholder),r.setAttribute("type","checkbox"),r.className="medium-editor-toolbar-anchor-target",o.innerHTML="Open in New Window?",o.insertBefore(r,o.firstChild),a.setAttribute("type","checkbox"),a.className="medium-editor-toolbar-anchor-button",i.innerHTML="Button",i.insertBefore(a,i.firstChild),t.className="medium-editor-toolbar-form-anchor",t.id="medium-editor-toolbar-form-anchor",t.appendChild(n),t.appendChild(u),t.appendChild(s),this.options.anchorTarget&&t.appendChild(o),this.options.anchorButton&&t.appendChild(i),t},bindSelect:function(){var t,n=this,o="";for(this.checkSelectionWrapper=function(t){return t&&n.clickingIntoArchorForm(t)?!1:(clearTimeout(o),void(o=setTimeout(function(){n.checkSelection()},n.options.delay)))},this.on(e.documentElement,"mouseup",this.checkSelectionWrapper),t=0;t<this.elements.length;t+=1)this.on(this.elements[t],"keyup",this.checkSelectionWrapper),this.on(this.elements[t],"blur",this.checkSelectionWrapper);return this},checkSelection:function(){var t,e;return this.keepToolbarAlive===!0||this.options.disableToolbar||(t=this.options.contentWindow.getSelection(),""===t.toString().trim()||this.options.allowMultiParagraphSelection===!1&&this.hasMultiParagraphs()||this.selectionInContentEditableFalse()?this.hideToolbarActions():(e=this.getSelectionElement(),!e||e.getAttribute("data-disable-toolbar")?this.hideToolbarActions():this.checkSelectionElement(t,e))),this},clickingIntoArchorForm:function(t){var e=this;return t.type&&"blur"===t.type.toLowerCase()&&t.relatedTarget&&t.relatedTarget===e.anchorInput?!0:!1},hasMultiParagraphs:function c(){var t=u.call(this).replace(/<[\S]+><\/[\S]+>/gim,""),c=t.match(/<(p|h[0-6]|blockquote)>([\s\S]*?)<\/(p|h[0-6]|blockquote)>/g);return c?c.length:0},checkSelectionElement:function(t,e){var n;for(this.selection=t,this.selectionRange=this.selection.getRangeAt(0),n=0;n<this.elements.length;n+=1)if(this.elements[n]===e)return void this.setToolbarButtonStates().setToolbarPosition().showToolbarActions();this.hideToolbarActions()},findMatchingSelectionParent:function(t){var e,n,o=this.options.contentWindow.getSelection();if(0===o.rangeCount)return!1;e=o.getRangeAt(0),n=e.commonAncestorContainer;do{if(1===n.nodeType){if(t(n))return n;if(n.getAttribute("data-medium-element"))return!1}n=n.parentNode}while(n);return!1},getSelectionElement:function(){return this.findMatchingSelectionParent(function(t){return t.getAttribute("data-medium-element")})},selectionInContentEditableFalse:function(){return this.findMatchingSelectionParent(function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")})},setToolbarPosition:function(){var t=50,e=this.options.contentWindow.getSelection(),n=e.getRangeAt(0),o=n.getBoundingClientRect(),r=this.options.diffLeft-this.toolbar.offsetWidth/2,i=(o.left+o.right)/2,a=this.toolbar.offsetWidth/2;return o.top<t?(this.toolbar.classList.add("medium-toolbar-arrow-over"),this.toolbar.classList.remove("medium-toolbar-arrow-under"),this.toolbar.style.top=t+o.bottom-this.options.diffTop+this.options.contentWindow.pageYOffset-this.toolbar.offsetHeight+"px"):(this.toolbar.classList.add("medium-toolbar-arrow-under"),this.toolbar.classList.remove("medium-toolbar-arrow-over"),this.toolbar.style.top=o.top+this.options.diffTop+this.options.contentWindow.pageYOffset-this.toolbar.offsetHeight+"px"),a>i?this.toolbar.style.left=r+a+"px":this.options.contentWindow.innerWidth-i<a?this.toolbar.style.left=this.options.contentWindow.innerWidth+r-a+"px":this.toolbar.style.left=r+i+"px",this.hideAnchorPreview(),this},setToolbarButtonStates:function(){var t,e=this.toolbarActions.querySelectorAll("button");for(t=0;t<e.length;t+=1)e[t].classList.remove(this.options.activeButtonClass);return this.checkActiveButtons(),this},checkActiveButtons:function(){for(var t=Array.prototype.slice.call(this.elements),e=this.getSelectedParentElement();void 0!==e.tagName&&-1===this.parentElements.indexOf(e.tagName.toLowerCase)&&(this.activateButton(e.tagName.toLowerCase()),this.callExtensions("checkState",e),-1===t.indexOf(e));)e=e.parentNode},activateButton:function(t){var e=this.toolbar.querySelector('[data-element="'+t+'"]');null!==e&&-1===e.className.indexOf(this.options.activeButtonClass)&&(e.className+=" "+this.options.activeButtonClass)},bindButtons:function(){var t,e=this.toolbar.querySelectorAll("button"),n=this,o=function(t){t.preventDefault(),t.stopPropagation(),void 0===n.selection&&n.checkSelection(),this.className.indexOf(n.options.activeButtonClass)>-1?this.classList.remove(n.options.activeButtonClass):this.className+=" "+n.options.activeButtonClass,this.hasAttribute("data-action")&&n.execAction(this.getAttribute("data-action"),t)};for(t=0;t<e.length;t+=1)this.on(e[t],"click",o);return this.setFirstAndLastItems(e),this},setFirstAndLastItems:function(t){return t.length>0&&(t[0].className+=" "+this.options.firstButtonClass,t[t.length-1].className+=" "+this.options.lastButtonClass),this},execAction:function(t,e){t.indexOf("append-")>-1?(this.execFormatBlock(t.replace("append-","")),this.setToolbarPosition(),this.setToolbarButtonStates()):"anchor"===t?this.triggerAnchorAction(e):"image"===t?this.options.ownerDocument.execCommand("insertImage",!1,this.options.contentWindow.getSelection()):(this.options.ownerDocument.execCommand(t,!1,null),this.setToolbarPosition())},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(){var t=null,e=this.selectionRange;return t=this.rangeSelectsSingleNode(e)?e.startContainer.childNodes[e.startOffset]:3===e.startContainer.nodeType?e.startContainer.parentNode:e.startContainer},triggerAnchorAction:function(){var t=this.getSelectedParentElement();return t.tagName&&"a"===t.tagName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):"block"===this.anchorForm.style.display?this.showToolbarActions():this.showAnchorForm(),this},execFormatBlock:function(t){var e=this.getSelectionData(this.selection.anchorNode);if("blockquote"===t&&e.el&&"blockquote"===e.el.parentNode.tagName.toLowerCase())return this.options.ownerDocument.execCommand("outdent",!1,null);if(e.tagName===t&&(t="p"),this.isIE){if("blockquote"===t)return this.options.ownerDocument.execCommand("indent",!1,t);t="<"+t+">"}return this.options.ownerDocument.execCommand("formatBlock",!1,t)},getSelectionData:function(t){var e;for(t&&t.tagName&&(e=t.tagName.toLowerCase());t&&-1===this.parentElements.indexOf(e);)t=t.parentNode,t&&t.tagName&&(e=t.tagName.toLowerCase());return{el:t,tagName:e}},getFirstChild:function(t){for(var e=t.firstChild;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},hideToolbarActions:function(){this.keepToolbarAlive=!1,void 0!==this.toolbar&&this.toolbar.classList.remove("medium-editor-toolbar-active")},showToolbarActions:function(){var t,e=this;this.anchorForm.style.display="none",this.toolbarActions.style.display="block",this.keepToolbarAlive=!1,clearTimeout(t),t=setTimeout(function(){e.toolbar&&!e.toolbar.classList.contains("medium-editor-toolbar-active")&&e.toolbar.classList.add("medium-editor-toolbar-active")},100)},saveSelection:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){this.savedSelection=i.call(this)}),restoreSelection:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){a.call(this,this.savedSelection)}),showAnchorForm:function(t){this.toolbarActions.style.display="none",this.saveSelection(),this.anchorForm.style.display="block",this.setToolbarPosition(),this.keepToolbarAlive=!0,this.anchorInput.focus(),this.anchorInput.value=t||""},bindAnchorForm:function(){var t=this.anchorForm.querySelector("a.medium-editor-toobar-anchor-close"),e=this.anchorForm.querySelector("a.medium-editor-toobar-anchor-save"),n=this;return this.on(this.anchorForm,"click",function(t){t.stopPropagation(),n.keepToolbarAlive=!0}),this.on(this.anchorInput,"keyup",function(t){var e,o=null;13===t.keyCode&&(t.preventDefault(),e=n.options.anchorTarget&&n.anchorTarget.checked?"_blank":"_self",n.options.anchorButton&&n.anchorButton.checked&&(o=n.options.anchorButtonClass),n.createLink(this,e,o))}),this.on(e,"click",function(t){var e,o=null;t.preventDefault(),e=n.options.anchorTarget&&n.anchorTarget.checked?"_blank":"_self",n.options.anchorButton&&n.anchorButton.checked&&(o=n.options.anchorButtonClass),n.createLink(n.anchorInput,e,o)},!0),this.on(this.anchorInput,"click",function(t){t.stopPropagation(),n.keepToolbarAlive=!0}),this.on(this.options.ownerDocument.body,"click",function(t){t.target===n.anchorForm||r(n.anchorForm,t.target)||r(n.toolbarActions,t.target)||(n.keepToolbarAlive=!1,n.checkSelection())},!0),this.on(this.options.ownerDocument.body,"focus",function(t){t.target===n.anchorForm||r(n.anchorForm,t.target)||r(n.toolbarActions,t.target)||(n.keepToolbarAlive=!1,n.checkSelection())},!0),this.on(t,"click",function(t){t.preventDefault(),n.showToolbarActions(),a.call(n,n.savedSelection)}),this},hideAnchorPreview:function(){this.anchorPreview.classList.remove("medium-editor-anchor-preview-active")},showAnchorPreview:function(t){if(this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||t.getAttribute("data-disable-preview"))return!0;var e,n,o,r=this,i=40,a=t.getBoundingClientRect(),s=(a.left+a.right)/2;return r.anchorPreview.querySelector("i").textContent=t.href,e=r.anchorPreview.offsetWidth/2,n=r.options.diffLeft-e,clearTimeout(o),o=setTimeout(function(){r.anchorPreview&&!r.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&r.anchorPreview.classList.add("medium-editor-anchor-preview-active")},100),r.observeAnchorPreview(t),r.anchorPreview.classList.add("medium-toolbar-arrow-over"),r.anchorPreview.classList.remove("medium-toolbar-arrow-under"),r.anchorPreview.style.top=Math.round(i+a.bottom-r.options.diffTop+this.options.contentWindow.pageYOffset-r.anchorPreview.offsetHeight)+"px",e>s?r.anchorPreview.style.left=n+e+"px":this.options.contentWindow.innerWidth-s<e?r.anchorPreview.style.left=this.options.contentWindow.innerWidth+n-e+"px":r.anchorPreview.style.left=n+s+"px",this},observeAnchorPreview:function(t){var e=this,n=(new Date).getTime(),o=!0,r=function(){n=(new Date).getTime(),o=!0},i=function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(o=!1)},a=setInterval(function(){if(o)return!0;var s=(new Date).getTime()-n;s>e.options.anchorPreviewHideDelay&&(e.hideAnchorPreview(),clearInterval(a),e.off(e.anchorPreview,"mouseover",r),e.off(e.anchorPreview,"mouseout",i),e.off(t,"mouseover",r),e.off(t,"mouseout",i))},200);this.on(e.anchorPreview,"mouseover",r),this.on(e.anchorPreview,"mouseout",i),this.on(t,"mouseover",r),this.on(t,"mouseout",i)},createAnchorPreview:function(){var t=this,e=this.options.ownerDocument.createElement("div");return e.id="medium-editor-anchor-preview-"+this.id,e.className="medium-editor-anchor-preview",e.innerHTML=this.anchorPreviewTemplate(),this.options.elementsContainer.appendChild(e),this.on(e,"click",function(){t.anchorPreviewClickHandler()}),e},anchorPreviewTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <i class="medium-editor-toolbar-anchor-preview-inner"></i></div>'},anchorPreviewClickHandler:function(t){if(this.activeAnchor){var e=this,n=this.options.ownerDocument.createRange(),o=this.options.contentWindow.getSelection();n.selectNodeContents(e.activeAnchor),o.removeAllRanges(),o.addRange(n),setTimeout(function(){e.activeAnchor&&e.showAnchorForm(e.activeAnchor.href),e.keepToolbarAlive=!1},100+e.options.delay)}this.hideAnchorPreview()},editorAnchorObserver:function(t){var e=this,n=!0,o=function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(){n=!1,e.off(e.activeAnchor,"mouseout",o)});if(t.target&&"a"===t.target.tagName.toLowerCase()){if(!/href=["']\S+["']/.test(t.target.outerHTML)||/href=["']#\S+["']/.test(t.target.outerHTML))return!0;if(this.toolbar.classList.contains("medium-editor-toolbar-active"))return!0;this.activeAnchor=t.target,this.on(this.activeAnchor,"mouseout",o),setTimeout(function(){n&&e.showAnchorPreview(t.target)},e.options.delay)}},bindAnchorPreview:function(t){var e,n=this;for(this.editorAnchorObserverWrapper=function(t){n.editorAnchorObserver(t)},e=0;e<this.elements.length;e+=1)this.on(this.elements[e],"mouseover",this.editorAnchorObserverWrapper);return this},checkLinkFormat:function(t){var e=/^(https?|ftps?|rtmpt?):\/\/|mailto:/;return(e.test(t)?"":"http://")+t},setTargetBlank:function(t){var e;if(t=t||s.call(this),"a"===t.tagName.toLowerCase())t.target="_blank";else for(t=t.getElementsByTagName("a"),e=0;e<t.length;e+=1)t[e].target="_blank"},setButtonClass:function(t){var e,n,o=s.call(this),r=t.split(" ");if("a"===o.tagName.toLowerCase())for(n=0;n<r.length;n+=1)o.classList.add(r[n]);else for(o=o.getElementsByTagName("a"),e=0;e<o.length;e+=1)for(n=0;n<r.length;n+=1)o[e].classList.add(r[n])},createLink:function(t,e,n){var o,r;if(0===t.value.trim().length)return void this.hideToolbarActions();if(a.call(this,this.savedSelection),this.options.checkLinkFormat&&(t.value=this.checkLinkFormat(t.value)),this.options.ownerDocument.execCommand("createLink",!1,t.value),(this.options.targetBlank||"_blank"===e)&&this.setTargetBlank(),n&&this.setButtonClass(n),this.options.targetBlank||"_blank"===e||n)for(r=this.options.ownerDocument.createEvent("HTMLEvents"),r.initEvent("input",!0,!0,this.options.contentWindow),o=0;o<this.elements.length;o+=1)this.elements[o].dispatchEvent(r);this.checkSelection(),this.showToolbarActions(),t.value=""},bindWindowActions:function(){var t,e=this;return this.windowResizeHandler=function(){clearTimeout(t),t=setTimeout(function(){e.toolbar&&e.toolbar.classList.contains("medium-editor-toolbar-active")&&e.setToolbarPosition()},100)},this.on(this.options.contentWindow,"resize",this.windowResizeHandler),this},activate:function(){this.isActive||this.setup()},deactivate:function(){var t;if(this.isActive){for(this.isActive=!1,void 0!==this.toolbar&&(this.options.elementsContainer.removeChild(this.anchorPreview),this.options.elementsContainer.removeChild(this.toolbar),delete this.toolbar,delete this.anchorPreview),t=0;t<this.elements.length;t+=1)this.elements[t].removeAttribute("contentEditable"),this.elements[t].removeAttribute("data-medium-element");this.removeAllEvents()}},htmlEntities:function(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},bindPaste:function(){var t,e=this;for(this.pasteWrapper=function(t){var n,o,r="";if(this.classList.remove("medium-editor-placeholder"),!e.options.forcePlainText&&!e.options.cleanPastedHTML)return this;if(t.clipboardData&&t.clipboardData.getData&&!t.defaultPrevented){if(t.preventDefault(),e.options.cleanPastedHTML&&t.clipboardData.getData("text/html"))return e.cleanPaste(t.clipboardData.getData("text/html"));if(e.options.disableReturn||this.getAttribute("data-disable-return"))r=e.htmlEntities(t.clipboardData.getData("text/plain")),e.options.ownerDocument.execCommand("insertHTML",!1,r);else{for(n=t.clipboardData.getData("text/plain").split(/[\r\n]/g),o=0;o<n.length;o+=1)""!==n[o]&&(r+=navigator.userAgent.match(/firefox/i)&&0===o?e.htmlEntities(n[o]):"<p>"+e.htmlEntities(n[o])+"</p>");e.options.ownerDocument.execCommand("insertHTML",!1,r)}}},t=0;t<this.elements.length;t+=1)this.on(this.elements[t],"paste",this.pasteWrapper);return this},setPlaceholders:function(){var t,e=function(t){t.querySelector("img")||t.querySelector("blockquote")||""!==t.textContent.replace(/^\s+|\s+$/g,"")||t.classList.add("medium-editor-placeholder")},n=function(t){this.classList.remove("medium-editor-placeholder"),"keypress"!==t.type&&e(this)};for(t=0;t<this.elements.length;t+=1)e(this.elements[t]),this.on(this.elements[t],"blur",n),this.on(this.elements[t],"keypress",n);return this},cleanPaste:function(t){var e,n,o,r=this.getSelectionElement(),i=/<p|<br|<div/.test(t),a=[[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:bold[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a\s+href=(&quot;|&rdquo;|&ldquo;|“|”)([^&]+)(&quot;|&rdquo;|&ldquo;|“|”)&gt;/gi),'<a href="$2">']];for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(i)for(n=t.split("<br><br>"),this.pasteHTML("<p>"+n.join("</p><p>")+"</p>"),this.options.ownerDocument.execCommand("insertText",!1,"\n"),n=r.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch(o=n[e],o.tagName.toLowerCase()){case"a":this.options.targetBlank&&this.setTargetBlank(o);break;case"p":case"div":this.filterCommonBlocks(o);break;case"br":this.filterLineBreak(o)}else this.pasteHTML(t)},pasteHTML:function(t){var e,n,o,r,i=this.options.ownerDocument.createDocumentFragment();for(i.appendChild(this.options.ownerDocument.createElement("body")),r=i.querySelector("body"),r.innerHTML=t,this.cleanupSpans(r),e=r.querySelectorAll("*"),o=0;o<e.length;o+=1)n=e[o],n.removeAttribute("class"),n.removeAttribute("style"),n.removeAttribute("dir"),"meta"===n.tagName.toLowerCase()&&n.parentNode.removeChild(n);this.options.ownerDocument.execCommand("insertHTML",!1,r.innerHTML.replace(/&nbsp;/g," "))},isCommonBlock:function(t){return t&&("p"===t.tagName.toLowerCase()||"div"===t.tagName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.innerText)&&t.parentNode.removeChild(t);
},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?t.parentNode.removeChild(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?1===t.parentNode.childElementCount&&this.removeWithParent(t):t.parentNode.removeChild(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t.parentNode))},cleanupSpans:function(t){var e,n,o,r=t.querySelectorAll(".replace-with");for(e=0;e<r.length;e+=1)n=r[e],o=this.options.ownerDocument.createElement(n.classList.contains("bold")?"b":"i"),n.classList.contains("bold")&&n.classList.contains("italic")?o.innerHTML="<i>"+n.innerHTML+"</i>":o.innerHTML=n.innerHTML,n.parentNode.replaceChild(o,n);for(r=t.querySelectorAll("span"),e=0;e<r.length;e+=1)n=r[e],/^\s*$/.test()?n.parentNode.removeChild(n):n.parentNode.replaceChild(this.options.ownerDocument.createTextNode(n.innerText),n)}}}(window,document)},38:function(t,e,n){}});
},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?t.parentNode.removeChild(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?1===t.parentNode.childElementCount&&this.removeWithParent(t):t.parentNode.removeChild(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t.parentNode))},cleanupSpans:function(t){var e,n,o,r=t.querySelectorAll(".replace-with");for(e=0;e<r.length;e+=1)n=r[e],o=this.options.ownerDocument.createElement(n.classList.contains("bold")?"b":"i"),n.classList.contains("bold")&&n.classList.contains("italic")?o.innerHTML="<i>"+n.innerHTML+"</i>":o.innerHTML=n.innerHTML,n.parentNode.replaceChild(o,n);for(r=t.querySelectorAll("span"),e=0;e<r.length;e+=1)n=r[e],/^\s*$/.test()?n.parentNode.removeChild(n):n.parentNode.replaceChild(this.options.ownerDocument.createTextNode(n.innerText),n)}}}(window,document)},37:function(t,e,n){}});
//# sourceMappingURL=medium.js.map

@@ -1,2 +0,2 @@

module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(4),a=r(o),u=n(15),i=r(u),s=n(1),l=r(s);n(39);var c=l["default"].createClass({displayName:"YouTube",propTypes:{content:l["default"].PropTypes.object.isRequired,onChange:l["default"].PropTypes.func.isRequired,src:l["default"].PropTypes.string},getDefaultProps:function(){return{content:{video_id:""}}},render:function(){var t=this.props.content.video_id;return l["default"].createElement("div",{className:"col-youtube"},l["default"].createElement("fieldset",{className:"col-youtube-fieldset"},l["default"].createElement(a["default"],{label:"YouTube Video ID",value:t,name:"youtube_video_id",onChange:this._onChange,autofocus:!0})),l["default"].createElement(i["default"],{video_id:t}))},_onChange:function(t){this.props.onChange({video_id:t.currentTarget.value})}});e["default"]=c,t.exports=e["default"]},1:function(t,e,n){t.exports=require("react")},2:function(t,e,n){function r(){for(var t,e="",n=0;n<arguments.length;n++)if(t=arguments[n])if("string"==typeof t||"number"==typeof t)e+=" "+t;else if("[object Array]"===Object.prototype.toString.call(t))e+=" "+r.apply(null,t);else if("object"==typeof t)for(var o in t)t.hasOwnProperty(o)&&t[o]&&(e+=" "+o);return e.substr(1)}"undefined"!=typeof t&&t.exports&&(t.exports=r)},4:function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u);n(6),e["default"]=i["default"].createClass({displayName:"field",getDefaultProps:function(){return{type:"text"}},render:function(){var t=this.props,e=t.label,n=t.name,r=t.type,u=o(t,["label","name","type"]);return i["default"].createElement("div",{className:"col-field"},i["default"].createElement("label",{className:"col-field-label",htmlFor:n||this.props.id},e),i["default"].createElement("input",a({className:"col-field-input",type:r},u,{name:n||this.props.id})))}}),t.exports=e["default"]},6:function(t,e,n){},15:function(t,e,n){"use strict";var r=n(1),o=n(2),a=r.createClass({displayName:"Player",getDefaultProps:function(){return{baseUrl:"https://www.youtube.com/embed/"}},getSrc:function(){var t=this.props,e=t.baseUrl,n=t.video_id;return n?e+n:null},render:function(){var t=o("col-youtube-player",{"col-youtube-player-open":this.props.video_id});return r.createElement("div",{className:t},r.createElement("iframe",{className:"col-youtube-frame",src:this.getSrc(),frameBorder:"0",allowFullScreen:!0}))}});t.exports=a},39:function(t,e,n){}});
module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(4),a=r(o),u=n(5),i=r(u),s=n(6),l=r(s),c=n(1),f=r(c),d=f["default"].createClass({displayName:"YouTube",getDefaultProps:function(){return{baseUrl:"https://www.youtube.com/embed/",content:{video_id:""}}},getSrc:function(t){var e=this.props.baseUrl;return t?e+t:null},render:function(){var t=this.props.content.video_id;return f["default"].createElement("div",{className:"col-youtube"},f["default"].createElement(a["default"],{label:"YouTube Video ID",value:t,name:"youtube_video_id",onChange:this._onChange,autofocus:!0}),f["default"].createElement(i["default"],{open:t},f["default"].createElement(l["default"],{element:"iframe",src:this.getSrc(t)})))},_onChange:function(t){this.props.onChange({video_id:t.currentTarget.value})}});e["default"]=d,t.exports=e["default"]},function(t,e,n){t.exports=require("react")},function(t,e,n){t.exports=require("classnames")},,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u);n(8),e["default"]=i["default"].createClass({displayName:"field",getDefaultProps:function(){return{type:"text"}},render:function(){var t=this.props,e=t.label,n=t.name,r=t.type,u=o(t,["label","name","type"]);return i["default"].createElement("div",{className:"col-field"},i["default"].createElement("label",{className:"col-field-label",htmlFor:n||this.props.id},e),i["default"].createElement("input",a({className:"col-field-input",type:r},u,{name:n||this.props.id})))}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u),s=n(2),l=r(s),c=i["default"].createClass({displayName:"Frame",getDefaultProps:function(){return{element:"figure"}},render:function(){var t=this.props,e=t.element,n=t.children,r=t.open,u=o(t,["element","children","open"]),s=l["default"]("col-frame",{"col-frame-open":r});return i["default"].createElement(e,a({className:s},u),n)}});e["default"]=c,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n};e.__esModule=!0;var a=n(1),u=r(a),i=n(2),s=(r(i),u["default"].createClass({displayName:"Graphic",getDefaultProps:function(){return{className:"col-graphic",element:"img",src:null}},render:function(){var t=this.props,e=t.element,n=o(t,["element"]);return u["default"].createElement(e,n)}}));e["default"]=s,t.exports=e["default"]},,function(t,e,n){}]);
//# sourceMappingURL=youtube.js.map

@@ -1,2 +0,2 @@

module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0,n(40);var o=n(16),a=r(o);e["default"]=a["default"],t.exports=e["default"]},function(t,e,n){t.exports=require("react")},function(t,e,n){function r(){for(var t,e="",n=0;n<arguments.length;n++)if(t=arguments[n])if("string"==typeof t||"number"==typeof t)e+=" "+t;else if("[object Array]"===Object.prototype.toString.call(t))e+=" "+r.apply(null,t);else if("object"==typeof t)for(var o in t)t.hasOwnProperty(o)&&t[o]&&(e+=" "+o);return e.substr(1)}"undefined"!=typeof t&&t.exports&&(t.exports=r)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e["default"]=r.tag({create:function(t,e,n){return{type:t,position:e,parent:n}},destroy:function(t){return t},update:function(t,e){return{id:t,content:e}},shift:function(t,e){return{id:t,delta:e}}}),t.exports=e["default"]},,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n};e.__esModule=!0;var a=n(1),u=r(a),i=n(44),s=r(i),l=u["default"].createClass({displayName:"Button",getDefaultProps:function(){return{className:"col-btn",hide:!1,tagName:"button",type:"button"}},render:function(){var t=this.props,e=t.children,n=t.hide,r=t.tagName,a=o(t,["children","hide","tagName"]);return n?null:u["default"].createElement(r,a,[u["default"].createElement(s["default"],{key:"__ink__"}),e])}});e["default"]=l,t.exports=e["default"]},,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(1),i=r(u),s=n(22),l=r(s),c=n(21),f=r(c),p=n(2),d=r(p);e["default"]=i["default"].createClass({displayName:"Switch",propTypes:{app:i["default"].PropTypes.object.isRequired},getInitialState:function(){return{open:!1}},componentWillReceiveProps:function(){this.setState({open:!1})},getTypes:function(){var t=this.props,e=t.app,n=t.parent,r=e.pull("blockTypes");if(!n)return r;var o=function(){var t=r.filter(function(t){return t.id===n.type})[0].types;return{v:r.filter(function(e){return t.indexOf(e.id)>-1})}}();return"object"==typeof o?o.v:void 0},render:function(){var t=this.props,e=t.app,n=t.forceOpen,r=t.parent,o=t.position,a=this.getTypes(),u=n||this.state.open;return a.length?i["default"].createElement("div",{className:d["default"]("col-switch",{"col-switch-open":u})},i["default"].createElement(l["default"],{onClick:this._onToggle,secondary:r,hide:u}),i["default"].createElement(f["default"],{app:e,blockTypes:a,parent:r,hide:!u,position:o})):null},_onToggle:function(){var t=this.getTypes();if(1===t.length){var e=this.props,n=e.app,r=e.position,o=e.parent;n.push(a["default"].create,t[0].id,r,o)}this.setState({open:!0})}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};e.__esModule=!0;var a=n(36),u=r(a),i=function(){function t(e){o(this,t),this.id=u["default"](),this.content=e.content,this.parent=e.parent,this.type=e.type}return t.prototype.valueOf=function(){return this.id},t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){var n=void 0===arguments[2]?"id":arguments[2],r=t.filter(function(t){return t[n]==e});if(r.length)return r[0];throw new Error("Unable to find record with "+n+" of "+e)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t.filter(e.parent?function(t){return t.parent===e.parent}:function(t){return!t.parent})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.tag=r,e["default"]=n(4)},function(t,e,n){"use strict";function r(t,e){if(!t){var n=new Error(e);throw n.framesToPop=1,n}}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){var n=void 0===arguments[2]?{}:arguments[2],r=Object.keys(t);return r.reduce(function(n,r){return n[r]=e(t[r],r),n},n)}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(1),a=r(o);e["default"]={validate:function(t){a["default"]("function"==typeof t,"Action "+t+" is not callable, actions should be functions")}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};e.__esModule=!0;var u=n(3),i=r(u),s=n(12),l=r(s),c=n(5),f=r(c),p=n(6),d=r(p),h=n(1),v=r(h),m=n(7),g=r(m),_=n(8),y=r(_),b=n(9),x=r(b),k=n(2),M=r(k),w=n(10),T=r(w),O=function(){function t(){a(this,t),l["default"].decorate(this),this._state={},this._stores={},this._plugins=[]}return t.prototype.push=function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];i["default"].validate(t);var a=t.apply(void 0,r);return a instanceof Promise?a.then(function(n){return e.dispatch(t,n)}):this.dispatch(t,a)},t.prototype.pull=function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o];var a=y["default"](this._state,t);return"function"==typeof e?e.call.apply(e,[this,a].concat(r)):a},t.prototype.prepare=function(t){for(var e,n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];return i["default"].validate(t),(e=this.push).bind.apply(e,[this,t].concat(r))},t.prototype.replace=function(t){this.commit(this.deserialize(t))},t.prototype.commit=function(t){this._state=t,this.emit()},t.prototype.dispatch=function(t,e){var n=this,r=T["default"](this._stores,function(e){return t in e});return Object.keys(r).length>0&&!function(){var o=g["default"](n._state),a=M["default"](r,function(n){return n[t](o[n],e)},o);n.commit(a)}(),e},t.prototype.addPlugin=function(t,e){f["default"].validate(t),this._plugins.push([t,e])},t.prototype.addStore=function(t){var e=o({},d["default"],t);v["default"](!this._stores[t],'Tried to add "'+t+'" but it is not unique'),this._stores[e]=e},t.prototype.serialize=function(){var t=this;return M["default"](this._stores,function(e){return e.serialize(t.pull(e))})},t.prototype.deserialize=function(){var t=void 0===arguments[0]?{}:arguments[0];return M["default"](this._stores,function(e){return e.deserialize(t[e])})},t.prototype.toJSON=function(){return this.serialize()},t.prototype.toObject=function(){return T["default"](this._state,function(){return!0})},t.prototype.start=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];this._state=M["default"](this._stores,function(t){return t.getInitialState()}),x["default"](this._plugins,this,function(){e.forEach(function(t){return t()})})},t}();e["default"]=O,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(1),a=r(o);e["default"]={validate:function(t){a["default"]("register"in t,"Plugins must have a register method.")}},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]={getInitialState:function(){return void 0},serialize:function(t){return t},deserialize:function(){var t=void 0===arguments[0]?this.getInitialState():arguments[0];return t},toString:function(){throw new Error("Stores must implement a toString() method")}},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t){return Object.create(t)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){for(var n=[].concat(e);n.length;)t=t[""+n.shift()];return t}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){var o=t[0],a=t.slice(1);if(!o)return n();var u=o[0],i=o[1];u.register(e,i,function(t){if(t)throw t;r(a,e,n)})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){var n={};for(var r in t)e(t[r])&&(n[r]=t[r]);return n},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return"function"==typeof t}function o(t,e){var n=t.bind(null),r="_"+e+"_"+s++;return n.toString=function(){return r},n}var a=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var u=n(2),i=a(u),s=0;e["default"]=function(t){return i["default"](t,function(t,e){return r(t)?o(t,e):t})},t.exports=e["default"]},function(t,e,r){t.exports=n(41)}])},function(t,e,n){t.exports=require("react/lib/ReactCSSTransitionGroup")},,,,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)};e.__esModule=!0;var u=n(27),i=r(u),s=n(28),l=r(s),c=n(11),f=r(c),p=n(1),d=(r(p),n(25)),h=r(d),v=n(26),m=r(v),g=function(t){function e(n){var r=n.el,a=n.blocks,u=n.blockTypes;o(this,e),t.call(this),this.addStore(l["default"]),this.addStore(i["default"]),this.addPlugin(h["default"],{blocks:a,blockTypes:u}),this.addPlugin(m["default"],{el:r})}return a(e,t),e.prototype.toJSON=function(){return this.serialize().blocks},e}(f["default"]);e["default"]=g,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(12),u=r(a),i=n(19),s=r(i),l=n(1),c=r(l),f=n(7),p=r(f),d=n(34),h=r(d);e["default"]=c["default"].createClass({displayName:"App",propTypes:{app:c["default"].PropTypes.object.isRequired},getBlock:function(t,e){return c["default"].createElement(s["default"],o({key:t.id,block:t},this.props))},render:function(){var t=this.props.app;return c["default"].createElement("div",{className:"colonel"},c["default"].createElement(p["default"],{app:t}),c["default"].createElement(u["default"],{transitionName:"col-editor-block"},t.pull("blocks",h["default"]).map(this.getBlock)))}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(1),i=r(u),s=n(23),l=r(s),c=n(2),f=r(c),p=n(9),d=r(p);e["default"]=i["default"].createClass({displayName:"Block",propTypes:{app:i["default"].PropTypes.object.isRequired,block:i["default"].PropTypes.object.isRequired},getClassName:function(t){return f["default"]("col-block","col-block-"+t)},render:function(){var t=this.props,e=t.app,n=t.block,r=t.children,o=t.first,a=t.last,u=e.pull("blockTypes",d["default"],n.type),s=(u.id,u.component);return i["default"].createElement("div",{className:this.getClassName(n.type)},i["default"].createElement(s,{ref:"block",content:n.content,onChange:this._onChange},r),i["default"].createElement(l["default"],{app:e,block:n,first:o,last:a}))},_onChange:function(t){var e=this.props,n=e.app,r=e.block;n.push(a["default"].update,r,t)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(12),a=r(o),u=n(18),i=r(u),s=n(7),l=r(s),c=n(1),f=r(c),p=n(31),d=r(p),h=f["default"].createClass({displayName:"EditorBlock",propTypes:{app:f["default"].PropTypes.object.isRequired,block:f["default"].PropTypes.object.isRequired},getBlock:function(t,e){return f["default"].createElement(h,{key:t.id,app:this.props.app,block:t})},render:function(){var t=this.props,e=t.app,n=t.block;return f["default"].createElement("div",{className:"col-editor-block"},f["default"].createElement(i["default"],{app:e,block:n},f["default"].createElement(l["default"],{app:e,parent:n}),f["default"].createElement(a["default"],{transitionName:"col-editor-block"},e.pull("blocks",d["default"],n).map(this.getBlock))),f["default"].createElement(l["default"],{app:e,position:n,parent:n.parent}))}});e["default"]=h,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n};e.__esModule=!0;var a=n(5),u=r(a),i=n(1),s=r(i);e["default"]=s["default"].createClass({displayName:"MenuItem",propTypes:{label:s["default"].PropTypes.string.isRequired,onClick:s["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{className:"col-menu-item",hide:!1,type:"button"}},render:function(){var t=this.props,e=t.hide,n=t.label,r=o(t,["hide","label"]);return e?null:s["default"].createElement(u["default"],r,n)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(5),i=r(u),s=n(1),l=r(s);e["default"]=l["default"].createClass({displayName:"SwitchNav",propTypes:{app:l["default"].PropTypes.object.isRequired,blockTypes:l["default"].PropTypes.array.isRequired},getButton:function(t){var e=this,n=t.id,r=t.label;return l["default"].createElement(i["default"],{key:n,className:"col-switch-btn",onClick:function(){return e._onAdd(n)}},r)},render:function(){var t=this.props,e=(t.app,t.blockTypes),n=t.hide;return n?null:l["default"].createElement("nav",{className:"col-switch-nav",role:"navigation"},e.map(this.getButton))},_onAdd:function(t){var e=this.props,n=e.app,r=e.position,o=e.parent;n.push(a["default"].create,t,r,o)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(5),a=r(o),u=n(1),i=r(u),s=n(2),l=r(s);e["default"]=i["default"].createClass({displayName:"SwitchToggle",propTypes:{onClick:i["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{label:"Open block creation menu",hide:!1,secondary:!1,symbol:"+"}},render:function(){var t=this.props,e=t.label,n=t.hide,r=t.onClick,o=t.secondary,u=t.symbol,s=l["default"]("col-btn-fab",{"col-btn-fab-secondary":o});return i["default"].createElement(a["default"],{ref:"toggle",className:s,onClick:r,hide:n},i["default"].createElement("span",{className:"col-hidden"},e),i["default"].createElement("span",{"aria-hidden":"true"},u))}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(24),a=r(o),u=n(20),i=r(u),s=n(43),l=r(s),c=n(1),f=r(c),p=n(2),d=(r(p),n(10)),h=r(d),v=n(3);e["default"]=f["default"].createClass({displayName:"Toolbar",propTypes:{app:f["default"].PropTypes.object.isRequired,block:f["default"].PropTypes.object.isRequired},getInitialState:function(){return{open:!1}},getMenu:function(){var t=this.props,e=t.app,n=t.block,r=e.pull("blocks",h["default"],n),o=r[0]===n,a=r[r.length-1]===n;return this.state.open?f["default"].createElement(l["default"],{element:"nav",role:"navigation",className:"col-menu",onExit:this._onExit},f["default"].createElement(i["default"],{ref:"moveUp",label:"Move Up",onClick:e.prepare(v.shift,n.id,-1),hide:o}),f["default"].createElement(i["default"],{ref:"moveDown",label:"Move Down",onClick:e.prepare(v.shift,n.id,1),hide:a}),f["default"].createElement(i["default"],{ref:"destroy",label:"Remove",onClick:e.prepare(v.destroy,n.id)})):null},render:function(){return f["default"].createElement("div",{className:"col-toolbar"},f["default"].createElement(a["default"],{ref:"handle",onClick:this._onHandleClick}),this.getMenu())},_onExit:function(){this.setState({open:!1})},_onHandleClick:function(t){t.preventDefault(),this.setState({open:!this.state.open})}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u),s=n(42),l=r(s);e["default"]=i["default"].createClass({displayName:"ToolbarHandle",getDefaultProps:function(){return{label:"Open the menu for this block",type:"button"}},render:function(){var t=this.props,e=t.label,n=o(t,["label"]);return i["default"].createElement("button",a({},n,{className:"col-toolbar-handle"}),i["default"].createElement("span",{className:"col-hidden"},e),i["default"].createElement("span",{"aria-hidden":"true",dangerouslySetInnerHTML:{__html:l["default"]}}))}}),t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]={register:function(t,e,n){var r=e.blocks,o=e.blockTypes;t.replace({blocks:r,blockTypes:o}),n()}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(17),u=r(a),i=n(1),s=r(i);e["default"]={render:function(t,e){s["default"].render(s["default"].createElement(u["default"],o({app:t},t.toObject())),e)},register:function(t,e,n){var r=this,o=e.el;this.render(t,o),t.listen(function(e){return r.render(t,o)}),n()}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(1),u=r(a);e["default"]={getInitialState:function(){return[]},deserialize:function(){var t=void 0===arguments[0]?[]:arguments[0];return t.map(function(t){var e=t.component;return"object"==typeof e&&(e=u["default"].createClass(e)),o({types:[]},t,{component:e})})},serialize:function(){return void 0},toString:function(){return"blockTypes"}},t.exports=e["default"]},function(t,e,n){"use strict";var r,o=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var a=n(3),u=o(a),i=n(8),s=o(i),l=n(29),c=o(l),f=n(32),p=o(f),d=n(9),h=o(d),v=n(33),m=o(v),g=n(10),_=o(g);e["default"]=(r={},r.getInitialState=function(){return[]},r.toString=function(){return"blocks"},r.serialize=n(30),r.deserialize=n(35),r[u["default"].create]=function(t,e){var n=e.type,r=e.parent,o=e.position,a=void 0===o?0:o,u=new s["default"]({parent:r,type:n});return a instanceof s["default"]&&(a=t.indexOf(a)+1),m["default"](t,u,a)},r[u["default"].destroy]=function(t,e){return p["default"](t,e)},r[u["default"].update]=function(t,e){var n=h["default"](t,e.id);return n.content=c["default"](n.content,e.content),t},r[u["default"].shift]=function(t,e){var n=e.id,r=e.delta,o=h["default"](t,n),a=_["default"](t,o),u=a.indexOf(o)+r,i=t.indexOf(a[u]),s=t.filter(function(t){return t!==o});return m["default"](s,o,i)},r),t.exports=e["default"]},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0,e["default"]=function(t,e){return r({},t,e)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){function e(n){var r=t.filter(function(t){return t.parent===n});return{content:n.content,type:n.type,blocks:r.map(e)}}t=t||[];var n=t.filter(function(t){return!t.parent});return n.map(e)}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t.filter(function(t){return t.parent===e})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){return t.filter(function(t){for(var n=t;n;n=n.parent)if(n.id==e)return!1;return!0})},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t,e,n){return Math.max(e,Math.min(n,t))};e["default"]=function(t,e){var n=void 0===arguments[2]?t.length:arguments[2];return function(){var o=r(n,0,t.length),a=t.slice(0,o),u=t.slice(o);return a.concat(e,u)}()},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t){return t.filter(function(t){return!t.parent})},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t=t||[],t.reduce(function(t,n){var o=new i["default"](a({},n,{parent:e})),u=r(n.blocks,o);return t.concat(o,u)},[])}var o=function(t){return t&&t.__esModule?t:{"default":t}},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0,e["default"]=r;var u=n(8),i=o(u);t.exports=e["default"]},function(t,e,n){"use strict";var r=0,o=function(){return"c"+(r+=1)};t.exports=o},,,,function(t,e,n){},function(t,e,n){function r(t){var e=[],n=t;t=t||{};var r=function(){for(var n=0;n<e.length;n++)e[n].apply(t,arguments)};return t.listen=function(t){e=e.concat(t)},t.ignore=function(t){e=e.filter(function(e){return e!==t})},t.emit=function(){r.apply(t,arguments)},t.volley=function(){var o=arguments;e.length>0&&(cancelAnimationFrame(n),n=requestAnimationFrame(function(){r.apply(t,o)}))},t}t.exports=r(),t.exports.decorate=r},function(t,e,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>\n'},function(t,e,n){!function(e,r){t.exports=r(n(1))}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),o=n(2);t.exports=o.createClass({displayName:"exports",mixins:[r],propTypes:{active:o.PropTypes.bool,onExit:o.PropTypes.func.isRequired,role:o.PropTypes.string.isRequired},getDefaultProps:function(){return{active:!0,className:"focus-trap-inner",element:"section",role:"dialog"}},getBackdrop:function(){return o.createElement("div",{className:"focus-trap-backdrop","aria-hidden":!0,onClick:this.props.onExit})},getInner:function(){var t=this.props,e=t.className,n=t.element,r=t.children;return o.createElement(n,{className:e},r)},render:function(){var t=this.props,e=t.active,n=t.role;return e?o.createElement("div",{className:"focus-trap",tabIndex:"0",role:n,onKeyUp:this._onKeyUp},this.getBackdrop(),this.getInner()):null},_onKeyUp:function(t){"Escape"===t.key&&this.props.onExit()}})},function(t,e,n){"use strict";t.exports={_pushFocus:function(){this.setState({previousFocus:document.activeElement}),this._focus()},_popFocus:function(){this.state.previousFocus&&(this.state.previousFocus.focus(),this._clearTrap())},_focus:function(){var t=this.getDOMNode();t&&t.focus()},_trapFocus:function(){this._focusTimer=setTimeout(this._focus,10)},_clearTrap:function(){clearTimeout(this._focusTimer)},componentDidMount:function(){var t=this.getDOMNode();t&&(t.addEventListener("focusin",this._clearTrap),t.addEventListener("focusout",this._trapFocus)),this._pushFocus()},componentWillUnmount:function(){var t=this.getDOMNode();this._popFocus(),t&&(t.removeEventListener("focusin",this._clearTrap),t.removeEventListener("focusout",this._trapFocus))}}},function(e,n,r){e.exports=t}])})},function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(4),a=0,u=n(5),i=n(8),s=n(2),l=n(7),c=i.PropTypes,f=2*Math.PI,p=n(1),d=n(6),h=i.createClass({displayName:"Ink",shouldComponentUpdate:d,propTypes:{background:c.bool,duration:c.number,opacity:c.number,radius:c.number,recenter:c.bool},getDefaultProps:function(){return{background:!0,duration:1e3,opacity:.25,radius:150,recenter:!0}},getInitialState:function(){return{store:l(this.tick),touchEvents:this.touchEvents()}},touchEvents:function(){return o?{onTouchStart:this._onPress,onTouchEnd:this._onRelease,onTouchCancel:this._onRelease,onTouchLeave:this._onRelease}:{onMouseDown:this._onPress,onMouseUp:this._onRelease,onMouseLeave:this._onRelease}},tick:function(){var t=this.state.ctx,e=this.state.color,n=this.state.density,r=this.state.height,o=this.state.width,a=this.state.store;t.save(),t.scale(n,n),t.clearRect(0,0,o,r),t.fillStyle=e,this.props.background&&(t.globalAlpha=a.getTotalOpacity(this.props.opacity),t.fillRect(0,0,o,r)),a.each(this.makeBlot,this),t.restore()},makeBlot:function(t){var e=this.state.ctx,n=this.state.height,r=this.state.width,o=t.x,a=t.y,u=t.radius;if(e.globalAlpha=p.getBlotOpacity(t,this.props.opacity),e.beginPath(),this.props.recenter){var i=Math.max(n,r);o+=p.getBlotShiftX(t,i,r),a+=p.getBlotShiftY(t,i,n)}e.arc(o,a,u*p.getBlotScale(t),0,f),e.closePath(),e.fill()},componentWillUnmount:function(){this.state.store.stop()},pushBlot:function(t,e,n){var r=this,o=this.getDOMNode(),a=o.getBoundingClientRect(),i=a.top,s=a.bottom,l=a.left,c=a.right,f=window.getComputedStyle(o),d=f.color,h=this.state.ctx||o.getContext("2d"),v=this.state.density||u(h),m=s-i,g=c-l,_=p.getMaxRadius(m,g,this.props.radius);this.setState({color:d,ctx:h,density:v,height:m,width:g},function(){r.state.store.add({duration:r.props.duration,mouseDown:t,mouseUp:0,radius:_,x:e-l,y:n-i})})},render:function(){var t=this.state.density,e=this.state.height,n=this.state.width,o=this.state.touchEvents;return i.createElement("canvas",r({className:"ink",style:r({},s,this.props.style),height:e*t,width:n*t,onDragOver:this._onRelease},o))},_onPress:function(t){var e=t.button,n=t.ctrlKey,r=t.clientX,o=t.clientY,u=t.changedTouches,i=Date.now();if(u)for(var s=0;s<u.length;s++){var l=u[s].clientX,c=u[s].clientY;this.pushBlot(i,l,c)}else e!==a||n||this.pushBlot(i,r,o)},_onRelease:function(){this.state.store.release(Date.now())}});t.exports=h},function(t,e,n){"use strict";function r(t){return c(t.duration,Date.now()-t.mouseDown)}function o(t){return t.mouseUp>0?Date.now()-t.mouseUp:0}function a(t){var e=t.duration,n=t.radius,a=.85*u(r(t),0,n,e),i=.15*u(o(t),0,n,e),c=.02*n*s(Date.now()/e);return l(0,a+i+c)}var u=n(3),i=Math.sqrt(2),s=Math.cos,l=Math.max,c=Math.min;t.exports={getMaxRadius:function(t,e,n){return c(.5*l(t,e),n)},getBlotOpacity:function(t,e){return u(o(t),e,-e,t.duration)},getBlotOuterOpacity:function(t,e){return c(this.getBlotOpacity(t,e),u(r(t),0,.3,3*t.duration))},getBlotShiftX:function(t,e,n){return c(1,a(t)/e*2/i)*(n/2-t.x)},getBlotShiftY:function(t,e,n){return c(1,a(t)/e*2/i)*(n/2-t.y)},getBlotScale:function(t){return a(t)/t.radius}}},function(t){"use strict";t.exports={borderRadius:"inherit",height:"100%",left:0,position:"absolute",top:0,width:"100%"}},function(t){"use strict";t.exports=function(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e}},function(t){"use strict";var e=!1;"undefined"!=typeof window&&(e="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),t.exports=e},function(t){"use strict";t.exports=function(t){var e=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/n}},function(t){"use strict";function e(t,e){for(var n in t)if(this.props[n]!==t[n])return!0;for(var r in e)if(this.state[r]!==e[r])return!0;return!1}t.exports=e},function(t,e,n){"use strict";var r=n(1),o=function(t){var e=t.mouseUp,n=t.duration;return!e||Date.now()-e<n};t.exports=function(t){var e=[],n=!1,a=void 0,u={each:function(t,n){for(var r=0,o=e.length;o>r;r++)t.call(n,e[r])},play:function(){n||(n=!0,u.update())},stop:function(){n=!1,cancelAnimationFrame(a)},getTotalOpacity:function(t){for(var n=0,o=0,a=e.length;a>o;o++)n+=r.getBlotOuterOpacity(e[o],t);return n},update:function(){e=e.filter(o),e.length?(a=requestAnimationFrame(u.update),t()):u.stop()},add:function(t){e.push(t),u.play()},release:function(t){for(var n=e.length-1;n>=0;n--)if(!e[n].mouseUp)return e[n].mouseUp=t}};return u}},function(t){t.exports=n(1)}])}]);
module.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0,n(38);var o=n(16),a=r(o);e["default"]=a["default"],t.exports=e["default"]},function(t,e,n){t.exports=require("react")},function(t,e,n){t.exports=require("classnames")},function(t,e,n){"use strict";e.__esModule=!0;var r=n(13);e["default"]=r.tag({create:function(t,e,n){return{type:t,position:e,parent:n}},destroy:function(t){return t},update:function(t,e){return{id:t,content:e}},shift:function(t,e){return{id:t,delta:e}}}),t.exports=e["default"]},,,,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n};e.__esModule=!0;var a=n(1),u=r(a),i=n(42),s=r(i),l=u["default"].createClass({displayName:"Button",getDefaultProps:function(){return{className:"col-btn",hide:!1,tagName:"button",type:"button"}},render:function(){var t=this.props,e=t.children,n=t.hide,r=t.tagName,a=o(t,["children","hide","tagName"]);return n?null:u["default"].createElement(r,a,[u["default"].createElement(s["default"],{key:"__ink__"}),e])}});e["default"]=l,t.exports=e["default"]},,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(1),i=r(u),s=n(22),l=r(s),c=n(21),f=r(c),p=n(2),d=r(p);e["default"]=i["default"].createClass({displayName:"Switch",propTypes:{app:i["default"].PropTypes.object.isRequired},getInitialState:function(){return{open:!1}},componentWillReceiveProps:function(){this.setState({open:!1})},getTypes:function(){var t=this.props,e=t.app,n=t.parent,r=e.pull("blockTypes");if(!n)return r;var o=function(){var t=r.filter(function(t){return t.id===n.type})[0].types;return{v:r.filter(function(e){return t.indexOf(e.id)>-1})}}();return"object"==typeof o?o.v:void 0},render:function(){var t=this.props,e=t.app,n=t.forceOpen,r=t.parent,o=t.position,a=this.getTypes(),u=n||this.state.open;return a.length?i["default"].createElement("div",{className:d["default"]("col-switch",{"col-switch-open":u})},i["default"].createElement(l["default"],{onClick:this._onToggle,secondary:r,hide:u}),i["default"].createElement(f["default"],{app:e,blockTypes:a,parent:r,hide:!u,position:o})):null},_onToggle:function(){var t=this.getTypes();if(1===t.length){var e=this.props,n=e.app,r=e.position,o=e.parent;n.push(a["default"].create,t[0].id,r,o)}this.setState({open:!0})}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};e.__esModule=!0;var a=n(36),u=r(a),i=function(){function t(e){o(this,t),this.id=u["default"](),this.content=e.content,this.parent=e.parent,this.type=e.type}return t.prototype.valueOf=function(){return this.id},t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){var n=void 0===arguments[2]?"id":arguments[2],r=t.filter(function(t){return t[n]==e});if(r.length)return r[0];throw new Error("Unable to find record with "+n+" of "+e)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t.filter(e.parent?function(t){return t.parent===e.parent}:function(t){return!t.parent})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";e.__esModule=!0;var r=n(11);e.tag=r,e["default"]=n(4)},function(t,e,n){"use strict";function r(t,e){if(!t){var n=new Error(e);throw n.framesToPop=1,n}}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){var n=void 0===arguments[2]?{}:arguments[2],r=Object.keys(t);return r.reduce(function(n,r){return n[r]=e(t[r],r),n},n)}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(1),a=r(o);e["default"]={validate:function(t){a["default"]("function"==typeof t,"Action "+t+" is not callable, actions should be functions")}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};e.__esModule=!0;var u=n(3),i=r(u),s=n(12),l=r(s),c=n(5),f=r(c),p=n(6),d=r(p),h=n(1),v=r(h),m=n(7),g=r(m),_=n(8),y=r(_),b=n(9),x=r(b),k=n(2),M=r(k),w=n(10),T=r(w),E=function(){function t(){a(this,t),l["default"].decorate(this),this._state={},this._stores={},this._plugins=[]}return t.prototype.push=function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];i["default"].validate(t);var a=t.apply(void 0,r);return a instanceof Promise?a.then(function(n){return e.dispatch(t,n)}):this.dispatch(t,a)},t.prototype.pull=function(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o];var a=y["default"](this._state,t);return"function"==typeof e?e.call.apply(e,[this,a].concat(r)):a},t.prototype.prepare=function(t){for(var e,n=arguments.length,r=Array(n>1?n-1:0),o=1;n>o;o++)r[o-1]=arguments[o];return i["default"].validate(t),(e=this.push).bind.apply(e,[this,t].concat(r))},t.prototype.replace=function(t){this.commit(this.deserialize(t))},t.prototype.commit=function(t){this._state=t,this.emit()},t.prototype.dispatch=function(t,e){var n=this,r=T["default"](this._stores,function(e){return t in e});return Object.keys(r).length>0&&!function(){var o=g["default"](n._state),a=M["default"](r,function(n){return n[t](o[n],e)},o);n.commit(a)}(),e},t.prototype.addPlugin=function(t,e){f["default"].validate(t),this._plugins.push([t,e])},t.prototype.addStore=function(t){var e=o({},d["default"],t);v["default"](!this._stores[t],'Tried to add "'+t+'" but it is not unique'),this._stores[e]=e},t.prototype.serialize=function(){var t=this;return M["default"](this._stores,function(e){return e.serialize(t.pull(e))})},t.prototype.deserialize=function(){var t=void 0===arguments[0]?{}:arguments[0];return M["default"](this._stores,function(e){return e.deserialize(t[e])})},t.prototype.toJSON=function(){return this.serialize()},t.prototype.toObject=function(){return T["default"](this._state,function(){return!0})},t.prototype.start=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];this._state=M["default"](this._stores,function(t){return t.getInitialState()}),x["default"](this._plugins,this,function(){e.forEach(function(t){return t()})})},t}();e["default"]=E,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(1),a=r(o);e["default"]={validate:function(t){a["default"]("register"in t,"Plugins must have a register method.")}},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]={getInitialState:function(){return void 0},serialize:function(t){return t},deserialize:function(){var t=void 0===arguments[0]?this.getInitialState():arguments[0];return t},toString:function(){throw new Error("Stores must implement a toString() method")}},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t){return Object.create(t)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){for(var n=[].concat(e);n.length;)t=t[""+n.shift()];return t}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){var o=t[0],a=t.slice(1);if(!o)return n();var u=o[0],i=o[1];u.register(e,i,function(t){if(t)throw t;r(a,e,n)})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){var n={};for(var r in t)e(t[r])&&(n[r]=t[r]);return n},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return"function"==typeof t}function o(t,e){var n=t.bind(null),r="_"+e+"_"+s++;return n.toString=function(){return r},n}var a=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var u=n(2),i=a(u),s=0;e["default"]=function(t){return i["default"](t,function(t,e){return r(t)?o(t,e):t})},t.exports=e["default"]},function(t,e,r){t.exports=n(39)}])},function(t,e,n){t.exports=require("react/lib/ReactCSSTransitionGroup")},,function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)};e.__esModule=!0;var u=n(27),i=r(u),s=n(28),l=r(s),c=n(13),f=r(c),p=n(1),d=(r(p),n(25)),h=r(d),v=n(26),m=r(v),g=function(t){function e(n){var r=n.el,a=n.blocks,u=n.blockTypes;o(this,e),t.call(this),this.addStore(l["default"]),this.addStore(i["default"]),this.addPlugin(h["default"],{blocks:a,blockTypes:u}),this.addPlugin(m["default"],{el:r})}return a(e,t),e.prototype.toJSON=function(){return this.serialize().blocks},e}(f["default"]);e["default"]=g,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(14),u=r(a),i=n(19),s=r(i),l=n(1),c=r(l),f=n(9),p=r(f),d=n(34),h=r(d);e["default"]=c["default"].createClass({displayName:"App",propTypes:{app:c["default"].PropTypes.object.isRequired},getBlock:function(t,e){return c["default"].createElement(s["default"],o({key:t.id,block:t},this.props))},render:function(){var t=this.props.app;return c["default"].createElement("div",{className:"colonel"},c["default"].createElement(p["default"],{app:t}),c["default"].createElement(u["default"],{transitionName:"col-editor-block"},t.pull("blocks",h["default"]).map(this.getBlock)))}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(1),i=r(u),s=n(23),l=r(s),c=n(2),f=r(c),p=n(11),d=r(p);e["default"]=i["default"].createClass({displayName:"Block",propTypes:{app:i["default"].PropTypes.object.isRequired,block:i["default"].PropTypes.object.isRequired},getClassName:function(t){return f["default"]("col-block","col-block-"+t)},render:function(){var t=this.props,e=t.app,n=t.block,r=t.children,o=t.first,a=t.last,u=e.pull("blockTypes",d["default"],n.type),s=(u.id,u.component);return i["default"].createElement("div",{className:this.getClassName(n.type)},i["default"].createElement(s,{ref:"block",content:n.content,onChange:this._onChange},r),i["default"].createElement(l["default"],{app:e,block:n,first:o,last:a}))},_onChange:function(t){var e=this.props,n=e.app,r=e.block;n.push(a["default"].update,r,t)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(14),a=r(o),u=n(18),i=r(u),s=n(9),l=r(s),c=n(1),f=r(c),p=n(31),d=r(p),h=f["default"].createClass({displayName:"EditorBlock",propTypes:{app:f["default"].PropTypes.object.isRequired,block:f["default"].PropTypes.object.isRequired},getBlock:function(t,e){return f["default"].createElement(h,{key:t.id,app:this.props.app,block:t})},render:function(){var t=this.props,e=t.app,n=t.block;return f["default"].createElement("div",{className:"col-editor-block"},f["default"].createElement(i["default"],{app:e,block:n},f["default"].createElement(l["default"],{app:e,parent:n}),f["default"].createElement(a["default"],{transitionName:"col-editor-block"},e.pull("blocks",d["default"],n).map(this.getBlock))),f["default"].createElement(l["default"],{app:e,position:n,parent:n.parent}))}});e["default"]=h,t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n};e.__esModule=!0;var a=n(7),u=r(a),i=n(1),s=r(i);e["default"]=s["default"].createClass({displayName:"MenuItem",propTypes:{label:s["default"].PropTypes.string.isRequired,onClick:s["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{className:"col-menu-item",hide:!1,type:"button"}},render:function(){var t=this.props,e=t.hide,n=t.label,r=o(t,["hide","label"]);return e?null:s["default"].createElement(u["default"],r,n)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(3),a=r(o),u=n(7),i=r(u),s=n(1),l=r(s);e["default"]=l["default"].createClass({displayName:"SwitchNav",propTypes:{app:l["default"].PropTypes.object.isRequired,blockTypes:l["default"].PropTypes.array.isRequired},getButton:function(t){var e=this,n=t.id,r=t.label;return l["default"].createElement(i["default"],{key:n,className:"col-switch-btn",onClick:function(){return e._onAdd(n)}},r)},render:function(){var t=this.props,e=(t.app,t.blockTypes),n=t.hide;return n?null:l["default"].createElement("nav",{className:"col-switch-nav",role:"navigation"},e.map(this.getButton))},_onAdd:function(t){var e=this.props,n=e.app,r=e.position,o=e.parent;n.push(a["default"].create,t,r,o)}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(7),a=r(o),u=n(1),i=r(u),s=n(2),l=r(s);e["default"]=i["default"].createClass({displayName:"SwitchToggle",propTypes:{onClick:i["default"].PropTypes.func.isRequired},getDefaultProps:function(){return{label:"Open block creation menu",hide:!1,secondary:!1,symbol:"+"}},render:function(){var t=this.props,e=t.label,n=t.hide,r=t.onClick,o=t.secondary,u=t.symbol,s=l["default"]("col-btn-fab",{"col-btn-fab-secondary":o});return i["default"].createElement(a["default"],{ref:"toggle",className:s,onClick:r,hide:n},i["default"].createElement("span",{className:"col-hidden"},e),i["default"].createElement("span",{"aria-hidden":"true"},u))}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var o=n(24),a=r(o),u=n(20),i=r(u),s=n(41),l=r(s),c=n(1),f=r(c),p=n(2),d=(r(p),n(12)),h=r(d),v=n(3);e["default"]=f["default"].createClass({displayName:"Toolbar",propTypes:{app:f["default"].PropTypes.object.isRequired,block:f["default"].PropTypes.object.isRequired},getInitialState:function(){return{open:!1}},getMenu:function(){var t=this.props,e=t.app,n=t.block,r=e.pull("blocks",h["default"],n),o=r[0]===n,a=r[r.length-1]===n;return this.state.open?f["default"].createElement(l["default"],{element:"nav",role:"navigation",className:"col-menu",onExit:this._onExit},f["default"].createElement(i["default"],{ref:"moveUp",label:"Move Up",onClick:e.prepare(v.shift,n.id,-1),hide:o}),f["default"].createElement(i["default"],{ref:"moveDown",label:"Move Down",onClick:e.prepare(v.shift,n.id,1),hide:a}),f["default"].createElement(i["default"],{ref:"destroy",label:"Remove",onClick:e.prepare(v.destroy,n.id)})):null},render:function(){return f["default"].createElement("div",{className:"col-toolbar"},f["default"].createElement(a["default"],{ref:"handle",onClick:this._onHandleClick}),this.getMenu())},_onExit:function(){this.setState({open:!1})},_onHandleClick:function(t){t.preventDefault(),this.setState({open:!this.state.open})}}),t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var u=n(1),i=r(u),s=n(40),l=r(s);e["default"]=i["default"].createClass({displayName:"ToolbarHandle",getDefaultProps:function(){return{label:"Open the menu for this block",type:"button"}},render:function(){var t=this.props,e=t.label,n=o(t,["label"]);return i["default"].createElement("button",a({},n,{className:"col-toolbar-handle"}),i["default"].createElement("span",{className:"col-hidden"},e),i["default"].createElement("span",{"aria-hidden":"true",dangerouslySetInnerHTML:{__html:l["default"]}}))}}),t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]={register:function(t,e,n){var r=e.blocks,o=e.blockTypes;t.replace({blocks:r,blockTypes:o}),n()}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(17),u=r(a),i=n(1),s=r(i);e["default"]={render:function(t,e){s["default"].render(s["default"].createElement(u["default"],o({app:t},t.toObject())),e)},register:function(t,e,n){var r=this,o=e.el;this.render(t,o),t.listen(function(e){return r.render(t,o)}),n()}},t.exports=e["default"]},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{"default":t}},o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0;var a=n(1),u=r(a);e["default"]={getInitialState:function(){return[]},deserialize:function(){var t=void 0===arguments[0]?[]:arguments[0];return t.map(function(t){var e=t.component;return"object"==typeof e&&(e=u["default"].createClass(e)),o({types:[]},t,{component:e})})},serialize:function(){return void 0},toString:function(){return"blockTypes"}},t.exports=e["default"]},function(t,e,n){"use strict";var r,o=function(t){return t&&t.__esModule?t:{"default":t}};e.__esModule=!0;var a=n(3),u=o(a),i=n(10),s=o(i),l=n(29),c=o(l),f=n(32),p=o(f),d=n(11),h=o(d),v=n(33),m=o(v),g=n(12),_=o(g);e["default"]=(r={},r.getInitialState=function(){return[]},r.toString=function(){return"blocks"},r.serialize=n(30),r.deserialize=n(35),r[u["default"].create]=function(t,e){var n=e.type,r=e.parent,o=e.position,a=void 0===o?0:o,u=new s["default"]({parent:r,type:n});return a instanceof s["default"]&&(a=t.indexOf(a)+1),m["default"](t,u,a)},r[u["default"].destroy]=function(t,e){return p["default"](t,e)},r[u["default"].update]=function(t,e){var n=h["default"](t,e.id);return n.content=c["default"](n.content,e.content),t},r[u["default"].shift]=function(t,e){var n=e.id,r=e.delta,o=h["default"](t,n),a=_["default"](t,o),u=a.indexOf(o)+r,i=t.indexOf(a[u]),s=t.filter(function(t){return t!==o});return m["default"](s,o,i)},r),t.exports=e["default"]},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0,e["default"]=function(t,e){return r({},t,e)},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){function e(n){var r=t.filter(function(t){return t.parent===n});return{content:n.content,type:n.type,blocks:r.map(e)}}t=t||[];var n=t.filter(function(t){return!t.parent});return n.map(e)}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t.filter(function(t){return t.parent===e})}e.__esModule=!0,e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t,e){return t.filter(function(t){for(var n=t;n;n=n.parent)if(n.id==e)return!1;return!0})},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t,e,n){return Math.max(e,Math.min(n,t))};e["default"]=function(t,e){var n=void 0===arguments[2]?t.length:arguments[2];return function(){var o=r(n,0,t.length),a=t.slice(0,o),u=t.slice(o);return a.concat(e,u)}()},t.exports=e["default"]},function(t,e,n){"use strict";e.__esModule=!0,e["default"]=function(t){return t.filter(function(t){return!t.parent})},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e){return t=t||[],t.reduce(function(t,n){var o=new i["default"](a({},n,{parent:e})),u=r(n.blocks,o);return t.concat(o,u)},[])}var o=function(t){return t&&t.__esModule?t:{"default":t}},a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.__esModule=!0,e["default"]=r;var u=n(10),i=o(u);t.exports=e["default"]},function(t,e,n){"use strict";var r=0,o=function(){return"c"+(r+=1)};t.exports=o},,function(t,e,n){},function(t,e,n){function r(t){var e=[],n=t;t=t||{};var r=function(){for(var n=0;n<e.length;n++)e[n].apply(t,arguments)};return t.listen=function(t){e=e.concat(t)},t.ignore=function(t){e=e.filter(function(e){return e!==t})},t.emit=function(){r.apply(t,arguments)},t.volley=function(){var o=arguments;e.length>0&&(cancelAnimationFrame(n),n=requestAnimationFrame(function(){r.apply(t,o)}))},t}t.exports=r(),t.exports.decorate=r},function(t,e,n){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>\n'},function(t,e,n){!function(e,r){t.exports=r(n(1))}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),o=n(2);t.exports=o.createClass({displayName:"exports",mixins:[r],propTypes:{active:o.PropTypes.bool,onExit:o.PropTypes.func.isRequired,role:o.PropTypes.string.isRequired},getDefaultProps:function(){return{active:!0,className:"focus-trap-inner",element:"section",role:"dialog"}},getBackdrop:function(){return o.createElement("div",{className:"focus-trap-backdrop","aria-hidden":!0,onClick:this.props.onExit})},getInner:function(){var t=this.props,e=t.className,n=t.element,r=t.children;return o.createElement(n,{className:e},r)},render:function(){var t=this.props,e=t.active,n=t.role;return e?o.createElement("div",{className:"focus-trap",tabIndex:"0",role:n,onKeyUp:this._onKeyUp},this.getBackdrop(),this.getInner()):null},_onKeyUp:function(t){"Escape"===t.key&&this.props.onExit()}})},function(t,e,n){"use strict";t.exports={_pushFocus:function(){this.setState({previousFocus:document.activeElement}),this._focus()},_popFocus:function(){this.state.previousFocus&&(this.state.previousFocus.focus(),this._clearTrap())},_focus:function(){var t=this.getDOMNode();t&&t.focus()},_trapFocus:function(){this._focusTimer=setTimeout(this._focus,10)},_clearTrap:function(){clearTimeout(this._focusTimer)},componentDidMount:function(){var t=this.getDOMNode();t&&(t.addEventListener("focusin",this._clearTrap),t.addEventListener("focusout",this._trapFocus)),this._pushFocus()},componentWillUnmount:function(){var t=this.getDOMNode();this._popFocus(),t&&(t.removeEventListener("focusin",this._clearTrap),t.removeEventListener("focusout",this._trapFocus))}}},function(e,n,r){e.exports=t}])})},function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(4),a=0,u=n(5),i=n(8),s=n(2),l=n(7),c=i.PropTypes,f=2*Math.PI,p=n(1),d=n(6),h=i.createClass({displayName:"Ink",shouldComponentUpdate:d,propTypes:{background:c.bool,duration:c.number,opacity:c.number,radius:c.number,recenter:c.bool},getDefaultProps:function(){return{background:!0,duration:1e3,opacity:.25,radius:150,recenter:!0}},getInitialState:function(){return{store:l(this.tick),touchEvents:this.touchEvents()}},touchEvents:function(){return o?{onTouchStart:this._onPress,onTouchEnd:this._onRelease,onTouchCancel:this._onRelease,onTouchLeave:this._onRelease}:{onMouseDown:this._onPress,onMouseUp:this._onRelease,onMouseLeave:this._onRelease}},tick:function(){var t=this.state.ctx,e=this.state.color,n=this.state.density,r=this.state.height,o=this.state.width,a=this.state.store;t.save(),t.scale(n,n),t.clearRect(0,0,o,r),t.fillStyle=e,this.props.background&&(t.globalAlpha=a.getTotalOpacity(this.props.opacity),t.fillRect(0,0,o,r)),a.each(this.makeBlot,this),t.restore()},makeBlot:function(t){var e=this.state.ctx,n=this.state.height,r=this.state.width,o=t.x,a=t.y,u=t.radius;if(e.globalAlpha=p.getBlotOpacity(t,this.props.opacity),e.beginPath(),this.props.recenter){var i=Math.max(n,r);o+=p.getBlotShiftX(t,i,r),a+=p.getBlotShiftY(t,i,n)}e.arc(o,a,u*p.getBlotScale(t),0,f),e.closePath(),e.fill()},componentWillUnmount:function(){this.state.store.stop()},pushBlot:function(t,e,n){var r=this,o=this.getDOMNode(),a=o.getBoundingClientRect(),i=a.top,s=a.bottom,l=a.left,c=a.right,f=window.getComputedStyle(o),d=f.color,h=this.state.ctx||o.getContext("2d"),v=this.state.density||u(h),m=s-i,g=c-l,_=p.getMaxRadius(m,g,this.props.radius);this.setState({color:d,ctx:h,density:v,height:m,width:g},function(){r.state.store.add({duration:r.props.duration,mouseDown:t,mouseUp:0,radius:_,x:e-l,y:n-i})})},render:function(){var t=this.state.density,e=this.state.height,n=this.state.width,o=this.state.touchEvents;return i.createElement("canvas",r({className:"ink",style:r({},s,this.props.style),height:e*t,width:n*t,onDragOver:this._onRelease},o))},_onPress:function(t){var e=t.button,n=t.ctrlKey,r=t.clientX,o=t.clientY,u=t.changedTouches,i=Date.now();if(u)for(var s=0;s<u.length;s++){var l=u[s].clientX,c=u[s].clientY;this.pushBlot(i,l,c)}else e!==a||n||this.pushBlot(i,r,o)},_onRelease:function(){this.state.store.release(Date.now())}});t.exports=h},function(t,e,n){"use strict";function r(t){return c(t.duration,Date.now()-t.mouseDown)}function o(t){return t.mouseUp>0?Date.now()-t.mouseUp:0}function a(t){var e=t.duration,n=t.radius,a=.85*u(r(t),0,n,e),i=.15*u(o(t),0,n,e),c=.02*n*s(Date.now()/e);return l(0,a+i+c)}var u=n(3),i=Math.sqrt(2),s=Math.cos,l=Math.max,c=Math.min;t.exports={getMaxRadius:function(t,e,n){return c(.5*l(t,e),n)},getBlotOpacity:function(t,e){return u(o(t),e,-e,t.duration)},getBlotOuterOpacity:function(t,e){return c(this.getBlotOpacity(t,e),u(r(t),0,.3,3*t.duration))},getBlotShiftX:function(t,e,n){return c(1,a(t)/e*2/i)*(n/2-t.x)},getBlotShiftY:function(t,e,n){return c(1,a(t)/e*2/i)*(n/2-t.y)},getBlotScale:function(t){return a(t)/t.radius}}},function(t){"use strict";t.exports={borderRadius:"inherit",height:"100%",left:0,position:"absolute",top:0,width:"100%"}},function(t){"use strict";t.exports=function(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e}},function(t){"use strict";var e=!1;"undefined"!=typeof window&&(e="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),t.exports=e},function(t){"use strict";t.exports=function(t){var e=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/n}},function(t){"use strict";function e(t,e){for(var n in t)if(this.props[n]!==t[n])return!0;for(var r in e)if(this.state[r]!==e[r])return!0;return!1}t.exports=e},function(t,e,n){"use strict";var r=n(1),o=function(t){var e=t.mouseUp,n=t.duration;return!e||Date.now()-e<n};t.exports=function(t){var e=[],n=!1,a=void 0,u={each:function(t,n){for(var r=0,o=e.length;o>r;r++)t.call(n,e[r])},play:function(){n||(n=!0,u.update())},stop:function(){n=!1,cancelAnimationFrame(a)},getTotalOpacity:function(t){for(var n=0,o=0,a=e.length;a>o;o++)n+=r.getBlotOuterOpacity(e[o],t);return n},update:function(){e=e.filter(o),e.length?(a=requestAnimationFrame(u.update),t()):u.stop()},add:function(t){e.push(t),u.play()},release:function(t){for(var n=e.length-1;n>=0;n--)if(!e[n].mouseUp)return e[n].mouseUp=t}};return u}},function(t){t.exports=n(1)}])}]);
//# sourceMappingURL=colonel-kurtz.js.map
# Changelog
## 2.4.0
- Set up more sharing between Youtube and Image addons
- Improve animations of Image and Youtube UI
## 2.3.0

@@ -4,0 +9,0 @@

{
"name": "colonel-kurtz",
"version": "2.3.0",
"version": "2.4.0",
"description": "A block editor",

@@ -5,0 +5,0 @@ "main": "build/colonel-kurtz.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc