Ubuntu
(window.webpackJsonp=window.webpackJsonp||[]).push([[140],{674:function(e,t,n){"use strict";var a=n(260),o=n.n(a),i=n(69),r=n.n(i),s=n(2),l=n.n(s),c=n(32),u=n.n(c);t.a=function(e){var t=e.className,n=e.children,a=r()(e,["className","children"]);return l.a.createElement("fieldset",o()({},a,{className:u()(t,"form-fieldset")}),n)}},676:function(e,t,n){"use strict";var a=n(2),o=n.n(a),i=n(19),r=n.n(i),s=n(32),l=n.n(s),c=n(261),u=n.n(c),p=function(e){var t=e.text,n=e.type,a=void 0===n?"input-validation":n;return o.a.createElement("div",{className:l()("field-error","field-error__".concat(a))},o.a.createElement(u.a,{size:24,icon:"notice-outline"})," ",o.a.createElement("span",null,t))};p.propTypes={text:r.a.string.isRequired,type:r.a.string},t.a=p},677:function(e,t,n){"use strict";n.d(t,"a",function(){return N});var a=n(260),o=n.n(a),i=n(52),r=n.n(i),s=n(78),l=n.n(s),c=n(91),u=n.n(c),p=n(85),d=n.n(p),m=n(92),h=n.n(m),f=n(5),b=n.n(f),v=n(2),g=n.n(v),y=n(19),k=n.n(y),E=n(32),C=n.n(E),w=n(0),N=function(e){function t(){return r()(this,t),u()(this,d()(t).apply(this,arguments))}return h()(t,e),l()(t,[{key:"render",value:function(){var e=C()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return g.a.createElement("p",o()({},Object(w.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(g.a.Component);b()(N,"displayName","FormSettingExplanation"),b()(N,"propTypes",{noValidate:k.a.bool,isIndented:k.a.bool,className:k.a.string}),b()(N,"defaultProps",{noValidate:!1,isIndented:!1})},678:function(e,t,n){"use strict";var a=n(260),o=n.n(a),i=n(69),r=n.n(i),s=n(2),l=n.n(s),c=n(32),u=n.n(c);t.a=function(e){var t=e.className,n=e.children,a=r()(e,["className","children"]);return l.a.createElement("legend",o()({},a,{className:u()(t,"form-legend")}),n)}},679:function(e,t,n){"use strict";var a=n(260),o=n.n(a),i=n(69),r=n.n(i),s=n(2),l=n.n(s),c=n(32),u=n.n(c);t.a=function(e){var t=e.className,n=e.children,a=r()(e,["className","children"]);return l.a.createElement("h3",o()({},a,{className:u()(t,"form-section-heading")}),n)}},681:function(e,t,n){"use strict";var a=n(260),o=n.n(a),i=n(69),r=n.n(i),s=n(2),l=n.n(s),c=n(32),u=n.n(c);n(688);t.a=function(e){var t=e.inputRef,n=e.className,a=e.isError,i=r()(e,["inputRef","className","isError"]);return l.a.createElement("select",o()({},i,{ref:t,className:u()(n,"form-select",{"is-error":a})}))}},683:function(e,t,n){"use strict";var a=n(260),o=n.n(a),i=n(52),r=n.n(i),s=n(78),l=n.n(s),c=n(91),u=n.n(c),p=n(85),d=n.n(p),m=n(93),h=n.n(m),f=n(92),b=n.n(f),v=n(5),g=n.n(v),y=n(19),k=n.n(y),E=n(2),C=n.n(E),w=n(0),N=n(691),_=n(409),R=n.n(_),O=n(32),I=n.n(O),D=function(e){function t(){var e,n;r()(this,t);for(var a=arguments.length,o=new Array(a),i=0;i1||!n.props.children)?C.a.createElement("div",n.props,n.props.children):n.props.children,n.context.store&&(e=C.a.createElement(w.a,{store:n.context.store},C.a.createElement(N.b,null,e))),g.a.render(e,n.container)}),n}return h()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.renderChildren()}},{key:"componentDidUpdate",value:function(){this.renderChildren()}},{key:"componentWillUnmount",value:function(){this.container&&(g.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container),delete this.container)}},{key:"render",value:function(){return null}}]),t}(C.a.Component);b()(_,"contextTypes",{store:k.a.object})},692:function(e,t,n){"use strict";var a=n(52),o=n.n(a),i=n(78),r=n.n(i),s=n(91),l=n.n(s),c=n(85),u=n.n(c),p=n(93),d=n.n(p),m=n(92),h=n.n(m),f=n(5),b=n.n(f),v=n(19),g=n.n(v),y=n(2),k=n.n(y),E=n(32),C=n.n(E),w=n(8),N=n(0),_=n(705),R=n(849),O=n(261),I=n.n(O),D=(n(703),function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,i=new Array(a),r=0;r0)return s;l>o&&(o=l,n=e)}return n}(l,r);return c!==u&&c!==B[u]||(c=null),function(e,t,n,a,o,i){for(var r,s="top"===e||"bottom"===e,l=t?[s?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,s?"".concat(e," ").concat(B[t]):"".concat(B[t]," ").concat(e)]:[e,s?"".concat(e," ").concat(A[e]):"".concat(A[e]," ").concat(e),s?"".concat(e," ").concat(B[A[e]]):"".concat(B[A[e]]," ").concat(e)],c=0,u=o*i,p=0,d=l.length;pc&&(c=y,r=m)}return r}(u,c,t,n,i,o)||e};function W(e,t,n,a){var o=q()(t);if(!o)throw new Error("could not get bounding client rect of Tip element");var i=o.width,r=o.height,s=q()(n);if(!s)throw new Error("could not get bounding client rect of `target`");var l=s.width,c=s.height,u=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],a=t.documentElement||n.parentNode,o=a.clientTop||n.clientTop||0,i=a.clientLeft||n.clientLeft||0,r=window.pageYOffset||a.scrollTop,s=window.pageXOffset||a.scrollLeft;return{top:e.top+r-o,left:e.left+s-i}}(s,document);if(!u)throw new Error("could not determine page offset of `target`");var p={};switch(e){case"top":p={top:u.top-r,left:a&&a.left?u.left+a.left:u.left+l/2-i/2};break;case"bottom":p={top:u.top+c,left:a&&a.left?u.left+a.left:u.left+l/2-i/2};break;case"right":p={top:u.top+c/2-r/2,left:u.left+l};break;case"left":p={top:u.top+c/2-r/2,left:u.left-i};break;case"top left":p={top:u.top-r,left:u.left+l/2-i+15};break;case"top right":p={top:u.top-r,left:u.left+l/2-15};break;case"bottom left":p={top:u.top+c,left:u.left+l/2-i+15};break;case"bottom right":p={top:u.top+c,left:u.left+l/2-15};break;case"left top":p={top:u.top+c/2-r,left:u.left-i};break;case"left bottom":p={top:u.top+c/2,left:u.left-i};break;case"right top":p={top:u.top+c/2-r,left:u.left+l};break;case"right bottom":p={top:u.top+c/2,left:u.left+l};break;default:throw new Error('invalid position "'.concat(e,'"'))}return p}var Y=function(){},J=_()("calypso:popover"),X=new Set,G=function(e){function t(e){var n;return o()(this,t),n=l()(this,u()(t).call(this,e)),b()(d()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(d()(n)),n.setPosition=n.setPosition.bind(d()(n)),n.onClickout=n.onClickout.bind(d()(n)),n.onKeydown=n.onKeydown.bind(d()(n)),n.onWindowChange=n.onWindowChange.bind(d()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),H())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=C.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,a=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),H()),a!==e.isVisible&&(a?this.show():this.hide()),this.domContainer&&this.domContext&&a?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){X.has(n.id)&&n.domContainer&&n.domContext&&a?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),U(),X.delete(this.id),J("current popover instances: ",X.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=D()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=C.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=C.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,a=n.position,o=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var i=a;this.debug("position: %o",i),this.props.autoRtl&&(i=this.adjustRtlPosition(i),this.debug("RTL adjusted position: %o",i)),this.props.autoPosition&&(i=K(i,e,t),this.debug("suggested position: %o",i));var r=Object.assign({},function(e,t){var n=q()(t).width;return e.left=Math.max(0,Math.min(e.left,z.width-n)),e}(W(i,e,t,o),e),{positionClass:this.getPositionClass(i)});return this.debug("updating reposition: ",r),r}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=O()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),k.a.createElement(P.a,{className:this.props.rootClassName},k.a.createElement("div",{style:this.getStylePosition(),className:e},k.a.createElement("div",{className:"popover__arrow"}),k.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(y.Component);b()(G,"propTypes",{autoPosition:g.a.bool,autoRtl:g.a.bool,className:g.a.string,closeOnEsc:g.a.bool,id:g.a.string,ignoreContext:g.a.shape({getDOMNode:g.a.function}),isRtl:g.a.bool,isVisible:g.a.bool,position:g.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:g.a.string,showDelay:g.a.number,onClose:g.a.func,onShow:g.a.func,relativePosition:g.a.shape({left:g.a.number}),customPosition:g.a.shape({top:g.a.number,left:g.a.number,positionClass:g.a.oneOf(["top","right","bottom","left"])})}),b()(G,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:Y,onShow:Y});t.a=Object(w.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(G)},758:function(e,t,n){"use strict";var a=n(52),o=n.n(a),i=n(78),r=n.n(i),s=n(91),l=n.n(s),c=n(85),u=n.n(c),p=n(93),d=n.n(p),m=n(92),h=n.n(m),f=n(5),b=n.n(f),v=n(61),g=n(8),y=n(19),k=n.n(y),E=n(2),C=n.n(E),w=n(0),N=(n(826),n(408)),_=n(261),R=n.n(_),O=n(669),I=n(36),D=n(430),x=n(32),P=n.n(x),T=n(719),j=n(739),S=function(e){return"HR"===e.tagName},q=function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,i=new Array(a),r=0;r1&&void 0!==arguments[1])||arguments[1],a=n.menu.current,o=a.firstChild,i=a.lastChild;if(t||(o=a.lastChild,i=a.firstChild),e===a)return o;var r=e[t?"nextSibling":"previousSibling"]||i;return S(r)?n._getClosestSibling(r,t):r}),b()(d()(n),"_onKeyDown",function(e){var t,a=e.target,o=!1;switch(e.keyCode){case 9:n.props.onClose(),o=!0;break;case 38:t=n._getClosestSibling(a,!1),o=!0;break;case 40:t=n._getClosestSibling(a,!0),o=!0}t&&t.focus(),o&&e.preventDefault()}),b()(d()(n),"_onClose",function(e){n._previouslyFocusedElement&&(n._previouslyFocusedElement.focus(),n._previouslyFocusedElement=null),n.props.onClose&&n.props.onClose(e)}),n}return h()(t,e),r()(t,[{key:"componentWillUnmount",value:function(){this._previouslyFocusedElement=null}},{key:"render",value:function(){var e=this.props,t=e.popoverComponent,n=e.autoPosition,a=e.className,o=e.context,i=e.customPosition,r=e.isVisible,s=e.popoverTitle,l=e.position,c=e.rootClassName;return C.a.createElement(t,{onClose:this._onClose,onShow:this._onShow,autoPosition:n,className:a,context:o,customPosition:i,isVisible:r,popoverTitle:s,position:l,rootClassName:c},C.a.createElement("div",{ref:this.menu,role:"menu",className:"popover__menu",onKeyDown:this._onKeyDown,tabIndex:"-1"},C.a.Children.map(this.props.children,this._setPropsOnChild,this)))}}]),t}(E.Component);b()(q,"propTypes",{autoPosition:k.a.bool,isVisible:k.a.bool.isRequired,onClose:k.a.func.isRequired,position:k.a.string,className:k.a.string,rootClassName:k.a.string,popoverComponent:k.a.func,popoverTitle:k.a.string,customPosition:k.a.object}),b()(q,"defaultProps",{autoPosition:!0,position:"top",popoverComponent:j.a});var M=q,L=(n(827),function(e){function t(){var e,n;o()(this,t);for(var a=arguments.length,i=new Array(a),r=0;r