text: /*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements.
   * Licensed under the Elastic License; you may not use this file except in compliance with the Elastic License. */
  var __kbnBundles__=typeof __kbnBundles__==="object"?__kbnBundles__:{};__kbnBundles__["space_selector"]=function(modules){function webpackJsonpCallback(data){var chunkIds=data[0];var moreModules=data[1];var executeModules=data[2];var moduleId,chunkId,i=0,resolves=[];for(;i<chunkIds.length;i++){chunkId=chunkIds[i];if(installedChunks[chunkId]){resolves.push(installedChunks[chunkId][0])}installedChunks[chunkId]=0}for(moduleId in moreModules){if(Object.prototype.hasOwnProperty.call(moreModules,moduleId)){modules[moduleId]=moreModules[moduleId]}}if(parentJsonpFunction)parentJsonpFunction(data);while(resolves.length){resolves.shift()()}deferredModules.push.apply(deferredModules,executeModules||[]);return checkDeferredModules()}function checkDeferredModules(){var result;for(var i=0;i<deferredModules.length;i++){var deferredModule=deferredModules[i];var fulfilled=true;for(var j=1;j<deferredModule.length;j++){var depId=deferredModule[j];if(installedChunks[depId]!==0)fulfilled=false}if(fulfilled){deferredModules.splice(i--,1);result=__webpack_require__(__webpack_require__.s=deferredModule[0])}}return result}var installedModules={};var installedChunks={18:0};var deferredModules=[];function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(exports,"__esModule",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value==="object"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,"default",{enumerable:true,value:value});if(mode&2&&typeof value!="string")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="__REPLACE_WITH_PUBLIC_PATH__";var jsonpArray=window["webpackJsonp"]=window["webpackJsonp"]||[];var oldJsonpFunction=jsonpArray.push.bind(jsonpArray);jsonpArray.push=webpackJsonpCallback;jsonpArray=jsonpArray.slice();for(var i=0;i<jsonpArray.length;i++)webpackJsonpCallback(jsonpArray[i]);var parentJsonpFunction=oldJsonpFunction;deferredModules.push([2718,0]);return checkDeferredModules()}({2718:function(module,exports,__webpack_require__){"use strict";__webpack_require__(86);__webpack_require__(87);__webpack_require__(88);__webpack_require__(89);__webpack_require__(90);__webpack_require__(91);__webpack_require__(92);__webpack_require__(93);__webpack_require__(94);__webpack_require__(95);__webpack_require__(96);__webpack_require__(97);__webpack_require__(98);__webpack_require__(99);__webpack_require__(100);__webpack_require__(101);__webpack_require__(102);__webpack_require__(103);__webpack_require__(104);__webpack_require__(105);__webpack_require__(106);__webpack_require__(107);__webpack_require__(108);__webpack_require__(109);__webpack_require__(110);__webpack_require__(111);__webpack_require__(112);__webpack_require__(113);__webpack_require__(114);__webpack_require__(115);__webpack_require__(116);__webpack_require__(117);__webpack_require__(118);__webpack_require__(119);__webpack_require__(120);__webpack_require__(121);__webpack_require__(122);__webpack_require__(123);__webpack_require__(124);__webpack_require__(125);__webpack_require__(126);__webpack_require__(127);__webpack_require__(128);__webpack_require__(129);__webpack_require__(130);__webpack_require__(131);__webpack_require__(132);__webpack_require__(133);__webpack_require__(134);__webpack_require__(135);__webpack_require__(136);__webpack_require__(137);__webpack_require__(138);__webpack_require__(139);__webpack_require__(140);__webpack_require__(141);__webpack_require__(142);__webpack_require__(143);__webpack_require__(144);__webpack_require__(145);__webpack_require__(146);__webpack_require__(147);__webpack_require__(148);__webpack_require__(149);__webpack_require__(150);__webpack_require__(151);__webpack_require__(152);__webpack_require__(153);__webpack_require__(154);__webpack_require__(155);__webpack_require__(156);__webpack_require__(157);__webpack_require__(158);__webpack_require__(159);__webpack_require__(160);__webpack_require__(161);__webpack_require__(162);__webpack_require__(163);__webpack_require__(164);__webpack_require__(165);__webpack_require__(166);__webpack_require__(167);__webpack_require__(168);__webpack_require__(169);__webpack_require__(170);__webpack_require__(171);__webpack_require__(172);__webpack_require__(173);__webpack_require__(174);__webpack_require__(175);__webpack_require__(176);__webpack_require__(177);__webpack_require__(178);__webpack_require__(179);__webpack_require__(180);__webpack_require__(181);__webpack_require__(182);__webpack_require__(183);__webpack_require__(184);__webpack_require__(185);__webpack_require__(186);__webpack_require__(187);__webpack_require__(188);__webpack_require__(189);__webpack_require__(190);__webpack_require__(191);__webpack_require__(192);__webpack_require__(193);__webpack_require__(194);__webpack_require__(195);__webpack_require__(196);__webpack_require__(197);__webpack_require__(198);__webpack_require__(199);__webpack_require__(200);__webpack_require__(201);__webpack_require__(202);__webpack_require__(203);__webpack_require__(204);__webpack_require__(205);__webpack_require__(206);__webpack_require__(207);__webpack_require__(208);__webpack_require__(209);__webpack_require__(210);__webpack_require__(211);__webpack_require__(212);__webpack_require__(213);__webpack_require__(214);__webpack_require__(215);__webpack_require__(216);var _i18n=__webpack_require__(4);var _kibanaCore__=__webpack_require__(73);__webpack_require__.nc=window.__kbnNonce__;var injectedMetadata=JSON.parse(document.querySelector("kbn-injected-metadata").getAttribute("data"));_i18n.i18n.load(injectedMetadata.i18n.translationsUrl).catch(function(e){return e}).then(function(i18nError){var coreSystem=new _kibanaCore__.CoreSystem({injectedMetadata:injectedMetadata,rootDomElement:document.body,browserSupportsCsp:!window.__kbnCspNotEnforced__,requireLegacyFiles:function requireLegacyFiles(){__webpack_require__(2719)}});coreSystem.setup().then(function(coreSetup){if(i18nError){coreSetup.fatalErrors.add(i18nError)}return coreSystem.start()})})},2719:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var tslib_1=__webpack_require__(2);var spaces_manager_1=__webpack_require__(656);var space_selector_html_1=tslib_1.__importDefault(__webpack_require__(2720));__webpack_require__(278);var chrome_1=tslib_1.__importDefault(__webpack_require__(9));var i18n_1=__webpack_require__(15);var modules_1=__webpack_require__(8);var react_1=tslib_1.__importDefault(__webpack_require__(0));var react_dom_1=__webpack_require__(17);var space_selector_1=__webpack_require__(2721);var _module=modules_1.uiModules.get("spaces_selector",[]);_module.controller("spacesSelectorController",function($scope,$http,spaces,spaceSelectorURL){var domNode=document.getElementById("spaceSelectorRoot");var spacesManager=new spaces_manager_1.SpacesManager($http,chrome_1.default,spaceSelectorURL);react_dom_1.render(react_1.default.createElement(i18n_1.I18nContext,null,react_1.default.createElement(space_selector_1.SpaceSelector,{spaces:spaces,spacesManager:spacesManager})),domNode);$scope.$on("$destroy",function(){if(domNode){react_dom_1.unmountComponentAtNode(domNode)}})});chrome_1.default.setVisible(false).setRootTemplate(space_selector_html_1.default)},2720:function(module,exports){module.exports='<div ng-controller="spacesSelectorController" id="spaceSelectorRootWrap">\n  <div id="spaceSelectorRoot" />\n</div>\n'},2721:function(module,exports,__webpack_require__){"use strict";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a 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)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call}return _assertThisInitialized(self)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}Object.defineProperty(exports,"__esModule",{value:true});var tslib_1=__webpack_require__(2);var eui_1=__webpack_require__(1);var react_1=__webpack_require__(5);var react_2=tslib_1.__importStar(__webpack_require__(0));var constants_1=__webpack_require__(427);var space_cards_1=__webpack_require__(2722);var SpaceSelectorUI=function(_react_2$Component){_inherits(SpaceSelectorUI,_react_2$Component);function SpaceSelectorUI(props){var _this;_classCallCheck(this,SpaceSelectorUI);_this=_possibleConstructorReturn(this,_getPrototypeOf(SpaceSelectorUI).call(this,props));_this.setHeaderRef=function(ref){_this.headerRef=ref;if(_this.headerRef){_this.headerRef.focus()}};_this.getSearchField=function(){var intl=_this.props.intl;if(!_this.props.spaces||_this.props.spaces.length<constants_1.SPACE_SEARCH_COUNT_THRESHOLD){return null}return react_2.default.createElement(eui_1.EuiFlexItem,{className:"spcSpaceSelector__searchHolder"},react_2.default.createElement(eui_1.EuiFieldSearch,{className:"spcSpaceSelector__searchField",placeholder:intl.formatMessage({id:"xpack.spaces.spaceSelector.findSpacePlaceholder",defaultMessage:"Find a space"}),incremental:true,onSearch:_this.onSearch}))};_this.onSearch=function(){var searchTerm=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";_this.setState({searchTerm:searchTerm.trim().toLowerCase()})};_this.onSelectSpace=function(space){_this.props.spacesManager.changeSelectedSpace(space)};var state={loading:false,searchTerm:"",spaces:[]};if(Array.isArray(props.spaces)){state.spaces=_toConsumableArray(props.spaces)}_this.state=state;return _this}_createClass(SpaceSelectorUI,[{key:"componentDidMount",value:function componentDidMount(){if(this.state.spaces.length===0){this.loadSpaces()}}},{key:"loadSpaces",value:function loadSpaces(){var _this2=this;this.setState({loading:true});var spacesManager=this.props.spacesManager;spacesManager.getSpaces().then(function(spaces){_this2.setState({loading:false,spaces:spaces})})}},{key:"render",value:function render(){var _this$state=this.state,spaces=_this$state.spaces,searchTerm=_this$state.searchTerm;var filteredSpaces=spaces;if(searchTerm){filteredSpaces=spaces.filter(function(space){return space.name.toLowerCase().indexOf(searchTerm)>=0||(space.description||"").toLowerCase().indexOf(searchTerm)>=0})}return react_2.default.createElement(eui_1.EuiPage,{className:"spcSpaceSelector","data-test-subj":"kibanaSpaceSelector"},react_2.default.createElement(eui_1.EuiPageBody,null,react_2.default.createElement(eui_1.EuiPageHeader,{className:"spcSpaceSelector__heading"},react_2.default.createElement(eui_1.EuiSpacer,{size:"xxl"}),react_2.default.createElement("span",{className:"spcSpaceSelector__logo"},react_2.default.createElement(eui_1.EuiIcon,{size:"xxl",type:"logoKibana"})),react_2.default.createElement(eui_1.EuiTitle,{size:"l"},react_2.default.createElement("h1",{tabIndex:0,ref:this.setHeaderRef},react_2.default.createElement(react_1.FormattedMessage,{id:"xpack.spaces.spaceSelector.selectSpacesTitle",defaultMessage:"Select your space"}))),react_2.default.createElement(eui_1.EuiText,{size:"s",color:"subdued"},react_2.default.createElement("p",null,react_2.default.createElement(react_1.FormattedMessage,{id:"xpack.spaces.spaceSelector.changeSpaceAnytimeAvailabilityText",defaultMessage:"You can change your space at anytime"})))),react_2.default.createElement(eui_1.EuiPageContent,{className:"spcSpaceSelector__pageContent"},react_2.default.createElement(eui_1.EuiFlexGroup,{direction:"column",alignItems:"center",responsive:false},this.getSearchField()),react_2.default.createElement(eui_1.EuiSpacer,{size:"xl"}),react_2.default.createElement(space_cards_1.SpaceCards,{spaces:filteredSpaces,onSpaceSelect:this.onSelectSpace}),filteredSpaces.length===0&&react_2.default.createElement(react_2.Fragment,null,react_2.default.createElement(eui_1.EuiSpacer,null),react_2.default.createElement(eui_1.EuiText,{color:"subdued",textAlign:"center"},react_2.default.createElement(react_1.FormattedMessage,{id:"xpack.spaces.spaceSelector.noSpacesMatchSearchCriteriaDescription",defaultMessage:"No spaces match search criteria"}))))))}}]);return SpaceSelectorUI}(react_2.Component);exports.SpaceSelector=react_1.injectI18n(SpaceSelectorUI)},2722:function(module,exports,__webpack_require__){"use strict";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a 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)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call}return _assertThisInitialized(self)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}Object.defineProperty(exports,"__esModule",{value:true});var tslib_1=__webpack_require__(2);var eui_1=__webpack_require__(1);var react_1=tslib_1.__importStar(__webpack_require__(0));var space_card_1=__webpack_require__(2723);var SpaceCards=function(_react_1$Component){_inherits(SpaceCards,_react_1$Component);function SpaceCards(){var _this;_classCallCheck(this,SpaceCards);_this=_possibleConstructorReturn(this,_getPrototypeOf(SpaceCards).apply(this,arguments));_this.renderSpace=function(space){return react_1.default.createElement(eui_1.EuiFlexItem,{key:space.id,grow:false},react_1.default.createElement(space_card_1.SpaceCard,{space:space,onClick:_this.createSpaceClickHandler(space)}))};_this.createSpaceClickHandler=function(space){return function(){_this.props.onSpaceSelect(space)}};return _this}_createClass(SpaceCards,[{key:"render",value:function render(){return react_1.default.createElement("div",{className:"spaceCards"},react_1.default.createElement(eui_1.EuiFlexGroup,{gutterSize:"l",justifyContent:"center",wrap:true,responsive:false},this.props.spaces.map(this.renderSpace)))}}]);return SpaceCards}(react_1.Component);exports.SpaceCards=SpaceCards},2723:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var tslib_1=__webpack_require__(2);var eui_1=__webpack_require__(1);var react_1=tslib_1.__importDefault(__webpack_require__(0));var components_1=__webpack_require__(356);exports.SpaceCard=function(props){var space=props.space,onClick=props.onClick;return react_1.default.createElement(eui_1.EuiCard,{className:"spaceCard","data-test-subj":"space-card-".concat(space.id),icon:renderSpaceAvatar(space),title:space.name,description:renderSpaceDescription(space),onClick:onClick})};function renderSpaceAvatar(space){return react_1.default.createElement(components_1.SpaceAvatar,{space:space,size:"l",announceSpaceName:false})}function renderSpaceDescription(space){var description=space.description||"";var needsTruncation=description.length>120;if(needsTruncation){description=description.substr(0,120)+"…"}return react_1.default.createElement("span",{title:description,className:"eui-textBreakWord euiTextColor--subdued"},description)}},7:function(module,exports){module.exports=vendors}})["plugin"];