{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./test/dummy/frontend/js/initializers/rails.js","webpack:///./test/dummy/frontend/js/views/shared/Flash.js","webpack:///./test/dummy/frontend/js/controllers/concerns/Disconnection.js","webpack:///./test/dummy/frontend/js/actions.js","webpack:///./test/dummy/frontend/js/reducers/articles.js","webpack:///./test/dummy/frontend/js/reducers/comments.js","webpack:///./test/dummy/frontend/js/reducers/users.js","webpack:///./test/dummy/frontend/js/reducers/index.js","webpack:///./test/dummy/frontend/js/store.js","webpack:///./test/dummy/frontend/js/views/layouts/User.js","webpack:///./test/dummy/frontend/js/views/user/articles/Show.js","webpack:///./test/dummy/frontend/js/models/article/Comment.js","webpack:///./test/dummy/frontend/js/selectors/comments.js","webpack:///./test/dummy/frontend/js/containers/user/Comment.js","webpack:///./test/dummy/frontend/js/containers/user/CommentList.js","webpack:///./test/dummy/frontend/js/views/user/articles/Form.js","webpack:///./test/dummy/frontend/js/models/Article.js","webpack:///./test/dummy/frontend/js/components/user/Article.js","webpack:///./test/dummy/frontend/js/containers/user/ArticleList.js","webpack:///./test/dummy/frontend/js/controllers/user/Articles.js","webpack:///./test/dummy/frontend/js/models/room/Member.js","webpack:///./test/dummy/frontend/js/models/User.js","webpack:///./test/dummy/frontend/js/views/user/rooms/List.js","webpack:///./test/dummy/frontend/js/models/Room.js","webpack:///./test/dummy/frontend/js/views/user/rooms/Show.js","webpack:///./test/dummy/frontend/js/controllers/user/Rooms.js","webpack:///./test/dummy/frontend/js/controllers/User.js","webpack:///./test/dummy/frontend/js/services/NotificationCenter.js","webpack:///./test/dummy/frontend/js/selectors/index.js","webpack:///./test/dummy/frontend/js/selectors/articles.js","webpack:///./test/dummy/frontend/js/components/admin/comment.js","webpack:///./test/dummy/frontend/js/components/admin/CommentList.js","webpack:///./test/dummy/frontend/js/views/admin/articles/Edit.js","webpack:///./test/dummy/frontend/js/views/admin/articles/Form.js","webpack:///./test/dummy/frontend/js/components/admin/Article.js","webpack:///./test/dummy/frontend/js/containers/admin/ArticleList.js","webpack:///./test/dummy/frontend/js/controllers/admin/Articles.js","webpack:///./test/dummy/frontend/js/views/admin/comments/Form.js","webpack:///./test/dummy/frontend/js/controllers/admin/Comments.js","webpack:///./test/dummy/frontend/js/views/admin/sessions/Form.js","webpack:///./test/dummy/frontend/js/controllers/admin/Sessions.js","webpack:///./test/dummy/frontend/js/components/admin/User.js","webpack:///./test/dummy/frontend/js/containers/admin/UserList.js","webpack:///./test/dummy/frontend/js/views/admin/users/Show.js","webpack:///./test/dummy/frontend/js/views/admin/users/Form.js","webpack:///./test/dummy/frontend/js/controllers/admin/Users.js","webpack:///./test/dummy/frontend/js/controllers/Admin.js","webpack:///./test/dummy/frontend/js/components/main/Comment.js","webpack:///./test/dummy/frontend/js/containers/main/articles/CommentList.js","webpack:///./test/dummy/frontend/js/containers/main/articles/CommentsNumber.js","webpack:///./test/dummy/frontend/js/views/main/articles/Show.js","webpack:///./test/dummy/frontend/js/controllers/main/Articles.js","webpack:///./test/dummy/frontend/js/containers/main/pages/LoadMoreLink.js","webpack:///./test/dummy/frontend/js/components/main/Article.js","webpack:///./test/dummy/frontend/js/containers/main/pages/ArticleList.js","webpack:///./test/dummy/frontend/js/controllers/main/Pages.js","webpack:///./test/dummy/frontend/js/views/main/users/UserRegistrationForm.js","webpack:///./test/dummy/frontend/js/controllers/main/Users.js","webpack:///./test/dummy/frontend/js/controllers/Main.js","webpack:///./test/dummy/frontend/js/services/Connectivity.js","webpack:///./test/dummy/frontend/js/initializers/loco.js","webpack:///./test/dummy/frontend/js/validators/Vulgarity.js","webpack:///./test/dummy/frontend/js/validators/index.js","webpack:///./test/dummy/frontend/js/locales/base/pl.js","webpack:///./test/dummy/frontend/js/locales/models/user/pl.js","webpack:///./test/dummy/frontend/js/locales/validators/en.vulgarity.js","webpack:///./test/dummy/frontend/js/locales/validators/pl.vulgarity.js","webpack:///./test/dummy/frontend/js/controllers/index.js","webpack:///./test/dummy/frontend/js/models/index.js","webpack:///./test/dummy/frontend/index.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Rails","start","Flash","opts","notice","alert","warning","hide","text","this","node","document","querySelector","classList","remove","add","textContent","hideAfterTime","time","setTimeout","Views","Base","Disconnection","disconnectedForTooLong","render","ADD_ARTICLES","PREPEND_ARTICLES","REMOVE_ARTICLE","SET_ARTICLES","UPDATE_ARTICLE","ADD_COMMENTS","REMOVE_COMMENT","SET_COMMENTS","UPDATE_COMMENT","PREPEND_USERS","addArticles","articles","type","setArticles","updateArticle","article","index","addComments","comments","articleId","setComments","updateComment","comment","produce","draft","action","concat","filter","id","find","indexOf","users","combineReducers","store","createStore","reducer","User","Show","connectWith","receiver","getElementById","title","content","publishedAt","style","display","_handlePublishing","_updateEditLink","signal","reload","applyChanges","location","href","addEventListener","e","preventDefault","target","put","outerHTML","FlashView","getAttribute","setAttribute","replace","Comment","Models","url","paginate","per","main","param","admin","author","validations","presence","vulgarity","remoteName","createdAt","updatedAt","emotion","pinned","adminRate","approved","commentsForArticle","state","approveLink","isAdmin","useState","approving","setApproving","Services","Date","strftime","handleApproving","updateAttribute","ok","dispatch","CommentModel","className","onClick","data-method","data-confirm","propTypes","PropTypes","instanceOf","isRequired","bool","CommentList","props","useEffect","unsubscribe","subscribe","getState","list","map","number","arrayOf","Form","form","changes","_handleApplyingChanges","UI","for","all","resp","resources","renderElement","mark","_displayChanges","entries","attrib","sel","getAttrRemoteName","Array","from","querySelectorAll","attrName","getAttrName","is","fill","Article","published","exec","addErrorMessage","categoryId","adminReviewStartedAt","now","within","minimum","commentsCount","adminReview","onArticleDestroyed","handleDeletingArticle","confirm","delete","success","ArticleModel","func","ArticleList","Articles","layout","UserLayout","res","flash","setNotice","setAlert","params","message","_renderArticle","_renderComments","FormView","view","renderComments","ShowView","Controllers","Member","console","log","email","format","with","username","password","on","confirmation","passwordConfirmation","confirmed","List","Room","_memberJoined","room_id","_memberLeft","renderedRoom","_renderRoom","room","insertAdjacentHTML","roomNode","parentNode","removeChild","roomId","_membersNode","parseInt","_handleSendingMessage","members","member","renderedMessage","event","keyCode","Env","loco","emit","txt","li","Rooms","setView","renderMembers","assign","NotificationCenter","_pingSignal","_messageSignal","namespaceController","constructor","UserController","_getRoomView","receivedMessage","controller","RoomsController","getView","createFinder","resourceType","parentId","resource","a","findArticle","findComment","Edit","setDefaultValuesForAdminReview","date","toString","editView","_renderComment","commentId","initObj","test","commentFormObj","getObj","Comments","delegator","callbackSuccess","Sessions","user","userId","user_id","ping","UserModel","UserList","setUsers","editLink","Users","Admin","setScope","CommentsNumber","newComment","dateService","textEl","innerHTML","Helpers","Text","simpleFormat","renderArticle","total","LoadMoreLink","page","setPage","noMorePosts","setNoMorePosts","handleClick","currentPage","Pages","UserRegistrationForm","_confirming","_confirmed","Main","articleCreated","abbr","articlePublished","AdminController","articleUpdated","findParams","commentsChanged","diff","article_id","updatedArticle","commentCreated","MainController","commentDestroyed","removeComment","commentUpdated","Connectivity","Deps","cable","createConsumer","connectivity","Loco","notifications","enable","size","postInit","getWire","setPollingTime","init","Vulgarity","val","vulgarWord","_getVulgarWord","RegExp","_addErrorMessage","TypeError","attr","I18n","getLocale","errors","messages","obj","Validators","pl","variants","few","num","Utils","String","last","models","attributes","ui","sending","connection","invalid_data","formats","default","short","long","day_names","abbr_day_names","month_names","abbr_month_names","accepted","blank","empty","equal_to","even","exclusion","greater_than","greater_than_or_equal_to","inclusion","invalid","less_than","less_than_or_equal_to","not_a_number","not_an_integer","odd","present","too_long","many","one","other","too_short","wrong_length","other_than","en","Channels"],"mappings":"aACE,SAASA,EAAqBC,G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O,CACZ+H,oBACAlK","file":"application.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([158,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import Rails from \"@rails/ujs\";\n\nRails.start();\n","import { Views } from \"loco-js\";\n\nclass Flash extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.notice = opts.notice;\n this.alert = opts.alert;\n this.warning = opts.warning;\n this.hide = opts.hide;\n }\n\n setNotice(text) {\n this.notice = text;\n }\n setAlert(text) {\n this.alert = text;\n }\n setWarning(text) {\n this.warning = text;\n }\n\n render() {\n const node = document.querySelector(\".flash\");\n node.classList.remove(\"notice\");\n node.classList.remove(\"alert\");\n node.classList.remove(\"warning\");\n if (this.notice != null) {\n node.classList.add(\"notice\");\n document.querySelector(\".flash p\").textContent = this.notice;\n } else if (this.alert != null) {\n node.classList.add(\"alert\");\n document.querySelector(\".flash p\").textContent = this.alert;\n } else if (this.warning != null) {\n node.classList.add(\"warning\");\n document.querySelector(\".flash p\").textContent = this.warning;\n }\n node.classList.remove(\"none\"); // slideDown initially\n if (this.hide) this.hideAfterTime();\n }\n\n hideAfterTime(time = 4000) {\n setTimeout(() => {\n document.querySelector(\".flash\").classList.add(\"none\"); // slideUp initially\n }, time);\n }\n}\n\nexport default Flash;\n","import Flash from \"views/shared/Flash\";\n\nconst Disconnection = {\n disconnectedForTooLong() {\n const msg =\n \"You have been disconnected from the server for too long. Reload page!\";\n const view = new Flash({ alert: msg, hide: false });\n view.render();\n }\n};\n\nexport default Disconnection;\n","/*\n * action types\n */\n\nexport const ADD_ARTICLES = \"ADD_ARTICLES\";\nexport const PREPEND_ARTICLES = \"PREPEND_ARTICLES\";\nexport const REMOVE_ARTICLE = \"REMOVE_ARTICLE\";\nexport const SET_ARTICLES = \"SET_ARTICLES\";\nexport const UPDATE_ARTICLE = \"UPDATE_ARTICLE\";\n\nexport const ADD_COMMENTS = \"ADD_COMMENTS\";\nexport const REMOVE_COMMENT = \"REMOVE_COMMENT\";\nexport const SET_COMMENTS = \"SET_COMMENTS\";\nexport const UPDATE_COMMENT = \"UPDATE_COMMENT\";\n\nexport const PREPEND_USERS = \"PREPEND_USERS\";\nexport const SET_USERS = \"SET_USERS\";\n\n/*\n * action creators\n */\n\nexport function addArticles(articles) {\n return { type: ADD_ARTICLES, articles };\n}\n\nexport function prependArticles(articles) {\n return { type: PREPEND_ARTICLES, articles };\n}\n\nexport function removeArticle(id) {\n return { type: REMOVE_ARTICLE, id };\n}\n\nexport function setArticles(articles) {\n return { type: SET_ARTICLES, articles };\n}\n\nexport function updateArticle(article, index) {\n return { type: UPDATE_ARTICLE, article, index };\n}\n\nexport function addComments(comments, articleId) {\n return { type: ADD_COMMENTS, articleId, comments };\n}\n\nexport function removeComment(id, articleId) {\n return { type: REMOVE_COMMENT, id, articleId };\n}\n\nexport function setComments(comments, articleId) {\n return { type: SET_COMMENTS, comments, articleId };\n}\n\nexport function updateComment(comment, articleId, index) {\n return { type: UPDATE_COMMENT, comment, articleId, index };\n}\n\nexport function prependUsers(users) {\n return { type: PREPEND_USERS, users };\n}\n\nexport function setUsers(users) {\n return { type: PREPEND_USERS, users };\n}\n","import produce from \"immer\";\n\nimport {\n ADD_ARTICLES,\n PREPEND_ARTICLES,\n REMOVE_ARTICLE,\n SET_ARTICLES,\n UPDATE_ARTICLE\n} from \"actions\";\n\nexport default produce((draft = [], action) => {\n switch (action.type) {\n case ADD_ARTICLES:\n return draft.concat(action.articles);\n case PREPEND_ARTICLES:\n return action.articles.concat(draft);\n case REMOVE_ARTICLE:\n return draft.filter(article => article.id !== action.id);\n case SET_ARTICLES:\n return action.articles;\n case UPDATE_ARTICLE:\n draft[action.index] = action.article;\n break;\n default:\n return draft;\n }\n});\n","import produce from \"immer\";\n\nimport {\n ADD_COMMENTS,\n REMOVE_COMMENT,\n SET_COMMENTS,\n UPDATE_COMMENT\n} from \"actions\";\n\nexport default produce((draft = {}, action) => {\n switch (action.type) {\n case ADD_COMMENTS:\n draft[action.articleId] = draft[action.articleId].concat(action.comments);\n break;\n case REMOVE_COMMENT:\n if (draft[action.articleId] == null) return draft;\n draft[action.articleId] = draft[action.articleId].filter(\n comment => comment.id !== action.id\n );\n break;\n case SET_COMMENTS:\n draft[action.articleId] = action.comments;\n break;\n case UPDATE_COMMENT: {\n const articleId = action.articleId;\n let index = action.index;\n if (!index) {\n const comment = draft[articleId].find(c => c.id === action.comment.id);\n index = draft[articleId].indexOf(comment);\n }\n draft[articleId][index] = action.comment;\n break;\n }\n default:\n return draft;\n }\n});\n","import produce from \"immer\";\n\nimport { PREPEND_USERS, SET_USERS } from \"actions\";\n\nexport default produce((draft = [], action) => {\n switch (action.type) {\n case SET_USERS:\n return action.users;\n case PREPEND_USERS:\n return action.users.concat(draft);\n default:\n return draft;\n }\n});\n","import { combineReducers } from \"redux\";\n\nimport articles from \"./articles\";\nimport comments from \"./comments\";\nimport users from \"./users\";\n\nexport default combineReducers({\n articles,\n comments,\n users\n});\n","import { createStore } from \"redux\";\n\nimport reducer from \"reducers\";\n\nconst store = createStore(reducer);\n\nexport default store;\n","import { Views } from \"loco-js\";\n\nclass User extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n}\n\nexport default User;\n","import { Views } from \"loco-js\";\n\nimport FlashView from \"views/shared/Flash\";\n\nclass Show extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.article = null;\n }\n\n render(article = null) {\n if (this.article == null) {\n this.connectWith(article, { receiver: \"articleReceivedSignal\" });\n this.article = article;\n }\n document.getElementById(\"article_title\").textContent = this.article.title;\n document.getElementById(\"article_text\").textContent = this.article.content;\n const node = document.getElementById(\"publish_article\");\n if (node && this.article.publishedAt != null) node.style.display = \"none\";\n else if (node) node.style.display = \"\";\n this._handlePublishing();\n this._updateEditLink();\n }\n\n async articleReceivedSignal(signal) {\n switch (signal) {\n case \"updated\":\n await this.article.reload();\n this.article.applyChanges();\n this.render();\n break;\n case \"destroyed\":\n window.location.href = \"/user/articles?message=deleted\";\n }\n }\n\n _handlePublishing() {\n document\n .getElementById(\"publish_article\")\n .addEventListener(\"click\", async e => {\n e.preventDefault();\n e.target.textContent = \"Publishing...\";\n try {\n await this.article.put(\"publish\");\n document.getElementById(\"publish_article\").outerHTML =\n \"Published!\";\n } catch (err) {\n document.getElementById(\"publish_article\").textContent = \"Publish\";\n const flash = new FlashView({ alert: \"Connection error!\" });\n flash.render();\n }\n });\n }\n\n _updateEditLink() {\n const href = document.getElementById(\"edit_link\").getAttribute(\"href\");\n document\n .getElementById(\"edit_link\")\n .setAttribute(\"href\", href.replace(\"/0/\", `/${this.article.id}/`));\n }\n}\n\nexport default Show;\n","import { Models } from \"loco-js\";\n\nclass Comment extends Models.Base {\n static identity = \"Article.Comment\";\n\n static remoteName = \"Comment\";\n\n static resources = {\n url: \"/user/articles/:articleId/comments\",\n paginate: { per: 10 },\n main: {\n url: \"/articles/:articleId/comments\",\n paginate: { per: 5, param: \"page-num\" }\n },\n admin: {\n url: \"/admin/articles/:articleId/comments\",\n paginate: { per: 5 }\n }\n };\n\n static attributes = {\n author: {\n validations: {\n presence: true\n }\n },\n text: {\n validations: {\n presence: true,\n vulgarity: true\n }\n },\n articleId: {\n type: \"Int\",\n validations: {\n presence: true\n },\n remoteName: \"article_id\"\n },\n createdAt: {\n type: \"Date\",\n remoteName: \"created_at\"\n },\n updatedAt: {\n type: \"Date\",\n remoteName: \"updated_at\"\n },\n emotion: {\n type: \"Int\"\n },\n pinned: {\n type: \"Boolean\"\n },\n adminRate: {\n type: \"Int\",\n remoteName: \"admin_rate\"\n },\n approved: {\n type: \"Boolean\"\n }\n };\n\n constructor(data) {\n super(data);\n }\n}\n\nexport default Comment;\n","export const commentsForArticle = (state, articleId) => {\n return state.comments[articleId];\n};\n","import React, { useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Services } from \"loco-js\";\n\nimport { updateComment } from \"actions\";\nimport store from \"store\";\n\nimport CommentModel from \"models/article/Comment\";\n\nfunction Comment({ comment, isAdmin = false }) {\n const [approving, setApproving] = useState(false);\n\n const createdAt = new Services.Date(comment.createdAt).strftime(\"%d %b %y\");\n\n const handleApproving = async e => {\n e.preventDefault();\n setApproving(true);\n comment.approved = true;\n const res = await comment.updateAttribute(\"approved\");\n if (!res.ok) return;\n store.dispatch(\n updateComment(\n new CommentModel({ ...comment, approved: true }),\n comment.articleId\n )\n );\n };\n\n const adminSection = () => {\n let approveLink;\n\n if (comment.approved) {\n approveLink = (\n <>\n approved |{\" \"}\n \n );\n } else if (approving) {\n approveLink = (\n <>\n approving... |{\" \"}\n \n );\n } else {\n approveLink = (\n <>\n \n approve\n {\" \"}\n |{\" \"}\n \n );\n }\n\n return (\n <>\n {\" \"}\n ({approveLink}\n \n edit\n {\" \"}\n |{\" \"}\n \n delete\n \n )\n \n );\n };\n\n return (\n

\n {comment.author} on {createdAt}\n {isAdmin ? adminSection() : \"\"}\n
\n {comment.text}\n

\n );\n}\n\nComment.propTypes = {\n comment: PropTypes.instanceOf(CommentModel).isRequired,\n isAdmin: PropTypes.bool\n};\n\nexport default Comment;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport { commentsForArticle } from \"selectors/comments\";\nimport Comment from \"containers/user/Comment\";\nimport CommentModel from \"models/article/Comment\";\n\nfunction CommentList(props) {\n const articleId = props.articleId;\n const isAdmin = props.isAdmin || false;\n const [comments, setComments] = useState(props.comments);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() =>\n setComments(commentsForArticle(store.getState(), articleId))\n );\n\n return () => {\n unsubscribe();\n };\n });\n\n if (comments.length === 0) return

