-
Notifications
You must be signed in to change notification settings - Fork 3
/
13-fd5ef347026a0fd2f506.js.map
1 lines (1 loc) · 25.3 KB
/
13-fd5ef347026a0fd2f506.js.map
1
{"version":3,"sources":["webpack:///13-fd5ef347026a0fd2f506.js","webpack:///./src/MenuCards/MenuCardsForSection.component.js","webpack:///./src/MenuCards/MenuCards.component.js","webpack:///./src/MenuCards/menuCardsStore.js"],"names":["webpackJsonp","3312","module","__webpack_exports__","__webpack_require__","Object","defineProperty","value","__WEBPACK_IMPORTED_MODULE_0__MenuCards_component__","__WEBPACK_IMPORTED_MODULE_1_d2_ui_lib_component_helpers_withStateFrom__","__WEBPACK_IMPORTED_MODULE_2__menuCardsStore__","__WEBPACK_IMPORTED_MODULE_3__App_appStateStore__","_slicedToArray","sliceIterator","arr","i","_arr","_n","_d","_e","undefined","_s","_i","Symbol","iterator","next","done","push","length","err","Array","isArray","TypeError","currentSection$","map","appState","sideBar","currentSection","distinctUntilChanged","sectionItemsForCurrentGroup$","combineLatest","flatMap","_ref","_ref2","metaDataSections","filter","metaDataSection","key","menuItems","items","3723","__WEBPACK_IMPORTED_MODULE_0_react__","__WEBPACK_IMPORTED_MODULE_0_react___default","n","__WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card__","__WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card___default","__WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader__","__WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader___default","__WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText__","__WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText___default","__WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions__","__WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions___default","__WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton__","__WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton___default","__WEBPACK_IMPORTED_MODULE_6_d2_ui_lib_i18n_Translate_mixin__","a","createClass","displayName","propTypes","PropTypes","arrayOf","shape","name","string","description","mixins","getDefaultProps","renderCard","details","index","cardStyle","padding","margin","float","width","headerStyle","height","borderBottom","cursor","textStyle","actionStyle","textAlign","styles","cardHeaderText","paddingRight","actionButtons","canCreate","createElement","iconClassName","tooltip","this","getTranslation","tooltipPosition","onClick","add","list","style","title","render","props","clear","3724","_asyncToGenerator","fn","gen","apply","arguments","Promise","resolve","reject","step","arg","info","error","then","__WEBPACK_IMPORTED_MODULE_0__App_appStateStore__","__WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores__","__WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores___default","__WEBPACK_IMPORTED_MODULE_2_rxjs__","__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__","__WEBPACK_IMPORTED_MODULE_4__router_utils__","createCardsFromMetaDataSections","regeneratorRuntime","mark","_callee","d2","wrap","_context","prev","sent","abrupt","i18n","label","currentUser","models","goToRoute","stop","_x","mainSections","v","reduce","cardState","mainSectionName","concat","take","fromPromise","concatAll"],"mappings":"AAAAA,cAAc,KAERC,KACA,SAAUC,EAAQC,EAAqBC,GAE7C,YACAC,QAAOC,eAAeH,EAAqB,cAAgBI,OAAO,GAC7C,IAAIC,GAAqDJ,EAAoB,MACzEK,EAA0EL,EAAoB,MAC9FM,EAAgDN,EAAoB,MACpEO,EAAmDP,EAAoB,KAC5FQ,EAAiB,WAAc,QAASC,GAAcC,EAAKC,GAAK,GAAIC,MAAeC,GAAK,EAAUC,GAAK,EAAWC,MAAKC,EAAW,KAAM,IAAK,GAAiCC,GAA7BC,EAAKR,EAAIS,OAAOC,cAAmBP,GAAMI,EAAKC,EAAGG,QAAQC,QAAoBV,EAAKW,KAAKN,EAAGd,QAAYQ,GAAKC,EAAKY,SAAWb,GAA3DE,GAAK,IAAoE,MAAOY,GAAOX,GAAK,EAAMC,EAAKU,EAAO,QAAU,KAAWZ,GAAMK,EAAW,QAAGA,EAAW,SA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GAAAe,SAAmBnG,EAAgB0B,KAAnC,IAA2CzB,EAA3C,SACX0D,KAAM,iBAAMrG,GAAAW,EAAAmH,EAAA,GAAAe,SAAmBnG,EAAgB0B,KAAnC,IAA2CzB,UAb/E,wBAAA0F,GAAAS,SAAAZ,EAAAlC,QH+NI,OAAO,UAAyC+C,GAC5C,MAAOzG,GAAKyE,MAAMf,KAAMgB,cG9MhCjH,GAAA,EAAe0H,EAAA,EACV3F,IAAI,SAACC,GAQF,MAPkBA,GAASC,QAAQgH,aAC9BlH,IAAI,SAAAmH,GAAA,MAAKA,GAAEtG,MACXuG,OAAO,SAACC,EAAWC,GAAZ,MAAgCD,GAAUE,SAC9CjF,KAAMgF,EACNvG,MAAOd,EAASC,QAAQoH,iBAKnCE,KAAK,GACLxH,IAAI,SAAAU,GAAA,MAAoBoF,GAAA,WAAW2B,YAAYxB,EAAgCvF,MAC/EgH","file":"13-fd5ef347026a0fd2f506.js","sourcesContent":["webpackJsonp([13],{\n\n/***/ 3312:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__MenuCards_component__ = __webpack_require__(3723);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d2_ui_lib_component_helpers_withStateFrom__ = __webpack_require__(1307);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__menuCardsStore__ = __webpack_require__(3724);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__App_appStateStore__ = __webpack_require__(134);\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\n\n\n\n\n\nvar currentSection$ = __WEBPACK_IMPORTED_MODULE_3__App_appStateStore__[\"b\" /* default */].map(function (appState) {\n return appState.sideBar.currentSection;\n}).distinctUntilChanged();\n\nvar sectionItemsForCurrentGroup$ = __WEBPACK_IMPORTED_MODULE_2__menuCardsStore__[\"a\" /* default */].combineLatest(currentSection$)\n// Filter the section based on the app's currentSection\n.flatMap(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n metaDataSections = _ref2[0],\n currentSection = _ref2[1];\n\n return metaDataSections.filter(function (metaDataSection) {\n return metaDataSection.key === currentSection;\n });\n})\n// Map the section items onto the props for the MenuCards component\n.map(function (currentSection) {\n return { menuItems: currentSection.items };\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_d2_ui_lib_component_helpers_withStateFrom__[\"a\" /* default */])(sectionItemsForCurrentGroup$, __WEBPACK_IMPORTED_MODULE_0__MenuCards_component__[\"a\" /* default */]));\n\n/***/ }),\n\n/***/ 3723:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card__ = __webpack_require__(1343);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader__ = __webpack_require__(740);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText__ = __webpack_require__(741);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions__ = __webpack_require__(739);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton__ = __webpack_require__(203);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_d2_ui_lib_i18n_Translate_mixin__ = __webpack_require__(1308);\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'MenuCards.component',\n\n propTypes: {\n menuItems: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.arrayOf(__WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.shape({\n name: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.string,\n description: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.string\n }))\n },\n\n mixins: [__WEBPACK_IMPORTED_MODULE_6_d2_ui_lib_i18n_Translate_mixin__[\"a\" /* default */]],\n\n getDefaultProps: function getDefaultProps() {\n return {\n menuItems: []\n };\n },\n renderCard: function renderCard(details, index) {\n var cardStyle = {\n padding: '0',\n margin: '.5rem',\n float: 'left',\n width: '230px'\n };\n\n var headerStyle = {\n padding: '1rem',\n height: 'auto',\n borderBottom: '1px solid #ddd',\n cursor: 'pointer'\n };\n\n var textStyle = {\n height: '85px',\n padding: '.5rem 1rem'\n };\n\n var actionStyle = {\n textAlign: 'right'\n };\n\n var styles = {\n cardHeaderText: {\n paddingRight: 0\n }\n };\n\n var actionButtons = [];\n\n if (details.canCreate) {\n actionButtons.push(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton___default.a,\n {\n key: 'add',\n iconClassName: 'material-icons',\n tooltip: this.getTranslation('add'),\n tooltipPosition: 'top-center',\n onClick: details.add\n },\n '\\uE145'\n ));\n }\n\n actionButtons.push(__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_5_material_ui_IconButton_IconButton___default.a,\n {\n key: 'list',\n iconClassName: 'material-icons',\n tooltip: this.getTranslation('list'),\n tooltipPosition: 'top-center',\n onClick: details.list\n },\n '\\uE8EF'\n ));\n\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_1_material_ui_Card_Card___default.a,\n { key: index, style: cardStyle },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_material_ui_Card_CardHeader___default.a, {\n onClick: details.list,\n style: headerStyle,\n title: details.name,\n textStyle: styles.cardHeaderText\n }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_3_material_ui_Card_CardText___default.a,\n { style: textStyle },\n details.description\n ),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_4_material_ui_Card_CardActions___default.a,\n { style: actionStyle },\n actionButtons\n )\n );\n },\n render: function render() {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n null,\n this.props.menuItems.map(this.renderCard),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', { style: { clear: 'both' } })\n );\n }\n}));\n\n/***/ }),\n\n/***/ 3724:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__App_appStateStore__ = __webpack_require__(134);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores__ = __webpack_require__(95);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs__ = __webpack_require__(25);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_rxjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_rxjs__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__router_utils__ = __webpack_require__(202);\nvar createCardsFromMetaDataSections = function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(metaDataSections) {\n var d2;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__[\"getInstance\"])();\n\n case 2:\n d2 = _context.sent;\n return _context.abrupt('return', metaDataSections.map(function (metaDataSection) {\n return {\n key: metaDataSection.name,\n name: d2.i18n.getTranslation(__WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores___default()(metaDataSection.name)),\n items: metaDataSection.items.map(function (_ref2) {\n var key = _ref2.key,\n label = _ref2.label;\n return {\n name: label,\n description: d2.i18n.getTranslation('intro_' + __WEBPACK_IMPORTED_MODULE_1_d2_utilizr_lib_camelCaseToUnderscores___default()(key)),\n canCreate: d2.currentUser.canCreate(d2.models[key]),\n add: function add() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__router_utils__[\"a\" /* goToRoute */])('/edit/' + metaDataSection.name + '/' + key + '/add');\n },\n list: function list() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__router_utils__[\"a\" /* goToRoute */])('/list/' + metaDataSection.name + '/' + key);\n }\n };\n })\n };\n }));\n\n case 4:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n return function createCardsFromMetaDataSections(_x) {\n return _ref.apply(this, arguments);\n };\n}();\n\nfunction _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0__App_appStateStore__[\"b\" /* default */].map(function (appState) {\n var cardState = appState.sideBar.mainSections.map(function (v) {\n return v.key;\n }).reduce(function (cardState, mainSectionName) {\n return cardState.concat([{\n name: mainSectionName,\n items: appState.sideBar[mainSectionName] || []\n }]);\n }, []);\n\n return cardState;\n}).take(1).map(function (metaDataSections) {\n return __WEBPACK_IMPORTED_MODULE_2_rxjs__[\"Observable\"].fromPromise(createCardsFromMetaDataSections(metaDataSections));\n}).concatAll());\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// 13-fd5ef347026a0fd2f506.js","import MenuCards from './MenuCards.component';\nimport withStateFrom from 'd2-ui/lib/component-helpers/withStateFrom';\nimport menuCardsStore from './menuCardsStore';\nimport appState from '../App/appStateStore';\n\nconst currentSection$ = appState\n .map(appState => appState.sideBar.currentSection)\n .distinctUntilChanged();\n\nconst sectionItemsForCurrentGroup$ = menuCardsStore\n .combineLatest(currentSection$)\n // Filter the section based on the app's currentSection\n .flatMap(([metaDataSections, currentSection]) => metaDataSections.filter(metaDataSection => metaDataSection.key === currentSection))\n // Map the section items onto the props for the MenuCards component\n .map(currentSection => ({ menuItems: currentSection.items }));\n\nexport default withStateFrom(sectionItemsForCurrentGroup$, MenuCards);\n\n\n\n// WEBPACK FOOTER //\n// ./src/MenuCards/MenuCardsForSection.component.js","import React from 'react';\nimport Card from 'material-ui/Card/Card';\nimport CardHeader from 'material-ui/Card/CardHeader';\nimport CardText from 'material-ui/Card/CardText';\nimport CardActions from 'material-ui/Card/CardActions';\nimport IconButton from 'material-ui/IconButton/IconButton';\nimport Translate from 'd2-ui/lib/i18n/Translate.mixin';\n\nexport default React.createClass({\n propTypes: {\n menuItems: React.PropTypes.arrayOf(React.PropTypes.shape({\n name: React.PropTypes.string,\n description: React.PropTypes.string,\n })),\n },\n\n mixins: [Translate],\n\n getDefaultProps() {\n return {\n menuItems: [],\n };\n },\n\n renderCard(details, index) {\n const cardStyle = {\n padding: '0',\n margin: '.5rem',\n float: 'left',\n width: '230px',\n };\n\n const headerStyle = {\n padding: '1rem',\n height: 'auto',\n borderBottom: '1px solid #ddd',\n cursor: 'pointer',\n };\n\n const textStyle = {\n height: '85px',\n padding: '.5rem 1rem',\n };\n\n const actionStyle = {\n textAlign: 'right',\n };\n\n const styles = {\n cardHeaderText: {\n paddingRight: 0,\n },\n };\n\n const actionButtons = [];\n\n if (details.canCreate) {\n actionButtons.push(\n <IconButton\n key=\"add\"\n iconClassName=\"material-icons\"\n tooltip={this.getTranslation('add')}\n tooltipPosition=\"top-center\"\n onClick={details.add}\n ></IconButton>\n );\n }\n\n actionButtons.push(\n <IconButton\n key=\"list\"\n iconClassName=\"material-icons\"\n tooltip={this.getTranslation('list')}\n tooltipPosition=\"top-center\"\n onClick={details.list}\n ></IconButton>\n );\n\n return (\n <Card key={index} style={cardStyle}>\n <CardHeader\n onClick={details.list}\n style={headerStyle}\n title={details.name}\n textStyle={styles.cardHeaderText}\n />\n <CardText style={textStyle}>{details.description}</CardText>\n <CardActions style={actionStyle}>\n {actionButtons}\n </CardActions>\n </Card>\n );\n },\n\n render() {\n return (\n <div>\n {this.props.menuItems.map(this.renderCard)}\n <div style={{ clear: 'both' }} />\n </div>\n );\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/MenuCards/MenuCards.component.js","import appStateStore from '../App/appStateStore';\nimport camelCaseToUnderscores from 'd2-utilizr/lib/camelCaseToUnderscores';\nimport { Observable } from 'rxjs';\nimport { getInstance } from 'd2/lib/d2';\nimport { goToRoute } from '../router-utils';\n\nasync function createCardsFromMetaDataSections(metaDataSections) {\n const d2 = await getInstance();\n\n return metaDataSections\n .map(metaDataSection => ({\n key: metaDataSection.name,\n name: d2.i18n.getTranslation(camelCaseToUnderscores(metaDataSection.name)),\n items: metaDataSection.items\n .map(({ key, label }) => ({\n name: label,\n description: d2.i18n.getTranslation(`intro_${camelCaseToUnderscores(key)}`),\n canCreate: d2.currentUser.canCreate(d2.models[key]),\n add: () => goToRoute(`/edit/${metaDataSection.name}/${key}/add`),\n list: () => goToRoute(`/list/${metaDataSection.name}/${key}`),\n })),\n }));\n}\n\nexport default appStateStore\n .map((appState) => {\n const cardState = appState.sideBar.mainSections\n .map(v => v.key)\n .reduce((cardState, mainSectionName) => cardState.concat([{\n name: mainSectionName,\n items: appState.sideBar[mainSectionName] || [],\n }]), []);\n\n return cardState;\n })\n .take(1)\n .map(metaDataSections => Observable.fromPromise(createCardsFromMetaDataSections(metaDataSections)))\n .concatAll();\n\n\n\n// WEBPACK FOOTER //\n// ./src/MenuCards/menuCardsStore.js"],"sourceRoot":""}