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cgE,EAAQ,iBACpEjB,EAAKqB,kBAAkBzB,mBAAmB,aAAcuB,EAC1D,GAEJ,M,8EAAC1C,CAAA,CA9DkB,CAEQ6C,EAAAA,I,EAAU7C,E,EACpB,CAAC,cAAe,gBAAiB,cAAe,iBAAkB,WAAY,c,MAD1D,c,0JCNjC8C,EAAcC,EAAAA,GAAYC,QAC1BC,EAAUC,EAAAA,MAChBJ,EAAYK,MAAKC,EAAAA,EAAAA,IAAuBH,G,4gDCHY,IAC/BjG,EAAa,SAAAqG,I,sRAAAlH,CAAAa,EAAAqG,GAAA,I,MAAAjH,EAAAC,EAAAW,GAAA,SAAAA,IAAA,O,4FAAAV,CAAA,KAAAU,GAAAZ,EAAAG,MAAA,KAAAC,UAAA,Q,EAAAQ,E,kFAAA,E,QAASsG,c,6GCS3CC,EAAAA,EAAAA,GAAcC,OAAQ,EAEtB7D,IAAAA,WAAwB,CAGtB8D,iBAAiB,IAGnB9D,IAAAA,SAAsB,CACpB+D,iBAAAA,EAAAA,EACAzH,OAAAA,EAAAA,G","sources":["webpack://react-webpack-rails-tutorial/./client/app/controllers/ sync \\.js$","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/components/Footer/Footer.jsx","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/components/NavigationBar/CommentsCount.jsx","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/constants/paths.js","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/containers/NavigationBarContainer.jsx","webpack://react-webpack-rails-tutorial/./client/app/bundles/comments/startup/NavigationBarApp.jsx","webpack://react-webpack-rails-tutorial/./client/app/controllers/comments_controller.js","webpack://react-webpack-rails-tutorial/./client/app/controllers/index.js","webpack://react-webpack-rails-tutorial/./client/app/libs/components/BaseComponent.jsx","webpack://react-webpack-rails-tutorial/./client/app/packs/stimulus-bundle.js"],"sourcesContent":["var map = {\n\t\"./comments_controller.js\": 5210,\n\t\"./index.js\": 8308,\n\t\"controllers/comments_controller.js\": 5210,\n\t\"controllers/index.js\": 8308\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 3181;","import React from 'react';\nimport BaseComponent from 'libs/components/BaseComponent';\n\nexport default class Footer extends BaseComponent {\n  render() {\n    return (\n      <footer className=\" text-neutral-200 bg-[#222] py-8 mt-16\">\n        <div className=\"container mx-auto px-4\">\n          <a href=\"http://www.shakacode.com\">\n            <h3 className=\"flex gap-4 items-center\">\n              <div className=\"w-[146px] h-[40px] bg-[url('../images/railsonmaui.png')]\" />\n              Example of styling using image-url and Open Sans Light custom font\n            </h3>\n          </a>\n          <a href=\"https://twitter.com/railsonmaui\" className=\"flex gap-4 items-center\">\n            <div className=\"w-16 h-16 bg-[url('../images/twitter_64.png')]\" />\n            Rails On Maui on Twitter\n          </a>\n        </div>\n      </footer>\n    );\n  }\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst href =\n  'https://github.com/shakacode/react_on_rails/blob/master/README.md#multiple-react-' +\n  'components-on-a-page-with-one-store';\nfunction CommentsCount(props) {\n  const { commentsCount } = props;\n  return (\n    <li className=\"border-t border-gray-300 lg:border-t-0 lg:border-l\">\n      <a id=\"js-comment-count\" href={href} className=\"px-2 py-4 inline-block\">\n        Comments: {commentsCount}\n      </a>\n    </li>\n  );\n}\n\nCommentsCount.propTypes = {\n  commentsCount: PropTypes.number.isRequired,\n};\n\nexport default CommentsCount;\n","export const ROUTER_PATH = '/';\nexport const REACT_ROUTER_PATH = '/react-router';\nexport const NO_ROUTER_PATH = '/no-router';\nexport const RESCRIPT_PATH = '/rescript';\nexport const SIMPLE_REACT_PATH = '/simple';\nexport const STIMULUS_PATH = '/stimulus';\nexport const RAILS_PATH = '/comments';\n","// https://github.com/eslint/eslint/issues/6876\n// eslint-disable new-cap\n\nimport classNames from 'classnames';\nimport _ from 'lodash';\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport CommentsCount from './CommentsCount.jsx';\nimport * as paths from '../../constants/paths';\n\nfunction NavigationBar(props) {\n  const { commentsCount, pathname } = props;\n\n  const [isOpen, setIsOpen] = useState(false);\n\n  const menuWrapperClasses = 'flex flex-col lg:flex-row flex-wrap lg:items-center lg:visible';\n\n  return (\n    <nav className=\"bg-yellow-50\">\n      <div className=\"container mx-auto\">\n        <div className=\"flex flex-col lg:flex-row justify-between\">\n          <div className=\"flex justify-between items-center align-middle\">\n            <a className=\"p-3 text-2xl\" href=\"http://www.shakacode.com\">\n              ShakaCode\n            </a>\n\n            <button\n              type=\"button\"\n              className=\"navbar-toggle\"\n              data-toggle=\"collapse\"\n              data-target=\"#bs-example-navbar-collapse-1\"\n              onClick={() => setIsOpen(!isOpen)}\n            >\n              <span className=\"sr-only\">Toggle navigation</span>\n              <div className=\"p-4 lg:hidden\">\n                <svg\n                  xmlns=\"http://www.w3.org/2000/svg\"\n                  fill=\"none\"\n                  viewBox=\"0 0 24 24\"\n                  stroke=\"currentColor\"\n                  className=\"w-6 h-6\"\n                >\n                  <path\n                    strokeLinecap=\"round\"\n                    strokeLinejoin=\"round\"\n                    strokeWidth=\"2\"\n                    d=\"M4 6h16M4 12h16M4 18h16\"\n                  />\n                </svg>\n              </div>\n            </button>\n          </div>\n\n          <ul className={`${menuWrapperClasses} ${isOpen ? '' : ' collapse'}`}>\n            <li\n              className={classNames({\n                'bg-yellow-100': pathname === paths.ROUTER_PATH || pathname === paths.REACT_ROUTER_PATH,\n              })}\n            >\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.ROUTER_PATH}\n              >\n                React Router Demo\n              </a>\n            </li>\n            <li className={classNames({ 'bg-yellow-100': pathname === paths.NO_ROUTER_PATH })}>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.NO_ROUTER_PATH}\n              >\n                React Demo\n              </a>\n            </li>\n            <li className={classNames({ 'bg-yellow-100': pathname === paths.SIMPLE_REACT_PATH })}>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.SIMPLE_REACT_PATH}\n              >\n                Simple React\n              </a>\n            </li>\n            <li className={classNames({ 'bg-yellow-100': pathname === paths.STIMULUS_PATH })}>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.STIMULUS_PATH}\n              >\n                Stimulus Demo\n              </a>\n            </li>\n            <li className={classNames({ 'bg-yellow-100': pathname === paths.RAILS_PATH })}>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.RAILS_PATH}\n              >\n                Classic Rails\n              </a>\n            </li>\n            <li className={classNames({ 'bg-yellow-100': pathname === paths.RESCRIPT_PATH })}>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href={paths.RESCRIPT_PATH}\n              >\n                Rescript\n              </a>\n            </li>\n            <li>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href=\"https://github.com/shakacode/react-webpack-rails-tutorial\"\n              >\n                Source\n              </a>\n            </li>\n            <li>\n              <a\n                className=\"px-2 py-4 w-full inline-block text-gray-500 hover:text-gray-700\"\n                href=\"https://forum.shakacode.com/c/reactjs\"\n              >\n                Forum\n              </a>\n            </li>\n            {_.isNumber(commentsCount) && CommentsCount({ commentsCount })}\n          </ul>\n        </div>\n      </div>\n    </nav>\n  );\n}\n\nNavigationBar.propTypes = {\n  commentsCount: PropTypes.number,\n  pathname: PropTypes.string.isRequired,\n};\n\nexport default NavigationBar;\n","import { connect } from 'react-redux';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport BaseComponent from '../../../libs/components/BaseComponent.jsx';\n\nimport NavigationBar from '../components/NavigationBar/NavigationBar.jsx';\n\nfunction stateToProps(state) {\n  // Which part of the Redux global state does our component want to receive as props?\n  if (state.$$commentsStore) {\n    return {\n      commentsCount: state.$$commentsStore.get('$$comments').size,\n      pathname: state.railsContext.pathname,\n    };\n  }\n  return {};\n}\n\nclass NavigationBarContainer extends BaseComponent {\n  static propTypes = {\n    commentsCount: PropTypes.number.isRequired,\n    pathname: PropTypes.string.isRequired,\n  };\n\n  render() {\n    const { commentsCount, pathname } = this.props;\n\n    return <NavigationBar {...{ commentsCount, pathname }} />;\n  }\n}\n\n// Don't forget to actually use connect!\nexport default connect(stateToProps)(NavigationBarContainer);\n","// Top level component for client side.\n// Compare this to the ./ServerApp.jsx file which is used for server side rendering.\n\nimport { Provider } from 'react-redux';\nimport React from 'react';\nimport ReactOnRails from 'react-on-rails';\n\nimport NavigationBar from '../components/NavigationBar/NavigationBar.jsx';\nimport NavigationBarContainer from '../containers/NavigationBarContainer.jsx';\nimport * as paths from '../constants/paths';\n\n/*\n *  Export a function that returns a ReactComponent, depending on a store named SharedReduxStore.\n *  This is used for the client rendering hook after the page html is rendered.\n *  React will see that the state is the same and not do anything.\n */\nfunction NavigationBarAppFactory(_props, railsContext) {\n  // This is where we get the existing store.\n  const { pathname } = railsContext;\n  let store;\n  if (pathname === paths.ROUTER_PATH) {\n    store = ReactOnRails.getStore('routerCommentsStore', false);\n  } else if (pathname === paths.NO_ROUTER_PATH) {\n    store = ReactOnRails.getStore('commentsStore', false);\n  } else {\n    return function NavigationBarApp() {\n      return <NavigationBar {...{ pathname }} />;\n    };\n  }\n\n  // eslint interprets the return as a new component definition, which is not the case\n  // eslint-disable-next-line react/display-name, react/no-unstable-nested-components\n  return function NavigationBarApp() {\n    return (\n      <Provider store={store}>\n        <NavigationBarContainer />\n      </Provider>\n    );\n  };\n}\n\nexport default NavigationBarAppFactory;\n","import { Controller } from '@hotwired/stimulus';\nimport * as ActionCable from '@rails/actioncable';\nimport * as marked from 'marked';\nimport { gfmHeadingId } from 'marked-gfm-heading-id';\nimport { mangle } from 'marked-mangle';\n\nmarked.use(gfmHeadingId());\nmarked.use(mangle());\n\nexport default class extends Controller {\n  static targets = ['commentList', 'commentAuthor', 'commentText', 'commentRefresh', 'alertDiv', 'errorList'];\n\n  resetText() {\n    const inputAuthor = this.commentAuthorTarget;\n    const inputText = this.commentTextTarget;\n    const alertDiv = this.alertDivTarget;\n    const errorList = this.errorListTarget;\n\n    const errors = [];\n\n    if (!inputAuthor.value || !inputText.value) {\n      errorList.innerHTML = '';\n      if (!inputAuthor.value) {\n        errors.push('Author');\n      } else if (!inputText.value) {\n        errors.push('Text');\n      } else {\n        errors.push('Author');\n        errors.push('Text');\n      }\n      errors.forEach((error) => {\n        const errorString = `<li>${error}: can't be blank</li>`;\n        errorList.insertAdjacentHTML('afterbegin', errorString);\n      });\n      alertDiv.classList.remove('hidden');\n    } else {\n      alertDiv.classList.add('hidden');\n      errorList.innerHTML = '';\n      inputText.value = '';\n      this.refreshCommentList();\n    }\n  }\n\n  refreshCommentList() {\n    const refreshBtn = this.commentRefreshTarget;\n    refreshBtn.click();\n  }\n\n  connect() {\n    console.log('connected to Stimulus comments_controller');\n\n    const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';\n    const cableUrl = `${protocol}${window.location.hostname}:${window.location.port}/cable`;\n\n    this.cable = ActionCable.createConsumer(cableUrl);\n\n    this.cable.subscriptions.create('CommentsChannel', {\n      connected: () => {\n        console.log('connected to comments channel using Stimulus controller');\n      },\n      disconnected: () => {\n        console.log('disconnected from comments channel via Stimulus');\n      },\n      received: (comment) => {\n        const htmlText = marked.parse(comment.text);\n        const htmlComment = `<div><h2>${comment.author}</h2><span>${htmlText}</span></div>`;\n        this.commentListTarget.insertAdjacentHTML('afterbegin', htmlComment);\n      },\n    });\n  }\n}\n","import { Application } from '@hotwired/stimulus';\nimport { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers';\n\nconst application = Application.start();\nconst context = require.context('.', true, /\\.js$/);\napplication.load(definitionsFromContext(context));\n","import React from 'react';\n\n/* eslint-disable react/prefer-stateless-function */\nexport default class BaseComponent extends React.PureComponent {}\n","import ReactOnRails from 'react-on-rails';\nimport 'jquery-ujs';\nimport { Turbo } from '@hotwired/turbo-rails';\n\n// eslint-disable-next-line no-unused-vars\nimport controllers from '../controllers';\n\nimport NavigationBarApp from '../bundles/comments/startup/NavigationBarApp';\nimport Footer from '../bundles/comments/components/Footer/Footer';\n\nimport '../assets/styles/application';\n\nTurbo.session.drive = false;\n\nReactOnRails.setOptions({\n  // traceTurbolinks: process.env.TRACE_TURBOLINKS, // eslint-disable-line no-undef\n  // process.env.TRACE_TURBOLINKS -> error: development is not defined\n  traceTurbolinks: true,\n});\n\nReactOnRails.register({\n  NavigationBarApp,\n  Footer,\n});\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","Footer","_BaseComponent","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","key","value","_jsx","className","children","_jsxs","href","BaseComponent","props","commentsCount","NO_ROUTER_PATH","RESCRIPT_PATH","SIMPLE_REACT_PATH","STIMULUS_PATH","RAILS_PATH","pathname","_useState2","_slicedToArray","useState","isOpen","setIsOpen","type","onClick","xmlns","fill","viewBox","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d","concat","classNames","paths","_","CommentsCount","NavigationBarContainer","_this$props","this","NavigationBar","PropTypes","isRequired","connect","state","$$commentsStore","get","size","railsContext","_props","store","ReactOnRails","Provider","marked","gfmHeadingId","mangle","_default","_Controller","inputAuthor","commentAuthorTarget","inputText","commentTextTarget","alertDiv","alertDivTarget","errorList","errorListTarget","errors","classList","add","innerHTML","refreshCommentList","push","forEach","error","errorString","insertAdjacentHTML","remove","commentRefreshTarget","click","_this","console","log","protocol","window","location","cableUrl","hostname","port","cable","ActionCable","subscriptions","create","connected","disconnected","received","comment","htmlText","text","htmlComment","author","commentListTarget","Controller","application","Application","start","context","require","load","definitionsFromContext","_React$PureComponent","React","Turbo","drive","traceTurbolinks","NavigationBarApp"],"sourceRoot":""}