diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 588a36222..813329e5f 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1,13233 @@ -!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=22)}([function(e,t){e.exports=React},function(e,t){e.exports=Injector},function(e,t){e.exports=i18n},function(e,t){e.exports=classnames},function(e,t){e.exports=Redux},function(e,t){e.exports=GraphQLTag},function(e,t){e.exports=ReactApollo},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0?e+"px":null}function a(){return document.body.clientWidth0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;return t?e.split(" ").map(function(e){return t[e]||e}).join(" "):e}function c(e,t){var n={};return Object.keys(e).forEach(function(o){-1===t.indexOf(o)&&(n[o]=e[o])}),n}function p(e,t){for(var n=Array.isArray(t)?t:[t],o=n.length,r=void 0,a={};o>0;)o-=1,r=n[o],a[r]=e[r];return a}function d(e){$[e]||("undefined"!=typeof console&&console.error(e),$[e]=!0)}function f(e,t){return function(n,o,r){null!==n[o]&&void 0!==n[o]&&d('"'+o+'" property of "'+r+'" has been deprecated.\n'+t);for(var a=arguments.length,i=Array(a>3?a-3:0),s=3;s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},ae=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},ie={tag:j.a.oneOfType([j.a.func,j.a.string]),fluid:j.a.bool,className:j.a.string,cssModule:j.a.object},se={tag:"div"},le=function(e){var t=e.className,n=e.cssModule,o=e.fluid,r=e.tag,a=re(e,["className","cssModule","fluid","tag"]),i=u(S()(t,o?"container-fluid":"container"),n);return x.a.createElement(r,ne({},a,{className:i}))};le.propTypes=ie,le.defaultProps=se;var ue={tag:j.a.oneOfType([j.a.func,j.a.string]),noGutters:j.a.bool,className:j.a.string,cssModule:j.a.object},ce={tag:"div"},pe=function(e){var t=e.className,n=e.cssModule,o=e.noGutters,r=e.tag,a=re(e,["className","cssModule","noGutters","tag"]),i=u(S()(t,o?"no-gutters":null,"row"),n);return x.a.createElement(r,ne({},a,{className:i}))};pe.propTypes=ue,pe.defaultProps=ce;var de=["xs","sm","md","lg","xl"],fe=j.a.oneOfType([j.a.number,j.a.string]),me=j.a.oneOfType([j.a.bool,j.a.number,j.a.string,j.a.shape({size:j.a.oneOfType([j.a.bool,j.a.number,j.a.string]),push:f(fe,'Please use the prop "order"'),pull:f(fe,'Please use the prop "order"'),order:fe,offset:fe})]),he={tag:j.a.oneOfType([j.a.func,j.a.string]),xs:me,sm:me,md:me,lg:me,xl:me,className:j.a.string,cssModule:j.a.object,widths:j.a.array},ge={tag:"div",widths:de},ve=function(e,t,n){return!0===n||""===n?e?"col":"col-"+t:"auto"===n?e?"col-auto":"col-"+t+"-auto":e?"col-"+n:"col-"+t+"-"+n},be=function(e){var t=e.className,n=e.cssModule,o=e.widths,r=e.tag,a=re(e,["className","cssModule","widths","tag"]),i=[];o.forEach(function(t,o){var r=e[t];if(delete a[t],r||""===r){var s=!o;if(L()(r)){var l,c=s?"-":"-"+t+"-",p=ve(s,t,r.size);i.push(u(S()((l={},te(l,p,r.size||""===r.size),te(l,"order"+c+r.order,r.order||0===r.order),te(l,"offset"+c+r.offset,r.offset||0===r.offset),l)),n))}else{var d=ve(s,t,r);i.push(d)}}}),i.length||i.push("col");var s=u(S()(t,i),n);return x.a.createElement(r,ne({},a,{className:s}))};be.propTypes=he,be.defaultProps=ge;var ye={light:j.a.bool,dark:j.a.bool,inverse:f(j.a.bool,'Please use the prop "dark"'),full:j.a.bool,fixed:j.a.string,sticky:j.a.string,color:j.a.string,role:j.a.string,tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object,toggleable:f(j.a.oneOfType([j.a.bool,j.a.string]),'Please use the prop "expand"'),expand:j.a.oneOfType([j.a.bool,j.a.string])},Ee={tag:"nav",expand:!1},Te=function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)},Oe={xs:"sm",sm:"md",md:"lg",lg:"xl"},_e=function(e){return void 0!==e&&"xl"!==e&&(!1===e?"navbar-expand":"navbar-expand-"+(!0===e?"sm":Oe[e]||e))},Ne=function(e){var t,n=e.toggleable,o=e.expand,r=e.className,a=e.cssModule,i=e.light,s=e.dark,l=e.inverse,c=e.fixed,p=e.sticky,d=e.color,f=e.tag,m=re(e,["toggleable","expand","className","cssModule","light","dark","inverse","fixed","sticky","color","tag"]),h=u(S()(r,"navbar",Te(o)||_e(n),(t={"navbar-light":i,"navbar-dark":l||s},te(t,"bg-"+d,d),te(t,"fixed-"+c,c),te(t,"sticky-"+p,p),t)),a);return x.a.createElement(f,ne({},m,{className:h}))};Ne.propTypes=ye,Ne.defaultProps=Ee;var Pe={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},ke={tag:"a"},we=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"navbar-brand"),n);return x.a.createElement(o,ne({},r,{className:a}))};we.propTypes=Pe,we.defaultProps=ke;var Ce={tag:j.a.oneOfType([j.a.func,j.a.string]),type:j.a.string,className:j.a.string,cssModule:j.a.object,children:j.a.node},xe={tag:"button",type:"button"},Me=function(e){var t=e.className,n=e.cssModule,o=e.children,r=e.tag,a=re(e,["className","cssModule","children","tag"]),i=u(S()(t,"navbar-toggler"),n);return x.a.createElement(r,ne({},a,{className:i}),o||x.a.createElement("span",{className:u("navbar-toggler-icon",n)}))};Me.propTypes=Ce,Me.defaultProps=xe;var je={tabs:j.a.bool,pills:j.a.bool,vertical:j.a.oneOfType([j.a.bool,j.a.string]),horizontal:j.a.string,justified:j.a.bool,fill:j.a.bool,navbar:j.a.bool,card:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Ie={tag:"ul",vertical:!1},Se=function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")},Ae=function(e){var t=e.className,n=e.cssModule,o=e.tabs,r=e.pills,a=e.vertical,i=e.horizontal,s=e.justified,l=e.fill,c=e.navbar,p=e.card,d=e.tag,f=re(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),m=u(S()(t,c?"navbar-nav":"nav",!!i&&"justify-content-"+i,Se(a),{"nav-tabs":o,"card-header-tabs":p&&o,"nav-pills":r,"card-header-pills":p&&r,"nav-justified":s,"nav-fill":l}),n);return x.a.createElement(d,ne({},f,{className:m}))};Ae.propTypes=je,Ae.defaultProps=Ie;var De={tag:j.a.oneOfType([j.a.func,j.a.string]),active:j.a.bool,className:j.a.string,cssModule:j.a.object},Re={tag:"li"},Le=function(e){var t=e.className,n=e.cssModule,o=e.active,r=e.tag,a=re(e,["className","cssModule","active","tag"]),i=u(S()(t,"nav-item",!!o&&"active"),n);return x.a.createElement(r,ne({},a,{className:i}))};Le.propTypes=De,Le.defaultProps=Re;var Be={disabled:j.a.bool,dropup:f(j.a.bool,'Please use the prop "direction" with the value "up".'),direction:j.a.oneOf(["up","down","left","right"]),group:j.a.bool,isOpen:j.a.bool,nav:j.a.bool,active:j.a.bool,addonType:j.a.oneOfType([j.a.bool,j.a.oneOf(["prepend","append"])]),size:j.a.string,tag:j.a.string,toggle:j.a.func,children:j.a.node,className:j.a.string,cssModule:j.a.object,inNavbar:j.a.bool},Fe={isOpen:!1,direction:"down",nav:!1,active:!1,addonType:!1,inNavbar:!1},He={toggle:j.a.func.isRequired,isOpen:j.a.bool.isRequired,direction:j.a.oneOf(["up","down","left","right"]).isRequired,inNavbar:j.a.bool.isRequired},Ve=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.addEvents=n.addEvents.bind(n),n.handleDocumentClick=n.handleDocumentClick.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.removeEvents=n.removeEvents.bind(n),n.toggle=n.toggle.bind(n),n}return oe(t,e),ee(t,[{key:"getChildContext",value:function(){return{toggle:this.props.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar}}},{key:"componentDidMount",value:function(){this.handleProps()}},{key:"componentDidUpdate",value:function(e){this.props.isOpen!==e.isOpen&&this.handleProps()}},{key:"componentWillUnmount",value:function(){this.removeEvents()}},{key:"getContainer",value:function(){return F.a.findDOMNode(this)}},{key:"addEvents",value:function(){var e=this;["click","touchstart","keyup"].forEach(function(t){return document.addEventListener(t,e.handleDocumentClick,!0)})}},{key:"removeEvents",value:function(){var e=this;["click","touchstart","keyup"].forEach(function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)})}},{key:"handleDocumentClick",value:function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===K.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==K.tab)&&this.toggle(e)}}},{key:"handleKeyDown",value:function(e){if(!(-1===[K.esc,K.up,K.down,K.space].indexOf(e.which)||/button/i.test(e.target.tagName)&&e.which===K.space||/input|textarea/i.test(e.target.tagName)||(e.preventDefault(),this.props.disabled))){var t=this.getContainer();if(e.which===K.space&&this.props.isOpen&&t!==e.target&&e.target.click(),e.which===K.esc||!this.props.isOpen)return this.toggle(e),void t.querySelector("[aria-expanded]").focus();var n=u("dropdown-menu",this.props.cssModule),o=u("dropdown-item",this.props.cssModule),r=u("disabled",this.props.cssModule),a=t.querySelectorAll("."+n+" ."+o+":not(."+r+")");if(a.length){for(var i=-1,s=0;s0&&(i-=1),e.which===K.down&&i=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":J(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":J(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(){}t.__esModule=!0,t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(j.a),u=n(x.a),c=n(F.a),p=t.UNMOUNTED="unmounted",d=t.EXITED="exited",f=t.ENTERING="entering",m=t.ENTERED="entered",h=t.EXITING="exiting",g=function(e){function t(n,o){r(this,t);var i=a(this,e.call(this,n,o)),s=o.transitionGroup,l=s&&!s.isMounting?n.enter:n.appear,u=void 0;return i.nextStatus=null,n.in?l?(u=d,i.nextStatus=f):u=m:u=n.unmountOnExit||n.mountOnEnter?p:d,i.state={status:u},i.nextCallback=null,i}return i(t,e),t.prototype.getChildContext=function(){return{transitionGroup:null}},t.prototype.componentDidMount=function(){this.updateStatus(!0)},t.prototype.componentWillReceiveProps=function(e){var t=this.pendingState||this.state,n=t.status;e.in?(n===p&&this.setState({status:d}),n!==f&&n!==m&&(this.nextStatus=f)):n!==f&&n!==m||(this.nextStatus=h)},t.prototype.componentDidUpdate=function(){this.updateStatus()},t.prototype.componentWillUnmount=function(){this.cancelNextCallback()},t.prototype.getTimeouts=function(){var e=this.props.timeout,t=void 0,n=void 0,o=void 0;return t=n=o=e,null!=e&&"number"!=typeof e&&(t=e.exit,n=e.enter,o=e.appear),{exit:t,enter:n,appear:o}},t.prototype.updateStatus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nextStatus;if(null!==t){this.nextStatus=null,this.cancelNextCallback();var n=c.default.findDOMNode(this);t===f?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===d&&this.setState({status:p})},t.prototype.performEnter=function(e,t){var n=this,o=this.props.enter,r=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts();if(!t&&!o)return void this.safeSetState({status:m},function(){n.props.onEntered(e)});this.props.onEnter(e,r),this.safeSetState({status:f},function(){n.props.onEntering(e,r),n.onTransitionEnd(e,a.enter,function(){n.safeSetState({status:m},function(){n.props.onEntered(e,r)})})})},t.prototype.performExit=function(e){var t=this,n=this.props.exit,o=this.getTimeouts();if(!n)return void this.safeSetState({status:d},function(){t.props.onExited(e)});this.props.onExit(e),this.safeSetState({status:h},function(){t.props.onExiting(e),t.onTransitionEnd(e,o.exit,function(){t.safeSetState({status:d},function(){t.props.onExited(e)})})})},t.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.prototype.safeSetState=function(e,t){var n=this;this.pendingState=e,t=this.setNextCallback(t),this.setState(e,function(){n.pendingState=null,t()})},t.prototype.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},t.prototype.onTransitionEnd=function(e,t,n){this.setNextCallback(n),e?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},t.prototype.render=function(){var e=this.state.status;if(e===p)return null;var t=this.props,n=t.children,r=o(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=u.default.Children.only(n);return u.default.cloneElement(a,r)},t}(u.default.Component);g.contextTypes={transitionGroup:l.object},g.childContextTypes={transitionGroup:function(){}},g.propTypes={},g.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:s,onEntering:s,onEntered:s,onExit:s,onExiting:s,onExited:s},g.UNMOUNTED=0,g.EXITED=1,g.ENTERING=2,g.ENTERED=3,g.EXITING=4,t.default=g}),_t=v(Ot),Nt=ne({},_t.propTypes,{children:j.a.oneOfType([j.a.arrayOf(j.a.node),j.a.node]),tag:j.a.oneOfType([j.a.string,j.a.func]),baseClass:j.a.string,baseClassActive:j.a.string,className:j.a.string,cssModule:j.a.object}),Pt=ne({},_t.defaultProps,{tag:"div",baseClass:"fade",baseClassActive:"show",timeout:z.Fade,appear:!0,enter:!0,exit:!0,in:!0});y.propTypes=Nt,y.defaultProps=Pt;var kt={color:j.a.string,pill:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),children:j.a.node,className:j.a.string,cssModule:j.a.object},wt={color:"secondary",pill:!1,tag:"span"},Ct=function(e){var t=e.className,n=e.cssModule,o=e.color,r=e.pill,a=e.tag,i=re(e,["className","cssModule","color","pill","tag"]),s=u(S()(t,"badge","badge-"+o,!!r&&"badge-pill"),n);return i.href&&"span"===a&&(a="a"),x.a.createElement(a,ne({},i,{className:s}))};Ct.propTypes=kt,Ct.defaultProps=wt;var xt={tag:j.a.oneOfType([j.a.func,j.a.string]),inverse:j.a.bool,color:j.a.string,block:f(j.a.bool,'Please use the props "body"'),body:j.a.bool,outline:j.a.bool,className:j.a.string,cssModule:j.a.object},Mt={tag:"div"},jt=function(e){var t=e.className,n=e.cssModule,o=e.color,r=e.block,a=e.body,i=e.inverse,s=e.outline,l=e.tag,c=re(e,["className","cssModule","color","block","body","inverse","outline","tag"]),p=u(S()(t,"card",!!i&&"text-white",!(!r&&!a)&&"card-body",!!o&&(s?"border":"bg")+"-"+o),n);return x.a.createElement(l,ne({},c,{className:p}))};jt.propTypes=xt,jt.defaultProps=Mt;var It={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},St={tag:"div"},At=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-group"),n);return x.a.createElement(o,ne({},r,{className:a}))};At.propTypes=It,At.defaultProps=St;var Dt={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Rt={tag:"div"},Lt=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-deck"),n);return x.a.createElement(o,ne({},r,{className:a}))};Lt.propTypes=Dt,Lt.defaultProps=Rt;var Bt={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Ft={tag:"div"},Ht=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-columns"),n);return x.a.createElement(o,ne({},r,{className:a}))};Ht.propTypes=Bt,Ht.defaultProps=Ft;var Vt={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Ut={tag:"div"},qt=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-body"),n);return x.a.createElement(o,ne({},r,{className:a}))};qt.propTypes=Vt,qt.defaultProps=Ut;var $t={tag:j.a.oneOfType([j.a.func,j.a.string]),innerRef:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},zt={tag:"a"},Wt=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.innerRef,a=re(e,["className","cssModule","tag","innerRef"]),i=u(S()(t,"card-link"),n);return x.a.createElement(o,ne({},a,{ref:r,className:i}))};Wt.propTypes=$t,Wt.defaultProps=zt;var Gt={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Kt={tag:"div"},Qt=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-footer"),n);return x.a.createElement(o,ne({},r,{className:a}))};Qt.propTypes=Gt,Qt.defaultProps=Kt;var Xt={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Yt={tag:"div"},Jt=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-header"),n);return x.a.createElement(o,ne({},r,{className:a}))};Jt.propTypes=Xt,Jt.defaultProps=Yt;var Zt={tag:j.a.oneOfType([j.a.func,j.a.string]),top:j.a.bool,bottom:j.a.bool,className:j.a.string,cssModule:j.a.object},en={tag:"img"},tn=function(e){var t=e.className,n=e.cssModule,o=e.top,r=e.bottom,a=e.tag,i=re(e,["className","cssModule","top","bottom","tag"]),s="card-img";o&&(s="card-img-top"),r&&(s="card-img-bottom");var l=u(S()(t,s),n);return x.a.createElement(a,ne({},i,{className:l}))};tn.propTypes=Zt,tn.defaultProps=en;var nn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},on={tag:"div"},rn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-img-overlay"),n);return x.a.createElement(o,ne({},r,{className:a}))};rn.propTypes=nn,rn.defaultProps=on;var an=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={startAnimation:!1},n.onEnter=n.onEnter.bind(n),n.onEntering=n.onEntering.bind(n),n.onExit=n.onExit.bind(n),n.onExiting=n.onExiting.bind(n),n.onExited=n.onExited.bind(n),n}return oe(t,e),ee(t,[{key:"onEnter",value:function(e,t){this.setState({startAnimation:!1}),this.props.onEnter(e,t)}},{key:"onEntering",value:function(e,t){var n=e.offsetHeight;return this.setState({startAnimation:!0}),this.props.onEntering(e,t),n}},{key:"onExit",value:function(e){this.setState({startAnimation:!1}),this.props.onExit(e)}},{key:"onExiting",value:function(e){this.setState({startAnimation:!0}),e.dispatchEvent(new CustomEvent("slide.bs.carousel")),this.props.onExiting(e)}},{key:"onExited",value:function(e){e.dispatchEvent(new CustomEvent("slid.bs.carousel")),this.props.onExited(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.in,o=t.children,r=t.cssModule,a=t.slide,i=t.tag,s=t.className,l=re(t,["in","children","cssModule","slide","tag","className"]);return x.a.createElement(_t,ne({},l,{enter:a,exit:a,in:n,onEnter:this.onEnter,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(t){var n=e.context.direction,a=t===G.ENTERED||t===G.EXITING,l=(t===G.ENTERING||t===G.EXITING)&&e.state.startAnimation&&("right"===n?"carousel-item-left":"carousel-item-right"),c=t===G.ENTERING&&("right"===n?"carousel-item-next":"carousel-item-prev"),p=u(S()(s,"carousel-item",a&&"active",l,c),r);return x.a.createElement(i,{className:p},o)})}}]),t}(x.a.Component);an.propTypes=ne({},_t.propTypes,{tag:j.a.oneOfType([j.a.func,j.a.string]),in:j.a.bool,cssModule:j.a.object,children:j.a.node,slide:j.a.bool,className:j.a.string}),an.defaultProps=ne({},_t.defaultProps,{tag:"div",timeout:z.Carousel,slide:!0}),an.contextTypes={direction:j.a.string};var sn=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleKeyPress=n.handleKeyPress.bind(n),n.renderItems=n.renderItems.bind(n),n.hoverStart=n.hoverStart.bind(n),n.hoverEnd=n.hoverEnd.bind(n),n.state={direction:"right",indicatorClicked:!1},n}return oe(t,e),ee(t,[{key:"getChildContext",value:function(){return{direction:this.state.direction}}},{key:"componentDidMount",value:function(){"carousel"===this.props.ride&&this.setInterval(),document.addEventListener("keyup",this.handleKeyPress)}},{key:"componentWillReceiveProps",value:function(e){this.setInterval(e),this.props.activeIndex+1===e.activeIndex?this.setState({direction:"right"}):this.props.activeIndex-1===e.activeIndex?this.setState({direction:"left"}):this.props.activeIndex>e.activeIndex?this.setState({direction:this.state.indicatorClicked?"left":"right"}):this.props.activeIndex!==e.activeIndex&&this.setState({direction:this.state.indicatorClicked?"right":"left"}),this.setState({indicatorClicked:!1})}},{key:"componentWillUnmount",value:function(){this.clearInterval(),document.removeEventListener("keyup",this.handleKeyPress)}},{key:"setInterval",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.clearInterval(),e.interval&&(this.cycleInterval=setInterval(function(){e.next()},parseInt(e.interval,10)))})},{key:"clearInterval",value:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){clearInterval(this.cycleInterval)})},{key:"hoverStart",value:function(){if("hover"===this.props.pause&&this.clearInterval(),this.props.mouseEnter){var e;(e=this.props).mouseEnter.apply(e,arguments)}}},{key:"hoverEnd",value:function(){if("hover"===this.props.pause&&this.setInterval(),this.props.mouseLeave){var e;(e=this.props).mouseLeave.apply(e,arguments)}}},{key:"handleKeyPress",value:function(e){this.props.keyboard&&(37===e.keyCode?this.props.previous():39===e.keyCode&&this.props.next())}},{key:"renderItems",value:function(e,t){var n=this,o=this.props.slide;return x.a.createElement("div",{role:"listbox",className:t},e.map(function(e,t){var r=t===n.props.activeIndex;return x.a.cloneElement(e,{in:r,slide:o})}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,o=t.cssModule,r=t.slide,a=t.className,i=u(S()(a,"carousel",r&&"slide"),o),s=u(S()("carousel-inner"),o);if(n.every(function(e){return e.type===an}))return x.a.createElement("div",{className:i,onMouseEnter:this.hoverStart,onMouseLeave:this.hoverEnd},this.renderItems(n,s));if(n[0]instanceof Array){var l=n[0],c=n[1],p=n[2];return x.a.createElement("div",{className:i,onMouseEnter:this.hoverStart,onMouseLeave:this.hoverEnd},this.renderItems(l,s),c,p)}var d=n[0],f=function(t){"function"==typeof d.props.onClickHandler&&e.setState({indicatorClicked:!0},function(){return d.props.onClickHandler(t)})},m=x.a.cloneElement(d,{onClickHandler:f}),h=n[1],g=n[2],v=n[3];return x.a.createElement("div",{className:i,onMouseEnter:this.hoverStart,onMouseLeave:this.hoverEnd},m,this.renderItems(h,s),g,v)}}]),t}(x.a.Component);sn.propTypes={activeIndex:j.a.number,next:j.a.func.isRequired,previous:j.a.func.isRequired,keyboard:j.a.bool,pause:j.a.oneOf(["hover",!1]),ride:j.a.oneOf(["carousel"]),interval:j.a.oneOfType([j.a.number,j.a.string,j.a.bool]),children:j.a.array,mouseEnter:j.a.func,mouseLeave:j.a.func,slide:j.a.bool,cssModule:j.a.object,className:j.a.string},sn.defaultProps={interval:5e3,pause:"hover",keyboard:!0,slide:!0},sn.childContextTypes={direction:j.a.string};var ln=function(e){var t=e.direction,n=e.onClickHandler,o=e.cssModule,r=e.directionText,a=e.className,i=u(S()(a,"carousel-control-"+t),o),s=u(S()("carousel-control-"+t+"-icon"),o),l=u(S()("sr-only"),o);return x.a.createElement("a",{className:i,role:"button",tabIndex:"0",onClick:function(e){e.preventDefault(),n()}},x.a.createElement("span",{className:s,"aria-hidden":"true"}),x.a.createElement("span",{className:l},r||t))};ln.propTypes={direction:j.a.oneOf(["prev","next"]).isRequired,onClickHandler:j.a.func.isRequired,cssModule:j.a.object,directionText:j.a.string,className:j.a.string};var un=function(e){var t=e.items,n=e.activeIndex,o=e.cssModule,r=e.onClickHandler,a=e.className,i=u(S()(a,"carousel-indicators"),o),s=t.map(function(e,t){var a=u(S()({active:n===t}),o);return x.a.createElement("li",{key:""+(e.key||e.src)+e.caption+e.altText,onClick:function(e){e.preventDefault(),r(t)},className:a})});return x.a.createElement("ol",{className:i},s)};un.propTypes={items:j.a.array.isRequired,activeIndex:j.a.number.isRequired,cssModule:j.a.object,onClickHandler:j.a.func.isRequired,className:j.a.string};var cn=function(e){var t=e.captionHeader,n=e.captionText,o=e.cssModule,r=e.className,a=u(S()(r,"carousel-caption","d-none","d-md-block"),o);return x.a.createElement("div",{className:a},x.a.createElement("h3",null,t),x.a.createElement("p",null,n))};cn.propTypes={captionHeader:j.a.string,captionText:j.a.string.isRequired,cssModule:j.a.object,className:j.a.string};var pn={items:j.a.array.isRequired,indicators:j.a.bool,controls:j.a.bool,autoPlay:j.a.bool,activeIndex:j.a.number,next:j.a.func,previous:j.a.func,goToIndex:j.a.func},dn=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.animating=!1,n.state={activeIndex:0},n.next=n.next.bind(n),n.previous=n.previous.bind(n),n.goToIndex=n.goToIndex.bind(n),n.onExiting=n.onExiting.bind(n),n.onExited=n.onExited.bind(n),n}return oe(t,e),ee(t,[{key:"onExiting",value:function(){this.animating=!0}},{key:"onExited",value:function(){this.animating=!1}},{key:"next",value:function(){if(!this.animating){var e=this.state.activeIndex===this.props.items.length-1?0:this.state.activeIndex+1;this.setState({activeIndex:e})}}},{key:"previous",value:function(){if(!this.animating){var e=0===this.state.activeIndex?this.props.items.length-1:this.state.activeIndex-1;this.setState({activeIndex:e})}}},{key:"goToIndex",value:function(e){this.animating||this.setState({activeIndex:e})}},{key:"render",value:function(){var e=this,t=this.props,n=t.autoPlay,o=t.indicators,r=t.controls,a=t.items,i=t.goToIndex,s=re(t,["autoPlay","indicators","controls","items","goToIndex"]),l=this.state.activeIndex,u=a.map(function(t){return x.a.createElement(an,{onExiting:e.onExiting,onExited:e.onExited,key:t.src},x.a.createElement("img",{src:t.src,alt:t.altText}),x.a.createElement(cn,{captionText:t.caption,captionHeader:t.caption}))});return x.a.createElement(sn,ne({activeIndex:l,next:this.next,previous:this.previous,ride:n?"carousel":void 0},s),o&&x.a.createElement(un,{items:a,activeIndex:s.activeIndex||l,onClickHandler:i||this.goToIndex}),u,r&&x.a.createElement(ln,{direction:"prev",directionText:"Previous",onClickHandler:s.previous||this.previous}),r&&x.a.createElement(ln,{direction:"next",directionText:"Next",onClickHandler:s.next||this.next}))}}]),t}(C.Component);dn.propTypes=pn,dn.defaultProps={controls:!0,indicators:!0,autoPlay:!0};var fn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},mn={tag:"h6"},hn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-subtitle"),n);return x.a.createElement(o,ne({},r,{className:a}))};hn.propTypes=fn,hn.defaultProps=mn;var gn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},vn={tag:"p"},bn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-text"),n);return x.a.createElement(o,ne({},r,{className:a}))};bn.propTypes=gn,bn.defaultProps=vn;var yn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},En={tag:"h5"},Tn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"card-title"),n);return x.a.createElement(o,ne({},r,{className:a}))};Tn.propTypes=yn,Tn.defaultProps=En;var On={children:j.a.node.isRequired,className:j.a.string,placement:j.a.string,placementPrefix:j.a.string,hideArrow:j.a.bool,tag:j.a.string,isOpen:j.a.bool.isRequired,cssModule:j.a.object,offset:j.a.oneOfType([j.a.string,j.a.number]),fallbackPlacement:j.a.oneOfType([j.a.string,j.a.array]),flip:j.a.bool,container:j.a.oneOfType([j.a.string,j.a.func,m]),target:j.a.oneOfType([j.a.string,j.a.func,m]).isRequired,modifiers:j.a.object},_n={placement:"auto",hideArrow:!1,isOpen:!1,offset:0,fallbackPlacement:"flip",flip:!0,container:"body",modifiers:{}},Nn={popperManager:j.a.object.isRequired},Pn=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handlePlacementChange=n.handlePlacementChange.bind(n),n.setTargetNode=n.setTargetNode.bind(n),n.getTargetNode=n.getTargetNode.bind(n),n.state={},n}return oe(t,e),ee(t,[{key:"getChildContext",value:function(){return{popperManager:{setTargetNode:this.setTargetNode,getTargetNode:this.getTargetNode}}}},{key:"componentDidMount",value:function(){this.handleProps()}},{key:"componentDidUpdate",value:function(e){this.props.isOpen!==e.isOpen?this.handleProps():this._element&&this.renderIntoSubtree()}},{key:"componentWillUnmount",value:function(){this.hide()}},{key:"setTargetNode",value:function(e){this.targetNode=e}},{key:"getTargetNode",value:function(){return this.targetNode}},{key:"getContainerNode",value:function(){return h(this.props.container)}},{key:"handlePlacementChange",value:function(e){return this.state.placement!==e.placement&&this.setState({placement:e.placement}),e}},{key:"handleProps",value:function(){"inline"!==this.props.container&&(this.props.isOpen?this.show():this.hide())}},{key:"hide",value:function(){this._element&&(this.getContainerNode().removeChild(this._element),F.a.unmountComponentAtNode(this._element),this._element=null)}},{key:"show",value:function(){this._element=document.createElement("div"),this.getContainerNode().appendChild(this._element),this.renderIntoSubtree(),this._element.childNodes&&this._element.childNodes[0]&&this._element.childNodes[0].focus&&this._element.childNodes[0].focus()}},{key:"renderIntoSubtree",value:function(){F.a.unstable_renderSubtreeIntoContainer(this,this.renderChildren(),this._element)}},{key:"renderChildren",value:function(){var e=this.props,t=e.cssModule,n=e.children,o=(e.isOpen,e.flip),r=(e.target,e.offset),a=e.fallbackPlacement,i=e.placementPrefix,s=e.hideArrow,l=e.className,c=e.tag,p=(e.container,e.modifiers),d=re(e,["cssModule","children","isOpen","flip","target","offset","fallbackPlacement","placementPrefix","hideArrow","className","tag","container","modifiers"]),f=u("arrow",t),m=(this.state.placement||d.placement).split("-")[0],h=u(S()(l,i?i+"-"+m:m),this.props.cssModule),g=ne({offset:{offset:r},flip:{enabled:o,behavior:a},update:{enabled:!0,order:950,fn:this.handlePlacementChange}},p);return x.a.createElement(H.Popper,ne({modifiers:g},d,{component:c,className:h}),n,!s&&x.a.createElement(H.Arrow,{className:f}))}},{key:"render",value:function(){return this.setTargetNode(h(this.props.target)),"inline"===this.props.container&&this.props.isOpen?this.renderChildren():null}}]),t}(x.a.Component);Pn.propTypes=On,Pn.defaultProps=_n,Pn.childContextTypes=Nn;var kn=function(e,t){return t.popperManager.setTargetNode(h(e.target)),null};kn.contextTypes={popperManager:j.a.object.isRequired},kn.propTypes={target:j.a.oneOfType([j.a.string,j.a.func,m]).isRequired};var wn={placement:j.a.oneOf(Q),target:j.a.oneOfType([j.a.string,j.a.func,m]).isRequired,container:j.a.oneOfType([j.a.string,j.a.func,m]),isOpen:j.a.bool,disabled:j.a.bool,hideArrow:j.a.bool,className:j.a.string,innerClassName:j.a.string,placementPrefix:j.a.string,cssModule:j.a.object,toggle:j.a.func,delay:j.a.oneOfType([j.a.shape({show:j.a.number,hide:j.a.number}),j.a.number]),modifiers:j.a.object},Cn={show:0,hide:0},xn={isOpen:!1,hideArrow:!1,placement:"right",placementPrefix:"bs-popover",delay:Cn,toggle:function(){}},Mn=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.addTargetEvents=n.addTargetEvents.bind(n),n.handleDocumentClick=n.handleDocumentClick.bind(n),n.removeTargetEvents=n.removeTargetEvents.bind(n),n.getRef=n.getRef.bind(n),n.toggle=n.toggle.bind(n),n.show=n.show.bind(n),n.hide=n.hide.bind(n),n}return oe(t,e),ee(t,[{key:"componentDidMount",value:function(){this._target=h(this.props.target),this.handleProps()}},{key:"componentDidUpdate",value:function(){this.handleProps()}},{key:"componentWillUnmount",value:function(){this.clearShowTimeout(),this.clearHideTimeout(),this.removeTargetEvents()}},{key:"getRef",value:function(e){this._popover=e}},{key:"getDelay",value:function(e){var t=this.props.delay;return"object"===(void 0===t?"undefined":J(t))?isNaN(t[e])?Cn[e]:t[e]:t}},{key:"handleProps",value:function(){this.props.isOpen?this.show():this.hide()}},{key:"show",value:function(){this.clearHideTimeout(),this.addTargetEvents(),this.props.isOpen||(this.clearShowTimeout(),this._showTimeout=setTimeout(this.toggle,this.getDelay("show")))}},{key:"hide",value:function(){this.clearShowTimeout(),this.removeTargetEvents(),this.props.isOpen&&(this.clearHideTimeout(),this._hideTimeout=setTimeout(this.toggle,this.getDelay("hide")))}},{key:"clearShowTimeout",value:function(){clearTimeout(this._showTimeout),this._showTimeout=void 0}},{key:"clearHideTimeout",value:function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0}},{key:"handleDocumentClick",value:function(e){e.target===this._target||this._target.contains(e.target)||e.target===this._popover||this._popover&&this._popover.contains(e.target)||(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&this.toggle(e))}},{key:"addTargetEvents",value:function(){var e=this;["click","touchstart"].forEach(function(t){return document.addEventListener(t,e.handleDocumentClick,!0)})}},{key:"removeTargetEvents",value:function(){var e=this;["click","touchstart"].forEach(function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)})}},{key:"toggle",value:function(e){return this.props.disabled?e&&e.preventDefault():this.props.toggle(e)}},{key:"render",value:function(){if(!this.props.isOpen)return null;var e=c(this.props,Object.keys(wn)),t=u(S()("popover-inner",this.props.innerClassName),this.props.cssModule),n=u(S()("popover","show",this.props.className),this.props.cssModule);return x.a.createElement(Pn,{className:n,target:this.props.target,isOpen:this.props.isOpen,hideArrow:this.props.hideArrow,placement:this.props.placement,placementPrefix:this.props.placementPrefix,container:this.props.container,modifiers:this.props.modifiers},x.a.createElement("div",ne({},e,{className:t,ref:this.getRef})))}}]),t}(x.a.Component);Mn.propTypes=wn,Mn.defaultProps=xn;var jn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},In={tag:"h3"},Sn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"popover-header"),n);return x.a.createElement(o,ne({},r,{className:a}))};Sn.propTypes=jn,Sn.defaultProps=In;var An={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Dn={tag:"div"},Rn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"popover-body"),n);return x.a.createElement(o,ne({},r,{className:a}))};Rn.propTypes=An,Rn.defaultProps=Dn;var Ln={children:j.a.node,bar:j.a.bool,multi:j.a.bool,tag:j.a.string,value:j.a.oneOfType([j.a.string,j.a.number]),max:j.a.oneOfType([j.a.string,j.a.number]),animated:j.a.bool,striped:j.a.bool,color:j.a.string,className:j.a.string,barClassName:j.a.string,cssModule:j.a.object},Bn={tag:"div",value:0,max:100},Fn=function(e){var t=e.children,n=e.className,o=e.barClassName,r=e.cssModule,a=e.value,i=e.max,s=e.animated,l=e.striped,c=e.color,p=e.bar,d=e.multi,f=e.tag,m=re(e,["children","className","barClassName","cssModule","value","max","animated","striped","color","bar","multi","tag"]),h=U()(a)/U()(i)*100,g=u(S()(n,"progress"),r),v=u(S()("progress-bar",p?n||o:o,s?"progress-bar-animated":null,c?"bg-"+c:null,l||s?"progress-bar-striped":null),r),b=d?t:x.a.createElement("div",{className:v,style:{width:h+"%"},role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":i,children:t});return p?b:x.a.createElement(f,ne({},m,{className:g,children:b}))};Fn.propTypes=Ln,Fn.defaultProps=Bn;var Hn={children:j.a.node.isRequired,node:j.a.any},Vn=function(e){function t(){return Z(this,t),ae(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return oe(t,e),ee(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return X?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),F.a.createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(x.a.Component);Vn.propTypes=Hn;var Un=j.a.shape(y.propTypes),qn={isOpen:j.a.bool,autoFocus:j.a.bool,centered:j.a.bool,size:j.a.string,toggle:j.a.func,keyboard:j.a.bool,role:j.a.string,labelledBy:j.a.string,backdrop:j.a.oneOfType([j.a.bool,j.a.oneOf(["static"])]),onEnter:j.a.func,onExit:j.a.func,onOpened:j.a.func,onClosed:j.a.func,children:j.a.node,className:j.a.string,wrapClassName:j.a.string,modalClassName:j.a.string,backdropClassName:j.a.string,contentClassName:j.a.string,external:j.a.node,fade:j.a.bool,cssModule:j.a.object,zIndex:j.a.oneOfType([j.a.number,j.a.string]),backdropTransition:Un,modalTransition:Un},$n=Object.keys(qn),zn={isOpen:!1,autoFocus:!0,centered:!1,role:"dialog",backdrop:!0,keyboard:!0,zIndex:1050,fade:!0,onOpened:_,onClosed:_,modalTransition:{timeout:z.Modal},backdropTransition:{mountOnEnter:!0,timeout:z.Fade}},Wn=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._element=null,n._originalBodyPadding=null,n.handleBackdropClick=n.handleBackdropClick.bind(n),n.handleEscape=n.handleEscape.bind(n),n.onOpened=n.onOpened.bind(n),n.onClosed=n.onClosed.bind(n),n.state={isOpen:e.isOpen},e.isOpen&&n.init(),n}return oe(t,e),ee(t,[{key:"componentDidMount",value:function(){this.props.onEnter&&this.props.onEnter(),this.state.isOpen&&this.props.autoFocus&&this.setFocus(),this._isMounted=!0}},{key:"componentWillReceiveProps",value:function(e){e.isOpen&&!this.props.isOpen&&this.setState({isOpen:e.isOpen})}},{key:"componentWillUpdate",value:function(e,t){t.isOpen&&!this.state.isOpen&&this.init()}},{key:"componentDidUpdate",value:function(e,t){this.props.autoFocus&&this.state.isOpen&&!t.isOpen&&this.setFocus()}},{key:"componentWillUnmount",value:function(){this.props.onExit&&this.props.onExit(),this.state.isOpen&&this.destroy(),this._isMounted=!1}},{key:"onOpened",value:function(e,t){this.props.onOpened(),(this.props.modalTransition.onEntered||_)(e,t)}},{key:"onClosed",value:function(e){this.props.onClosed(),(this.props.modalTransition.onExited||_)(e),this.destroy(),this._isMounted&&this.setState({isOpen:!1})}},{key:"setFocus",value:function(){this._dialog&&this._dialog.parentNode&&"function"==typeof this._dialog.parentNode.focus&&this._dialog.parentNode.focus()}},{key:"handleBackdropClick",value:function(e){if(e.stopPropagation(),this.props.isOpen&&!0===this.props.backdrop){var t=this._dialog;e.target&&!t.contains(e.target)&&this.props.toggle&&this.props.toggle(e)}}},{key:"handleEscape",value:function(e){this.props.isOpen&&this.props.keyboard&&27===e.keyCode&&this.props.toggle&&this.props.toggle(e)}},{key:"init",value:function(){this._element=document.createElement("div"),this._element.setAttribute("tabindex","-1"),this._element.style.position="relative",this._element.style.zIndex=this.props.zIndex,this._originalBodyPadding=i(),s(),document.body.appendChild(this._element),this.bodyClassAdded||(document.body.className=S()(document.body.className,u("modal-open",this.props.cssModule)),this.bodyClassAdded=!0)}},{key:"destroy",value:function(){if(this._element&&(document.body.removeChild(this._element),this._element=null),this.bodyClassAdded){var e=u("modal-open",this.props.cssModule),t=new RegExp("(^| )"+e+"( |$)");document.body.className=document.body.className.replace(t," ").trim(),this.bodyClassAdded=!1}r(this._originalBodyPadding)}},{key:"renderModalDialog",value:function(){var e,t=this,n=c(this.props,$n);return x.a.createElement("div",ne({},n,{className:u(S()("modal-dialog",this.props.className,(e={},te(e,"modal-"+this.props.size,this.props.size),te(e,"modal-dialog-centered",this.props.centered),e)),this.props.cssModule),role:"document",ref:function(e){t._dialog=e}}),x.a.createElement("div",{className:u(S()("modal-content",this.props.contentClassName),this.props.cssModule)},this.props.children))}},{key:"render",value:function(){if(this.state.isOpen){var e=this.props,t=e.wrapClassName,n=e.modalClassName,o=e.backdropClassName,r=e.cssModule,a=e.isOpen,i=e.backdrop,s=e.role,l=e.labelledBy,c=e.external,p={onClick:this.handleBackdropClick,onKeyUp:this.handleEscape,style:{display:"block"},"aria-labelledby":l,role:s,tabIndex:"-1"},d=this.props.fade,f=ne({},y.defaultProps,this.props.modalTransition,{baseClass:d?this.props.modalTransition.baseClass:"",timeout:d?this.props.modalTransition.timeout:0}),m=ne({},y.defaultProps,this.props.backdropTransition,{baseClass:d?this.props.backdropTransition.baseClass:"",timeout:d?this.props.backdropTransition.timeout:0});return x.a.createElement(Vn,{node:this._element},x.a.createElement("div",{className:u(t)},x.a.createElement(y,ne({},p,f,{in:a,onEntered:this.onOpened,onExited:this.onClosed,cssModule:r,className:u(S()("modal",n),r)}),c,this.renderModalDialog()),x.a.createElement(y,ne({},m,{in:a&&!!i,cssModule:r,className:u(S()("modal-backdrop",o),r)}))))}return null}}]),t}(x.a.Component);Wn.propTypes=qn,Wn.defaultProps=zn;var Gn={tag:j.a.oneOfType([j.a.func,j.a.string]),wrapTag:j.a.oneOfType([j.a.func,j.a.string]),toggle:j.a.func,className:j.a.string,cssModule:j.a.object,children:j.a.node,closeAriaLabel:j.a.string},Kn={tag:"h5",wrapTag:"div",closeAriaLabel:"Close"},Qn=function(e){var t=void 0,n=e.className,o=e.cssModule,r=e.children,a=e.toggle,i=e.tag,s=e.wrapTag,l=e.closeAriaLabel,c=re(e,["className","cssModule","children","toggle","tag","wrapTag","closeAriaLabel"]),p=u(S()(n,"modal-header"),o);return a&&(t=x.a.createElement("button",{type:"button",onClick:a,className:u("close",o),"aria-label":l},x.a.createElement("span",{"aria-hidden":"true"},String.fromCharCode(215)))),x.a.createElement(s,ne({},c,{className:p}),x.a.createElement(i,{className:u("modal-title",o)},r),t)};Qn.propTypes=Gn,Qn.defaultProps=Kn;var Xn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Yn={tag:"div"},Jn=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"modal-body"),n);return x.a.createElement(o,ne({},r,{className:a}))};Jn.propTypes=Xn,Jn.defaultProps=Yn;var Zn={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},eo={tag:"div"},to=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"modal-footer"),n);return x.a.createElement(o,ne({},r,{className:a}))};to.propTypes=Zn,to.defaultProps=eo;var no={placement:j.a.oneOf(Q),target:j.a.oneOfType([j.a.string,j.a.func,m]).isRequired,container:j.a.oneOfType([j.a.string,j.a.func,m]),isOpen:j.a.bool,disabled:j.a.bool,hideArrow:j.a.bool,className:j.a.string,innerClassName:j.a.string,cssModule:j.a.object,toggle:j.a.func,autohide:j.a.bool,placementPrefix:j.a.string,delay:j.a.oneOfType([j.a.shape({show:j.a.number,hide:j.a.number}),j.a.number]),modifiers:j.a.object},oo={show:0,hide:250},ro={isOpen:!1,hideArrow:!1,placement:"top",placementPrefix:"bs-tooltip",delay:oo,autohide:!0,toggle:function(){}},ao=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.addTargetEvents=n.addTargetEvents.bind(n),n.handleDocumentClick=n.handleDocumentClick.bind(n),n.removeTargetEvents=n.removeTargetEvents.bind(n),n.toggle=n.toggle.bind(n),n.onMouseOverTooltip=n.onMouseOverTooltip.bind(n),n.onMouseLeaveTooltip=n.onMouseLeaveTooltip.bind(n),n.onMouseOverTooltipContent=n.onMouseOverTooltipContent.bind(n),n.onMouseLeaveTooltipContent=n.onMouseLeaveTooltipContent.bind(n),n.show=n.show.bind(n),n.hide=n.hide.bind(n),n}return oe(t,e),ee(t,[{key:"componentDidMount",value:function(){this._target=h(this.props.target),this.addTargetEvents()}},{key:"componentWillUnmount",value:function(){this.removeTargetEvents()}},{key:"onMouseOverTooltip",value:function(){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show,this.getDelay("show"))}},{key:"onMouseLeaveTooltip",value:function(){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide,this.getDelay("hide"))}},{key:"onMouseOverTooltipContent",value:function(){this.props.autohide||this._hideTimeout&&this.clearHideTimeout()}},{key:"onMouseLeaveTooltipContent",value:function(){this.props.autohide||(this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide,this.getDelay("hide")))}},{key:"getDelay",value:function(e){var t=this.props.delay;return"object"===(void 0===t?"undefined":J(t))?isNaN(t[e])?oo[e]:t[e]:t}},{key:"show",value:function(){this.props.isOpen||(this.clearShowTimeout(),this.toggle())}},{key:"hide",value:function(){this.props.isOpen&&(this.clearHideTimeout(),this.toggle())}},{key:"clearShowTimeout",value:function(){clearTimeout(this._showTimeout),this._showTimeout=void 0}},{key:"clearHideTimeout",value:function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0}},{key:"handleDocumentClick",value:function(e){(e.target===this._target||this._target.contains(e.target))&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen||this.toggle())}},{key:"addTargetEvents",value:function(){var e=this;this._target.addEventListener("mouseover",this.onMouseOverTooltip,!0),this._target.addEventListener("mouseout",this.onMouseLeaveTooltip,!0),["click","touchstart"].forEach(function(t){return document.addEventListener(t,e.handleDocumentClick,!0)})}},{key:"removeTargetEvents",value:function(){var e=this;this._target.removeEventListener("mouseover",this.onMouseOverTooltip,!0),this._target.removeEventListener("mouseout",this.onMouseLeaveTooltip,!0),["click","touchstart"].forEach(function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)})}},{key:"toggle",value:function(e){return this.props.disabled?e&&e.preventDefault():this.props.toggle()}},{key:"render",value:function(){if(!this.props.isOpen)return null;var e=c(this.props,Object.keys(no)),t=u(S()("tooltip-inner",this.props.innerClassName),this.props.cssModule),n=u(S()("tooltip","show",this.props.className),this.props.cssModule);return x.a.createElement(Pn,{className:n,target:this.props.target,isOpen:this.props.isOpen,hideArrow:this.props.hideArrow,placement:this.props.placement,placementPrefix:this.props.placementPrefix,container:this.props.container,modifiers:this.props.modifiers},x.a.createElement("div",ne({},e,{className:t,onMouseOver:this.onMouseOverTooltipContent,onMouseLeave:this.onMouseLeaveTooltipContent})))}}]),t}(x.a.Component);ao.propTypes=no,ao.defaultProps=ro;var io={className:j.a.string,cssModule:j.a.object,size:j.a.string,bordered:j.a.bool,striped:j.a.bool,inverse:f(j.a.bool,'Please use the prop "dark"'),dark:j.a.bool,hover:j.a.bool,responsive:j.a.oneOfType([j.a.bool,j.a.string]),tag:j.a.oneOfType([j.a.func,j.a.string]),responsiveTag:j.a.oneOfType([j.a.func,j.a.string])},so={tag:"table",responsiveTag:"div"},lo=function(e){var t=e.className,n=e.cssModule,o=e.size,r=e.bordered,a=e.striped,i=e.inverse,s=e.dark,l=e.hover,c=e.responsive,p=e.tag,d=e.responsiveTag,f=re(e,["className","cssModule","size","bordered","striped","inverse","dark","hover","responsive","tag","responsiveTag"]),m=u(S()(t,"table",!!o&&"table-"+o,!!r&&"table-bordered",!!a&&"table-striped",!(!s&&!i)&&"table-dark",!!l&&"table-hover"),n),h=x.a.createElement(p,ne({},f,{className:m}));if(c){var g=!0===c?"table-responsive":"table-responsive-"+c;return x.a.createElement(d,{className:g},h)}return h};lo.propTypes=io,lo.defaultProps=so;var uo={tag:j.a.oneOfType([j.a.func,j.a.string]),flush:j.a.bool,className:j.a.string,cssModule:j.a.object},co={tag:"ul"},po=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.flush,a=re(e,["className","cssModule","tag","flush"]),i=u(S()(t,"list-group",!!r&&"list-group-flush"),n);return x.a.createElement(o,ne({},a,{className:i}))};po.propTypes=uo,po.defaultProps=co;var fo={children:j.a.node,inline:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),innerRef:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},mo={tag:"form"},ho=function(e){var t=e.className,n=e.cssModule,o=e.inline,r=e.tag,a=e.innerRef,i=re(e,["className","cssModule","inline","tag","innerRef"]),s=u(S()(t,!!o&&"form-inline"),n);return x.a.createElement(r,ne({},i,{ref:a,className:s}))};ho.propTypes=fo,ho.defaultProps=mo;var go={children:j.a.node,tag:j.a.string,className:j.a.string,cssModule:j.a.object,valid:j.a.bool},vo={tag:"div",valid:void 0},bo=function(e){var t=e.className,n=e.cssModule,o=e.valid,r=e.tag,a=re(e,["className","cssModule","valid","tag"]),i=u(S()(t,o?"valid-feedback":"invalid-feedback"),n);return x.a.createElement(r,ne({},a,{className:i}))};bo.propTypes=go,bo.defaultProps=vo;var yo={children:j.a.node,row:j.a.bool,check:j.a.bool,inline:j.a.bool,disabled:j.a.bool,tag:j.a.string,className:j.a.string,cssModule:j.a.object},Eo={tag:"div"},To=function(e){var t=e.className,n=e.cssModule,o=e.row,r=e.disabled,a=e.check,i=e.inline,s=e.tag,l=re(e,["className","cssModule","row","disabled","check","inline","tag"]),c=u(S()(t,!!o&&"row",a?"form-check":"form-group",!(!a||!i)&&"form-check-inline",!(!a||!r)&&"disabled"),n);return x.a.createElement(s,ne({},l,{className:c}))};To.propTypes=yo,To.defaultProps=Eo;var Oo={children:j.a.node,inline:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),color:j.a.string,className:j.a.string,cssModule:j.a.object},_o={tag:"small",color:"muted"},No=function(e){var t=e.className,n=e.cssModule,o=e.inline,r=e.color,a=e.tag,i=re(e,["className","cssModule","inline","color","tag"]),s=u(S()(t,!o&&"form-text",!!r&&"text-"+r),n);return x.a.createElement(a,ne({},i,{className:s}))};No.propTypes=Oo,No.defaultProps=_o;var Po={children:j.a.node,type:j.a.string,size:j.a.string,bsSize:j.a.string,state:f(j.a.string,'Please use the props "valid" and "invalid" to indicate the state.'),valid:j.a.bool,invalid:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),innerRef:j.a.oneOfType([j.a.func,j.a.string]),static:f(j.a.bool,'Please use the prop "plaintext"'),plaintext:j.a.bool,addon:j.a.bool,className:j.a.string,cssModule:j.a.object},ko={type:"text"},wo=function(e){function t(){return Z(this,t),ae(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return oe(t,e),ee(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.type,r=e.bsSize,a=e.state,i=e.valid,s=e.invalid,l=e.tag,c=e.addon,p=e.static,f=e.plaintext,m=e.innerRef,h=re(e,["className","cssModule","type","bsSize","state","valid","invalid","tag","addon","static","plaintext","innerRef"]),g=["radio","checkbox"].indexOf(o)>-1,v=new RegExp("\\D","g"),b="file"===o,y="textarea"===o,E="select"===o,T=l||(E||y?o:"input"),O="form-control";f||p?(O+="-plaintext",T=l||"p"):b?O+="-file":g&&(O=c?null:"form-check-input"),a&&void 0===i&&void 0===s&&("danger"===a?s=!0:"success"===a&&(i=!0)),h.size&&v.test(h.size)&&(d('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'),r=h.size,delete h.size);var _=u(S()(t,s&&"is-invalid",i&&"is-valid",!!r&&"form-control-"+r,O),n);return"input"!==T&&"string"==typeof l||(h.type=o),x.a.createElement(T,ne({},h,{ref:m,className:_}))}}]),t}(x.a.Component);wo.propTypes=Po,wo.defaultProps=ko;var Co={tag:j.a.oneOfType([j.a.func,j.a.string]),size:j.a.string,className:j.a.string,cssModule:j.a.object},xo={tag:"div"},Mo=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.size,a=re(e,["className","cssModule","tag","size"]),i=u(S()(t,"input-group",r?"input-group-"+r:null),n);return x.a.createElement(o,ne({},a,{className:i}))};Mo.propTypes=Co,Mo.defaultProps=xo;var jo={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object},Io={tag:"span"},So=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"input-group-text"),n);return x.a.createElement(o,ne({},r,{className:a}))};So.propTypes=jo,So.defaultProps=Io;var Ao={tag:j.a.oneOfType([j.a.func,j.a.string]),addonType:j.a.oneOf(["prepend","append"]).isRequired,children:j.a.node,className:j.a.string,cssModule:j.a.object},Do={tag:"div"},Ro=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.addonType,a=e.children,i=re(e,["className","cssModule","tag","addonType","children"]),s=u(S()(t,"input-group-"+r),n);return"string"==typeof a?x.a.createElement(o,ne({},i,{className:s}),x.a.createElement(So,{children:a})):x.a.createElement(o,ne({},i,{className:s,children:a}))};Ro.propTypes=Ao,Ro.defaultProps=Do;var Lo={tag:j.a.oneOfType([j.a.func,j.a.string]),addonType:j.a.oneOf(["prepend","append"]).isRequired,children:j.a.node,groupClassName:j.a.string,groupAttributes:j.a.object,className:j.a.string,cssModule:j.a.object},Bo=function(e){d('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".');var t=e.children,n=e.groupClassName,o=e.groupAttributes,r=re(e,["children","groupClassName","groupAttributes"]);if("string"==typeof t){var a=r.cssModule,i=r.tag,s=r.addonType,l=re(r,["cssModule","tag","addonType"]),u=ne({},o,{cssModule:a,tag:i,addonType:s});return x.a.createElement(Ro,ne({},u,{className:n}),x.a.createElement(Ze,ne({},l,{children:t})))}return x.a.createElement(Ro,ne({},e,{children:t}))};Bo.propTypes=Lo;var Fo={addonType:j.a.oneOf(["prepend","append"]).isRequired,children:j.a.node},Ho=function(e){return x.a.createElement(Ve,e)};Ho.propTypes=Fo;var Vo=["xs","sm","md","lg","xl"],Uo=j.a.oneOfType([j.a.number,j.a.string]),qo=j.a.oneOfType([j.a.string,j.a.number,j.a.shape({size:Uo,push:f(Uo,'Please use the prop "order"'),pull:f(Uo,'Please use the prop "order"'),order:Uo,offset:Uo})]),$o={children:j.a.node,hidden:j.a.bool,check:j.a.bool,size:j.a.string,for:j.a.string,tag:j.a.string,className:j.a.string,cssModule:j.a.object,xs:qo,sm:qo,md:qo,lg:qo,xl:qo,widths:j.a.array},zo={tag:"label",widths:Vo},Wo=function(e,t,n){return!0===n||""===n?e?"col":"col-"+t:"auto"===n?e?"col-auto":"col-"+t+"-auto":e?"col-"+n:"col-"+t+"-"+n},Go=function(e){var t=e.className,n=e.cssModule,o=e.hidden,r=e.widths,a=e.tag,i=e.check,s=e.size,l=e.for,c=re(e,["className","cssModule","hidden","widths","tag","check","size","for"]),p=[];r.forEach(function(t,o){var r=e[t];if(delete c[t],r||""===r){var a=!o,i=void 0;if(L()(r)){var s,l=a?"-":"-"+t+"-";i=Wo(a,t,r.size),p.push(u(S()((s={},te(s,i,r.size||""===r.size),te(s,"order"+l+r.order,r.order||0===r.order),te(s,"offset"+l+r.offset,r.offset||0===r.offset),s))),n)}else i=Wo(a,t,r),p.push(i)}});var d=u(S()(t,!!o&&"sr-only",!!i&&"form-check-label",!!s&&"col-form-label-"+s,p,!!p.length&&"col-form-label"),n);return x.a.createElement(a,ne({htmlFor:l},c,{className:d}))};Go.propTypes=$o,Go.defaultProps=zo;var Ko={body:j.a.bool,bottom:j.a.bool,children:j.a.node,className:j.a.string,cssModule:j.a.object,heading:j.a.bool,left:j.a.bool,list:j.a.bool,middle:j.a.bool,object:j.a.bool,right:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string]),top:j.a.bool},Qo=function(e){var t=e.body,n=e.bottom,o=e.className,r=e.cssModule,a=e.heading,i=e.left,s=e.list,l=e.middle,c=e.object,p=e.right,d=e.tag,f=e.top,m=re(e,["body","bottom","className","cssModule","heading","left","list","middle","object","right","tag","top"]),h=void 0;h=a?"h4":i||p?"a":c?"img":s?"ul":"div";var g=d||h,v=u(S()(o,{"media-body":t,"media-heading":a,"media-left":i,"media-right":p,"media-top":f,"media-bottom":n,"media-middle":l,"media-object":c,"media-list":s,media:!(t||a||i||p||f||n||l||c||s)}),r);return x.a.createElement(g,ne({},m,{className:v}))};Qo.propTypes=Ko;var Xo={children:j.a.node,className:j.a.string,cssModule:j.a.object,size:j.a.string,tag:j.a.oneOfType([j.a.func,j.a.string])},Yo={tag:"ul"},Jo=function(e){var t=e.className,n=e.cssModule,o=e.size,r=e.tag,a=re(e,["className","cssModule","size","tag"]),i=u(S()(t,"pagination",te({},"pagination-"+o,!!o)),n);return x.a.createElement(r,ne({},a,{className:i}))};Jo.propTypes=Xo,Jo.defaultProps=Yo;var Zo={active:j.a.bool,children:j.a.node,className:j.a.string,cssModule:j.a.object,disabled:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string])},er={tag:"li"},tr=function(e){var t=e.active,n=e.className,o=e.cssModule,r=e.disabled,a=e.tag,i=re(e,["active","className","cssModule","disabled","tag"]),s=u(S()(n,"page-item",{active:t,disabled:r}),o);return x.a.createElement(a,ne({},i,{className:s}))};tr.propTypes=Zo,tr.defaultProps=er;var nr={"aria-label":j.a.string,children:j.a.node,className:j.a.string,cssModule:j.a.object,next:j.a.bool,previous:j.a.bool,tag:j.a.oneOfType([j.a.func,j.a.string])},or={tag:"a"},rr=function(e){var t=e.className,n=e.cssModule,o=e.next,r=e.previous,a=e.tag,i=re(e,["className","cssModule","next","previous","tag"]),s=u(S()(t,"page-link"),n),l=void 0;r?l="Previous":o&&(l="Next");var c=e["aria-label"]||l,p=void 0;r?p="«":o&&(p="»");var d=e.children;return d&&Array.isArray(d)&&0===d.length&&(d=null),(r||o)&&(d=[x.a.createElement("span",{"aria-hidden":"true",key:"caret"},d||p),x.a.createElement("span",{className:"sr-only",key:"sr"},c)]),x.a.createElement(a,ne({},i,{className:s,"aria-label":c}),d)};rr.propTypes=nr,rr.defaultProps=or;var ar={tag:j.a.oneOfType([j.a.func,j.a.string]),activeTab:j.a.any,className:j.a.string,cssModule:j.a.object},ir={tag:"div"},sr={activeTabId:j.a.any},lr=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={activeTab:n.props.activeTab},n}return oe(t,e),ee(t,[{key:"getChildContext",value:function(){return{activeTabId:this.state.activeTab}}},{key:"componentWillReceiveProps",value:function(e){this.state.activeTab!==e.activeTab&&this.setState({activeTab:e.activeTab})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.cssModule,o=e.tag,r=c(this.props,Object.keys(ar)),a=u(S()("tab-content",t),n);return x.a.createElement(o,ne({},r,{className:a}))}}]),t}(C.Component);lr.propTypes=ar,lr.defaultProps=ir,lr.childContextTypes=sr;var ur={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.string,cssModule:j.a.object,tabId:j.a.any},cr={tag:"div"},pr={activeTabId:j.a.any};N.propTypes=ur,N.defaultProps=cr,N.contextTypes=pr;var dr={tag:j.a.oneOfType([j.a.func,j.a.string]),fluid:j.a.bool,className:j.a.string,cssModule:j.a.object},fr={tag:"div"},mr=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.fluid,a=re(e,["className","cssModule","tag","fluid"]),i=u(S()(t,"jumbotron",!!r&&"jumbotron-fluid"),n);return x.a.createElement(o,ne({},a,{className:i}))};mr.propTypes=dr,mr.defaultProps=fr;var hr={children:j.a.node,className:j.a.string,closeClassName:j.a.string,closeAriaLabel:j.a.string,cssModule:j.a.object,color:j.a.string,isOpen:j.a.bool,toggle:j.a.func,tag:j.a.oneOfType([j.a.func,j.a.string]),transition:j.a.shape(y.propTypes)},gr={color:"success",isOpen:!0,tag:"div",closeAriaLabel:"Close",transition:ne({},y.defaultProps,{unmountOnExit:!0})};P.propTypes=hr,P.defaultProps=gr;var vr,br=ne({},_t.propTypes,{isOpen:j.a.bool,children:j.a.oneOfType([j.a.arrayOf(j.a.node),j.a.node]),tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.node,navbar:j.a.bool,cssModule:j.a.object}),yr=ne({},_t.defaultProps,{isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:z.Collapse}),Er=(vr={},te(vr,G.ENTERING,"collapsing"),te(vr,G.ENTERED,"collapse show"),te(vr,G.EXITING,"collapsing"),te(vr,G.EXITED,"collapse"),vr),Tr=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={height:null},["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(e){n[e]=n[e].bind(n)}),n}return oe(t,e),ee(t,[{key:"onEntering",value:function(e,t){this.setState({height:w(e)}),this.props.onEntering(e,t)}},{key:"onEntered",value:function(e,t){this.setState({height:null}),this.props.onEntered(e,t)}},{key:"onExit",value:function(e){this.setState({height:w(e)}),this.props.onExit(e)}},{key:"onExiting",value:function(e){e.offsetHeight,this.setState({height:0}),this.props.onExiting(e)}},{key:"onExited",value:function(e){this.setState({height:null}),this.props.onExited(e)}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.isOpen,o=e.className,r=e.navbar,a=e.cssModule,i=e.children,s=re(e,["tag","isOpen","className","navbar","cssModule","children"]),l=this.state.height,d=p(s,W),f=c(s,W);return x.a.createElement(_t,ne({},d,{in:n,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(e){var n=k(e),s=u(S()(o,n,r&&"navbar-collapse"),a),c=null===l?null:{height:l};return x.a.createElement(t,ne({},f,{style:ne({},f.style,c),className:s}),i)})}}]),t}(C.Component);Tr.propTypes=br,Tr.defaultProps=yr;var Or={tag:j.a.oneOfType([j.a.func,j.a.string]),active:j.a.bool,disabled:j.a.bool,color:j.a.string,action:j.a.bool,className:j.a.any,cssModule:j.a.object},_r={tag:"li"},Nr=function(e){e.preventDefault()},Pr=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=e.active,a=e.disabled,i=e.action,s=e.color,l=re(e,["className","cssModule","tag","active","disabled","action","color"]),c=u(S()(t,!!r&&"active",!!a&&"disabled",!!i&&"list-group-item-action",!!s&&"list-group-item-"+s,"list-group-item"),n);return a&&(l.onClick=Nr),x.a.createElement(o,ne({},l,{className:c}))};Pr.propTypes=Or,Pr.defaultProps=_r;var kr={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.any,cssModule:j.a.object},wr={tag:"h5"},Cr=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"list-group-item-heading"),n);return x.a.createElement(o,ne({},r,{className:a}))};Cr.propTypes=kr,Cr.defaultProps=wr;var xr={tag:j.a.oneOfType([j.a.func,j.a.string]),className:j.a.any,cssModule:j.a.object},Mr={tag:"p"},jr=function(e){var t=e.className,n=e.cssModule,o=e.tag,r=re(e,["className","cssModule","tag"]),a=u(S()(t,"list-group-item-text"),n);return x.a.createElement(o,ne({},r,{className:a}))};jr.propTypes=xr,jr.defaultProps=Mr;var Ir=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!0},n.toggle=n.toggle.bind(n),n}return oe(t,e),ee(t,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return x.a.createElement(P,ne({isOpen:this.state.isOpen,toggle:this.toggle},this.props))}}]),t}(C.Component),Sr=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!1},n.toggle=n.toggle.bind(n),n}return oe(t,e),ee(t,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return x.a.createElement(tt,ne({isOpen:this.state.isOpen,toggle:this.toggle},this.props))}}]),t}(C.Component),Ar=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!1},n.toggle=n.toggle.bind(n),n}return oe(t,e),ee(t,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return x.a.createElement(Ve,ne({isOpen:this.state.isOpen,toggle:this.toggle},this.props))}}]),t}(C.Component),Dr=function(e){return d('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.'),x.a.createElement(Ar,ne({nav:!0},e))},Rr=function(e){function t(e){Z(this,t);var n=ae(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={isOpen:!1},n.toggle=n.toggle.bind(n),n}return oe(t,e),ee(t,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return x.a.createElement(ao,ne({isOpen:this.state.isOpen,toggle:this.toggle},this.props))}}]),t}(C.Component)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementFormStateName=void 0;var o=n(16),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.loadElementFormStateName=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=r.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController"),n=t.form.elementForm.formNameTemplate;return e?n.replace("{id}",e):n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadElementSchemaValue=void 0;var o=n(16),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.loadElementSchemaValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=r.default.getSection("DNADesign\\Elemental\\Controllers\\ElementalAreaController"),o=n.form.elementForm[e]||"";return t?o+"/"+t:o}},function(e,t){e.exports=ReactRedux},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementType=void 0;var o=n(0),r=o.PropTypes.shape({ID:o.PropTypes.string.isRequired,Title:o.PropTypes.string,BlockSchema:o.PropTypes.object,InlineEditable:o.PropTypes.bool,IsPublished:o.PropTypes.bool,IsLiveVersion:o.PropTypes.bool,Version:o.PropTypes.number});t.elementType=r},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=Config},function(e,t){e.exports=ReactDom},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=n(20),a=o(r),i=n(21),s=o(i);window.document.addEventListener("DOMContentLoaded",function(){(0,a.default)(),(0,s.default)()})},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=n(61),a=o(r),i=n(0),s=o(i),l=n(17),u=o(l),c=n(1);a.default.entwine("ss",function(e){e(".js-injector-boot .element-editor__container").entwine({onmatch:function(){var e={},t=(0,c.loadComponent)("ElementEditor",e),n=this.data("schema"),o={fieldName:this.attr("name"),pageId:n["page-id"],elementalAreaId:n["elemental-area-id"],elementTypes:n["element-types"]};u.default.render(s.default.createElement(t,o),this[0])},onunmatch:function(){u.default.unmountComponentAtNode(this[0])},"from .cms-edit-form":{onaftersubmitform:function(){window.ss.apolloClient.resetStore()}}})})},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=o(r),i=n(30),s=o(i),l=n(31),u=o(l),c=n(32),p=o(c),d=n(33),f=o(d),m=n(38),h=o(m),g=n(28),v=o(g),b=n(34),y=o(b),E=n(29),T=o(E),O=n(37),_=o(O),N=n(36),P=o(N),k=n(27),w=o(k),C=n(35),x=o(C);t.default=function(){a.default.component.registerMany({ElementEditor:p.default,ElementToolbar:h.default,ElementAddNewButton:v.default,ElementList:f.default,Element:s.default,ElementActions:u.default,ElementHeader:y.default,ElementContent:T.default,ElementSummary:_.default,ElementInlineEditForm:P.default,AddElementPopover:w.default,HoverBar:x.default})}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=o(r),i=n(45),s=o(i),l=n(39),u=o(l),c=n(46),p=o(c),d=n(43),f=o(d),m=n(40),h=o(m),g=n(23),v=o(g),b=n(24),y=o(b),E=n(25),T=o(E),O=n(26),_=o(O);t.default=function(){a.default.transform("elemental-fieldgroup",function(e){e.component("FieldGroup.HistoryViewer.VersionDetail",u.default,"HistoricElement")},{after:"field-holders"}),a.default.transform("elements-history",function(e){e.component("HistoryViewer.Form_ItemEditForm",s.default,"ElementHistoryViewer")}),a.default.transform("blocks-history-revert",function(e){e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail",p.default,"BlockRevertMutation")}),a.default.transform("cms-element-editor",function(e){e.component("ElementList",f.default,"PageElements")}),a.default.transform("cms-element-adder",function(e){e.component("AddElementPopover",h.default,"ElementAddButton")}),a.default.transform("element-actions",function(e){e.component("ElementActions",T.default,"ElementActionsWithSave"),e.component("ElementActions",v.default,"ElementActionsWithArchive"),e.component("ElementActions",y.default,"ElementActionsWithPublish"),e.component("ElementActions",_.default,"ElementActionsWithUnpublish")})}},function(e,t,n){"use strict";n(19),n(18)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(0),a=o(r),i=n(4),s=n(7),l=o(s),u=n(41),c=o(u),p=n(2),d=o(p),f=function(e){return function(t){var n=function(e){e.stopPropagation();var n=t.id,o=t.isPublished,r=t.actions.handleArchiveBlock,a=d.default._t("ArchiveAction.CONFIRM_DELETE","Are you sure you want to send this block to the archive?");o&&(a=d.default._t("ArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH","Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?")),r&&confirm(a)&&r(n)},o={title:d.default._t("ArchiveAction.ARCHIVE","Archive"),className:"element-editor__actions-archive",onClick:n,toggle:t.toggle};return a.default.createElement(e,t,t.children,a.default.createElement(l.default,o))}};t.Component=f,t.default=(0,i.compose)(c.default,f)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(0),a=o(r),i=n(4),s=n(7),l=o(s),u=n(42),c=o(u),p=n(2),d=o(p),f=function(e){return function(t){var n=function(e){e.stopPropagation();var n=t.id,o=t.title,r=t.version,a=t.actions.handlePublishBlock,i=window,s=i.jQuery;a&&a(n,"DRAFT","LIVE",r).then(function(){s.noticeAdd({text:d.default.inject(d.default._t("UnpublishAction.SUCCESS_NOTIFICATION","Published '{title}' successfully"),{title:o}),stay:!1,type:"success"})}).catch(function(){s.noticeAdd({text:d.default.inject(d.default._t("UnpublishAction.ERROR_NOTIFICATION","Error publishing '{title}'"),{title:o}),stay:!1,type:"error"})})},o={title:d.default._t("PublishAction.PUBLISH","Publish"),className:"element-editor__actions-publish",onClick:n,toggle:t.toggle};return a.default.createElement(e,t,t.children,!t.isLiveVersion&&a.default.createElement(l.default,o))}};t.Component=f,t.default=(0,i.compose)(c.default,f)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=(0,g.loadElementFormStateName)(t.id),o=null;return e.form.formState.element&&e.form.formState.element[n]&&(o=e.form.formState.element[n].values),{formData:o,securityId:e.config.SecurityID}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var a=n(0),i=o(a),s=n(4),l=n(13),u=n(7),c=o(u),p=n(58),d=o(p),f=n(2),m=o(f),h=n(12),g=n(11),v=function(e){return function(t){var n=function(e){e.stopPropagation();var n=t.id,o=t.title,r=t.securityId,a=t.formData,i=window,s=i.jQuery,l={url:(0,h.loadElementSchemaValue)("saveUrl",n),method:(0,h.loadElementSchemaValue)("saveMethod"),payloadFormat:(0,h.loadElementSchemaValue)("payloadFormat"),defaultData:{SecurityID:r}};d.default.createEndpointFetcher(l)(a).then(function(){window.ss.apolloClient.queryManager.reFetchObservableQueries();var e=a["PageElements_"+n+"_Title"];s.noticeAdd({text:m.default.inject(m.default._t("SaveAction.SUCCESS_NOTIFICATION","Saved '{title}' successfully"),{title:e}),stay:!1,type:"success"})}).catch(function(){s.noticeAdd({text:m.default.inject(m.default._t("SaveAction.ERROR_NOTIFICATION","Error saving '{title}'"),{title:o}),stay:!1,type:"error"})})},o={title:m.default._t("SaveAction.SAVE","Save"),className:"element-editor__actions-save",onClick:n};return i.default.createElement(e,t,t.children,i.default.createElement(c.default,o))}};t.Component=v,t.default=(0,s.compose)((0,l.connect)(r),v)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(0),a=o(r),i=n(4),s=n(7),l=o(s),u=n(44),c=o(u),p=n(2),d=o(p),f=function(e){return function(t){var n=function(e){e.stopPropagation();var n=t.id,o=t.title,r=t.actions.handleUnpublishBlock,a=window,i=a.jQuery;r&&r(n).then(function(){i.noticeAdd({text:d.default.inject(d.default._t("UnpublishAction.SUCCESS_NOTIFICATION","Removed '{title}' from the published page"),{title:o}),stay:!1,type:"success"})}).catch(function(){i.noticeAdd({text:d.default.inject(d.default._t("UnpublishAction.ERROR_NOTIFICATION","Error unpublishing '{title}'"),{title:o}),stay:!1,type:"error"})})},o={title:d.default._t("UnpublishAction.UNPUBLISH","Unpublish"),className:"element-editor__actions-unpublish",onClick:n,toggle:t.toggle};return a.default.createElement(e,t,t.children,t.isPublished&&a.default.createElement(l.default,o))}};t.Component=f,t.default=(0,i.compose)(c.default,f)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",o=e.nodeName;if("BODY"===o||"HTML"===o){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[n]}return e[n]}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=f(t,"top"),r=f(t,"left"),a=n?-1:1;return e.top+=o*a,e.bottom+=o*a,e.left+=r*a,e.right+=r*a,e}function h(e,t){var n="x"===t?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+o+"Width"],10)}function g(e,t,n,o){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],l(10)?parseInt(n["offset"+e])+parseInt(o["margin"+("Height"===e?"Top":"Left")])+parseInt(o["margin"+("Height"===e?"Bottom":"Right")]):0)}function v(e){var t=e.body,n=e.documentElement,o=l(10)&&getComputedStyle(n);return{height:g("Height",t,n,o),width:g("Width",t,n,o)}}function b(e){return Ee({},e,{right:e.left+e.width,bottom:e.top+e.height})}function y(e){var t={};try{if(l(10)){t=e.getBoundingClientRect();var n=f(e,"top"),o=f(e,"left");t.top+=n,t.left+=o,t.bottom+=n,t.right+=o}else t=e.getBoundingClientRect()}catch(e){}var r={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?v(e.ownerDocument):{},s=i.width||e.clientWidth||r.right-r.left,u=i.height||e.clientHeight||r.bottom-r.top,c=e.offsetWidth-s,p=e.offsetHeight-u;if(c||p){var d=a(e);c-=h(d,"x"),p-=h(d,"y"),r.width-=c,r.height-=p}return b(r)}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=l(10),r="HTML"===t.nodeName,i=y(e),u=y(t),c=s(e),p=a(t),d=parseFloat(p.borderTopWidth,10),f=parseFloat(p.borderLeftWidth,10);n&&r&&(u.top=Math.max(u.top,0),u.left=Math.max(u.left,0));var h=b({top:i.top-u.top-d,left:i.left-u.left-f,width:i.width,height:i.height});if(h.marginTop=0,h.marginLeft=0,!o&&r){var g=parseFloat(p.marginTop,10),v=parseFloat(p.marginLeft,10);h.top-=d-g,h.bottom-=d-g,h.left-=f-v,h.right-=f-v,h.marginTop=g,h.marginLeft=v}return(o&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(h=m(h,t)),h}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,o=E(e,n),r=Math.max(n.clientWidth,window.innerWidth||0),a=Math.max(n.clientHeight,window.innerHeight||0),i=t?0:f(n),s=t?0:f(n,"left");return b({top:i-o.top+o.marginTop,left:s-o.left+o.marginLeft,width:r,height:a})}function O(e){var t=e.nodeName;return"BODY"!==t&&"HTML"!==t&&("fixed"===a(e,"position")||O(i(e)))}function _(e){if(!e||!e.parentElement||l())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function N(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={top:0,left:0},l=r?_(e):d(e,t);if("viewport"===o)a=T(l,r);else{var u=void 0;"scrollParent"===o?(u=s(i(t)),"BODY"===u.nodeName&&(u=e.ownerDocument.documentElement)):u="window"===o?e.ownerDocument.documentElement:o;var c=E(u,l,r);if("HTML"!==u.nodeName||O(l))a=c;else{var p=v(e.ownerDocument),f=p.height,m=p.width;a.top+=c.top-c.marginTop,a.bottom=f+c.top,a.left+=c.left-c.marginLeft,a.right=m+c.left}}n=n||0;var h="number"==typeof n;return a.left+=h?n:n.left||0,a.top+=h?n:n.top||0,a.right-=h?n:n.right||0,a.bottom-=h?n:n.bottom||0,a}function P(e){return e.width*e.height}function k(e,t,n,o,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var i=N(n,o,a,r),s={top:{width:i.width,height:t.top-i.top},right:{width:i.right-t.right,height:i.height},bottom:{width:i.width,height:i.bottom-t.bottom},left:{width:t.left-i.left,height:i.height}},l=Object.keys(s).map(function(e){return Ee({key:e},s[e],{area:P(s[e])})}).sort(function(e,t){return t.area-e.area}),u=l.filter(function(e){var t=e.width,o=e.height;return t>=n.clientWidth&&o>=n.clientHeight}),c=u.length>0?u[0].key:l[0].key,p=e.split("-")[1];return c+(p?"-"+p:"")}function w(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return E(n,o?_(t):d(t,n),o)}function C(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),o=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+o,height:e.offsetHeight+n}}function x(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function M(e,t,n){n=n.split("-")[0];var o=C(e),r={width:o.width,height:o.height},a=-1!==["right","left"].indexOf(n),i=a?"top":"left",s=a?"left":"top",l=a?"height":"width",u=a?"width":"height";return r[i]=t[i]+t[l]/2-o[l]/2,r[s]=n===s?t[s]-o[u]:t[x(s)],r}function j(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function I(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var o=j(e,function(e){return e[t]===n});return e.indexOf(o)}function S(e,t,n){return(void 0===n?e:e.slice(0,I(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&r(n)&&(t.offsets.popper=b(t.offsets.popper),t.offsets.reference=b(t.offsets.reference),t=n(t,e))}),t}function A(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=w(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=k(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=M(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=S(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function D(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function R(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),o=0;os[m]&&(e.offsets.popper[d]+=l[d]+h-s[m]),e.offsets.popper=b(e.offsets.popper);var g=l[d]+l[c]/2-h/2,v=a(e.instance.popper),y=parseFloat(v["margin"+p],10),E=parseFloat(v["border"+p+"Width"],10),T=g-e.offsets.popper[d]-y-E;return T=Math.max(Math.min(s[c]-h,T),0),e.arrowElement=o,e.offsets.arrow=(n={},ye(n,d,Math.round(T)),ye(n,f,""),n),e}function J(e){return"end"===e?"start":"start"===e?"end":e}function Z(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Oe.indexOf(e),o=Oe.slice(n+1).concat(Oe.slice(0,n));return t?o.reverse():o}function ee(e,t){if(D(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=N(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),o=e.placement.split("-")[0],r=x(o),a=e.placement.split("-")[1]||"",i=[];switch(t.behavior){case _e.FLIP:i=[o,r];break;case _e.CLOCKWISE:i=Z(o);break;case _e.COUNTERCLOCKWISE:i=Z(o,!0);break;default:i=t.behavior}return i.forEach(function(s,l){if(o!==s||i.length===l+1)return e;o=e.placement.split("-")[0],r=x(o);var u=e.offsets.popper,c=e.offsets.reference,p=Math.floor,d="left"===o&&p(u.right)>p(c.left)||"right"===o&&p(u.left)p(c.top)||"bottom"===o&&p(u.top)p(n.right),h=p(u.top)p(n.bottom),v="left"===o&&f||"right"===o&&m||"top"===o&&h||"bottom"===o&&g,b=-1!==["top","bottom"].indexOf(o),y=!!t.flipVariations&&(b&&"start"===a&&f||b&&"end"===a&&m||!b&&"start"===a&&h||!b&&"end"===a&&g);(d||v||y)&&(e.flipped=!0,(d||v)&&(o=i[l+1]),y&&(a=J(a)),e.placement=o+(a?"-"+a:""),e.offsets.popper=Ee({},e.offsets.popper,M(e.instance.popper,e.offsets.reference,e.placement)),e=S(e.instance.modifiers,e,"flip"))}),e}function te(e){var t=e.offsets,n=t.popper,o=t.reference,r=e.placement.split("-")[0],a=Math.floor,i=-1!==["top","bottom"].indexOf(r),s=i?"right":"bottom",l=i?"left":"top",u=i?"width":"height";return n[s]a(o[s])&&(e.offsets.popper[l]=a(o[s])),e}function ne(e,t,n,o){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+r[1],i=r[2];if(!a)return e;if(0===i.indexOf("%")){var s=void 0;switch(i){case"%p":s=n;break;case"%":case"%r":default:s=o}return b(s)[t]/100*a}return"vh"===i||"vw"===i?("vh"===i?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*a:a}function oe(e,t,n,o){var r=[0,0],a=-1!==["right","left"].indexOf(o),i=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=i.indexOf(j(i,function(e){return-1!==e.search(/,|\s/)}));i[s]&&-1===i[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[i.slice(0,s).concat([i[s].split(l)[0]]),[i[s].split(l)[1]].concat(i.slice(s+1))]:[i];return u=u.map(function(e,o){var r=(1===o?!a:a)?"height":"width",i=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,i=!0,e):i?(e[e.length-1]+=t,i=!1,e):e.concat(t)},[]).map(function(e){return ne(e,r,t,n)})}),u.forEach(function(e,t){e.forEach(function(n,o){$(n)&&(r[t]+=n*("-"===e[o-1]?-1:1))})}),r}function re(e,t){var n=t.offset,o=e.placement,r=e.offsets,a=r.popper,i=r.reference,s=o.split("-")[0],l=void 0;return l=$(+n)?[+n,0]:oe(n,a,i,s),"left"===s?(a.top+=l[0],a.left-=l[1]):"right"===s?(a.top+=l[0],a.left+=l[1]):"top"===s?(a.left+=l[0],a.top-=l[1]):"bottom"===s&&(a.left+=l[0],a.top+=l[1]),e.popper=a,e}function ae(e,t){var n=t.boundariesElement||u(e.instance.popper);e.instance.reference===n&&(n=u(n));var o=R("transform"),r=e.instance.popper.style,a=r.top,i=r.left,s=r[o];r.top="",r.left="",r[o]="";var l=N(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);r.top=a,r.left=i,r[o]=s,t.boundaries=l;var c=t.priority,p=e.offsets.popper,d={primary:function(e){var n=p[e];return p[e]l[e]&&!t.escapeWithReference&&(o=Math.min(p[n],l[e]-("right"===e?p.width:p.height))),ye({},n,o)}};return c.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";p=Ee({},p,d[t](e))}),e.offsets.popper=p,e}function ie(e){var t=e.placement,n=t.split("-")[0],o=t.split("-")[1];if(o){var r=e.offsets,a=r.reference,i=r.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:ye({},l,a[l]),end:ye({},l,a[l]+a[u]-i[u])};e.offsets.popper=Ee({},i,c[o])}return e}function se(e){if(!X(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=j(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right=0){pe=1;break}var fe=ue&&window.Promise,me=fe?n:o,he=ue&&!(!window.MSInputMethodContext||!document.documentMode),ge=ue&&/MSIE 10/.test(navigator.userAgent),ve=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},be=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};ve(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=me(this.update.bind(this)),this.options=Ee({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Ee({},e.Defaults.modifiers,a.modifiers)).forEach(function(t){o.options.modifiers[t]=Ee({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Ee({name:e},o.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&r(e.onLoad)&&e.onLoad(o.reference,o.popper,o.options,e,o.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return be(e,[{key:"update",value:function(){return A.call(this)}},{key:"destroy",value:function(){return L.call(this)}},{key:"enableEventListeners",value:function(){return V.call(this)}},{key:"disableEventListeners",value:function(){return q.call(this)}}]),e}();ke.Utils=("undefined"!=typeof window?window:e).PopperUtils,ke.placements=Te,ke.Defaults=Pe,t.default=ke}.call(t,n(15))},function(e,t,n){"use strict";function o(){}var r=n(52);e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=o,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t 0 ? padding + 'px' : null; +} + +function isBodyOverflowing() { + return document.body.clientWidth < window.innerWidth; +} + +function getOriginalBodyPadding() { + var style = window.getComputedStyle(document.body, null); + + return parseInt(style && style.getPropertyValue('padding-right') || 0, 10); +} + +function conditionallyUpdateScrollbar() { + var scrollbarWidth = getScrollbarWidth(); + // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433 + var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0]; + var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0; + + if (isBodyOverflowing()) { + setScrollbarWidth(bodyPadding + scrollbarWidth); + } +} + +var globalCssModule = void 0; + +function setGlobalCssModule(cssModule) { + globalCssModule = cssModule; +} + +function mapToCssModules() { + var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + var cssModule = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalCssModule; + + if (!cssModule) return className; + return className.split(' ').map(function (c) { + return cssModule[c] || c; + }).join(' '); +} + +/** + * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`. + */ +function omit(obj, omitKeys) { + var result = {}; + Object.keys(obj).forEach(function (key) { + if (omitKeys.indexOf(key) === -1) { + result[key] = obj[key]; + } + }); + return result; +} + +/** + * Returns a filtered copy of an object with only the specified keys. + */ +function pick(obj, keys) { + var pickKeys = Array.isArray(keys) ? keys : [keys]; + var length = pickKeys.length; + var key = void 0; + var result = {}; + + while (length > 0) { + length -= 1; + key = pickKeys[length]; + result[key] = obj[key]; + } + return result; +} + +var warned = {}; + +function warnOnce(message) { + if (!warned[message]) { + /* istanbul ignore else */ + if (typeof console !== 'undefined') { + console.error(message); // eslint-disable-line no-console + } + warned[message] = true; + } +} + +function deprecated(propType, explanation) { + return function validate(props, propName, componentName) { + if (props[propName] !== null && typeof props[propName] !== 'undefined') { + warnOnce('"' + propName + '" property of "' + componentName + '" has been deprecated.\n' + explanation); + } + + for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + rest[_key - 3] = arguments[_key]; + } + + return propType.apply(undefined, [props, propName, componentName].concat(rest)); + }; +} + +function DOMElement(props, propName, componentName) { + if (!(props[propName] instanceof Element)) { + return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.'); + } +} + +function getTarget(target) { + if (__WEBPACK_IMPORTED_MODULE_3_lodash_isfunction___default()(target)) { + return target(); + } + + if (typeof target === 'string' && document) { + var selection = document.querySelector(target); + if (selection === null) { + selection = document.querySelector('#' + target); + } + if (selection === null) { + throw new Error('The target \'' + target + '\' could not be identified in the dom, tip: check spelling'); + } + return selection; + } + + return target; +} + +/* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */ +// These are all setup to match what is in the bootstrap _variables.scss +// https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss +var TransitionTimeouts = { + Fade: 150, // $transition-fade + Collapse: 350, // $transition-collapse + Modal: 300, // $modal-transition + Carousel: 600 // $carousel-transition +}; + +// Duplicated Transition.propType keys to ensure that Reactstrap builds +// for distribution properly exclude these keys for nested child HTML attributes +// since `react-transition-group` removes propTypes in production builds. +var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited']; + +var TransitionStatuses = { + ENTERING: 'entering', + ENTERED: 'entered', + EXITING: 'exiting', + EXITED: 'exited' +}; + +var keyCodes = { + esc: 27, + space: 32, + tab: 9, + up: 38, + down: 40 +}; + +var PopperPlacements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; + +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +var utils = Object.freeze({ + getScrollbarWidth: getScrollbarWidth, + setScrollbarWidth: setScrollbarWidth, + isBodyOverflowing: isBodyOverflowing, + getOriginalBodyPadding: getOriginalBodyPadding, + conditionallyUpdateScrollbar: conditionallyUpdateScrollbar, + setGlobalCssModule: setGlobalCssModule, + mapToCssModules: mapToCssModules, + omit: omit, + pick: pick, + warnOnce: warnOnce, + deprecated: deprecated, + DOMElement: DOMElement, + getTarget: getTarget, + TransitionTimeouts: TransitionTimeouts, + TransitionPropTypeKeys: TransitionPropTypeKeys, + TransitionStatuses: TransitionStatuses, + keyCodes: keyCodes, + PopperPlacements: PopperPlacements, + canUseDOM: canUseDOM +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + + + + + + + + + + + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + +var defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + + + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + +var objectWithoutProperties = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +}; + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +var propTypes = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + fluid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps = { + tag: 'div' +}; + +var Container = function Container(props) { + var className = props.className, + cssModule = props.cssModule, + fluid = props.fluid, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'fluid', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, fluid ? 'container-fluid' : 'container'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Container.propTypes = propTypes; +Container.defaultProps = defaultProps; + +var propTypes$1 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + noGutters: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$1 = { + tag: 'div' +}; + +var Row = function Row(props) { + var className = props.className, + cssModule = props.cssModule, + noGutters = props.noGutters, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'noGutters', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, noGutters ? 'no-gutters' : null, 'row'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Row.propTypes = propTypes$1; +Row.defaultProps = defaultProps$1; + +var colWidths = ['xs', 'sm', 'md', 'lg', 'xl']; +var stringOrNumberProp = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]); + +var columnProps = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + push: deprecated(stringOrNumberProp, 'Please use the prop "order"'), + pull: deprecated(stringOrNumberProp, 'Please use the prop "order"'), + order: stringOrNumberProp, + offset: stringOrNumberProp +})]); + +var propTypes$2 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + xs: columnProps, + sm: columnProps, + md: columnProps, + lg: columnProps, + xl: columnProps, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + widths: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array +}; + +var defaultProps$2 = { + tag: 'div', + widths: colWidths +}; + +var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) { + if (colSize === true || colSize === '') { + return isXs ? 'col' : 'col-' + colWidth; + } else if (colSize === 'auto') { + return isXs ? 'col-auto' : 'col-' + colWidth + '-auto'; + } + + return isXs ? 'col-' + colSize : 'col-' + colWidth + '-' + colSize; +}; + +var Col = function Col(props) { + var className = props.className, + cssModule = props.cssModule, + widths = props.widths, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'widths', 'tag']); + + var colClasses = []; + + widths.forEach(function (colWidth, i) { + var columnProp = props[colWidth]; + + delete attributes[colWidth]; + + if (!columnProp && columnProp !== '') { + return; + } + + var isXs = !i; + + if (__WEBPACK_IMPORTED_MODULE_4_lodash_isobject___default()(columnProp)) { + var _classNames; + + var colSizeInterfix = isXs ? '-' : '-' + colWidth + '-'; + var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size); + + colClasses.push(mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()((_classNames = {}, defineProperty(_classNames, colClass, columnProp.size || columnProp.size === ''), defineProperty(_classNames, 'order' + colSizeInterfix + columnProp.order, columnProp.order || columnProp.order === 0), defineProperty(_classNames, 'offset' + colSizeInterfix + columnProp.offset, columnProp.offset || columnProp.offset === 0), _classNames)), cssModule)); + } else { + var _colClass = getColumnSizeClass(isXs, colWidth, columnProp); + colClasses.push(_colClass); + } + }); + + if (!colClasses.length) { + colClasses.push('col'); + } + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, colClasses), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Col.propTypes = propTypes$2; +Col.defaultProps = defaultProps$2; + +var propTypes$3 = { + light: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + dark: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + inverse: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "dark"'), + full: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + fixed: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + sticky: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + toggleable: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), 'Please use the prop "expand"'), + expand: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) +}; + +var defaultProps$3 = { + tag: 'nav', + expand: false +}; + +var getExpandClass = function getExpandClass(expand) { + if (expand === false) { + return false; + } else if (expand === true || expand === 'xs') { + return 'navbar-expand'; + } + + return 'navbar-expand-' + expand; +}; + +// To better maintain backwards compatibility while toggleable is deprecated. +// We must map breakpoints to the next breakpoint so that toggleable and expand do the same things at the same breakpoint. +var toggleableToExpand = { + xs: 'sm', + sm: 'md', + md: 'lg', + lg: 'xl' +}; + +var getToggleableClass = function getToggleableClass(toggleable) { + if (toggleable === undefined || toggleable === 'xl') { + return false; + } else if (toggleable === false) { + return 'navbar-expand'; + } + + return 'navbar-expand-' + (toggleable === true ? 'sm' : toggleableToExpand[toggleable] || toggleable); +}; + +var Navbar = function Navbar(props) { + var _classNames; + + var toggleable = props.toggleable, + expand = props.expand, + className = props.className, + cssModule = props.cssModule, + light = props.light, + dark = props.dark, + inverse = props.inverse, + fixed = props.fixed, + sticky = props.sticky, + color = props.color, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['toggleable', 'expand', 'className', 'cssModule', 'light', 'dark', 'inverse', 'fixed', 'sticky', 'color', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar', getExpandClass(expand) || getToggleableClass(toggleable), (_classNames = { + 'navbar-light': light, + 'navbar-dark': inverse || dark + }, defineProperty(_classNames, 'bg-' + color, color), defineProperty(_classNames, 'fixed-' + fixed, fixed), defineProperty(_classNames, 'sticky-' + sticky, sticky), _classNames)), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Navbar.propTypes = propTypes$3; +Navbar.defaultProps = defaultProps$3; + +var propTypes$4 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$4 = { + tag: 'a' +}; + +var NavbarBrand = function NavbarBrand(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar-brand'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +NavbarBrand.propTypes = propTypes$4; +NavbarBrand.defaultProps = defaultProps$4; + +var propTypes$5 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + type: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + +var defaultProps$5 = { + tag: 'button', + type: 'button' +}; + +var NavbarToggler = function NavbarToggler(props) { + var className = props.className, + cssModule = props.cssModule, + children = props.children, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'children', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar-toggler'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + _extends({}, attributes, { className: classes }), + children || __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span', { className: mapToCssModules('navbar-toggler-icon', cssModule) }) + ); +}; + +NavbarToggler.propTypes = propTypes$5; +NavbarToggler.defaultProps = defaultProps$5; + +var propTypes$6 = { + tabs: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + pills: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + vertical: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + horizontal: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + justified: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + fill: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + navbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + card: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$6 = { + tag: 'ul', + vertical: false +}; + +var getVerticalClass = function getVerticalClass(vertical) { + if (vertical === false) { + return false; + } else if (vertical === true || vertical === 'xs') { + return 'flex-column'; + } + + return 'flex-' + vertical + '-column'; +}; + +var Nav = function Nav(props) { + var className = props.className, + cssModule = props.cssModule, + tabs = props.tabs, + pills = props.pills, + vertical = props.vertical, + horizontal = props.horizontal, + justified = props.justified, + fill = props.fill, + navbar = props.navbar, + card = props.card, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tabs', 'pills', 'vertical', 'horizontal', 'justified', 'fill', 'navbar', 'card', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, navbar ? 'navbar-nav' : 'nav', horizontal ? 'justify-content-' + horizontal : false, getVerticalClass(vertical), { + 'nav-tabs': tabs, + 'card-header-tabs': card && tabs, + 'nav-pills': pills, + 'card-header-pills': card && pills, + 'nav-justified': justified, + 'nav-fill': fill + }), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Nav.propTypes = propTypes$6; +Nav.defaultProps = defaultProps$6; + +var propTypes$7 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$7 = { + tag: 'li' +}; + +var NavItem = function NavItem(props) { + var className = props.className, + cssModule = props.cssModule, + active = props.active, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'active', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'nav-item', active ? 'active' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +NavItem.propTypes = propTypes$7; +NavItem.defaultProps = defaultProps$7; + +/* eslint react/no-find-dom-node: 0 */ +// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md + +var propTypes$8 = { + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + dropup: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "direction" with the value "up".'), + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['up', 'down', 'left', 'right']), + group: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + nav: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append'])]), + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var defaultProps$8 = { + isOpen: false, + direction: 'down', + nav: false, + active: false, + addonType: false, + inNavbar: false +}; + +var childContextTypes = { + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['up', 'down', 'left', 'right']).isRequired, + inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired +}; + +var Dropdown = function (_React$Component) { + inherits(Dropdown, _React$Component); + + function Dropdown(props) { + classCallCheck(this, Dropdown); + + var _this = possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); + + _this.addEvents = _this.addEvents.bind(_this); + _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); + _this.handleKeyDown = _this.handleKeyDown.bind(_this); + _this.removeEvents = _this.removeEvents.bind(_this); + _this.toggle = _this.toggle.bind(_this); + return _this; + } + + createClass(Dropdown, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + toggle: this.props.toggle, + isOpen: this.props.isOpen, + direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction, + inNavbar: this.props.inNavbar + }; + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.handleProps(); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps) { + if (this.props.isOpen !== prevProps.isOpen) { + this.handleProps(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeEvents(); + } + }, { + key: 'getContainer', + value: function getContainer() { + return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(this); + } + }, { + key: 'addEvents', + value: function addEvents() { + var _this2 = this; + + ['click', 'touchstart', 'keyup'].forEach(function (event) { + return document.addEventListener(event, _this2.handleDocumentClick, true); + }); + } + }, { + key: 'removeEvents', + value: function removeEvents() { + var _this3 = this; + + ['click', 'touchstart', 'keyup'].forEach(function (event) { + return document.removeEventListener(event, _this3.handleDocumentClick, true); + }); + } + }, { + key: 'handleDocumentClick', + value: function handleDocumentClick(e) { + if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return; + var container = this.getContainer(); + + if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) { + return; + } + + this.toggle(e); + } + }, { + key: 'handleKeyDown', + value: function handleKeyDown(e) { + if ([keyCodes.esc, keyCodes.up, keyCodes.down, keyCodes.space].indexOf(e.which) === -1 || /button/i.test(e.target.tagName) && e.which === keyCodes.space || /input|textarea/i.test(e.target.tagName)) { + return; + } + + e.preventDefault(); + if (this.props.disabled) return; + + var container = this.getContainer(); + + if (e.which === keyCodes.space && this.props.isOpen && container !== e.target) { + e.target.click(); + } + + if (e.which === keyCodes.esc || !this.props.isOpen) { + this.toggle(e); + container.querySelector('[aria-expanded]').focus(); + return; + } + + var menuClass = mapToCssModules('dropdown-menu', this.props.cssModule); + var itemClass = mapToCssModules('dropdown-item', this.props.cssModule); + var disabledClass = mapToCssModules('disabled', this.props.cssModule); + + var items = container.querySelectorAll('.' + menuClass + ' .' + itemClass + ':not(.' + disabledClass + ')'); + + if (!items.length) return; + + var index = -1; + for (var i = 0; i < items.length; i += 1) { + if (items[i] === e.target) { + index = i; + break; + } + } + + if (e.which === keyCodes.up && index > 0) { + index -= 1; + } + + if (e.which === keyCodes.down && index < items.length - 1) { + index += 1; + } + + if (index < 0) { + index = 0; + } + + items[index].focus(); + } + }, { + key: 'handleProps', + value: function handleProps() { + if (this.props.isOpen) { + this.addEvents(); + } else { + this.removeEvents(); + } + } + }, { + key: 'toggle', + value: function toggle(e) { + if (this.props.disabled) { + return e && e.preventDefault(); + } + + return this.props.toggle(e); + } + }, { + key: 'render', + value: function render() { + var _classNames; + + var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar', 'direction']), + className = _omit.className, + cssModule = _omit.cssModule, + dropup = _omit.dropup, + isOpen = _omit.isOpen, + group = _omit.group, + size = _omit.size, + nav = _omit.nav, + active = _omit.active, + addonType = _omit.addonType, + attrs = objectWithoutProperties(_omit, ['className', 'cssModule', 'dropup', 'isOpen', 'group', 'size', 'nav', 'active', 'addonType']); + + var direction = this.props.direction === 'down' && dropup ? 'up' : this.props.direction; + + attrs.tag = attrs.tag || (nav ? 'li' : 'div'); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, direction !== 'down' && 'drop' + direction, nav && active ? 'active' : false, (_classNames = {}, defineProperty(_classNames, 'input-group-' + addonType, addonType), defineProperty(_classNames, 'btn-group', group), defineProperty(_classNames, 'btn-group-' + size, !!size), defineProperty(_classNames, 'dropdown', !group && !addonType), defineProperty(_classNames, 'show', isOpen), defineProperty(_classNames, 'nav-item', nav), _classNames)), cssModule); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Manager"], _extends({}, attrs, { className: classes, onKeyDown: this.handleKeyDown })); + } + }]); + return Dropdown; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Dropdown.propTypes = propTypes$8; +Dropdown.defaultProps = defaultProps$8; +Dropdown.childContextTypes = childContextTypes; + +function NavDropdown(props) { + warnOnce('The "NavDropdown" component has been deprecated.\nPlease use component "Dropdown" with nav prop.'); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ nav: true }, props)); +} + +var propTypes$9 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + href: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any +}; + +var defaultProps$9 = { + tag: 'a' +}; + +var NavLink = function (_React$Component) { + inherits(NavLink, _React$Component); + + function NavLink(props) { + classCallCheck(this, NavLink); + + var _this = possibleConstructorReturn(this, (NavLink.__proto__ || Object.getPrototypeOf(NavLink)).call(this, props)); + + _this.onClick = _this.onClick.bind(_this); + return _this; + } + + createClass(NavLink, [{ + key: 'onClick', + value: function onClick(e) { + if (this.props.disabled) { + e.preventDefault(); + return; + } + + if (this.props.href === '#') { + e.preventDefault(); + } + + if (this.props.onClick) { + this.props.onClick(e); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + cssModule = _props.cssModule, + active = _props.active, + Tag = _props.tag, + innerRef = _props.innerRef, + attributes = objectWithoutProperties(_props, ['className', 'cssModule', 'active', 'tag', 'innerRef']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'nav-link', { + disabled: attributes.disabled, + active: active + }), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, onClick: this.onClick, className: classes })); + } + }]); + return NavLink; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +NavLink.propTypes = propTypes$9; +NavLink.defaultProps = defaultProps$9; + +var propTypes$10 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$10 = { + tag: 'ol' +}; + +var Breadcrumb = function Breadcrumb(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'breadcrumb'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Breadcrumb.propTypes = propTypes$10; +Breadcrumb.defaultProps = defaultProps$10; + +var propTypes$11 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$11 = { + tag: 'li' +}; + +var BreadcrumbItem = function BreadcrumbItem(props) { + var className = props.className, + cssModule = props.cssModule, + active = props.active, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'active', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, active ? 'active' : false, 'breadcrumb-item'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +BreadcrumbItem.propTypes = propTypes$11; +BreadcrumbItem.defaultProps = defaultProps$11; + +var propTypes$12 = { + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + outline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$12 = { + color: 'secondary', + tag: 'button' +}; + +var Button = function (_React$Component) { + inherits(Button, _React$Component); + + function Button(props) { + classCallCheck(this, Button); + + var _this = possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); + + _this.onClick = _this.onClick.bind(_this); + return _this; + } + + createClass(Button, [{ + key: 'onClick', + value: function onClick(e) { + if (this.props.disabled) { + e.preventDefault(); + return; + } + + if (this.props.onClick) { + this.props.onClick(e); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + active = _props.active, + block = _props.block, + className = _props.className, + cssModule = _props.cssModule, + color = _props.color, + outline = _props.outline, + size = _props.size, + Tag = _props.tag, + innerRef = _props.innerRef, + attributes = objectWithoutProperties(_props, ['active', 'block', 'className', 'cssModule', 'color', 'outline', 'size', 'tag', 'innerRef']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'btn', 'btn' + (outline ? '-outline' : '') + '-' + color, size ? 'btn-' + size : false, block ? 'btn-block' : false, { active: active, disabled: this.props.disabled }), cssModule); + + if (attributes.href && Tag === 'button') { + Tag = 'a'; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ + type: Tag === 'button' && attributes.onClick ? 'button' : undefined + }, attributes, { + className: classes, + ref: innerRef, + onClick: this.onClick + })); + } + }]); + return Button; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Button.propTypes = propTypes$12; +Button.defaultProps = defaultProps$12; + +var propTypes$13 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + +var ButtonDropdown = function ButtonDropdown(props) { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ group: true }, props)); +}; + +ButtonDropdown.propTypes = propTypes$13; + +var propTypes$14 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + vertical: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var defaultProps$13 = { + tag: 'div', + role: 'group' +}; + +var ButtonGroup = function ButtonGroup(props) { + var className = props.className, + cssModule = props.cssModule, + size = props.size, + vertical = props.vertical, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'vertical', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ButtonGroup.propTypes = propTypes$14; +ButtonGroup.defaultProps = defaultProps$13; + +var propTypes$15 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var defaultProps$14 = { + tag: 'div', + role: 'toolbar' +}; + +var ButtonToolbar = function ButtonToolbar(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'btn-toolbar'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ButtonToolbar.propTypes = propTypes$15; +ButtonToolbar.defaultProps = defaultProps$14; + +var propTypes$16 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + divider: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + header: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var contextTypes = { + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func +}; + +var defaultProps$15 = { + tag: 'button', + toggle: true +}; + +var DropdownItem = function (_React$Component) { + inherits(DropdownItem, _React$Component); + + function DropdownItem(props) { + classCallCheck(this, DropdownItem); + + var _this = possibleConstructorReturn(this, (DropdownItem.__proto__ || Object.getPrototypeOf(DropdownItem)).call(this, props)); + + _this.onClick = _this.onClick.bind(_this); + _this.getTabIndex = _this.getTabIndex.bind(_this); + return _this; + } + + createClass(DropdownItem, [{ + key: 'onClick', + value: function onClick(e) { + if (this.props.disabled || this.props.header || this.props.divider) { + e.preventDefault(); + return; + } + + if (this.props.onClick) { + this.props.onClick(e); + } + + if (this.props.toggle) { + this.context.toggle(e); + } + } + }, { + key: 'getTabIndex', + value: function getTabIndex() { + if (this.props.disabled || this.props.header || this.props.divider) { + return '-1'; + } + + return '0'; + } + }, { + key: 'render', + value: function render() { + var tabIndex = this.getTabIndex(); + + var _omit = omit(this.props, ['toggle']), + className = _omit.className, + cssModule = _omit.cssModule, + divider = _omit.divider, + Tag = _omit.tag, + header = _omit.header, + active = _omit.active, + props = objectWithoutProperties(_omit, ['className', 'cssModule', 'divider', 'tag', 'header', 'active']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { + disabled: props.disabled, + 'dropdown-item': !divider && !header, + active: active, + 'dropdown-header': header, + 'dropdown-divider': divider + }), cssModule); + + if (Tag === 'button') { + if (header) { + Tag = 'h6'; + } else if (divider) { + Tag = 'div'; + } else if (props.href) { + Tag = 'a'; + } + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ + type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined + }, props, { + tabIndex: tabIndex, + className: classes, + onClick: this.onClick + })); + } + }]); + return DropdownItem; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +DropdownItem.propTypes = propTypes$16; +DropdownItem.defaultProps = defaultProps$15; +DropdownItem.contextTypes = contextTypes; + +var propTypes$17 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node.isRequired, + right: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + flip: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$16 = { + tag: 'div', + flip: true +}; + +var contextTypes$1 = { + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['up', 'down', 'left', 'right']).isRequired, + inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired +}; + +var noFlipModifier = { flip: { enabled: false } }; + +var directionPositionMap = { + up: 'top', + left: 'left', + right: 'right', + down: 'bottom' +}; + +var DropdownMenu = function DropdownMenu(props, context) { + var className = props.className, + cssModule = props.cssModule, + right = props.right, + tag = props.tag, + flip = props.flip, + attrs = objectWithoutProperties(props, ['className', 'cssModule', 'right', 'tag', 'flip']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'dropdown-menu', { + 'dropdown-menu-right': right, + show: context.isOpen + }), cssModule); + + var Tag = tag; + + if (context.isOpen && !context.inNavbar) { + Tag = __WEBPACK_IMPORTED_MODULE_6_react_popper__["Popper"]; + + var position1 = directionPositionMap[context.direction] || 'bottom'; + var position2 = right ? 'end' : 'start'; + attrs.placement = position1 + '-' + position2; + attrs.component = tag; + attrs.modifiers = !flip ? noFlipModifier : undefined; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ + tabIndex: '-1', + role: 'menu' + }, attrs, { + 'aria-hidden': !context.isOpen, + className: classes + })); +}; + +DropdownMenu.propTypes = propTypes$17; +DropdownMenu.defaultProps = defaultProps$16; +DropdownMenu.contextTypes = contextTypes$1; + +var propTypes$18 = { + caret: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + 'aria-haspopup': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + split: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + nav: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var defaultProps$17 = { + 'aria-haspopup': true, + color: 'secondary' +}; + +var contextTypes$2 = { + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired +}; + +var DropdownToggle = function (_React$Component) { + inherits(DropdownToggle, _React$Component); + + function DropdownToggle(props) { + classCallCheck(this, DropdownToggle); + + var _this = possibleConstructorReturn(this, (DropdownToggle.__proto__ || Object.getPrototypeOf(DropdownToggle)).call(this, props)); + + _this.onClick = _this.onClick.bind(_this); + return _this; + } + + createClass(DropdownToggle, [{ + key: 'onClick', + value: function onClick(e) { + if (this.props.disabled) { + e.preventDefault(); + return; + } + + if (this.props.nav && !this.props.tag) { + e.preventDefault(); + } + + if (this.props.onClick) { + this.props.onClick(e); + } + + this.context.toggle(e); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + color = _props.color, + cssModule = _props.cssModule, + caret = _props.caret, + split = _props.split, + nav = _props.nav, + tag = _props.tag, + props = objectWithoutProperties(_props, ['className', 'color', 'cssModule', 'caret', 'split', 'nav', 'tag']); + + var ariaLabel = props['aria-label'] || 'Toggle Dropdown'; + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { + 'dropdown-toggle': caret || split, + 'dropdown-toggle-split': split, + 'nav-link': nav + }), cssModule); + var children = props.children || __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { className: 'sr-only' }, + ariaLabel + ); + + var Tag = void 0; + + if (nav && !tag) { + Tag = 'a'; + props.href = '#'; + } else if (!tag) { + Tag = Button; + props.color = color; + props.cssModule = cssModule; + } else { + Tag = tag; + } + + if (this.context.inNavbar) { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, props, { + className: classes, + onClick: this.onClick, + 'aria-expanded': this.context.isOpen, + children: children + })); + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Target"], _extends({}, props, { + className: classes, + component: Tag, + onClick: this.onClick, + 'aria-expanded': this.context.isOpen, + children: children + })); + } + }]); + return DropdownToggle; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +DropdownToggle.propTypes = propTypes$18; +DropdownToggle.defaultProps = defaultProps$17; +DropdownToggle.contextTypes = contextTypes$2; + +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var PropTypes$1 = createCommonjsModule(function (module, exports) { + 'use strict'; + + exports.__esModule = true; + exports.classNamesShape = exports.timeoutsShape = undefined; + exports.transitionTimeout = transitionTimeout; + + var _propTypes2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + + function transitionTimeout(transitionType) { + var timeoutPropName = 'transition' + transitionType + 'Timeout'; + var enabledPropName = 'transition' + transitionType; + + return function (props) { + // If the transition is enabled + if (props[enabledPropName]) { + // If no timeout duration is provided + if (props[timeoutPropName] == null) { + return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); + + // If the duration isn't a number + } else if (typeof props[timeoutPropName] !== 'number') { + return new Error(timeoutPropName + ' must be a number (in milliseconds)'); + } + } + + return null; + }; + } + + var timeoutsShape = exports.timeoutsShape = _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ + enter: _propTypes2.default.number, + exit: _propTypes2.default.number + }).isRequired]); + + var classNamesShape = exports.classNamesShape = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ + enter: _propTypes2.default.string, + exit: _propTypes2.default.string, + active: _propTypes2.default.string + }), _propTypes2.default.shape({ + enter: _propTypes2.default.string, + enterActive: _propTypes2.default.string, + exit: _propTypes2.default.string, + exitActive: _propTypes2.default.string + })]); +}); + +unwrapExports(PropTypes$1); + +var Transition_1 = createCommonjsModule(function (module, exports) { + 'use strict'; + + exports.__esModule = true; + exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined; + + var PropTypes$$1 = _interopRequireWildcard(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a); + + var _react2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_0_react___default.a); + + var _reactDom2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_5_react_dom___default.a); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {};if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + }newObj.default = obj;return newObj; + } + } + + function _objectWithoutProperties(obj, keys) { + var target = {};for (var i in obj) { + if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i]; + }return target; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass))); + }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + } + + var UNMOUNTED = exports.UNMOUNTED = 'unmounted'; + var EXITED = exports.EXITED = 'exited'; + var ENTERING = exports.ENTERING = 'entering'; + var ENTERED = exports.ENTERED = 'entered'; + var EXITING = exports.EXITING = 'exiting'; + + /** + * The Transition component lets you describe a transition from one component + * state to another _over time_ with a simple declarative API. Most commonly + * it's used to animate the mounting and unmounting of a component, but can also + * be used to describe in-place transition states as well. + * + * By default the `Transition` component does not alter the behavior of the + * component it renders, it only tracks "enter" and "exit" states for the components. + * It's up to you to give meaning and effect to those states. For example we can + * add styles to a component when it enters or exits: + * + * ```jsx + * import Transition from 'react-transition-group/Transition'; + * + * const duration = 300; + * + * const defaultStyle = { + * transition: `opacity ${duration}ms ease-in-out`, + * opacity: 0, + * } + * + * const transitionStyles = { + * entering: { opacity: 0 }, + * entered: { opacity: 1 }, + * }; + * + * const Fade = ({ in: inProp }) => ( + * + * {(state) => ( + *
+ * I'm A fade Transition! + *
+ * )} + *
+ * ); + * ``` + * + * As noted the `Transition` component doesn't _do_ anything by itself to its child component. + * What it does do is track transition states over time so you can update the + * component (such as by adding styles or classes) when it changes states. + * + * There are 4 main states a Transition can be in: + * - `ENTERING` + * - `ENTERED` + * - `EXITING` + * - `EXITED` + * + * Transition state is toggled via the `in` prop. When `true` the component begins the + * "Enter" stage. During this stage, the component will shift from its current transition state, + * to `'entering'` for the duration of the transition and then to the `'entered'` stage once + * it's complete. Let's take the following example: + * + * ```jsx + * state= { in: false }; + * + * toggleEnterState = () => { + * this.setState({ in: true }); + * } + * + * render() { + * return ( + *
+ * + * + *
+ * ); + * } + * ``` + * + * When the button is clicked the component will shift to the `'entering'` state and + * stay there for 500ms (the value of `timeout`) when finally switches to `'entered'`. + * + * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`. + */ + + var Transition = function (_React$Component) { + _inherits(Transition, _React$Component); + + function Transition(props, context) { + _classCallCheck(this, Transition); + + var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); + + var parentGroup = context.transitionGroup; + // In the context of a TransitionGroup all enters are really appears + var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; + + var initialStatus = void 0; + _this.nextStatus = null; + + if (props.in) { + if (appear) { + initialStatus = EXITED; + _this.nextStatus = ENTERING; + } else { + initialStatus = ENTERED; + } + } else { + if (props.unmountOnExit || props.mountOnEnter) { + initialStatus = UNMOUNTED; + } else { + initialStatus = EXITED; + } + } + + _this.state = { status: initialStatus }; + + _this.nextCallback = null; + return _this; + } + + Transition.prototype.getChildContext = function getChildContext() { + return { transitionGroup: null }; // allows for nested Transitions + }; + + Transition.prototype.componentDidMount = function componentDidMount() { + this.updateStatus(true); + }; + + Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var _ref = this.pendingState || this.state, + status = _ref.status; + + if (nextProps.in) { + if (status === UNMOUNTED) { + this.setState({ status: EXITED }); + } + if (status !== ENTERING && status !== ENTERED) { + this.nextStatus = ENTERING; + } + } else { + if (status === ENTERING || status === ENTERED) { + this.nextStatus = EXITING; + } + } + }; + + Transition.prototype.componentDidUpdate = function componentDidUpdate() { + this.updateStatus(); + }; + + Transition.prototype.componentWillUnmount = function componentWillUnmount() { + this.cancelNextCallback(); + }; + + Transition.prototype.getTimeouts = function getTimeouts() { + var timeout = this.props.timeout; + + var exit = void 0, + enter = void 0, + appear = void 0; + + exit = enter = appear = timeout; + + if (timeout != null && typeof timeout !== 'number') { + exit = timeout.exit; + enter = timeout.enter; + appear = timeout.appear; + } + return { exit: exit, enter: enter, appear: appear }; + }; + + Transition.prototype.updateStatus = function updateStatus() { + var mounting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var nextStatus = this.nextStatus; + + if (nextStatus !== null) { + this.nextStatus = null; + // nextStatus will always be ENTERING or EXITING. + this.cancelNextCallback(); + var node = _reactDom2.default.findDOMNode(this); + + if (nextStatus === ENTERING) { + this.performEnter(node, mounting); + } else { + this.performExit(node); + } + } else if (this.props.unmountOnExit && this.state.status === EXITED) { + this.setState({ status: UNMOUNTED }); + } + }; + + Transition.prototype.performEnter = function performEnter(node, mounting) { + var _this2 = this; + + var enter = this.props.enter; + + var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting; + + var timeouts = this.getTimeouts(); + + // no enter animation skip right to ENTERED + // if we are mounting and running this it means appear _must_ be set + if (!mounting && !enter) { + this.safeSetState({ status: ENTERED }, function () { + _this2.props.onEntered(node); + }); + return; + } + + this.props.onEnter(node, appearing); + + this.safeSetState({ status: ENTERING }, function () { + _this2.props.onEntering(node, appearing); + + // FIXME: appear timeout? + _this2.onTransitionEnd(node, timeouts.enter, function () { + _this2.safeSetState({ status: ENTERED }, function () { + _this2.props.onEntered(node, appearing); + }); + }); + }); + }; + + Transition.prototype.performExit = function performExit(node) { + var _this3 = this; + + var exit = this.props.exit; + + var timeouts = this.getTimeouts(); + + // no exit animation skip right to EXITED + if (!exit) { + this.safeSetState({ status: EXITED }, function () { + _this3.props.onExited(node); + }); + return; + } + this.props.onExit(node); + + this.safeSetState({ status: EXITING }, function () { + _this3.props.onExiting(node); + + _this3.onTransitionEnd(node, timeouts.exit, function () { + _this3.safeSetState({ status: EXITED }, function () { + _this3.props.onExited(node); + }); + }); + }); + }; + + Transition.prototype.cancelNextCallback = function cancelNextCallback() { + if (this.nextCallback !== null) { + this.nextCallback.cancel(); + this.nextCallback = null; + } + }; + + Transition.prototype.safeSetState = function safeSetState(nextState, callback) { + var _this4 = this; + + // We need to track pending updates for instances where a cWRP fires quickly + // after cDM and before the state flushes, which would double trigger a + // transition + this.pendingState = nextState; + + // This shouldn't be necessary, but there are weird race conditions with + // setState callbacks and unmounting in testing, so always make sure that + // we can cancel any pending setState callbacks after we unmount. + callback = this.setNextCallback(callback); + this.setState(nextState, function () { + _this4.pendingState = null; + callback(); + }); + }; + + Transition.prototype.setNextCallback = function setNextCallback(callback) { + var _this5 = this; + + var active = true; + + this.nextCallback = function (event) { + if (active) { + active = false; + _this5.nextCallback = null; + + callback(event); + } + }; + + this.nextCallback.cancel = function () { + active = false; + }; + + return this.nextCallback; + }; + + Transition.prototype.onTransitionEnd = function onTransitionEnd(node, timeout, handler) { + this.setNextCallback(handler); + + if (node) { + if (this.props.addEndListener) { + this.props.addEndListener(node, this.nextCallback); + } + if (timeout != null) { + setTimeout(this.nextCallback, timeout); + } + } else { + setTimeout(this.nextCallback, 0); + } + }; + + Transition.prototype.render = function render() { + var status = this.state.status; + if (status === UNMOUNTED) { + return null; + } + + var _props = this.props, + children = _props.children, + childProps = _objectWithoutProperties(_props, ['children']); + // filter props for Transtition + + + delete childProps.in; + delete childProps.mountOnEnter; + delete childProps.unmountOnExit; + delete childProps.appear; + delete childProps.enter; + delete childProps.exit; + delete childProps.timeout; + delete childProps.addEndListener; + delete childProps.onEnter; + delete childProps.onEntering; + delete childProps.onEntered; + delete childProps.onExit; + delete childProps.onExiting; + delete childProps.onExited; + + if (typeof children === 'function') { + return children(status, childProps); + } + + var child = _react2.default.Children.only(children); + return _react2.default.cloneElement(child, childProps); + }; + + return Transition; + }(_react2.default.Component); + + Transition.contextTypes = { + transitionGroup: PropTypes$$1.object + }; + Transition.childContextTypes = { + transitionGroup: function transitionGroup() {} + }; + + Transition.propTypes = true ? { + /** + * A `function` child can be used instead of a React element. + * This function is called with the current transition status + * ('entering', 'entered', 'exiting', 'exited', 'unmounted'), which can used + * to apply context specific props to a component. + * + * ```jsx + * + * {(status) => ( + * + * )} + * + * ``` + */ + children: PropTypes$$1.oneOfType([PropTypes$$1.func.isRequired, PropTypes$$1.element.isRequired]).isRequired, + + /** + * Show the component; triggers the enter or exit states + */ + in: PropTypes$$1.bool, + + /** + * By default the child component is mounted immediately along with + * the parent `Transition` component. If you want to "lazy mount" the component on the + * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay + * mounted, even on "exited", unless you also specify `unmountOnExit`. + */ + mountOnEnter: PropTypes$$1.bool, + + /** + * By default the child component stays mounted after it reaches the `'exited'` state. + * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. + */ + unmountOnExit: PropTypes$$1.bool, + + /** + * Normally a component is not transitioned if it is shown when the `` component mounts. + * If you want to transition on the first mount set `appear` to `true`, and the + * component will transition in as soon as the `` mounts. + * + * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition. + */ + appear: PropTypes$$1.bool, + + /** + * Enable or disable enter transitions. + */ + enter: PropTypes$$1.bool, + + /** + * Enable or disable exit transitions. + */ + exit: PropTypes$$1.bool, + + /** + * The duration of the transition, in milliseconds. + * Required unless `addEventListener` is provided + * + * You may specify a single timeout for all transitions like: `timeout={500}`, + * or individually like: + * + * ```jsx + * timeout={{ + * enter: 300, + * exit: 500, + * }} + * ``` + * + * @type {number | { enter?: number, exit?: number }} + */ + timeout: function timeout(props) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var pt = PropTypes$1.timeoutsShape; + if (!props.addEndListener) pt = pt.isRequired; + return pt.apply(undefined, [props].concat(args)); + }, + + /** + * Add a custom transition end trigger. Called with the transitioning + * DOM node and a `done` callback. Allows for more fine grained transition end + * logic. **Note:** Timeouts are still used as a fallback if provided. + * + * ```jsx + * addEndListener={(node, done) => { + * // use the css transitionend event to mark the finish of a transition + * node.addEventListener('transitionend', done, false); + * }} + * ``` + */ + addEndListener: PropTypes$$1.func, + + /** + * Callback fired before the "entering" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * @type Function(node: HtmlElement, isAppearing: bool) -> void + */ + onEnter: PropTypes$$1.func, + + /** + * Callback fired after the "entering" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * @type Function(node: HtmlElement, isAppearing: bool) + */ + onEntering: PropTypes$$1.func, + + /** + * Callback fired after the "entered" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * @type Function(node: HtmlElement, isAppearing: bool) -> void + */ + onEntered: PropTypes$$1.func, + + /** + * Callback fired before the "exiting" status is applied. + * + * @type Function(node: HtmlElement) -> void + */ + onExit: PropTypes$$1.func, + + /** + * Callback fired after the "exiting" status is applied. + * + * @type Function(node: HtmlElement) -> void + */ + onExiting: PropTypes$$1.func, + + /** + * Callback fired after the "exited" status is applied. + * + * @type Function(node: HtmlElement) -> void + */ + onExited: PropTypes$$1.func + } : {}; + + // Name the function so it is clearer in the documentation + function noop() {} + + Transition.defaultProps = { + in: false, + mountOnEnter: false, + unmountOnExit: false, + appear: false, + enter: true, + exit: true, + + onEnter: noop, + onEntering: noop, + onEntered: noop, + + onExit: noop, + onExiting: noop, + onExited: noop + }; + + Transition.UNMOUNTED = 0; + Transition.EXITED = 1; + Transition.ENTERING = 2; + Transition.ENTERED = 3; + Transition.EXITING = 4; + + exports.default = Transition; +}); + +var Transition = unwrapExports(Transition_1); + +var propTypes$19 = _extends({}, Transition.propTypes, { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node]), + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]), + baseClass: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + baseClassActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}); + +var defaultProps$18 = _extends({}, Transition.defaultProps, { + tag: 'div', + baseClass: 'fade', + baseClassActive: 'show', + timeout: TransitionTimeouts.Fade, + appear: true, + enter: true, + exit: true, + in: true +}); + +function Fade(props) { + var Tag = props.tag, + baseClass = props.baseClass, + baseClassActive = props.baseClassActive, + className = props.className, + cssModule = props.cssModule, + children = props.children, + otherProps = objectWithoutProperties(props, ['tag', 'baseClass', 'baseClassActive', 'className', 'cssModule', 'children']); + + // In NODE_ENV=production the Transition.propTypes are wrapped which results in an + // empty object "{}". This is the result of the `react-transition-group` babel + // configuration settings. Therefore, to ensure that production builds work without + // error, we can either explicitly define keys or use the Transition.defaultProps. + // Using the Transition.defaultProps excludes any required props. Thus, the best + // solution is to explicitly define required props in our utilities and reference these. + // This also gives us more flexibility in the future to remove the prop-types + // dependency in distribution builds (Similar to how `react-transition-group` does). + // Note: Without omitting the `react-transition-group` props, the resulting child + // Tag component would inherit the Transition properties as attributes for the HTML + // element which results in errors/warnings for non-valid attributes. + + var transitionProps = pick(otherProps, TransitionPropTypeKeys); + var childProps = omit(otherProps, TransitionPropTypeKeys); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Transition, + transitionProps, + function (status) { + var isActive = status === 'entered'; + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, baseClass, isActive && baseClassActive), cssModule); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + _extends({ className: classes }, childProps), + children + ); + } + ); +} + +Fade.propTypes = propTypes$19; +Fade.defaultProps = defaultProps$18; + +var propTypes$20 = { + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + pill: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$19 = { + color: 'secondary', + pill: false, + tag: 'span' +}; + +var Badge = function Badge(props) { + var className = props.className, + cssModule = props.cssModule, + color = props.color, + pill = props.pill, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'color', 'pill', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule); + + if (attributes.href && Tag === 'span') { + Tag = 'a'; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Badge.propTypes = propTypes$20; +Badge.defaultProps = defaultProps$19; + +var propTypes$21 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + inverse: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + block: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the props "body"'), + body: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + outline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$20 = { + tag: 'div' +}; + +var Card = function Card(props) { + var className = props.className, + cssModule = props.cssModule, + color = props.color, + block = props.block, + body = props.body, + inverse = props.inverse, + outline = props.outline, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'color', 'block', 'body', 'inverse', 'outline', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card', inverse ? 'text-white' : false, block || body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + '-' + color : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Card.propTypes = propTypes$21; +Card.defaultProps = defaultProps$20; + +var propTypes$22 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$21 = { + tag: 'div' +}; + +var CardGroup = function CardGroup(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-group'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardGroup.propTypes = propTypes$22; +CardGroup.defaultProps = defaultProps$21; + +var propTypes$23 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$22 = { + tag: 'div' +}; + +var CardDeck = function CardDeck(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-deck'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardDeck.propTypes = propTypes$23; +CardDeck.defaultProps = defaultProps$22; + +var propTypes$24 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$23 = { + tag: 'div' +}; + +var CardColumns = function CardColumns(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-columns'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardColumns.propTypes = propTypes$24; +CardColumns.defaultProps = defaultProps$23; + +var propTypes$25 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$24 = { + tag: 'div' +}; + +var CardBody = function CardBody(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-body'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardBody.propTypes = propTypes$25; +CardBody.defaultProps = defaultProps$24; + +function CardBlock(props) { + warnOnce('The "CardBlock" component has been deprecated.\nPlease use component "CardBody".'); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CardBody, props); +} + +var propTypes$26 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$25 = { + tag: 'a' +}; + +var CardLink = function CardLink(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + innerRef = props.innerRef, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'innerRef']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-link'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); +}; + +CardLink.propTypes = propTypes$26; +CardLink.defaultProps = defaultProps$25; + +var propTypes$27 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$26 = { + tag: 'div' +}; + +var CardFooter = function CardFooter(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-footer'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardFooter.propTypes = propTypes$27; +CardFooter.defaultProps = defaultProps$26; + +var propTypes$28 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$27 = { + tag: 'div' +}; + +var CardHeader = function CardHeader(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-header'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardHeader.propTypes = propTypes$28; +CardHeader.defaultProps = defaultProps$27; + +var propTypes$29 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + top: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + bottom: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$28 = { + tag: 'img' +}; + +var CardImg = function CardImg(props) { + var className = props.className, + cssModule = props.cssModule, + top = props.top, + bottom = props.bottom, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'top', 'bottom', 'tag']); + + + var cardImgClassName = 'card-img'; + if (top) { + cardImgClassName = 'card-img-top'; + } + if (bottom) { + cardImgClassName = 'card-img-bottom'; + } + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, cardImgClassName), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardImg.propTypes = propTypes$29; +CardImg.defaultProps = defaultProps$28; + +var propTypes$30 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$29 = { + tag: 'div' +}; + +var CardImgOverlay = function CardImgOverlay(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-img-overlay'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardImgOverlay.propTypes = propTypes$30; +CardImgOverlay.defaultProps = defaultProps$29; + +var CarouselItem = function (_React$Component) { + inherits(CarouselItem, _React$Component); + + function CarouselItem(props) { + classCallCheck(this, CarouselItem); + + var _this = possibleConstructorReturn(this, (CarouselItem.__proto__ || Object.getPrototypeOf(CarouselItem)).call(this, props)); + + _this.state = { + startAnimation: false + }; + + _this.onEnter = _this.onEnter.bind(_this); + _this.onEntering = _this.onEntering.bind(_this); + _this.onExit = _this.onExit.bind(_this); + _this.onExiting = _this.onExiting.bind(_this); + _this.onExited = _this.onExited.bind(_this); + return _this; + } + + createClass(CarouselItem, [{ + key: 'onEnter', + value: function onEnter(node, isAppearing) { + this.setState({ startAnimation: false }); + this.props.onEnter(node, isAppearing); + } + }, { + key: 'onEntering', + value: function onEntering(node, isAppearing) { + // getting this variable triggers a reflow + var offsetHeight = node.offsetHeight; + this.setState({ startAnimation: true }); + this.props.onEntering(node, isAppearing); + return offsetHeight; + } + }, { + key: 'onExit', + value: function onExit(node) { + this.setState({ startAnimation: false }); + this.props.onExit(node); + } + }, { + key: 'onExiting', + value: function onExiting(node) { + this.setState({ startAnimation: true }); + node.dispatchEvent(new CustomEvent('slide.bs.carousel')); + this.props.onExiting(node); + } + }, { + key: 'onExited', + value: function onExited(node) { + node.dispatchEvent(new CustomEvent('slid.bs.carousel')); + this.props.onExited(node); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props = this.props, + isIn = _props.in, + children = _props.children, + cssModule = _props.cssModule, + slide = _props.slide, + Tag = _props.tag, + className = _props.className, + transitionProps = objectWithoutProperties(_props, ['in', 'children', 'cssModule', 'slide', 'tag', 'className']); + + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Transition, + _extends({}, transitionProps, { + enter: slide, + exit: slide, + 'in': isIn, + onEnter: this.onEnter, + onEntering: this.onEntering, + onExit: this.onExit, + onExiting: this.onExiting, + onExited: this.onExited + }), + function (status) { + var direction = _this2.context.direction; + + var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING; + var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right'); + var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev'); + var itemClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + { className: itemClasses }, + children + ); + } + ); + } + }]); + return CarouselItem; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +CarouselItem.propTypes = _extends({}, Transition.propTypes, { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + in: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + slide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}); + +CarouselItem.defaultProps = _extends({}, Transition.defaultProps, { + tag: 'div', + timeout: TransitionTimeouts.Carousel, + slide: true +}); + +CarouselItem.contextTypes = { + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var Carousel = function (_React$Component) { + inherits(Carousel, _React$Component); + + function Carousel(props) { + classCallCheck(this, Carousel); + + var _this = possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, props)); + + _this.handleKeyPress = _this.handleKeyPress.bind(_this); + _this.renderItems = _this.renderItems.bind(_this); + _this.hoverStart = _this.hoverStart.bind(_this); + _this.hoverEnd = _this.hoverEnd.bind(_this); + _this.state = { + direction: 'right', + indicatorClicked: false + }; + return _this; + } + + createClass(Carousel, [{ + key: 'getChildContext', + value: function getChildContext() { + return { direction: this.state.direction }; + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + // Set up the cycle + if (this.props.ride === 'carousel') { + this.setInterval(); + } + + // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page. + document.addEventListener('keyup', this.handleKeyPress); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + this.setInterval(nextProps); + // Calculate the direction to turn + if (this.props.activeIndex + 1 === nextProps.activeIndex) { + this.setState({ direction: 'right' }); + } else if (this.props.activeIndex - 1 === nextProps.activeIndex) { + this.setState({ direction: 'left' }); + } else if (this.props.activeIndex > nextProps.activeIndex) { + this.setState({ direction: this.state.indicatorClicked ? 'left' : 'right' }); + } else if (this.props.activeIndex !== nextProps.activeIndex) { + this.setState({ direction: this.state.indicatorClicked ? 'right' : 'left' }); + } + this.setState({ indicatorClicked: false }); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.clearInterval(); + document.removeEventListener('keyup', this.handleKeyPress); + } + }, { + key: 'setInterval', + value: function (_setInterval) { + function setInterval() { + return _setInterval.apply(this, arguments); + } + + setInterval.toString = function () { + return _setInterval.toString(); + }; + + return setInterval; + }(function () { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + + // make sure not to have multiple intervals going... + this.clearInterval(); + if (props.interval) { + this.cycleInterval = setInterval(function () { + props.next(); + }, parseInt(props.interval, 10)); + } + }) + }, { + key: 'clearInterval', + value: function (_clearInterval) { + function clearInterval() { + return _clearInterval.apply(this, arguments); + } + + clearInterval.toString = function () { + return _clearInterval.toString(); + }; + + return clearInterval; + }(function () { + clearInterval(this.cycleInterval); + }) + }, { + key: 'hoverStart', + value: function hoverStart() { + if (this.props.pause === 'hover') { + this.clearInterval(); + } + if (this.props.mouseEnter) { + var _props; + + (_props = this.props).mouseEnter.apply(_props, arguments); + } + } + }, { + key: 'hoverEnd', + value: function hoverEnd() { + if (this.props.pause === 'hover') { + this.setInterval(); + } + if (this.props.mouseLeave) { + var _props2; + + (_props2 = this.props).mouseLeave.apply(_props2, arguments); + } + } + }, { + key: 'handleKeyPress', + value: function handleKeyPress(evt) { + if (this.props.keyboard) { + if (evt.keyCode === 37) { + this.props.previous(); + } else if (evt.keyCode === 39) { + this.props.next(); + } + } + } + }, { + key: 'renderItems', + value: function renderItems(carouselItems, className) { + var _this2 = this; + + var slide = this.props.slide; + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { role: 'listbox', className: className }, + carouselItems.map(function (item, index) { + var isIn = index === _this2.props.activeIndex; + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(item, { + in: isIn, + slide: slide + }); + }) + ); + } + }, { + key: 'render', + value: function render() { + var _this3 = this; + + var _props3 = this.props, + children = _props3.children, + cssModule = _props3.cssModule, + slide = _props3.slide, + className = _props3.className; + + var outerClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel', slide && 'slide'), cssModule); + + var innerClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('carousel-inner'), cssModule); + + var slidesOnly = children.every(function (child) { + return child.type === CarouselItem; + }); + + // Rendering only slides + if (slidesOnly) { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, + this.renderItems(children, innerClasses) + ); + } + + // Rendering slides and controls + if (children[0] instanceof Array) { + var _carouselItems = children[0]; + var _controlLeft = children[1]; + var _controlRight = children[2]; + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, + this.renderItems(_carouselItems, innerClasses), + _controlLeft, + _controlRight + ); + } + + // Rendering indicators, slides and controls + var indicators = children[0]; + var wrappedOnClick = function wrappedOnClick(e) { + if (typeof indicators.props.onClickHandler === 'function') { + _this3.setState({ indicatorClicked: true }, function () { + return indicators.props.onClickHandler(e); + }); + } + }; + var wrappedIndicators = __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(indicators, { onClickHandler: wrappedOnClick }); + var carouselItems = children[1]; + var controlLeft = children[2]; + var controlRight = children[3]; + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, + wrappedIndicators, + this.renderItems(carouselItems, innerClasses), + controlLeft, + controlRight + ); + } + }]); + return Carousel; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Carousel.propTypes = { + // the current active slide of the carousel + activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + // a function which should advance the carousel to the next slide (via activeIndex) + next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + // a function which should advance the carousel to the previous slide (via activeIndex) + previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + // controls if the left and right arrow keys should control the carousel + keyboard: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on + * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover") + */ + pause: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hover', false]), + // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load. + // This is how bootstrap defines it... I would prefer a bool named autoplay or something... + ride: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['carousel']), + // the interval at which the carousel automatically cycles (default: 5000) + // eslint-disable-next-line react/no-unused-prop-types + interval: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool]), + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array, + // called when the mouse enters the Carousel + mouseEnter: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + // called when the mouse exits the Carousel + mouseLeave: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + // controls whether the slide animation on the Carousel works or not + slide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +Carousel.defaultProps = { + interval: 5000, + pause: 'hover', + keyboard: true, + slide: true +}; + +Carousel.childContextTypes = { + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var CarouselControl = function CarouselControl(props) { + var direction = props.direction, + onClickHandler = props.onClickHandler, + cssModule = props.cssModule, + directionText = props.directionText, + className = props.className; + + + var anchorClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-control-' + direction), cssModule); + + var iconClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('carousel-control-' + direction + '-icon'), cssModule); + + var screenReaderClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('sr-only'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'a', + { + className: anchorClasses, + role: 'button', + tabIndex: '0', + onClick: function onClick(e) { + e.preventDefault(); + onClickHandler(); + } + }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span', { className: iconClasses, 'aria-hidden': 'true' }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { className: screenReaderClasses }, + directionText || direction + ) + ); +}; + +CarouselControl.propTypes = { + direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prev', 'next']).isRequired, + onClickHandler: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + directionText: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var CarouselIndicators = function CarouselIndicators(props) { + var items = props.items, + activeIndex = props.activeIndex, + cssModule = props.cssModule, + onClickHandler = props.onClickHandler, + className = props.className; + + + var listClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-indicators'), cssModule); + var indicators = items.map(function (item, idx) { + var indicatorClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()({ active: activeIndex === idx }), cssModule); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('li', { + key: '' + (item.key || item.src) + item.caption + item.altText, + onClick: function onClick(e) { + e.preventDefault(); + onClickHandler(idx); + }, + className: indicatorClasses + }); + }); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'ol', + { className: listClasses }, + indicators + ); +}; + +CarouselIndicators.propTypes = { + items: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array.isRequired, + activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number.isRequired, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + onClickHandler: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var CarouselCaption = function CarouselCaption(props) { + var captionHeader = props.captionHeader, + captionText = props.captionText, + cssModule = props.cssModule, + className = props.className; + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { className: classes }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'h3', + null, + captionHeader + ), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'p', + null, + captionText + ) + ); +}; + +CarouselCaption.propTypes = { + captionHeader: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + captionText: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var propTypes$31 = { + items: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array.isRequired, + indicators: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + controls: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + autoPlay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, + next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + goToIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func +}; + +var UncontrolledCarousel = function (_Component) { + inherits(UncontrolledCarousel, _Component); + + function UncontrolledCarousel(props) { + classCallCheck(this, UncontrolledCarousel); + + var _this = possibleConstructorReturn(this, (UncontrolledCarousel.__proto__ || Object.getPrototypeOf(UncontrolledCarousel)).call(this, props)); + + _this.animating = false; + _this.state = { activeIndex: 0 }; + _this.next = _this.next.bind(_this); + _this.previous = _this.previous.bind(_this); + _this.goToIndex = _this.goToIndex.bind(_this); + _this.onExiting = _this.onExiting.bind(_this); + _this.onExited = _this.onExited.bind(_this); + return _this; + } + + createClass(UncontrolledCarousel, [{ + key: 'onExiting', + value: function onExiting() { + this.animating = true; + } + }, { + key: 'onExited', + value: function onExited() { + this.animating = false; + } + }, { + key: 'next', + value: function next() { + if (this.animating) return; + var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1; + this.setState({ activeIndex: nextIndex }); + } + }, { + key: 'previous', + value: function previous() { + if (this.animating) return; + var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1; + this.setState({ activeIndex: nextIndex }); + } + }, { + key: 'goToIndex', + value: function goToIndex(newIndex) { + if (this.animating) return; + this.setState({ activeIndex: newIndex }); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props = this.props, + autoPlay = _props.autoPlay, + indicators = _props.indicators, + controls = _props.controls, + items = _props.items, + goToIndex = _props.goToIndex, + props = objectWithoutProperties(_props, ['autoPlay', 'indicators', 'controls', 'items', 'goToIndex']); + var activeIndex = this.state.activeIndex; + + + var slides = items.map(function (item) { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + CarouselItem, + { + onExiting: _this2.onExiting, + onExited: _this2.onExited, + key: item.src + }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('img', { src: item.src, alt: item.altText }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselCaption, { captionText: item.caption, captionHeader: item.caption }) + ); + }); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Carousel, + _extends({ + activeIndex: activeIndex, + next: this.next, + previous: this.previous, + ride: autoPlay ? 'carousel' : undefined + }, props), + indicators && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselIndicators, { + items: items, + activeIndex: props.activeIndex || activeIndex, + onClickHandler: goToIndex || this.goToIndex + }), + slides, + controls && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselControl, { + direction: 'prev', + directionText: 'Previous', + onClickHandler: props.previous || this.previous + }), + controls && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselControl, { + direction: 'next', + directionText: 'Next', + onClickHandler: props.next || this.next + }) + ); + } + }]); + return UncontrolledCarousel; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +UncontrolledCarousel.propTypes = propTypes$31; +UncontrolledCarousel.defaultProps = { + controls: true, + indicators: true, + autoPlay: true +}; + +var propTypes$32 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$30 = { + tag: 'h6' +}; + +var CardSubtitle = function CardSubtitle(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-subtitle'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardSubtitle.propTypes = propTypes$32; +CardSubtitle.defaultProps = defaultProps$30; + +var propTypes$33 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$31 = { + tag: 'p' +}; + +var CardText = function CardText(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-text'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardText.propTypes = propTypes$33; +CardText.defaultProps = defaultProps$31; + +var propTypes$34 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$32 = { + tag: 'h5' +}; + +var CardTitle = function CardTitle(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-title'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +CardTitle.propTypes = propTypes$34; +CardTitle.defaultProps = defaultProps$32; + +var propTypes$35 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node.isRequired, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + hideArrow: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + offset: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), + fallbackPlacement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array]), + flip: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, + modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$33 = { + placement: 'auto', + hideArrow: false, + isOpen: false, + offset: 0, + fallbackPlacement: 'flip', + flip: true, + container: 'body', + modifiers: {} +}; + +var childContextTypes$1 = { + popperManager: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired +}; + +var PopperContent = function (_React$Component) { + inherits(PopperContent, _React$Component); + + function PopperContent(props) { + classCallCheck(this, PopperContent); + + var _this = possibleConstructorReturn(this, (PopperContent.__proto__ || Object.getPrototypeOf(PopperContent)).call(this, props)); + + _this.handlePlacementChange = _this.handlePlacementChange.bind(_this); + _this.setTargetNode = _this.setTargetNode.bind(_this); + _this.getTargetNode = _this.getTargetNode.bind(_this); + _this.state = {}; + return _this; + } + + createClass(PopperContent, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + popperManager: { + setTargetNode: this.setTargetNode, + getTargetNode: this.getTargetNode + } + }; + } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.handleProps(); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps) { + if (this.props.isOpen !== prevProps.isOpen) { + this.handleProps(); + } else if (this._element) { + // rerender + this.renderIntoSubtree(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.hide(); + } + }, { + key: 'setTargetNode', + value: function setTargetNode(node) { + this.targetNode = node; + } + }, { + key: 'getTargetNode', + value: function getTargetNode() { + return this.targetNode; + } + }, { + key: 'getContainerNode', + value: function getContainerNode() { + return getTarget(this.props.container); + } + }, { + key: 'handlePlacementChange', + value: function handlePlacementChange(data) { + if (this.state.placement !== data.placement) { + this.setState({ placement: data.placement }); + } + return data; + } + }, { + key: 'handleProps', + value: function handleProps() { + if (this.props.container !== 'inline') { + if (this.props.isOpen) { + this.show(); + } else { + this.hide(); + } + } + } + }, { + key: 'hide', + value: function hide() { + if (this._element) { + this.getContainerNode().removeChild(this._element); + __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unmountComponentAtNode(this._element); + this._element = null; + } + } + }, { + key: 'show', + value: function show() { + this._element = document.createElement('div'); + this.getContainerNode().appendChild(this._element); + this.renderIntoSubtree(); + if (this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) { + this._element.childNodes[0].focus(); + } + } + }, { + key: 'renderIntoSubtree', + value: function renderIntoSubtree() { + __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unstable_renderSubtreeIntoContainer(this, this.renderChildren(), this._element); + } + }, { + key: 'renderChildren', + value: function renderChildren() { + var _props = this.props, + cssModule = _props.cssModule, + children = _props.children, + isOpen = _props.isOpen, + flip = _props.flip, + target = _props.target, + offset = _props.offset, + fallbackPlacement = _props.fallbackPlacement, + placementPrefix = _props.placementPrefix, + hideArrow = _props.hideArrow, + className = _props.className, + tag = _props.tag, + container = _props.container, + modifiers = _props.modifiers, + attrs = objectWithoutProperties(_props, ['cssModule', 'children', 'isOpen', 'flip', 'target', 'offset', 'fallbackPlacement', 'placementPrefix', 'hideArrow', 'className', 'tag', 'container', 'modifiers']); + + var arrowClassName = mapToCssModules('arrow', cssModule); + var placement = (this.state.placement || attrs.placement).split('-')[0]; + var popperClassName = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, placementPrefix ? placementPrefix + '-' + placement : placement), this.props.cssModule); + + var extendedModifiers = _extends({ + offset: { offset: offset }, + flip: { enabled: flip, behavior: fallbackPlacement }, + update: { + enabled: true, + order: 950, + fn: this.handlePlacementChange + } + }, modifiers); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + __WEBPACK_IMPORTED_MODULE_6_react_popper__["Popper"], + _extends({ modifiers: extendedModifiers }, attrs, { component: tag, className: popperClassName }), + children, + !hideArrow && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Arrow"], { className: arrowClassName }) + ); + } + }, { + key: 'render', + value: function render() { + this.setTargetNode(getTarget(this.props.target)); + + if (this.props.container === 'inline') { + return this.props.isOpen ? this.renderChildren() : null; + } + + return null; + } + }]); + return PopperContent; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +PopperContent.propTypes = propTypes$35; +PopperContent.defaultProps = defaultProps$33; +PopperContent.childContextTypes = childContextTypes$1; + +var PopperTargetHelper = function PopperTargetHelper(props, context) { + context.popperManager.setTargetNode(getTarget(props.target)); + return null; +}; + +PopperTargetHelper.contextTypes = { + popperManager: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired +}; + +PopperTargetHelper.propTypes = { + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired +}; + +var propTypes$36 = { + placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(PopperPlacements), + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, + container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + hideArrow: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + innerClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + delay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ show: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, hide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number }), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), + modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var DEFAULT_DELAYS = { + show: 0, + hide: 0 +}; + +var defaultProps$34 = { + isOpen: false, + hideArrow: false, + placement: 'right', + placementPrefix: 'bs-popover', + delay: DEFAULT_DELAYS, + toggle: function toggle() {} +}; + +var Popover = function (_React$Component) { + inherits(Popover, _React$Component); + + function Popover(props) { + classCallCheck(this, Popover); + + var _this = possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).call(this, props)); + + _this.addTargetEvents = _this.addTargetEvents.bind(_this); + _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); + _this.removeTargetEvents = _this.removeTargetEvents.bind(_this); + _this.getRef = _this.getRef.bind(_this); + _this.toggle = _this.toggle.bind(_this); + _this.show = _this.show.bind(_this); + _this.hide = _this.hide.bind(_this); + return _this; + } + + createClass(Popover, [{ + key: 'componentDidMount', + value: function componentDidMount() { + this._target = getTarget(this.props.target); + this.handleProps(); + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate() { + this.handleProps(); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.clearShowTimeout(); + this.clearHideTimeout(); + this.removeTargetEvents(); + } + }, { + key: 'getRef', + value: function getRef(ref) { + this._popover = ref; + } + }, { + key: 'getDelay', + value: function getDelay(key) { + var delay = this.props.delay; + + if ((typeof delay === 'undefined' ? 'undefined' : _typeof(delay)) === 'object') { + return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key]; + } + return delay; + } + }, { + key: 'handleProps', + value: function handleProps() { + if (this.props.isOpen) { + this.show(); + } else { + this.hide(); + } + } + }, { + key: 'show', + value: function show() { + this.clearHideTimeout(); + this.addTargetEvents(); + if (!this.props.isOpen) { + this.clearShowTimeout(); + this._showTimeout = setTimeout(this.toggle, this.getDelay('show')); + } + } + }, { + key: 'hide', + value: function hide() { + this.clearShowTimeout(); + this.removeTargetEvents(); + if (this.props.isOpen) { + this.clearHideTimeout(); + this._hideTimeout = setTimeout(this.toggle, this.getDelay('hide')); + } + } + }, { + key: 'clearShowTimeout', + value: function clearShowTimeout() { + clearTimeout(this._showTimeout); + this._showTimeout = undefined; + } + }, { + key: 'clearHideTimeout', + value: function clearHideTimeout() { + clearTimeout(this._hideTimeout); + this._hideTimeout = undefined; + } + }, { + key: 'handleDocumentClick', + value: function handleDocumentClick(e) { + if (e.target !== this._target && !this._target.contains(e.target) && e.target !== this._popover && !(this._popover && this._popover.contains(e.target))) { + if (this._hideTimeout) { + this.clearHideTimeout(); + } + + if (this.props.isOpen) { + this.toggle(e); + } + } + } + }, { + key: 'addTargetEvents', + value: function addTargetEvents() { + var _this2 = this; + + ['click', 'touchstart'].forEach(function (event) { + return document.addEventListener(event, _this2.handleDocumentClick, true); + }); + } + }, { + key: 'removeTargetEvents', + value: function removeTargetEvents() { + var _this3 = this; + + ['click', 'touchstart'].forEach(function (event) { + return document.removeEventListener(event, _this3.handleDocumentClick, true); + }); + } + }, { + key: 'toggle', + value: function toggle(e) { + if (this.props.disabled) { + return e && e.preventDefault(); + } + + return this.props.toggle(e); + } + }, { + key: 'render', + value: function render() { + if (!this.props.isOpen) { + return null; + } + + var attributes = omit(this.props, Object.keys(propTypes$36)); + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('popover-inner', this.props.innerClassName), this.props.cssModule); + + var popperClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('popover', 'show', this.props.className), this.props.cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + PopperContent, + { + className: popperClasses, + target: this.props.target, + isOpen: this.props.isOpen, + hideArrow: this.props.hideArrow, + placement: this.props.placement, + placementPrefix: this.props.placementPrefix, + container: this.props.container, + modifiers: this.props.modifiers + }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', _extends({}, attributes, { className: classes, ref: this.getRef })) + ); + } + }]); + return Popover; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Popover.propTypes = propTypes$36; +Popover.defaultProps = defaultProps$34; + +var propTypes$37 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$35 = { + tag: 'h3' +}; + +var PopoverHeader = function PopoverHeader(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'popover-header'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +PopoverHeader.propTypes = propTypes$37; +PopoverHeader.defaultProps = defaultProps$35; + +function PopoverTitle(props) { + warnOnce('The "PopoverTitle" component has been deprecated.\nPlease use component "PopoverHeader".'); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(PopoverHeader, props); +} + +var propTypes$38 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$36 = { + tag: 'div' +}; + +var PopoverBody = function PopoverBody(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'popover-body'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +PopoverBody.propTypes = propTypes$38; +PopoverBody.defaultProps = defaultProps$36; + +function PopoverContent(props) { + warnOnce('The "PopoverContent" component has been deprecated.\nPlease use component "PopoverBody".'); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(PopoverBody, props); +} + +var propTypes$39 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + bar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + multi: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + value: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), + max: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), + animated: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + striped: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + barClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$37 = { + tag: 'div', + value: 0, + max: 100 +}; + +var Progress = function Progress(props) { + var children = props.children, + className = props.className, + barClassName = props.barClassName, + cssModule = props.cssModule, + value = props.value, + max = props.max, + animated = props.animated, + striped = props.striped, + color = props.color, + bar = props.bar, + multi = props.multi, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['children', 'className', 'barClassName', 'cssModule', 'value', 'max', 'animated', 'striped', 'color', 'bar', 'multi', 'tag']); + + + var percent = __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber___default()(value) / __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber___default()(max) * 100; + + var progressClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'progress'), cssModule); + + var progressBarClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? 'bg-' + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule); + + var ProgressBar = multi ? children : __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', { + className: progressBarClasses, + style: { width: percent + '%' }, + role: 'progressbar', + 'aria-valuenow': value, + 'aria-valuemin': '0', + 'aria-valuemax': max, + children: children + }); + + if (bar) { + return ProgressBar; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: progressClasses, children: ProgressBar })); +}; + +Progress.propTypes = propTypes$39; +Progress.defaultProps = defaultProps$37; + +var propTypes$41 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node.isRequired, + node: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any +}; + +var Portal = function (_React$Component) { + inherits(Portal, _React$Component); + + function Portal() { + classCallCheck(this, Portal); + return possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments)); + } + + createClass(Portal, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this.defaultNode) { + document.body.removeChild(this.defaultNode); + } + this.defaultNode = null; + } + }, { + key: 'render', + value: function render() { + if (!canUseDOM) { + return null; + } + + if (!this.props.node && !this.defaultNode) { + this.defaultNode = document.createElement('div'); + document.body.appendChild(this.defaultNode); + } + + return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.createPortal(this.props.children, this.props.node || this.defaultNode); + } + }]); + return Portal; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Portal.propTypes = propTypes$41; + +function noop() {} + +var FadePropTypes = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape(Fade.propTypes); + +var propTypes$40 = { + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + autoFocus: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + centered: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + keyboard: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + labelledBy: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + backdrop: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['static'])]), + onEnter: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + onExit: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + onOpened: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + onClosed: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + wrapClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + modalClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + backdropClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + contentClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + external: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + fade: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + zIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + backdropTransition: FadePropTypes, + modalTransition: FadePropTypes +}; + +var propsToOmit = Object.keys(propTypes$40); + +var defaultProps$38 = { + isOpen: false, + autoFocus: true, + centered: false, + role: 'dialog', + backdrop: true, + keyboard: true, + zIndex: 1050, + fade: true, + onOpened: noop, + onClosed: noop, + modalTransition: { + timeout: TransitionTimeouts.Modal + }, + backdropTransition: { + mountOnEnter: true, + timeout: TransitionTimeouts.Fade // uses standard fade transition + } +}; + +var Modal = function (_React$Component) { + inherits(Modal, _React$Component); + + function Modal(props) { + classCallCheck(this, Modal); + + var _this = possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, props)); + + _this._element = null; + _this._originalBodyPadding = null; + _this.handleBackdropClick = _this.handleBackdropClick.bind(_this); + _this.handleEscape = _this.handleEscape.bind(_this); + _this.onOpened = _this.onOpened.bind(_this); + _this.onClosed = _this.onClosed.bind(_this); + + _this.state = { + isOpen: props.isOpen + }; + + if (props.isOpen) { + _this.init(); + } + return _this; + } + + createClass(Modal, [{ + key: 'componentDidMount', + value: function componentDidMount() { + if (this.props.onEnter) { + this.props.onEnter(); + } + + if (this.state.isOpen && this.props.autoFocus) { + this.setFocus(); + } + + this._isMounted = true; + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (nextProps.isOpen && !this.props.isOpen) { + this.setState({ isOpen: nextProps.isOpen }); + } + } + }, { + key: 'componentWillUpdate', + value: function componentWillUpdate(nextProps, nextState) { + if (nextState.isOpen && !this.state.isOpen) { + this.init(); + } + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(prevProps, prevState) { + if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) { + this.setFocus(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + if (this.props.onExit) { + this.props.onExit(); + } + + if (this.state.isOpen) { + this.destroy(); + } + + this._isMounted = false; + } + }, { + key: 'onOpened', + value: function onOpened(node, isAppearing) { + this.props.onOpened(); + (this.props.modalTransition.onEntered || noop)(node, isAppearing); + } + }, { + key: 'onClosed', + value: function onClosed(node) { + // so all methods get called before it is unmounted + this.props.onClosed(); + (this.props.modalTransition.onExited || noop)(node); + this.destroy(); + + if (this._isMounted) { + this.setState({ isOpen: false }); + } + } + }, { + key: 'setFocus', + value: function setFocus() { + if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') { + this._dialog.parentNode.focus(); + } + } + }, { + key: 'handleBackdropClick', + value: function handleBackdropClick(e) { + e.stopPropagation(); + if (!this.props.isOpen || this.props.backdrop !== true) return; + + var container = this._dialog; + + if (e.target && !container.contains(e.target) && this.props.toggle) { + this.props.toggle(e); + } + } + }, { + key: 'handleEscape', + value: function handleEscape(e) { + if (this.props.isOpen && this.props.keyboard && e.keyCode === 27 && this.props.toggle) { + this.props.toggle(e); + } + } + }, { + key: 'init', + value: function init() { + this._element = document.createElement('div'); + this._element.setAttribute('tabindex', '-1'); + this._element.style.position = 'relative'; + this._element.style.zIndex = this.props.zIndex; + this._originalBodyPadding = getOriginalBodyPadding(); + + conditionallyUpdateScrollbar(); + + document.body.appendChild(this._element); + + if (!this.bodyClassAdded) { + document.body.className = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(document.body.className, mapToCssModules('modal-open', this.props.cssModule)); + this.bodyClassAdded = true; + } + } + }, { + key: 'destroy', + value: function destroy() { + if (this._element) { + document.body.removeChild(this._element); + this._element = null; + } + + if (this.bodyClassAdded) { + var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); + // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened` + var modalOpenClassNameRegex = new RegExp('(^| )' + modalOpenClassName + '( |$)'); + document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim(); + this.bodyClassAdded = false; + } + + setScrollbarWidth(this._originalBodyPadding); + } + }, { + key: 'renderModalDialog', + value: function renderModalDialog() { + var _classNames, + _this2 = this; + + var attributes = omit(this.props, propsToOmit); + var dialogBaseClass = 'modal-dialog'; + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + _extends({}, attributes, { + className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(dialogBaseClass, this.props.className, (_classNames = {}, defineProperty(_classNames, 'modal-' + this.props.size, this.props.size), defineProperty(_classNames, dialogBaseClass + '-centered', this.props.centered), _classNames)), this.props.cssModule), + role: 'document', + ref: function ref(c) { + _this2._dialog = c; + } + }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { + className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal-content', this.props.contentClassName), this.props.cssModule) + }, + this.props.children + ) + ); + } + }, { + key: 'render', + value: function render() { + if (this.state.isOpen) { + var _props = this.props, + wrapClassName = _props.wrapClassName, + modalClassName = _props.modalClassName, + backdropClassName = _props.backdropClassName, + cssModule = _props.cssModule, + isOpen = _props.isOpen, + backdrop = _props.backdrop, + role = _props.role, + labelledBy = _props.labelledBy, + external = _props.external; + + + var modalAttributes = { + onClick: this.handleBackdropClick, + onKeyUp: this.handleEscape, + style: { display: 'block' }, + 'aria-labelledby': labelledBy, + role: role, + tabIndex: '-1' + }; + + var hasTransition = this.props.fade; + var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, { + baseClass: hasTransition ? this.props.modalTransition.baseClass : '', + timeout: hasTransition ? this.props.modalTransition.timeout : 0 + }); + var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, { + baseClass: hasTransition ? this.props.backdropTransition.baseClass : '', + timeout: hasTransition ? this.props.backdropTransition.timeout : 0 + }); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Portal, + { node: this._element }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { className: mapToCssModules(wrapClassName) }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Fade, + _extends({}, modalAttributes, modalTransition, { + 'in': isOpen, + onEntered: this.onOpened, + onExited: this.onClosed, + cssModule: cssModule, + className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal', modalClassName), cssModule) + }), + external, + this.renderModalDialog() + ), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Fade, _extends({}, backdropTransition, { + 'in': isOpen && !!backdrop, + cssModule: cssModule, + className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal-backdrop', backdropClassName), cssModule) + })) + ) + ); + } + + return null; + } + }]); + return Modal; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Modal.propTypes = propTypes$40; +Modal.defaultProps = defaultProps$38; + +var propTypes$42 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + wrapTag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + closeAriaLabel: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string +}; + +var defaultProps$39 = { + tag: 'h5', + wrapTag: 'div', + closeAriaLabel: 'Close' +}; + +var ModalHeader = function ModalHeader(props) { + var closeButton = void 0; + var className = props.className, + cssModule = props.cssModule, + children = props.children, + toggle = props.toggle, + Tag = props.tag, + WrapTag = props.wrapTag, + closeAriaLabel = props.closeAriaLabel, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'children', 'toggle', 'tag', 'wrapTag', 'closeAriaLabel']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-header'), cssModule); + + if (toggle) { + closeButton = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'button', + { type: 'button', onClick: toggle, className: mapToCssModules('close', cssModule), 'aria-label': closeAriaLabel }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { 'aria-hidden': 'true' }, + String.fromCharCode(215) + ) + ); + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + WrapTag, + _extends({}, attributes, { className: classes }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + { className: mapToCssModules('modal-title', cssModule) }, + children + ), + closeButton + ); +}; + +ModalHeader.propTypes = propTypes$42; +ModalHeader.defaultProps = defaultProps$39; + +var propTypes$43 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$40 = { + tag: 'div' +}; + +var ModalBody = function ModalBody(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-body'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ModalBody.propTypes = propTypes$43; +ModalBody.defaultProps = defaultProps$40; + +var propTypes$44 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$41 = { + tag: 'div' +}; + +var ModalFooter = function ModalFooter(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-footer'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ModalFooter.propTypes = propTypes$44; +ModalFooter.defaultProps = defaultProps$41; + +var propTypes$45 = { + placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(PopperPlacements), + target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, + container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + hideArrow: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + innerClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + autohide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + delay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ show: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, hide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number }), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), + modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var DEFAULT_DELAYS$1 = { + show: 0, + hide: 250 +}; + +var defaultProps$42 = { + isOpen: false, + hideArrow: false, + placement: 'top', + placementPrefix: 'bs-tooltip', + delay: DEFAULT_DELAYS$1, + autohide: true, + toggle: function toggle() {} +}; + +var Tooltip = function (_React$Component) { + inherits(Tooltip, _React$Component); + + function Tooltip(props) { + classCallCheck(this, Tooltip); + + var _this = possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, props)); + + _this.addTargetEvents = _this.addTargetEvents.bind(_this); + _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); + _this.removeTargetEvents = _this.removeTargetEvents.bind(_this); + _this.toggle = _this.toggle.bind(_this); + _this.onMouseOverTooltip = _this.onMouseOverTooltip.bind(_this); + _this.onMouseLeaveTooltip = _this.onMouseLeaveTooltip.bind(_this); + _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_this); + _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_this); + _this.show = _this.show.bind(_this); + _this.hide = _this.hide.bind(_this); + return _this; + } + + createClass(Tooltip, [{ + key: 'componentDidMount', + value: function componentDidMount() { + this._target = getTarget(this.props.target); + this.addTargetEvents(); + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeTargetEvents(); + } + }, { + key: 'onMouseOverTooltip', + value: function onMouseOverTooltip() { + if (this._hideTimeout) { + this.clearHideTimeout(); + } + this._showTimeout = setTimeout(this.show, this.getDelay('show')); + } + }, { + key: 'onMouseLeaveTooltip', + value: function onMouseLeaveTooltip() { + if (this._showTimeout) { + this.clearShowTimeout(); + } + this._hideTimeout = setTimeout(this.hide, this.getDelay('hide')); + } + }, { + key: 'onMouseOverTooltipContent', + value: function onMouseOverTooltipContent() { + if (this.props.autohide) { + return; + } + if (this._hideTimeout) { + this.clearHideTimeout(); + } + } + }, { + key: 'onMouseLeaveTooltipContent', + value: function onMouseLeaveTooltipContent() { + if (this.props.autohide) { + return; + } + if (this._showTimeout) { + this.clearShowTimeout(); + } + this._hideTimeout = setTimeout(this.hide, this.getDelay('hide')); + } + }, { + key: 'getDelay', + value: function getDelay(key) { + var delay = this.props.delay; + + if ((typeof delay === 'undefined' ? 'undefined' : _typeof(delay)) === 'object') { + return isNaN(delay[key]) ? DEFAULT_DELAYS$1[key] : delay[key]; + } + return delay; + } + }, { + key: 'show', + value: function show() { + if (!this.props.isOpen) { + this.clearShowTimeout(); + this.toggle(); + } + } + }, { + key: 'hide', + value: function hide() { + if (this.props.isOpen) { + this.clearHideTimeout(); + this.toggle(); + } + } + }, { + key: 'clearShowTimeout', + value: function clearShowTimeout() { + clearTimeout(this._showTimeout); + this._showTimeout = undefined; + } + }, { + key: 'clearHideTimeout', + value: function clearHideTimeout() { + clearTimeout(this._hideTimeout); + this._hideTimeout = undefined; + } + }, { + key: 'handleDocumentClick', + value: function handleDocumentClick(e) { + if (e.target === this._target || this._target.contains(e.target)) { + if (this._hideTimeout) { + this.clearHideTimeout(); + } + + if (!this.props.isOpen) { + this.toggle(); + } + } + } + }, { + key: 'addTargetEvents', + value: function addTargetEvents() { + var _this2 = this; + + this._target.addEventListener('mouseover', this.onMouseOverTooltip, true); + this._target.addEventListener('mouseout', this.onMouseLeaveTooltip, true); + ['click', 'touchstart'].forEach(function (event) { + return document.addEventListener(event, _this2.handleDocumentClick, true); + }); + } + }, { + key: 'removeTargetEvents', + value: function removeTargetEvents() { + var _this3 = this; + + this._target.removeEventListener('mouseover', this.onMouseOverTooltip, true); + this._target.removeEventListener('mouseout', this.onMouseLeaveTooltip, true); + ['click', 'touchstart'].forEach(function (event) { + return document.removeEventListener(event, _this3.handleDocumentClick, true); + }); + } + }, { + key: 'toggle', + value: function toggle(e) { + if (this.props.disabled) { + return e && e.preventDefault(); + } + + return this.props.toggle(); + } + }, { + key: 'render', + value: function render() { + if (!this.props.isOpen) { + return null; + } + + var attributes = omit(this.props, Object.keys(propTypes$45)); + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tooltip-inner', this.props.innerClassName), this.props.cssModule); + + var popperClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tooltip', 'show', this.props.className), this.props.cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + PopperContent, + { + className: popperClasses, + target: this.props.target, + isOpen: this.props.isOpen, + hideArrow: this.props.hideArrow, + placement: this.props.placement, + placementPrefix: this.props.placementPrefix, + container: this.props.container, + modifiers: this.props.modifiers + }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', _extends({}, attributes, { + className: classes, + onMouseOver: this.onMouseOverTooltipContent, + onMouseLeave: this.onMouseLeaveTooltipContent + })) + ); + } + }]); + return Tooltip; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Tooltip.propTypes = propTypes$45; +Tooltip.defaultProps = defaultProps$42; + +var propTypes$46 = { + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + bordered: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + striped: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + inverse: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "dark"'), + dark: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + hover: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + responsive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + responsiveTag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) +}; + +var defaultProps$43 = { + tag: 'table', + responsiveTag: 'div' +}; + +var Table = function Table(props) { + var className = props.className, + cssModule = props.cssModule, + size = props.size, + bordered = props.bordered, + striped = props.striped, + inverse = props.inverse, + dark = props.dark, + hover = props.hover, + responsive = props.responsive, + Tag = props.tag, + ResponsiveTag = props.responsiveTag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'bordered', 'striped', 'inverse', 'dark', 'hover', 'responsive', 'tag', 'responsiveTag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, striped ? 'table-striped' : false, dark || inverse ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule); + + var table = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); + + if (responsive) { + var responsiveClassName = responsive === true ? 'table-responsive' : 'table-responsive-' + responsive; + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + ResponsiveTag, + { className: responsiveClassName }, + table + ); + } + + return table; +}; + +Table.propTypes = propTypes$46; +Table.defaultProps = defaultProps$43; + +var propTypes$47 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + flush: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$44 = { + tag: 'ul' +}; + +var ListGroup = function ListGroup(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + flush = props.flush, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'flush']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group', flush ? 'list-group-flush' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ListGroup.propTypes = propTypes$47; +ListGroup.defaultProps = defaultProps$44; + +var propTypes$48 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$45 = { + tag: 'form' +}; + +var Form = function Form(props) { + var className = props.className, + cssModule = props.cssModule, + inline = props.inline, + Tag = props.tag, + innerRef = props.innerRef, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'inline', 'tag', 'innerRef']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, inline ? 'form-inline' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); +}; + +Form.propTypes = propTypes$48; +Form.defaultProps = defaultProps$45; + +var propTypes$49 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + valid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var defaultProps$46 = { + tag: 'div', + valid: undefined +}; + +var FormFeedback = function FormFeedback(props) { + var className = props.className, + cssModule = props.cssModule, + valid = props.valid, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'valid', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, valid ? 'valid-feedback' : 'invalid-feedback'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +FormFeedback.propTypes = propTypes$49; +FormFeedback.defaultProps = defaultProps$46; + +var propTypes$50 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + row: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + check: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$47 = { + tag: 'div' +}; + +var FormGroup = function FormGroup(props) { + var className = props.className, + cssModule = props.cssModule, + row = props.row, + disabled = props.disabled, + check = props.check, + inline = props.inline, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'row', 'disabled', 'check', 'inline', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +FormGroup.propTypes = propTypes$50; +FormGroup.defaultProps = defaultProps$47; + +var propTypes$51 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$48 = { + tag: 'small', + color: 'muted' +}; + +var FormText = function FormText(props) { + var className = props.className, + cssModule = props.cssModule, + inline = props.inline, + color = props.color, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'inline', 'color', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, !inline ? 'form-text' : false, color ? 'text-' + color : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +FormText.propTypes = propTypes$51; +FormText.defaultProps = defaultProps$48; + +/* eslint react/prefer-stateless-function: 0 */ + +var propTypes$52 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + type: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + bsSize: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + state: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, 'Please use the props "valid" and "invalid" to indicate the state.'), + valid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + invalid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + static: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "plaintext"'), + plaintext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + addon: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$49 = { + type: 'text' +}; + +var Input = function (_React$Component) { + inherits(Input, _React$Component); + + function Input() { + classCallCheck(this, Input); + return possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).apply(this, arguments)); + } + + createClass(Input, [{ + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + cssModule = _props.cssModule, + type = _props.type, + bsSize = _props.bsSize, + state = _props.state, + valid = _props.valid, + invalid = _props.invalid, + tag = _props.tag, + addon = _props.addon, + staticInput = _props.static, + plaintext = _props.plaintext, + innerRef = _props.innerRef, + attributes = objectWithoutProperties(_props, ['className', 'cssModule', 'type', 'bsSize', 'state', 'valid', 'invalid', 'tag', 'addon', 'static', 'plaintext', 'innerRef']); + + + var checkInput = ['radio', 'checkbox'].indexOf(type) > -1; + var isNotaNumber = new RegExp('\\D', 'g'); + + var fileInput = type === 'file'; + var textareaInput = type === 'textarea'; + var selectInput = type === 'select'; + var Tag = tag || (selectInput || textareaInput ? type : 'input'); + + var formControlClass = 'form-control'; + + if (plaintext || staticInput) { + formControlClass = formControlClass + '-plaintext'; + Tag = tag || 'p'; + } else if (fileInput) { + formControlClass = formControlClass + '-file'; + } else if (checkInput) { + if (addon) { + formControlClass = null; + } else { + formControlClass = 'form-check-input'; + } + } + + if (state && typeof valid === 'undefined' && typeof invalid === 'undefined') { + if (state === 'danger') { + invalid = true; + } else if (state === 'success') { + valid = true; + } + } + + if (attributes.size && isNotaNumber.test(attributes.size)) { + warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'); + bsSize = attributes.size; + delete attributes.size; + } + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? 'form-control-' + bsSize : false, formControlClass), cssModule); + + if (Tag === 'input' || typeof tag !== 'string') { + attributes.type = type; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); + } + }]); + return Input; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +Input.propTypes = propTypes$52; +Input.defaultProps = defaultProps$49; + +var propTypes$53 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$50 = { + tag: 'div' +}; + +var InputGroup = function InputGroup(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + size = props.size, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'size']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group', size ? 'input-group-' + size : null), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +InputGroup.propTypes = propTypes$53; +InputGroup.defaultProps = defaultProps$50; + +var propTypes$55 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$52 = { + tag: 'span' +}; + +var InputGroupText = function InputGroupText(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group-text'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +InputGroupText.propTypes = propTypes$55; +InputGroupText.defaultProps = defaultProps$52; + +var propTypes$54 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$51 = { + tag: 'div' +}; + +var InputGroupAddon = function InputGroupAddon(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + addonType = props.addonType, + children = props.children, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'addonType', 'children']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group-' + addonType), cssModule); + + // Convenience to assist with transition + if (typeof children === 'string') { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + _extends({}, attributes, { className: classes }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(InputGroupText, { children: children }) + ); + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes, children: children })); +}; + +InputGroupAddon.propTypes = propTypes$54; +InputGroupAddon.defaultProps = defaultProps$51; + +var propTypes$56 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + groupClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + groupAttributes: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var InputGroupButton = function InputGroupButton(props) { + warnOnce('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".'); + + var children = props.children, + groupClassName = props.groupClassName, + groupAttributes = props.groupAttributes, + propsWithoutGroup = objectWithoutProperties(props, ['children', 'groupClassName', 'groupAttributes']); + + + if (typeof children === 'string') { + var cssModule = propsWithoutGroup.cssModule, + tag = propsWithoutGroup.tag, + addonType = propsWithoutGroup.addonType, + attributes = objectWithoutProperties(propsWithoutGroup, ['cssModule', 'tag', 'addonType']); + + + var allGroupAttributes = _extends({}, groupAttributes, { + cssModule: cssModule, + tag: tag, + addonType: addonType + }); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + InputGroupAddon, + _extends({}, allGroupAttributes, { className: groupClassName }), + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Button, _extends({}, attributes, { children: children })) + ); + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(InputGroupAddon, _extends({}, props, { children: children })); +}; + +InputGroupButton.propTypes = propTypes$56; + +var propTypes$57 = { + addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node +}; + +var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, props); +}; + +InputGroupButtonDropdown.propTypes = propTypes$57; + +var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl']; + +var stringOrNumberProp$1 = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]); + +var columnProps$1 = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ + size: stringOrNumberProp$1, + push: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'), + pull: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'), + order: stringOrNumberProp$1, + offset: stringOrNumberProp$1 +})]); + +var propTypes$58 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + hidden: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + check: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + for: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + xs: columnProps$1, + sm: columnProps$1, + md: columnProps$1, + lg: columnProps$1, + xl: columnProps$1, + widths: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array +}; + +var defaultProps$53 = { + tag: 'label', + widths: colWidths$1 +}; + +var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) { + if (colSize === true || colSize === '') { + return isXs ? 'col' : 'col-' + colWidth; + } else if (colSize === 'auto') { + return isXs ? 'col-auto' : 'col-' + colWidth + '-auto'; + } + + return isXs ? 'col-' + colSize : 'col-' + colWidth + '-' + colSize; +}; + +var Label = function Label(props) { + var className = props.className, + cssModule = props.cssModule, + hidden = props.hidden, + widths = props.widths, + Tag = props.tag, + check = props.check, + size = props.size, + htmlFor = props.for, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'hidden', 'widths', 'tag', 'check', 'size', 'for']); + + + var colClasses = []; + + widths.forEach(function (colWidth, i) { + var columnProp = props[colWidth]; + + delete attributes[colWidth]; + + if (!columnProp && columnProp !== '') { + return; + } + + var isXs = !i; + var colClass = void 0; + + if (__WEBPACK_IMPORTED_MODULE_4_lodash_isobject___default()(columnProp)) { + var _classNames; + + var colSizeInterfix = isXs ? '-' : '-' + colWidth + '-'; + colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size); + + colClasses.push(mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()((_classNames = {}, defineProperty(_classNames, colClass, columnProp.size || columnProp.size === ''), defineProperty(_classNames, 'order' + colSizeInterfix + columnProp.order, columnProp.order || columnProp.order === 0), defineProperty(_classNames, 'offset' + colSizeInterfix + columnProp.offset, columnProp.offset || columnProp.offset === 0), _classNames))), cssModule); + } else { + colClass = getColumnSizeClass$1(isXs, colWidth, columnProp); + colClasses.push(colClass); + } + }); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? 'col-form-label-' + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ htmlFor: htmlFor }, attributes, { className: classes })); +}; + +Label.propTypes = propTypes$58; +Label.defaultProps = defaultProps$53; + +var propTypes$59 = { + body: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + bottom: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + heading: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + left: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + list: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + middle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + object: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + right: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + top: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool +}; + +var Media = function Media(props) { + var body = props.body, + bottom = props.bottom, + className = props.className, + cssModule = props.cssModule, + heading = props.heading, + left = props.left, + list = props.list, + middle = props.middle, + object = props.object, + right = props.right, + tag = props.tag, + top = props.top, + attributes = objectWithoutProperties(props, ['body', 'bottom', 'className', 'cssModule', 'heading', 'left', 'list', 'middle', 'object', 'right', 'tag', 'top']); + + + var defaultTag = void 0; + if (heading) { + defaultTag = 'h4'; + } else if (left || right) { + defaultTag = 'a'; + } else if (object) { + defaultTag = 'img'; + } else if (list) { + defaultTag = 'ul'; + } else { + defaultTag = 'div'; + } + var Tag = tag || defaultTag; + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { + 'media-body': body, + 'media-heading': heading, + 'media-left': left, + 'media-right': right, + 'media-top': top, + 'media-bottom': bottom, + 'media-middle': middle, + 'media-object': object, + 'media-list': list, + media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list + }), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Media.propTypes = propTypes$59; + +var propTypes$60 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) +}; + +var defaultProps$54 = { + tag: 'ul' +}; + +var Pagination = function Pagination(props) { + var className = props.className, + cssModule = props.cssModule, + size = props.size, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'pagination', defineProperty({}, 'pagination-' + size, !!size)), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Pagination.propTypes = propTypes$60; +Pagination.defaultProps = defaultProps$54; + +var propTypes$61 = { + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) +}; + +var defaultProps$55 = { + tag: 'li' +}; + +var PaginationItem = function PaginationItem(props) { + var active = props.active, + className = props.className, + cssModule = props.cssModule, + disabled = props.disabled, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['active', 'className', 'cssModule', 'disabled', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'page-item', { + active: active, + disabled: disabled + }), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +PaginationItem.propTypes = propTypes$61; +PaginationItem.defaultProps = defaultProps$55; + +var propTypes$62 = { + 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) +}; + +var defaultProps$56 = { + tag: 'a' +}; + +var PaginationLink = function PaginationLink(props) { + var className = props.className, + cssModule = props.cssModule, + next = props.next, + previous = props.previous, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'next', 'previous', 'tag']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'page-link'), cssModule); + + var defaultAriaLabel = void 0; + if (previous) { + defaultAriaLabel = 'Previous'; + } else if (next) { + defaultAriaLabel = 'Next'; + } + var ariaLabel = props['aria-label'] || defaultAriaLabel; + + var defaultCaret = void 0; + if (previous) { + defaultCaret = '\xAB'; + } else if (next) { + defaultCaret = '\xBB'; + } + + var children = props.children; + if (children && Array.isArray(children) && children.length === 0) { + children = null; + } + + if (previous || next) { + children = [__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { + 'aria-hidden': 'true', + key: 'caret' + }, + children || defaultCaret + ), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { + className: 'sr-only', + key: 'sr' + }, + ariaLabel + )]; + } + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + _extends({}, attributes, { + className: classes, + 'aria-label': ariaLabel + }), + children + ); +}; + +PaginationLink.propTypes = propTypes$62; +PaginationLink.defaultProps = defaultProps$56; + +var propTypes$63 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + activeTab: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$57 = { + tag: 'div' +}; + +var childContextTypes$2 = { + activeTabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any +}; + +var TabContent = function (_Component) { + inherits(TabContent, _Component); + + function TabContent(props) { + classCallCheck(this, TabContent); + + var _this = possibleConstructorReturn(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).call(this, props)); + + _this.state = { + activeTab: _this.props.activeTab + }; + return _this; + } + + createClass(TabContent, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + activeTabId: this.state.activeTab + }; + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if (this.state.activeTab !== nextProps.activeTab) { + this.setState({ + activeTab: nextProps.activeTab + }); + } + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + className = _props.className, + cssModule = _props.cssModule, + Tag = _props.tag; + + + var attributes = omit(this.props, Object.keys(propTypes$63)); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tab-content', className), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); + } + }]); + return TabContent; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +TabContent.propTypes = propTypes$63; +TabContent.defaultProps = defaultProps$57; +TabContent.childContextTypes = childContextTypes$2; + +var propTypes$64 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + tabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any +}; + +var defaultProps$58 = { + tag: 'div' +}; + +var contextTypes$3 = { + activeTabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any +}; + +function TabPane(props, context) { + var className = props.className, + cssModule = props.cssModule, + tabId = props.tabId, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tabId', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tab-pane', className, { active: tabId === context.activeTabId }), cssModule); + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +} +TabPane.propTypes = propTypes$64; +TabPane.defaultProps = defaultProps$58; +TabPane.contextTypes = contextTypes$3; + +var propTypes$65 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + fluid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$59 = { + tag: 'div' +}; + +var Jumbotron = function Jumbotron(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + fluid = props.fluid, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'fluid']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +Jumbotron.propTypes = propTypes$65; +Jumbotron.defaultProps = defaultProps$59; + +var propTypes$66 = { + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + closeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + closeAriaLabel: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + transition: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape(Fade.propTypes) +}; + +var defaultProps$60 = { + color: 'success', + isOpen: true, + tag: 'div', + closeAriaLabel: 'Close', + transition: _extends({}, Fade.defaultProps, { + unmountOnExit: true + }) +}; + +function Alert(props) { + var className = props.className, + closeClassName = props.closeClassName, + closeAriaLabel = props.closeAriaLabel, + cssModule = props.cssModule, + Tag = props.tag, + color = props.color, + isOpen = props.isOpen, + toggle = props.toggle, + children = props.children, + transition = props.transition, + attributes = objectWithoutProperties(props, ['className', 'closeClassName', 'closeAriaLabel', 'cssModule', 'tag', 'color', 'isOpen', 'toggle', 'children', 'transition']); + + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'alert', 'alert-' + color, { 'alert-dismissible': toggle }), cssModule); + + var closeClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('close', closeClassName), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Fade, + _extends({}, attributes, transition, { tag: Tag, className: classes, 'in': isOpen, role: 'alert' }), + toggle ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'button', + { type: 'button', className: closeClasses, 'aria-label': closeAriaLabel, onClick: toggle }, + __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'span', + { 'aria-hidden': 'true' }, + '\xD7' + ) + ) : null, + children + ); +} + +Alert.propTypes = propTypes$66; +Alert.defaultProps = defaultProps$60; + +var _transitionStatusToCl; + +var propTypes$67 = _extends({}, Transition.propTypes, { + isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node]), + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, + navbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}); + +var defaultProps$61 = _extends({}, Transition.defaultProps, { + isOpen: false, + appear: false, + enter: true, + exit: true, + tag: 'div', + timeout: TransitionTimeouts.Collapse +}); + +var transitionStatusToClassHash = (_transitionStatusToCl = {}, defineProperty(_transitionStatusToCl, TransitionStatuses.ENTERING, 'collapsing'), defineProperty(_transitionStatusToCl, TransitionStatuses.ENTERED, 'collapse show'), defineProperty(_transitionStatusToCl, TransitionStatuses.EXITING, 'collapsing'), defineProperty(_transitionStatusToCl, TransitionStatuses.EXITED, 'collapse'), _transitionStatusToCl); + +function getTransitionClass(status) { + return transitionStatusToClassHash[status] || 'collapse'; +} + +function getHeight(node) { + return node.scrollHeight; +} + +var Collapse = function (_Component) { + inherits(Collapse, _Component); + + function Collapse(props) { + classCallCheck(this, Collapse); + + var _this = possibleConstructorReturn(this, (Collapse.__proto__ || Object.getPrototypeOf(Collapse)).call(this, props)); + + _this.state = { + height: null + }; + + ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) { + _this[name] = _this[name].bind(_this); + }); + return _this; + } + + createClass(Collapse, [{ + key: 'onEntering', + value: function onEntering(node, isAppearing) { + this.setState({ height: getHeight(node) }); + this.props.onEntering(node, isAppearing); + } + }, { + key: 'onEntered', + value: function onEntered(node, isAppearing) { + this.setState({ height: null }); + this.props.onEntered(node, isAppearing); + } + }, { + key: 'onExit', + value: function onExit(node) { + this.setState({ height: getHeight(node) }); + this.props.onExit(node); + } + }, { + key: 'onExiting', + value: function onExiting(node) { + // getting this variable triggers a reflow + var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars + this.setState({ height: 0 }); + this.props.onExiting(node); + } + }, { + key: 'onExited', + value: function onExited(node) { + this.setState({ height: null }); + this.props.onExited(node); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + Tag = _props.tag, + isOpen = _props.isOpen, + className = _props.className, + navbar = _props.navbar, + cssModule = _props.cssModule, + children = _props.children, + otherProps = objectWithoutProperties(_props, ['tag', 'isOpen', 'className', 'navbar', 'cssModule', 'children']); + var height = this.state.height; + + // In NODE_ENV=production the Transition.propTypes are wrapped which results in an + // empty object "{}". This is the result of the `react-transition-group` babel + // configuration settings. Therefore, to ensure that production builds work without + // error, we can either explicitly define keys or use the Transition.defaultProps. + // Using the Transition.defaultProps excludes any required props. Thus, the best + // solution is to explicitly define required props in our utilities and reference these. + // This also gives us more flexibility in the future to remove the prop-types + // dependency in distribution builds (Similar to how `react-transition-group` does). + // Note: Without omitting the `react-transition-group` props, the resulting child + // Tag component would inherit the Transition properties as attributes for the HTML + // element which results in errors/warnings for non-valid attributes. + + var transitionProps = pick(otherProps, TransitionPropTypeKeys); + var childProps = omit(otherProps, TransitionPropTypeKeys); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Transition, + _extends({}, transitionProps, { + 'in': isOpen, + onEntering: this.onEntering, + onEntered: this.onEntered, + onExit: this.onExit, + onExiting: this.onExiting, + onExited: this.onExited + }), + function (status) { + var collapseClass = getTransitionClass(status); + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, collapseClass, navbar && 'navbar-collapse'), cssModule); + var style = height === null ? null : { height: height }; + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + Tag, + _extends({}, childProps, { + style: _extends({}, childProps.style, style), + className: classes + }), + children + ); + } + ); + } + }]); + return Collapse; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +Collapse.propTypes = propTypes$67; +Collapse.defaultProps = defaultProps$61; + +var propTypes$68 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + action: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$62 = { + tag: 'li' +}; + +var handleDisabledOnClick = function handleDisabledOnClick(e) { + e.preventDefault(); +}; + +var ListGroupItem = function ListGroupItem(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + active = props.active, + disabled = props.disabled, + action = props.action, + color = props.color, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'active', 'disabled', 'action', 'color']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? 'list-group-item-' + color : false, 'list-group-item'), cssModule); + + // Prevent click event when disabled. + if (disabled) { + attributes.onClick = handleDisabledOnClick; + } + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ListGroupItem.propTypes = propTypes$68; +ListGroupItem.defaultProps = defaultProps$62; + +var propTypes$69 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$63 = { + tag: 'h5' +}; + +var ListGroupItemHeading = function ListGroupItemHeading(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group-item-heading'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ListGroupItemHeading.propTypes = propTypes$69; +ListGroupItemHeading.defaultProps = defaultProps$63; + +var propTypes$70 = { + tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object +}; + +var defaultProps$64 = { + tag: 'p' +}; + +var ListGroupItemText = function ListGroupItemText(props) { + var className = props.className, + cssModule = props.cssModule, + Tag = props.tag, + attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); + + var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group-item-text'), cssModule); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); +}; + +ListGroupItemText.propTypes = propTypes$70; +ListGroupItemText.defaultProps = defaultProps$64; + +var UncontrolledAlert = function (_Component) { + inherits(UncontrolledAlert, _Component); + + function UncontrolledAlert(props) { + classCallCheck(this, UncontrolledAlert); + + var _this = possibleConstructorReturn(this, (UncontrolledAlert.__proto__ || Object.getPrototypeOf(UncontrolledAlert)).call(this, props)); + + _this.state = { isOpen: true }; + _this.toggle = _this.toggle.bind(_this); + return _this; + } + + createClass(UncontrolledAlert, [{ + key: 'toggle', + value: function toggle() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'render', + value: function render() { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Alert, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); + } + }]); + return UncontrolledAlert; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +var UncontrolledButtonDropdown = function (_Component) { + inherits(UncontrolledButtonDropdown, _Component); + + function UncontrolledButtonDropdown(props) { + classCallCheck(this, UncontrolledButtonDropdown); + + var _this = possibleConstructorReturn(this, (UncontrolledButtonDropdown.__proto__ || Object.getPrototypeOf(UncontrolledButtonDropdown)).call(this, props)); + + _this.state = { isOpen: false }; + _this.toggle = _this.toggle.bind(_this); + return _this; + } + + createClass(UncontrolledButtonDropdown, [{ + key: 'toggle', + value: function toggle() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'render', + value: function render() { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(ButtonDropdown, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); + } + }]); + return UncontrolledButtonDropdown; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +var UncontrolledDropdown = function (_Component) { + inherits(UncontrolledDropdown, _Component); + + function UncontrolledDropdown(props) { + classCallCheck(this, UncontrolledDropdown); + + var _this = possibleConstructorReturn(this, (UncontrolledDropdown.__proto__ || Object.getPrototypeOf(UncontrolledDropdown)).call(this, props)); + + _this.state = { isOpen: false }; + _this.toggle = _this.toggle.bind(_this); + return _this; + } + + createClass(UncontrolledDropdown, [{ + key: 'toggle', + value: function toggle() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'render', + value: function render() { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); + } + }]); + return UncontrolledDropdown; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + +var UncontrolledNavDropdown = function UncontrolledNavDropdown(props) { + warnOnce('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.'); + + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(UncontrolledDropdown, _extends({ nav: true }, props)); +}; + +var UncontrolledTooltip = function (_Component) { + inherits(UncontrolledTooltip, _Component); + + function UncontrolledTooltip(props) { + classCallCheck(this, UncontrolledTooltip); + + var _this = possibleConstructorReturn(this, (UncontrolledTooltip.__proto__ || Object.getPrototypeOf(UncontrolledTooltip)).call(this, props)); + + _this.state = { isOpen: false }; + _this.toggle = _this.toggle.bind(_this); + return _this; + } + + createClass(UncontrolledTooltip, [{ + key: 'toggle', + value: function toggle() { + this.setState({ isOpen: !this.state.isOpen }); + } + }, { + key: 'render', + value: function render() { + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tooltip, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); + } + }]); + return UncontrolledTooltip; +}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); + + +//# sourceMappingURL=reactstrap.es.js.map + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.loadElementFormStateName = undefined; + +var _Config = __webpack_require__(17); + +var _Config2 = _interopRequireDefault(_Config); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var loadElementFormStateName = exports.loadElementFormStateName = function loadElementFormStateName() { + var elementId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + + var sectionKey = 'DNADesign\\Elemental\\Controllers\\ElementalAreaController'; + var section = _Config2.default.getSection(sectionKey); + var formNameTemplate = section.form.elementForm.formNameTemplate; + + if (elementId) { + return formNameTemplate.replace('{id}', elementId); + } + return formNameTemplate; +}; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.loadElementSchemaValue = undefined; + +var _Config = __webpack_require__(17); + +var _Config2 = _interopRequireDefault(_Config); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var loadElementSchemaValue = exports.loadElementSchemaValue = function loadElementSchemaValue(key) { + var elementId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + var sectionKey = 'DNADesign\\Elemental\\Controllers\\ElementalAreaController'; + var section = _Config2.default.getSection(sectionKey); + var schemaValue = section.form.elementForm[key] || ''; + + if (elementId) { + return schemaValue + '/' + elementId; + } + return schemaValue; +}; + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +module.exports = ReactRedux; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.elementType = undefined; + +var _react = __webpack_require__(0); + +var elementType = _react.PropTypes.shape({ + ID: _react.PropTypes.string.isRequired, + Title: _react.PropTypes.string, + BlockSchema: _react.PropTypes.object, + InlineEditable: _react.PropTypes.bool, + IsPublished: _react.PropTypes.bool, + IsLiveVersion: _react.PropTypes.bool, + Version: _react.PropTypes.number +}); + +exports.elementType = elementType; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + +module.exports = Config; + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +module.exports = ReactDom; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _registerComponents = __webpack_require__(21); + +var _registerComponents2 = _interopRequireDefault(_registerComponents); + +var _registerTransforms = __webpack_require__(22); + +var _registerTransforms2 = _interopRequireDefault(_registerTransforms); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +window.document.addEventListener('DOMContentLoaded', function () { + (0, _registerComponents2.default)(); + (0, _registerTransforms2.default)(); +}); + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _jquery = __webpack_require__(63); + +var _jquery2 = _interopRequireDefault(_jquery); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactDom = __webpack_require__(18); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _Injector = __webpack_require__(1); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_jquery2.default.entwine('ss', function ($) { + $('.js-injector-boot .element-editor__container').entwine({ + onmatch: function onmatch() { + var context = {}; + var ElementEditorComponent = (0, _Injector.loadComponent)('ElementEditor', context); + var schemaData = this.data('schema'); + + var props = { + fieldName: this.attr('name'), + pageId: schemaData['page-id'], + elementalAreaId: schemaData['elemental-area-id'], + elementTypes: schemaData['element-types'] + }; + + _reactDom2.default.render(_react2.default.createElement(ElementEditorComponent, props), this[0]); + }, + onunmatch: function onunmatch() { + _reactDom2.default.unmountComponentAtNode(this[0]); + }, + + 'from .cms-edit-form': { + onaftersubmitform: function onaftersubmitform() { + window.ss.apolloClient.resetStore(); + } + } + }); +}); + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Injector = __webpack_require__(1); + +var _Injector2 = _interopRequireDefault(_Injector); + +var _Element = __webpack_require__(31); + +var _Element2 = _interopRequireDefault(_Element); + +var _ElementActions = __webpack_require__(32); + +var _ElementActions2 = _interopRequireDefault(_ElementActions); + +var _ElementEditor = __webpack_require__(33); + +var _ElementEditor2 = _interopRequireDefault(_ElementEditor); + +var _ElementList = __webpack_require__(34); + +var _ElementList2 = _interopRequireDefault(_ElementList); + +var _Toolbar = __webpack_require__(39); + +var _Toolbar2 = _interopRequireDefault(_Toolbar); + +var _AddNewButton = __webpack_require__(29); + +var _AddNewButton2 = _interopRequireDefault(_AddNewButton); + +var _Header = __webpack_require__(35); + +var _Header2 = _interopRequireDefault(_Header); + +var _Content = __webpack_require__(30); + +var _Content2 = _interopRequireDefault(_Content); + +var _Summary = __webpack_require__(38); + +var _Summary2 = _interopRequireDefault(_Summary); + +var _InlineEditForm = __webpack_require__(37); + +var _InlineEditForm2 = _interopRequireDefault(_InlineEditForm); + +var _AddElementPopover = __webpack_require__(28); + +var _AddElementPopover2 = _interopRequireDefault(_AddElementPopover); + +var _HoverBar = __webpack_require__(36); + +var _HoverBar2 = _interopRequireDefault(_HoverBar); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + _Injector2.default.component.registerMany({ + ElementEditor: _ElementEditor2.default, + ElementToolbar: _Toolbar2.default, + ElementAddNewButton: _AddNewButton2.default, + ElementList: _ElementList2.default, + Element: _Element2.default, + ElementActions: _ElementActions2.default, + ElementHeader: _Header2.default, + ElementContent: _Content2.default, + ElementSummary: _Summary2.default, + ElementInlineEditForm: _InlineEditForm2.default, + AddElementPopover: _AddElementPopover2.default, + HoverBar: _HoverBar2.default + }); +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Injector = __webpack_require__(1); + +var _Injector2 = _interopRequireDefault(_Injector); + +var _readOneBlockQuery = __webpack_require__(46); + +var _readOneBlockQuery2 = _interopRequireDefault(_readOneBlockQuery); + +var _HistoricElementView = __webpack_require__(40); + +var _HistoricElementView2 = _interopRequireDefault(_HistoricElementView); + +var _revertToBlockVersionMutation = __webpack_require__(47); + +var _revertToBlockVersionMutation2 = _interopRequireDefault(_revertToBlockVersionMutation); + +var _readBlocksForPageQuery = __webpack_require__(44); + +var _readBlocksForPageQuery2 = _interopRequireDefault(_readBlocksForPageQuery); + +var _addElementMutation = __webpack_require__(41); + +var _addElementMutation2 = _interopRequireDefault(_addElementMutation); + +var _ArchiveAction = __webpack_require__(24); + +var _ArchiveAction2 = _interopRequireDefault(_ArchiveAction); + +var _PublishAction = __webpack_require__(25); + +var _PublishAction2 = _interopRequireDefault(_PublishAction); + +var _SaveAction = __webpack_require__(26); + +var _SaveAction2 = _interopRequireDefault(_SaveAction); + +var _UnpublishAction = __webpack_require__(27); + +var _UnpublishAction2 = _interopRequireDefault(_UnpublishAction); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + _Injector2.default.transform('elemental-fieldgroup', function (updater) { + updater.component('FieldGroup.HistoryViewer.VersionDetail', _HistoricElementView2.default, 'HistoricElement'); + }, { + after: 'field-holders' + }); + + _Injector2.default.transform('elements-history', function (updater) { + updater.component('HistoryViewer.Form_ItemEditForm', _readOneBlockQuery2.default, 'ElementHistoryViewer'); + }); + + _Injector2.default.transform('blocks-history-revert', function (updater) { + updater.component('HistoryViewerToolbar.VersionedAdmin.HistoryViewer.Element.HistoryViewerVersionDetail', _revertToBlockVersionMutation2.default, 'BlockRevertMutation'); + }); + + _Injector2.default.transform('cms-element-editor', function (updater) { + updater.component('ElementList', _readBlocksForPageQuery2.default, 'PageElements'); + }); + + _Injector2.default.transform('cms-element-adder', function (updater) { + updater.component('AddElementPopover', _addElementMutation2.default, 'ElementAddButton'); + }); + + _Injector2.default.transform('element-actions', function (updater) { + updater.component('ElementActions', _SaveAction2.default, 'ElementActionsWithSave'); + updater.component('ElementActions', _ArchiveAction2.default, 'ElementActionsWithArchive'); + updater.component('ElementActions', _PublishAction2.default, 'ElementActionsWithPublish'); + updater.component('ElementActions', _UnpublishAction2.default, 'ElementActionsWithUnpublish'); + }); +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(20); +__webpack_require__(19); + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(4); + +var _AbstractAction = __webpack_require__(7); + +var _AbstractAction2 = _interopRequireDefault(_AbstractAction); + +var _archiveBlockMutation = __webpack_require__(42); + +var _archiveBlockMutation2 = _interopRequireDefault(_archiveBlockMutation); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var ArchiveAction = function ArchiveAction(MenuComponent) { + return function (props) { + var handleClick = function handleClick(event) { + event.stopPropagation(); + + var id = props.id, + isPublished = props.isPublished, + handleArchiveBlock = props.actions.handleArchiveBlock; + + + var archiveMessage = _i18n2.default._t('ArchiveAction.CONFIRM_DELETE', 'Are you sure you want to send this block to the archive?'); + + if (isPublished) { + archiveMessage = _i18n2.default._t('ArchiveAction.CONFIRM_DELETE_AND_UNPUBLISH', 'Warning: This block will be unpublished before being sent to the archive. Are you sure you want to proceed?'); + } + + if (handleArchiveBlock && confirm(archiveMessage)) { + handleArchiveBlock(id); + } + }; + + var newProps = { + title: _i18n2.default._t('ArchiveAction.ARCHIVE', 'Archive'), + className: 'element-editor__actions-archive', + onClick: handleClick, + toggle: props.toggle + }; + + return _react2.default.createElement( + MenuComponent, + props, + props.children, + _react2.default.createElement(_AbstractAction2.default, newProps) + ); + }; +}; + +exports.Component = ArchiveAction; +exports.default = (0, _redux.compose)(_archiveBlockMutation2.default, ArchiveAction); + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(4); + +var _AbstractAction = __webpack_require__(7); + +var _AbstractAction2 = _interopRequireDefault(_AbstractAction); + +var _publishBlockMutation = __webpack_require__(43); + +var _publishBlockMutation2 = _interopRequireDefault(_publishBlockMutation); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var PublishAction = function PublishAction(MenuComponent) { + return function (props) { + var handleClick = function handleClick(event) { + event.stopPropagation(); + + var id = props.id, + title = props.title, + version = props.version, + handlePublishBlock = props.actions.handlePublishBlock; + var _window = window, + $ = _window.jQuery; + + + if (handlePublishBlock) { + handlePublishBlock(id, 'DRAFT', 'LIVE', version).then(function () { + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('UnpublishAction.SUCCESS_NOTIFICATION', 'Published \'{title}\' successfully'), { title: title }), + stay: false, + type: 'success' + }); + }).catch(function () { + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('UnpublishAction.ERROR_NOTIFICATION', 'Error publishing \'{title}\''), { title: title }), + stay: false, + type: 'error' + }); + }); + } + }; + + var newProps = { + title: _i18n2.default._t('PublishAction.PUBLISH', 'Publish'), + className: 'element-editor__actions-publish', + onClick: handleClick, + toggle: props.toggle + }; + + return _react2.default.createElement( + MenuComponent, + props, + props.children, + !props.isLiveVersion && _react2.default.createElement(_AbstractAction2.default, newProps) + ); + }; +}; + +exports.Component = PublishAction; +exports.default = (0, _redux.compose)(_publishBlockMutation2.default, PublishAction); + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(4); + +var _reactRedux = __webpack_require__(13); + +var _AbstractAction = __webpack_require__(7); + +var _AbstractAction2 = _interopRequireDefault(_AbstractAction); + +var _Backend = __webpack_require__(60); + +var _Backend2 = _interopRequireDefault(_Backend); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _loadElementSchemaValue = __webpack_require__(12); + +var _loadElementFormStateName = __webpack_require__(11); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SaveAction = function SaveAction(MenuComponent) { + return function (props) { + var handleClick = function handleClick(event) { + event.stopPropagation(); + + var id = props.id, + title = props.title, + securityId = props.securityId, + formData = props.formData; + var _window = window, + $ = _window.jQuery; + + + var endpointSpec = { + url: (0, _loadElementSchemaValue.loadElementSchemaValue)('saveUrl', id), + method: (0, _loadElementSchemaValue.loadElementSchemaValue)('saveMethod'), + payloadFormat: (0, _loadElementSchemaValue.loadElementSchemaValue)('payloadFormat'), + defaultData: { + SecurityID: securityId + } + }; + + var endpoint = _Backend2.default.createEndpointFetcher(endpointSpec); + endpoint(formData).then(function () { + var apolloClient = window.ss.apolloClient; + + apolloClient.queryManager.reFetchObservableQueries(); + + var newTitle = formData['PageElements_' + id + '_Title']; + + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('SaveAction.SUCCESS_NOTIFICATION', 'Saved \'{title}\' successfully'), { title: newTitle }), + stay: false, + type: 'success' + }); + }).catch(function () { + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('SaveAction.ERROR_NOTIFICATION', 'Error saving \'{title}\''), { title: title }), + stay: false, + type: 'error' + }); + }); + }; + + var newProps = { + title: _i18n2.default._t('SaveAction.SAVE', 'Save'), + className: 'element-editor__actions-save', + onClick: handleClick + }; + + return _react2.default.createElement( + MenuComponent, + props, + props.children, + _react2.default.createElement(_AbstractAction2.default, newProps) + ); + }; +}; + +function mapStateToProps(state, ownProps) { + var formName = (0, _loadElementFormStateName.loadElementFormStateName)(ownProps.id); + + var formData = null; + + if (state.form.formState.element && state.form.formState.element[formName]) { + formData = state.form.formState.element[formName].values; + } + + return { + formData: formData, + securityId: state.config.SecurityID + }; +} + +exports.Component = SaveAction; +exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps), SaveAction); + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(4); + +var _AbstractAction = __webpack_require__(7); + +var _AbstractAction2 = _interopRequireDefault(_AbstractAction); + +var _unpublishBlockMutation = __webpack_require__(45); + +var _unpublishBlockMutation2 = _interopRequireDefault(_unpublishBlockMutation); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var UnpublishAction = function UnpublishAction(MenuComponent) { + return function (props) { + var handleClick = function handleClick(event) { + event.stopPropagation(); + + var id = props.id, + title = props.title, + handleUnpublishBlock = props.actions.handleUnpublishBlock; + var _window = window, + $ = _window.jQuery; + + + if (handleUnpublishBlock) { + handleUnpublishBlock(id).then(function () { + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('UnpublishAction.SUCCESS_NOTIFICATION', 'Removed \'{title}\' from the published page'), { title: title }), + stay: false, + type: 'success' + }); + }).catch(function () { + $.noticeAdd({ + text: _i18n2.default.inject(_i18n2.default._t('UnpublishAction.ERROR_NOTIFICATION', 'Error unpublishing \'{title}\''), { title: title }), + stay: false, + type: 'error' + }); + }); + } + }; + + var newProps = { + title: _i18n2.default._t('UnpublishAction.UNPUBLISH', 'Unpublish'), + className: 'element-editor__actions-unpublish', + onClick: handleClick, + toggle: props.toggle + }; + + return _react2.default.createElement( + MenuComponent, + props, + props.children, + props.isPublished && _react2.default.createElement(_AbstractAction2.default, newProps) + ); + }; +}; + +exports.Component = UnpublishAction; +exports.default = (0, _redux.compose)(_unpublishBlockMutation2.default, UnpublishAction); + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactstrap = __webpack_require__(10); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _elementTypeType = __webpack_require__(8); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var AddElementPopover = function (_Component) { + _inherits(AddElementPopover, _Component); + + function AddElementPopover(props) { + _classCallCheck(this, AddElementPopover); + + var _this = _possibleConstructorReturn(this, (AddElementPopover.__proto__ || Object.getPrototypeOf(AddElementPopover)).call(this, props)); + + _this.renderElementButtons = _this.renderElementButtons.bind(_this); + _this.renderAddElementPopoverContent = _this.renderAddElementPopoverContent.bind(_this); + _this.handleSearchValueChange = _this.handleSearchValueChange.bind(_this); + _this.handleClear = _this.handleClear.bind(_this); + _this.handleToggle = _this.handleToggle.bind(_this); + _this.handleKeyDown = _this.handleKeyDown.bind(_this); + _this.getElementButtonClickHandler = _this.getElementButtonClickHandler.bind(_this); + + _this.state = { + searchValue: '' + }; + return _this; + } + + _createClass(AddElementPopover, [{ + key: 'getElementButtonClickHandler', + value: function getElementButtonClickHandler(elementType) { + var _this2 = this; + + return function (event) { + var _props = _this2.props, + handleAddElementToArea = _props.actions.handleAddElementToArea, + elementalAreaId = _props.elementalAreaId, + insertAfterElement = _props.insertAfterElement; + + + event.preventDefault(); + handleAddElementToArea(elementType.name.replace(/-/g, '\\'), elementalAreaId, insertAfterElement); + _this2.handleToggle(); + }; + } + }, { + key: 'handleKeyDown', + value: function handleKeyDown(event) { + switch (event.key) { + case 'Escape': + this.handleToggle(); + break; + default: + } + } + }, { + key: 'handleToggle', + value: function handleToggle() { + var toggle = this.props.toggle; + + + toggle(); + this.handleClear(); + } + }, { + key: 'handleClear', + value: function handleClear() { + this.setState({ searchValue: '' }); + } + }, { + key: 'handleSearchValueChange', + value: function handleSearchValueChange(event) { + this.setState({ searchValue: event.target.value }); + } + }, { + key: 'renderClearLink', + value: function renderClearLink() { + var searchValue = this.state.searchValue; + + + if (searchValue.length === 0) { + return null; + } + + return _react2.default.createElement( + _reactstrap.InputGroupAddon, + { addonType: 'append' }, + _react2.default.createElement( + 'button', + { + className: 'element-editor-add-element__search-clear btn-link', + onClick: this.handleClear + }, + _i18n2.default._t('AddElementPopover.CLEAR', 'Clear') + ) + ); + } + }, { + key: 'renderElementButtons', + value: function renderElementButtons() { + var _this3 = this; + + var elementalAreaId = this.props.elementalAreaId; + var elementTypes = this.props.elementTypes; + var searchValue = this.state.searchValue; + + + if (searchValue.length !== 0) { + elementTypes = elementTypes.filter(function (elementType) { + return elementType.title.toLowerCase().includes(searchValue.trim().toLowerCase()); + }); + } + + if (elementTypes.length === 0) { + return _react2.default.createElement( + 'div', + { className: 'element-editor-add-element__no-results' }, + _i18n2.default._t('AddElementPopover.NO_RESULTS', 'No results found') + ); + } + + return elementTypes.map(function (elementType) { + return _react2.default.createElement( + _reactstrap.Button, + { + className: (0, _classnames2.default)(elementType.icon, 'btn--icon-xl', 'element-editor-add-element__button'), + key: elementType.name, + name: elementType.name, + onClick: _this3.getElementButtonClickHandler(elementType), + elementalAreaId: elementalAreaId + }, + elementType.title + ); + }); + } + }, { + key: 'renderAddElementPopoverContent', + value: function renderAddElementPopoverContent() { + return _react2.default.createElement( + 'div', + { className: 'element-editor-add-element__button-container' }, + this.renderElementButtons() + ); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + container = _props2.container, + extraClass = _props2.extraClass, + isOpen = _props2.isOpen, + placement = _props2.placement, + target = _props2.target; + var searchValue = this.state.searchValue; + + var popoverClassNames = (0, _classnames2.default)('element-editor-add-element', extraClass); + + return _react2.default.createElement( + _reactstrap.Popover, + { + className: popoverClassNames, + container: container, + hideArrow: true, + isOpen: isOpen, + placement: placement, + target: target, + toggle: this.handleToggle, + onKeyDown: this.handleKeyDown + }, + _react2.default.createElement( + _reactstrap.InputGroup, + { className: 'element-editor-add-element__search' }, + _react2.default.createElement(_reactstrap.Input, { + autoFocus: true, + className: 'element-editor-add-element__search-input', + id: 'element-editor-add-element__search-input', + onChange: this.handleSearchValueChange, + placeholder: _i18n2.default._t('AddElementPopover.SEARCH_BLOCKS', 'Search blocks'), + type: 'text', + value: searchValue + }), + this.renderClearLink() + ), + this.renderAddElementPopoverContent() + ); + } + }]); + + return AddElementPopover; +}(_react.Component); + +AddElementPopover.propTypes = { + container: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func, _react.PropTypes.object]), + elementTypes: _react.PropTypes.arrayOf(_elementTypeType.elementTypeType), + extraClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.array, _react.PropTypes.object]), + isOpen: _react.PropTypes.bool.isRequired, + placement: _react.PropTypes.string, + target: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func, _react.PropTypes.object]).isRequired, + toggle: _react.PropTypes.func.isRequired, + elementalAreaId: _react.PropTypes.number.isRequired, + insertAfterElement: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]) +}; + +exports.default = AddElementPopover; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactstrap = __webpack_require__(10); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _elementTypeType = __webpack_require__(8); + +var _Injector = __webpack_require__(1); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var AddNewButton = function (_Component) { + _inherits(AddNewButton, _Component); + + function AddNewButton(props) { + _classCallCheck(this, AddNewButton); + + var _this = _possibleConstructorReturn(this, (AddNewButton.__proto__ || Object.getPrototypeOf(AddNewButton)).call(this, props)); + + _this.toggle = _this.toggle.bind(_this); + + _this.state = { + popoverOpen: false + }; + return _this; + } + + _createClass(AddNewButton, [{ + key: 'toggle', + value: function toggle() { + this.setState({ + popoverOpen: !this.state.popoverOpen + }); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + AddElementPopoverComponent = _props.AddElementPopoverComponent, + elementTypes = _props.elementTypes, + elementalAreaId = _props.elementalAreaId; + + var buttonAttributes = { + id: 'ElementalArea' + elementalAreaId + '_AddButton', + color: 'primary', + onClick: this.toggle + }; + + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + _reactstrap.Button, + buttonAttributes, + _i18n2.default._t('AddNewButton.ADD_BLOCK', 'Add block') + ), + _react2.default.createElement(AddElementPopoverComponent, { + placement: 'bottom-start', + target: buttonAttributes.id, + isOpen: this.state.popoverOpen, + elementTypes: elementTypes, + toggle: this.toggle, + elementalAreaId: elementalAreaId, + insertAfterElement: 0 + }) + ); + } + }]); + + return AddNewButton; +}(_react.Component); + +AddNewButton.defaultProps = {}; +AddNewButton.propTypes = { + elementTypes: _react.PropTypes.arrayOf(_elementTypeType.elementTypeType).isRequired, + elementalAreaId: _react.PropTypes.number.isRequired +}; + +exports.Component = AddNewButton; +exports.default = (0, _Injector.inject)(['AddElementPopover'], function (AddElementPopoverComponent) { + return { + AddElementPopoverComponent: AddElementPopoverComponent + }; +}, function () { + return 'ElementEditor.ElementList.AddNewButton'; +})(AddNewButton); + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _Injector = __webpack_require__(1); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Content = function (_PureComponent) { + _inherits(Content, _PureComponent); + + function Content() { + _classCallCheck(this, Content); + + return _possibleConstructorReturn(this, (Content.__proto__ || Object.getPrototypeOf(Content)).apply(this, arguments)); + } + + _createClass(Content, [{ + key: 'render', + value: function render() { + var _props = this.props, + id = _props.id, + fileUrl = _props.fileUrl, + fileTitle = _props.fileTitle, + content = _props.content, + previewExpanded = _props.previewExpanded, + InlineEditFormComponent = _props.InlineEditFormComponent, + SummaryComponent = _props.SummaryComponent, + activeTab = _props.activeTab, + onFormInit = _props.onFormInit; + + + return _react2.default.createElement( + 'div', + { className: 'element-editor-content' }, + !previewExpanded && _react2.default.createElement(SummaryComponent, { + content: content, + fileUrl: fileUrl, + fileTitle: fileTitle + }), + previewExpanded && _react2.default.createElement(InlineEditFormComponent, { + extraClass: { 'element-editor-editform--collapsed': !previewExpanded }, + onClick: function onClick(event) { + return event.stopPropagation(); + }, + elementId: id, + activeTab: activeTab, + onFormInit: onFormInit + }) + ); + } + }]); + + return Content; +}(_react.PureComponent); + +Content.propTypes = { + id: _react.PropTypes.string, + content: _react.PropTypes.string, + fileUrl: _react.PropTypes.string, + fileTitle: _react.PropTypes.string, + previewExpanded: _react.PropTypes.bool, + SummaryComponent: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.func]), + InlineEditFormComponent: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.func]) +}; + +Content.defaultProps = {}; + +exports.Component = Content; +exports.default = (0, _Injector.inject)(['ElementSummary', 'ElementInlineEditForm'], function (SummaryComponent, InlineEditFormComponent) { + return { + SummaryComponent: SummaryComponent, InlineEditFormComponent: InlineEditFormComponent + }; +}, function () { + return 'ElementEditor.ElementList.Element'; +})(Content); + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _elementType = __webpack_require__(14); + +var _redux = __webpack_require__(4); + +var _Injector = __webpack_require__(1); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _reactRedux = __webpack_require__(13); + +var _loadElementFormStateName = __webpack_require__(11); + +var _loadElementSchemaValue = __webpack_require__(12); + +var _TabsActions = __webpack_require__(62); + +var TabsActions = _interopRequireWildcard(_TabsActions); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Element = function (_Component) { + _inherits(Element, _Component); + + function Element(props) { + _classCallCheck(this, Element); + + var _this = _possibleConstructorReturn(this, (Element.__proto__ || Object.getPrototypeOf(Element)).call(this, props)); + + _this.handleKeyUp = _this.handleKeyUp.bind(_this); + _this.handleExpand = _this.handleExpand.bind(_this); + _this.handleTabClick = _this.handleTabClick.bind(_this); + _this.updateFormTab = _this.updateFormTab.bind(_this); + + _this.state = { + previewExpanded: false, + initialTab: '' + }; + return _this; + } + + _createClass(Element, [{ + key: 'getVersionedStateClassName', + value: function getVersionedStateClassName() { + var element = this.props.element; + + + var baseClassName = 'element-editor__element'; + + if (!element.IsPublished) { + return baseClassName + '--draft'; + } + + if (element.IsPublished && !element.IsLiveVersion) { + return baseClassName + '--modified'; + } + + return baseClassName + '--published'; + } + }, { + key: 'updateFormTab', + value: function updateFormTab(activeTab) { + var _props = this.props, + element = _props.element, + actions = _props.actions, + tabSetName = _props.tabSetName, + onActivateTab = _props.onActivateTab; + var initialTab = this.state.initialTab; + + + if (!initialTab) { + this.setState({ + initialTab: activeTab + }); + } + + if (activeTab || initialTab) { + onActivateTab(tabSetName, activeTab || initialTab); + } else { + var defaultFirstTab = 'Main'; + onActivateTab(tabSetName, defaultFirstTab); + } + } + }, { + key: 'handleTabClick', + value: function handleTabClick(toBeActiveTab) { + var activeTab = this.props.activeTab; + + + if (toBeActiveTab !== activeTab) { + this.setState({ + previewExpanded: true + }); + + this.updateFormTab(toBeActiveTab); + } + } + }, { + key: 'handleExpand', + value: function handleExpand(event) { + var _props2 = this.props, + element = _props2.element, + link = _props2.link; + + + if (event.target.type === 'button') { + event.stopPropagation(); + return; + } + + if (element.InlineEditable) { + this.setState({ + previewExpanded: !this.state.previewExpanded + }); + return; + } + + window.location = link; + } + }, { + key: 'handleKeyUp', + value: function handleKeyUp(event) { + var nodeName = event.target.nodeName; + + + if (event.code === 'Enter') { + this.handleExpand(event); + } else if (event.code === 'Space' && !['input', 'textarea'].includes(nodeName.toLowerCase())) { + this.handleExpand(event); + } + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var _props3 = this.props, + element = _props3.element, + HeaderComponent = _props3.HeaderComponent, + ContentComponent = _props3.ContentComponent, + link = _props3.link, + editTabs = _props3.editTabs, + activeTab = _props3.activeTab; + var previewExpanded = this.state.previewExpanded; + + + var linkTitle = _i18n2.default.inject(_i18n2.default._t('ElementalElement.TITLE', 'Edit this {type} block'), { type: element.BlockSchema.type }); + + if (!element.ID) { + return null; + } + + var elementClassNames = (0, _classnames2.default)('element-editor__element', { + 'element-editor__element--expandable': element.InlineEditable + }, this.getVersionedStateClassName()); + + return _react2.default.createElement( + 'div', + { + className: elementClassNames, + onClick: this.handleExpand, + onKeyUp: this.handleKeyUp, + role: 'button', + tabIndex: 0, + title: linkTitle, + key: element.ID + }, + _react2.default.createElement(HeaderComponent, { + id: element.ID, + title: element.Title, + version: element.Version, + isLiveVersion: element.IsLiveVersion, + isPublished: element.IsPublished, + elementType: element.BlockSchema.type, + fontIcon: element.BlockSchema.iconClass, + link: link, + editTabs: editTabs, + previewExpanded: previewExpanded, + expandable: element.InlineEditable, + handleEditTabsClick: this.handleTabClick, + activeTab: activeTab + }), + _react2.default.createElement(ContentComponent, { + id: element.ID, + fileUrl: element.BlockSchema.fileURL, + fileTitle: element.BlockSchema.fileTitle, + content: element.BlockSchema.content, + previewExpanded: previewExpanded, + activeTab: activeTab, + onFormInit: function onFormInit() { + return _this2.updateFormTab(activeTab); + } + }) + ); + } + }]); + + return Element; +}(_react.Component); + +function mapStateToProps(state, ownProps) { + + var elementId = ownProps.element.ID; + var elementName = (0, _loadElementFormStateName.loadElementFormStateName)(elementId); + var elementFormSchema = (0, _loadElementSchemaValue.loadElementSchemaValue)('schemaUrl', elementId); + + var filterFieldsForTabs = function filterFieldsForTabs(field) { + return field.component === 'Tabs'; + }; + + var tabSet = state.form && state.form.formSchemas[elementFormSchema] && state.form.formSchemas[elementFormSchema].schema && state.form.formSchemas[elementFormSchema].schema.fields.find(filterFieldsForTabs); + + var tabSetName = tabSet && tabSet.id; + var uniqueFieldId = 'element.' + elementName + '__' + tabSetName; + + var activeTab = state.tabs && state.tabs.fields && state.tabs.fields[uniqueFieldId] && state.tabs.fields[uniqueFieldId].activeTab; + + return { + tabSetName: tabSetName, + activeTab: activeTab + }; +} + +function mapDispatchToProps(dispatch, ownProps) { + + var elementName = (0, _loadElementFormStateName.loadElementFormStateName)(ownProps.element.ID); + + return { + onActivateTab: function onActivateTab(tabSetName, activeTabName) { + dispatch(TabsActions.activateTab('element.' + elementName + '__' + tabSetName, activeTabName)); + } + }; +} + +Element.propTypes = { + element: _elementType.elementType, + link: _react.PropTypes.string.isRequired, + editTabs: _react.PropTypes.arrayOf(_react.PropTypes.object), + + activeTab: _react.PropTypes.string, + tabSetName: _react.PropTypes.string, + onActivateTab: _react.PropTypes.func +}; + +Element.defaultProps = { + element: null +}; + +exports.Component = Element; +exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _Injector.inject)(['ElementHeader', 'ElementContent'], function (HeaderComponent, ContentComponent) { + return { + HeaderComponent: HeaderComponent, ContentComponent: ContentComponent + }; +}, function () { + return 'ElementEditor.ElementList.Element'; +}))(Element); + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _redux = __webpack_require__(4); + +var _reactstrap = __webpack_require__(10); + +var _Injector = __webpack_require__(1); + +var _AbstractAction = __webpack_require__(7); + +var _AbstractAction2 = _interopRequireDefault(_AbstractAction); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ElementActions = function (_Component) { + _inherits(ElementActions, _Component); + + function ElementActions(props) { + _classCallCheck(this, ElementActions); + + var _this = _possibleConstructorReturn(this, (ElementActions.__proto__ || Object.getPrototypeOf(ElementActions)).call(this, props)); + + _this.handleEditTabsClick = _this.handleEditTabsClick.bind(_this); + return _this; + } + + _createClass(ElementActions, [{ + key: 'handleEditTabsClick', + value: function handleEditTabsClick(event) { + var handleEditTabsClick = this.props.handleEditTabsClick; + + handleEditTabsClick(event.target.name); + } + }, { + key: 'renderEditTabs', + value: function renderEditTabs() { + var _this2 = this; + + var _props = this.props, + editTabs = _props.editTabs, + activeTab = _props.activeTab; + + + if (!editTabs || !editTabs.length) { + return null; + } + + return editTabs.map(function (_ref) { + var name = _ref.name, + title = _ref.title; + return _react2.default.createElement(_AbstractAction2.default, { + key: name, + name: name, + title: title, + onClick: _this2.handleEditTabsClick, + active: name === activeTab + }); + }); + } + }, { + key: 'renderDivider', + value: function renderDivider() { + var _props2 = this.props, + children = _props2.children, + editTabs = _props2.editTabs; + + + if (editTabs && editTabs.length && _react2.default.Children.count(children)) { + return _react2.default.createElement(_reactstrap.DropdownItem, { divider: true, role: 'separator' }); + } + return null; + } + }, { + key: 'render', + value: function render() { + var _props3 = this.props, + children = _props3.children, + id = _props3.id, + ActionMenuComponent = _props3.ActionMenuComponent; + + + var dropdownToggleClassNames = ['element-editor-header__actions-toggle', 'btn', 'btn-sm', 'btn--no-text', 'font-icon-dot-3']; + + return _react2.default.createElement( + ActionMenuComponent, + { + id: 'element-editor-actions-' + id, + className: 'element-editor-header__actions-dropdown', + dropdownMenuProps: { right: true }, + dropdownToggleClassNames: dropdownToggleClassNames + }, + this.renderEditTabs(), + this.renderDivider(), + children + ); + } + }]); + + return ElementActions; +}(_react.Component); + +ElementActions.propTypes = { + id: _react.PropTypes.string, + activeTab: _react.PropTypes.string, + editTabs: _react.PropTypes.arrayOf(_react.PropTypes.shape({ + title: _react.PropTypes.string, + name: _react.PropTypes.string + })) }; + +ElementActions.defaultProps = { + editTabs: [] +}; + +exports.Component = ElementActions; +exports.default = (0, _redux.compose)((0, _Injector.inject)(['ActionMenu'], function (ActionMenuComponent) { + return { + ActionMenuComponent: ActionMenuComponent + }; +}, function () { + return 'ElementEditor.ElementList.Element'; +}))(ElementActions); + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _Injector = __webpack_require__(1); + +var _elementTypeType = __webpack_require__(8); + +var _reactRedux = __webpack_require__(13); + +var _redux = __webpack_require__(4); + +var _loadElementFormStateName = __webpack_require__(11); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ElementEditor = function (_PureComponent) { + _inherits(ElementEditor, _PureComponent); + + function ElementEditor() { + _classCallCheck(this, ElementEditor); + + return _possibleConstructorReturn(this, (ElementEditor.__proto__ || Object.getPrototypeOf(ElementEditor)).apply(this, arguments)); + } + + _createClass(ElementEditor, [{ + key: 'render', + value: function render() { + var _props = this.props, + fieldName = _props.fieldName, + formState = _props.formState, + ToolbarComponent = _props.ToolbarComponent, + ListComponent = _props.ListComponent, + pageId = _props.pageId, + elementalAreaId = _props.elementalAreaId, + elementTypes = _props.elementTypes; + + + return _react2.default.createElement( + 'div', + { className: 'element-editor' }, + _react2.default.createElement(ToolbarComponent, { + elementTypes: elementTypes, + elementalAreaId: elementalAreaId + }), + _react2.default.createElement(ListComponent, { + elementTypes: elementTypes, + pageId: pageId, + elementalAreaId: elementalAreaId + }), + _react2.default.createElement('input', { name: fieldName, type: 'hidden', value: JSON.stringify(formState) }) + ); + } + }]); + + return ElementEditor; +}(_react.PureComponent); + +ElementEditor.propTypes = { + fieldName: _react.PropTypes.string, + elementTypes: _react.PropTypes.arrayOf(_elementTypeType.elementTypeType).isRequired, + pageId: _react.PropTypes.number.isRequired, + elementalAreaId: _react.PropTypes.number.isRequired +}; + +ElementEditor.defaultProps = {}; + +function mapStateToProps(state) { + var formNamePattern = (0, _loadElementFormStateName.loadElementFormStateName)('[0-9]+'); + var elementFormState = state.form.formState.element; + + if (!elementFormState) { + return {}; + } + + var formState = Object.keys(elementFormState).filter(function (key) { + return key.match(formNamePattern); + }).reduce(function (accumulator, key) { + return _extends({}, accumulator, _defineProperty({}, key, elementFormState[key].values)); + }, {}); + + return { formState: formState }; +} + +exports.Component = ElementEditor; +exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps), (0, _Injector.inject)(['ElementToolbar', 'ElementList'], function (ToolbarComponent, ListComponent) { + return { + ToolbarComponent: ToolbarComponent, + ListComponent: ListComponent + }; +}, function () { + return 'ElementEditor'; +}))(ElementEditor); + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _elementType = __webpack_require__(14); + +var _Injector = __webpack_require__(1); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ElementList = function (_Component) { + _inherits(ElementList, _Component); + + function ElementList() { + _classCallCheck(this, ElementList); + + return _possibleConstructorReturn(this, (ElementList.__proto__ || Object.getPrototypeOf(ElementList)).apply(this, arguments)); + } + + _createClass(ElementList, [{ + key: 'getEditTabs', + value: function getEditTabs(element) { + var elementTypes = this.props.elementTypes; + + var matchingType = elementTypes.find(function (type) { + return element.BlockSchema.type === type.title; + }); + + if (!matchingType || !matchingType.tabs) { + return []; + } + + return matchingType.tabs; + } + }, { + key: 'renderBlocks', + value: function renderBlocks() { + var _this2 = this; + + var _props = this.props, + ElementComponent = _props.ElementComponent, + HoverBarComponent = _props.HoverBarComponent, + blocks = _props.blocks, + elementTypes = _props.elementTypes, + elementalAreaId = _props.elementalAreaId; + + if (!blocks) { + return null; + } + + if (blocks && !blocks.length) { + return _react2.default.createElement( + 'div', + null, + _i18n2.default._t('ElementList.ADD_BLOCKS', 'Add blocks to place your content') + ); + } + + return blocks.map(function (element) { + return _react2.default.createElement( + 'div', + { key: element.ID }, + _react2.default.createElement(ElementComponent, { + element: element, + editTabs: _this2.getEditTabs(element), + link: element.BlockSchema.actions.edit + }), + _react2.default.createElement(HoverBarComponent, { + elementalAreaId: elementalAreaId, + elementId: element.ID, + elementTypes: elementTypes + }) + ); + }); + } + }, { + key: 'renderLoading', + value: function renderLoading() { + var _props2 = this.props, + loading = _props2.loading, + LoadingComponent = _props2.LoadingComponent; + + + if (loading) { + return _react2.default.createElement(LoadingComponent, null); + } + return null; + } + }, { + key: 'render', + value: function render() { + var blocks = this.props.blocks; + + var listClassNames = (0, _classnames2.default)('elemental-editor__list', { 'elemental-editor__list--empty': !blocks || !blocks.length }); + + return _react2.default.createElement( + 'div', + { className: listClassNames }, + this.renderLoading(), + this.renderBlocks() + ); + } + }]); + + return ElementList; +}(_react.Component); + +ElementList.propTypes = { + blocks: _react.PropTypes.arrayOf(_elementType.elementType), + loading: _react.PropTypes.bool, + elementalAreaId: _react.PropTypes.number.isRequired +}; + +ElementList.defaultProps = { + blocks: [], + loading: false +}; + +exports.Component = ElementList; +exports.default = (0, _Injector.inject)(['Element', 'Loading', 'HoverBar'], function (ElementComponent, LoadingComponent, HoverBarComponent) { + return { + ElementComponent: ElementComponent, + LoadingComponent: LoadingComponent, + HoverBarComponent: HoverBarComponent + }; +}, function () { + return 'ElementEditor.ElementList'; +})(ElementList); + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactstrap = __webpack_require__(10); + +var _redux = __webpack_require__(4); + +var _Injector = __webpack_require__(1); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Header = function (_Component) { + _inherits(Header, _Component); + + function Header(props) { + _classCallCheck(this, Header); + + var _this = _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).call(this, props)); + + _this.toggle = _this.toggle.bind(_this); + + _this.state = { + tooltipOpen: false + }; + return _this; + } + + _createClass(Header, [{ + key: 'toggle', + value: function toggle() { + this.setState({ + tooltipOpen: !this.state.tooltipOpen + }); + } + }, { + key: 'renderVersionedStateMessage', + value: function renderVersionedStateMessage() { + var _props = this.props, + isLiveVersion = _props.isLiveVersion, + isPublished = _props.isPublished; + + if (isPublished && isLiveVersion) { + return null; + } + + var versionStateButtonTitle = ''; + var stateClassNames = ['element-editor-header__version-state']; + + if (!isPublished) { + versionStateButtonTitle = _i18n2.default._t('ElementHeader.STATE_DRAFT', 'Item has not been published yet'); + stateClassNames.push('element-editor-header__version-state--draft'); + } + + if (isPublished && !isLiveVersion) { + versionStateButtonTitle = _i18n2.default._t('ElementHeader.STATE_MODIFIED', 'Item has unpublished changes'); + stateClassNames.push('element-editor-header__version-state--modified'); + } + + return _react2.default.createElement('span', { + className: (0, _classnames2.default)(stateClassNames), + title: versionStateButtonTitle + }); + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + id = _props2.id, + title = _props2.title, + elementType = _props2.elementType, + fontIcon = _props2.fontIcon, + expandable = _props2.expandable, + previewExpanded = _props2.previewExpanded, + ElementActionsComponent = _props2.ElementActionsComponent; + + + var noTitle = _i18n2.default.inject(_i18n2.default._t('ElementHeader.NOTITLE', 'Untitled {type} block'), { type: elementType }); + var titleClasses = (0, _classnames2.default)({ + 'element-editor-header__title': true, + 'element-editor-header__title--none': !title + }); + var expandTitle = _i18n2.default._t('ElementHeader.EXPAND', 'Show editable fields'); + var expandCaretClasses = (0, _classnames2.default)('element-editor-header__expand', { + 'font-icon-right-open-big': !expandable, + 'font-icon-up-open-big': expandable && previewExpanded, + 'font-icon-down-open-big': expandable && !previewExpanded + }); + + return _react2.default.createElement( + 'div', + { className: 'element-editor-header' }, + _react2.default.createElement( + 'div', + { className: 'element-editor-header__info' }, + _react2.default.createElement( + 'div', + { className: 'element-editor-header__icon-container' }, + _react2.default.createElement('i', { className: fontIcon, id: 'element-editor-header__icon' + id }), + this.renderVersionedStateMessage(), + _react2.default.createElement( + _reactstrap.Tooltip, + { + placement: 'top', + isOpen: this.state.tooltipOpen, + target: 'element-editor-header__icon' + id, + toggle: this.toggle + }, + elementType + ) + ), + _react2.default.createElement( + 'h3', + { className: titleClasses }, + title || noTitle + ) + ), + _react2.default.createElement( + 'div', + { + className: 'element-editor-header__actions' + + }, + expandable && _react2.default.createElement( + 'div', + { + role: 'none', + onClick: function onClick(event) { + return event.stopPropagation(); + } + }, + _react2.default.createElement(ElementActionsComponent, this.props) + ), + _react2.default.createElement('i', { className: expandCaretClasses, title: expandTitle }) + ) + ); + } + }]); + + return Header; +}(_react.Component); + +Header.propTypes = { + id: _react.PropTypes.string, + title: _react.PropTypes.string, + version: _react.PropTypes.number, + isLiveVersion: _react.PropTypes.bool, + isPublished: _react.PropTypes.bool, + elementType: _react.PropTypes.string, + fontIcon: _react.PropTypes.string, + ElementActionsComponent: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.node, _react2.default.PropTypes.func]), + expandable: _react.PropTypes.bool, + previewExpanded: _react.PropTypes.bool +}; + +Header.defaultProps = { + expandable: true +}; + +exports.Component = Header; +exports.default = (0, _redux.compose)((0, _Injector.inject)(['ElementActions'], function (ElementActionsComponent) { + return { + ElementActionsComponent: ElementActionsComponent + }; +}, function () { + return 'ElementEditor.ElementList.Element'; +}))(Header); + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Component = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _Injector = __webpack_require__(1); + +var _elementTypeType = __webpack_require__(8); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var HoverBar = function (_Component) { + _inherits(HoverBar, _Component); + + function HoverBar(props) { + _classCallCheck(this, HoverBar); + + var _this = _possibleConstructorReturn(this, (HoverBar.__proto__ || Object.getPrototypeOf(HoverBar)).call(this, props)); + + _this.handleMouseEnter = _this.handleMouseEnter.bind(_this); + _this.handleMouseLeave = _this.handleMouseLeave.bind(_this); + _this.renderHoverBar = _this.renderHoverBar.bind(_this); + _this.toggle = _this.toggle.bind(_this); + + _this.state = { + timeoutRef: null, + delayAreaActive: false, + instAreaActive: false, + popoverOpen: false + }; + return _this; + } + + _createClass(HoverBar, [{ + key: 'handleMouseEnter', + value: function handleMouseEnter(event) { + var _this2 = this; + + var elementId = this.props.elementId; + + var plusButtonWidth = 50; + + var addBlockAreaContainer = window.document.getElementById('AddBlockArea_' + elementId); + var clientWidth = addBlockAreaContainer.clientWidth; + var offsetLeft = addBlockAreaContainer.getBoundingClientRect().left; + var mousePos = event.pageX - offsetLeft; + var delayArea = clientWidth - plusButtonWidth; + + if (mousePos < delayArea) { + var timeoutRef = setTimeout(function () { + _this2.setState({ + delayAreaActive: true + }); + }, 200); + + this.setState({ + timeoutRef: timeoutRef + }); + } else { + this.setState({ + instAreaActive: true + }); + } + } + }, { + key: 'handleMouseLeave', + value: function handleMouseLeave() { + clearTimeout(this.state.timeoutRef); + + if (this.state.popoverOpen) { + return; + } + this.setState({ delayAreaActive: false, instAreaActive: false }); + } + }, { + key: 'toggle', + value: function toggle() { + this.setState({ + popoverOpen: !this.state.popoverOpen + }); + } + }, { + key: 'renderHoverBar', + value: function renderHoverBar(calledInstantaneously) { + var elementId = this.props.elementId; + + + var hoverBarClassNames = (0, _classnames2.default)('font-icon-plus-circled', 'element-editor__add-block-hover-bar', { + 'element-editor__add-block-hover-bar--delay': !calledInstantaneously, + 'element-editor__add-block-hover-bar--inst': calledInstantaneously + }); + + return _react2.default.createElement('button', { + id: 'AddBlockHoverBar_' + elementId, + className: hoverBarClassNames, + onClick: this.toggle + }); + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + AddElementPopoverComponent = _props.AddElementPopoverComponent, + elementTypes = _props.elementTypes, + elementId = _props.elementId, + elementalAreaId = _props.elementalAreaId; + var popoverOpen = this.state.popoverOpen; + + + return _react2.default.createElement( + 'div', + { className: 'element-editor__add-block-area-container', id: 'AddBlockArea_' + elementId }, + _react2.default.createElement( + 'div', + { + className: 'element-editor__add-block-area', + onMouseEnter: this.handleMouseEnter, + onMouseLeave: this.handleMouseLeave + }, + this.state.delayAreaActive && this.renderHoverBar(false) || this.state.instAreaActive && this.renderHoverBar(true), + (this.state.delayAreaActive || this.state.instAreaActive) && _react2.default.createElement(AddElementPopoverComponent, { + placement: 'bottom-end', + target: 'AddBlockHoverBar_' + elementId, + isOpen: popoverOpen, + elementTypes: elementTypes, + toggle: this.toggle, + container: '#AddBlockArea_' + elementId, + elementalAreaId: elementalAreaId, + insertAfterElement: elementId + }) + ) + ); + } + }]); + + return HoverBar; +}(_react.Component); + +HoverBar.propTypes = { + elementTypes: _react.PropTypes.arrayOf(_elementTypeType.elementTypeType).isRequired, + elementId: _react.PropTypes.number.isRequired, + elementalAreaId: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]).isRequired +}; +exports.Component = HoverBar; +exports.default = (0, _Injector.inject)(['AddElementPopover'], function (AddElementPopoverComponent) { + return { + AddElementPopoverComponent: AddElementPopoverComponent + }; +}, function () { + return 'ElementEditor.ElementList.HoverBar'; +})(HoverBar); + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +var _FormBuilderLoader = __webpack_require__(61); + +var _FormBuilderLoader2 = _interopRequireDefault(_FormBuilderLoader); + +var _loadElementSchemaValue = __webpack_require__(12); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InlineEditForm = function (_PureComponent) { + _inherits(InlineEditForm, _PureComponent); + + function InlineEditForm() { + _classCallCheck(this, InlineEditForm); + + return _possibleConstructorReturn(this, (InlineEditForm.__proto__ || Object.getPrototypeOf(InlineEditForm)).apply(this, arguments)); + } + + _createClass(InlineEditForm, [{ + key: 'render', + value: function render() { + var _props = this.props, + elementId = _props.elementId, + extraClass = _props.extraClass, + onClick = _props.onClick, + onFormInit = _props.onFormInit; + + + var classNames = (0, _classnames2.default)('element-editor-editform', extraClass); + var schemaUrl = (0, _loadElementSchemaValue.loadElementSchemaValue)('schemaUrl', elementId); + + var formProps = { + formTag: 'div', + schemaUrl: schemaUrl, + identifier: 'element', + refetchSchemaOnMount: false + }; + + if (typeof onFormInit === 'function') { + formProps.onReduxFormInit = onFormInit; + } + + return _react2.default.createElement( + 'div', + { className: classNames, onClick: onClick, role: 'presentation' }, + _react2.default.createElement(_FormBuilderLoader2.default, formProps) + ); + } + }]); + + return InlineEditForm; +}(_react.PureComponent); + +InlineEditForm.propTypes = { + extraClass: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.object]), + onClick: _react.PropTypes.func, + elementId: _react.PropTypes.string +}; + +exports.default = InlineEditForm; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Summary = function (_PureComponent) { + _inherits(Summary, _PureComponent); + + function Summary() { + _classCallCheck(this, Summary); + + return _possibleConstructorReturn(this, (Summary.__proto__ || Object.getPrototypeOf(Summary)).apply(this, arguments)); + } + + _createClass(Summary, [{ + key: "render", + value: function render() { + var _props = this.props, + fileUrl = _props.fileUrl, + fileTitle = _props.fileTitle, + content = _props.content; + + + return _react2.default.createElement( + "div", + { className: "element-editor-summary" }, + fileUrl && _react2.default.createElement("img", { + className: "element-editor-summary__thumbnail-image", + src: fileUrl, + alt: fileTitle + }), + (content || !fileUrl) && _react2.default.createElement( + "p", + { className: "element-editor-summary__content" }, + content + ) + ); + } + }]); + + return Summary; +}(_react.PureComponent); + +Summary.defaultProps = {}; + +Summary.propTypes = { + content: _react.PropTypes.string, + fileUrl: _react.PropTypes.string, + fileTitle: _react.PropTypes.string +}; + +exports.default = Summary; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _Injector = __webpack_require__(1); + +var _elementTypeType = __webpack_require__(8); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Toolbar = function (_PureComponent) { + _inherits(Toolbar, _PureComponent); + + function Toolbar() { + _classCallCheck(this, Toolbar); + + return _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).apply(this, arguments)); + } + + _createClass(Toolbar, [{ + key: 'render', + value: function render() { + var _props = this.props, + AddNewButtonComponent = _props.AddNewButtonComponent, + elementTypes = _props.elementTypes, + elementalAreaId = _props.elementalAreaId; + + return _react2.default.createElement( + 'div', + { className: 'element-editor__toolbar' }, + _react2.default.createElement(AddNewButtonComponent, { + elementTypes: elementTypes, + elementalAreaId: elementalAreaId + }) + ); + } + }]); + + return Toolbar; +}(_react.PureComponent); + +Toolbar.defaultProps = {}; +Toolbar.propTypes = { + elementTypes: _react.PropTypes.arrayOf(_elementTypeType.elementTypeType).isRequired, + elementalAreaId: _react.PropTypes.number.isRequired, + AddNewButtonComponent: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.func]).isRequired +}; + +exports.default = (0, _Injector.inject)(['ElementAddNewButton'], function (AddNewButtonComponent) { + return { + AddNewButtonComponent: AddNewButtonComponent + }; +}, function () { + return 'ElementEditor.ElementToolbar'; +})(Toolbar); + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _i18n = __webpack_require__(2); + +var _i18n2 = _interopRequireDefault(_i18n); + +var _classnames = __webpack_require__(3); + +var _classnames2 = _interopRequireDefault(_classnames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ElementalAreaHistoryFactory = function ElementalAreaHistoryFactory(FieldGroup) { + return function (_FieldGroup) { + _inherits(HistoricElementView, _FieldGroup); + + function HistoricElementView() { + _classCallCheck(this, HistoricElementView); + + return _possibleConstructorReturn(this, (HistoricElementView.__proto__ || Object.getPrototypeOf(HistoricElementView)).apply(this, arguments)); + } + + _createClass(HistoricElementView, [{ + key: 'getClassName', + value: function getClassName() { + var classlist = [_get(HistoricElementView.prototype.__proto__ || Object.getPrototypeOf(HistoricElementView.prototype), 'getClassName', this).call(this)]; + if (this.props.data.ElementID) { + classlist.unshift('elemental-area__element--historic-inner'); + } + return (0, _classnames2.default)(classlist); + } + }, { + key: 'render', + value: function render() { + var legend = this.getLegend(); + var Tag = this.props.data.tag || 'div'; + var classNames = this.getClassName(); + var data = this.props.data; + + + if (!data.ElementID) { + return _get(HistoricElementView.prototype.__proto__ || Object.getPrototypeOf(HistoricElementView.prototype), 'render', this).call(this); + } + + return _react2.default.createElement( + Tag, + { className: classNames }, + legend, + _react2.default.createElement( + 'div', + { className: 'elemental-preview elemental-preview--historic' }, + data.ElementEditLink && _react2.default.createElement( + 'a', + { className: 'elemental-preview__link', href: data.ElementEditLink }, + _i18n2.default._t('HistoricElementView.BLOCK_HISTORY', 'View block'), + _react2.default.createElement('i', { className: 'font-icon-angle-right' }) + ), + _react2.default.createElement( + 'div', + { className: 'elemental-preview__icon' }, + _react2.default.createElement('i', { className: data.ElementIcon }) + ), + _react2.default.createElement( + 'div', + { className: 'elemental-preview__detail' }, + _react2.default.createElement( + 'h3', + null, + data.ElementTitle, + ' ', + _react2.default.createElement( + 'small', + null, + data.ElementType + ) + ) + ) + ), + this.props.children + ); + } + }]); + + return HistoricElementView; + }(FieldGroup); +}; + +exports.default = ElementalAreaHistoryFactory; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.mutation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nmutation AddElementToArea($className: String!, $elementalAreaID: ID!, $afterElementID: ID) {\n addElementToArea(\n ClassName: $className,\n ElementalAreaID: $elementalAreaID,\n AfterElementID: $afterElementID\n ) {\n ID\n Sort\n InlineEditable\n }\n}\n'], ['\nmutation AddElementToArea($className: String!, $elementalAreaID: ID!, $afterElementID: ID) {\n addElementToArea(\n ClassName: $className,\n ElementalAreaID: $elementalAreaID,\n AfterElementID: $afterElementID\n ) {\n ID\n Sort\n InlineEditable\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var mutation = (0, _graphqlTag2.default)(_templateObject); + +var config = { + props: function props(_ref) { + var mutate = _ref.mutate, + actions = _ref.ownProps.actions; + + var handleAddElementToArea = function handleAddElementToArea(className, elementalAreaID, afterElementID) { + return mutate({ + variables: { className: className, elementalAreaID: elementalAreaID, afterElementID: afterElementID } + }); + }; + + return { + actions: _extends({}, actions, { + handleAddElementToArea: handleAddElementToArea + }) + }; + }, + options: { + refetchQueries: ['ReadBlocksForPage'] + } +}; + +exports.mutation = mutation; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(mutation, config); + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.mutation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nmutation ArchiveBlock($blockId: ID!) {\n deleteBlock(IDs: [$blockId]) {\n ID\n }\n}\n'], ['\nmutation ArchiveBlock($blockId: ID!) {\n deleteBlock(IDs: [$blockId]) {\n ID\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var mutation = (0, _graphqlTag2.default)(_templateObject); + +var config = { + props: function props(_ref) { + var mutate = _ref.mutate, + actions = _ref.ownProps.actions; + + var handleArchiveBlock = function handleArchiveBlock(blockId) { + return mutate({ + variables: { blockId: blockId } + }); + }; + + return { + actions: _extends({}, actions, { + handleArchiveBlock: handleArchiveBlock + }) + }; + }, + options: { + refetchQueries: ['ReadBlocksForPage'] + } +}; + +exports.mutation = mutation; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(mutation, config); + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.mutation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nmutation PublishBlock($blockId:ID!, $fromStage:VersionedStage!, $toStage:VersionedStage!, $fromVersion:Int!) {\n copyBlockToStage(Input: {\n ID: $blockId\n FromVersion: $fromVersion\n FromStage: $fromStage\n ToStage: $toStage\n }) {\n ID\n }\n}\n'], ['\nmutation PublishBlock($blockId:ID!, $fromStage:VersionedStage!, $toStage:VersionedStage!, $fromVersion:Int!) {\n copyBlockToStage(Input: {\n ID: $blockId\n FromVersion: $fromVersion\n FromStage: $fromStage\n ToStage: $toStage\n }) {\n ID\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var mutation = (0, _graphqlTag2.default)(_templateObject); + +var config = { + props: function props(_ref) { + var mutate = _ref.mutate, + actions = _ref.ownProps.actions; + + var handlePublishBlock = function handlePublishBlock(blockId, fromStage, toStage, fromVersion) { + return mutate({ + variables: { + blockId: blockId, + fromStage: fromStage, + toStage: toStage, + fromVersion: fromVersion + } + }); + }; + + return { + actions: _extends({}, actions, { + handlePublishBlock: handlePublishBlock + }) + }; + }, + options: { + refetchQueries: ['ReadBlocksForPage'] + } +}; + +exports.mutation = mutation; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(mutation, config); + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.query = undefined; + +var _templateObject = _taggedTemplateLiteral(['\nquery ReadBlocksForPage($id:ID!) {\n readOnePage(ID: $id, Versioning: {\n Mode: DRAFT\n }){\n ID\n ElementalAreaIfExists {\n Elements {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ID\n Title\n BlockSchema\n InlineEditable\n IsLiveVersion\n IsPublished\n Version\n }\n }\n }\n }\n }\n}\n'], ['\nquery ReadBlocksForPage($id:ID!) {\n readOnePage(ID: $id, Versioning: {\n Mode: DRAFT\n }){\n ID\n ElementalAreaIfExists {\n Elements {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ID\n Title\n BlockSchema\n InlineEditable\n IsLiveVersion\n IsPublished\n Version\n }\n }\n }\n }\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var query = (0, _graphqlTag2.default)(_templateObject); + +var config = { + options: function options(_ref) { + var pageId = _ref.pageId; + + return { + variables: { + id: pageId + } + }; + }, + props: function props(_ref2) { + var _ref2$data = _ref2.data, + error = _ref2$data.error, + readOnePage = _ref2$data.readOnePage, + networkLoading = _ref2$data.loading; + + var blocks = null; + if (readOnePage) { + blocks = readOnePage.ElementalAreaIfExists.Elements.edges.map(function (element) { + return element.node; + }); + } + + var errors = error && error.graphQLErrors && error.graphQLErrors.map(function (graphQLError) { + return graphQLError.message; + }); + + return { + loading: networkLoading || !blocks, + blocks: blocks, + graphQLErrors: errors + }; + } +}; + +exports.query = query; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(query, config); + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.mutation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nmutation UnpublishBlock($blockId:ID!) {\n unpublishBlock(\n ID: $blockId\n ) {\n ID\n }\n}\n'], ['\nmutation UnpublishBlock($blockId:ID!) {\n unpublishBlock(\n ID: $blockId\n ) {\n ID\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var mutation = (0, _graphqlTag2.default)(_templateObject); + +var config = { + props: function props(_ref) { + var mutate = _ref.mutate, + actions = _ref.ownProps.actions; + + var handleUnpublishBlock = function handleUnpublishBlock(blockId, fromStage, toStage, fromVersion) { + return mutate({ + variables: { + blockId: blockId, + fromStage: fromStage, + toStage: toStage, + fromVersion: fromVersion + } + }); + }; + + return { + actions: _extends({}, actions, { + handleUnpublishBlock: handleUnpublishBlock + }) + }; + }, + options: { + refetchQueries: ['ReadBlocksForPage'] + } +}; + +exports.mutation = mutation; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(mutation, config); + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.query = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nquery ReadHistoryViewerBlock ($block_id: ID!, $limit: Int!, $offset: Int!) {\n readOneBlock(\n Versioning: {\n Mode: LATEST\n },\n ID: $block_id\n ) {\n ID\n Versions (limit: $limit, offset: $offset) {\n pageInfo {\n totalCount\n }\n edges {\n node {\n Version\n AbsoluteLink\n Author {\n FirstName\n Surname\n }\n Publisher {\n FirstName\n Surname\n }\n Published\n LiveVersion\n LatestDraftVersion\n LastEdited\n }\n }\n }\n }\n}\n'], ['\nquery ReadHistoryViewerBlock ($block_id: ID!, $limit: Int!, $offset: Int!) {\n readOneBlock(\n Versioning: {\n Mode: LATEST\n },\n ID: $block_id\n ) {\n ID\n Versions (limit: $limit, offset: $offset) {\n pageInfo {\n totalCount\n }\n edges {\n node {\n Version\n AbsoluteLink\n Author {\n FirstName\n Surname\n }\n Publisher {\n FirstName\n Surname\n }\n Published\n LiveVersion\n LatestDraftVersion\n LastEdited\n }\n }\n }\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var query = (0, _graphqlTag2.default)(_templateObject); + +var config = { + options: function options(_ref) { + var recordId = _ref.recordId, + limit = _ref.limit, + page = _ref.page; + + return { + variables: { + limit: limit, + offset: ((page || 1) - 1) * limit, + block_id: recordId + } + }; + }, + props: function props(_ref2) { + var _ref2$data = _ref2.data, + error = _ref2$data.error, + refetch = _ref2$data.refetch, + readOneBlock = _ref2$data.readOneBlock, + networkLoading = _ref2$data.loading, + _ref2$ownProps = _ref2.ownProps, + _ref2$ownProps$action = _ref2$ownProps.actions, + actions = _ref2$ownProps$action === undefined ? { + versions: {} + } : _ref2$ownProps$action, + limit = _ref2$ownProps.limit, + recordId = _ref2$ownProps.recordId; + + var versions = readOneBlock || null; + + var errors = error && error.graphQLErrors && error.graphQLErrors.map(function (graphQLError) { + return graphQLError.message; + }); + + return { + loading: networkLoading || !versions, + versions: versions, + graphQLErrors: errors, + actions: _extends({}, actions, { + versions: _extends({}, versions, { + goToPage: function goToPage(page) { + refetch({ + offset: ((page || 1) - 1) * limit, + limit: limit, + block_id: recordId + }); + } + }) + }) + }; + } +}; + +exports.query = query; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(query, config); + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.config = exports.mutation = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _templateObject = _taggedTemplateLiteral(['\nmutation revertBlockToVersion($id:ID!, $fromStage:VersionedStage!, $toStage:VersionedStage!, $fromVersion:Int!) {\n copyBlockToStage(Input: {\n ID: $id\n FromVersion: $fromVersion\n FromStage: $fromStage\n ToStage: $toStage\n }) {\n ID\n }\n}\n'], ['\nmutation revertBlockToVersion($id:ID!, $fromStage:VersionedStage!, $toStage:VersionedStage!, $fromVersion:Int!) {\n copyBlockToStage(Input: {\n ID: $id\n FromVersion: $fromVersion\n FromStage: $fromStage\n ToStage: $toStage\n }) {\n ID\n }\n}\n']); + +var _reactApollo = __webpack_require__(6); + +var _graphqlTag = __webpack_require__(5); + +var _graphqlTag2 = _interopRequireDefault(_graphqlTag); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var mutation = (0, _graphqlTag2.default)(_templateObject); + +var config = { + props: function props(_ref) { + var mutate = _ref.mutate, + actions = _ref.ownProps.actions; + + var revertToVersion = function revertToVersion(id, fromVersion, fromStage, toStage) { + return mutate({ + variables: { + id: id, + fromVersion: fromVersion, + fromStage: fromStage, + toStage: toStage + } + }); + }; + + return { + actions: _extends({}, actions, { + revertToVersion: revertToVersion + }) + }; + }, + options: { + refetchQueries: ['ReadHistoryViewerBlock'] + } +}; + +exports.mutation = mutation; +exports.config = config; +exports.default = (0, _reactApollo.graphql)(mutation, config); + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + nullTag = '[object Null]', + proxyTag = '[object Proxy]', + undefinedTag = '[object Undefined]'; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isFunction; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16))) + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), +/* 52 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* WEBPACK VAR INJECTION */(function(global) {/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.14.4 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; + +var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; +var timeoutDuration = 0; +for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { + if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { + timeoutDuration = 1; + break; + } +} + +function microtaskDebounce(fn) { + var called = false; + return function () { + if (called) { + return; + } + called = true; + window.Promise.resolve().then(function () { + called = false; + fn(); + }); + }; +} + +function taskDebounce(fn) { + var scheduled = false; + return function () { + if (!scheduled) { + scheduled = true; + setTimeout(function () { + scheduled = false; + fn(); + }, timeoutDuration); + } + }; +} + +var supportsMicroTasks = isBrowser && window.Promise; + +/** +* Create a debounced version of a method, that's asynchronously deferred +* but called in the minimum time possible. +* +* @method +* @memberof Popper.Utils +* @argument {Function} fn +* @returns {Function} +*/ +var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; + +/** + * Check if the given variable is a function + * @method + * @memberof Popper.Utils + * @argument {Any} functionToCheck - variable to check + * @returns {Boolean} answer to: is a function? + */ +function isFunction(functionToCheck) { + var getType = {}; + return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; +} + +/** + * Get CSS computed property of the given element + * @method + * @memberof Popper.Utils + * @argument {Eement} element + * @argument {String} property + */ +function getStyleComputedProperty(element, property) { + if (element.nodeType !== 1) { + return []; + } + // NOTE: 1 DOM access here + var css = getComputedStyle(element, null); + return property ? css[property] : css; +} + +/** + * Returns the parentNode or the host of the element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} parent + */ +function getParentNode(element) { + if (element.nodeName === 'HTML') { + return element; + } + return element.parentNode || element.host; +} + +/** + * Returns the scrolling parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} scroll parent + */ +function getScrollParent(element) { + // Return body, `getScroll` will take care to get the correct `scrollTop` from it + if (!element) { + return document.body; + } + + switch (element.nodeName) { + case 'HTML': + case 'BODY': + return element.ownerDocument.body; + case '#document': + return element.body; + } + + // Firefox want us to check `-x` and `-y` variations as well + + var _getStyleComputedProp = getStyleComputedProperty(element), + overflow = _getStyleComputedProp.overflow, + overflowX = _getStyleComputedProp.overflowX, + overflowY = _getStyleComputedProp.overflowY; + + if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { + return element; + } + + return getScrollParent(getParentNode(element)); +} + +var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); +var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); + +/** + * Determines if the browser is Internet Explorer + * @method + * @memberof Popper.Utils + * @param {Number} version to check + * @returns {Boolean} isIE + */ +function isIE(version) { + if (version === 11) { + return isIE11; + } + if (version === 10) { + return isIE10; + } + return isIE11 || isIE10; +} + +/** + * Returns the offset parent of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} offset parent + */ +function getOffsetParent(element) { + if (!element) { + return document.documentElement; + } + + var noOffsetParent = isIE(10) ? document.body : null; + + // NOTE: 1 DOM access here + var offsetParent = element.offsetParent; + // Skip hidden elements which don't have an offsetParent + while (offsetParent === noOffsetParent && element.nextElementSibling) { + offsetParent = (element = element.nextElementSibling).offsetParent; + } + + var nodeName = offsetParent && offsetParent.nodeName; + + if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { + return element ? element.ownerDocument.documentElement : document.documentElement; + } + + // .offsetParent will return the closest TD or TABLE in case + // no offsetParent is present, I hate this job... + if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { + return getOffsetParent(offsetParent); + } + + return offsetParent; +} + +function isOffsetContainer(element) { + var nodeName = element.nodeName; + + if (nodeName === 'BODY') { + return false; + } + return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; +} + +/** + * Finds the root node (document, shadowDOM root) of the given element + * @method + * @memberof Popper.Utils + * @argument {Element} node + * @returns {Element} root node + */ +function getRoot(node) { + if (node.parentNode !== null) { + return getRoot(node.parentNode); + } + + return node; +} + +/** + * Finds the offset parent common to the two provided nodes + * @method + * @memberof Popper.Utils + * @argument {Element} element1 + * @argument {Element} element2 + * @returns {Element} common offset parent + */ +function findCommonOffsetParent(element1, element2) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { + return document.documentElement; + } + + // Here we make sure to give as "start" the element that comes first in the DOM + var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; + var start = order ? element1 : element2; + var end = order ? element2 : element1; + + // Get common ancestor container + var range = document.createRange(); + range.setStart(start, 0); + range.setEnd(end, 0); + var commonAncestorContainer = range.commonAncestorContainer; + + // Both nodes are inside #document + + if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { + if (isOffsetContainer(commonAncestorContainer)) { + return commonAncestorContainer; + } + + return getOffsetParent(commonAncestorContainer); + } + + // one of the nodes is inside shadowDOM, find which one + var element1root = getRoot(element1); + if (element1root.host) { + return findCommonOffsetParent(element1root.host, element2); + } else { + return findCommonOffsetParent(element1, getRoot(element2).host); + } +} + +/** + * Gets the scroll value of the given element in the given side (top and left) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {String} side `top` or `left` + * @returns {number} amount of scrolled pixels + */ +function getScroll(element) { + var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; + + var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; + var nodeName = element.nodeName; + + if (nodeName === 'BODY' || nodeName === 'HTML') { + var html = element.ownerDocument.documentElement; + var scrollingElement = element.ownerDocument.scrollingElement || html; + return scrollingElement[upperSide]; + } + + return element[upperSide]; +} + +/* + * Sum or subtract the element scroll values (left and top) from a given rect object + * @method + * @memberof Popper.Utils + * @param {Object} rect - Rect object you want to change + * @param {HTMLElement} element - The element from the function reads the scroll values + * @param {Boolean} subtract - set to true if you want to subtract the scroll values + * @return {Object} rect - The modifier rect object + */ +function includeScroll(rect, element) { + var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + var modifier = subtract ? -1 : 1; + rect.top += scrollTop * modifier; + rect.bottom += scrollTop * modifier; + rect.left += scrollLeft * modifier; + rect.right += scrollLeft * modifier; + return rect; +} + +/* + * Helper to detect borders of a given element + * @method + * @memberof Popper.Utils + * @param {CSSStyleDeclaration} styles + * Result of `getStyleComputedProperty` on the given element + * @param {String} axis - `x` or `y` + * @return {number} borders - The borders size of the given axis + */ + +function getBordersSize(styles, axis) { + var sideA = axis === 'x' ? 'Left' : 'Top'; + var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; + + return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); +} + +function getSize(axis, body, html, computedStyle) { + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); +} + +function getWindowSizes(document) { + var body = document.body; + var html = document.documentElement; + var computedStyle = isIE(10) && getComputedStyle(html); + + return { + height: getSize('Height', body, html, computedStyle), + width: getSize('Width', body, html, computedStyle) + }; +} + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + +var defineProperty = function (obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +/** + * Given element offsets, generate an output similar to getBoundingClientRect + * @method + * @memberof Popper.Utils + * @argument {Object} offsets + * @returns {Object} ClientRect like output + */ +function getClientRect(offsets) { + return _extends({}, offsets, { + right: offsets.left + offsets.width, + bottom: offsets.top + offsets.height + }); +} + +/** + * Get bounding client rect of given element + * @method + * @memberof Popper.Utils + * @param {HTMLElement} element + * @return {Object} client rect + */ +function getBoundingClientRect(element) { + var rect = {}; + + // IE10 10 FIX: Please, don't ask, the element isn't + // considered in DOM in some circumstances... + // This isn't reproducible in IE10 compatibility mode of IE11 + try { + if (isIE(10)) { + rect = element.getBoundingClientRect(); + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + rect.top += scrollTop; + rect.left += scrollLeft; + rect.bottom += scrollTop; + rect.right += scrollLeft; + } else { + rect = element.getBoundingClientRect(); + } + } catch (e) {} + + var result = { + left: rect.left, + top: rect.top, + width: rect.right - rect.left, + height: rect.bottom - rect.top + }; + + // subtract scrollbar size from sizes + var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; + var width = sizes.width || element.clientWidth || result.right - result.left; + var height = sizes.height || element.clientHeight || result.bottom - result.top; + + var horizScrollbar = element.offsetWidth - width; + var vertScrollbar = element.offsetHeight - height; + + // if an hypothetical scrollbar is detected, we must be sure it's not a `border` + // we make this check conditional for performance reasons + if (horizScrollbar || vertScrollbar) { + var styles = getStyleComputedProperty(element); + horizScrollbar -= getBordersSize(styles, 'x'); + vertScrollbar -= getBordersSize(styles, 'y'); + + result.width -= horizScrollbar; + result.height -= vertScrollbar; + } + + return getClientRect(result); +} + +function getOffsetRectRelativeToArbitraryNode(children, parent) { + var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var isIE10 = isIE(10); + var isHTML = parent.nodeName === 'HTML'; + var childrenRect = getBoundingClientRect(children); + var parentRect = getBoundingClientRect(parent); + var scrollParent = getScrollParent(children); + + var styles = getStyleComputedProperty(parent); + var borderTopWidth = parseFloat(styles.borderTopWidth, 10); + var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); + + // In cases where the parent is fixed, we must ignore negative scroll in offset calc + if (fixedPosition && isHTML) { + parentRect.top = Math.max(parentRect.top, 0); + parentRect.left = Math.max(parentRect.left, 0); + } + var offsets = getClientRect({ + top: childrenRect.top - parentRect.top - borderTopWidth, + left: childrenRect.left - parentRect.left - borderLeftWidth, + width: childrenRect.width, + height: childrenRect.height + }); + offsets.marginTop = 0; + offsets.marginLeft = 0; + + // Subtract margins of documentElement in case it's being used as parent + // we do this only on HTML because it's the only element that behaves + // differently when margins are applied to it. The margins are included in + // the box of the documentElement, in the other cases not. + if (!isIE10 && isHTML) { + var marginTop = parseFloat(styles.marginTop, 10); + var marginLeft = parseFloat(styles.marginLeft, 10); + + offsets.top -= borderTopWidth - marginTop; + offsets.bottom -= borderTopWidth - marginTop; + offsets.left -= borderLeftWidth - marginLeft; + offsets.right -= borderLeftWidth - marginLeft; + + // Attach marginTop and marginLeft because in some circumstances we may need them + offsets.marginTop = marginTop; + offsets.marginLeft = marginLeft; + } + + if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { + offsets = includeScroll(offsets, parent); + } + + return offsets; +} + +function getViewportOffsetRectRelativeToArtbitraryNode(element) { + var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var html = element.ownerDocument.documentElement; + var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); + var width = Math.max(html.clientWidth, window.innerWidth || 0); + var height = Math.max(html.clientHeight, window.innerHeight || 0); + + var scrollTop = !excludeScroll ? getScroll(html) : 0; + var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; + + var offset = { + top: scrollTop - relativeOffset.top + relativeOffset.marginTop, + left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, + width: width, + height: height + }; + + return getClientRect(offset); +} + +/** + * Check if the given element is fixed or is inside a fixed parent + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @argument {Element} customContainer + * @returns {Boolean} answer to "isFixed?" + */ +function isFixed(element) { + var nodeName = element.nodeName; + if (nodeName === 'BODY' || nodeName === 'HTML') { + return false; + } + if (getStyleComputedProperty(element, 'position') === 'fixed') { + return true; + } + return isFixed(getParentNode(element)); +} + +/** + * Finds the first parent of an element that has a transformed property defined + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Element} first transformed parent or documentElement + */ + +function getFixedPositionOffsetParent(element) { + // This check is needed to avoid errors in case one of the elements isn't defined for any reason + if (!element || !element.parentElement || isIE()) { + return document.documentElement; + } + var el = element.parentElement; + while (el && getStyleComputedProperty(el, 'transform') === 'none') { + el = el.parentElement; + } + return el || document.documentElement; +} + +/** + * Computed the boundaries limits and return them + * @method + * @memberof Popper.Utils + * @param {HTMLElement} popper + * @param {HTMLElement} reference + * @param {number} padding + * @param {HTMLElement} boundariesElement - Element used to define the boundaries + * @param {Boolean} fixedPosition - Is in fixed position mode + * @returns {Object} Coordinates of the boundaries + */ +function getBoundaries(popper, reference, padding, boundariesElement) { + var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + // NOTE: 1 DOM access here + + var boundaries = { top: 0, left: 0 }; + var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + + // Handle viewport case + if (boundariesElement === 'viewport') { + boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); + } else { + // Handle other cases based on DOM element used as boundaries + var boundariesNode = void 0; + if (boundariesElement === 'scrollParent') { + boundariesNode = getScrollParent(getParentNode(reference)); + if (boundariesNode.nodeName === 'BODY') { + boundariesNode = popper.ownerDocument.documentElement; + } + } else if (boundariesElement === 'window') { + boundariesNode = popper.ownerDocument.documentElement; + } else { + boundariesNode = boundariesElement; + } + + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); + + // In case of HTML, we need a different computation + if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { + var _getWindowSizes = getWindowSizes(popper.ownerDocument), + height = _getWindowSizes.height, + width = _getWindowSizes.width; + + boundaries.top += offsets.top - offsets.marginTop; + boundaries.bottom = height + offsets.top; + boundaries.left += offsets.left - offsets.marginLeft; + boundaries.right = width + offsets.left; + } else { + // for all the other DOM elements, this one is good + boundaries = offsets; + } + } + + // Add paddings + padding = padding || 0; + var isPaddingNumber = typeof padding === 'number'; + boundaries.left += isPaddingNumber ? padding : padding.left || 0; + boundaries.top += isPaddingNumber ? padding : padding.top || 0; + boundaries.right -= isPaddingNumber ? padding : padding.right || 0; + boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; + + return boundaries; +} + +function getArea(_ref) { + var width = _ref.width, + height = _ref.height; + + return width * height; +} + +/** + * Utility used to transform the `auto` placement to the placement with more + * available space. + * @method + * @memberof Popper.Utils + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { + var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + + if (placement.indexOf('auto') === -1) { + return placement; + } + + var boundaries = getBoundaries(popper, reference, padding, boundariesElement); + + var rects = { + top: { + width: boundaries.width, + height: refRect.top - boundaries.top + }, + right: { + width: boundaries.right - refRect.right, + height: boundaries.height + }, + bottom: { + width: boundaries.width, + height: boundaries.bottom - refRect.bottom + }, + left: { + width: refRect.left - boundaries.left, + height: boundaries.height + } + }; + + var sortedAreas = Object.keys(rects).map(function (key) { + return _extends({ + key: key + }, rects[key], { + area: getArea(rects[key]) + }); + }).sort(function (a, b) { + return b.area - a.area; + }); + + var filteredAreas = sortedAreas.filter(function (_ref2) { + var width = _ref2.width, + height = _ref2.height; + return width >= popper.clientWidth && height >= popper.clientHeight; + }); + + var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; + + var variation = placement.split('-')[1]; + + return computedPlacement + (variation ? '-' + variation : ''); +} + +/** + * Get offsets to the reference element + * @method + * @memberof Popper.Utils + * @param {Object} state + * @param {Element} popper - the popper element + * @param {Element} reference - the reference element (the popper will be relative to this) + * @param {Element} fixedPosition - is in fixed position mode + * @returns {Object} An object containing the offsets which will be applied to the popper + */ +function getReferenceOffsets(state, popper, reference) { + var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + + var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); + return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); +} + +/** + * Get the outer sizes of the given element (offset size + margins) + * @method + * @memberof Popper.Utils + * @argument {Element} element + * @returns {Object} object containing width and height properties + */ +function getOuterSizes(element) { + var styles = getComputedStyle(element); + var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); + var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); + var result = { + width: element.offsetWidth + y, + height: element.offsetHeight + x + }; + return result; +} + +/** + * Get the opposite placement of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement + * @returns {String} flipped placement + */ +function getOppositePlacement(placement) { + var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); +} + +/** + * Get offsets to the popper + * @method + * @memberof Popper.Utils + * @param {Object} position - CSS position the Popper will get applied + * @param {HTMLElement} popper - the popper element + * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) + * @param {String} placement - one of the valid placement options + * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper + */ +function getPopperOffsets(popper, referenceOffsets, placement) { + placement = placement.split('-')[0]; + + // Get popper node sizes + var popperRect = getOuterSizes(popper); + + // Add position, width and height to our offsets object + var popperOffsets = { + width: popperRect.width, + height: popperRect.height + }; + + // depending by the popper placement we have to compute its offsets slightly differently + var isHoriz = ['right', 'left'].indexOf(placement) !== -1; + var mainSide = isHoriz ? 'top' : 'left'; + var secondarySide = isHoriz ? 'left' : 'top'; + var measurement = isHoriz ? 'height' : 'width'; + var secondaryMeasurement = !isHoriz ? 'height' : 'width'; + + popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; + if (placement === secondarySide) { + popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; + } else { + popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; + } + + return popperOffsets; +} + +/** + * Mimics the `find` method of Array + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ +function find(arr, check) { + // use native find if supported + if (Array.prototype.find) { + return arr.find(check); + } + + // use `filter` to obtain the same behavior of `find` + return arr.filter(check)[0]; +} + +/** + * Return the index of the matching object + * @method + * @memberof Popper.Utils + * @argument {Array} arr + * @argument prop + * @argument value + * @returns index or -1 + */ +function findIndex(arr, prop, value) { + // use native findIndex if supported + if (Array.prototype.findIndex) { + return arr.findIndex(function (cur) { + return cur[prop] === value; + }); + } + + // use `find` + `indexOf` if `findIndex` isn't supported + var match = find(arr, function (obj) { + return obj[prop] === value; + }); + return arr.indexOf(match); +} + +/** + * Loop trough the list of modifiers and run them in order, + * each of them will then edit the data object. + * @method + * @memberof Popper.Utils + * @param {dataObject} data + * @param {Array} modifiers + * @param {String} ends - Optional modifier name used as stopper + * @returns {dataObject} + */ +function runModifiers(modifiers, data, ends) { + var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); + + modifiersToRun.forEach(function (modifier) { + if (modifier['function']) { + // eslint-disable-line dot-notation + console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); + } + var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation + if (modifier.enabled && isFunction(fn)) { + // Add properties to offsets to make them a complete clientRect object + // we do this before each modifier to make sure the previous one doesn't + // mess with these values + data.offsets.popper = getClientRect(data.offsets.popper); + data.offsets.reference = getClientRect(data.offsets.reference); + + data = fn(data, modifier); + } + }); + + return data; +} + +/** + * Updates the position of the popper, computing the new offsets and applying + * the new style.
+ * Prefer `scheduleUpdate` over `update` because of performance reasons. + * @method + * @memberof Popper + */ +function update() { + // if popper is destroyed, don't perform any further update + if (this.state.isDestroyed) { + return; + } + + var data = { + instance: this, + styles: {}, + arrowStyles: {}, + attributes: {}, + flipped: false, + offsets: {} + }; + + // compute reference element offsets + data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); + + // store the computed placement inside `originalPlacement` + data.originalPlacement = data.placement; + + data.positionFixed = this.options.positionFixed; + + // compute the popper offsets + data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); + + data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; + + // run the modifiers + data = runModifiers(this.modifiers, data); + + // the first `update` will call `onCreate` callback + // the other ones will call `onUpdate` callback + if (!this.state.isCreated) { + this.state.isCreated = true; + this.options.onCreate(data); + } else { + this.options.onUpdate(data); + } +} + +/** + * Helper used to know if the given modifier is enabled. + * @method + * @memberof Popper.Utils + * @returns {Boolean} + */ +function isModifierEnabled(modifiers, modifierName) { + return modifiers.some(function (_ref) { + var name = _ref.name, + enabled = _ref.enabled; + return enabled && name === modifierName; + }); +} + +/** + * Get the prefixed supported property name + * @method + * @memberof Popper.Utils + * @argument {String} property (camelCase) + * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) + */ +function getSupportedPropertyName(property) { + var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; + var upperProp = property.charAt(0).toUpperCase() + property.slice(1); + + for (var i = 0; i < prefixes.length; i++) { + var prefix = prefixes[i]; + var toCheck = prefix ? '' + prefix + upperProp : property; + if (typeof document.body.style[toCheck] !== 'undefined') { + return toCheck; + } + } + return null; +} + +/** + * Destroys the popper. + * @method + * @memberof Popper + */ +function destroy() { + this.state.isDestroyed = true; + + // touch DOM only if `applyStyle` modifier is enabled + if (isModifierEnabled(this.modifiers, 'applyStyle')) { + this.popper.removeAttribute('x-placement'); + this.popper.style.position = ''; + this.popper.style.top = ''; + this.popper.style.left = ''; + this.popper.style.right = ''; + this.popper.style.bottom = ''; + this.popper.style.willChange = ''; + this.popper.style[getSupportedPropertyName('transform')] = ''; + } + + this.disableEventListeners(); + + // remove the popper if user explicity asked for the deletion on destroy + // do not use `remove` because IE11 doesn't support it + if (this.options.removeOnDestroy) { + this.popper.parentNode.removeChild(this.popper); + } + return this; +} + +/** + * Get the window associated with the element + * @argument {Element} element + * @returns {Window} + */ +function getWindow(element) { + var ownerDocument = element.ownerDocument; + return ownerDocument ? ownerDocument.defaultView : window; +} + +function attachToScrollParents(scrollParent, event, callback, scrollParents) { + var isBody = scrollParent.nodeName === 'BODY'; + var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; + target.addEventListener(event, callback, { passive: true }); + + if (!isBody) { + attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); + } + scrollParents.push(target); +} + +/** + * Setup needed event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ +function setupEventListeners(reference, options, state, updateBound) { + // Resize event listener on window + state.updateBound = updateBound; + getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); + + // Scroll event listener on scroll parents + var scrollElement = getScrollParent(reference); + attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); + state.scrollElement = scrollElement; + state.eventsEnabled = true; + + return state; +} + +/** + * It will add resize/scroll events and start recalculating + * position of the popper element when they are triggered. + * @method + * @memberof Popper + */ +function enableEventListeners() { + if (!this.state.eventsEnabled) { + this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); + } +} + +/** + * Remove event listeners used to update the popper position + * @method + * @memberof Popper.Utils + * @private + */ +function removeEventListeners(reference, state) { + // Remove resize event listener on window + getWindow(reference).removeEventListener('resize', state.updateBound); + + // Remove scroll event listener on scroll parents + state.scrollParents.forEach(function (target) { + target.removeEventListener('scroll', state.updateBound); + }); + + // Reset state + state.updateBound = null; + state.scrollParents = []; + state.scrollElement = null; + state.eventsEnabled = false; + return state; +} + +/** + * It will remove resize/scroll events and won't recalculate popper position + * when they are triggered. It also won't trigger `onUpdate` callback anymore, + * unless you call `update` method manually. + * @method + * @memberof Popper + */ +function disableEventListeners() { + if (this.state.eventsEnabled) { + cancelAnimationFrame(this.scheduleUpdate); + this.state = removeEventListeners(this.reference, this.state); + } +} + +/** + * Tells if a given input is a number + * @method + * @memberof Popper.Utils + * @param {*} input to check + * @return {Boolean} + */ +function isNumeric(n) { + return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); +} + +/** + * Set the style to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the style to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ +function setStyles(element, styles) { + Object.keys(styles).forEach(function (prop) { + var unit = ''; + // add unit if the value is numeric and is one of the following + if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { + unit = 'px'; + } + element.style[prop] = styles[prop] + unit; + }); +} + +/** + * Set the attributes to the given popper + * @method + * @memberof Popper.Utils + * @argument {Element} element - Element to apply the attributes to + * @argument {Object} styles + * Object with a list of properties and values which will be applied to the element + */ +function setAttributes(element, attributes) { + Object.keys(attributes).forEach(function (prop) { + var value = attributes[prop]; + if (value !== false) { + element.setAttribute(prop, attributes[prop]); + } else { + element.removeAttribute(prop); + } + }); +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} data.styles - List of style properties - values to apply to popper element + * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The same data object + */ +function applyStyle(data) { + // any property present in `data.styles` will be applied to the popper, + // in this way we can make the 3rd party modifiers add custom styles to it + // Be aware, modifiers could override the properties defined in the previous + // lines of this modifier! + setStyles(data.instance.popper, data.styles); + + // any property present in `data.attributes` will be applied to the popper, + // they will be set as HTML attributes of the element + setAttributes(data.instance.popper, data.attributes); + + // if arrowElement is defined and arrowStyles has some properties + if (data.arrowElement && Object.keys(data.arrowStyles).length) { + setStyles(data.arrowElement, data.arrowStyles); + } + + return data; +} + +/** + * Set the x-placement attribute before everything else because it could be used + * to add margins to the popper margins needs to be calculated to get the + * correct popper offsets. + * @method + * @memberof Popper.modifiers + * @param {HTMLElement} reference - The reference element used to position the popper + * @param {HTMLElement} popper - The HTML element used as popper + * @param {Object} options - Popper.js options + */ +function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { + // compute reference element offsets + var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); + + // compute auto placement, store placement inside the data object, + // modifiers will be able to edit `placement` if needed + // and refer to originalPlacement to know the original value + var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); + + popper.setAttribute('x-placement', placement); + + // Apply `position` to popper before anything else because + // without the position applied we can't guarantee correct computations + setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); + + return options; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function computeStyle(data, options) { + var x = options.x, + y = options.y; + var popper = data.offsets.popper; + + // Remove this legacy support in Popper.js v2 + + var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'applyStyle'; + }).gpuAcceleration; + if (legacyGpuAccelerationOption !== undefined) { + console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); + } + var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; + + var offsetParent = getOffsetParent(data.instance.popper); + var offsetParentRect = getBoundingClientRect(offsetParent); + + // Styles + var styles = { + position: popper.position + }; + + // Avoid blurry text by using full pixel integers. + // For pixel-perfect positioning, top/bottom prefers rounded + // values, while left/right prefers floored values. + var offsets = { + left: Math.floor(popper.left), + top: Math.round(popper.top), + bottom: Math.round(popper.bottom), + right: Math.floor(popper.right) + }; + + var sideA = x === 'bottom' ? 'top' : 'bottom'; + var sideB = y === 'right' ? 'left' : 'right'; + + // if gpuAcceleration is set to `true` and transform is supported, + // we use `translate3d` to apply the position to the popper we + // automatically use the supported prefixed version if needed + var prefixedProperty = getSupportedPropertyName('transform'); + + // now, let's make a step back and look at this code closely (wtf?) + // If the content of the popper grows once it's been positioned, it + // may happen that the popper gets misplaced because of the new content + // overflowing its reference element + // To avoid this problem, we provide two options (x and y), which allow + // the consumer to define the offset origin. + // If we position a popper on top of a reference element, we can set + // `x` to `top` to make the popper grow towards its top instead of + // its bottom. + var left = void 0, + top = void 0; + if (sideA === 'bottom') { + // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar) + // and not the bottom of the html element + if (offsetParent.nodeName === 'HTML') { + top = -offsetParent.clientHeight + offsets.bottom; + } else { + top = -offsetParentRect.height + offsets.bottom; + } + } else { + top = offsets.top; + } + if (sideB === 'right') { + if (offsetParent.nodeName === 'HTML') { + left = -offsetParent.clientWidth + offsets.right; + } else { + left = -offsetParentRect.width + offsets.right; + } + } else { + left = offsets.left; + } + if (gpuAcceleration && prefixedProperty) { + styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; + styles[sideA] = 0; + styles[sideB] = 0; + styles.willChange = 'transform'; + } else { + // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties + var invertTop = sideA === 'bottom' ? -1 : 1; + var invertLeft = sideB === 'right' ? -1 : 1; + styles[sideA] = top * invertTop; + styles[sideB] = left * invertLeft; + styles.willChange = sideA + ', ' + sideB; + } + + // Attributes + var attributes = { + 'x-placement': data.placement + }; + + // Update `data` attributes, styles and arrowStyles + data.attributes = _extends({}, attributes, data.attributes); + data.styles = _extends({}, styles, data.styles); + data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); + + return data; +} + +/** + * Helper used to know if the given modifier depends from another one.
+ * It checks if the needed modifier is listed and enabled. + * @method + * @memberof Popper.Utils + * @param {Array} modifiers - list of modifiers + * @param {String} requestingName - name of requesting modifier + * @param {String} requestedName - name of requested modifier + * @returns {Boolean} + */ +function isModifierRequired(modifiers, requestingName, requestedName) { + var requesting = find(modifiers, function (_ref) { + var name = _ref.name; + return name === requestingName; + }); + + var isRequired = !!requesting && modifiers.some(function (modifier) { + return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; + }); + + if (!isRequired) { + var _requesting = '`' + requestingName + '`'; + var requested = '`' + requestedName + '`'; + console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); + } + return isRequired; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function arrow(data, options) { + var _data$offsets$arrow; + + // arrow depends on keepTogether in order to work + if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { + return data; + } + + var arrowElement = options.element; + + // if arrowElement is a string, suppose it's a CSS selector + if (typeof arrowElement === 'string') { + arrowElement = data.instance.popper.querySelector(arrowElement); + + // if arrowElement is not found, don't run the modifier + if (!arrowElement) { + return data; + } + } else { + // if the arrowElement isn't a query selector we must check that the + // provided DOM node is child of its popper node + if (!data.instance.popper.contains(arrowElement)) { + console.warn('WARNING: `arrow.element` must be child of its popper element!'); + return data; + } + } + + var placement = data.placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isVertical = ['left', 'right'].indexOf(placement) !== -1; + + var len = isVertical ? 'height' : 'width'; + var sideCapitalized = isVertical ? 'Top' : 'Left'; + var side = sideCapitalized.toLowerCase(); + var altSide = isVertical ? 'left' : 'top'; + var opSide = isVertical ? 'bottom' : 'right'; + var arrowElementSize = getOuterSizes(arrowElement)[len]; + + // + // extends keepTogether behavior making sure the popper and its + // reference have enough pixels in conjunction + // + + // top/left side + if (reference[opSide] - arrowElementSize < popper[side]) { + data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); + } + // bottom/right side + if (reference[side] + arrowElementSize > popper[opSide]) { + data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; + } + data.offsets.popper = getClientRect(data.offsets.popper); + + // compute center of the popper + var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; + + // Compute the sideValue using the updated popper offsets + // take popper margin in account because we don't have this info available + var css = getStyleComputedProperty(data.instance.popper); + var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); + var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); + var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; + + // prevent arrowElement from being placed not contiguously to its popper + sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); + + data.arrowElement = arrowElement; + data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); + + return data; +} + +/** + * Get the opposite placement variation of the given one + * @method + * @memberof Popper.Utils + * @argument {String} placement variation + * @returns {String} flipped placement variation + */ +function getOppositeVariation(variation) { + if (variation === 'end') { + return 'start'; + } else if (variation === 'start') { + return 'end'; + } + return variation; +} + +/** + * List of accepted placements to use as values of the `placement` option.
+ * Valid placements are: + * - `auto` + * - `top` + * - `right` + * - `bottom` + * - `left` + * + * Each placement can have a variation from this list: + * - `-start` + * - `-end` + * + * Variations are interpreted easily if you think of them as the left to right + * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` + * is right.
+ * Vertically (`left` and `right`), `start` is top and `end` is bottom. + * + * Some valid examples are: + * - `top-end` (on top of reference, right aligned) + * - `right-start` (on right of reference, top aligned) + * - `bottom` (on bottom, centered) + * - `auto-end` (on the side with more space available, alignment depends by placement) + * + * @static + * @type {Array} + * @enum {String} + * @readonly + * @method placements + * @memberof Popper + */ +var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; + +// Get rid of `auto` `auto-start` and `auto-end` +var validPlacements = placements.slice(3); + +/** + * Given an initial placement, returns all the subsequent placements + * clockwise (or counter-clockwise). + * + * @method + * @memberof Popper.Utils + * @argument {String} placement - A valid placement (it accepts variations) + * @argument {Boolean} counter - Set to true to walk the placements counterclockwise + * @returns {Array} placements including their variations + */ +function clockwise(placement) { + var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var index = validPlacements.indexOf(placement); + var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); + return counter ? arr.reverse() : arr; +} + +var BEHAVIORS = { + FLIP: 'flip', + CLOCKWISE: 'clockwise', + COUNTERCLOCKWISE: 'counterclockwise' +}; + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function flip(data, options) { + // if `inner` modifier is enabled, we can't use the `flip` modifier + if (isModifierEnabled(data.instance.modifiers, 'inner')) { + return data; + } + + if (data.flipped && data.placement === data.originalPlacement) { + // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides + return data; + } + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); + + var placement = data.placement.split('-')[0]; + var placementOpposite = getOppositePlacement(placement); + var variation = data.placement.split('-')[1] || ''; + + var flipOrder = []; + + switch (options.behavior) { + case BEHAVIORS.FLIP: + flipOrder = [placement, placementOpposite]; + break; + case BEHAVIORS.CLOCKWISE: + flipOrder = clockwise(placement); + break; + case BEHAVIORS.COUNTERCLOCKWISE: + flipOrder = clockwise(placement, true); + break; + default: + flipOrder = options.behavior; + } + + flipOrder.forEach(function (step, index) { + if (placement !== step || flipOrder.length === index + 1) { + return data; + } + + placement = data.placement.split('-')[0]; + placementOpposite = getOppositePlacement(placement); + + var popperOffsets = data.offsets.popper; + var refOffsets = data.offsets.reference; + + // using floor because the reference offsets may contain decimals we are not going to consider here + var floor = Math.floor; + var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); + + var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); + var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); + var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); + var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); + + var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; + + // flip the variation if required + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); + + if (overlapsRef || overflowsBoundaries || flippedVariation) { + // this boolean to detect any flip loop + data.flipped = true; + + if (overlapsRef || overflowsBoundaries) { + placement = flipOrder[index + 1]; + } + + if (flippedVariation) { + variation = getOppositeVariation(variation); + } + + data.placement = placement + (variation ? '-' + variation : ''); + + // this object contains `position`, we want to preserve it along with + // any additional property we may add in the future + data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); + + data = runModifiers(data.instance.modifiers, data, 'flip'); + } + }); + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function keepTogether(data) { + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var placement = data.placement.split('-')[0]; + var floor = Math.floor; + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var side = isVertical ? 'right' : 'bottom'; + var opSide = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + if (popper[side] < floor(reference[opSide])) { + data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; + } + if (popper[opSide] > floor(reference[side])) { + data.offsets.popper[opSide] = floor(reference[side]); + } + + return data; +} + +/** + * Converts a string containing value + unit into a px value number + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} str - Value + unit string + * @argument {String} measurement - `height` or `width` + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @returns {Number|String} + * Value in pixels, or original string if no values were extracted + */ +function toValue(str, measurement, popperOffsets, referenceOffsets) { + // separate value from unit + var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); + var value = +split[1]; + var unit = split[2]; + + // If it's not a number it's an operator, I guess + if (!value) { + return str; + } + + if (unit.indexOf('%') === 0) { + var element = void 0; + switch (unit) { + case '%p': + element = popperOffsets; + break; + case '%': + case '%r': + default: + element = referenceOffsets; + } + + var rect = getClientRect(element); + return rect[measurement] / 100 * value; + } else if (unit === 'vh' || unit === 'vw') { + // if is a vh or vw, we calculate the size based on the viewport + var size = void 0; + if (unit === 'vh') { + size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); + } else { + size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); + } + return size / 100 * value; + } else { + // if is an explicit pixel unit, we get rid of the unit and keep the value + // if is an implicit unit, it's px, and we return just the value + return value; + } +} + +/** + * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. + * @function + * @memberof {modifiers~offset} + * @private + * @argument {String} offset + * @argument {Object} popperOffsets + * @argument {Object} referenceOffsets + * @argument {String} basePlacement + * @returns {Array} a two cells array with x and y offsets in numbers + */ +function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { + var offsets = [0, 0]; + + // Use height if placement is left or right and index is 0 otherwise use width + // in this way the first offset will use an axis and the second one + // will use the other one + var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; + + // Split the offset string to obtain a list of values and operands + // The regex addresses values with the plus or minus sign in front (+10, -20, etc) + var fragments = offset.split(/(\+|\-)/).map(function (frag) { + return frag.trim(); + }); + + // Detect if the offset string contains a pair of values or a single one + // they could be separated by comma or space + var divider = fragments.indexOf(find(fragments, function (frag) { + return frag.search(/,|\s/) !== -1; + })); + + if (fragments[divider] && fragments[divider].indexOf(',') === -1) { + console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); + } + + // If divider is found, we divide the list of values and operands to divide + // them by ofset X and Y. + var splitRegex = /\s*,\s*|\s+/; + var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; + + // Convert the values with units to absolute pixels to allow our computations + ops = ops.map(function (op, index) { + // Most of the units rely on the orientation of the popper + var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; + var mergeWithPrevious = false; + return op + // This aggregates any `+` or `-` sign that aren't considered operators + // e.g.: 10 + +5 => [10, +, +5] + .reduce(function (a, b) { + if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { + a[a.length - 1] = b; + mergeWithPrevious = true; + return a; + } else if (mergeWithPrevious) { + a[a.length - 1] += b; + mergeWithPrevious = false; + return a; + } else { + return a.concat(b); + } + }, []) + // Here we convert the string values into number values (in px) + .map(function (str) { + return toValue(str, measurement, popperOffsets, referenceOffsets); + }); + }); + + // Loop trough the offsets arrays and execute the operations + ops.forEach(function (op, index) { + op.forEach(function (frag, index2) { + if (isNumeric(frag)) { + offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); + } + }); + }); + return offsets; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @argument {Number|String} options.offset=0 + * The offset value as described in the modifier description + * @returns {Object} The data object, properly modified + */ +function offset(data, _ref) { + var offset = _ref.offset; + var placement = data.placement, + _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var basePlacement = placement.split('-')[0]; + + var offsets = void 0; + if (isNumeric(+offset)) { + offsets = [+offset, 0]; + } else { + offsets = parseOffset(offset, popper, reference, basePlacement); + } + + if (basePlacement === 'left') { + popper.top += offsets[0]; + popper.left -= offsets[1]; + } else if (basePlacement === 'right') { + popper.top += offsets[0]; + popper.left += offsets[1]; + } else if (basePlacement === 'top') { + popper.left += offsets[0]; + popper.top -= offsets[1]; + } else if (basePlacement === 'bottom') { + popper.left += offsets[0]; + popper.top += offsets[1]; + } + + data.popper = popper; + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function preventOverflow(data, options) { + var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); + + // If offsetParent is the reference element, we really want to + // go one step up and use the next offsetParent as reference to + // avoid to make this modifier completely useless and look like broken + if (data.instance.reference === boundariesElement) { + boundariesElement = getOffsetParent(boundariesElement); + } + + // NOTE: DOM access here + // resets the popper's position so that the document size can be calculated excluding + // the size of the popper element itself + var transformProp = getSupportedPropertyName('transform'); + var popperStyles = data.instance.popper.style; // assignment to help minification + var top = popperStyles.top, + left = popperStyles.left, + transform = popperStyles[transformProp]; + + popperStyles.top = ''; + popperStyles.left = ''; + popperStyles[transformProp] = ''; + + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); + + // NOTE: DOM access here + // restores the original style properties after the offsets have been computed + popperStyles.top = top; + popperStyles.left = left; + popperStyles[transformProp] = transform; + + options.boundaries = boundaries; + + var order = options.priority; + var popper = data.offsets.popper; + + var check = { + primary: function primary(placement) { + var value = popper[placement]; + if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { + value = Math.max(popper[placement], boundaries[placement]); + } + return defineProperty({}, placement, value); + }, + secondary: function secondary(placement) { + var mainSide = placement === 'right' ? 'left' : 'top'; + var value = popper[mainSide]; + if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { + value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); + } + return defineProperty({}, mainSide, value); + } + }; + + order.forEach(function (placement) { + var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; + popper = _extends({}, popper, check[side](placement)); + }); + + data.offsets.popper = popper; + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function shift(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var shiftvariation = placement.split('-')[1]; + + // if shift shiftvariation is specified, run the modifier + if (shiftvariation) { + var _data$offsets = data.offsets, + reference = _data$offsets.reference, + popper = _data$offsets.popper; + + var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; + var side = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + var shiftOffsets = { + start: defineProperty({}, side, reference[side]), + end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) + }; + + data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); + } + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by update method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function hide(data) { + if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { + return data; + } + + var refRect = data.offsets.reference; + var bound = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'preventOverflow'; + }).boundaries; + + if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === true) { + return data; + } + + data.hide = true; + data.attributes['x-out-of-boundaries'] = ''; + } else { + // Avoid unnecessary DOM access if visibility hasn't changed + if (data.hide === false) { + return data; + } + + data.hide = false; + data.attributes['x-out-of-boundaries'] = false; + } + + return data; +} + +/** + * @function + * @memberof Modifiers + * @argument {Object} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {Object} The data object, properly modified + */ +function inner(data) { + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; + + var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; + + popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); + + data.placement = getOppositePlacement(placement); + data.offsets.popper = getClientRect(popper); + + return data; +} + +/** + * Modifier function, each modifier can have a function of this type assigned + * to its `fn` property.
+ * These functions will be called on each update, this means that you must + * make sure they are performant enough to avoid performance bottlenecks. + * + * @function ModifierFn + * @argument {dataObject} data - The data object generated by `update` method + * @argument {Object} options - Modifiers configuration and options + * @returns {dataObject} The data object, properly modified + */ + +/** + * Modifiers are plugins used to alter the behavior of your poppers.
+ * Popper.js uses a set of 9 modifiers to provide all the basic functionalities + * needed by the library. + * + * Usually you don't want to override the `order`, `fn` and `onLoad` props. + * All the other properties are configurations that could be tweaked. + * @namespace modifiers + */ +var modifiers = { + /** + * Modifier used to shift the popper on the start or end of its reference + * element.
+ * It will read the variation of the `placement` property.
+ * It can be one either `-end` or `-start`. + * @memberof modifiers + * @inner + */ + shift: { + /** @prop {number} order=100 - Index used to define the order of execution */ + order: 100, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: shift + }, + + /** + * The `offset` modifier can shift your popper on both its axis. + * + * It accepts the following units: + * - `px` or unit-less, interpreted as pixels + * - `%` or `%r`, percentage relative to the length of the reference element + * - `%p`, percentage relative to the length of the popper element + * - `vw`, CSS viewport width unit + * - `vh`, CSS viewport height unit + * + * For length is intended the main axis relative to the placement of the popper.
+ * This means that if the placement is `top` or `bottom`, the length will be the + * `width`. In case of `left` or `right`, it will be the `height`. + * + * You can provide a single value (as `Number` or `String`), or a pair of values + * as `String` divided by a comma or one (or more) white spaces.
+ * The latter is a deprecated method because it leads to confusion and will be + * removed in v2.
+ * Additionally, it accepts additions and subtractions between different units. + * Note that multiplications and divisions aren't supported. + * + * Valid examples are: + * ``` + * 10 + * '10%' + * '10, 10' + * '10%, 10' + * '10 + 10%' + * '10 - 5vh + 3%' + * '-10px + 5vh, 5px - 6%' + * ``` + * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap + * > with their reference element, unfortunately, you will have to disable the `flip` modifier. + * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). + * + * @memberof modifiers + * @inner + */ + offset: { + /** @prop {number} order=200 - Index used to define the order of execution */ + order: 200, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: offset, + /** @prop {Number|String} offset=0 + * The offset value as described in the modifier description + */ + offset: 0 + }, + + /** + * Modifier used to prevent the popper from being positioned outside the boundary. + * + * A scenario exists where the reference itself is not within the boundaries.
+ * We can say it has "escaped the boundaries" — or just "escaped".
+ * In this case we need to decide whether the popper should either: + * + * - detach from the reference and remain "trapped" in the boundaries, or + * - if it should ignore the boundary and "escape with its reference" + * + * When `escapeWithReference` is set to`true` and reference is completely + * outside its boundaries, the popper will overflow (or completely leave) + * the boundaries in order to remain attached to the edge of the reference. + * + * @memberof modifiers + * @inner + */ + preventOverflow: { + /** @prop {number} order=300 - Index used to define the order of execution */ + order: 300, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: preventOverflow, + /** + * @prop {Array} [priority=['left','right','top','bottom']] + * Popper will try to prevent overflow following these priorities by default, + * then, it could overflow on the left and on top of the `boundariesElement` + */ + priority: ['left', 'right', 'top', 'bottom'], + /** + * @prop {number} padding=5 + * Amount of pixel used to define a minimum distance between the boundaries + * and the popper. This makes sure the popper always has a little padding + * between the edges of its container + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='scrollParent' + * Boundaries used by the modifier. Can be `scrollParent`, `window`, + * `viewport` or any DOM element. + */ + boundariesElement: 'scrollParent' + }, + + /** + * Modifier used to make sure the reference and its popper stay near each other + * without leaving any gap between the two. Especially useful when the arrow is + * enabled and you want to ensure that it points to its reference element. + * It cares only about the first axis. You can still have poppers with margin + * between the popper and its reference element. + * @memberof modifiers + * @inner + */ + keepTogether: { + /** @prop {number} order=400 - Index used to define the order of execution */ + order: 400, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: keepTogether + }, + + /** + * This modifier is used to move the `arrowElement` of the popper to make + * sure it is positioned between the reference element and its popper element. + * It will read the outer size of the `arrowElement` node to detect how many + * pixels of conjunction are needed. + * + * It has no effect if no `arrowElement` is provided. + * @memberof modifiers + * @inner + */ + arrow: { + /** @prop {number} order=500 - Index used to define the order of execution */ + order: 500, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: arrow, + /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ + element: '[x-arrow]' + }, + + /** + * Modifier used to flip the popper's placement when it starts to overlap its + * reference element. + * + * Requires the `preventOverflow` modifier before it in order to work. + * + * **NOTE:** this modifier will interrupt the current update cycle and will + * restart it if it detects the need to flip the placement. + * @memberof modifiers + * @inner + */ + flip: { + /** @prop {number} order=600 - Index used to define the order of execution */ + order: 600, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: flip, + /** + * @prop {String|Array} behavior='flip' + * The behavior used to change the popper's placement. It can be one of + * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid + * placements (with optional variations) + */ + behavior: 'flip', + /** + * @prop {number} padding=5 + * The popper will flip if it hits the edges of the `boundariesElement` + */ + padding: 5, + /** + * @prop {String|HTMLElement} boundariesElement='viewport' + * The element which will define the boundaries of the popper position. + * The popper will never be placed outside of the defined boundaries + * (except if `keepTogether` is enabled) + */ + boundariesElement: 'viewport' + }, + + /** + * Modifier used to make the popper flow toward the inner of the reference element. + * By default, when this modifier is disabled, the popper will be placed outside + * the reference element. + * @memberof modifiers + * @inner + */ + inner: { + /** @prop {number} order=700 - Index used to define the order of execution */ + order: 700, + /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ + enabled: false, + /** @prop {ModifierFn} */ + fn: inner + }, + + /** + * Modifier used to hide the popper when its reference element is outside of the + * popper boundaries. It will set a `x-out-of-boundaries` attribute which can + * be used to hide with a CSS selector the popper when its reference is + * out of boundaries. + * + * Requires the `preventOverflow` modifier before it in order to work. + * @memberof modifiers + * @inner + */ + hide: { + /** @prop {number} order=800 - Index used to define the order of execution */ + order: 800, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: hide + }, + + /** + * Computes the style that will be applied to the popper element to gets + * properly positioned. + * + * Note that this modifier will not touch the DOM, it just prepares the styles + * so that `applyStyle` modifier can apply it. This separation is useful + * in case you need to replace `applyStyle` with a custom implementation. + * + * This modifier has `850` as `order` value to maintain backward compatibility + * with previous versions of Popper.js. Expect the modifiers ordering method + * to change in future major versions of the library. + * + * @memberof modifiers + * @inner + */ + computeStyle: { + /** @prop {number} order=850 - Index used to define the order of execution */ + order: 850, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: computeStyle, + /** + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3D transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties + */ + gpuAcceleration: true, + /** + * @prop {string} [x='bottom'] + * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. + * Change this if your popper should grow in a direction different from `bottom` + */ + x: 'bottom', + /** + * @prop {string} [x='left'] + * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. + * Change this if your popper should grow in a direction different from `right` + */ + y: 'right' + }, + + /** + * Applies the computed styles to the popper element. + * + * All the DOM manipulations are limited to this modifier. This is useful in case + * you want to integrate Popper.js inside a framework or view library and you + * want to delegate all the DOM manipulations to it. + * + * Note that if you disable this modifier, you must make sure the popper element + * has its position set to `absolute` before Popper.js can do its work! + * + * Just disable this modifier and define your own to achieve the desired effect. + * + * @memberof modifiers + * @inner + */ + applyStyle: { + /** @prop {number} order=900 - Index used to define the order of execution */ + order: 900, + /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ + enabled: true, + /** @prop {ModifierFn} */ + fn: applyStyle, + /** @prop {Function} */ + onLoad: applyStyleOnLoad, + /** + * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier + * @prop {Boolean} gpuAcceleration=true + * If true, it uses the CSS 3D transformation to position the popper. + * Otherwise, it will use the `top` and `left` properties + */ + gpuAcceleration: undefined + } +}; + +/** + * The `dataObject` is an object containing all the information used by Popper.js. + * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. + * @name dataObject + * @property {Object} data.instance The Popper.js instance + * @property {String} data.placement Placement applied to popper + * @property {String} data.originalPlacement Placement originally defined on init + * @property {Boolean} data.flipped True if popper has been flipped by flip modifier + * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper + * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier + * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) + * @property {Object} data.boundaries Offsets of the popper boundaries + * @property {Object} data.offsets The measurements of popper, reference and arrow elements + * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values + * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 + */ + +/** + * Default options provided to Popper.js constructor.
+ * These can be overridden using the `options` argument of Popper.js.
+ * To override an option, simply pass an object with the same + * structure of the `options` object, as the 3rd argument. For example: + * ``` + * new Popper(ref, pop, { + * modifiers: { + * preventOverflow: { enabled: false } + * } + * }) + * ``` + * @type {Object} + * @static + * @memberof Popper + */ +var Defaults = { + /** + * Popper's placement. + * @prop {Popper.placements} placement='bottom' + */ + placement: 'bottom', + + /** + * Set this to true if you want popper to position it self in 'fixed' mode + * @prop {Boolean} positionFixed=false + */ + positionFixed: false, + + /** + * Whether events (resize, scroll) are initially enabled. + * @prop {Boolean} eventsEnabled=true + */ + eventsEnabled: true, + + /** + * Set to true if you want to automatically remove the popper when + * you call the `destroy` method. + * @prop {Boolean} removeOnDestroy=false + */ + removeOnDestroy: false, + + /** + * Callback called when the popper is created.
+ * By default, it is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onCreate} + */ + onCreate: function onCreate() {}, + + /** + * Callback called when the popper is updated. This callback is not called + * on the initialization/creation of the popper, but only on subsequent + * updates.
+ * By default, it is set to no-op.
+ * Access Popper.js instance with `data.instance`. + * @prop {onUpdate} + */ + onUpdate: function onUpdate() {}, + + /** + * List of modifiers used to modify the offsets before they are applied to the popper. + * They provide most of the functionalities of Popper.js. + * @prop {modifiers} + */ + modifiers: modifiers +}; + +/** + * @callback onCreate + * @param {dataObject} data + */ + +/** + * @callback onUpdate + * @param {dataObject} data + */ + +// Utils +// Methods +var Popper = function () { + /** + * Creates a new Popper.js instance. + * @class Popper + * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper + * @param {HTMLElement} popper - The HTML element used as the popper + * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) + * @return {Object} instance - The generated Popper.js instance + */ + function Popper(reference, popper) { + var _this = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + classCallCheck(this, Popper); + + this.scheduleUpdate = function () { + return requestAnimationFrame(_this.update); + }; + + // make update() debounced, so that it only runs at most once-per-tick + this.update = debounce(this.update.bind(this)); + + // with {} we create a new object with the options inside it + this.options = _extends({}, Popper.Defaults, options); + + // init state + this.state = { + isDestroyed: false, + isCreated: false, + scrollParents: [] + }; + + // get reference and popper elements (allow jQuery wrappers) + this.reference = reference && reference.jquery ? reference[0] : reference; + this.popper = popper && popper.jquery ? popper[0] : popper; + + // Deep merge modifiers options + this.options.modifiers = {}; + Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { + _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); + }); + + // Refactoring modifiers' list (Object => Array) + this.modifiers = Object.keys(this.options.modifiers).map(function (name) { + return _extends({ + name: name + }, _this.options.modifiers[name]); + }) + // sort the modifiers by order + .sort(function (a, b) { + return a.order - b.order; + }); + + // modifiers have the ability to execute arbitrary code when Popper.js get inited + // such code is executed in the same order of its modifier + // they could add new properties to their options configuration + // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! + this.modifiers.forEach(function (modifierOptions) { + if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { + modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); + } + }); + + // fire the first update to position the popper in the right place + this.update(); + + var eventsEnabled = this.options.eventsEnabled; + if (eventsEnabled) { + // setup event listeners, they will take care of update the position in specific situations + this.enableEventListeners(); + } + + this.state.eventsEnabled = eventsEnabled; + } + + // We can't use class properties because they don't get listed in the + // class prototype and break stuff like Sinon stubs + + + createClass(Popper, [{ + key: 'update', + value: function update$$1() { + return update.call(this); + } + }, { + key: 'destroy', + value: function destroy$$1() { + return destroy.call(this); + } + }, { + key: 'enableEventListeners', + value: function enableEventListeners$$1() { + return enableEventListeners.call(this); + } + }, { + key: 'disableEventListeners', + value: function disableEventListeners$$1() { + return disableEventListeners.call(this); + } + + /** + * Schedules an update. It will run on the next UI update available. + * @method scheduleUpdate + * @memberof Popper + */ + + + /** + * Collection of utilities useful when writing custom modifiers. + * Starting from version 1.7, this method is available only if you + * include `popper-utils.js` before `popper.js`. + * + * **DEPRECATION**: This way to access PopperUtils is deprecated + * and will be removed in v2! Use the PopperUtils module directly instead. + * Due to the high instability of the methods contained in Utils, we can't + * guarantee them to follow semver. Use them at your own risk! + * @static + * @private + * @type {Object} + * @deprecated since version 1.8 + * @member Utils + * @memberof Popper + */ + + }]); + return Popper; +}(); + +/** + * The `referenceObject` is an object that provides an interface compatible with Popper.js + * and lets you use it as replacement of a real DOM node.
+ * You can use this method to position a popper relatively to a set of coordinates + * in case you don't have a DOM node to use as reference. + * + * ``` + * new Popper(referenceObject, popperNode); + * ``` + * + * NB: This feature isn't supported in Internet Explorer 10. + * @name referenceObject + * @property {Function} data.getBoundingClientRect + * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. + * @property {number} data.clientWidth + * An ES6 getter that will return the width of the virtual reference element. + * @property {number} data.clientHeight + * An ES6 getter that will return the height of the virtual reference element. + */ + + +Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; +Popper.placements = placements; +Popper.Defaults = Defaults; + +/* harmony default export */ __webpack_exports__["default"] = (Popper); +//# sourceMappingURL=popper.js.map + +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(16))) + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var printWarning = function() {}; + +if (true) { + var ReactPropTypesSecret = __webpack_require__(15); + var loggedTypeFailures = {}; + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ) + + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +module.exports = checkPropTypes; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var assign = __webpack_require__(51); + +var ReactPropTypesSecret = __webpack_require__(15); +var checkPropTypes = __webpack_require__(53); + +var printWarning = function() {}; + +if (true) { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if ("development" !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + true ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _react = __webpack_require__(0); + +var _propTypes = __webpack_require__(9); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +var Arrow = function Arrow(props, context) { + var _props$component = props.component, + component = _props$component === undefined ? 'span' : _props$component, + innerRef = props.innerRef, + children = props.children, + restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']); + + var popper = context.popper; + + var arrowRef = function arrowRef(node) { + popper.setArrowNode(node); + if (typeof innerRef === 'function') { + innerRef(node); + } + }; + var arrowStyle = popper.getArrowStyle(); + + if (typeof children === 'function') { + var arrowProps = { + ref: arrowRef, + style: arrowStyle + }; + return children({ arrowProps: arrowProps, restProps: restProps }); + } + + var componentProps = _extends({}, restProps, { + style: _extends({}, arrowStyle, restProps.style) + }); + + if (typeof component === 'string') { + componentProps.ref = arrowRef; + } else { + componentProps.innerRef = arrowRef; + } + + return (0, _react.createElement)(component, componentProps, children); +}; + +Arrow.contextTypes = { + popper: _propTypes2.default.object.isRequired +}; + +Arrow.propTypes = { + component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + innerRef: _propTypes2.default.func, + children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; + +exports.default = Arrow; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _propTypes = __webpack_require__(9); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Manager = function (_Component) { + _inherits(Manager, _Component); + + function Manager() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Manager); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Manager.__proto__ || Object.getPrototypeOf(Manager)).call.apply(_ref, [this].concat(args))), _this), _this._setTargetNode = function (node) { + _this._targetNode = node; + }, _this._getTargetNode = function () { + return _this._targetNode; + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Manager, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + popperManager: { + setTargetNode: this._setTargetNode, + getTargetNode: this._getTargetNode + } + }; + } + }, { + key: 'render', + value: function render() { + var _props = this.props, + tag = _props.tag, + children = _props.children, + restProps = _objectWithoutProperties(_props, ['tag', 'children']); + + if (tag !== false) { + return (0, _react.createElement)(tag, restProps, children); + } else { + return children; + } + } + }]); + + return Manager; +}(_react.Component); + +Manager.childContextTypes = { + popperManager: _propTypes2.default.object.isRequired +}; +Manager.propTypes = { + tag: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool]), + children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; +Manager.defaultProps = { + tag: 'div' +}; +exports.default = Manager; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _propTypes = __webpack_require__(9); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _popper = __webpack_require__(52); + +var _popper2 = _interopRequireDefault(_popper); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Popper = function (_Component) { + _inherits(Popper, _Component); + + function Popper() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Popper); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Popper.__proto__ || Object.getPrototypeOf(Popper)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this._setArrowNode = function (node) { + _this._arrowNode = node; + }, _this._getTargetNode = function () { + return _this.context.popperManager.getTargetNode(); + }, _this._getOffsets = function (data) { + return Object.keys(data.offsets).map(function (key) { + return data.offsets[key]; + }); + }, _this._isDataDirty = function (data) { + if (_this.state.data) { + return JSON.stringify(_this._getOffsets(_this.state.data)) !== JSON.stringify(_this._getOffsets(data)); + } else { + return true; + } + }, _this._updateStateModifier = { + enabled: true, + order: 900, + fn: function fn(data) { + if (_this._isDataDirty(data)) { + _this.setState({ data: data }); + } + return data; + } + }, _this._getPopperStyle = function () { + var data = _this.state.data; + + + if (!_this._popper || !data) { + return { + position: 'absolute', + pointerEvents: 'none', + opacity: 0 + }; + } + + return _extends({ + position: data.offsets.popper.position + }, data.styles); + }, _this._getPopperPlacement = function () { + return _this.state.data ? _this.state.data.placement : undefined; + }, _this._getPopperHide = function () { + return !!_this.state.data && _this.state.data.hide ? '' : undefined; + }, _this._getArrowStyle = function () { + if (!_this.state.data || !_this.state.data.offsets.arrow) { + return {}; + } else { + var _this$state$data$offs = _this.state.data.offsets.arrow, + top = _this$state$data$offs.top, + left = _this$state$data$offs.left; + + return { top: top, left: left }; + } + }, _this._handlePopperRef = function (node) { + _this._popperNode = node; + if (node) { + _this._createPopper(); + } else { + _this._destroyPopper(); + } + if (_this.props.innerRef) { + _this.props.innerRef(node); + } + }, _this._scheduleUpdate = function () { + _this._popper && _this._popper.scheduleUpdate(); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Popper, [{ + key: 'getChildContext', + value: function getChildContext() { + return { + popper: { + setArrowNode: this._setArrowNode, + getArrowStyle: this._getArrowStyle + } + }; + } + }, { + key: 'componentDidUpdate', + value: function componentDidUpdate(lastProps) { + if (lastProps.placement !== this.props.placement || lastProps.eventsEnabled !== this.props.eventsEnabled) { + this._destroyPopper(); + this._createPopper(); + } + if (lastProps.children !== this.props.children) { + this._scheduleUpdate(); + } + } + }, { + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this._destroyPopper(); + } + }, { + key: '_createPopper', + value: function _createPopper() { + var _this2 = this; + + var _props = this.props, + placement = _props.placement, + eventsEnabled = _props.eventsEnabled; + + var modifiers = _extends({}, this.props.modifiers, { + applyStyle: { enabled: false }, + updateState: this._updateStateModifier + }); + if (this._arrowNode) { + modifiers.arrow = { + element: this._arrowNode + }; + } + this._popper = new _popper2.default(this._getTargetNode(), this._popperNode, { + placement: placement, + eventsEnabled: eventsEnabled, + modifiers: modifiers + }); + + // TODO: look into setTimeout scheduleUpdate call, without it, the popper will not position properly on creation + setTimeout(function () { + return _this2._scheduleUpdate(); + }); + } + }, { + key: '_destroyPopper', + value: function _destroyPopper() { + if (this._popper) { + this._popper.destroy(); + } + } + }, { + key: 'render', + value: function render() { + var _props2 = this.props, + component = _props2.component, + innerRef = _props2.innerRef, + placement = _props2.placement, + eventsEnabled = _props2.eventsEnabled, + modifiers = _props2.modifiers, + children = _props2.children, + restProps = _objectWithoutProperties(_props2, ['component', 'innerRef', 'placement', 'eventsEnabled', 'modifiers', 'children']); + + var popperStyle = this._getPopperStyle(); + var popperPlacement = this._getPopperPlacement(); + var popperHide = this._getPopperHide(); + + if (typeof children === 'function') { + var popperProps = { + ref: this._handlePopperRef, + style: popperStyle, + 'data-placement': popperPlacement, + 'data-x-out-of-boundaries': popperHide + }; + return children({ + popperProps: popperProps, + restProps: restProps, + scheduleUpdate: this._scheduleUpdate + }); + } + + var componentProps = _extends({}, restProps, { + style: _extends({}, restProps.style, popperStyle), + 'data-placement': popperPlacement, + 'data-x-out-of-boundaries': popperHide + }); + + if (typeof component === 'string') { + componentProps.ref = this._handlePopperRef; + } else { + componentProps.innerRef = this._handlePopperRef; + } + + return (0, _react.createElement)(component, componentProps, children); + } + }]); + + return Popper; +}(_react.Component); + +Popper.contextTypes = { + popperManager: _propTypes2.default.object.isRequired +}; +Popper.childContextTypes = { + popper: _propTypes2.default.object.isRequired +}; +Popper.propTypes = { + component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + innerRef: _propTypes2.default.func, + placement: _propTypes2.default.oneOf(_popper2.default.placements), + eventsEnabled: _propTypes2.default.bool, + modifiers: _propTypes2.default.object, + children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; +Popper.defaultProps = { + component: 'div', + placement: 'bottom', + eventsEnabled: true, + modifiers: {} +}; +exports.default = Popper; + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _react = __webpack_require__(0); + +var _propTypes = __webpack_require__(9); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +var Target = function Target(props, context) { + var _props$component = props.component, + component = _props$component === undefined ? 'div' : _props$component, + innerRef = props.innerRef, + children = props.children, + restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']); + + var popperManager = context.popperManager; + + var targetRef = function targetRef(node) { + popperManager.setTargetNode(node); + if (typeof innerRef === 'function') { + innerRef(node); + } + }; + + if (typeof children === 'function') { + var targetProps = { ref: targetRef }; + return children({ targetProps: targetProps, restProps: restProps }); + } + + var componentProps = _extends({}, restProps); + + if (typeof component === 'string') { + componentProps.ref = targetRef; + } else { + componentProps.innerRef = targetRef; + } + + return (0, _react.createElement)(component, componentProps, children); +}; + +Target.contextTypes = { + popperManager: _propTypes2.default.object.isRequired +}; + +Target.propTypes = { + component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), + innerRef: _propTypes2.default.func, + children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) +}; + +exports.default = Target; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Arrow = exports.Popper = exports.Target = exports.Manager = undefined; + +var _Manager2 = __webpack_require__(56); + +var _Manager3 = _interopRequireDefault(_Manager2); + +var _Target2 = __webpack_require__(58); + +var _Target3 = _interopRequireDefault(_Target2); + +var _Popper2 = __webpack_require__(57); + +var _Popper3 = _interopRequireDefault(_Popper2); + +var _Arrow2 = __webpack_require__(55); + +var _Arrow3 = _interopRequireDefault(_Arrow2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.Manager = _Manager3.default; +exports.Target = _Target3.default; +exports.Popper = _Popper3.default; +exports.Arrow = _Arrow3.default; + +/***/ }), +/* 60 */ +/***/ (function(module, exports) { + +module.exports = Backend; + +/***/ }), +/* 61 */ +/***/ (function(module, exports) { + +module.exports = FormBuilderLoader; + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +module.exports = TabsActions; + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +module.exports = jQuery; + +/***/ }) +/******/ ]); +//# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index 1185175d5..a3d4f4416 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1,2 @@ -.elemental-edit{display:-webkit-box;display:-webkit-flex;display:flex;color:inherit}.elemental-edit:focus,.elemental-edit:hover{text-decoration:none;color:inherit}.elemental-editor .col-EditorPreview{padding-left:0}.elemental-preview__detail{display:inline-block;margin-left:.76925rem;margin-top:1px}.elemental-preview__detail h3{font-weight:400;line-height:26px;margin:0;-webkit-font-smoothing:antialiased}.elemental-preview__detail p{-webkit-box-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;margin-bottom:0;margin-top:6px}.elemental-preview__detail small{color:#566b8d;font-size:13px}.elemental-preview__thumbnail-image{margin-right:.76925rem}.elemental-preview__thumbnail-image img{border-radius:.192rem}.elemental-preview__thumbnail-image--placeholder{border-radius:0;height:36px;margin-left:-4px}.elemental-preview__icon{color:#566b8d;display:inline-block;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;font-size:2.3rem;width:28px;vertical-align:top;margin-top:-1px}.ss-gridfield-orderable.elemental-editor .col-reorder .handle{opacity:.5;padding:22px 0 0}.ss-gridfield-orderable.elemental-editor .col-reorder .handle .icon{font-size:1.3em}.elemental-editor .ss-gridfield-item:hover .handle{opacity:1}.elemental-editor .grid-field__table{margin-bottom:12px}@media (max-width:991.98px){.elemental-editor .grid-field__table .col-EditorPreview{display:table-cell}}.elemental-report__grid-field .element-editor-header__version-state{bottom:9px;left:14px}.elemental-block__history-tab{margin-top:-1.5385rem}.cms-edit-form .fieldgroup.elemental-area__element--historic{margin-left:0;margin-right:0}.cms-edit-form .fieldgroup.elemental-area__element--historic.form-group{border-top:1px solid #dbe0e9}.cms-edit-form .fieldgroup.elemental-area__element--historic .form__field-holder{-webkit-box-flex:0;-webkit-flex:0 0 100%;flex:0 0 100%;max-width:100%}.elemental-preview{line-height:20px}.elemental-preview--historic{margin-bottom:1rem}.elemental-preview__link{float:right;margin-top:4px}div.elemental-area__element--historic.elemental-area__element--historic-inner{background:transparent;border:0;padding-left:0;padding-right:0;padding-top:1.5385rem}.elemental-area--read-only{border-bottom:1px solid #dbe0e9;margin:2.30775rem -1.5385rem}.history-viewer__version-detail fieldset{overflow:visible}.elemental-report__grid-field .ss-gridfield-item td:first-child{width:1px}.elemental-report__grid-field .col-Icon{font-size:1.5rem}.elemental-report__grid-field .element-item--draft,.elemental-report__grid-field .element-item--modified{bottom:8px;left:14px;height:6px;width:6px}.textcheckboxgroup .input-group-append .form-check-input{margin-left:0;position:relative}.elemental-editor__add-new-block-control{width:20rem}.elemental-editor__add-new-block-control a{line-height:1.85em}.element-editor__element{border-bottom:1px solid #dbe0e9;color:inherit;cursor:pointer;padding:.9231rem 1.5385rem 1.8462rem}.element-editor__element:focus,.element-editor__element:hover{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);outline-width:0}.element-editor__element:last-child{border-bottom:0}.elemental-editor__list{background-color:#fff;border-bottom:1px solid #dbe0e9;border-top:1px solid #dbe0e9;margin-left:-1.5385rem;margin-right:-1.5385rem;min-height:6rem;position:relative}.elemental-editor__list--empty{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.element-editor-editform{margin-top:.76925rem;cursor:auto}.element-editor-header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.element-editor-header__title{font-size:15px;font-weight:400;margin:0 0 0 .76925rem;-webkit-font-smoothing:antialiased;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-header__title--none{font-style:italic;color:#6f84a7}.element-editor-header__actions,.element-editor-header__info{-webkit-box-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.element-editor-header__info{max-width:calc(100% - 60px)}.element-editor-header__actions{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.element-editor-header__actions-toggle{padding-top:3px;padding-bottom:3px}.element-editor-header__icon-container{margin-left:-2px;color:#566b8d;font-size:2.154rem;height:28px;line-height:1.5rem}.element-editor-header__expand{font-size:1.1rem;margin-left:3px;width:unset}.element-editor-header__version-state{border:1px solid #cf3f00;border-radius:100%;bottom:6px;-webkit-box-shadow:0 0 1px .5px #fff;box-shadow:0 0 1px .5px #fff;display:block;height:8px;left:22px;position:relative;width:8px;z-index:1}.element-editor-header__version-state--draft{background-color:#fff7f0}.element-editor-header__version-state--modified{background-color:#ff7f22}.element-editor-header .dropdown-item.active{cursor:default}.element-editor-summary{display:-webkit-box;display:-webkit-flex;display:flex;margin-top:.9231rem;margin-left:36px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;min-height:2em}.element-editor-summary__thumbnail-image{border-radius:.1536rem;height:36px;margin:-.6154rem .9231rem -.6154rem 0}.element-editor-summary__content{color:#566b8d;line-height:1.3;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor__toolbar{margin-bottom:1rem}.element-editor-add-element{min-width:320px;max-height:356px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;border-radius:.23rem;overflow-y:scroll}.element-editor-add-element:focus,.element-editor-add-element:hover{outline-width:0}.element-editor-add-element:focus,.element-editor-add-element:hover,.element-editor-add-element__button-container{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1)}.element-editor-add-element__button-container{width:100%;padding:10px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.element-editor-add-element__button-container :nth-child(odd){margin-right:.76925rem}.element-editor-add-element__button-container :nth-child(2n){margin-right:0}.element-editor-add-element__button-container :nth-last-child(-n+2){margin-bottom:0}.element-editor-add-element__button-container .element-editor-add-element__no-results{text-align:center;vertical-align:middle;width:100%;margin:0;padding:.76925rem}.element-editor-add-element__button{width:calc(100% * 0.5 - 5px);padding:.76925rem;text-align:start;margin-bottom:4px;border:0;max-height:40px}.element-editor-add-element .element-editor-add-element__button:before{font-size:2.1rem;margin-right:.76925rem}.element-editor-add-element__search{height:52px}.element-editor-add-element__search-clear,.element-editor-add-element__search-clear:active,.element-editor-add-element__search-clear:focus,.element-editor-add-element__search-clear:hover,.element-editor-add-element__search-input,.element-editor-add-element__search-input:active,.element-editor-add-element__search-input:focus,.element-editor-add-element__search-input:hover{-webkit-box-shadow:none;box-shadow:none;border:0;border-bottom:1px solid #dbe0e9;border-radius:0;outline:none}.element-editor-add-element__search-input{padding-left:1.5385rem}.element-editor-add-element__search .input-group-append .btn-link{padding-right:1.5385rem}.element-editor-add-element__inline{z-index:1}.element-editor__add-block-area-container{height:0;display:-webkit-box;display:-webkit-flex;display:flex;width:100%;position:relative;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.element-editor__add-block-area{background-color:transparent;min-height:1.8462rem;width:100%;margin:0;padding:0;border:0;outline:0;-webkit-transition:0s;-o-transition:0s;transition:0s}.element-editor__add-block-hover-bar{-webkit-align-self:center;align-self:center;width:100%;-webkit-appearance:button;border:0;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;padding:0;top:50%;-webkit-transform:translateY(-66%);-o-transform:translateY(-66%);transform:translateY(-66%)}.element-editor__add-block-hover-bar:before{font-size:1.5rem;background-image:-webkit-radial-gradient(#fff 50%,transparent 0);background-image:-o-radial-gradient(#fff 50%,transparent 50%);background-image:radial-gradient(#fff 50%,transparent 0);-webkit-transform:translateY(-35%);-o-transform:translateY(-35%);transform:translateY(-35%);position:relative;z-index:2;margin-right:.76925rem;display:block;height:1em}.element-editor__add-block-hover-bar--delay{background-color:#c1cad9;max-height:3px}.element-editor__add-block-hover-bar--delay:before{-webkit-transform:translateY(calc(1.5px + -50%));-o-transform:translateY(calc(1.5px + -50%));transform:translateY(calc(1.5px + -50%));color:#c1cad9}.element-editor__add-block-hover-bar--inst{background-color:#0071c4;max-height:5px}.element-editor__add-block-hover-bar--inst:before{-webkit-transform:translateY(calc(2.5px + -50%));-o-transform:translateY(calc(2.5px + -50%));transform:translateY(calc(2.5px + -50%));color:#0071c4} \ No newline at end of file +.elemental-edit{display:-webkit-box;display:-webkit-flex;display:flex;color:inherit}.elemental-edit:focus,.elemental-edit:hover{text-decoration:none;color:inherit}.elemental-editor .col-EditorPreview{padding-left:0}.elemental-preview__detail{display:inline-block;margin-left:.76925rem;margin-top:1px}.elemental-preview__detail h3{font-weight:400;line-height:26px;margin:0;-webkit-font-smoothing:antialiased}.elemental-preview__detail p{-webkit-box-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;margin-bottom:0;margin-top:6px}.elemental-preview__detail small{color:#566b8d;font-size:13px}.elemental-preview__thumbnail-image{margin-right:.76925rem}.elemental-preview__thumbnail-image img{border-radius:.192rem}.elemental-preview__thumbnail-image--placeholder{border-radius:0;height:36px;margin-left:-4px}.elemental-preview__icon{color:#566b8d;display:inline-block;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;font-size:2.3rem;width:28px;vertical-align:top;margin-top:-1px}.ss-gridfield-orderable.elemental-editor .col-reorder .handle{opacity:.5;padding:22px 0 0}.ss-gridfield-orderable.elemental-editor .col-reorder .handle .icon{font-size:1.3em}.elemental-editor .ss-gridfield-item:hover .handle{opacity:1}.elemental-editor .grid-field__table{margin-bottom:12px}@media (max-width:991.98px){.elemental-editor .grid-field__table .col-EditorPreview{display:table-cell}}.elemental-report__grid-field .element-editor-header__version-state{bottom:9px;left:14px}.elemental-block__history-tab{margin-top:-1.5385rem}.cms-edit-form .fieldgroup.elemental-area__element--historic{margin-left:0;margin-right:0}.cms-edit-form .fieldgroup.elemental-area__element--historic.form-group{border-top:1px solid #dbe0e9}.cms-edit-form .fieldgroup.elemental-area__element--historic .form__field-holder{-webkit-box-flex:0;-webkit-flex:0 0 100%;flex:0 0 100%;max-width:100%}.elemental-preview{line-height:20px}.elemental-preview--historic{margin-bottom:1rem}.elemental-preview__link{float:right;margin-top:4px}div.elemental-area__element--historic.elemental-area__element--historic-inner{background:transparent;border:0;padding-left:0;padding-right:0;padding-top:1.5385rem}.elemental-area--read-only{border-bottom:1px solid #dbe0e9;margin:2.30775rem -1.5385rem}.history-viewer__version-detail fieldset{overflow:visible}.elemental-report__grid-field .ss-gridfield-item td:first-child{width:1px}.elemental-report__grid-field .col-Icon{font-size:1.5rem}.elemental-report__grid-field .element-item--draft,.elemental-report__grid-field .element-item--modified{bottom:8px;left:14px;height:6px;width:6px}.textcheckboxgroup .input-group-append .form-check-input{margin-left:0;position:relative}.elemental-editor__add-new-block-control{width:20rem}.elemental-editor__add-new-block-control a{line-height:1.85em}.element-editor__element{border-bottom:1px solid #dbe0e9;color:inherit;cursor:pointer;padding:.9231rem 1.5385rem 1.8462rem}.element-editor__element:focus,.element-editor__element:hover{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);outline-width:0}.element-editor__element:last-child{border-bottom:0}.elemental-editor__list{background-color:#fff;border-bottom:1px solid #dbe0e9;border-top:1px solid #dbe0e9;margin-left:-1.5385rem;margin-right:-1.5385rem;min-height:6rem;position:relative}.elemental-editor__list--empty{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.element-editor-editform{margin-top:.76925rem;cursor:auto}.element-editor-header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.element-editor-header__title{font-size:15px;font-weight:400;margin:0 0 0 .76925rem;-webkit-font-smoothing:antialiased;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor-header__title--none{font-style:italic;color:#6f84a7}.element-editor-header__actions,.element-editor-header__info{-webkit-box-align:center;-webkit-align-items:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;flex-grow:1}.element-editor-header__info{max-width:calc(100% - 60px)}.element-editor-header__actions{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.element-editor-header__actions-toggle{padding-top:3px;padding-bottom:3px}.element-editor-header__icon-container{margin-left:-2px;color:#566b8d;font-size:2.154rem;height:28px;line-height:1.5rem}.element-editor-header__expand{font-size:1.1rem;margin-left:3px;width:unset}.element-editor-header__version-state{border:1px solid #cf3f00;border-radius:100%;bottom:6px;-webkit-box-shadow:0 0 1px .5px #fff;box-shadow:0 0 1px .5px #fff;display:block;height:8px;left:22px;position:relative;width:8px;z-index:1}.element-editor-header__version-state--draft{background-color:#fff7f0}.element-editor-header__version-state--modified{background-color:#ff7f22}.element-editor-header .dropdown-item.active{cursor:default}.element-editor-summary{display:-webkit-box;display:-webkit-flex;display:flex;margin-top:.9231rem;margin-left:36px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;min-height:2em}.element-editor-summary__thumbnail-image{border-radius:.1536rem;height:36px;margin:-.6154rem .9231rem -.6154rem 0}.element-editor-summary__content{color:#566b8d;line-height:1.3;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.element-editor__toolbar{margin-bottom:1rem}.element-editor-add-element{min-width:320px;max-height:356px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;border-radius:.23rem;overflow-y:scroll}.element-editor-add-element:focus,.element-editor-add-element:hover{outline-width:0}.element-editor-add-element:focus,.element-editor-add-element:hover,.element-editor-add-element__button-container{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1);box-shadow:0 2px 5px 0 rgba(0,0,0,.1),0 2px 10px 0 rgba(0,0,0,.1)}.element-editor-add-element__button-container{width:100%;padding:10px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.element-editor-add-element__button-container :nth-child(odd){margin-right:.76925rem}.element-editor-add-element__button-container :nth-child(2n){margin-right:0}.element-editor-add-element__button-container :nth-last-child(-n+2){margin-bottom:0}.element-editor-add-element__button-container .element-editor-add-element__no-results{text-align:center;vertical-align:middle;width:100%;margin:0;padding:.76925rem}.element-editor-add-element__button{width:calc(100% * 0.5 - 5px);padding:.76925rem;text-align:start;margin-bottom:4px;border:0;max-height:40px}.element-editor-add-element .element-editor-add-element__button:before{font-size:2.1rem;margin-right:.76925rem}.element-editor-add-element__search{height:52px}.element-editor-add-element__search-clear,.element-editor-add-element__search-clear:active,.element-editor-add-element__search-clear:focus,.element-editor-add-element__search-clear:hover,.element-editor-add-element__search-input,.element-editor-add-element__search-input:active,.element-editor-add-element__search-input:focus,.element-editor-add-element__search-input:hover{-webkit-box-shadow:none;box-shadow:none;border:0;border-bottom:1px solid #dbe0e9;border-radius:0;outline:none}.element-editor-add-element__search-input{padding-left:1.5385rem}.element-editor-add-element__search .input-group-append .btn-link{padding-right:1.5385rem}.element-editor-add-element__inline{z-index:1}.element-editor__add-block-area-container{height:0;display:-webkit-box;display:-webkit-flex;display:flex;width:100%;position:relative;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.element-editor__add-block-area{background-color:transparent;min-height:1.8462rem;width:100%;margin:0;padding:0;border:0;outline:0;-webkit-transition:0s;-o-transition:0s;transition:0s}.element-editor__add-block-hover-bar{-webkit-align-self:center;align-self:center;width:100%;-webkit-appearance:button;border:0;position:absolute;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;padding:0;top:50%;-webkit-transform:translateY(-66%);-o-transform:translateY(-66%);transform:translateY(-66%)}.element-editor__add-block-hover-bar:before{font-size:1.5rem;background-image:-webkit-radial-gradient(#fff 50%,transparent 0);background-image:-o-radial-gradient(#fff 50%,transparent 50%);background-image:radial-gradient(#fff 50%,transparent 0);-webkit-transform:translateY(-35%);-o-transform:translateY(-35%);transform:translateY(-35%);position:relative;z-index:2;margin-right:.76925rem;display:block;height:1em}.element-editor__add-block-hover-bar--delay{background-color:#c1cad9;max-height:3px}.element-editor__add-block-hover-bar--delay:before{-webkit-transform:translateY(calc(1.5px + -50%));-o-transform:translateY(calc(1.5px + -50%));transform:translateY(calc(1.5px + -50%));color:#c1cad9}.element-editor__add-block-hover-bar--inst{background-color:#0071c4;max-height:5px}.element-editor__add-block-hover-bar--inst:before{-webkit-transform:translateY(calc(2.5px + -50%));-o-transform:translateY(calc(2.5px + -50%));transform:translateY(calc(2.5px + -50%));color:#0071c4} +/*# sourceMappingURL=bundle.css.map*/ \ No newline at end of file diff --git a/client/src/components/ElementEditor/Element.js b/client/src/components/ElementEditor/Element.js index 126c67c5b..93f1c23ff 100644 --- a/client/src/components/ElementEditor/Element.js +++ b/client/src/components/ElementEditor/Element.js @@ -7,10 +7,9 @@ import { inject } from 'lib/Injector'; import i18n from 'i18n'; import classNames from 'classnames'; import { connect } from 'react-redux'; -import { change } from 'redux-form'; import { loadElementFormStateName } from 'state/editor/loadElementFormStateName'; import { loadElementSchemaValue } from 'state/editor/loadElementSchemaValue'; - +import * as TabsActions from 'state/tabs/TabsActions'; /** * The Element component used in the context of an ElementEditor shows the summary @@ -53,15 +52,14 @@ class Element extends Component { } /** - * Dispatcher to Redux-Form state for the Tabs container 'value' + * Dispatcher to Tabs redux store for this element's tabset + * * @param {string} activeTab Name prop of the active tab */ updateFormTab(activeTab) { - const { element, actions } = this.props; + const { element, actions, tabSetName, onActivateTab } = this.props; const { initialTab } = this.state; - const formStateName = `element.${loadElementFormStateName(element.ID)}`; - if (!initialTab) { this.setState({ initialTab: activeTab @@ -69,10 +67,10 @@ class Element extends Component { } if (activeTab || initialTab) { - actions.reduxForm.change(formStateName, 'Root', activeTab || initialTab); + onActivateTab(tabSetName, activeTab || initialTab) } else { const defaultFirstTab = 'Main'; - actions.reduxForm.change(formStateName, 'Root', defaultFirstTab); + onActivateTab(tabSetName, defaultFirstTab) } } @@ -166,7 +164,6 @@ class Element extends Component { this.getVersionedStateClassName() ); - return (
field.component === 'Tabs'; - let defaultValue; - if ( - state.form.formSchemas && + // Find name of the first Tabs component in the form + // Only defined - and needed - once the form is loaded + const tabSet = + state.form && state.form.formSchemas[elementFormSchema] && - state.form.formSchemas[elementFormSchema].schema - ) { - defaultValue = state.form.formSchemas[elementFormSchema].schema.fields - .find(filterFieldsForTabs).children[0].name; - } - const activeTab = stateValue || defaultValue; - return { activeTab }; + state.form.formSchemas[elementFormSchema].schema && + state.form.formSchemas[elementFormSchema].schema.fields.find(filterFieldsForTabs) + + const tabSetName = tabSet && tabSet.id; + const uniqueFieldId = `element.${elementName}__${tabSetName}`; + + // Find name of the active tab in the tab set + // Only defined once an element form is expanded for the first time + const activeTab = + state.tabs && + state.tabs.fields && + state.tabs.fields[uniqueFieldId] && + state.tabs.fields[uniqueFieldId].activeTab + ; + + return { + tabSetName, + activeTab, + }; } -function mapDispatchToProps(dispatch) { +function mapDispatchToProps(dispatch, ownProps) { + + const elementName = loadElementFormStateName(ownProps.element.ID); + return { - actions: { - reduxForm: bindActionCreators({ change }, dispatch), + onActivateTab(tabSetName, activeTabName) { + dispatch(TabsActions.activateTab(`element.${elementName}__${tabSetName}`, activeTabName)); }, }; } - Element.propTypes = { element: elementType, link: PropTypes.string.isRequired, editTabs: PropTypes.arrayOf(PropTypes.object), + // Redux mapped props: + activeTab: PropTypes.string, + tabSetName: PropTypes.string, + onActivateTab: PropTypes.func, }; Element.defaultProps = { diff --git a/webpack.config.js b/webpack.config.js index 588f2eb63..5e2bba3b3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,7 +31,14 @@ const config = [ }, devtool: (ENV !== 'production') ? 'source-map' : '', resolve: resolveJS(ENV, PATHS), - externals: externalJS(ENV, PATHS), + externals: Object.assign( + {}, + externalJS(ENV, PATHS), + { + // @todo remove this once @silverstripe/webpack-config has this updated and published + 'state/tabs/TabsActions': 'TabsActions', + } + ), module: moduleJS(ENV, PATHS), plugins: pluginJS(ENV, PATHS), },