No comments.

;\n\n const list = comments.map(comment => (\n \n ));\n\n return <>{list};\n}\n\nCommentList.propTypes = {\n articleId: PropTypes.number.isRequired,\n isAdmin: PropTypes.bool,\n comments: PropTypes.arrayOf(PropTypes.instanceOf(CommentModel)).isRequired\n};\n\nexport default CommentList;\n","import React from \"react\";\nimport { render as renderElement } from \"react-dom\";\nimport { UI, Views } from \"loco-js\";\n\nimport { addArticles, setComments } from \"actions\";\nimport store from \"store\";\n\nimport Comment from \"models/article/Comment\";\n\nimport FlashView from \"views/shared/Flash\";\n\nimport CommentList from \"containers/user/CommentList\";\n\nclass Form extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.article = null;\n this.form = null;\n this.changes = null;\n }\n\n render(article) {\n store.dispatch(addArticles([article]));\n this.article = article;\n this.connectWith(this.article);\n this._handleApplyingChanges();\n this.form = new UI.Form({ for: this.article });\n this.form.render();\n }\n\n async renderComments(articleId) {\n const resp = await Comment.all({ articleId: articleId });\n store.dispatch(setComments(resp.resources, articleId));\n renderElement(\n ,\n document.getElementById(\"comments\")\n );\n }\n\n async receivedSignal(signal, data) {\n switch (signal) {\n case \"updating\":\n if (\n document.querySelector(\"h1\").getAttribute(\"data-mark\") !== data.mark\n ) {\n const flash = new FlashView({\n warning: \"Uuups someone else started editing this article.\"\n });\n flash.render();\n }\n break;\n case \"updated\":\n await this.article.reload();\n this.changes = this.article.changes();\n this._displayChanges();\n break;\n case \"destroyed\":\n window.location.href = \"/user/articles?message=deleted\";\n }\n }\n\n _displayChanges() {\n for (const [attrib] of Object.entries(this.changes)) {\n const sel = document.querySelector(\n `a.apply_changes[data-for=${this.article.getAttrRemoteName(attrib)}]`\n );\n if (!sel) continue;\n sel.classList.remove(\"none\");\n }\n }\n\n _handleApplyingChanges() {\n for (const sel of Array.from(\n document.querySelectorAll(\"a.apply_changes\")\n )) {\n sel.addEventListener(\"click\", e => {\n e.preventDefault();\n const attrName = this.article.getAttrName(\n e.target.getAttribute(\"data-for\")\n );\n this.article[attrName] = this.changes[attrName].is;\n this.form.fill(attrName);\n e.target.classList.add(\"none\");\n });\n }\n }\n}\n\nexport default Form;\n","import { Models } from \"loco-js\";\n\nclass Article extends Models.Base {\n static identity = \"Article\";\n\n static resources = {\n url: \"/user/articles\",\n paginate: { per: 5 },\n main: {\n url: \"/articles\",\n paginate: { per: 3 }\n },\n admin: {\n url: \"/admin/articles\",\n paginate: { per: 4 }\n }\n };\n\n static attributes = {\n title: {\n validations: {\n presence: true,\n length: { within: [3, 255] }\n }\n },\n content: {\n validations: {\n presence: true,\n length: { minimum: 100 }\n },\n remoteName: \"text\"\n },\n createdAt: {\n type: \"Date\",\n remoteName: \"created_at\"\n },\n updatedAt: {\n type: \"Date\",\n remoteName: \"updated_at\"\n },\n commentsCount: {\n type: \"Int\",\n remoteName: \"comments_count\"\n },\n publishedAt: {\n type: \"Date\",\n remoteName: \"published_at\"\n },\n published: {},\n adminReview: {\n remoteName: \"admin_review\"\n },\n adminRate: {\n type: \"Int\",\n remoteName: \"admin_rate\"\n },\n categoryId: {\n type: \"Int\",\n remoteName: \"category_id\"\n },\n adminReviewStartedAt: {\n remoteName: \"admin_review_started_at\"\n }\n };\n\n static validate = [\"vulgarityLevel\"];\n\n constructor(data) {\n super(data);\n this.published = this.publishedAt == null ? false : true;\n }\n\n vulgarityLevel() {\n if (\n (this.title != null && /fuck/i.exec(this.title)) ||\n (this.content != null && /fuck/i.exec(this.content))\n )\n this.addErrorMessage(\"Article contains strong language.\", {\n for: \"base\"\n });\n }\n\n setDefaultValuesForAdminReview() {\n this.adminRate = this.adminRate == null ? 3 : this.adminRate;\n this.categoryId = this.categoryId == null ? 6 : this.categoryId;\n this.adminReviewStartedAt = Date.now();\n }\n}\n\nexport default Article;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport ArticleModel from \"models/Article\";\n\nimport { removeArticle } from \"actions\";\nimport store from \"store\";\n\nfunction Article({ article, onArticleDestroyed }) {\n const handleDeletingArticle = async e => {\n e.preventDefault();\n if (!confirm(\"Are you sure?\")) return;\n const data = await article.delete(null);\n if (data.success) {\n store.dispatch(removeArticle(data.id));\n }\n onArticleDestroyed(data);\n };\n\n return (\n \n {article.title}\n {article.content}\n {article.commentsCount}\n {article.publishedAt ? \"yes\" : \"no\"}\n \n Show |\n Edit |\n \n Delete\n \n \n \n );\n}\n\nArticle.propTypes = {\n article: PropTypes.instanceOf(ArticleModel).isRequired,\n onArticleDestroyed: PropTypes.func.isRequired\n};\n\nexport default Article;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport Article from \"components/user/Article\";\nimport ArticleModel from \"models/Article\";\n\nfunction ArticleList(props) {\n const [articles, setArticles] = useState(props.articles);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() =>\n setArticles(store.getState().articles)\n );\n\n return () => {\n unsubscribe();\n };\n });\n\n const list = articles.map(article => (\n \n ));\n\n return <>{list};\n}\n\nArticleList.propTypes = {\n articles: PropTypes.arrayOf(PropTypes.instanceOf(ArticleModel)).isRequired,\n onArticleDestroyed: PropTypes.func.isRequired\n};\n\nexport default ArticleList;\n","import React from \"react\";\nimport { render } from \"react-dom\";\nimport { Controllers } from \"loco-js\";\n\nimport { setArticles, setComments } from \"actions\";\nimport store from \"store\";\n\nimport UserLayout from \"views/layouts/User\";\nimport FlashView from \"views/shared/Flash\";\nimport ShowView from \"views/user/articles/Show\";\nimport FormView from \"views/user/articles/Form\";\n\nimport Article from \"models/Article\";\nimport Comment from \"models/article/Comment\";\n\nimport ArticleList from \"containers/user/ArticleList\";\nimport CommentList from \"containers/user/CommentList\";\n\nclass Articles extends Controllers.Base {\n initialize() {\n this.layout = new UserLayout();\n }\n\n onArticleDestroyed(res) {\n const flash = new FlashView();\n if (res.success) flash.setNotice(res.notice);\n else flash.setAlert(res.alert);\n flash.render();\n }\n\n async index() {\n if (this.params.message === \"deleted\") {\n const flash = new FlashView({ alert: \"Article has been deleted.\" });\n flash.render();\n }\n const resp = await Article.get(\"all\");\n store.dispatch(setArticles(resp.resources));\n render(\n ,\n document.getElementById(\"article_list\")\n );\n }\n\n async show() {\n this._renderArticle();\n this._renderComments();\n }\n\n new() {\n new FormView().render(new Article());\n }\n\n async edit() {\n const view = new FormView();\n view.renderComments(this.params.id);\n const article = await Article.find(this.params.id);\n view.render(article);\n }\n\n async _renderArticle() {\n const article = await Article.find(this.params.id);\n store.dispatch(setArticles([article]));\n new ShowView().render(article);\n }\n\n async _renderComments() {\n const resp = await Comment.all({ articleId: this.params.id });\n store.dispatch(setComments(resp.resources, this.params.id));\n render(\n ,\n document.getElementById(\"comments\")\n );\n }\n}\n\nexport default Articles;\n","import { Models } from \"loco-js\";\n\nclass Member extends Models.Base {\n static identity = \"Room.Member\";\n\n static resources = {\n url: \"/user/rooms/:roomId/members\",\n paginate: { per: 100 }\n };\n\n static attributes = {};\n\n static validate = [];\n\n constructor(data) {\n super(data);\n }\n}\n\nexport default Member;\n","import { Models } from \"loco-js\";\n\nclass User extends Models.Base {\n static identity = \"User\";\n\n static resources = {\n url: \"/users\",\n admin: {\n url: \"/admin/users\"\n }\n };\n\n static paginate = { per: 10 };\n\n static attributes = {\n email: {\n validations: {\n presence: true,\n format: { with: /^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/i }\n }\n },\n username: {\n validations: {\n presence: true,\n format: { with: /^[a-z][a-z0-9_-]*$/i }\n }\n },\n password: {\n validations: {\n presence: { on: \"create\" },\n confirmation: true\n }\n },\n passwordConfirmation: {\n remoteName: \"password_confirmation\"\n },\n confirmed: {},\n createdAt: {\n type: \"Date\",\n remoteName: \"created_at\"\n },\n updatedAt: {\n type: \"Date\",\n remoteName: \"updated_at\"\n }\n };\n\n static receivedSignal(signal) {\n console.log(`User.receivedSignal: ${signal}`);\n }\n\n constructor(data) {\n super(data);\n }\n\n receivedSignal(signal) {\n console.log(`User#receivedSignal: ${signal}`);\n }\n}\n\nexport default User;\n","import { Views } from \"loco-js\";\n\nimport Room from \"models/User\";\n\nclass List extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n render() {\n this.connectWith(Room);\n }\n\n receivedSignal(signal, data) {\n switch (signal) {\n case \"Room member_joined\":\n this._memberJoined(data.room_id);\n break;\n case \"Room member_left\":\n this._memberLeft(data.room_id);\n break;\n case \"Room created\": {\n const renderedRoom = this._renderRoom(data.room);\n document\n .getElementById(\"rooms_list\")\n .insertAdjacentHTML(\"beforeend\", renderedRoom);\n break;\n }\n case \"Room destroyed\": {\n const roomNode = document.getElementById(`room_${data.room_id}`);\n roomNode.parentNode.removeChild(roomNode);\n }\n }\n }\n\n _memberJoined(roomId) {\n const node = this._membersNode(roomId);\n node.textContent = parseInt(node.text()) + 1;\n }\n\n _memberLeft(roomId) {\n const node = this._membersNode(roomId);\n node.textContent = parseInt(node.text()) - 1;\n }\n\n _membersNode(roomId) {\n document.querySelector(`#room_${roomId} td.members`);\n }\n\n _renderRoom(room) {\n `\n \n ${room.name}\n 0\n \n Join |\n Destroy\n \n \n `;\n }\n}\n\nexport default List;\n","import { Models } from \"loco-js\";\n\nclass Room extends Models.Base {\n static identity = \"Room\";\n\n static resources = {};\n\n static attributes = {};\n\n static validate = [];\n\n constructor(data) {\n super(data);\n }\n}\n\nexport default Room;\n","import { Env, Views } from \"loco-js\";\n\nimport Room from \"models/Room\";\n\nclass Show extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.roomId = opts.id;\n }\n\n render() {\n this.connectWith(Room);\n this._handleSendingMessage();\n }\n\n renderMembers(members) {\n for (const member of members) {\n this._memberJoined(member);\n }\n }\n\n receivedMessage(message, author) {\n const renderedMessage = `

