{"version":3,"sources":["webpack:///./src/components/Disqus/Disqus.jsx","webpack:///./src/components/PostTemplateDetails/index.jsx","webpack:///./src/templates/post-template.jsx","webpack:///./src/components/Layout/index.jsx","webpack:///./node_modules/core-js/modules/es6.function.bind.js","webpack:///./node_modules/core-js/modules/_bind.js","webpack:///./node_modules/react-disqus-comments/build/main.js","webpack:///./node_modules/react-disqus-comments/build/components/DisqusThread.js"],"names":["Disqus","props","_this","_Component","call","this","state","toasts","notifyAboutComment","bind","assertThisInitialized_default","onSnackbarDismiss","slice","setState","push","text","render","_this$props","postNode","siteMetadata","disqusShortname","post","frontmatter","url","fields","slug","react_default","a","createElement","main_default","shortname","identifier","title","category_id","onNewComment","Component","PostTemplateDetails","_this$props$data$site","data","site","subtitle","author","markdownRemark","tags","tagSlugs","homeBlock","gatsby_browser_entry","className","to","tagsBlock","map","tag","i","key","commentsBlock","components_Disqus_Disqus","dangerouslySetInnerHTML","__html","html","moment","date","format","href","twitter","target","rel","name","React","PostTemplate","_post$frontmatter","postTitle","postDescription","description","Layout","Helmet_default","content","components_PostTemplateDetails","pageQuery","__webpack_exports__","children","react__WEBPACK_IMPORTED_MODULE_1___default","react_helmet__WEBPACK_IMPORTED_MODULE_2___default","defaultTitle","$export","__webpack_require__","P","aFunction","isObject","invoke","arraySlice","factories","module","exports","Function","that","fn","partArgs","arguments","bound","args","concat","F","len","n","join","construct","length","prototype","Object","defineProperty","value","_extends","assign","source","hasOwnProperty","_createClass","defineProperties","descriptor","enumerable","configurable","writable","Constructor","protoProps","staticProps","_react2","_interopRequireDefault","_propTypes2","obj","__esModule","default","DISQUS_CONFIG","__disqusAdded","copyProps","context","language","rest","keys","indexOf","_objectWithoutProperties","prop","page","callbacks","DisqusThread","_React$Component","instance","TypeError","_classCallCheck","self","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","apply","subClass","superClass","create","constructor","setPrototypeOf","_inherits","loadDisqus","nextProps","nextState","_this2","reduce","memo","some","config","_defineProperty","id","child","disqus","document","parent","getElementsByTagName","async","type","src","appendChild","_this3","forEach","DISQUS","reset","reload","replace","window","disqus_config","addDisqusScript","displayName","propTypes","string","isRequired","func","defaultProps","location"],"mappings":"qPAwCeA,cApCb,SAAAA,EAAYC,GAAO,IAAAC,EAAA,OACjBA,EAAAC,EAAAC,KAAAC,KAAMJ,IAANI,MACKC,MAAQ,CAAEC,OAAQ,IACvBL,EAAKM,mBAAqBN,EAAKM,mBAAmBC,KAAxBC,QAAAR,KAC1BA,EAAKS,kBAAoBT,EAAKS,kBAAkBF,KAAvBC,QAAAR,KAJRA,sCAOnBS,6BAAoB,IACNJ,EAAUF,KAAKC,MAAMC,OADfK,MAAA,GAElBP,KAAKQ,SAAS,CAAEN,cAElBC,8BACE,IAAMD,EAASF,KAAKC,MAAMC,OAAOK,QACjCL,EAAOO,KAAK,CAAEC,KAAM,4BACpBV,KAAKQ,SAAS,CAAEN,cAElBS,kBAAS,IAAAC,EAC4BZ,KAAKJ,MAAhCiB,EADDD,EACCC,SAAUC,EADXF,EACWE,aAClB,IAAKA,EAAaC,gBAChB,OAAO,KAET,IAAMC,EAAOH,EAASI,YAChBC,EAAMJ,EAAaI,IAAML,EAASM,OAAOC,KAC/C,OACEC,EAAAC,EAAAC,cAACC,EAAAF,EAAD,CACEG,UAAWX,EAAaC,gBACxBW,WAAYV,EAAKW,MACjBA,MAAOX,EAAKW,MACZT,IAAKA,EACLU,YAAaZ,EAAKY,YAClBC,aAAc7B,KAAKG,yBA/BN2B,aC+ENC,oGA3EbpB,kBAAS,IAAAqB,EACsBhC,KAAKJ,MAAMqC,KAAKC,KAAKpB,aAA1CqB,EADDH,EACCG,SAAUC,EADXJ,EACWI,OACZpB,EAAOhB,KAAKJ,MAAMqC,KAAKI,eACvBC,EAAOtB,EAAKG,OAAOoB,SAEnBC,EACJnB,EAAAC,EAAAC,cAAA,WACEF,EAAAC,EAAAC,cAACkB,EAAA,KAAD,CAAMC,UAAU,2BAA2BC,GAAG,KAA9C,iBAMEC,EAC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AA1C,EAAAG,QAAA4D,OAOA/J,UAAAgG,EAAAG,QAAA4D,OAAAC,WAWA/J,WAAA+F,EAAAG,QAAA4D,OAQA7J,MAAA8F,EAAAG,QAAA4D,OASAtK,IAAAuG,EAAAG,QAAA4D,OAOA5J,YAAA6F,EAAAG,QAAA4D,OAOA3J,aAAA4F,EAAAG,QAAA8D,KAOAzD,SAAAR,EAAAG,QAAA4D,QAGA/C,EAAAkD,aAAA,CACAzK,IAAA,oBAAAiK,OAAA,KAAAA,OAAAS,SAAAnI,MAGA8B,EAAAqC,QAAAa","file":"component---src-templates-post-template-jsx-b263cc91e0ee2d80c8dd.js","sourcesContent":["import React, { Component } from 'react'\nimport ReactDisqusComments from 'react-disqus-comments'\n\nclass Disqus extends Component {\n constructor(props) {\n super(props)\n this.state = { toasts: [] }\n this.notifyAboutComment = this.notifyAboutComment.bind(this)\n this.onSnackbarDismiss = this.onSnackbarDismiss.bind(this)\n }\n\n onSnackbarDismiss() {\n const [, ...toasts] = this.state.toasts\n this.setState({ toasts })\n }\n notifyAboutComment() {\n const toasts = this.state.toasts.slice()\n toasts.push({ text: 'New comment available!!' })\n this.setState({ toasts })\n }\n render() {\n const { postNode, siteMetadata } = this.props\n if (!siteMetadata.disqusShortname) {\n return null\n }\n const post = postNode.frontmatter\n const url = siteMetadata.url + postNode.fields.slug\n return (\n \n )\n }\n}\n\nexport default Disqus\n","import React from 'react'\nimport { Link } from 'gatsby'\nimport moment from 'moment'\nimport Disqus from '../Disqus/Disqus'\nimport './style.scss'\n\nclass PostTemplateDetails extends React.Component {\n render() {\n const { subtitle, author } = this.props.data.site.siteMetadata\n const post = this.props.data.markdownRemark\n const tags = post.fields.tagSlugs\n\n const homeBlock = (\n
\n \n All Articles\n \n
\n )\n\n const tagsBlock = (\n
\n \n
\n )\n\n const commentsBlock = (\n
\n \n
\n )\n\n return (\n
\n {homeBlock}\n
\n
\n

{post.frontmatter.title}

\n \n
\n \n Published {moment(post.frontmatter.date).format('D MMM YYYY')}\n \n
\n
\n
\n {tagsBlock}\n
\n

\n {subtitle}\n \n
{author.name} on Twitter\n \n

\n {commentsBlock}\n
\n
\n
\n )\n }\n}\n\nexport default PostTemplateDetails\n","import React from 'react'\nimport Helmet from 'react-helmet'\nimport { graphql } from 'gatsby'\nimport Layout from '../components/Layout'\nimport PostTemplateDetails from '../components/PostTemplateDetails'\n\nclass PostTemplate extends React.Component {\n render() {\n const { title, subtitle } = this.props.data.site.siteMetadata\n const post = this.props.data.markdownRemark\n const { title: postTitle, description: postDescription } = post.frontmatter\n const description = postDescription !== null ? postDescription : subtitle\n\n return (\n \n
\n \n {`${postTitle} - ${title}`}\n \n \n \n
\n
\n )\n }\n}\n\nexport default PostTemplate\n\nexport const pageQuery = graphql`\n query PostBySlug($slug: String!) {\n site {\n siteMetadata {\n title\n subtitle\n copyright\n author {\n picture\n name\n twitter\n linkedin\n }\n disqusShortname\n url\n }\n }\n markdownRemark(fields: { slug: { eq: $slug } }) {\n id\n html\n fields {\n tagSlugs\n slug\n }\n frontmatter {\n title\n tags\n date\n description\n }\n }\n }\n`\n","import React from 'react'\nimport Helmet from 'react-helmet'\nimport '../../assets/scss/init.scss'\n\nclass Layout extends React.Component {\n render() {\n const { children } = this.props\n\n return (\n
\n \n {children}\n
\n )\n }\n}\n\nexport default Layout\n","// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","'use strict';\n\nmodule.exports = require('./components/DisqusThread');","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nvar DISQUS_CONFIG = ['shortname', 'identifier', 'title', 'url', 'category_id', 'onNewComment', 'language'];\nvar __disqusAdded = false;\n\nfunction copyProps(context, props) {\n var onNewComment = props.onNewComment,\n language = props.language,\n rest = _objectWithoutProperties(props, ['onNewComment', 'language']);\n\n for (var prop in rest) {\n context.page[prop] = rest[prop];\n }\n\n // Setting the language - if none is provided, the default one is used\n context.language = language;\n\n if (onNewComment) {\n context.callbacks = {\n onNewComment: [onNewComment]\n };\n }\n}\n\nvar DisqusThread = function (_React$Component) {\n _inherits(DisqusThread, _React$Component);\n\n function DisqusThread() {\n _classCallCheck(this, DisqusThread);\n\n return _possibleConstructorReturn(this, (DisqusThread.__proto__ || Object.getPrototypeOf(DisqusThread)).apply(this, arguments));\n }\n\n _createClass(DisqusThread, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.loadDisqus();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.loadDisqus();\n }\n }, {\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps, nextState) {\n return nextProps.identifier !== this.props.identifier;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var props = Object.keys(this.props).reduce(function (memo, key) {\n return DISQUS_CONFIG.some(function (config) {\n return config === key;\n }) ? memo : _extends({}, memo, _defineProperty({}, key, _this2.props[key]));\n }, {});\n\n return _react2.default.createElement(\n 'div',\n props,\n _react2.default.createElement('div', { id: 'disqus_thread' })\n );\n }\n }, {\n key: 'addDisqusScript',\n value: function addDisqusScript() {\n if (__disqusAdded) {\n return;\n }\n\n var child = this.disqus = document.createElement('script');\n var parent = document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0];\n\n child.async = true;\n child.type = 'text/javascript';\n child.src = '//' + this.props.shortname + '.disqus.com/embed.js';\n\n parent.appendChild(child);\n __disqusAdded = true;\n }\n }, {\n key: 'loadDisqus',\n value: function loadDisqus() {\n var _this3 = this;\n\n var props = {};\n\n // Extract Disqus props that were supplied to this component\n DISQUS_CONFIG.forEach(function (prop) {\n // prop \"shortname\" is only necessary for loading the script, not for the config itself\n if (prop !== 'shortname' && !!_this3.props[prop]) {\n props[prop] = _this3.props[prop];\n }\n });\n\n // If Disqus has already been added, reset it\n if (typeof DISQUS !== 'undefined') {\n DISQUS.reset({\n reload: true,\n config: function config() {\n copyProps(this, props);\n\n // Disqus needs hashbang URL, see https://help.disqus.com/customer/portal/articles/472107\n this.page.url = this.page.url.replace(/#/, '') + '#!newthread';\n }\n });\n } else {\n // Otherwise add Disqus to the page\n window.disqus_config = function () {\n copyProps(this, props);\n };\n this.addDisqusScript();\n }\n }\n }]);\n\n return DisqusThread;\n}(_react2.default.Component);\n\nDisqusThread.displayName = 'DisqusThread';\n\nDisqusThread.propTypes = {\n id: _propTypes2.default.string,\n\n /**\n * `shortname` tells the Disqus service your forum's shortname,\n * which is the unique identifier for your website as registered\n * on Disqus. If undefined , the Disqus embed will not load.\n */\n shortname: _propTypes2.default.string.isRequired,\n\n /**\n * `identifier` tells the Disqus service how to identify the\n * current page. When the Disqus embed is loaded, the identifier\n * is used to look up the correct thread. If disqus_identifier\n * is undefined, the page's URL will be used. The URL can be\n * unreliable, such as when renaming an article slug or changing\n * domains, so we recommend using your own unique way of\n * identifying a thread.\n */\n identifier: _propTypes2.default.string,\n\n /**\n * `title` tells the Disqus service the title of the current page.\n * This is used when creating the thread on Disqus for the first time.\n * If undefined, Disqus will use the attribute of the page.\n * If that attribute could not be used, Disqus will use the URL of the page.\n */\n title: _propTypes2.default.string,\n\n /**\n * `url` tells the Disqus service the URL of the current page.\n * If undefined, Disqus will take the window.location.href.\n * This URL is used to look up or create a thread if disqus_identifier\n * is undefined. In addition, this URL is always saved when a thread is\n * being created so that Disqus knows what page a thread belongs to.\n */\n url: _propTypes2.default.string,\n\n /**\n * `category_id` tells the Disqus service the category to be used for\n * the current page. This is used when creating the thread on Disqus\n * for the first time.\n */\n category_id: _propTypes2.default.string,\n\n /**\n * `onNewComment` function accepts one parameter `comment` which is a\n * JavaScript object with comment `id` and `text`. This allows you to track\n * user comments and replies and run a script after a comment is posted.\n */\n onNewComment: _propTypes2.default.func,\n\n /**\n * `language` tells the Disqus service which language should be used.\n * Please refer to https://www.transifex.com/disqus/disqus/ on which languages can be used\n * If undefined, English is used as default one\n */\n language: _propTypes2.default.string\n};\n\nDisqusThread.defaultProps = {\n url: typeof window === 'undefined' ? null : window.location.href\n};\n\nexports.default = DisqusThread;"],"sourceRoot":""}