[
  {
    "path": ".gitignore",
    "content": "dist/\nbuild/\n*.pyc\n.DS_Store\n*.egg-info\nnpm-debug.log\nnode_modules\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Tom Dyson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "graft wagalytics\nglobal-exclude __pycache__\nglobal-exclude *.py[co]\n"
  },
  {
    "path": "README.md",
    "content": "# Wagtail Analytics\n\n(Last Updated 12/17/19 for Wagtail v2.x)\n\nThis module provides a simple dashboard of Google Analytics data, integrated into the Wagtail admin UI. Tested on Wagtail 2.0+.\n\n![Screenshot](screenshot.png)\n\n![Screenshot](wagalytics-page-stats.png)\n\n## Instructions\n\n1. [Create a service account](https://ga-dev-tools.appspot.com/embed-api/server-side-authorization) and download the JSON key (Credentials > Create Credentials > API key)\n1. Make sure the [Analytics API is enabled for your project](https://console.developers.google.com/apis/api/analytics.googleapis.com) (See [issue 2](https://github.com/tomdyson/wagalytics/issues/2))\n1. Add the [service account email address](https://console.developers.google.com/permissions/serviceaccounts) as a read-only user in Google Analytics (Admin > User Management)\n1. Find the ID for your Google Analytics property (Admin > Property > View Settings, note: this is NOT the key that begins with \"UA-\")\n1. Store your JSON key somewhere safe, and do not check it into your repo\n1. `pip install wagalytics`\n1. Add 'wagalytics' to your INSTALLED_APPS\n1. Add 'wagtailfontawesome' to INSTALLED_APPS if it's not there already\n1. Update your settings:\n - `GA_KEY_FILEPATH = '/path/to/secure/directory/your-key.json'`\n\n or when using environment variables (e.g. Heroku):\n - `GA_KEY_CONTENT = 'content_of_your_key.json'`\n - `GA_VIEW_ID = 'ga:xxxxxxxx'`\n\nIf you get CryptoUnavailableError errors, you probably need to `pip install PyOpenSSL` and/or `pip install pycrypto`. See [StackOverflow](http://stackoverflow.com/questions/27305867/google-api-access-using-service-account-oauth2client-client-cryptounavailableerr).\n\nEnsure that your code snippet is included on each page you want to be tracked (likely by putting it in your base.html template.) (Admin > Property > Tracking Code)\n\n## Multisite Support\n\nTo enable multisite support you'll need to update your Wagalytics settings _and_ have `wagtail.contrib.settings` installed. Sites can use a `GA_KEY_FILEPATH` or a `GA_KEY_CONTENT` key, but it's best not to use both.\n\nIn the snippet below, you'll see `site_id`. This is the ID (Primary Key) of your Wagtail Site.\n```python\n# Use either the GA_KEY_FILEPATH or the GA_KEY_CONTENT setting on your sites,\n# but don't use both\nWAGALYTICS_SETTINGS = {\n    site_id: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_FILEPATH': '/path/to/secure/directory/your-key.json',\n    },\n    site_id: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_CONTENT': 'content_of_your_key.json',\n\t}\n}\n```\nFor every Wagalytics site you add in your multisite `WAGALYTICS_SETTINGS` you'll need to make sure you have the proper GA View ID and API Key. One View ID and API Key won't work for all your sites automatically.\n\nHere's a working example of multisite WAGALYTICS_SETTINGS:\n\n```python\nWAGALYTICS_SETTINGS = {\n\t# My default site. 2 is the site ID. This one uses GA_KEY_FILEPATH.\n    2: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_FILEPATH': '/path/to/secure/directory/your-key.json',\n    },\n    # The secondary site. 3 is the Site ID. This one uses GA_KEY_CONTENT.\n    3: {\n        'GA_KEY_CONTENT': 'content_of_your_key.json',\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n    }\n}\n```\n\n## Wagalytics Developers\n\nDevelopers will need to carry out the following steps after cloning wagalytics:\n\n- Ensure NodeJS & NPM are installed\n- Run `npm install` then `npm run build` in the top level wagalytics directory\n\nYou will need to run `npm run build` anytime the javascript source is updated.\n\n### TODO\n\n - [ ] allow configuration of results\n - [x] better styling, e.g. using [chart.js](https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/)\n - [ ] Throw an error if the relevant settings aren't available\n - [x] add [per-page results](https://github.com/tomdyson/wagalytics/issues/12)\n\n### Notes\n\nThis module doesn't help with recording user activity. See [the Wagtail docs](http://docs.wagtail.io/en/latest/topics/writing_templates.html?highlight=analytics#varying-output-between-preview-and-live) and [StackOverflow](http://stackoverflow.com/a/1272312/181793) for pointers on how to avoid gathering data during preview and testing.\n\n### Contributors\n\n - Thijs Kramer\n - Stefan Schärmeli\n - Alex Gleason\n - James Ramm\n - Jake Kent\n - Kalob Taulien\n - Julius Parishy\n"
  },
  {
    "path": "client/src/wagalytics.js",
    "content": "import moment from 'moment';\n\n$(document).ready(() => {\n    const el = document.getElementById('wagalytics-data');\n    setup(el.dataset.token, el.dataset.viewId);\n});\n\n/**\n * Initialises google analytics and creates the dashboard charts\n * @param {*} token_url\n * @param {*} view_id\n */\nfunction setup(token_url, view_id) {\n    if (!window.google || !window.google.load) {\n        var tag = document.createElement('script');\n        tag.type = 'text/javascript';\n        tag.src = 'https://www.google.com/jsapi';\n        var s = document.getElementsByTagName('script')[0];\n        s.parentNode.insertBefore(tag, s);\n    }\n\n    gapi.analytics.ready(function () {\n        $.get(token_url, function (data) {\n            gapi.analytics.auth.authorize({\n                'serverAuth': {\n                    'access_token': data\n                }\n            });\n        });\n\n        // Create the dashboard controller\n        const dashboard = new Dashboard(view_id);\n        dashboard.refresh();\n    });\n}\n\n/**\n * Wagtails' colour palette\n */\nconst colors = {\n    BLUE: '#71b2d4',\n    GREEN: '#189370',\n    ORANGE: '#e9b04d',\n    RED: '#cd3238',\n    SALMON: '#f37e77',\n    SALMON_LIGHT: '#fcf2f2',\n    TEAL: '#43b1b0',\n    TEAL_DARKER: '#358c8b',\n    TEAL_DARK: '#246060'\n};\n\n/**\n * Sets up the various charts and controls their UI functionality\n */\nclass Dashboard {\n    constructor(view_id) {\n        this.view_id = view_id;\n        this.start_date_input = document.getElementById(\"id_date_from\");\n        this.end_date_input = document.getElementById(\"id_date_to\");\n        this.export_btn = document.getElementById(\"export-button\");\n        this.start_date_input.addEventListener('change', () => this.refresh());\n        this.end_date_input.addEventListener('change', () => this.refresh());\n        $(document.getElementById(\"export\")).submit(() => {\n            $(document.getElementById('export-data')).val(JSON.stringify(this.data));\n        });\n\n        this.data = {};\n\n        this.tooltips = {\n            enabled: true,\n            mode: 'label',\n            callbacks: {\n                title: function (tooltipItems, data) {\n                    var idx = tooltipItems[0].index;\n                    return 'Title:' + data.labels[idx];//do something with title\n                },\n                label: function (tooltipItems, data) {\n                    return tooltipItems.xLabel;\n                }\n            }\n        }\n    }\n\n    setLoading(id) {\n        document.getElementById(id).innerHTML = '<i class=\"icon icon-spinner\"></i>';\n    }\n\n    /**\n     * Setup the charts within the specified date range (last 7 or last 30 days)\n     * @param {int} range - use the `ranges` enum to select. (Can be 1 or 2)\n     */\n    refresh() {\n        this.sessionsLineChart();\n        this.popularPagesTable();\n        this.topReferrersTable();\n    }\n\n    /**\n     * Query the google API for data within\n     * the set range.\n     * @param {Object} options Options specifying metrics, dimensions and any\n     *  other keys accepted by gapi.\n     */\n    getQuery(options) {\n      $(this.export_btn).prop('disabled', true);\n      return query(Object.assign({\n          ids: this.view_id,\n          'start-date': $(this.start_date_input).val(),\n          'end-date': $(this.end_date_input).val()\n      }, options));\n    }\n\n    /**\n     * Create a line chart showing number of sessions per day\n     */\n    sessionsLineChart() {\n        const id = 'sessions-line-chart-container';\n        this.setLoading(id);\n        this.getQuery(\n            {\n                dimensions: 'ga:date,ga:nthDay',\n                metrics: 'ga:sessions'\n            }).then(results => {\n                this.data['sessions'] = results.rows;\n                $(this.export_btn).prop('disabled', false);\n                $(this.export_btn).removeClass('button-longrunning-active');\n\n                var data1 = results.rows.map(row => row[2]);\n                var labels = results.rows.map(row => row[0]);\n                labels = labels.map(function (label) {\n                    return moment(label, 'YYYYMMDD').format('ll');\n                });\n\n                var data = {\n                    labels: labels,\n                    datasets: [\n                        {\n                            label: 'Sessions',\n                            backgroundColor: colors.SALMON_LIGHT,\n                            borderColor: colors.SALMON,\n                            pointBackgroundColor: colors.SALMON,\n                            pointBorderColor: '#fff',\n                            data: data1\n                        }\n                    ]\n                };\n                new Chart(makeCanvas(id), {\n                    type: 'line',\n                    data: data,\n                    options: {\n                        legend: {\n                            display: false\n                        },\n                        scales: {\n                            xAxes: [{\n                                ticks: {\n                                    autoSkip: true,\n                                    maxTicksLimit: 4,\n                                    maxRotation: 0\n                                }\n                            }]\n                        }\n                    }\n                });\n                //generateLegend('legend-1-container', data.datasets);\n            });\n    }\n\n    /**\n     * Create table showing 25 most popular pages\n     */\n    popularPagesTable() {\n        const id = 'popular-pages-table-container';\n        this.setLoading(id);\n        const queryData = {\n            'metrics': 'ga:pageviews',\n            'dimensions': 'ga:hostname,ga:pagePath',\n            'sort': '-ga:pageviews',\n            'max-results': 25\n        };\n        this.getQuery(queryData).then(results => {\n\n            // The results contain duplicates for variations in hostname\n            // e.g. if someone visit http://mywebsite.com vs http://www.mywebsite.com\n            // Here we aggregate these results into single values per page, regardless\n            // of hostname\n            var i = 0;\n            const rows = results.rows;\n            const l = rows.length;\n            const bars = {};\n            for (i; i < l; ++i) {\n                const key = rows[i][1]\n                if (bars.hasOwnProperty(key)) {\n                    bars[key][1] += parseInt(rows[i][2], 10);\n                }\n                else {\n                    bars[key] = [key, parseInt(rows[i][2], 10)];\n                }\n            }\n\n            this.data['pages'] = Object.values(bars);\n            $(this.export_btn).prop('disabled', false);\n            $(this.export_btn).removeClass('button-longrunning-active');\n\n            const table = createTable(['Page URL', 'Views'], Object.values(bars));\n            const pager = paginateTable(table);\n            const container = document.getElementById(id);\n            container.innerHTML = '';\n            container.appendChild(table);\n            $(container).append(pager);\n        });\n    }\n\n    /**\n     * Create table showing 25 top referrers\n     */\n    topReferrersTable() {\n        const id = 'top-referrers-table-container';\n        this.setLoading(id);\n        const queryData = {\n            'metrics': 'ga:pageviews',\n            'dimensions': 'ga:fullReferrer',\n            'sort': '-ga:pageviews',\n            'max-results': 25\n        };\n\n        this.getQuery(queryData).then(results => {\n            this.data['referrers'] = results.rows;\n            $(this.export_btn).prop('disabled', false);\n            $(this.export_btn).removeClass('button-longrunning-active');\n\n            const table = createTable(['Source', 'Views'], results.rows);\n            const pager = paginateTable(table);\n            const container = document.getElementById(id);\n            container.innerHTML = '';\n            container.appendChild(table);\n            $(container).append(pager);\n        });\n    }\n}\n\n/**\n * Create a table\n * @param {*} headings\n * @param {*} rows\n */\nfunction createTable(headings, rows){\n    const table = document.createElement('table');\n    table.className = 'listing';\n    const head = table.createTHead();\n    const headerRow = head.insertRow(0);\n    let i = 0;\n    for (i; i < headings.length; ++i) {\n        const heading = headerRow.insertCell(i);\n        heading.innerHTML = headings[i];\n        heading.className = 'title';\n    }\n    const body = table.createTBody();\n    for (i = 0; i < rows.length; ++i) {\n        const rowData = rows[i];\n        const row = body.insertRow(i);\n        for (let j = 0; j < rowData.length; ++j) {\n            row.insertCell(j).innerHTML = rowData[j];\n        }\n    }\n    return table;\n}\n\n/**\n * Client side pagination of a table.\n * Table rows are hidden/shown according to the page number\n * @param {*} table\n */\nfunction paginateTable(table) {\n    let currentPage = 0;\n    const numPerPage = 5;\n    const $table = $(table);\n\n    // This is the function which controls display of content\n    $table.bind('repaginate', function() {\n        $table.find('tbody tr').hide().slice(currentPage * numPerPage, (currentPage + 1) * numPerPage).show();\n        let $pager = $table.next();\n        if (currentPage <= 0) {\n            $pager.find('.prev').addClass('disabled');\n        } else {\n            $pager.find('.prev').removeClass('disabled');\n        }\n        if (currentPage >= numPages - 1) {\n            $pager.find('.next').addClass('disabled');\n        } else {\n            $pager.find('.next').removeClass('disabled');\n        }\n    });\n    $table.trigger('repaginate');\n    const numRows = $table.find('tbody tr').length;\n    const numPages = Math.ceil(numRows / numPerPage);\n\n    // Create the page selector element and add callbacks to handle setting the page\n    const $pager = $(`\n        <div class=\"pagination\">\n            <p>Page <span class=\"page-num\">1</span> of ${numPages}</p>\n            <ul>\n                <li class=\"prev disabled\">\n                    <a class=\"icon icon-arrow-left\" href=\"#\">Previous</a>\n                </li>\n                <li class=\"next\">\n                    <a class=\"icon icon-arrow-right-after\" href=\"#\">Next</a>\n                </li>\n            </ul>\n        </div>`);\n\n    // Previous page click handler\n    $pager.find('.prev a').bind('click', event => {\n        event.preventDefault();\n        currentPage -= 1;\n        if (currentPage < 0) {\n            currentPage = 0;\n        }\n        $pager.find('.page-num').text(`${currentPage + 1}`);\n        $table.trigger('repaginate');\n    });\n\n    // Next page click handler\n    $pager.find('.next a').bind('click', event => {\n        event.preventDefault();\n        currentPage += 1;\n        if (currentPage >= numPages) {\n            currentPage = numPages - 1;\n        }\n        $pager.find('.page-num').text(`${currentPage + 1}`);\n        $table.trigger('repaginate');\n    });\n    return $pager;\n}\n\n\n/**\n * Extend the Embed APIs `gapi.analytics.report.Data` component to\n * return a promise the is fulfilled with the value returned by the API.\n * @param {Object} params The request parameters.\n * @return {Promise} A promise.\n */\nfunction query(params) {\n    return new Promise(function (resolve, reject) {\n        var data = new gapi.analytics.report.Data({ query: params });\n        data.once('success', function (response) { resolve(response); })\n            .once('error', function (response) { reject(response); })\n            .execute();\n    });\n}\n\n\n/**\n * Create a new canvas inside the specified element. Set it to be the width\n * and height of its container.\n * @param {string} id The id attribute of the element to host the canvas.\n * @return {RenderingContext} The 2D canvas context.\n */\nfunction makeCanvas(id) {\n    var container = document.getElementById(id);\n    var canvas = document.createElement('canvas');\n    var ctx = canvas.getContext('2d');\n\n    container.innerHTML = '';\n    canvas.width = container.offsetWidth;\n    canvas.height = container.offsetHeight;\n    container.appendChild(canvas);\n\n    return ctx;\n}\n\n/**\n * Create a visual legend inside the specified element based off of a\n * Chart.js dataset.\n * @param {string} id The id attribute of the element to host the legend.\n * @param {Array.<Object>} items A list of labels and colors for the legend.\n */\nfunction generateLegend(id, items) {\n    var legend = document.getElementById(id);\n    legend.innerHTML = items.map(function (item) {\n        var color = item.color || item.fillColor;\n        var label = item.label;\n        return '<li><i style=\"background:' + color + '\"></i>' +\n            escapeHtml(label) + '</li>';\n    }).join('');\n}\n\n/**\n * Escapes a potentially unsafe HTML string.\n * @param {string} str An string that may contain HTML entities.\n * @return {string} The HTML-escaped string.\n */\nfunction escapeHtml(str) {\n    var div = document.createElement('div');\n    div.appendChild(document.createTextNode(str));\n    return div.innerHTML;\n}\n\n// Set some global Chart.js defaults.\nChart.defaults.global.animationSteps = 60;\nChart.defaults.global.animationEasing = 'easeInOutQuart';\nChart.defaults.global.responsive = true;\nChart.defaults.global.maintainAspectRatio = false;\n"
  },
  {
    "path": "client/webpack.config.js",
    "content": "var path = require('path');\nvar webpack = require('webpack');\n\nmodule.exports = {\n  context: __dirname,\n  entry: {\n    wagalytics: './src/wagalytics.js',\n    vendors: [\n      'moment',\n    ]\n  },\n  output: {\n      path: path.resolve('./wagalytics/static/wagalytics/'),\n      filename: \"[name].bundle.js\"\n  },\n\n  module: {\n    rules: [{\n      test: /\\.jsx?$/,\n      exclude: /node_modules/,\n      use: [{\n        loader: 'babel-loader',\n        options: {\n          presets: [],\n        },\n      },\n      ]\n    }]\n  },\n\n  mode: 'production',\n\n  plugins: [\n    new webpack.DefinePlugin({\n      'process.env': {\n        NODE_ENV: JSON.stringify('production')\n      }\n    }),\n    new webpack.SourceMapDevToolPlugin({\n      filename: '[name].js.map',\n      append: '\\n//# sourceMappingURL=http://127.0.0.1:3001/dist/js/[url]'\n    }),\n    new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/)\n  ]\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"wagalytics\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/tomdyson/wagalytics.git\"\n  },\n  \"author\": \"Tom Dyson\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"build\": \"npx webpack --config ./client/webpack.config.js\",\n    \"watch\": \"npx webpack --config ./client/webpack.config.js --watch\",\n    \"dist\": \"npm install && npx webpack --config ./client/webpack.config.js\"\n  },\n  \"babel\": {\n    \"presets\": [\n      \"@babel/preset-env\"\n    ]\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.0.0\",\n    \"@babel/plugin-proposal-class-properties\": \"^7.0.0\",\n    \"@babel/plugin-proposal-decorators\": \"^7.0.0\",\n    \"@babel/plugin-proposal-do-expressions\": \"^7.0.0\",\n    \"@babel/plugin-proposal-export-default-from\": \"^7.0.0\",\n    \"@babel/plugin-proposal-export-namespace-from\": \"^7.0.0\",\n    \"@babel/plugin-proposal-function-bind\": \"^7.0.0\",\n    \"@babel/plugin-proposal-function-sent\": \"^7.0.0\",\n    \"@babel/plugin-proposal-json-strings\": \"^7.0.0\",\n    \"@babel/plugin-proposal-logical-assignment-operators\": \"^7.0.0\",\n    \"@babel/plugin-proposal-nullish-coalescing-operator\": \"^7.0.0\",\n    \"@babel/plugin-proposal-numeric-separator\": \"^7.0.0\",\n    \"@babel/plugin-proposal-optional-chaining\": \"^7.0.0\",\n    \"@babel/plugin-proposal-pipeline-operator\": \"^7.0.0\",\n    \"@babel/plugin-proposal-throw-expressions\": \"^7.0.0\",\n    \"@babel/plugin-syntax-dynamic-import\": \"^7.0.0\",\n    \"@babel/plugin-syntax-import-meta\": \"^7.0.0\",\n    \"@babel/polyfill\": \"^7.0.0\",\n    \"@babel/preset-env\": \"^7.0.0\",\n    \"babel-loader\": \"^8.0.0\",\n    \"webpack\": \"^4.43.0\",\n    \"webpack-cli\": \"^3.3.11\"\n  },\n  \"dependencies\": {\n    \"moment\": \"^2.17.1\"\n  }\n}\n"
  },
  {
    "path": "pytest.ini",
    "content": "[pytest]\nDJANGO_SETTINGS_MODULE = wagalytics.tests.settings\npython_files = tests.py test_*.py *_tests.py\n"
  },
  {
    "path": "setup.cfg",
    "content": "[metadata]\ndescription-file = README.md\n\n[bdist_wheel]\nuniversal=1\n"
  },
  {
    "path": "setup.py",
    "content": "from os import path\n\nfrom setuptools import setup, find_packages\n\ntry:\n    from wagtail.utils.setup import sdist\n    cmdclass = {\n        'sdist': sdist\n    }\nexcept ModuleNotFoundError:\n    cmdclass = {}\n\nfrom wagalytics import __version__\n\n\ntesting_extras = [\n    'pytest==5.3.1',\n    'pytest-django==3.7.0',\n    'wagtail-factories==2.0.0',\n    'factory-boy==2.11.0',\n]\n\nsetup(\n    name='wagalytics',\n    version=__version__,\n    description='Show Google Analytics data in Wagtail.',\n    long_description='See https://github.com/tomdyson/wagalytics for details',\n    url='https://github.com/tomdyson/wagalytics',\n    author='Tom Dyson',\n    author_email='tom+wagalytics@torchbox.com',\n    license='MIT',\n    classifiers=[\n        \"Environment :: Web Environment\",\n        \"Framework :: Django\",\n        \"Intended Audience :: Developers\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python\",\n        'Topic :: Internet :: WWW/HTTP',\n        \"Topic :: Internet :: WWW/HTTP :: Dynamic Content\",\n    ],\n    keywords='development',\n    packages=find_packages(),\n    include_package_data=True,\n    zip_safe=False,\n    install_requires=[\n        \"wagtail>=2.0\",\n        \"Django>=2.0.13\",\n        \"oauth2client\",\n        \"wagtailfontawesome>=1.1.2\",\n        \"pyexcel-ods==0.5.3\"\n    ],\n    cmdclass=cmdclass,\n    extras_require={\n        'testing': testing_extras,\n    },\n)\n"
  },
  {
    "path": "wagalytics/__init__.py",
    "content": "__version__ = '1.3'\n"
  },
  {
    "path": "wagalytics/static/wagalytics/.gitkeep",
    "content": ""
  },
  {
    "path": "wagalytics/static/wagalytics/vendors.bundle.js",
    "content": "!function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=3)}([function(e,t,n){(function(e){e.exports=function(){\"use strict\";var t,n;function s(){return t.apply(null,arguments)}function i(e){return e instanceof Array||\"[object Array]\"===Object.prototype.toString.call(e)}function r(e){return null!=e&&\"[object Object]\"===Object.prototype.toString.call(e)}function a(e){return void 0===e}function o(e){return\"number\"==typeof e||\"[object Number]\"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||\"[object Date]\"===Object.prototype.toString.call(e)}function l(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,\"toString\")&&(e.toString=t.toString),d(t,\"valueOf\")&&(e.valueOf=t.valueOf),e}function c(e,t,n,s){return St(e,t,n,s,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){if(null==e._isValid){var t=f(e),s=n.call(t.parsedDateParts,(function(e){return null!=e})),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&s);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function _(e){var t=c(NaN);return null!=e?h(f(t),e):f(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var y=s.momentProperties=[];function g(e,t){var n,s,i;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=f(t)),a(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)a(i=t[s=y[n]])||(e[s]=i);return e}var p=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===p&&(p=!0,s.updateOffset(this),p=!1)}function w(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function M(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function S(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=M(t)),n}function D(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&S(e[s])!==S(t[s]))&&a++;return a+r}function k(e){!1===s.suppressDeprecationWarnings&&\"undefined\"!=typeof console&&console.warn&&console.warn(\"Deprecation warning: \"+e)}function Y(e,t){var n=!0;return h((function(){if(null!=s.deprecationHandler&&s.deprecationHandler(null,e),n){for(var i,r=[],a=0;a<arguments.length;a++){if(i=\"\",\"object\"==typeof arguments[a]){for(var o in i+=\"\\n[\"+a+\"] \",arguments[0])i+=o+\": \"+arguments[0][o]+\", \";i=i.slice(0,-2)}else i=arguments[a];r.push(i)}k(e+\"\\nArguments: \"+Array.prototype.slice.call(r).join(\"\")+\"\\n\"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var O,T={};function b(e,t){null!=s.deprecationHandler&&s.deprecationHandler(e,t),T[e]||(k(t),T[e]=!0)}function x(e){return e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}function P(e,t){var n,s=h({},e);for(n in t)d(t,n)&&(r(e[n])&&r(t[n])?(s[n]={},h(s[n],e[n]),h(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)d(e,n)&&!d(t,n)&&r(e[n])&&(s[n]=h({},s[n]));return s}function W(e){null!=e&&this.set(e)}s.suppressDeprecationWarnings=!1,s.deprecationHandler=null,O=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var C={};function H(e,t){var n=e.toLowerCase();C[n]=C[n+\"s\"]=C[t]=e}function R(e){return\"string\"==typeof e?C[e]||C[e.toLowerCase()]:void 0}function F(e){var t,n,s={};for(n in e)d(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var L={};function U(e,t){L[e]=t}function N(e,t,n){var s=\"\"+Math.abs(e),i=t-s.length;return(e>=0?n?\"+\":\"\":\"-\")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var G=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,V=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},j={};function I(e,t,n,s){var i=s;\"string\"==typeof s&&(i=function(){return this[s]()}),e&&(j[e]=i),t&&(j[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),n&&(j[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=Z(t,e.localeData()),E[t]=E[t]||function(e){var t,n,s,i=e.match(G);for(t=0,n=i.length;t<n;t++)j[i[t]]?i[t]=j[i[t]]:i[t]=(s=i[t]).match(/\\[[\\s\\S]/)?s.replace(/^\\[|\\]$/g,\"\"):s.replace(/\\\\/g,\"\");return function(t){var s,r=\"\";for(s=0;s<n;s++)r+=x(i[s])?i[s].call(t,e):i[s];return r}}(t),E[t](e)):e.localeData().invalidDate()}function Z(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(V.lastIndex=0;n>=0&&V.test(e);)e=e.replace(V,s),V.lastIndex=0,n-=1;return e}var z=/\\d/,$=/\\d\\d/,J=/\\d{3}/,q=/\\d{4}/,B=/[+-]?\\d{6}/,Q=/\\d\\d?/,X=/\\d\\d\\d\\d?/,K=/\\d\\d\\d\\d\\d\\d?/,ee=/\\d{1,3}/,te=/\\d{1,4}/,ne=/[+-]?\\d{1,6}/,se=/\\d+/,ie=/[+-]?\\d+/,re=/Z|[+-]\\d\\d:?\\d\\d/gi,ae=/Z|[+-]\\d\\d(?::?\\d\\d)?/gi,oe=/[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,ue={};function le(e,t,n){ue[e]=x(t)?t:function(e,s){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(he(e.replace(\"\\\\\",\"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,(function(e,t,n,s,i){return t||n||s||i}))))}function he(e){return e.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}var ce={};function fe(e,t){var n,s=t;for(\"string\"==typeof e&&(e=[e]),o(t)&&(s=function(e,n){n[t]=S(e)}),n=0;n<e.length;n++)ce[e[n]]=s}function me(e,t){fe(e,(function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)}))}function _e(e,t,n){null!=t&&d(ce,e)&&ce[e](t,n._a,n,e)}function ye(e){return ge(e)?366:365}function ge(e){return e%4==0&&e%100!=0||e%400==0}I(\"Y\",0,0,(function(){var e=this.year();return e<=9999?\"\"+e:\"+\"+e})),I(0,[\"YY\",2],0,(function(){return this.year()%100})),I(0,[\"YYYY\",4],0,\"year\"),I(0,[\"YYYYY\",5],0,\"year\"),I(0,[\"YYYYYY\",6,!0],0,\"year\"),H(\"year\",\"y\"),U(\"year\",1),le(\"Y\",ie),le(\"YY\",Q,$),le(\"YYYY\",te,q),le(\"YYYYY\",ne,B),le(\"YYYYYY\",ne,B),fe([\"YYYYY\",\"YYYYYY\"],0),fe(\"YYYY\",(function(e,t){t[0]=2===e.length?s.parseTwoDigitYear(e):S(e)})),fe(\"YY\",(function(e,t){t[0]=s.parseTwoDigitYear(e)})),fe(\"Y\",(function(e,t){t[0]=parseInt(e,10)})),s.parseTwoDigitYear=function(e){return S(e)+(S(e)>68?1900:2e3)};var pe,ve=we(\"FullYear\",!0);function we(e,t){return function(n){return null!=n?(Se(this,e,n),s.updateOffset(this,t),this):Me(this,e)}}function Me(e,t){return e.isValid()?e._d[\"get\"+(e._isUTC?\"UTC\":\"\")+t]():NaN}function Se(e,t,n){e.isValid()&&!isNaN(n)&&(\"FullYear\"===t&&ge(e.year())&&1===e.month()&&29===e.date()?e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n,e.month(),De(n,e.month())):e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n))}function De(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ge(e)?29:28:31-s%7%2}pe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I(\"M\",[\"MM\",2],\"Mo\",(function(){return this.month()+1})),I(\"MMM\",0,0,(function(e){return this.localeData().monthsShort(this,e)})),I(\"MMMM\",0,0,(function(e){return this.localeData().months(this,e)})),H(\"month\",\"M\"),U(\"month\",8),le(\"M\",Q),le(\"MM\",Q,$),le(\"MMM\",(function(e,t){return t.monthsShortRegex(e)})),le(\"MMMM\",(function(e,t){return t.monthsRegex(e)})),fe([\"M\",\"MM\"],(function(e,t){t[1]=S(e)-1})),fe([\"MMM\",\"MMMM\"],(function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[1]=i:f(n).invalidMonth=e}));var ke=/D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,Ye=\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),Oe=\"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\");function Te(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=c([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,\"\").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,\"\").toLocaleLowerCase();return n?\"MMM\"===t?-1!==(i=pe.call(this._shortMonthsParse,a))?i:null:-1!==(i=pe.call(this._longMonthsParse,a))?i:null:\"MMM\"===t?-1!==(i=pe.call(this._shortMonthsParse,a))||-1!==(i=pe.call(this._longMonthsParse,a))?i:null:-1!==(i=pe.call(this._longMonthsParse,a))||-1!==(i=pe.call(this._shortMonthsParse,a))?i:null}function be(e,t){var n;if(!e.isValid())return e;if(\"string\"==typeof t)if(/^\\d+$/.test(t))t=S(t);else if(!o(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),De(e.year(),t)),e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+\"Month\"](t,n),e}function xe(e){return null!=e?(be(this,e),s.updateOffset(this,!0),this):Me(this,\"Month\")}var Pe=oe,We=oe;function Ce(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=c([2e3,t]),s.push(this.monthsShort(n,\"\")),i.push(this.months(n,\"\")),r.push(this.months(n,\"\")),r.push(this.monthsShort(n,\"\"));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=he(s[t]),i[t]=he(i[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp(\"^(\"+r.join(\"|\")+\")\",\"i\"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp(\"^(\"+i.join(\"|\")+\")\",\"i\"),this._monthsShortStrictRegex=new RegExp(\"^(\"+s.join(\"|\")+\")\",\"i\")}function He(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function Re(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Fe(e,t,n){var s=7+t-n;return-(7+Re(e,0,s).getUTCDay()-t)%7+s-1}function Le(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Fe(e,s,i);return o<=0?a=ye(r=e-1)+o:o>ye(e)?(r=e+1,a=o-ye(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ue(e,t,n){var s,i,r=Fe(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ne(i=e.year()-1,t,n):a>Ne(e.year(),t,n)?(s=a-Ne(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ne(e,t,n){var s=Fe(e,t,n),i=Fe(e+1,t,n);return(ye(e)-s+i)/7}I(\"w\",[\"ww\",2],\"wo\",\"week\"),I(\"W\",[\"WW\",2],\"Wo\",\"isoWeek\"),H(\"week\",\"w\"),H(\"isoWeek\",\"W\"),U(\"week\",5),U(\"isoWeek\",5),le(\"w\",Q),le(\"ww\",Q,$),le(\"W\",Q),le(\"WW\",Q,$),me([\"w\",\"ww\",\"W\",\"WW\"],(function(e,t,n,s){t[s.substr(0,1)]=S(e)})),I(\"d\",0,\"do\",\"day\"),I(\"dd\",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),I(\"ddd\",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),I(\"dddd\",0,0,(function(e){return this.localeData().weekdays(this,e)})),I(\"e\",0,0,\"weekday\"),I(\"E\",0,0,\"isoWeekday\"),H(\"day\",\"d\"),H(\"weekday\",\"e\"),H(\"isoWeekday\",\"E\"),U(\"day\",11),U(\"weekday\",11),U(\"isoWeekday\",11),le(\"d\",Q),le(\"e\",Q),le(\"E\",Q),le(\"dd\",(function(e,t){return t.weekdaysMinRegex(e)})),le(\"ddd\",(function(e,t){return t.weekdaysShortRegex(e)})),le(\"dddd\",(function(e,t){return t.weekdaysRegex(e)})),me([\"dd\",\"ddd\",\"dddd\"],(function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:f(n).invalidWeekday=e})),me([\"d\",\"e\",\"E\"],(function(e,t,n,s){t[s]=S(e)}));var Ge=\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),Ve=\"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\"),Ee=\"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");function je(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=c([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,\"\").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,\"\").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,\"\").toLocaleLowerCase();return n?\"dddd\"===t?-1!==(i=pe.call(this._weekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:\"dddd\"===t?-1!==(i=pe.call(this._weekdaysParse,a))||-1!==(i=pe.call(this._shortWeekdaysParse,a))||-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:\"ddd\"===t?-1!==(i=pe.call(this._shortWeekdaysParse,a))||-1!==(i=pe.call(this._weekdaysParse,a))||-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:-1!==(i=pe.call(this._minWeekdaysParse,a))||-1!==(i=pe.call(this._weekdaysParse,a))||-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:null}var Ie=oe,Ae=oe,Ze=oe;function ze(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=c([2e3,1]).day(t),s=this.weekdaysMin(n,\"\"),i=this.weekdaysShort(n,\"\"),r=this.weekdays(n,\"\"),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp(\"^(\"+l.join(\"|\")+\")\",\"i\"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp(\"^(\"+u.join(\"|\")+\")\",\"i\"),this._weekdaysShortStrictRegex=new RegExp(\"^(\"+o.join(\"|\")+\")\",\"i\"),this._weekdaysMinStrictRegex=new RegExp(\"^(\"+a.join(\"|\")+\")\",\"i\")}function $e(){return this.hours()%12||12}function Je(e,t){I(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function qe(e,t){return t._meridiemParse}I(\"H\",[\"HH\",2],0,\"hour\"),I(\"h\",[\"hh\",2],0,$e),I(\"k\",[\"kk\",2],0,(function(){return this.hours()||24})),I(\"hmm\",0,0,(function(){return\"\"+$e.apply(this)+N(this.minutes(),2)})),I(\"hmmss\",0,0,(function(){return\"\"+$e.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),I(\"Hmm\",0,0,(function(){return\"\"+this.hours()+N(this.minutes(),2)})),I(\"Hmmss\",0,0,(function(){return\"\"+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),Je(\"a\",!0),Je(\"A\",!1),H(\"hour\",\"h\"),U(\"hour\",13),le(\"a\",qe),le(\"A\",qe),le(\"H\",Q),le(\"h\",Q),le(\"k\",Q),le(\"HH\",Q,$),le(\"hh\",Q,$),le(\"kk\",Q,$),le(\"hmm\",X),le(\"hmmss\",K),le(\"Hmm\",X),le(\"Hmmss\",K),fe([\"H\",\"HH\"],3),fe([\"k\",\"kk\"],(function(e,t,n){var s=S(e);t[3]=24===s?0:s})),fe([\"a\",\"A\"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),fe([\"h\",\"hh\"],(function(e,t,n){t[3]=S(e),f(n).bigHour=!0})),fe(\"hmm\",(function(e,t,n){var s=e.length-2;t[3]=S(e.substr(0,s)),t[4]=S(e.substr(s)),f(n).bigHour=!0})),fe(\"hmmss\",(function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=S(e.substr(0,s)),t[4]=S(e.substr(s,2)),t[5]=S(e.substr(i)),f(n).bigHour=!0})),fe(\"Hmm\",(function(e,t,n){var s=e.length-2;t[3]=S(e.substr(0,s)),t[4]=S(e.substr(s))})),fe(\"Hmmss\",(function(e,t,n){var s=e.length-4,i=e.length-2;t[3]=S(e.substr(0,s)),t[4]=S(e.substr(s,2)),t[5]=S(e.substr(i))}));var Be,Qe=we(\"Hours\",!0),Xe={calendar:{sameDay:\"[Today at] LT\",nextDay:\"[Tomorrow at] LT\",nextWeek:\"dddd [at] LT\",lastDay:\"[Yesterday at] LT\",lastWeek:\"[Last] dddd [at] LT\",sameElse:\"L\"},longDateFormat:{LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},invalidDate:\"Invalid date\",ordinal:\"%d\",dayOfMonthOrdinalParse:/\\d{1,2}/,relativeTime:{future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",ss:\"%d seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"},months:Ye,monthsShort:Oe,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:Ee,weekdaysShort:Ve,meridiemParse:/[ap]\\.?m?\\.?/i},Ke={},et={};function tt(e){return e?e.toLowerCase().replace(\"_\",\"-\"):e}function nt(t){var n=null;if(!Ke[t]&&void 0!==e&&e&&e.exports)try{n=Be._abbr,!function(){var e=new Error(\"Cannot find module 'undefined'\");throw e.code=\"MODULE_NOT_FOUND\",e}(),st(n)}catch(e){}return Ke[t]}function st(e,t){var n;return e&&((n=a(t)?rt(e):it(e,t))?Be=n:\"undefined\"!=typeof console&&console.warn&&console.warn(\"Locale \"+e+\" not found. Did you forget to load it?\")),Be._abbr}function it(e,t){if(null!==t){var n,s=Xe;if(t.abbr=e,null!=Ke[e])b(\"defineLocaleOverride\",\"use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.\"),s=Ke[e]._config;else if(null!=t.parentLocale)if(null!=Ke[t.parentLocale])s=Ke[t.parentLocale]._config;else{if(null==(n=nt(t.parentLocale)))return et[t.parentLocale]||(et[t.parentLocale]=[]),et[t.parentLocale].push({name:e,config:t}),null;s=n._config}return Ke[e]=new W(P(s,t)),et[e]&&et[e].forEach((function(e){it(e.name,e.config)})),st(e),Ke[e]}return delete Ke[e],null}function rt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Be;if(!i(e)){if(t=nt(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=tt(e[r]).split(\"-\")).length,n=(n=tt(e[r+1]))?n.split(\"-\"):null;t>0;){if(s=nt(i.slice(0,t).join(\"-\")))return s;if(n&&n.length>=t&&D(i,n,!0)>=t-1)break;t--}r++}return Be}(e)}function at(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>De(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,f(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),f(e)._overflowWeeks&&-1===t&&(t=7),f(e)._overflowWeekday&&-1===t&&(t=8),f(e).overflow=t),e}function ot(e,t,n){return null!=e?e:null!=t?t:n}function ut(e){var t,n,i,r,a,o=[];if(!e._d){for(i=function(e){var t=new Date(s.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ot(t.GG,e._a[0],Ue(Dt(),1,4).year),s=ot(t.W,1),((i=ot(t.E,1))<1||i>7)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ue(Dt(),r,a);n=ot(t.gg,e._a[0],l.year),s=ot(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r}s<1||s>Ne(n,r,a)?f(e)._overflowWeeks=!0:null!=u?f(e)._overflowWeekday=!0:(o=Le(n,s,i,r,a),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(a=ot(e._a[0],i[0]),(e._dayOfYear>ye(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),n=Re(a,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Re:He).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(f(e).weekdayMismatch=!0)}}var lt=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,dt=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,ht=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[[\"YYYYYY-MM-DD\",/[+-]\\d{6}-\\d\\d-\\d\\d/],[\"YYYY-MM-DD\",/\\d{4}-\\d\\d-\\d\\d/],[\"GGGG-[W]WW-E\",/\\d{4}-W\\d\\d-\\d/],[\"GGGG-[W]WW\",/\\d{4}-W\\d\\d/,!1],[\"YYYY-DDD\",/\\d{4}-\\d{3}/],[\"YYYY-MM\",/\\d{4}-\\d\\d/,!1],[\"YYYYYYMMDD\",/[+-]\\d{10}/],[\"YYYYMMDD\",/\\d{8}/],[\"GGGG[W]WWE\",/\\d{4}W\\d{3}/],[\"GGGG[W]WW\",/\\d{4}W\\d{2}/,!1],[\"YYYYDDD\",/\\d{7}/]],ft=[[\"HH:mm:ss.SSSS\",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],[\"HH:mm:ss,SSSS\",/\\d\\d:\\d\\d:\\d\\d,\\d+/],[\"HH:mm:ss\",/\\d\\d:\\d\\d:\\d\\d/],[\"HH:mm\",/\\d\\d:\\d\\d/],[\"HHmmss.SSSS\",/\\d\\d\\d\\d\\d\\d\\.\\d+/],[\"HHmmss,SSSS\",/\\d\\d\\d\\d\\d\\d,\\d+/],[\"HHmmss\",/\\d\\d\\d\\d\\d\\d/],[\"HHmm\",/\\d\\d\\d\\d/],[\"HH\",/\\d\\d/]],mt=/^\\/?Date\\((\\-?\\d+)/i;function _t(e){var t,n,s,i,r,a,o=e._i,u=lt.exec(o)||dt.exec(o);if(u){for(f(e).iso=!0,t=0,n=ct.length;t<n;t++)if(ct[t][1].exec(u[1])){i=ct[t][0],s=!1!==ct[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(u[3])){r=(u[2]||\" \")+ft[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!ht.exec(u[4]))return void(e._isValid=!1);a=\"Z\"}e._f=i+(r||\"\")+(a||\"\"),wt(e)}else e._isValid=!1}var yt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;function gt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var pt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,s,i,r,a,o,u=yt.exec(e._i.replace(/\\([^)]*\\)|[\\n\\t]/g,\" \").replace(/(\\s\\s+)/g,\" \").replace(/^\\s\\s*/,\"\").replace(/\\s\\s*$/,\"\"));if(u){var l=(t=u[4],n=u[3],s=u[2],i=u[5],r=u[6],a=u[7],o=[gt(t),Oe.indexOf(n),parseInt(s,10),parseInt(i,10),parseInt(r,10)],a&&o.push(parseInt(a,10)),o);if(!function(e,t,n){return!e||Ve.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],l,e))return;e._a=l,e._tzm=function(e,t,n){if(e)return pt[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(u[8],u[9],u[10]),e._d=Re.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function wt(e){if(e._f!==s.ISO_8601)if(e._f!==s.RFC_2822){e._a=[],f(e).empty=!0;var t,n,i,r,a,o=\"\"+e._i,u=o.length,l=0;for(i=Z(e._f,e._locale).match(G)||[],t=0;t<i.length;t++)r=i[t],(n=(o.match(de(r,e))||[])[0])&&((a=o.substr(0,o.indexOf(n))).length>0&&f(e).unusedInput.push(a),o=o.slice(o.indexOf(n)+n.length),l+=n.length),j[r]?(n?f(e).empty=!1:f(e).unusedTokens.push(r),_e(r,n,e)):e._strict&&!n&&f(e).unusedTokens.push(r);f(e).charsLeftOver=u-l,o.length>0&&f(e).unusedInput.push(o),e._a[3]<=12&&!0===f(e).bigHour&&e._a[3]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var s;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),ut(e),at(e)}else vt(e);else _t(e)}function Mt(e){var t=e._i,n=e._f;return e._locale=e._locale||rt(e._l),null===t||void 0===n&&\"\"===t?_({nullInput:!0}):(\"string\"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new v(at(t)):(u(t)?e._d=t:i(n)?function(e){var t,n,s,i,r;if(0===e._f.length)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],wt(t),m(t)&&(r+=f(t).charsLeftOver,r+=10*f(t).unusedTokens.length,f(t).score=r,(null==s||r<s)&&(s=r,n=t));h(e,n||t)}(e):n?wt(e):function(e){var t=e._i;a(t)?e._d=new Date(s.now()):u(t)?e._d=new Date(t.valueOf()):\"string\"==typeof t?function(e){var t=mt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,vt(e),!1===e._isValid&&(delete e._isValid,s.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=l(t.slice(0),(function(e){return parseInt(e,10)})),ut(e)):r(t)?function(e){if(!e._d){var t=F(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),ut(e)}}(e):o(t)?e._d=new Date(t):s.createFromInputFallback(e)}(e),m(e)||(e._d=null),e))}function St(e,t,n,s,a){var o,u={};return!0!==n&&!1!==n||(s=n,n=void 0),(r(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=a,u._l=n,u._i=e,u._f=t,u._strict=s,(o=new v(at(Mt(u))))._nextDay&&(o.add(1,\"d\"),o._nextDay=void 0),o}function Dt(e,t,n,s){return St(e,t,n,s,!1)}s.createFromInputFallback=Y(\"value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.\",(function(e){e._d=new Date(e._i+(e._useUTC?\" UTC\":\"\"))})),s.ISO_8601=function(){},s.RFC_2822=function(){};var kt=Y(\"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/\",(function(){var e=Dt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()})),Yt=Y(\"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/\",(function(){var e=Dt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()}));function Ot(e,t){var n,s;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Dt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Tt=[\"year\",\"quarter\",\"month\",\"week\",\"day\",\"hour\",\"minute\",\"second\",\"millisecond\"];function bt(e){var t=F(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===pe.call(Tt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Tt.length;++s)if(e[Tt[s]]){if(n)return!1;parseFloat(e[Tt[s]])!==S(e[Tt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=rt(),this._bubble()}function xt(e){return e instanceof bt}function Pt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){I(e,0,0,(function(){var e=this.utcOffset(),n=\"+\";return e<0&&(e=-e,n=\"-\"),n+N(~~(e/60),2)+t+N(~~e%60,2)}))}Wt(\"Z\",\":\"),Wt(\"ZZ\",\"\"),le(\"Z\",ae),le(\"ZZ\",ae),fe([\"Z\",\"ZZ\"],(function(e,t,n){n._useUTC=!0,n._tzm=Ht(ae,e)}));var Ct=/([\\+\\-]|\\d\\d)/gi;function Ht(e,t){var n=(t||\"\").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+\"\").match(Ct)||[\"-\",0,0],i=60*s[1]+S(s[2]);return 0===i?0:\"+\"===s[0]?i:-i}function Rt(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(w(e)||u(e)?e.valueOf():Dt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),s.updateOffset(n,!1),n):Dt(e).local()}function Ft(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Lt(){return!!this.isValid()&&this._isUTC&&0===this._offset}s.updateOffset=function(){};var Ut=/^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/,Nt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Gt(e,t){var n,s,i,r,a,u,l=e,h=null;return xt(e)?l={ms:e._milliseconds,d:e._days,M:e._months}:o(e)?(l={},t?l[t]=e:l.milliseconds=e):(h=Ut.exec(e))?(n=\"-\"===h[1]?-1:1,l={y:0,d:S(h[2])*n,h:S(h[3])*n,m:S(h[4])*n,s:S(h[5])*n,ms:S(Pt(1e3*h[6]))*n}):(h=Nt.exec(e))?(n=\"-\"===h[1]?-1:(h[1],1),l={y:Vt(h[2],n),M:Vt(h[3],n),w:Vt(h[4],n),d:Vt(h[5],n),h:Vt(h[6],n),m:Vt(h[7],n),s:Vt(h[8],n)}):null==l?l={}:\"object\"==typeof l&&(\"from\"in l||\"to\"in l)&&(r=Dt(l.from),a=Dt(l.to),i=r.isValid()&&a.isValid()?(a=Rt(a,r),r.isBefore(a)?u=Et(r,a):((u=Et(a,r)).milliseconds=-u.milliseconds,u.months=-u.months),u):{milliseconds:0,months:0},(l={}).ms=i.milliseconds,l.M=i.months),s=new bt(l),xt(e)&&d(e,\"_locale\")&&(s._locale=e._locale),s}function Vt(e,t){var n=e&&parseFloat(e.replace(\",\",\".\"));return(isNaN(n)?0:n)*t}function Et(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,\"M\").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,\"M\"),n}function jt(e,t){return function(n,s){var i;return null===s||isNaN(+s)||(b(t,\"moment().\"+t+\"(period, number) is deprecated. Please use moment().\"+t+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),i=n,n=s,s=i),It(this,Gt(n=\"string\"==typeof n?+n:n,s),e),this}}function It(e,t,n,i){var r=t._milliseconds,a=Pt(t._days),o=Pt(t._months);e.isValid()&&(i=null==i||i,o&&be(e,Me(e,\"Month\")+o*n),a&&Se(e,\"Date\",Me(e,\"Date\")+a*n),r&&e._d.setTime(e._d.valueOf()+r*n),i&&s.updateOffset(e,a||o))}Gt.fn=bt.prototype,Gt.invalid=function(){return Gt(NaN)};var At=jt(1,\"add\"),Zt=jt(-1,\"subtract\");function zt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,\"months\");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,\"months\")):(t-s)/(e.clone().add(n+1,\"months\")-s)))||0}function $t(e){var t;return void 0===e?this._locale._abbr:(null!=(t=rt(e))&&(this._locale=t),this)}s.defaultFormat=\"YYYY-MM-DDTHH:mm:ssZ\",s.defaultFormatUtc=\"YYYY-MM-DDTHH:mm:ss[Z]\";var Jt=Y(\"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.\",(function(e){return void 0===e?this.localeData():this.locale(e)}));function qt(){return this._locale}function Bt(e,t){I(0,[e,e.length],0,t)}function Qt(e,t,n,s,i){var r;return null==e?Ue(this,s,i).year:(t>(r=Ne(e,s,i))&&(t=r),Xt.call(this,e,t,n,s,i))}function Xt(e,t,n,s,i){var r=Le(e,t,n,s,i),a=Re(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}I(0,[\"gg\",2],0,(function(){return this.weekYear()%100})),I(0,[\"GG\",2],0,(function(){return this.isoWeekYear()%100})),Bt(\"gggg\",\"weekYear\"),Bt(\"ggggg\",\"weekYear\"),Bt(\"GGGG\",\"isoWeekYear\"),Bt(\"GGGGG\",\"isoWeekYear\"),H(\"weekYear\",\"gg\"),H(\"isoWeekYear\",\"GG\"),U(\"weekYear\",1),U(\"isoWeekYear\",1),le(\"G\",ie),le(\"g\",ie),le(\"GG\",Q,$),le(\"gg\",Q,$),le(\"GGGG\",te,q),le(\"gggg\",te,q),le(\"GGGGG\",ne,B),le(\"ggggg\",ne,B),me([\"gggg\",\"ggggg\",\"GGGG\",\"GGGGG\"],(function(e,t,n,s){t[s.substr(0,2)]=S(e)})),me([\"gg\",\"GG\"],(function(e,t,n,i){t[i]=s.parseTwoDigitYear(e)})),I(\"Q\",0,\"Qo\",\"quarter\"),H(\"quarter\",\"Q\"),U(\"quarter\",7),le(\"Q\",z),fe(\"Q\",(function(e,t){t[1]=3*(S(e)-1)})),I(\"D\",[\"DD\",2],\"Do\",\"date\"),H(\"date\",\"D\"),U(\"date\",9),le(\"D\",Q),le(\"DD\",Q,$),le(\"Do\",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),fe([\"D\",\"DD\"],2),fe(\"Do\",(function(e,t){t[2]=S(e.match(Q)[0])}));var Kt=we(\"Date\",!0);I(\"DDD\",[\"DDDD\",3],\"DDDo\",\"dayOfYear\"),H(\"dayOfYear\",\"DDD\"),U(\"dayOfYear\",4),le(\"DDD\",ee),le(\"DDDD\",J),fe([\"DDD\",\"DDDD\"],(function(e,t,n){n._dayOfYear=S(e)})),I(\"m\",[\"mm\",2],0,\"minute\"),H(\"minute\",\"m\"),U(\"minute\",14),le(\"m\",Q),le(\"mm\",Q,$),fe([\"m\",\"mm\"],4);var en=we(\"Minutes\",!1);I(\"s\",[\"ss\",2],0,\"second\"),H(\"second\",\"s\"),U(\"second\",15),le(\"s\",Q),le(\"ss\",Q,$),fe([\"s\",\"ss\"],5);var tn,nn=we(\"Seconds\",!1);for(I(\"S\",0,0,(function(){return~~(this.millisecond()/100)})),I(0,[\"SS\",2],0,(function(){return~~(this.millisecond()/10)})),I(0,[\"SSS\",3],0,\"millisecond\"),I(0,[\"SSSS\",4],0,(function(){return 10*this.millisecond()})),I(0,[\"SSSSS\",5],0,(function(){return 100*this.millisecond()})),I(0,[\"SSSSSS\",6],0,(function(){return 1e3*this.millisecond()})),I(0,[\"SSSSSSS\",7],0,(function(){return 1e4*this.millisecond()})),I(0,[\"SSSSSSSS\",8],0,(function(){return 1e5*this.millisecond()})),I(0,[\"SSSSSSSSS\",9],0,(function(){return 1e6*this.millisecond()})),H(\"millisecond\",\"ms\"),U(\"millisecond\",16),le(\"S\",ee,z),le(\"SS\",ee,$),le(\"SSS\",ee,J),tn=\"SSSS\";tn.length<=9;tn+=\"S\")le(tn,se);function sn(e,t){t[6]=S(1e3*(\"0.\"+e))}for(tn=\"S\";tn.length<=9;tn+=\"S\")fe(tn,sn);var rn=we(\"Milliseconds\",!1);I(\"z\",0,0,\"zoneAbbr\"),I(\"zz\",0,0,\"zoneName\");var an=v.prototype;function on(e){return e}an.add=At,an.calendar=function(e,t){var n=e||Dt(),i=Rt(n,this).startOf(\"day\"),r=s.calendarFormat(this,i)||\"sameElse\",a=t&&(x(t[r])?t[r].call(this,n):t[r]);return this.format(a||this.localeData().calendar(r,this,Dt(n)))},an.clone=function(){return new v(this)},an.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Rt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case\"year\":r=zt(this,s)/12;break;case\"month\":r=zt(this,s);break;case\"quarter\":r=zt(this,s)/3;break;case\"second\":r=(this-s)/1e3;break;case\"minute\":r=(this-s)/6e4;break;case\"hour\":r=(this-s)/36e5;break;case\"day\":r=(this-s-i)/864e5;break;case\"week\":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:M(r)},an.endOf=function(e){return void 0===(e=R(e))||\"millisecond\"===e?this:(\"date\"===e&&(e=\"day\"),this.startOf(e).add(1,\"isoWeek\"===e?\"week\":e).subtract(1,\"ms\"))},an.format=function(e){e||(e=this.isUtc()?s.defaultFormatUtc:s.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},an.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Dt(e).isValid())?Gt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},an.fromNow=function(e){return this.from(Dt(),e)},an.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||Dt(e).isValid())?Gt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},an.toNow=function(e){return this.to(Dt(),e)},an.get=function(e){return x(this[e=R(e)])?this[e]():this},an.invalidAt=function(){return f(this).overflow},an.isAfter=function(e,t){var n=w(e)?e:Dt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(a(t)?\"millisecond\":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},an.isBefore=function(e,t){var n=w(e)?e:Dt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=R(a(t)?\"millisecond\":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},an.isBetween=function(e,t,n,s){return(\"(\"===(s=s||\"()\")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(\")\"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},an.isSame=function(e,t){var n,s=w(e)?e:Dt(e);return!(!this.isValid()||!s.isValid())&&(\"millisecond\"===(t=R(t||\"millisecond\"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},an.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},an.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},an.isValid=function(){return m(this)},an.lang=Jt,an.locale=$t,an.localeData=qt,an.max=Yt,an.min=kt,an.parsingFlags=function(){return h({},f(this))},an.set=function(e,t){if(\"object\"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:L[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=F(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},an.startOf=function(e){switch(e=R(e)){case\"year\":this.month(0);case\"quarter\":case\"month\":this.date(1);case\"week\":case\"isoWeek\":case\"day\":case\"date\":this.hours(0);case\"hour\":this.minutes(0);case\"minute\":this.seconds(0);case\"second\":this.milliseconds(0)}return\"week\"===e&&this.weekday(0),\"isoWeek\"===e&&this.isoWeekday(1),\"quarter\"===e&&this.month(3*Math.floor(this.month()/3)),this},an.subtract=Zt,an.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},an.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},an.toDate=function(){return new Date(this.valueOf())},an.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?A(n,t?\"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ\"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace(\"Z\",A(n,\"Z\")):A(n,t?\"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYY-MM-DD[T]HH:mm:ss.SSSZ\")},an.inspect=function(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var e=\"moment\",t=\"\";this.isLocal()||(e=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",t=\"Z\");var n=\"[\"+e+'(\"]',s=0<=this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",i=t+'[\")]';return this.format(n+s+\"-MM-DD[T]HH:mm:ss.SSS\"+i)},an.toJSON=function(){return this.isValid()?this.toISOString():null},an.toString=function(){return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\")},an.unix=function(){return Math.floor(this.valueOf()/1e3)},an.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},an.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},an.year=ve,an.isLeapYear=function(){return ge(this.year())},an.weekYear=function(e){return Qt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},an.isoWeekYear=function(e){return Qt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},an.quarter=an.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},an.month=xe,an.daysInMonth=function(){return De(this.year(),this.month())},an.week=an.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),\"d\")},an.isoWeek=an.isoWeeks=function(e){var t=Ue(this,1,4).week;return null==e?t:this.add(7*(e-t),\"d\")},an.weeksInYear=function(){var e=this.localeData()._week;return Ne(this.year(),e.dow,e.doy)},an.isoWeeksInYear=function(){return Ne(this.year(),1,4)},an.date=Kt,an.day=an.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return\"string\"!=typeof e?e:isNaN(e)?\"number\"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,\"d\")):t},an.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,\"d\")},an.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return\"string\"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},an.dayOfYear=function(e){var t=Math.round((this.clone().startOf(\"day\")-this.clone().startOf(\"year\"))/864e5)+1;return null==e?t:this.add(e-t,\"d\")},an.hour=an.hours=Qe,an.minute=an.minutes=en,an.second=an.seconds=nn,an.millisecond=an.milliseconds=rn,an.utcOffset=function(e,t,n){var i,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if(\"string\"==typeof e){if(null===(e=Ht(ae,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=Ft(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,\"m\"),r!==e&&(!t||this._changeInProgress?It(this,Gt(e-r,\"m\"),1,!1):this._changeInProgress||(this._changeInProgress=!0,s.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ft(this)},an.utc=function(e){return this.utcOffset(0,e)},an.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ft(this),\"m\")),this},an.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if(\"string\"==typeof this._i){var e=Ht(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},an.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Dt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},an.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},an.isLocal=function(){return!!this.isValid()&&!this._isUTC},an.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},an.isUtc=Lt,an.isUTC=Lt,an.zoneAbbr=function(){return this._isUTC?\"UTC\":\"\"},an.zoneName=function(){return this._isUTC?\"Coordinated Universal Time\":\"\"},an.dates=Y(\"dates accessor is deprecated. Use date instead.\",Kt),an.months=Y(\"months accessor is deprecated. Use month instead\",xe),an.years=Y(\"years accessor is deprecated. Use year instead\",ve),an.zone=Y(\"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/\",(function(e,t){return null!=e?(\"string\"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),an.isDSTShifted=Y(\"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information\",(function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=Mt(e))._a){var t=e._isUTC?c(e._a):Dt(e._a);this._isDSTShifted=this.isValid()&&D(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var un=W.prototype;function ln(e,t,n,s){var i=rt(),r=c().set(s,t);return i[n](r,e)}function dn(e,t,n){if(o(e)&&(t=e,e=void 0),e=e||\"\",null!=t)return ln(e,t,n,\"month\");var s,i=[];for(s=0;s<12;s++)i[s]=ln(e,s,n,\"month\");return i}function hn(e,t,n,s){\"boolean\"==typeof e?(o(t)&&(n=t,t=void 0),t=t||\"\"):(n=t=e,e=!1,o(t)&&(n=t,t=void 0),t=t||\"\");var i,r=rt(),a=e?r._week.dow:0;if(null!=n)return ln(t,(n+a)%7,s,\"day\");var u=[];for(i=0;i<7;i++)u[i]=ln(t,(i+a)%7,s,\"day\");return u}un.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},un.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},un.invalidDate=function(){return this._invalidDate},un.ordinal=function(e){return this._ordinal.replace(\"%d\",e)},un.preparse=on,un.postformat=on,un.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},un.pastFuture=function(e,t){var n=this._relativeTime[e>0?\"future\":\"past\"];return x(n)?n(t):n.replace(/%s/i,t)},un.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this[\"_\"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+\"|\"+/\\d{1,2}/.source)},un.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ke).test(t)?\"format\":\"standalone\"][e.month()]:i(this._months)?this._months:this._months.standalone},un.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ke.test(t)?\"format\":\"standalone\"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},un.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return Te.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=c([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp(\"^\"+this.months(i,\"\").replace(\".\",\"\")+\"$\",\"i\"),this._shortMonthsParse[s]=new RegExp(\"^\"+this.monthsShort(i,\"\").replace(\".\",\"\")+\"$\",\"i\")),n||this._monthsParse[s]||(r=\"^\"+this.months(i,\"\")+\"|^\"+this.monthsShort(i,\"\"),this._monthsParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"MMMM\"===t&&this._longMonthsParse[s].test(e))return s;if(n&&\"MMM\"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},un.monthsRegex=function(e){return this._monthsParseExact?(d(this,\"_monthsRegex\")||Ce.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,\"_monthsRegex\")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},un.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,\"_monthsRegex\")||Ce.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,\"_monthsShortRegex\")||(this._monthsShortRegex=Pe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},un.week=function(e){return Ue(e,this._week.dow,this._week.doy).week},un.firstDayOfYear=function(){return this._week.doy},un.firstDayOfWeek=function(){return this._week.dow},un.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?\"format\":\"standalone\"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},un.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},un.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},un.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return je.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=c([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp(\"^\"+this.weekdays(i,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\"),this._shortWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysShort(i,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\"),this._minWeekdaysParse[s]=new RegExp(\"^\"+this.weekdaysMin(i,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\")),this._weekdaysParse[s]||(r=\"^\"+this.weekdays(i,\"\")+\"|^\"+this.weekdaysShort(i,\"\")+\"|^\"+this.weekdaysMin(i,\"\"),this._weekdaysParse[s]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"dddd\"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&\"ddd\"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&\"dd\"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},un.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||ze.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,\"_weekdaysRegex\")||(this._weekdaysRegex=Ie),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},un.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||ze.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,\"_weekdaysShortRegex\")||(this._weekdaysShortRegex=Ae),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},un.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||ze.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,\"_weekdaysMinRegex\")||(this._weekdaysMinRegex=Ze),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},un.isPM=function(e){return\"p\"===(e+\"\").toLowerCase().charAt(0)},un.meridiem=function(e,t,n){return e>11?n?\"pm\":\"PM\":n?\"am\":\"AM\"},st(\"en\",{dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===S(e%100/10)?\"th\":1===t?\"st\":2===t?\"nd\":3===t?\"rd\":\"th\")}}),s.lang=Y(\"moment.lang is deprecated. Use moment.locale instead.\",st),s.langData=Y(\"moment.langData is deprecated. Use moment.localeData instead.\",rt);var cn=Math.abs;function fn(e,t,n,s){var i=Gt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function mn(e){return e<0?Math.floor(e):Math.ceil(e)}function _n(e){return 4800*e/146097}function yn(e){return 146097*e/4800}function gn(e){return function(){return this.as(e)}}var pn=gn(\"ms\"),vn=gn(\"s\"),wn=gn(\"m\"),Mn=gn(\"h\"),Sn=gn(\"d\"),Dn=gn(\"w\"),kn=gn(\"M\"),Yn=gn(\"y\");function On(e){return function(){return this.isValid()?this._data[e]:NaN}}var Tn=On(\"milliseconds\"),bn=On(\"seconds\"),xn=On(\"minutes\"),Pn=On(\"hours\"),Wn=On(\"days\"),Cn=On(\"months\"),Hn=On(\"years\"),Rn=Math.round,Fn={ss:44,s:45,m:45,h:22,d:26,M:11};function Ln(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}var Un=Math.abs;function Nn(e){return(e>0)-(e<0)||+e}function Gn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Un(this._milliseconds)/1e3,s=Un(this._days),i=Un(this._months);e=M(n/60),t=M(e/60),n%=60,e%=60;var r=M(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\\.?0+$/,\"\"):\"\",h=this.asSeconds();if(!h)return\"P0D\";var c=h<0?\"-\":\"\",f=Nn(this._months)!==Nn(h)?\"-\":\"\",m=Nn(this._days)!==Nn(h)?\"-\":\"\",_=Nn(this._milliseconds)!==Nn(h)?\"-\":\"\";return c+\"P\"+(r?f+r+\"Y\":\"\")+(a?f+a+\"M\":\"\")+(o?m+o+\"D\":\"\")+(u||l||d?\"T\":\"\")+(u?_+u+\"H\":\"\")+(l?_+l+\"M\":\"\")+(d?_+d+\"S\":\"\")}var Vn=bt.prototype;return Vn.isValid=function(){return this._isValid},Vn.abs=function(){var e=this._data;return this._milliseconds=cn(this._milliseconds),this._days=cn(this._days),this._months=cn(this._months),e.milliseconds=cn(e.milliseconds),e.seconds=cn(e.seconds),e.minutes=cn(e.minutes),e.hours=cn(e.hours),e.months=cn(e.months),e.years=cn(e.years),this},Vn.add=function(e,t){return fn(this,e,t,1)},Vn.subtract=function(e,t){return fn(this,e,t,-1)},Vn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(\"month\"===(e=R(e))||\"year\"===e)return t=this._days+s/864e5,n=this._months+_n(t),\"month\"===e?n:n/12;switch(t=this._days+Math.round(yn(this._months)),e){case\"week\":return t/7+s/6048e5;case\"day\":return t+s/864e5;case\"hour\":return 24*t+s/36e5;case\"minute\":return 1440*t+s/6e4;case\"second\":return 86400*t+s/1e3;case\"millisecond\":return Math.floor(864e5*t)+s;default:throw new Error(\"Unknown unit \"+e)}},Vn.asMilliseconds=pn,Vn.asSeconds=vn,Vn.asMinutes=wn,Vn.asHours=Mn,Vn.asDays=Sn,Vn.asWeeks=Dn,Vn.asMonths=kn,Vn.asYears=Yn,Vn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12):NaN},Vn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*mn(yn(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=M(r/1e3),u.seconds=e%60,t=M(e/60),u.minutes=t%60,n=M(t/60),u.hours=n%24,a+=M(n/24),i=M(_n(a)),o+=i,a-=mn(yn(i)),s=M(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},Vn.clone=function(){return Gt(this)},Vn.get=function(e){return e=R(e),this.isValid()?this[e+\"s\"]():NaN},Vn.milliseconds=Tn,Vn.seconds=bn,Vn.minutes=xn,Vn.hours=Pn,Vn.days=Wn,Vn.weeks=function(){return M(this.days()/7)},Vn.months=Cn,Vn.years=Hn,Vn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var s=Gt(e).abs(),i=Rn(s.as(\"s\")),r=Rn(s.as(\"m\")),a=Rn(s.as(\"h\")),o=Rn(s.as(\"d\")),u=Rn(s.as(\"M\")),l=Rn(s.as(\"y\")),d=i<=Fn.ss&&[\"s\",i]||i<Fn.s&&[\"ss\",i]||r<=1&&[\"m\"]||r<Fn.m&&[\"mm\",r]||a<=1&&[\"h\"]||a<Fn.h&&[\"hh\",a]||o<=1&&[\"d\"]||o<Fn.d&&[\"dd\",o]||u<=1&&[\"M\"]||u<Fn.M&&[\"MM\",u]||l<=1&&[\"y\"]||[\"yy\",l];return d[2]=t,d[3]=+e>0,d[4]=n,Ln.apply(null,d)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Vn.toISOString=Gn,Vn.toString=Gn,Vn.toJSON=Gn,Vn.locale=$t,Vn.localeData=qt,Vn.toIsoString=Y(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\",Gn),Vn.lang=Jt,I(\"X\",0,0,\"unix\"),I(\"x\",0,0,\"valueOf\"),le(\"x\",ie),le(\"X\",/[+-]?\\d+(\\.\\d{1,3})?/),fe(\"X\",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),fe(\"x\",(function(e,t,n){n._d=new Date(S(e))})),s.version=\"2.22.2\",t=Dt,s.fn=an,s.min=function(){var e=[].slice.call(arguments,0);return Ot(\"isBefore\",e)},s.max=function(){var e=[].slice.call(arguments,0);return Ot(\"isAfter\",e)},s.now=function(){return Date.now?Date.now():+new Date},s.utc=c,s.unix=function(e){return Dt(1e3*e)},s.months=function(e,t){return dn(e,t,\"months\")},s.isDate=u,s.locale=st,s.invalid=_,s.duration=Gt,s.isMoment=w,s.weekdays=function(e,t,n){return hn(e,t,n,\"weekdays\")},s.parseZone=function(){return Dt.apply(null,arguments).parseZone()},s.localeData=rt,s.isDuration=xt,s.monthsShort=function(e,t){return dn(e,t,\"monthsShort\")},s.weekdaysMin=function(e,t,n){return hn(e,t,n,\"weekdaysMin\")},s.defineLocale=it,s.updateLocale=function(e,t){if(null!=t){var n,s,i=Xe;null!=(s=nt(e))&&(i=s._config),t=P(i,t),(n=new W(t)).parentLocale=Ke[e],Ke[e]=n,st(e)}else null!=Ke[e]&&(null!=Ke[e].parentLocale?Ke[e]=Ke[e].parentLocale:null!=Ke[e]&&delete Ke[e]);return Ke[e]},s.locales=function(){return O(Ke)},s.weekdaysShort=function(e,t,n){return hn(e,t,n,\"weekdaysShort\")},s.normalizeUnits=R,s.relativeTimeRounding=function(e){return void 0===e?Rn:\"function\"==typeof e&&(Rn=e,!0)},s.relativeTimeThreshold=function(e,t){return void 0!==Fn[e]&&(void 0===t?Fn[e]:(Fn[e]=t,\"s\"===e&&(Fn.ss=t-1),!0))},s.calendarFormat=function(e,t){var n=e.diff(t,\"days\",!0);return n<-6?\"sameElse\":n<-1?\"lastWeek\":n<0?\"lastDay\":n<1?\"sameDay\":n<2?\"nextDay\":n<7?\"nextWeek\":\"sameElse\"},s.prototype=an,s.HTML5_FMT={DATETIME_LOCAL:\"YYYY-MM-DDTHH:mm\",DATETIME_LOCAL_SECONDS:\"YYYY-MM-DDTHH:mm:ss\",DATETIME_LOCAL_MS:\"YYYY-MM-DDTHH:mm:ss.SSS\",DATE:\"YYYY-MM-DD\",TIME:\"HH:mm\",TIME_SECONDS:\"HH:mm:ss\",TIME_MS:\"HH:mm:ss.SSS\",WEEK:\"YYYY-[W]WW\",MONTH:\"YYYY-MM\"},s}()}).call(this,n(1)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,\"loaded\",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,\"id\",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},,function(e,t,n){e.exports=n(0)}]);\n//# sourceMappingURL=http://127.0.0.1:3001/dist/js/vendors.js.map"
  },
  {
    "path": "wagalytics/static/wagalytics/wagalytics.bundle.js",
    "content": "!function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=2)}([function(e,t,n){(function(e){e.exports=function(){\"use strict\";var t,n;function i(){return t.apply(null,arguments)}function s(e){return e instanceof Array||\"[object Array]\"===Object.prototype.toString.call(e)}function r(e){return null!=e&&\"[object Object]\"===Object.prototype.toString.call(e)}function a(e){return void 0===e}function o(e){return\"number\"==typeof e||\"[object Number]\"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||\"[object Date]\"===Object.prototype.toString.call(e)}function l(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function h(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,\"toString\")&&(e.toString=t.toString),d(t,\"valueOf\")&&(e.valueOf=t.valueOf),e}function c(e,t,n,i){return St(e,t,n,i,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){if(null==e._isValid){var t=f(e),i=n.call(t.parsedDateParts,(function(e){return null!=e})),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function _(e){var t=c(NaN);return null!=e?h(f(t),e):f(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,i=0;i<n;i++)if(i in t&&e.call(this,t[i],i,t))return!0;return!1};var y=i.momentProperties=[];function g(e,t){var n,i,s;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=f(t)),a(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)a(s=t[i=y[n]])||(e[i]=s);return e}var p=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===p&&(p=!0,i.updateOffset(this),p=!1)}function w(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function M(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function S(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=M(t)),n}function k(e,t,n){var i,s=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(i=0;i<s;i++)(n&&e[i]!==t[i]||!n&&S(e[i])!==S(t[i]))&&a++;return a+r}function D(e){!1===i.suppressDeprecationWarnings&&\"undefined\"!=typeof console&&console.warn&&console.warn(\"Deprecation warning: \"+e)}function Y(e,t){var n=!0;return h((function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,e),n){for(var s,r=[],a=0;a<arguments.length;a++){if(s=\"\",\"object\"==typeof arguments[a]){for(var o in s+=\"\\n[\"+a+\"] \",arguments[0])s+=o+\": \"+arguments[0][o]+\", \";s=s.slice(0,-2)}else s=arguments[a];r.push(s)}D(e+\"\\nArguments: \"+Array.prototype.slice.call(r).join(\"\")+\"\\n\"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var b,O={};function T(e,t){null!=i.deprecationHandler&&i.deprecationHandler(e,t),O[e]||(D(t),O[e]=!0)}function x(e){return e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}function P(e,t){var n,i=h({},e);for(n in t)d(t,n)&&(r(e[n])&&r(t[n])?(i[n]={},h(i[n],e[n]),h(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);for(n in e)d(e,n)&&!d(t,n)&&r(e[n])&&(i[n]=h({},i[n]));return i}function C(e){null!=e&&this.set(e)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,b=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var W={};function L(e,t){var n=e.toLowerCase();W[n]=W[n+\"s\"]=W[t]=e}function H(e){return\"string\"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function R(e){var t,n,i={};for(n in e)d(e,n)&&(t=H(n))&&(i[t]=e[n]);return i}var F={};function E(e,t){F[e]=t}function N(e,t,n){var i=\"\"+Math.abs(e),s=t-i.length;return(e>=0?n?\"+\":\"\":\"-\")+Math.pow(10,Math.max(0,s)).toString().substr(1)+i}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,I=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},G={};function j(e,t,n,i){var s=i;\"string\"==typeof i&&(s=function(){return this[i]()}),e&&(G[e]=s),t&&(G[t[0]]=function(){return N(s.apply(this,arguments),t[1],t[2])}),n&&(G[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=z(t,e.localeData()),V[t]=V[t]||function(e){var t,n,i,s=e.match(U);for(t=0,n=s.length;t<n;t++)G[s[t]]?s[t]=G[s[t]]:s[t]=(i=s[t]).match(/\\[[\\s\\S]/)?i.replace(/^\\[|\\]$/g,\"\"):i.replace(/\\\\/g,\"\");return function(t){var i,r=\"\";for(i=0;i<n;i++)r+=x(s[i])?s[i].call(t,e):s[i];return r}}(t),V[t](e)):e.localeData().invalidDate()}function z(e,t){var n=5;function i(e){return t.longDateFormat(e)||e}for(I.lastIndex=0;n>=0&&I.test(e);)e=e.replace(I,i),I.lastIndex=0,n-=1;return e}var Z=/\\d/,$=/\\d\\d/,B=/\\d{3}/,J=/\\d{4}/,q=/[+-]?\\d{6}/,Q=/\\d\\d?/,X=/\\d\\d\\d\\d?/,K=/\\d\\d\\d\\d\\d\\d?/,ee=/\\d{1,3}/,te=/\\d{1,4}/,ne=/[+-]?\\d{1,6}/,ie=/\\d+/,se=/[+-]?\\d+/,re=/Z|[+-]\\d\\d:?\\d\\d/gi,ae=/Z|[+-]\\d\\d(?::?\\d\\d)?/gi,oe=/[0-9]{0,256}['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFF07\\uFF10-\\uFFEF]{1,256}|[\\u0600-\\u06FF\\/]{1,256}(\\s*?[\\u0600-\\u06FF]{1,256}){1,2}/i,ue={};function le(e,t,n){ue[e]=x(t)?t:function(e,i){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(he(e.replace(\"\\\\\",\"\").replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g,(function(e,t,n,i,s){return t||n||i||s}))))}function he(e){return e.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")}var ce={};function fe(e,t){var n,i=t;for(\"string\"==typeof e&&(e=[e]),o(t)&&(i=function(e,n){n[t]=S(e)}),n=0;n<e.length;n++)ce[e[n]]=i}function me(e,t){fe(e,(function(e,n,i,s){i._w=i._w||{},t(e,i._w,i,s)}))}function _e(e,t,n){null!=t&&d(ce,e)&&ce[e](t,n._a,n,e)}function ye(e){return ge(e)?366:365}function ge(e){return e%4==0&&e%100!=0||e%400==0}j(\"Y\",0,0,(function(){var e=this.year();return e<=9999?\"\"+e:\"+\"+e})),j(0,[\"YY\",2],0,(function(){return this.year()%100})),j(0,[\"YYYY\",4],0,\"year\"),j(0,[\"YYYYY\",5],0,\"year\"),j(0,[\"YYYYYY\",6,!0],0,\"year\"),L(\"year\",\"y\"),E(\"year\",1),le(\"Y\",se),le(\"YY\",Q,$),le(\"YYYY\",te,J),le(\"YYYYY\",ne,q),le(\"YYYYYY\",ne,q),fe([\"YYYYY\",\"YYYYYY\"],0),fe(\"YYYY\",(function(e,t){t[0]=2===e.length?i.parseTwoDigitYear(e):S(e)})),fe(\"YY\",(function(e,t){t[0]=i.parseTwoDigitYear(e)})),fe(\"Y\",(function(e,t){t[0]=parseInt(e,10)})),i.parseTwoDigitYear=function(e){return S(e)+(S(e)>68?1900:2e3)};var pe,ve=we(\"FullYear\",!0);function we(e,t){return function(n){return null!=n?(Se(this,e,n),i.updateOffset(this,t),this):Me(this,e)}}function Me(e,t){return e.isValid()?e._d[\"get\"+(e._isUTC?\"UTC\":\"\")+t]():NaN}function Se(e,t,n){e.isValid()&&!isNaN(n)&&(\"FullYear\"===t&&ge(e.year())&&1===e.month()&&29===e.date()?e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n,e.month(),ke(n,e.month())):e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+t](n))}function ke(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,i=(t%(n=12)+n)%n;return e+=(t-i)/12,1===i?ge(e)?29:28:31-i%7%2}pe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},j(\"M\",[\"MM\",2],\"Mo\",(function(){return this.month()+1})),j(\"MMM\",0,0,(function(e){return this.localeData().monthsShort(this,e)})),j(\"MMMM\",0,0,(function(e){return this.localeData().months(this,e)})),L(\"month\",\"M\"),E(\"month\",8),le(\"M\",Q),le(\"MM\",Q,$),le(\"MMM\",(function(e,t){return t.monthsShortRegex(e)})),le(\"MMMM\",(function(e,t){return t.monthsRegex(e)})),fe([\"M\",\"MM\"],(function(e,t){t[1]=S(e)-1})),fe([\"MMM\",\"MMMM\"],(function(e,t,n,i){var s=n._locale.monthsParse(e,i,n._strict);null!=s?t[1]=s:f(n).invalidMonth=e}));var De=/D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/,Ye=\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),be=\"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec\".split(\"_\");function Oe(e,t,n){var i,s,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=c([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,\"\").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,\"\").toLocaleLowerCase();return n?\"MMM\"===t?-1!==(s=pe.call(this._shortMonthsParse,a))?s:null:-1!==(s=pe.call(this._longMonthsParse,a))?s:null:\"MMM\"===t?-1!==(s=pe.call(this._shortMonthsParse,a))||-1!==(s=pe.call(this._longMonthsParse,a))?s:null:-1!==(s=pe.call(this._longMonthsParse,a))||-1!==(s=pe.call(this._shortMonthsParse,a))?s:null}function Te(e,t){var n;if(!e.isValid())return e;if(\"string\"==typeof t)if(/^\\d+$/.test(t))t=S(t);else if(!o(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),ke(e.year(),t)),e._d[\"set\"+(e._isUTC?\"UTC\":\"\")+\"Month\"](t,n),e}function xe(e){return null!=e?(Te(this,e),i.updateOffset(this,!0),this):Me(this,\"Month\")}var Pe=oe,Ce=oe;function We(){function e(e,t){return t.length-e.length}var t,n,i=[],s=[],r=[];for(t=0;t<12;t++)n=c([2e3,t]),i.push(this.monthsShort(n,\"\")),s.push(this.months(n,\"\")),r.push(this.months(n,\"\")),r.push(this.monthsShort(n,\"\"));for(i.sort(e),s.sort(e),r.sort(e),t=0;t<12;t++)i[t]=he(i[t]),s[t]=he(s[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp(\"^(\"+r.join(\"|\")+\")\",\"i\"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp(\"^(\"+s.join(\"|\")+\")\",\"i\"),this._monthsShortStrictRegex=new RegExp(\"^(\"+i.join(\"|\")+\")\",\"i\")}function Le(e,t,n,i,s,r,a){var o=new Date(e,t,n,i,s,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function He(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Re(e,t,n){var i=7+t-n;return-(7+He(e,0,i).getUTCDay()-t)%7+i-1}function Fe(e,t,n,i,s){var r,a,o=1+7*(t-1)+(7+n-i)%7+Re(e,i,s);return o<=0?a=ye(r=e-1)+o:o>ye(e)?(r=e+1,a=o-ye(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ee(e,t,n){var i,s,r=Re(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?i=a+Ne(s=e.year()-1,t,n):a>Ne(e.year(),t,n)?(i=a-Ne(e.year(),t,n),s=e.year()+1):(s=e.year(),i=a),{week:i,year:s}}function Ne(e,t,n){var i=Re(e,t,n),s=Re(e+1,t,n);return(ye(e)-i+s)/7}j(\"w\",[\"ww\",2],\"wo\",\"week\"),j(\"W\",[\"WW\",2],\"Wo\",\"isoWeek\"),L(\"week\",\"w\"),L(\"isoWeek\",\"W\"),E(\"week\",5),E(\"isoWeek\",5),le(\"w\",Q),le(\"ww\",Q,$),le(\"W\",Q),le(\"WW\",Q,$),me([\"w\",\"ww\",\"W\",\"WW\"],(function(e,t,n,i){t[i.substr(0,1)]=S(e)})),j(\"d\",0,\"do\",\"day\"),j(\"dd\",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),j(\"ddd\",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),j(\"dddd\",0,0,(function(e){return this.localeData().weekdays(this,e)})),j(\"e\",0,0,\"weekday\"),j(\"E\",0,0,\"isoWeekday\"),L(\"day\",\"d\"),L(\"weekday\",\"e\"),L(\"isoWeekday\",\"E\"),E(\"day\",11),E(\"weekday\",11),E(\"isoWeekday\",11),le(\"d\",Q),le(\"e\",Q),le(\"E\",Q),le(\"dd\",(function(e,t){return t.weekdaysMinRegex(e)})),le(\"ddd\",(function(e,t){return t.weekdaysShortRegex(e)})),le(\"dddd\",(function(e,t){return t.weekdaysRegex(e)})),me([\"dd\",\"ddd\",\"dddd\"],(function(e,t,n,i){var s=n._locale.weekdaysParse(e,i,n._strict);null!=s?t.d=s:f(n).invalidWeekday=e})),me([\"d\",\"e\",\"E\"],(function(e,t,n,i){t[i]=S(e)}));var Ue=\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),Ie=\"Sun_Mon_Tue_Wed_Thu_Fri_Sat\".split(\"_\"),Ve=\"Su_Mo_Tu_We_Th_Fr_Sa\".split(\"_\");function Ge(e,t,n){var i,s,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=c([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,\"\").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,\"\").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,\"\").toLocaleLowerCase();return n?\"dddd\"===t?-1!==(s=pe.call(this._weekdaysParse,a))?s:null:\"ddd\"===t?-1!==(s=pe.call(this._shortWeekdaysParse,a))?s:null:-1!==(s=pe.call(this._minWeekdaysParse,a))?s:null:\"dddd\"===t?-1!==(s=pe.call(this._weekdaysParse,a))||-1!==(s=pe.call(this._shortWeekdaysParse,a))||-1!==(s=pe.call(this._minWeekdaysParse,a))?s:null:\"ddd\"===t?-1!==(s=pe.call(this._shortWeekdaysParse,a))||-1!==(s=pe.call(this._weekdaysParse,a))||-1!==(s=pe.call(this._minWeekdaysParse,a))?s:null:-1!==(s=pe.call(this._minWeekdaysParse,a))||-1!==(s=pe.call(this._weekdaysParse,a))||-1!==(s=pe.call(this._shortWeekdaysParse,a))?s:null}var je=oe,Ae=oe,ze=oe;function Ze(){function e(e,t){return t.length-e.length}var t,n,i,s,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=c([2e3,1]).day(t),i=this.weekdaysMin(n,\"\"),s=this.weekdaysShort(n,\"\"),r=this.weekdays(n,\"\"),a.push(i),o.push(s),u.push(r),l.push(i),l.push(s),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp(\"^(\"+l.join(\"|\")+\")\",\"i\"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp(\"^(\"+u.join(\"|\")+\")\",\"i\"),this._weekdaysShortStrictRegex=new RegExp(\"^(\"+o.join(\"|\")+\")\",\"i\"),this._weekdaysMinStrictRegex=new RegExp(\"^(\"+a.join(\"|\")+\")\",\"i\")}function $e(){return this.hours()%12||12}function Be(e,t){j(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Je(e,t){return t._meridiemParse}j(\"H\",[\"HH\",2],0,\"hour\"),j(\"h\",[\"hh\",2],0,$e),j(\"k\",[\"kk\",2],0,(function(){return this.hours()||24})),j(\"hmm\",0,0,(function(){return\"\"+$e.apply(this)+N(this.minutes(),2)})),j(\"hmmss\",0,0,(function(){return\"\"+$e.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),j(\"Hmm\",0,0,(function(){return\"\"+this.hours()+N(this.minutes(),2)})),j(\"Hmmss\",0,0,(function(){return\"\"+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),Be(\"a\",!0),Be(\"A\",!1),L(\"hour\",\"h\"),E(\"hour\",13),le(\"a\",Je),le(\"A\",Je),le(\"H\",Q),le(\"h\",Q),le(\"k\",Q),le(\"HH\",Q,$),le(\"hh\",Q,$),le(\"kk\",Q,$),le(\"hmm\",X),le(\"hmmss\",K),le(\"Hmm\",X),le(\"Hmmss\",K),fe([\"H\",\"HH\"],3),fe([\"k\",\"kk\"],(function(e,t,n){var i=S(e);t[3]=24===i?0:i})),fe([\"a\",\"A\"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),fe([\"h\",\"hh\"],(function(e,t,n){t[3]=S(e),f(n).bigHour=!0})),fe(\"hmm\",(function(e,t,n){var i=e.length-2;t[3]=S(e.substr(0,i)),t[4]=S(e.substr(i)),f(n).bigHour=!0})),fe(\"hmmss\",(function(e,t,n){var i=e.length-4,s=e.length-2;t[3]=S(e.substr(0,i)),t[4]=S(e.substr(i,2)),t[5]=S(e.substr(s)),f(n).bigHour=!0})),fe(\"Hmm\",(function(e,t,n){var i=e.length-2;t[3]=S(e.substr(0,i)),t[4]=S(e.substr(i))})),fe(\"Hmmss\",(function(e,t,n){var i=e.length-4,s=e.length-2;t[3]=S(e.substr(0,i)),t[4]=S(e.substr(i,2)),t[5]=S(e.substr(s))}));var qe,Qe=we(\"Hours\",!0),Xe={calendar:{sameDay:\"[Today at] LT\",nextDay:\"[Tomorrow at] LT\",nextWeek:\"dddd [at] LT\",lastDay:\"[Yesterday at] LT\",lastWeek:\"[Last] dddd [at] LT\",sameElse:\"L\"},longDateFormat:{LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},invalidDate:\"Invalid date\",ordinal:\"%d\",dayOfMonthOrdinalParse:/\\d{1,2}/,relativeTime:{future:\"in %s\",past:\"%s ago\",s:\"a few seconds\",ss:\"%d seconds\",m:\"a minute\",mm:\"%d minutes\",h:\"an hour\",hh:\"%d hours\",d:\"a day\",dd:\"%d days\",M:\"a month\",MM:\"%d months\",y:\"a year\",yy:\"%d years\"},months:Ye,monthsShort:be,week:{dow:0,doy:6},weekdays:Ue,weekdaysMin:Ve,weekdaysShort:Ie,meridiemParse:/[ap]\\.?m?\\.?/i},Ke={},et={};function tt(e){return e?e.toLowerCase().replace(\"_\",\"-\"):e}function nt(t){var n=null;if(!Ke[t]&&void 0!==e&&e&&e.exports)try{n=qe._abbr,!function(){var e=new Error(\"Cannot find module 'undefined'\");throw e.code=\"MODULE_NOT_FOUND\",e}(),it(n)}catch(e){}return Ke[t]}function it(e,t){var n;return e&&((n=a(t)?rt(e):st(e,t))?qe=n:\"undefined\"!=typeof console&&console.warn&&console.warn(\"Locale \"+e+\" not found. Did you forget to load it?\")),qe._abbr}function st(e,t){if(null!==t){var n,i=Xe;if(t.abbr=e,null!=Ke[e])T(\"defineLocaleOverride\",\"use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.\"),i=Ke[e]._config;else if(null!=t.parentLocale)if(null!=Ke[t.parentLocale])i=Ke[t.parentLocale]._config;else{if(null==(n=nt(t.parentLocale)))return et[t.parentLocale]||(et[t.parentLocale]=[]),et[t.parentLocale].push({name:e,config:t}),null;i=n._config}return Ke[e]=new C(P(i,t)),et[e]&&et[e].forEach((function(e){st(e.name,e.config)})),it(e),Ke[e]}return delete Ke[e],null}function rt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return qe;if(!s(e)){if(t=nt(e))return t;e=[e]}return function(e){for(var t,n,i,s,r=0;r<e.length;){for(t=(s=tt(e[r]).split(\"-\")).length,n=(n=tt(e[r+1]))?n.split(\"-\"):null;t>0;){if(i=nt(s.slice(0,t).join(\"-\")))return i;if(n&&n.length>=t&&k(s,n,!0)>=t-1)break;t--}r++}return qe}(e)}function at(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>ke(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,f(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),f(e)._overflowWeeks&&-1===t&&(t=7),f(e)._overflowWeekday&&-1===t&&(t=8),f(e).overflow=t),e}function ot(e,t,n){return null!=e?e:null!=t?t:n}function ut(e){var t,n,s,r,a,o=[];if(!e._d){for(s=function(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,i,s,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ot(t.GG,e._a[0],Ee(kt(),1,4).year),i=ot(t.W,1),((s=ot(t.E,1))<1||s>7)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ee(kt(),r,a);n=ot(t.gg,e._a[0],l.year),i=ot(t.w,l.week),null!=t.d?((s=t.d)<0||s>6)&&(u=!0):null!=t.e?(s=t.e+r,(t.e<0||t.e>6)&&(u=!0)):s=r}i<1||i>Ne(n,r,a)?f(e)._overflowWeeks=!0:null!=u?f(e)._overflowWeekday=!0:(o=Fe(n,i,s,r,a),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(a=ot(e._a[0],s[0]),(e._dayOfYear>ye(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),n=He(a,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=s[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?He:Le).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(f(e).weekdayMismatch=!0)}}var lt=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,dt=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,ht=/Z|[+-]\\d\\d(?::?\\d\\d)?/,ct=[[\"YYYYYY-MM-DD\",/[+-]\\d{6}-\\d\\d-\\d\\d/],[\"YYYY-MM-DD\",/\\d{4}-\\d\\d-\\d\\d/],[\"GGGG-[W]WW-E\",/\\d{4}-W\\d\\d-\\d/],[\"GGGG-[W]WW\",/\\d{4}-W\\d\\d/,!1],[\"YYYY-DDD\",/\\d{4}-\\d{3}/],[\"YYYY-MM\",/\\d{4}-\\d\\d/,!1],[\"YYYYYYMMDD\",/[+-]\\d{10}/],[\"YYYYMMDD\",/\\d{8}/],[\"GGGG[W]WWE\",/\\d{4}W\\d{3}/],[\"GGGG[W]WW\",/\\d{4}W\\d{2}/,!1],[\"YYYYDDD\",/\\d{7}/]],ft=[[\"HH:mm:ss.SSSS\",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],[\"HH:mm:ss,SSSS\",/\\d\\d:\\d\\d:\\d\\d,\\d+/],[\"HH:mm:ss\",/\\d\\d:\\d\\d:\\d\\d/],[\"HH:mm\",/\\d\\d:\\d\\d/],[\"HHmmss.SSSS\",/\\d\\d\\d\\d\\d\\d\\.\\d+/],[\"HHmmss,SSSS\",/\\d\\d\\d\\d\\d\\d,\\d+/],[\"HHmmss\",/\\d\\d\\d\\d\\d\\d/],[\"HHmm\",/\\d\\d\\d\\d/],[\"HH\",/\\d\\d/]],mt=/^\\/?Date\\((\\-?\\d+)/i;function _t(e){var t,n,i,s,r,a,o=e._i,u=lt.exec(o)||dt.exec(o);if(u){for(f(e).iso=!0,t=0,n=ct.length;t<n;t++)if(ct[t][1].exec(u[1])){s=ct[t][0],i=!1!==ct[t][2];break}if(null==s)return void(e._isValid=!1);if(u[3]){for(t=0,n=ft.length;t<n;t++)if(ft[t][1].exec(u[3])){r=(u[2]||\" \")+ft[t][0];break}if(null==r)return void(e._isValid=!1)}if(!i&&null!=r)return void(e._isValid=!1);if(u[4]){if(!ht.exec(u[4]))return void(e._isValid=!1);a=\"Z\"}e._f=s+(r||\"\")+(a||\"\"),wt(e)}else e._isValid=!1}var yt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/;function gt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var pt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,i,s,r,a,o,u=yt.exec(e._i.replace(/\\([^)]*\\)|[\\n\\t]/g,\" \").replace(/(\\s\\s+)/g,\" \").replace(/^\\s\\s*/,\"\").replace(/\\s\\s*$/,\"\"));if(u){var l=(t=u[4],n=u[3],i=u[2],s=u[5],r=u[6],a=u[7],o=[gt(t),be.indexOf(n),parseInt(i,10),parseInt(s,10),parseInt(r,10)],a&&o.push(parseInt(a,10)),o);if(!function(e,t,n){return!e||Ie.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],l,e))return;e._a=l,e._tzm=function(e,t,n){if(e)return pt[e];if(t)return 0;var i=parseInt(n,10),s=i%100;return(i-s)/100*60+s}(u[8],u[9],u[10]),e._d=He.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function wt(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],f(e).empty=!0;var t,n,s,r,a,o=\"\"+e._i,u=o.length,l=0;for(s=z(e._f,e._locale).match(U)||[],t=0;t<s.length;t++)r=s[t],(n=(o.match(de(r,e))||[])[0])&&((a=o.substr(0,o.indexOf(n))).length>0&&f(e).unusedInput.push(a),o=o.slice(o.indexOf(n)+n.length),l+=n.length),G[r]?(n?f(e).empty=!1:f(e).unusedTokens.push(r),_e(r,n,e)):e._strict&&!n&&f(e).unusedTokens.push(r);f(e).charsLeftOver=u-l,o.length>0&&f(e).unusedInput.push(o),e._a[3]<=12&&!0===f(e).bigHour&&e._a[3]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),ut(e),at(e)}else vt(e);else _t(e)}function Mt(e){var t=e._i,n=e._f;return e._locale=e._locale||rt(e._l),null===t||void 0===n&&\"\"===t?_({nullInput:!0}):(\"string\"==typeof t&&(e._i=t=e._locale.preparse(t)),w(t)?new v(at(t)):(u(t)?e._d=t:s(n)?function(e){var t,n,i,s,r;if(0===e._f.length)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(s=0;s<e._f.length;s++)r=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[s],wt(t),m(t)&&(r+=f(t).charsLeftOver,r+=10*f(t).unusedTokens.length,f(t).score=r,(null==i||r<i)&&(i=r,n=t));h(e,n||t)}(e):n?wt(e):function(e){var t=e._i;a(t)?e._d=new Date(i.now()):u(t)?e._d=new Date(t.valueOf()):\"string\"==typeof t?function(e){var t=mt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,vt(e),!1===e._isValid&&(delete e._isValid,i.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=l(t.slice(0),(function(e){return parseInt(e,10)})),ut(e)):r(t)?function(e){if(!e._d){var t=R(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),ut(e)}}(e):o(t)?e._d=new Date(t):i.createFromInputFallback(e)}(e),m(e)||(e._d=null),e))}function St(e,t,n,i,a){var o,u={};return!0!==n&&!1!==n||(i=n,n=void 0),(r(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||s(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=a,u._l=n,u._i=e,u._f=t,u._strict=i,(o=new v(at(Mt(u))))._nextDay&&(o.add(1,\"d\"),o._nextDay=void 0),o}function kt(e,t,n,i){return St(e,t,n,i,!1)}i.createFromInputFallback=Y(\"value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.\",(function(e){e._d=new Date(e._i+(e._useUTC?\" UTC\":\"\"))})),i.ISO_8601=function(){},i.RFC_2822=function(){};var Dt=Y(\"moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/\",(function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()})),Yt=Y(\"moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/\",(function(){var e=kt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()}));function bt(e,t){var n,i;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return kt();for(n=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](n)||(n=t[i]);return n}var Ot=[\"year\",\"quarter\",\"month\",\"week\",\"day\",\"hour\",\"minute\",\"second\",\"millisecond\"];function Tt(e){var t=R(e),n=t.year||0,i=t.quarter||0,s=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===pe.call(Ot,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,i=0;i<Ot.length;++i)if(e[Ot[i]]){if(n)return!1;parseFloat(e[Ot[i]])!==S(e[Ot[i]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+s+3*i+12*n,this._data={},this._locale=rt(),this._bubble()}function xt(e){return e instanceof Tt}function Pt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ct(e,t){j(e,0,0,(function(){var e=this.utcOffset(),n=\"+\";return e<0&&(e=-e,n=\"-\"),n+N(~~(e/60),2)+t+N(~~e%60,2)}))}Ct(\"Z\",\":\"),Ct(\"ZZ\",\"\"),le(\"Z\",ae),le(\"ZZ\",ae),fe([\"Z\",\"ZZ\"],(function(e,t,n){n._useUTC=!0,n._tzm=Lt(ae,e)}));var Wt=/([\\+\\-]|\\d\\d)/gi;function Lt(e,t){var n=(t||\"\").match(e);if(null===n)return null;var i=((n[n.length-1]||[])+\"\").match(Wt)||[\"-\",0,0],s=60*i[1]+S(i[2]);return 0===s?0:\"+\"===i[0]?s:-s}function Ht(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(w(e)||u(e)?e.valueOf():kt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),i.updateOffset(n,!1),n):kt(e).local()}function Rt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ft(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Et=/^(\\-|\\+)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/,Nt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ut(e,t){var n,i,s,r,a,u,l=e,h=null;return xt(e)?l={ms:e._milliseconds,d:e._days,M:e._months}:o(e)?(l={},t?l[t]=e:l.milliseconds=e):(h=Et.exec(e))?(n=\"-\"===h[1]?-1:1,l={y:0,d:S(h[2])*n,h:S(h[3])*n,m:S(h[4])*n,s:S(h[5])*n,ms:S(Pt(1e3*h[6]))*n}):(h=Nt.exec(e))?(n=\"-\"===h[1]?-1:(h[1],1),l={y:It(h[2],n),M:It(h[3],n),w:It(h[4],n),d:It(h[5],n),h:It(h[6],n),m:It(h[7],n),s:It(h[8],n)}):null==l?l={}:\"object\"==typeof l&&(\"from\"in l||\"to\"in l)&&(r=kt(l.from),a=kt(l.to),s=r.isValid()&&a.isValid()?(a=Ht(a,r),r.isBefore(a)?u=Vt(r,a):((u=Vt(a,r)).milliseconds=-u.milliseconds,u.months=-u.months),u):{milliseconds:0,months:0},(l={}).ms=s.milliseconds,l.M=s.months),i=new Tt(l),xt(e)&&d(e,\"_locale\")&&(i._locale=e._locale),i}function It(e,t){var n=e&&parseFloat(e.replace(\",\",\".\"));return(isNaN(n)?0:n)*t}function Vt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,\"M\").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,\"M\"),n}function Gt(e,t){return function(n,i){var s;return null===i||isNaN(+i)||(T(t,\"moment().\"+t+\"(period, number) is deprecated. Please use moment().\"+t+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),s=n,n=i,i=s),jt(this,Ut(n=\"string\"==typeof n?+n:n,i),e),this}}function jt(e,t,n,s){var r=t._milliseconds,a=Pt(t._days),o=Pt(t._months);e.isValid()&&(s=null==s||s,o&&Te(e,Me(e,\"Month\")+o*n),a&&Se(e,\"Date\",Me(e,\"Date\")+a*n),r&&e._d.setTime(e._d.valueOf()+r*n),s&&i.updateOffset(e,a||o))}Ut.fn=Tt.prototype,Ut.invalid=function(){return Ut(NaN)};var At=Gt(1,\"add\"),zt=Gt(-1,\"subtract\");function Zt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,\"months\");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,\"months\")):(t-i)/(e.clone().add(n+1,\"months\")-i)))||0}function $t(e){var t;return void 0===e?this._locale._abbr:(null!=(t=rt(e))&&(this._locale=t),this)}i.defaultFormat=\"YYYY-MM-DDTHH:mm:ssZ\",i.defaultFormatUtc=\"YYYY-MM-DDTHH:mm:ss[Z]\";var Bt=Y(\"moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.\",(function(e){return void 0===e?this.localeData():this.locale(e)}));function Jt(){return this._locale}function qt(e,t){j(0,[e,e.length],0,t)}function Qt(e,t,n,i,s){var r;return null==e?Ee(this,i,s).year:(t>(r=Ne(e,i,s))&&(t=r),Xt.call(this,e,t,n,i,s))}function Xt(e,t,n,i,s){var r=Fe(e,t,n,i,s),a=He(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}j(0,[\"gg\",2],0,(function(){return this.weekYear()%100})),j(0,[\"GG\",2],0,(function(){return this.isoWeekYear()%100})),qt(\"gggg\",\"weekYear\"),qt(\"ggggg\",\"weekYear\"),qt(\"GGGG\",\"isoWeekYear\"),qt(\"GGGGG\",\"isoWeekYear\"),L(\"weekYear\",\"gg\"),L(\"isoWeekYear\",\"GG\"),E(\"weekYear\",1),E(\"isoWeekYear\",1),le(\"G\",se),le(\"g\",se),le(\"GG\",Q,$),le(\"gg\",Q,$),le(\"GGGG\",te,J),le(\"gggg\",te,J),le(\"GGGGG\",ne,q),le(\"ggggg\",ne,q),me([\"gggg\",\"ggggg\",\"GGGG\",\"GGGGG\"],(function(e,t,n,i){t[i.substr(0,2)]=S(e)})),me([\"gg\",\"GG\"],(function(e,t,n,s){t[s]=i.parseTwoDigitYear(e)})),j(\"Q\",0,\"Qo\",\"quarter\"),L(\"quarter\",\"Q\"),E(\"quarter\",7),le(\"Q\",Z),fe(\"Q\",(function(e,t){t[1]=3*(S(e)-1)})),j(\"D\",[\"DD\",2],\"Do\",\"date\"),L(\"date\",\"D\"),E(\"date\",9),le(\"D\",Q),le(\"DD\",Q,$),le(\"Do\",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),fe([\"D\",\"DD\"],2),fe(\"Do\",(function(e,t){t[2]=S(e.match(Q)[0])}));var Kt=we(\"Date\",!0);j(\"DDD\",[\"DDDD\",3],\"DDDo\",\"dayOfYear\"),L(\"dayOfYear\",\"DDD\"),E(\"dayOfYear\",4),le(\"DDD\",ee),le(\"DDDD\",B),fe([\"DDD\",\"DDDD\"],(function(e,t,n){n._dayOfYear=S(e)})),j(\"m\",[\"mm\",2],0,\"minute\"),L(\"minute\",\"m\"),E(\"minute\",14),le(\"m\",Q),le(\"mm\",Q,$),fe([\"m\",\"mm\"],4);var en=we(\"Minutes\",!1);j(\"s\",[\"ss\",2],0,\"second\"),L(\"second\",\"s\"),E(\"second\",15),le(\"s\",Q),le(\"ss\",Q,$),fe([\"s\",\"ss\"],5);var tn,nn=we(\"Seconds\",!1);for(j(\"S\",0,0,(function(){return~~(this.millisecond()/100)})),j(0,[\"SS\",2],0,(function(){return~~(this.millisecond()/10)})),j(0,[\"SSS\",3],0,\"millisecond\"),j(0,[\"SSSS\",4],0,(function(){return 10*this.millisecond()})),j(0,[\"SSSSS\",5],0,(function(){return 100*this.millisecond()})),j(0,[\"SSSSSS\",6],0,(function(){return 1e3*this.millisecond()})),j(0,[\"SSSSSSS\",7],0,(function(){return 1e4*this.millisecond()})),j(0,[\"SSSSSSSS\",8],0,(function(){return 1e5*this.millisecond()})),j(0,[\"SSSSSSSSS\",9],0,(function(){return 1e6*this.millisecond()})),L(\"millisecond\",\"ms\"),E(\"millisecond\",16),le(\"S\",ee,Z),le(\"SS\",ee,$),le(\"SSS\",ee,B),tn=\"SSSS\";tn.length<=9;tn+=\"S\")le(tn,ie);function sn(e,t){t[6]=S(1e3*(\"0.\"+e))}for(tn=\"S\";tn.length<=9;tn+=\"S\")fe(tn,sn);var rn=we(\"Milliseconds\",!1);j(\"z\",0,0,\"zoneAbbr\"),j(\"zz\",0,0,\"zoneName\");var an=v.prototype;function on(e){return e}an.add=At,an.calendar=function(e,t){var n=e||kt(),s=Ht(n,this).startOf(\"day\"),r=i.calendarFormat(this,s)||\"sameElse\",a=t&&(x(t[r])?t[r].call(this,n):t[r]);return this.format(a||this.localeData().calendar(r,this,kt(n)))},an.clone=function(){return new v(this)},an.diff=function(e,t,n){var i,s,r;if(!this.isValid())return NaN;if(!(i=Ht(e,this)).isValid())return NaN;switch(s=6e4*(i.utcOffset()-this.utcOffset()),t=H(t)){case\"year\":r=Zt(this,i)/12;break;case\"month\":r=Zt(this,i);break;case\"quarter\":r=Zt(this,i)/3;break;case\"second\":r=(this-i)/1e3;break;case\"minute\":r=(this-i)/6e4;break;case\"hour\":r=(this-i)/36e5;break;case\"day\":r=(this-i-s)/864e5;break;case\"week\":r=(this-i-s)/6048e5;break;default:r=this-i}return n?r:M(r)},an.endOf=function(e){return void 0===(e=H(e))||\"millisecond\"===e?this:(\"date\"===e&&(e=\"day\"),this.startOf(e).add(1,\"isoWeek\"===e?\"week\":e).subtract(1,\"ms\"))},an.format=function(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},an.from=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||kt(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},an.fromNow=function(e){return this.from(kt(),e)},an.to=function(e,t){return this.isValid()&&(w(e)&&e.isValid()||kt(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},an.toNow=function(e){return this.to(kt(),e)},an.get=function(e){return x(this[e=H(e)])?this[e]():this},an.invalidAt=function(){return f(this).overflow},an.isAfter=function(e,t){var n=w(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=H(a(t)?\"millisecond\":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},an.isBefore=function(e,t){var n=w(e)?e:kt(e);return!(!this.isValid()||!n.isValid())&&(\"millisecond\"===(t=H(a(t)?\"millisecond\":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},an.isBetween=function(e,t,n,i){return(\"(\"===(i=i||\"()\")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(\")\"===i[1]?this.isBefore(t,n):!this.isAfter(t,n))},an.isSame=function(e,t){var n,i=w(e)?e:kt(e);return!(!this.isValid()||!i.isValid())&&(\"millisecond\"===(t=H(t||\"millisecond\"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},an.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},an.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},an.isValid=function(){return m(this)},an.lang=Bt,an.locale=$t,an.localeData=Jt,an.max=Yt,an.min=Dt,an.parsingFlags=function(){return h({},f(this))},an.set=function(e,t){if(\"object\"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=R(e)),i=0;i<n.length;i++)this[n[i].unit](e[n[i].unit]);else if(x(this[e=H(e)]))return this[e](t);return this},an.startOf=function(e){switch(e=H(e)){case\"year\":this.month(0);case\"quarter\":case\"month\":this.date(1);case\"week\":case\"isoWeek\":case\"day\":case\"date\":this.hours(0);case\"hour\":this.minutes(0);case\"minute\":this.seconds(0);case\"second\":this.milliseconds(0)}return\"week\"===e&&this.weekday(0),\"isoWeek\"===e&&this.isoWeekday(1),\"quarter\"===e&&this.month(3*Math.floor(this.month()/3)),this},an.subtract=zt,an.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},an.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},an.toDate=function(){return new Date(this.valueOf())},an.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?A(n,t?\"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ\"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace(\"Z\",A(n,\"Z\")):A(n,t?\"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]\":\"YYYY-MM-DD[T]HH:mm:ss.SSSZ\")},an.inspect=function(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var e=\"moment\",t=\"\";this.isLocal()||(e=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",t=\"Z\");var n=\"[\"+e+'(\"]',i=0<=this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",s=t+'[\")]';return this.format(n+i+\"-MM-DD[T]HH:mm:ss.SSS\"+s)},an.toJSON=function(){return this.isValid()?this.toISOString():null},an.toString=function(){return this.clone().locale(\"en\").format(\"ddd MMM DD YYYY HH:mm:ss [GMT]ZZ\")},an.unix=function(){return Math.floor(this.valueOf()/1e3)},an.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},an.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},an.year=ve,an.isLeapYear=function(){return ge(this.year())},an.weekYear=function(e){return Qt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},an.isoWeekYear=function(e){return Qt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},an.quarter=an.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},an.month=xe,an.daysInMonth=function(){return ke(this.year(),this.month())},an.week=an.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),\"d\")},an.isoWeek=an.isoWeeks=function(e){var t=Ee(this,1,4).week;return null==e?t:this.add(7*(e-t),\"d\")},an.weeksInYear=function(){var e=this.localeData()._week;return Ne(this.year(),e.dow,e.doy)},an.isoWeeksInYear=function(){return Ne(this.year(),1,4)},an.date=Kt,an.day=an.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return\"string\"!=typeof e?e:isNaN(e)?\"number\"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,\"d\")):t},an.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,\"d\")},an.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return\"string\"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},an.dayOfYear=function(e){var t=Math.round((this.clone().startOf(\"day\")-this.clone().startOf(\"year\"))/864e5)+1;return null==e?t:this.add(e-t,\"d\")},an.hour=an.hours=Qe,an.minute=an.minutes=en,an.second=an.seconds=nn,an.millisecond=an.milliseconds=rn,an.utcOffset=function(e,t,n){var s,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if(\"string\"==typeof e){if(null===(e=Lt(ae,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Rt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,\"m\"),r!==e&&(!t||this._changeInProgress?jt(this,Ut(e-r,\"m\"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Rt(this)},an.utc=function(e){return this.utcOffset(0,e)},an.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Rt(this),\"m\")),this},an.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if(\"string\"==typeof this._i){var e=Lt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},an.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?kt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},an.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},an.isLocal=function(){return!!this.isValid()&&!this._isUTC},an.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},an.isUtc=Ft,an.isUTC=Ft,an.zoneAbbr=function(){return this._isUTC?\"UTC\":\"\"},an.zoneName=function(){return this._isUTC?\"Coordinated Universal Time\":\"\"},an.dates=Y(\"dates accessor is deprecated. Use date instead.\",Kt),an.months=Y(\"months accessor is deprecated. Use month instead\",xe),an.years=Y(\"years accessor is deprecated. Use year instead\",ve),an.zone=Y(\"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/\",(function(e,t){return null!=e?(\"string\"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),an.isDSTShifted=Y(\"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information\",(function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=Mt(e))._a){var t=e._isUTC?c(e._a):kt(e._a);this._isDSTShifted=this.isValid()&&k(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var un=C.prototype;function ln(e,t,n,i){var s=rt(),r=c().set(i,t);return s[n](r,e)}function dn(e,t,n){if(o(e)&&(t=e,e=void 0),e=e||\"\",null!=t)return ln(e,t,n,\"month\");var i,s=[];for(i=0;i<12;i++)s[i]=ln(e,i,n,\"month\");return s}function hn(e,t,n,i){\"boolean\"==typeof e?(o(t)&&(n=t,t=void 0),t=t||\"\"):(n=t=e,e=!1,o(t)&&(n=t,t=void 0),t=t||\"\");var s,r=rt(),a=e?r._week.dow:0;if(null!=n)return ln(t,(n+a)%7,i,\"day\");var u=[];for(s=0;s<7;s++)u[s]=ln(t,(s+a)%7,i,\"day\");return u}un.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return x(i)?i.call(t,n):i},un.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},un.invalidDate=function(){return this._invalidDate},un.ordinal=function(e){return this._ordinal.replace(\"%d\",e)},un.preparse=on,un.postformat=on,un.relativeTime=function(e,t,n,i){var s=this._relativeTime[n];return x(s)?s(e,t,n,i):s.replace(/%d/i,e)},un.pastFuture=function(e,t){var n=this._relativeTime[e>0?\"future\":\"past\"];return x(n)?n(t):n.replace(/%s/i,t)},un.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this[\"_\"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+\"|\"+/\\d{1,2}/.source)},un.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||De).test(t)?\"format\":\"standalone\"][e.month()]:s(this._months)?this._months:this._months.standalone},un.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[De.test(t)?\"format\":\"standalone\"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},un.monthsParse=function(e,t,n){var i,s,r;if(this._monthsParseExact)return Oe.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(s=c([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp(\"^\"+this.months(s,\"\").replace(\".\",\"\")+\"$\",\"i\"),this._shortMonthsParse[i]=new RegExp(\"^\"+this.monthsShort(s,\"\").replace(\".\",\"\")+\"$\",\"i\")),n||this._monthsParse[i]||(r=\"^\"+this.months(s,\"\")+\"|^\"+this.monthsShort(s,\"\"),this._monthsParse[i]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"MMMM\"===t&&this._longMonthsParse[i].test(e))return i;if(n&&\"MMM\"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},un.monthsRegex=function(e){return this._monthsParseExact?(d(this,\"_monthsRegex\")||We.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,\"_monthsRegex\")||(this._monthsRegex=Ce),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},un.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,\"_monthsRegex\")||We.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,\"_monthsShortRegex\")||(this._monthsShortRegex=Pe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},un.week=function(e){return Ee(e,this._week.dow,this._week.doy).week},un.firstDayOfYear=function(){return this._week.doy},un.firstDayOfWeek=function(){return this._week.dow},un.weekdays=function(e,t){return e?s(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?\"format\":\"standalone\"][e.day()]:s(this._weekdays)?this._weekdays:this._weekdays.standalone},un.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},un.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},un.weekdaysParse=function(e,t,n){var i,s,r;if(this._weekdaysParseExact)return Ge.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(s=c([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp(\"^\"+this.weekdays(s,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\"),this._shortWeekdaysParse[i]=new RegExp(\"^\"+this.weekdaysShort(s,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\"),this._minWeekdaysParse[i]=new RegExp(\"^\"+this.weekdaysMin(s,\"\").replace(\".\",\"\\\\.?\")+\"$\",\"i\")),this._weekdaysParse[i]||(r=\"^\"+this.weekdays(s,\"\")+\"|^\"+this.weekdaysShort(s,\"\")+\"|^\"+this.weekdaysMin(s,\"\"),this._weekdaysParse[i]=new RegExp(r.replace(\".\",\"\"),\"i\")),n&&\"dddd\"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&\"ddd\"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&\"dd\"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},un.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||Ze.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,\"_weekdaysRegex\")||(this._weekdaysRegex=je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},un.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||Ze.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,\"_weekdaysShortRegex\")||(this._weekdaysShortRegex=Ae),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},un.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,\"_weekdaysRegex\")||Ze.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,\"_weekdaysMinRegex\")||(this._weekdaysMinRegex=ze),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},un.isPM=function(e){return\"p\"===(e+\"\").toLowerCase().charAt(0)},un.meridiem=function(e,t,n){return e>11?n?\"pm\":\"PM\":n?\"am\":\"AM\"},it(\"en\",{dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===S(e%100/10)?\"th\":1===t?\"st\":2===t?\"nd\":3===t?\"rd\":\"th\")}}),i.lang=Y(\"moment.lang is deprecated. Use moment.locale instead.\",it),i.langData=Y(\"moment.langData is deprecated. Use moment.localeData instead.\",rt);var cn=Math.abs;function fn(e,t,n,i){var s=Ut(t,n);return e._milliseconds+=i*s._milliseconds,e._days+=i*s._days,e._months+=i*s._months,e._bubble()}function mn(e){return e<0?Math.floor(e):Math.ceil(e)}function _n(e){return 4800*e/146097}function yn(e){return 146097*e/4800}function gn(e){return function(){return this.as(e)}}var pn=gn(\"ms\"),vn=gn(\"s\"),wn=gn(\"m\"),Mn=gn(\"h\"),Sn=gn(\"d\"),kn=gn(\"w\"),Dn=gn(\"M\"),Yn=gn(\"y\");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var On=bn(\"milliseconds\"),Tn=bn(\"seconds\"),xn=bn(\"minutes\"),Pn=bn(\"hours\"),Cn=bn(\"days\"),Wn=bn(\"months\"),Ln=bn(\"years\"),Hn=Math.round,Rn={ss:44,s:45,m:45,h:22,d:26,M:11};function Fn(e,t,n,i,s){return s.relativeTime(t||1,!!n,e,i)}var En=Math.abs;function Nn(e){return(e>0)-(e<0)||+e}function Un(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=En(this._milliseconds)/1e3,i=En(this._days),s=En(this._months);e=M(n/60),t=M(e/60),n%=60,e%=60;var r=M(s/12),a=s%=12,o=i,u=t,l=e,d=n?n.toFixed(3).replace(/\\.?0+$/,\"\"):\"\",h=this.asSeconds();if(!h)return\"P0D\";var c=h<0?\"-\":\"\",f=Nn(this._months)!==Nn(h)?\"-\":\"\",m=Nn(this._days)!==Nn(h)?\"-\":\"\",_=Nn(this._milliseconds)!==Nn(h)?\"-\":\"\";return c+\"P\"+(r?f+r+\"Y\":\"\")+(a?f+a+\"M\":\"\")+(o?m+o+\"D\":\"\")+(u||l||d?\"T\":\"\")+(u?_+u+\"H\":\"\")+(l?_+l+\"M\":\"\")+(d?_+d+\"S\":\"\")}var In=Tt.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=cn(this._milliseconds),this._days=cn(this._days),this._months=cn(this._months),e.milliseconds=cn(e.milliseconds),e.seconds=cn(e.seconds),e.minutes=cn(e.minutes),e.hours=cn(e.hours),e.months=cn(e.months),e.years=cn(e.years),this},In.add=function(e,t){return fn(this,e,t,1)},In.subtract=function(e,t){return fn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if(\"month\"===(e=H(e))||\"year\"===e)return t=this._days+i/864e5,n=this._months+_n(t),\"month\"===e?n:n/12;switch(t=this._days+Math.round(yn(this._months)),e){case\"week\":return t/7+i/6048e5;case\"day\":return t+i/864e5;case\"hour\":return 24*t+i/36e5;case\"minute\":return 1440*t+i/6e4;case\"second\":return 86400*t+i/1e3;case\"millisecond\":return Math.floor(864e5*t)+i;default:throw new Error(\"Unknown unit \"+e)}},In.asMilliseconds=pn,In.asSeconds=vn,In.asMinutes=wn,In.asHours=Mn,In.asDays=Sn,In.asWeeks=kn,In.asMonths=Dn,In.asYears=Yn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12):NaN},In._bubble=function(){var e,t,n,i,s,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*mn(yn(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=M(r/1e3),u.seconds=e%60,t=M(e/60),u.minutes=t%60,n=M(t/60),u.hours=n%24,a+=M(n/24),s=M(_n(a)),o+=s,a-=mn(yn(s)),i=M(o/12),o%=12,u.days=a,u.months=o,u.years=i,this},In.clone=function(){return Ut(this)},In.get=function(e){return e=H(e),this.isValid()?this[e+\"s\"]():NaN},In.milliseconds=On,In.seconds=Tn,In.minutes=xn,In.hours=Pn,In.days=Cn,In.weeks=function(){return M(this.days()/7)},In.months=Wn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var i=Ut(e).abs(),s=Hn(i.as(\"s\")),r=Hn(i.as(\"m\")),a=Hn(i.as(\"h\")),o=Hn(i.as(\"d\")),u=Hn(i.as(\"M\")),l=Hn(i.as(\"y\")),d=s<=Rn.ss&&[\"s\",s]||s<Rn.s&&[\"ss\",s]||r<=1&&[\"m\"]||r<Rn.m&&[\"mm\",r]||a<=1&&[\"h\"]||a<Rn.h&&[\"hh\",a]||o<=1&&[\"d\"]||o<Rn.d&&[\"dd\",o]||u<=1&&[\"M\"]||u<Rn.M&&[\"MM\",u]||l<=1&&[\"y\"]||[\"yy\",l];return d[2]=t,d[3]=+e>0,d[4]=n,Fn.apply(null,d)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},In.toISOString=Un,In.toString=Un,In.toJSON=Un,In.locale=$t,In.localeData=Jt,In.toIsoString=Y(\"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)\",Un),In.lang=Bt,j(\"X\",0,0,\"unix\"),j(\"x\",0,0,\"valueOf\"),le(\"x\",se),le(\"X\",/[+-]?\\d+(\\.\\d{1,3})?/),fe(\"X\",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),fe(\"x\",(function(e,t,n){n._d=new Date(S(e))})),i.version=\"2.22.2\",t=kt,i.fn=an,i.min=function(){var e=[].slice.call(arguments,0);return bt(\"isBefore\",e)},i.max=function(){var e=[].slice.call(arguments,0);return bt(\"isAfter\",e)},i.now=function(){return Date.now?Date.now():+new Date},i.utc=c,i.unix=function(e){return kt(1e3*e)},i.months=function(e,t){return dn(e,t,\"months\")},i.isDate=u,i.locale=it,i.invalid=_,i.duration=Ut,i.isMoment=w,i.weekdays=function(e,t,n){return hn(e,t,n,\"weekdays\")},i.parseZone=function(){return kt.apply(null,arguments).parseZone()},i.localeData=rt,i.isDuration=xt,i.monthsShort=function(e,t){return dn(e,t,\"monthsShort\")},i.weekdaysMin=function(e,t,n){return hn(e,t,n,\"weekdaysMin\")},i.defineLocale=st,i.updateLocale=function(e,t){if(null!=t){var n,i,s=Xe;null!=(i=nt(e))&&(s=i._config),t=P(s,t),(n=new C(t)).parentLocale=Ke[e],Ke[e]=n,it(e)}else null!=Ke[e]&&(null!=Ke[e].parentLocale?Ke[e]=Ke[e].parentLocale:null!=Ke[e]&&delete Ke[e]);return Ke[e]},i.locales=function(){return b(Ke)},i.weekdaysShort=function(e,t,n){return hn(e,t,n,\"weekdaysShort\")},i.normalizeUnits=H,i.relativeTimeRounding=function(e){return void 0===e?Hn:\"function\"==typeof e&&(Hn=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==Rn[e]&&(void 0===t?Rn[e]:(Rn[e]=t,\"s\"===e&&(Rn.ss=t-1),!0))},i.calendarFormat=function(e,t){var n=e.diff(t,\"days\",!0);return n<-6?\"sameElse\":n<-1?\"lastWeek\":n<0?\"lastDay\":n<1?\"sameDay\":n<2?\"nextDay\":n<7?\"nextWeek\":\"sameElse\"},i.prototype=an,i.HTML5_FMT={DATETIME_LOCAL:\"YYYY-MM-DDTHH:mm\",DATETIME_LOCAL_SECONDS:\"YYYY-MM-DDTHH:mm:ss\",DATETIME_LOCAL_MS:\"YYYY-MM-DDTHH:mm:ss.SSS\",DATE:\"YYYY-MM-DD\",TIME:\"HH:mm\",TIME_SECONDS:\"HH:mm:ss\",TIME_MS:\"HH:mm:ss.SSS\",WEEK:\"YYYY-[W]WW\",MONTH:\"YYYY-MM\"},i}()}).call(this,n(1)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,\"loaded\",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,\"id\",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){\"use strict\";n.r(t);var i=n(0),s=n.n(i);function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,\"value\"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}$(document).ready((function(){var e=document.getElementById(\"wagalytics-data\");!function(e,t){if(!window.google||!window.google.load){var n=document.createElement(\"script\");n.type=\"text/javascript\",n.src=\"https://www.google.com/jsapi\";var i=document.getElementsByTagName(\"script\")[0];i.parentNode.insertBefore(n,i)}gapi.analytics.ready((function(){$.get(e,(function(e){gapi.analytics.auth.authorize({serverAuth:{access_token:e}})})),new u(t).refresh()}))}(e.dataset.token,e.dataset.viewId)}));var a=\"#f37e77\",o=\"#fcf2f2\",u=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.view_id=t,this.start_date_input=document.getElementById(\"id_date_from\"),this.end_date_input=document.getElementById(\"id_date_to\"),this.export_btn=document.getElementById(\"export-button\"),this.start_date_input.addEventListener(\"change\",(function(){return n.refresh()})),this.end_date_input.addEventListener(\"change\",(function(){return n.refresh()})),$(document.getElementById(\"export\")).submit((function(){$(document.getElementById(\"export-data\")).val(JSON.stringify(n.data))})),this.data={},this.tooltips={enabled:!0,mode:\"label\",callbacks:{title:function(e,t){var n=e[0].index;return\"Title:\"+t.labels[n]},label:function(e,t){return e.xLabel}}}}var t,n,i;return t=e,(n=[{key:\"setLoading\",value:function(e){document.getElementById(e).innerHTML='<i class=\"icon icon-spinner\"></i>'}},{key:\"refresh\",value:function(){this.sessionsLineChart(),this.popularPagesTable(),this.topReferrersTable()}},{key:\"getQuery\",value:function(e){return $(this.export_btn).prop(\"disabled\",!0),t=Object.assign({ids:this.view_id,\"start-date\":$(this.start_date_input).val(),\"end-date\":$(this.end_date_input).val()},e),new Promise((function(e,n){new gapi.analytics.report.Data({query:t}).once(\"success\",(function(t){e(t)})).once(\"error\",(function(e){n(e)})).execute()}));var t}},{key:\"sessionsLineChart\",value:function(){var e=this,t=\"sessions-line-chart-container\";this.setLoading(t),this.getQuery({dimensions:\"ga:date,ga:nthDay\",metrics:\"ga:sessions\"}).then((function(n){e.data.sessions=n.rows,$(e.export_btn).prop(\"disabled\",!1),$(e.export_btn).removeClass(\"button-longrunning-active\");var i=n.rows.map((function(e){return e[2]})),r=n.rows.map((function(e){return e[0]})),u={labels:r=r.map((function(e){return s()(e,\"YYYYMMDD\").format(\"ll\")})),datasets:[{label:\"Sessions\",backgroundColor:o,borderColor:a,pointBackgroundColor:a,pointBorderColor:\"#fff\",data:i}]};new Chart(function(e){var t=document.getElementById(e),n=document.createElement(\"canvas\"),i=n.getContext(\"2d\");return t.innerHTML=\"\",n.width=t.offsetWidth,n.height=t.offsetHeight,t.appendChild(n),i}(t),{type:\"line\",data:u,options:{legend:{display:!1},scales:{xAxes:[{ticks:{autoSkip:!0,maxTicksLimit:4,maxRotation:0}}]}}})}))}},{key:\"popularPagesTable\",value:function(){var e=this,t=\"popular-pages-table-container\";this.setLoading(t),this.getQuery({metrics:\"ga:pageviews\",dimensions:\"ga:hostname,ga:pagePath\",sort:\"-ga:pageviews\",\"max-results\":25}).then((function(n){for(var i=0,s=n.rows,r=s.length,a={};i<r;++i){var o=s[i][1];a.hasOwnProperty(o)?a[o][1]+=parseInt(s[i][2],10):a[o]=[o,parseInt(s[i][2],10)]}e.data.pages=Object.values(a),$(e.export_btn).prop(\"disabled\",!1),$(e.export_btn).removeClass(\"button-longrunning-active\");var u=l([\"Page URL\",\"Views\"],Object.values(a)),h=d(u),c=document.getElementById(t);c.innerHTML=\"\",c.appendChild(u),$(c).append(h)}))}},{key:\"topReferrersTable\",value:function(){var e=this,t=\"top-referrers-table-container\";this.setLoading(t),this.getQuery({metrics:\"ga:pageviews\",dimensions:\"ga:fullReferrer\",sort:\"-ga:pageviews\",\"max-results\":25}).then((function(n){e.data.referrers=n.rows,$(e.export_btn).prop(\"disabled\",!1),$(e.export_btn).removeClass(\"button-longrunning-active\");var i=l([\"Source\",\"Views\"],n.rows),s=d(i),r=document.getElementById(t);r.innerHTML=\"\",r.appendChild(i),$(r).append(s)}))}}])&&r(t.prototype,n),i&&r(t,i),e}();function l(e,t){var n=document.createElement(\"table\");n.className=\"listing\";for(var i=n.createTHead().insertRow(0),s=0;s<e.length;++s){var r=i.insertCell(s);r.innerHTML=e[s],r.className=\"title\"}var a=n.createTBody();for(s=0;s<t.length;++s)for(var o=t[s],u=a.insertRow(s),l=0;l<o.length;++l)u.insertCell(l).innerHTML=o[l];return n}function d(e){var t=0,n=$(e);n.bind(\"repaginate\",(function(){n.find(\"tbody tr\").hide().slice(5*t,5*(t+1)).show();var e=n.next();t<=0?e.find(\".prev\").addClass(\"disabled\"):e.find(\".prev\").removeClass(\"disabled\"),t>=s-1?e.find(\".next\").addClass(\"disabled\"):e.find(\".next\").removeClass(\"disabled\")})),n.trigger(\"repaginate\");var i=n.find(\"tbody tr\").length,s=Math.ceil(i/5),r=$('\\n        <div class=\"pagination\">\\n            <p>Page <span class=\"page-num\">1</span> of '.concat(s,'</p>\\n            <ul>\\n                <li class=\"prev disabled\">\\n                    <a class=\"icon icon-arrow-left\" href=\"#\">Previous</a>\\n                </li>\\n                <li class=\"next\">\\n                    <a class=\"icon icon-arrow-right-after\" href=\"#\">Next</a>\\n                </li>\\n            </ul>\\n        </div>'));return r.find(\".prev a\").bind(\"click\",(function(e){e.preventDefault(),(t-=1)<0&&(t=0),r.find(\".page-num\").text(\"\".concat(t+1)),n.trigger(\"repaginate\")})),r.find(\".next a\").bind(\"click\",(function(e){e.preventDefault(),(t+=1)>=s&&(t=s-1),r.find(\".page-num\").text(\"\".concat(t+1)),n.trigger(\"repaginate\")})),r}Chart.defaults.global.animationSteps=60,Chart.defaults.global.animationEasing=\"easeInOutQuart\",Chart.defaults.global.responsive=!0,Chart.defaults.global.maintainAspectRatio=!1}]);\n//# sourceMappingURL=http://127.0.0.1:3001/dist/js/wagalytics.js.map"
  },
  {
    "path": "wagalytics/templates/wagalytics/dashboard.html",
    "content": "{% extends \"wagtailadmin/base.html\" %}\n{% load wagtailadmin_tags i18n static %}\n\n{% block extra_css %}\n    {% include \"wagtailadmin/pages/_editor_css.html\" %}\n    {{ block.super }}\n    <script>\n        (function(w,d,s,g,js,fs){\n          g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}};\n          js=d.createElement(s);fs=d.getElementsByTagName(s)[0];\n          js.src='https://apis.google.com/js/platform.js';\n          fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');};\n        }(window,document,'script'));\n    </script>\n    <style>\n      .wagalytics .chart {\n          height: 150px;\n          margin-bottom: 50px;\n      }\n\n      .wagalytics .icon-spinner {\n          margin-left: 50%;\n      }\n\n      .wagalytics .button-group {\n        float: right;\n      }\n\n      .wagalytics .pagination {\n        margin-bottom: 50px;\n      }\n\n      .wagalytics .pagination ul {\n        margin-top: -1.265em;\n      }\n\n      .wagalytics .disabled a {\n        cursor: default;\n        pointer-events: none;\n        color: #666;\n        opacity: 0.5;\n      }\n\n      .wagalytics table.listing td.title:first-child {\n        width: 90%;\n      }\n\n      footer .actions {\n        width: auto;\n      }\n\n      footer .meta {\n        float: none;\n        text-align: left;\n      }\n    </style>\n{% endblock %}\n\n{% block titletag %}{% trans 'Analytics' %}{% endblock %}\n\n{% block content %}\n    <header class=\"col12\">\n        <div class=\"row nice-padding\">\n            <div class=\"left\">\n                <div class=\"col header-title\">\n                    <h1 class=\"icon icon-fa-bar-chart\">\n                        {% trans \"Analytics\" %}\n                    </h1>\n                </div>\n            </div>\n            <form class=\"left\">\n                <ul class=\"fields\">\n                    <li class=\"date_field col6\">\n                        <div class=\"field date_field admin_date_input field-small\">\n                            <label for=\"id_date_from\">Start date:</label>\n                            <div class=\"field-content\">\n                                <div class=\"input\">\n                                    <input id=\"id_date_from\" type=\"date\" value=\"{{ initial_start_date }}\">\n                                </div>\n                            </div>\n                        </div>\n                    </li>\n                    <li class=\"date_field col6\">\n                        <div class=\"field date_field admin_date_input field-small\">\n                            <label for=\"id_date_from\">End date:</label>\n                            <div class=\"field-content\">\n                                <div class=\"input\">\n                                    <input id=\"id_date_to\" type=\"date\" value=\"{% now \"Y-m-d\" %}\">\n                                </div>\n                            </div>\n                        </div>\n                    </li>\n                </ul>\n            </form>\n            {% if site_switcher %}\n                <div class=\"right\" style='margin-left: 20px;'>\n                    <form method=\"get\" id=\"settings-site-switch\" novalidate>\n                        <label for=\"{{ site_switcher.site.id_for_label }}\">\n                            Site:\n                        </label>\n                        {{ site_switcher.site }}\n                    </form>\n                </div>\n            {% endif %}\n        </div>\n    </header>\n\n    <div class=\"wagalytics nice-padding\">\n        <div class=\"col12 clearfix\">\n            <h2>Sessions</h2>\n            <div id=\"sessions-line-chart-container\" class=\"chart\"><i class=\"icon icon-spinner\"></i></div>\n        </div>\n        <div class=\"col6 clearfix\">\n            <h2>Popular content</h2>\n            <div id=\"popular-pages-table-container\"><i class=\"icon icon-spinner\"></i></div>\n        </div>\n        <div class=\"col6 clearfix\">\n            <h2>Top referrers</h2>\n            <div id=\"top-referrers-table-container\" ><i class=\"icon icon-spinner\"></i></div>\n        </div>\n    </div>\n\n    <footer>\n        <ul>\n            <li class=\"actions\">\n                <form id=\"export\" action=\"{% url 'wagalytics_export' %}\" method=\"post\">\n                    {% csrf_token %}\n                    <input id=\"export-data\" type=\"hidden\" name=\"data\">\n                    <button id=\"export-button\" class=\"button icon icon-download button-longrunning\" data-clicked-text=\"Exporting…\" type=\"submit\" disabled>\n                        <span class=\"icon icon-spinner\"></span><em>Export Data</em>\n                    </button>\n                </form>\n            </li>\n            <li class=\"meta\">\n                <p>{% trans \"The current view will be exported to a spreadsheet file (*.ods)\" %}</p>\n            </li>\n        </ul>\n    </footer>\n\n    <div hidden id=\"wagalytics-data\" data-token=\"{% url 'wagalytics_site_token' site_id %}\" data-view-id=\"{{ ga_view_id }}\">\n    </div>\n{% endblock %}\n\n{% block extra_js %}\n    {{ block.super }}\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js\"></script>\n    <script src=\"{% static 'wagalytics/vendors.bundle.js' %}\"></script>\n    <script src=\"{% static 'wagalytics/wagalytics.bundle.js' %}\"></script>\n    {{ site_switcher.media.js }}\n{% endblock %}\n"
  },
  {
    "path": "wagalytics/tests/tests.py",
    "content": "import pytest\n\nfrom django.conf import settings\nfrom django.test import TestCase\nfrom django.urls import reverse\n\nfrom wagtail.tests.utils import WagtailTestUtils\nfrom wagtail.core.models import Site\nimport wagtail_factories\n\npytestmark = pytest.mark.django_db\n\n\n@pytest.mark.django_db\nclass TestWagalyticsDashboard(TestCase, WagtailTestUtils):\n\n    def setUp(self):\n        self.dashboard_url = reverse('wagalytics_dashboard')\n        # Clear KEY settings in case tests are being run inside of a project.\n        self._clean_wagalytics_keys()\n        # Login\n        self.login()\n\n    def _clean_wagalytics_keys(self):\n        \"\"\"Remove Wagalytics settings.\"\"\"\n        if hasattr(settings, 'WAGALYTICS_SETTINGS'):\n            del settings.WAGALYTICS_SETTINGS\n        if hasattr(settings, 'GA_VIEW_ID'):\n            del settings.GA_VIEW_ID\n        if hasattr(settings, 'GA_KEY_FILEPATH'):\n            del settings.GA_KEY_FILEPATH\n        if hasattr(settings, 'GA_KEY_CONTENT'):\n            del settings.GA_KEY_CONTENT\n\n    def _use_single_site_settings(self):\n        if hasattr(settings, 'WAGALYTICS_SETTINGS'):\n            del settings.WAGALYTICS_SETTINGS\n\n        settings.GA_VIEW_ID = 'ga:xxxxxxxx'\n        settings.GA_KEY_FILEPATH = '/path/to/your/analytics-key.json'\n\n    def _use_multi_site_settings(self):\n        settings.WAGALYTICS_SETTINGS = {\n            # My default site.\n            2: {\n                'GA_VIEW_ID': 'ga:xxxxxxxx',\n                'GA_KEY_FILEPATH': '/path/to/your/analytics-key.json',\n            },\n            # The secondary site.\n            3: {\n                'GA_KEY_CONTENT': 'content_of_your_key.json',\n                'GA_VIEW_ID': 'ga:xxxxxxxx',\n            }\n        }\n\n\n    def test_dashboard_view(self):\n        self._use_single_site_settings()\n        response_200 = self.client.get(self.dashboard_url)\n        # Default URL should not redirect to ^analytics/dashboard/{num}/$\n        self.assertEqual(response_200.status_code, 200)\n\n    def test_dashboard_404_view(self):\n        response_404 = self.client.get(reverse('wagalytics_site_dashboard', args=(999,)))\n        self.assertEqual(response_404.status_code, 404)\n\n    def test_single_site_missing_keys(self):\n        self._clean_wagalytics_keys()\n        response = self.client.get(self.dashboard_url)\n        messages = list(response.context['messages'])\n        self.assertEqual(len(messages), 2)\n        self.assertEqual(messages[0].message, \"You are missing your GA_VIEW_ID setting. Your analytics dashboard won't load without this setting.\")\n        self.assertEqual(messages[1].message, \"You are missing your GA_KEY_FILEPATH or your GA_KEY_CONTENT setting.\")\n\n    def test_single_site_no_siteswitcher(self):\n        \"\"\"Make sure the site switcher does not show up in the dashboard context.\"\"\"\n        self._clean_wagalytics_keys()\n        response = self.client.get(self.dashboard_url)\n        self.assertEqual(response.context['site_switcher'], None)\n\n    def test_single_site_dashboard(self):\n        self._use_single_site_settings()\n        response = self.client.get(self.dashboard_url)\n        messages = list(response.context['messages'])\n        self.assertEqual(len(messages), 0)\n\n    def test_single_site_dashboard_on_multisite_url(self):\n        self._use_single_site_settings()\n        response = self.client.get(reverse('wagalytics_site_dashboard', args=(2,)))\n        self.assertEqual(response.status_code, 200)  # Will still 200.\n\n        messages = list(response.context['messages'])\n        # Should have 1 message\n        self.assertEqual(len(messages), 1)\n        # The one message should be \"You are missing Wagalytics Multisite settings.\"\n        self.assertEqual(messages[0].message, \"You are missing Wagalytics Multisite settings.\")\n\n    def test_multi_site_dashboard(self):\n        self._use_multi_site_settings()\n        wagtail_factories.SiteFactory(hostname=\"example.com\")\n        sites = Site.objects.all()\n        # There should be 2 Wagtail Sites.\n        self.assertEqual(len(sites), 2)\n\n        # Go to ^analytics/dashboard/{num}/$. Should redirect.\n        response = self.client.get(self.dashboard_url)\n        self.assertEqual(response.status_code, 302)  # Redirect\n        # Went to /dashboard/2/ by default\n        self.assertEqual(response.url, reverse('wagalytics_site_dashboard', args=(2,)))\n\n    def test_multi_site_siteswitcher(self):\n        self._use_multi_site_settings()\n        wagtail_factories.SiteFactory(hostname=\"example.com\")\n\n        response = self.client.get(reverse('wagalytics_site_dashboard', args=(2,)))\n        self.assertNotEqual(response.context['site_switcher'], None)\n\n    def test_multi_site_dashboard_change_site(self):\n        self._use_multi_site_settings()\n        wagtail_factories.SiteFactory(hostname=\"example.com\")\n        site = Site.objects.last()\n\n        response = self.client.get(reverse('wagalytics_site_dashboard', args=(site.id,)))\n        self.assertEqual(response.status_code, 200)\n\n    def test_multi_site_token_no_api_keys(self):\n        \"\"\"Test the ^analytics/token/2/$ url. There will always be an id of 2 available.\"\"\"\n        self._clean_wagalytics_keys()\n        url = reverse('wagalytics_site_token', args=(2,))\n        response = self.client.get(url)\n        self.assertEqual(response.status_code, 403)\n\n    def test_single_site_token_no_api_keys(self):\n        \"\"\"Test the ^analytics/token/$ url. \"\"\"\n        self._clean_wagalytics_keys()\n        url = reverse('wagalytics_token')\n        response = self.client.get(url)\n        self.assertEqual(response.status_code, 403)\n\n    def test_multi_site_token_using_single_site_api_keys(self):\n        self._use_single_site_settings()\n        url = reverse('wagalytics_site_token', args=(2,))\n        response = self.client.get(url)\n        self.assertEqual(response.status_code, 200)\n\n    def test_multi_site_token_using_multi_site_api_keys(self):\n        self._use_multi_site_settings()\n        url = reverse('wagalytics_site_token', args=(2,))\n        response = self.client.get(url)\n        self.assertEqual(response.status_code, 200)\n"
  },
  {
    "path": "wagalytics/urls.py",
    "content": "from __future__ import absolute_import, unicode_literals\nfrom django.urls import path\nfrom django.views.decorators.cache import cache_page\n\nfrom .views import dashboard, token, export\n\nurlpatterns = [\n    path('dashboard/', dashboard, name='wagalytics_dashboard'),\n    path('dashboard/<int:site_id>/', dashboard, name='wagalytics_site_dashboard'),\n    path('token/', token, name='wagalytics_token'),\n    path('token/<int:site_id>/', cache_page(3600)(token), name='wagalytics_site_token'),\n    path('export/', export, name='wagalytics_export'),\n]\n"
  },
  {
    "path": "wagalytics/views.py",
    "content": "import json\nimport datetime\nfrom io import BytesIO\nfrom oauth2client.service_account import ServiceAccountCredentials\nfrom django.shortcuts import redirect, render, get_object_or_404\nfrom django.conf import settings\nfrom django.contrib import messages\nfrom django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden\nfrom django.utils import timezone\nfrom django.urls import reverse\nfrom collections import OrderedDict\nfrom pyexcel_ods import save_data\n\nfrom wagtail.contrib.settings.forms import SiteSwitchForm as SettingsSiteSwitchForm\nfrom wagtail.core.models import Site\n\n\nclass SiteSwitchForm(SettingsSiteSwitchForm):\n    \"\"\"Overwrite the get_change_url() method from SiteSwitchForm.\"\"\"\n\n    @classmethod\n    def get_change_url(cls, site, model):\n        \"\"\"Change the url based on the Site.\"\"\"\n        return reverse('wagalytics_site_dashboard', args=[site.pk])\n\n\ndef get_access_token(ga_key_filepath):\n    \"\"\"Get the access token for Google Analytics.\n\n    from https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/\n    Defines a method to get an access token from the credentials object.\n    The access token is automatically refreshed if it has expired.\n    \"\"\"\n\n    # The scope for the OAuth2 request.\n    SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'\n\n    # Construct a credentials objects from the key data and OAuth2 scope.\n    _credentials = ServiceAccountCredentials.from_json_keyfile_name(\n        ga_key_filepath, SCOPE)\n\n    return _credentials.get_access_token().access_token\n\n\ndef get_access_token_from_str(ga_key_content):\n    \"\"\"Get the access token from a string.\n\n    from https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/\n    Defines a method to get an access token from the credentials object.\n    The access token is automatically refreshed if it has expired.\n    \"\"\"\n\n    # The scope for the OAuth2 request.\n    SCOPE = 'https://www.googleapis.com/auth/analytics.readonly'\n\n    # Construct a credentials objects from the key data and OAuth2 scope.\n    keyDict = json.loads(ga_key_content.replace('\\n', '').replace('\\r', ''))\n    _credentials = ServiceAccountCredentials.from_json_keyfile_dict(\n        keyDict, SCOPE)\n\n    return _credentials.get_access_token().access_token\n\n\ndef token(request, site_id=None):\n    \"\"\"Generate the token.\n\n    Will detect Wagalyics Multisite settings.\n    Defaults to single-site settings.\n    \"\"\"\n\n    if hasattr(settings, 'WAGALYTICS_SETTINGS'):\n        if site_id is None:\n            site_id = Site.find_for_request(request).id\n\n        wagalytics_settings = settings.WAGALYTICS_SETTINGS[site_id]\n\n        if wagalytics_settings.get('GA_KEY_CONTENT', None):\n            access_token = get_access_token_from_str(wagalytics_settings['GA_KEY_CONTENT'])\n        elif wagalytics_settings.get('GA_KEY_FILEPATH', None):\n            access_token = get_access_token(wagalytics_settings['GA_KEY_FILEPATH'])\n        else:\n            return HttpResponseForbidden()\n    else:\n        if (hasattr(settings, 'GA_KEY_CONTENT') and settings.GA_KEY_CONTENT != ''):\n            access_token = get_access_token_from_str(settings.GA_KEY_CONTENT)\n        elif (hasattr(settings, 'GA_KEY_FILEPATH') and settings.GA_KEY_FILEPATH != ''):\n            access_token = get_access_token(settings.GA_KEY_FILEPATH)\n        else:\n            return HttpResponseForbidden()\n\n    return HttpResponse(access_token)\n\n\ndef dashboard(request, site_id=None):\n    \"\"\"Display the Wagalytics Dashboard.\n\n    If a site_id is provided, the dashboard will display an instance of a multi site.\n    \"\"\"\n    # If there is no site_id provided in the URL but WAGALYTICS_SETTINGS have been set,\n    # Redirect the viewer to the site main site.\n    # Default redirect will be to the current site they are. ie. ^analytics/dashboard/2/$\n    if not site_id and (hasattr(settings, 'WAGALYTICS_SETTINGS') and len(settings.WAGALYTICS_SETTINGS) > 0):\n        # This site has multi-site wagalytics enabled.\n        # Redirect user to ^analytics/dashboard/{site_id}/$\n        return redirect('wagalytics_site_dashboard', site_id=Site.find_for_request(request).id)\n\n    initial_start_date = (timezone.now() - datetime.timedelta(days=30)).strftime(\"%Y-%m-%d\")\n    ga_view_id = None\n\n    if site_id:\n        # Multisite analytics URL is being used.\n        # The URL being used looks something like this: ^/analytics/dashboard/2/$\n\n        # Look for the site object, or 404.\n        site = get_object_or_404(Site, id=site_id)\n\n        # Check for wagtail.contrib.settings app. Without it, the SiteSwitcher is not available.\n        if 'wagtail.contrib.settings' not in settings.INSTALLED_APPS:\n            display_message = \"You must enable the Wagtail Site Settings app for \" \\\n                              \"Multisite Wagalytics to work properly.\"\n            messages.error(request, display_message)\n\n        # Check for WAGALYTICS_SETTINGS\n        if not hasattr(settings, 'WAGALYTICS_SETTINGS'):\n            # Has no WAGALYTICS_SETTINGS at all\n            messages.error(request, \"You are missing Wagalytics Multisite settings.\")\n        elif not settings.WAGALYTICS_SETTINGS[site.id]:\n            # Has WAGALYTICS_SETTINGS but doesn't have settings for this specific site.\n            display_message = \"You have Wagalytics Multisite settings, but not \" \\\n                              \"for this site. Please add your settings for this site.\"\n            messages.error(request, display_message)\n        else:\n            # Has WAGALYTICS_SETTINGS for this specific site.\n            # Assign WAGALYTICS_SETTINGS[site_id]['GA_VIEW_ID] to ga_view_id for local use\n            ga_view_id = settings.WAGALYTICS_SETTINGS[site.id]['GA_VIEW_ID']\n    else:\n        # The regular ^analytics/dashboard/$ url is being viewed.\n        site = Site.objects.get(hostname=Site.find_for_request(request).hostname)\n        try:\n            ga_view_id = settings.GA_VIEW_ID\n        except AttributeError:\n            display_message = \"You are missing your GA_VIEW_ID setting. Your \" \\\n                              \"analytics dashboard won't load without this setting.\"\n            messages.error(request, display_message)\n\n        if not hasattr(settings, 'GA_KEY_FILEPATH') and not hasattr(settings, 'GA_KEY_CONTENT'):\n            display_message = \"You are missing your GA_KEY_FILEPATH or your \"\\\n                              \"GA_KEY_CONTENT setting.\"\n            messages.error(request, display_message)\n\n    # Check if a SiteSwitcher is required and add it. Otherwise return None.\n    # SiteSwitcher is disabled by default.\n    site_switcher = None\n    if Site.objects.count() > 1 and hasattr(settings, 'WAGALYTICS_SETTINGS'):\n        site_switcher = SiteSwitchForm(site, Site)\n\n    return render(request, 'wagalytics/dashboard.html', {\n        'ga_view_id': ga_view_id,\n        'initial_start_date': initial_start_date,\n        'site_switcher': site_switcher,\n        'site_id': site.id,\n    })\n\n\ndef export(request):\n    \"\"\"Export the data in the current view.\"\"\"\n    # Get JSON string posted to `data`\n    raw_data = request.POST.get('data')\n\n    # Reject a request without data\n    if not raw_data:\n        return HttpResponseBadRequest()\n\n    # Convert JSON to a Python dict\n    data = json.loads(raw_data)\n\n    # Clean up session data\n    for n in data[\"sessions\"]:\n        # Convert dates into datetime.date objects\n        n[0] = datetime.datetime.strptime(n[0], '%Y%m%d').strftime(\"%Y-%m-%d\")\n        # Convert session counts into integers\n        n[2] = int(n[2])\n        # Second key is just the index, which isn't needed\n        del n[1]\n\n    # Clean up referrers data\n    for n in data[\"referrers\"]:\n        # Convert counts into integers\n        n[1] = int(n[1])\n\n    # Format spreadsheet file\n    ods = OrderedDict()\n    ods[\"Sessions\"] = [[\"Date\", \"Sessions\"]] + data[\"sessions\"]\n    ods[\"Popular Content\"] = [[\"Page URL\", \"Views\"]] + data[\"pages\"]\n    ods[\"Top Referrers\"] = [[\"Source\", \"Views\"]] + data[\"referrers\"]\n\n    # Save the spreadsheet into memory\n    io = BytesIO()\n    save_data(io, ods)\n\n    # Set response metadata\n    response = HttpResponse(content_type='application/vnd.oasis.opendocument.spreadsheet')\n    response['Content-Disposition'] = 'attachment; filename=\"wagalytics.ods\"'\n\n    # Write spreadsheet into response\n    response.write(io.getvalue())\n    return response\n"
  },
  {
    "path": "wagalytics/wagtail_hooks.py",
    "content": "from django.utils.translation import ugettext_lazy as _\n\ntry:\n    from wagtail.core import hooks\n    from wagtail.admin.menu import MenuItem\nexcept ImportError:  # fallback for Wagtail <2.0\n    from wagtail.wagtailcore import hooks\n    from wagtail.wagtailadmin.menu import MenuItem\n\ntry:\n    from django.urls import re_path, include\nexcept ImportError:  # fallback for Django <2.0\n    from django.conf.urls import url as re_path\n    from django.conf.urls import include\n\ntry:\n    from django.urls import reverse\nexcept ImportError:  # fallback for Django <1.9\n    from django.core.urlresolvers import reverse\n\nfrom . import urls\nfrom . import views\n\n\n@hooks.register('register_admin_urls')\ndef register_admin_urls():\n    return [\n        re_path(r'^analytics/', include(urls)),\n    ]\n\n@hooks.register('register_admin_menu_item')\ndef register_styleguide_menu_item():\n    return MenuItem(\n        _('Analytics'),\n        reverse('wagalytics_dashboard'),\n        classnames='icon icon-fa-bar-chart',\n        order=1000\n    )\n"
  }
]