${author}: ${message}

`;\n document\n .getElementById(\"messages\")\n .insertAdjacentHTML(\"beforeend\", renderedMessage);\n }\n\n receivedSignal(signal, data) {\n switch (signal) {\n case \"Room member_joined\":\n if (data.room_id !== this.roomId) return;\n this._memberJoined(data.member);\n break;\n case \"Room member_left\":\n if (data.room_id !== this.roomId) return;\n this._memberLeft(data.member);\n }\n }\n\n _handleSendingMessage() {\n document\n .querySelector(\"[data-behavior~=room-speaker]\")\n .addEventListener(\"keypress\", event => {\n if (event.keyCode !== 13) return;\n event.preventDefault();\n Env.loco.emit({\n signal: \"message\",\n txt: event.target.value,\n room_id: this.roomId\n });\n event.target.value = \"\";\n });\n }\n\n _memberJoined(member) {\n const li = `
  • ${member.username}
  • `;\n document.getElementById(\"members\").insertAdjacentHTML(\"beforeend\", li);\n }\n\n _memberLeft(member) {\n const node = document.querySelector(`#members li#user_${member.id}`);\n node.parentNode.removeChild(node);\n }\n}\n\nexport default Show;\n","import { Controllers } from \"loco-js\";\n\nimport Member from \"models/room/Member\";\n\nimport List from \"views/user/rooms/List\";\nimport Show from \"views/user/rooms/Show\";\n\nclass Rooms extends Controllers.Base {\n initialize() {}\n\n index() {\n new List().render();\n }\n\n async show() {\n const view = new Show({ id: this.params.id });\n this.setView(\"show\", view);\n view.render();\n const resp = await Member.all({ roomId: this.params.id });\n view.renderMembers(resp.resources);\n }\n}\n\nexport default Rooms;\n","import { Controllers } from \"loco-js\";\n\nimport Disconnection from \"./concerns/Disconnection\";\nimport Articles from \"./user/Articles\";\nimport Rooms from \"./user/Rooms\";\n\nObject.assign(Controllers.Base.prototype, Disconnection);\n\nclass User extends Controllers.Base {}\n\nObject.assign(User, {\n Articles,\n Rooms\n});\n\nexport default User;\n","import { Env } from \"loco-js\";\n\nimport UserController from \"controllers/User\";\nimport RoomsController from \"controllers/user/Rooms\";\n\nclass NotificationCenter {\n receivedSignal(data) {\n switch (data.signal) {\n case \"ping\":\n this._pingSignal();\n break;\n case \"message\":\n this._messageSignal(data);\n }\n }\n\n _pingSignal() {\n if (Env.namespaceController.constructor !== UserController) return;\n alert(\"Ping!\");\n }\n\n _messageSignal(data) {\n const view = this._getRoomView();\n if (!view) return;\n view.receivedMessage(data.message, data.author);\n }\n\n _getRoomView() {\n if (Env.namespaceController.constructor !== UserController) return false;\n if (Env.controller.constructor !== RoomsController) return false;\n if (Env.action !== \"show\") return false;\n return Env.controller.getView(\"show\");\n }\n}\n\nexport default NotificationCenter;\n","export const createFinder = resourceType => {\n return function find(state, id, opts = {}) {\n let resources = state[resourceType];\n if (opts.parentId) resources = resources[opts.parentId];\n const resource = resources.find(a => a.id === id);\n if (!resource) return [null, null];\n const index = resources.indexOf(resource);\n return [resource, index];\n };\n};\n","import { createFinder } from \"./index\";\n\nexport const findArticle = createFinder(\"articles\");\n\nexport const findComment = createFinder(\"comments\");\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Services } from \"loco-js\";\n\nimport CommentModel from \"models/article/Comment\";\n\nfunction Comment({ comment }) {\n const createdAt = new Services.Date(comment.createdAt).strftime(\"%d %b %y\");\n\n return (\n

    \n {comment.author} on {createdAt} (\n \n edit\n \n )\n
    \n {comment.text}\n

    \n );\n}\n\nComment.propTypes = {\n comment: PropTypes.instanceOf(CommentModel).isRequired\n};\n\nexport default Comment;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport CommentModel from \"models/article/Comment\";\nimport Comment from \"components/admin/comment\";\n\nfunction CommentList({ comments }) {\n if (comments.length === 0) {\n return

    No comments

    ;\n }\n return (\n <>\n {comments.map(comment => (\n \n ))}\n \n );\n}\n\nCommentList.propTypes = {\n comments: PropTypes.arrayOf(PropTypes.instanceOf(CommentModel)).isRequired\n};\n\nexport default CommentList;\n","import React from \"react\";\nimport { render as renderElement } from \"react-dom\";\nimport { Views } from \"loco-js\";\n\nimport CommentList from \"components/admin/CommentList\";\n\nclass Edit extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.article = null;\n }\n\n async receivedSignal(signal) {\n switch (signal) {\n case \"updated\":\n await this.article.reload();\n this.article.applyChanges();\n this._renderArticle();\n }\n }\n\n render(article) {\n this.article = article;\n this.connectWith(article);\n this._renderArticle();\n }\n\n renderComments(comments) {\n renderElement(\n ,\n document.getElementById(\"comments\")\n );\n }\n\n _renderArticle() {\n document.getElementById(\"article_author\").textContent = this.article.author;\n document.getElementById(\"article_title\").textContent = this.article.title;\n document.getElementById(\"article_text\").textContent = this.article.content;\n }\n}\n\nexport default Edit;\n","import { Views, UI } from \"loco-js\";\n\nclass Form extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n render(article) {\n article.setDefaultValuesForAdminReview();\n const form = new UI.Form({ id: \"edit_article_form\", for: article });\n form.render();\n }\n}\n\nexport default Form;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Services } from \"loco-js\";\n\nimport ArticleModel from \"models/Article\";\n\nfunction Article({ article }) {\n const date = new Services.Date(article.publishedAt).toString(\"short\");\n\n return (\n
    \n

    {article.title}

    \n

    \n \n {article.author} wrote this on {date} /{\" \"}\n \n {article.commentsCount} comment\n {article.commentsCount === 1 ? \"\" : \"s\"}\n \n \n

    \n

    {article.content}

    \n

    \n Review\n

    \n
    \n );\n}\n\nArticle.propTypes = {\n article: PropTypes.instanceOf(ArticleModel).isRequired\n};\n\nexport default Article;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport Article from \"components/admin/Article\";\nimport ArticleModel from \"models/Article\";\n\nfunction ArticleList(props) {\n const [articles, setArticles] = useState(props.articles);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() =>\n setArticles(store.getState().articles)\n );\n\n return () => {\n unsubscribe();\n };\n });\n\n const list = articles.map(article => (\n
    \n ));\n\n return <>{list};\n}\n\nArticleList.propTypes = {\n articles: PropTypes.arrayOf(PropTypes.instanceOf(ArticleModel)).isRequired\n};\n\nexport default ArticleList;\n","import React from \"react\";\nimport { render } from \"react-dom\";\nimport { Controllers } from \"loco-js\";\n\nimport { setArticles } from \"actions\";\nimport store from \"store\";\n\nimport Article from \"models/Article\";\nimport Comment from \"models/article/Comment\";\nimport Edit from \"views/admin/articles/Edit\";\nimport Form from \"views/admin/articles/Form\";\n\nimport ArticleList from \"containers/admin/ArticleList\";\n\nclass Articles extends Controllers.Base {\n async published() {\n const resp = await Article.get(\"published\");\n store.dispatch(setArticles(resp.resources));\n render(\n ,\n document.getElementById(\"articles\")\n );\n }\n\n async edit() {\n const editView = new Edit();\n this._renderArticle(editView);\n this._renderComment(editView);\n }\n\n async _renderArticle(view) {\n const article = await Article.find(this.params.id);\n view.render(article);\n new Form().render(article);\n }\n\n async _renderComment(view) {\n const resp = await Comment.all({ articleId: this.params.id });\n view.renderComments(resp.resources);\n }\n}\n\nexport default Articles;\n","import { Env, UI, Views } from \"loco-js\";\n\nimport CommentModel from \"models/article/Comment\";\n\nclass Form extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n render(opts = {}) {\n const form = new UI.Form({\n for: new CommentModel({ id: opts.commentId, resource: \"admin\" }),\n id: `edit_comment_${opts.commentId}`,\n initObj: true\n });\n form.render();\n\n // only for testing purpose\n Env.test = { commentFormObj: form.getObj() };\n }\n}\n\nexport default Form;\n","import { Controllers } from \"loco-js\";\n\nimport Form from \"views/admin/comments/Form\";\n\nclass Comments extends Controllers.Base {\n edit() {\n new Form().render({ commentId: this.params.id });\n }\n}\n\nexport default Comments;\n","import { UI, Views } from \"loco-js\";\n\nclass Form extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n render() {\n const form = new UI.Form({\n id: \"sign_in_admin\",\n delegator: this,\n callbackSuccess: \"_signedIn\"\n });\n form.render();\n }\n\n _signedIn() {\n window.location.href = \"/admin\";\n }\n}\n\nexport default Form;\n","import { Controllers } from \"loco-js\";\n\nimport Form from \"views/admin/sessions/Form\";\n\nclass Sessions extends Controllers.Base {\n new() {\n new Form().render();\n }\n}\n\nexport default Sessions;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Env } from \"loco-js\";\n\nimport UserModel from \"models/User\";\n\nconst User = ({ user }) => {\n const ping = (e, userId) => {\n e.preventDefault();\n Env.loco.emit({ signal: \"ping\", user_id: userId });\n };\n\n return (\n \n {user.email}\n {user.username}\n {user.confirmed ? \"Yes\" : \"No\"}\n \n Show |{\" \"}\n Edit |{\" \"}\n \n Delete\n {\" \"}\n |{\" \"}\n ping(e, user.id)}>\n Ping\n \n \n \n );\n};\n\nUser.propTypes = {\n user: PropTypes.instanceOf(UserModel).isRequired\n};\n\nexport default User;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport User from \"components/admin/User\";\nimport UserModel from \"models/User\";\n\nfunction UserList(props) {\n const [users, setUsers] = useState(props.users);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() => setUsers(store.getState().users));\n\n return () => {\n unsubscribe();\n };\n });\n\n const list = users.map(user => );\n\n return <>{list};\n}\n\nUserList.propTypes = {\n users: PropTypes.arrayOf(PropTypes.instanceOf(UserModel)).isRequired\n};\n\nexport default UserList;\n","import { Views } from \"loco-js\";\n\nclass Show extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.user = opts.user;\n }\n\n render() {\n document.getElementById(\"user_email\").textContent = this.user.email;\n document.getElementById(\"user_username\").textContent = this.user.username;\n document.getElementById(\"user_confirmed\").textContent = this.user.confirmed\n ? \"Yes\"\n : \"No\";\n this._updateEditLink();\n }\n\n _updateEditLink() {\n const editLink = document.getElementById(\"edit_link\");\n const href = editLink.getAttribute(\"href\");\n editLink.setAttribute(\"href\", href.replace(\"/0/\", \"/#{@user.id}/\"));\n }\n}\n\nexport default Show;\n","import { UI, Views } from \"loco-js\";\n\nclass Form extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.user = opts.user;\n }\n\n render() {\n const form = new UI.Form({\n for: this.user,\n initObj: true,\n id: \"admin_user_form\"\n });\n form.render();\n }\n}\n\nexport default Form;\n","import React from \"react\";\nimport { render as renderElement } from \"react-dom\";\nimport { Controllers } from \"loco-js\";\n\nimport { setUsers } from \"actions\";\nimport store from \"store\";\n\nimport User from \"models/User\";\nimport UserList from \"containers/admin/UserList\";\nimport Show from \"views/admin/users/Show\";\nimport Form from \"views/admin/users/Form\";\n\nclass Users extends Controllers.Base {\n async index() {\n const resp = await User.get(\"all\");\n store.dispatch(setUsers(resp.resources));\n renderElement(\n ,\n document.querySelector(\"table tbody\")\n );\n }\n\n async show() {\n const user = await User.find(this.params.id);\n new Show({ user: user }).render();\n }\n\n edit() {\n const view = new Form({ user: new User({ id: this.params.id }) });\n view.render();\n }\n}\n\nexport default Users;\n","import { Controllers } from \"loco-js\";\n\nimport Disconnection from \"./concerns/Disconnection\";\nimport Articles from \"./admin/Articles\";\nimport Comments from \"./admin/Comments\";\nimport Sessions from \"./admin/Sessions\";\nimport Users from \"./admin/Users\";\n\nObject.assign(Controllers.Base.prototype, Disconnection);\n\nclass Admin extends Controllers.Base {\n initialize() {\n this.setScope(\"admin\");\n }\n}\n\nObject.assign(Admin, {\n Articles,\n Comments,\n Sessions,\n Users\n});\n\nexport default Admin;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Services } from \"loco-js\";\n\nimport CommentModel from \"models/article/Comment\";\n\nfunction Comment({ comment }) {\n const createdAt = new Services.Date(comment.createdAt).strftime(\"%d %b %y\");\n\n return (\n

    \n {comment.author} on {createdAt} wrote:\n
    \n {comment.text}\n

    \n );\n}\n\nComment.propTypes = {\n comment: PropTypes.instanceOf(CommentModel).isRequired\n};\n\nexport default Comment;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport { commentsForArticle } from \"selectors/comments\";\nimport Comment from \"components/main/Comment\";\nimport CommentModel from \"models/article/Comment\";\n\nfunction CommentList(props) {\n const articleId = props.articleId;\n const [comments, setComments] = useState(props.comments);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() => {\n setComments(commentsForArticle(store.getState(), articleId));\n });\n\n return () => {\n unsubscribe();\n };\n });\n\n const list = comments.map(comment => (\n \n ));\n\n if (comments.length === 0) {\n return

    No comments.

    ;\n }\n\n return <>{list};\n}\n\nCommentList.propTypes = {\n articleId: PropTypes.number.isRequired,\n comments: PropTypes.arrayOf(PropTypes.instanceOf(CommentModel)).isRequired\n};\n\nexport default CommentList;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport { commentsForArticle } from \"selectors/comments\";\nimport CommentModel from \"models/article/Comment\";\n\nfunction CommentsNumber(props) {\n const [comments, setComments] = useState(props.comments);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() => {\n setComments(commentsForArticle(store.getState(), props.articleId));\n });\n\n return () => {\n unsubscribe();\n };\n });\n\n return <>{`${comments.length} comment${comments.length === 1 ? \"\" : \"s\"}`};\n}\n\nCommentsNumber.propTypes = {\n articleId: PropTypes.number.isRequired,\n comments: PropTypes.arrayOf(PropTypes.instanceOf(CommentModel)).isRequired\n};\n\nexport default CommentsNumber;\n","import { Helpers, Services, UI, Views } from \"loco-js\";\n\nimport Flash from \"views/shared/Flash\";\n\nclass Show extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n this.article = null;\n this.newComment = opts.comment;\n }\n\n render() {\n const form = new UI.Form({\n for: this.newComment,\n initObj: true,\n id: \"new_comment\"\n });\n form.render();\n }\n\n renderArticle(article = null) {\n if (!this.article) {\n this.article = article;\n this.connectWith(this.article, { receiver: \"_articleReceivedSignal\" });\n }\n document.getElementById(\"title\").textContent = this.article.title;\n document.getElementById(\"author\").textContent = this.article.author;\n const dateService = new Services.Date(this.article.publishedAt);\n document.getElementById(\"pub_date\").textContent = dateService.toString(\n \"short\"\n );\n const textEl = document.getElementById(\"text\");\n textEl.innerHTML = \"\";\n const text = new Helpers.Text().simpleFormat(this.article.content);\n textEl.insertAdjacentHTML(\"beforeend\", text);\n }\n\n async _articleReceivedSignal(signal) {\n switch (signal) {\n case \"updating\": {\n const txt =\n \"Author is currently editing article. Be aware of possible changes.\";\n const flash = new Flash({ warning: txt });\n flash.render();\n break;\n }\n case \"updated\":\n await this.article.reload();\n this.article.applyChanges();\n this.renderArticle();\n }\n }\n}\n\nexport default Show;\n","import React from \"react\";\nimport { render } from \"react-dom\";\nimport { Controllers } from \"loco-js\";\n\nimport { setArticles, setComments } from \"actions\";\nimport store from \"store\";\n\nimport CommentList from \"containers/main/articles/CommentList\";\nimport CommentsNumber from \"containers/main/articles/CommentsNumber\";\n\nimport Article from \"models/Article\";\nimport Comment from \"models/article/Comment\";\nimport Show from \"views/main/articles/Show\";\n\nclass Articles extends Controllers.Base {\n async show() {\n const newComment = new Comment({ articleId: this.params.id });\n const view = new Show({ comment: newComment });\n view.render();\n this._renderArticle(view);\n this._renderComments();\n }\n\n async _renderArticle(view) {\n const article = await Article.find(this.params.id);\n store.dispatch(setArticles([article]));\n view.renderArticle(article);\n }\n\n async _renderComments() {\n const res = await Comment.get(\"count\", { articleId: this.params.id });\n const comments = await Comment.all({\n articleId: this.params.id,\n total: res.total\n });\n store.dispatch(setComments(comments, this.params.id));\n render(\n ,\n document.getElementById(\"comments\")\n );\n render(\n ,\n document.getElementById(\"comments_count\")\n );\n }\n}\n\nexport default Articles;\n","import React, { useState } from \"react\";\n\nimport Article from \"models/Article\";\n\nimport { addArticles } from \"actions\";\nimport store from \"store\";\n\nexport default function LoadMoreLink() {\n const [page, setPage] = useState(1);\n const [noMorePosts, setNoMorePosts] = useState(false);\n\n async function handleClick(e) {\n e.preventDefault();\n const currentPage = page + 1;\n setPage(currentPage);\n let resp = null;\n try {\n resp = await Article.get(\"all\", { page: currentPage });\n } catch (e) {\n alert(`Invalid URL: ${e}`);\n return;\n }\n if (resp.resources.length > 0) {\n store.dispatch(addArticles(resp.resources));\n } else {\n setNoMorePosts(true);\n }\n }\n\n function output() {\n if (noMorePosts) return No more posts.;\n else\n return (\n \n Load more…\n \n );\n }\n\n return output();\n}\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Services } from \"loco-js\";\n\nimport ArticleModel from \"models/Article\";\n\nfunction Article({ article }) {\n const date = new Services.Date(article.publishedAt).toString(\"short\");\n\n return (\n
    \n

    {article.title}

    \n

    \n \n {article.author} wrote this on {date} /{\" \"}\n \n {article.commentsCount} comment\n {article.commentsCount === 1 ? \"\" : \"s\"}\n \n \n

    \n

    {article.content}

    \n

    \n Continued…\n

    \n
    \n );\n}\n\nArticle.propTypes = {\n article: PropTypes.instanceOf(ArticleModel).isRequired\n};\n\nexport default Article;\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport store from \"store\";\nimport Article from \"components/main/Article\";\nimport ArticleModel from \"models/Article\";\n\nfunction ArticleList(props) {\n const [articles, setArticles] = useState(props.articles);\n\n useEffect(() => {\n const unsubscribe = store.subscribe(() =>\n setArticles(store.getState().articles)\n );\n\n return () => {\n unsubscribe();\n };\n });\n\n const list = articles.map(article => (\n
    \n ));\n\n return <>{list};\n}\n\nArticleList.propTypes = {\n articles: PropTypes.arrayOf(PropTypes.instanceOf(ArticleModel)).isRequired\n};\n\nexport default ArticleList;\n","import React from \"react\";\nimport { render as renderElement } from \"react-dom\";\nimport { Controllers } from \"loco-js\";\n\nimport { setArticles } from \"actions\";\nimport store from \"store\";\n\nimport Article from \"models/Article\";\nimport LoadMoreLink from \"containers/main/pages/LoadMoreLink\";\nimport ArticleList from \"containers/main/pages/ArticleList\";\n\nclass Pages extends Controllers.Base {\n async index() {\n renderElement(\n ,\n document.getElementById(\"load_more_wrapper\")\n );\n const resp = await Article.get(\"all\", { page: 1 });\n store.dispatch(setArticles(resp.resources));\n renderElement(\n ,\n document.getElementById(\"articles\")\n );\n }\n}\n\nexport default Pages;\n","import { UI, Views } from \"loco-js\";\n\nimport User from \"models/User\";\nimport Flash from \"views/shared/Flash\";\n\nclass UserRegistrationForm extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n render() {\n const form = new UI.Form({\n for: new User(),\n delegator: this,\n callbackSuccess: \"_created\"\n });\n form.render();\n }\n\n receivedSignal(signal) {\n switch (signal) {\n case \"confirming\":\n this._confirming();\n break;\n case \"confirmed\":\n this._confirmed();\n }\n }\n\n _created(data) {\n this.connectWith(new User({ id: data.id }));\n document.querySelector(\"form\").style.display = \"none\";\n document.getElementById(\"sign_in_paragraph\").classList.remove(\"none\");\n document.getElementById(\"verification_info\").classList.remove(\"none\");\n const flash = new Flash({ notice: data.notice });\n flash.render();\n }\n\n _confirming() {\n document.getElementById(\n \"verification_info\"\n ).textContent = document.getElementById(\n \"verification_progress\"\n ).textContent;\n }\n\n _confirmed() {\n window.location.href = \"/user/sessions/new?event=confirmed\";\n }\n}\n\nexport default UserRegistrationForm;\n","import { Controllers } from \"loco-js\";\n\nimport UserRegistrationForm from \"views/main/users/UserRegistrationForm\";\n\nclass Users extends Controllers.Base {\n new() {\n new UserRegistrationForm().render();\n }\n}\n\nexport default Users;\n","import { Controllers } from \"loco-js\";\n\nimport Disconnection from \"./concerns/Disconnection\";\nimport Articles from \"./main/Articles\";\nimport Pages from \"./main/Pages\";\nimport Users from \"./main/Users\";\n\nObject.assign(Controllers.Base.prototype, Disconnection);\n\nclass Main extends Controllers.Base {\n initialize() {\n this.setScope(\"main\");\n }\n}\n\nObject.assign(Main, {\n Articles,\n Pages,\n Users\n});\n\nexport default Main;\n","import { Env, Views } from \"loco-js\";\n\nimport {\n addArticles,\n prependArticles,\n updateArticle,\n addComments,\n prependUsers,\n removeComment,\n updateComment\n} from \"actions\";\nimport store from \"store\";\nimport { findArticle, findComment } from \"selectors/articles\";\n\nimport Article from \"models/Article\";\nimport Comment from \"models/article/Comment\";\nimport User from \"models/User\";\n\nimport AdminController from \"controllers/Admin\";\nimport MainController from \"controllers/Main\";\nimport UserController from \"controllers/User\";\n\nconst articleCreated = async ({ id }) => {\n if (Env.namespaceController.constructor !== UserController) return;\n const article = await Article.find({ id, abbr: true });\n store.dispatch(addArticles([article]));\n};\n\nconst articlePublished = async ({ id }) => {\n if (Env.namespaceController.constructor === AdminController) {\n const article = await Article.find({ id, abbr: true, resource: \"admin\" });\n store.dispatch(prependArticles([article]));\n } else {\n const article = await Article.find({ id, abbr: true });\n store.dispatch(addArticles([article]));\n }\n};\n\nconst articleUpdated = async ({ id }) => {\n const findParams = { id: id, abbr: true };\n if (Env.namespaceController.constructor === AdminController) {\n findParams[\"resource\"] = \"admin\";\n }\n let [article, index] = findArticle(store.getState(), id);\n if (!article) return;\n article = await Article.find(findParams);\n store.dispatch(updateArticle(article, index));\n};\n\nconst commentsChanged = ({ article_id: articleId }, diff) => {\n const [article, index] = findArticle(store.getState(), articleId);\n if (!article) return;\n const updatedArticle = new Article({\n ...article,\n commentsCount: article.commentsCount + diff\n });\n store.dispatch(updateArticle(updatedArticle, index));\n};\n\nconst commentCreated = async ({ article_id: articleId, id }) => {\n const findParams = { articleId, id };\n if (Env.namespaceController.constructor === MainController) {\n findParams[\"resource\"] = \"main\";\n }\n const [article] = findArticle(store.getState(), articleId);\n if (!article) return;\n const comment = await Comment.find(findParams);\n store.dispatch(addComments([comment], articleId));\n};\n\nconst commentDestroyed = ({ article_id: articleId, id }) => {\n store.dispatch(removeComment(id, articleId));\n};\n\nconst commentUpdated = async ({ article_id: articleId, id }) => {\n const [comment, index] = findComment(store.getState(), id, {\n parentId: articleId\n });\n if (!comment) return;\n await comment.reload();\n comment.applyChanges();\n store.dispatch(updateComment(new Comment({ ...comment }), articleId, index));\n};\n\nclass Connectivity extends Views.Base {\n constructor(opts = {}) {\n super(opts);\n }\n\n async receivedSignal(signal, data) {\n switch (signal) {\n case \"Article created\":\n articleCreated(data);\n break;\n case \"Article published\":\n articlePublished(data);\n break;\n case \"Article updated\":\n articleUpdated(data);\n break;\n case \"Article.Comment created\":\n commentsChanged(data, 1);\n commentCreated(data);\n break;\n case \"Article.Comment destroyed\":\n commentsChanged(data, -1);\n commentDestroyed(data);\n break;\n case \"Article.Comment updated\":\n commentUpdated(data);\n break;\n case \"User created\": {\n const user = await User.find(data.id);\n store.dispatch(prependUsers([user]));\n break;\n }\n }\n }\n\n call() {\n this.connectWith([Article, Comment, User]);\n }\n}\n\nexport default Connectivity;\n","import { Deps, Env, Loco } from \"loco-js\";\nimport { createConsumer } from \"@rails/actioncable\";\nimport NotificationCenter from \"services/NotificationCenter\";\nimport Connectivity from \"services/Connectivity\";\n\nDeps.cable = createConsumer();\nDeps.NotificationCenter = NotificationCenter;\n\nconst connectivity = new Connectivity();\n\nconst loco = new Loco({\n notifications: {\n enable: true,\n log: true,\n size: 10\n },\n postInit: () => {\n connectivity.call();\n\n if (\n document.querySelector(\"body\").getAttribute(\"data-rails-env\") !== \"test\"\n )\n return;\n Env.loco.getWire().setPollingTime(1000);\n }\n});\n\nloco.init();\n","import { Env, I18n, Validators } from \"loco-js\";\n\nclass Vulgarity extends Validators.Base {\n static identity = \"Vulgarity\";\n\n constructor() {\n super();\n }\n\n validate() {\n if (this.val == null) return;\n switch (typeof this.val) {\n case \"string\": {\n const vulgarWord = this._getVulgarWord();\n const match = new RegExp(`${vulgarWord}`, [\"i\"]).exec(this.val);\n if (match) this._addErrorMessage();\n else return;\n break;\n }\n default:\n throw new TypeError(\n `Vulgarity validator is applicable only for strings and ${this.attr} isn't.`\n );\n }\n }\n\n _addErrorMessage() {\n const message = I18n[Env.loco.getLocale()].errors.messages.vulgarity;\n this.obj.addErrorMessage(message, { for: this.attr });\n }\n\n _getVulgarWord() {\n switch (Env.loco.getLocale()) {\n case \"pl\":\n return \"kurwa\";\n case \"en\":\n return \"fuck\";\n }\n }\n}\n\nexport default Vulgarity;\n","import { Validators } from \"loco-js\";\n\nimport Vulgarity from \"./Vulgarity\";\n\nObject.assign(Validators, {\n Vulgarity\n});\n","import { I18n, Utils } from \"loco-js\";\n\nI18n.pl = {\n variants: {\n few(i) {\n const num = parseInt(Utils.String.last(String(i)));\n [2, 3, 4].indexOf(num) !== -1 &&\n !(String(i).length === 2 && String(i)[0] === \"1\");\n }\n },\n models: {},\n attributes: {},\n ui: {\n form: {\n sending: \"Wysyłam...\",\n success: \"Sukces\",\n errors: {\n connection: \"Błąd z połączeniem\",\n invalid_data: \"Nieprawidłowe dane\"\n }\n }\n },\n date: {\n formats: {\n default: \"%d-%m-%Y\",\n short: \"%d %b\",\n long: \"%B %d, %Y\"\n },\n day_names: [\n \"niedziela\",\n \"poniedziałek\",\n \"wtorek\",\n \"środa\",\n \"czwartek\",\n \"piątek\",\n \"sobota\"\n ],\n abbr_day_names: [\"nie\", \"pon\", \"wto\", \"śro\", \"czw\", \"pią\", \"sob\"],\n month_names: [\n \"styczeń\",\n \"luty\",\n \"marzec\",\n \"kwiecień\",\n \"maj\",\n \"czerwiec\",\n \"lipiec\",\n \"sierpień\",\n \"wrzesień\",\n \"październik\",\n \"listopad\",\n \"grudzień\"\n ],\n abbr_month_names: [\n \"sty\",\n \"lut\",\n \"mar\",\n \"kwi\",\n \"maj\",\n \"cze\",\n \"lip\",\n \"sie\",\n \"wrz\",\n \"paź\",\n \"lis\",\n \"gru\"\n ]\n },\n errors: {\n messages: {\n accepted: \"musi zostać zaakceptowane\",\n blank: \"nie może być puste\",\n confirmation: \"nie zgadza się z polem %{attribute}\",\n empty: \"nie może być puste\",\n equal_to: \"musi być równe %{count}\",\n even: \"musi być parzyste\",\n exclusion: \"jest zarezerwowane\",\n greater_than: \"musi być większe od %{count}\",\n greater_than_or_equal_to: \"musi być większe lub równe %{count}\",\n inclusion: \"nie znajduje się na liście dopuszczalnych wartości\",\n invalid: \"jest nieprawidłowe\",\n less_than: \"musi być mniejsze od %{count}\",\n less_than_or_equal_to: \"musi być mniejsze lub równe %{count}\",\n not_a_number: \"nie jest liczbą\",\n not_an_integer: \"musi być liczbą całkowitą\",\n odd: \"musi być nieparzyste\",\n present: \"musi być puste\",\n too_long: {\n few: \"jest za długie (maksymalnie %{count} znaki)\",\n many: \"jest za długie (maksymalnie %{count} znaków)\",\n one: \"jest za długie (maksymalnie jeden znak)\",\n other: \"jest za długie (maksymalnie %{count} znaków)\"\n },\n too_short: {\n few: \"jest za krótkie (przynajmniej %{count} znaki)\",\n many: \"jest za krótkie (przynajmniej %{count} znaków)\",\n one: \"jest za krótkie (przynajmniej jeden znak)\",\n other: \"jest za krótkie (przynajmniej %{count} znaków)\"\n },\n wrong_length: {\n few: \"ma nieprawidłową długość (powinna wynosić %{count} znaki)\",\n many: \"ma nieprawidłową długość (powinna wynosić %{count} znaków)\",\n one: \"ma nieprawidłową długość (powinna wynosić jeden znak)\",\n other: \"ma nieprawidłową długość (powinna wynosić %{count} znaków)\"\n },\n other_than: \"musi być inna niż %{count}\"\n }\n }\n};\n","import { I18n } from \"loco-js\";\n\nI18n.pl.models.User = \"Użytkownik\";\nI18n.pl.attributes.User = {\n password: \"Hasło\",\n passwordConfirmation: \"Powtórz hasło\"\n};\n","import { I18n } from \"loco-js\";\n\nI18n.en.errors.messages.vulgarity = \"contains strong language.\";\n","import { I18n } from \"loco-js\";\n\nI18n.pl.errors.messages.vulgarity = \"zawiera mocny język.\";\n","import { Controllers } from \"loco-js\";\n\nimport Admin from \"controllers/Admin\";\nimport Main from \"controllers/Main\";\nimport User from \"controllers/User\";\n\nObject.assign(Controllers, {\n Admin,\n Main,\n User\n});\n","import { Models } from \"loco-js\";\n\nimport Article from \"./Article\";\nimport Comment from \"./article/Comment\";\nimport Member from \"./room/Member\";\nimport Room from \"./Room\";\nimport User from \"./User\";\n\nObject.assign(Article, { Comment });\nObject.assign(Room, { Member });\n\nObject.assign(Models, {\n Article,\n Room,\n User\n});\n","import \"scaffold.css\";\nimport \"global.css\";\n\nimport \"initializers/rails\";\nimport \"initializers/loco\";\nimport \"validators\";\nimport \"locales\";\nimport \"controllers\";\nimport \"models\";\n\n// for testing purposes only\nimport { Channels, Env } from \"loco-js\";\nwindow.test = {\n Channels,\n Env\n};\n"],"sourceRoot":""}